diff --git a/frontend/src/routes/(root)/(logged)/user/(user)/instance_settings/+page.svelte b/frontend/src/routes/(root)/(logged)/user/(user)/instance_settings/+page.svelte index 07b821fe04..b5481f17fe 100644 --- a/frontend/src/routes/(root)/(logged)/user/(user)/instance_settings/+page.svelte +++ b/frontend/src/routes/(root)/(logged)/user/(user)/instance_settings/+page.svelte @@ -33,20 +33,35 @@ const wizardStepLabels = [...settingsSteps.map((s) => s.label), 'Root login & Resource Types'] + const fullStepLabels = ['Settings', 'Root login & Resource Types'] + const initialMode = $page.url.searchParams.get('mode') === 'full' ? 'full' : 'wizard' const initialStep = Math.max( 0, Math.min(parseInt($page.url.searchParams.get('step') ?? '0') || 0, wizardStepLabels.length - 1) ) + const initialFullStep = + initialMode === 'full' + ? Math.max( + 0, + Math.min( + parseInt($page.url.searchParams.get('step') ?? '0') || 0, + fullStepLabels.length - 1 + ) + ) + : 0 let mode: 'wizard' | 'full' = $state(initialMode) let wizardStep = $state(initialStep) + let fullStep = $state(initialFullStep) $effect(() => { const url = new URL(window.location.href) if (mode === 'wizard') { url.searchParams.set('step', String(wizardStep)) + url.searchParams.delete('mode') } else { - url.searchParams.delete('step') + url.searchParams.set('step', String(fullStep)) + url.searchParams.set('mode', 'full') } history.replaceState(history.state, '', url) }) @@ -92,7 +107,10 @@ } $effect(() => { - if (!isSettingsStep(wizardStep) && rtSyncStatus === 'idle') { + if ( + rtSyncStatus === 'idle' && + ((mode === 'wizard' && !isSettingsStep(wizardStep)) || (mode === 'full' && fullStep === 1)) + ) { syncCachedResourceTypes() } }) @@ -183,7 +201,9 @@ /** Check if we need to warn about missing EE license key before proceeding */ function proceedFromCore(callback: () => void) { - if (wizardStep === 0 && isEeImage() && isLicenseKeyEmpty()) { + const leavingSettings = + (mode === 'wizard' && wizardStep === 0) || (mode === 'full' && fullStep === 0) + if (leavingSettings && isEeImage() && isLicenseKeyEmpty()) { pendingNextCallback = callback showLicenseKeyWarning = true return @@ -215,6 +235,7 @@ function switchToWizardMode() { yamlMode = false + fullStep = 0 mode = 'wizard' } @@ -302,6 +323,100 @@ } +{#snippet accountSetupContent()} + + +
+ +
+
+ Email + 0 && !emailValid ? 'Must be a valid email' : undefined} + size="md" + /> + {#if $superadmin} +

Current email: {$superadmin}

+ {/if} +
+
+ Password + 0 && !passwordValid + ? 'Must be at least 2 characters' + : undefined} + size="md" + /> +
+
+
+ + +
+ {#if rtSyncStatus === 'loading'} + + {:else if rtSyncStatus === 'success'} + + {rtSyncMessage} + + {:else if rtSyncStatus === 'error'} + + {rtSyncMessage} + + {/if} + +
+ +

+ Fetches the latest resource types directly from the Windmill Hub (requires internet + access). +

+
+ {#if hubSyncStatus === 'success'} + + {hubSyncMessage} + + {:else if hubSyncStatus === 'error'} + + {hubSyncMessage} + + {/if} + +

+ The daily schedule synchronizes resource types from the Hub every day at midnight UTC. +

+
+
+ + {#if accountError} + + {accountError} + + {/if} +
+{/snippet} +
{#if mode === 'wizard'} @@ -339,136 +454,69 @@ /> {/key} {:else} - - - -
- -
-
- Email - 0 && !emailValid ? 'Must be a valid email' : undefined} - size="md" - /> - {#if $superadmin} -

Current email: {$superadmin}

- {/if} -
-
- Password - 0 && !passwordValid - ? 'Must be at least 2 characters' - : undefined} - size="md" - /> -
-
-
- - -
- {#if rtSyncStatus === 'loading'} - - {:else if rtSyncStatus === 'success'} - - {rtSyncMessage} - - {:else if rtSyncStatus === 'error'} - - {rtSyncMessage} - - {/if} - -
- -

- Fetches the latest resource types directly from the Windmill Hub (requires - internet access). -

-
- {#if hubSyncStatus === 'success'} - - {hubSyncMessage} - - {:else if hubSyncStatus === 'error'} - - {hubSyncMessage} - - {/if} - -

- The daily schedule synchronizes resource types from the Hub every day at midnight - UTC. -

-
-
- - {#if accountError} - - {accountError} - - {/if} -
+ {@render accountSetupContent()} {/if}
{:else} - -
- + +
+ { + if (i < fullStep) { + saveAndProceed(() => { + yamlMode = false + fullStep = i + }) + } + }} + > + {#snippet separator()} + + {/snippet} + + {#if fullStep === 0} + + {/if}
- -
- {#if !yamlMode} -
- - + {#if fullStep === 0} +
+ {#if !yamlMode} +
+ + +
+ {/if} + +
+ { + const targetTab = categoryToTabMap[category] + if (targetTab) { + handleNavigate(targetTab) + } + }} />
- {/if} - -
- { - const targetTab = categoryToTabMap[category] - if (targetTab) { - handleNavigate(targetTab) - } - }} - />
-
+ {:else} +
+ {@render accountSetupContent()} +
+ {/if} {/if} @@ -517,7 +565,7 @@ {/if}
- {:else} + {:else if fullStep === 0} + Continue + + {:else} + + {/if}