mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-24 16:01:42 +00:00
promote license key to second field in setup wizard and warn on EE (#8001)
* feat: promote license key to second field in setup wizard and warn on EE without key Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: remove screenshots from PR branch Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: use positive EE check with startsWith instead of negative CE check Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: claude-agent <claude-agent@noreply>
This commit is contained in:
@@ -57,6 +57,14 @@
|
||||
let version: string = $state('')
|
||||
let loading = $state(true)
|
||||
|
||||
export function getVersion(): string {
|
||||
return version
|
||||
}
|
||||
|
||||
export function getLicenseKey(): string {
|
||||
return $values?.['license_key'] ?? ''
|
||||
}
|
||||
|
||||
loadSettings()
|
||||
loadVersion()
|
||||
|
||||
@@ -1021,12 +1029,24 @@
|
||||
warning={setting.key === 'base_url' && baseUrlIsFallback ? 'Auto-detected from browser — not yet saved' : undefined}
|
||||
/>
|
||||
{/if}
|
||||
{#if quickSetup && category === 'Core' && setting.key === 'base_url'}
|
||||
{@const licenseKeySetting = settings['Core'].find((s) => s.key === 'license_key')}
|
||||
{#if licenseKeySetting}
|
||||
<InstanceSetting
|
||||
{openSmtpSettings}
|
||||
on:closeDrawer={() => closeDrawer?.()}
|
||||
{loading}
|
||||
setting={licenseKeySetting}
|
||||
{values}
|
||||
{version}
|
||||
{oauths}
|
||||
/>
|
||||
{/if}
|
||||
{/if}
|
||||
{/each}
|
||||
{#if quickSetup && category === 'Core'}
|
||||
{@const licenseKeySetting = settings['Core'].find((s) => s.key === 'license_key')}
|
||||
{@const extraSettings = [
|
||||
...settings['Jobs'].filter((s) => s.key === 'job_isolation'),
|
||||
...(licenseKeySetting ? [licenseKeySetting] : []),
|
||||
...settings['Jobs'].filter((s) => s.key === 'retention_period_secs'),
|
||||
...(settings['Object Storage']?.filter((s) => s.key === 'object_store_cache_config') ??
|
||||
[])
|
||||
|
||||
@@ -116,6 +116,20 @@
|
||||
let passwordValid = $derived(newPassword.length >= 2)
|
||||
let accountFormValid = $derived(emailValid && passwordValid)
|
||||
|
||||
// --- EE license key warning ---
|
||||
let showLicenseKeyWarning = $state(false)
|
||||
let pendingNextCallback: (() => void) | undefined = $state(undefined)
|
||||
|
||||
function isEeImage(): boolean {
|
||||
const v = instanceSettings?.getVersion() ?? ''
|
||||
return v.startsWith('EE')
|
||||
}
|
||||
|
||||
function isLicenseKeyEmpty(): boolean {
|
||||
const key = instanceSettings?.getLicenseKey() ?? ''
|
||||
return key.trim() === ''
|
||||
}
|
||||
|
||||
// --- Full settings mode state ---
|
||||
let fullTab = $state('general')
|
||||
let instanceSettingsCategory = $derived(tabToCategoryMap[fullTab] ?? 'Core')
|
||||
@@ -139,6 +153,16 @@
|
||||
|
||||
|
||||
|
||||
/** Check if we need to warn about missing EE license key before proceeding */
|
||||
function proceedFromCore(callback: () => void) {
|
||||
if (wizardStep === 0 && isEeImage() && isLicenseKeyEmpty()) {
|
||||
pendingNextCallback = callback
|
||||
showLicenseKeyWarning = true
|
||||
return
|
||||
}
|
||||
saveAndProceed(callback)
|
||||
}
|
||||
|
||||
/** Auto-save dirty settings, then run the callback */
|
||||
async function saveAndProceed(callback: () => void) {
|
||||
if (yamlMode) {
|
||||
@@ -454,7 +478,7 @@
|
||||
<Button
|
||||
variant="accent"
|
||||
unifiedSize="md"
|
||||
onClick={() => saveAndProceed(() => (wizardStep += 1))}
|
||||
onClick={() => proceedFromCore(() => (wizardStep += 1))}
|
||||
>
|
||||
{currentStepDirty ? 'Save & Next' : 'Next'}
|
||||
</Button>
|
||||
@@ -522,3 +546,27 @@
|
||||
</div>
|
||||
</ConfirmationModal>
|
||||
{/if}
|
||||
|
||||
{#if showLicenseKeyWarning}
|
||||
<ConfirmationModal
|
||||
open={showLicenseKeyWarning}
|
||||
title="License key required"
|
||||
confirmationText="Continue without license key"
|
||||
on:canceled={() => {
|
||||
showLicenseKeyWarning = false
|
||||
pendingNextCallback = undefined
|
||||
}}
|
||||
on:confirmed={() => {
|
||||
showLicenseKeyWarning = false
|
||||
const cb = pendingNextCallback
|
||||
pendingNextCallback = undefined
|
||||
if (cb) saveAndProceed(cb)
|
||||
}}
|
||||
>
|
||||
<div class="flex flex-col w-full space-y-4">
|
||||
<span>
|
||||
You are running the Enterprise Edition image but have not entered a license key. A valid license key is required to use EE features. Are you sure you want to continue without one?
|
||||
</span>
|
||||
</div>
|
||||
</ConfirmationModal>
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user