feat(admin): add Package Registry settings UI section
Adds a registry URL field to Admin > Settings so admins can configure an external package registry without touching env vars or the API directly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -36,6 +36,7 @@ export default function SettingsSection() {
|
|||||||
message_variant: cfg_.message?.variant || 'info',
|
message_variant: cfg_.message?.variant || 'info',
|
||||||
footer_enabled: !!cfg_.footer?.enabled,
|
footer_enabled: !!cfg_.footer?.enabled,
|
||||||
footer_text: cfg_.footer?.text || '',
|
footer_text: cfg_.footer?.text || '',
|
||||||
|
package_registry_url: cfg_.package_registry?.url || '',
|
||||||
});
|
});
|
||||||
setVault(v);
|
setVault(v);
|
||||||
} catch (e) { sw.toast(e.message, 'error'); }
|
} catch (e) { sw.toast(e.message, 'error'); }
|
||||||
@@ -78,6 +79,9 @@ export default function SettingsSection() {
|
|||||||
text: cfg.footer_text,
|
text: cfg.footer_text,
|
||||||
}});
|
}});
|
||||||
|
|
||||||
|
// Package Registry
|
||||||
|
await sw.api.admin.settings.update('package_registry', { value: { url: cfg.package_registry_url } });
|
||||||
|
|
||||||
sw.toast('Settings saved', 'success');
|
sw.toast('Settings saved', 'success');
|
||||||
} catch (e) { sw.toast(e.message, 'error'); }
|
} catch (e) { sw.toast(e.message, 'error'); }
|
||||||
finally { setSaving(false); }
|
finally { setSaving(false); }
|
||||||
@@ -166,6 +170,13 @@ export default function SettingsSection() {
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="settings-section"><h3>Package Registry</h3>
|
||||||
|
<div class="form-group"><label>Registry URL</label>
|
||||||
|
<input value=${cfg.package_registry_url} onInput=${e => set('package_registry_url', e.target.value)} placeholder="https://registry.example.com/registry.json" />
|
||||||
|
</div>
|
||||||
|
<span class="text-muted" style="font-size:12px;">URL to a JSON registry index. Enables browsing and one-click install under Packages > Registry.</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="settings-section"><h3>Email</h3>
|
<div class="settings-section"><h3>Email</h3>
|
||||||
<button class="btn-small" onClick=${testEmail}>Send Test Email</button>
|
<button class="btn-small" onClick=${testEmail}>Send Test Email</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user