200 lines
8.6 KiB
Plaintext
200 lines
8.6 KiB
Plaintext
<%- include("partials/layout-top", { title }) %>
|
|
<section class="card">
|
|
<%- include("partials/page-header", {
|
|
eyebrow: "Administration",
|
|
pageTitle: "Settings",
|
|
description: "Manage core behavior, updates, and platform integrations."
|
|
}) %>
|
|
<form method="post" action="/admin/settings" class="form-grid" data-lumi-settings-form>
|
|
<div class="field">
|
|
<label>Site title</label>
|
|
<input name="site_title" value="<%= settings.site_title || '' %>" />
|
|
</div>
|
|
<div class="field">
|
|
<label>Command prefix</label>
|
|
<input name="command_prefix" value="<%= settings.command_prefix || '!' %>" />
|
|
</div>
|
|
<div class="field">
|
|
<label>Auto update enabled</label>
|
|
<label class="switch">
|
|
<input
|
|
type="checkbox"
|
|
class="switch-input"
|
|
name="auto_update_enabled"
|
|
<%= settings.auto_update_enabled ? 'checked' : '' %>
|
|
/>
|
|
<span class="switch-track" aria-hidden="true"></span>
|
|
<span class="switch-text"><%= settings.auto_update_enabled ? 'Enabled' : 'Disabled' %></span>
|
|
</label>
|
|
</div>
|
|
<div class="field">
|
|
<label>Auto update interval (minutes)</label>
|
|
<input name="auto_update_interval_minutes" value="<%= settings.auto_update_interval_minutes || 60 %>" />
|
|
</div>
|
|
<div class="field">
|
|
<label>Git remote</label>
|
|
<input name="git_remote" value="<%= settings.git_remote || 'origin' %>" />
|
|
</div>
|
|
<div class="field">
|
|
<label>Git branch</label>
|
|
<input name="git_branch" value="<%= settings.git_branch || 'main' %>" />
|
|
</div>
|
|
<div class="field full">
|
|
<div class="inline-actions">
|
|
<%- include("partials/state-button", {
|
|
type: "submit",
|
|
states: [
|
|
{ id: "idle", text: "Save settings" },
|
|
{ id: "loading", text: "Saving", spinner: true },
|
|
{ id: "success", text: "Saved" }
|
|
]
|
|
}) %>
|
|
<%- include("partials/state-button", {
|
|
type: "submit",
|
|
classes: "subtle",
|
|
attrs: "formaction=\"/admin/check-update\" formmethod=\"post\"",
|
|
states: [
|
|
{ id: "idle", text: "Check for updates" },
|
|
{ id: "loading", text: "Checking", spinner: true },
|
|
{ id: "success", text: "Checked" }
|
|
]
|
|
}) %>
|
|
<%- include("partials/state-button", {
|
|
type: "submit",
|
|
classes: "subtle",
|
|
attrs: "formaction=\"/admin/update\" formmethod=\"post\" data-confirm-mode=\"modal\" data-confirm-title=\"Update from git\" data-confirm-text=\"Pull updates from the configured remote and branch, then restart Lumi if the update succeeds.\" data-confirm-label=\"Update from git\"",
|
|
states: [
|
|
{ id: "idle", text: "Update from git" },
|
|
{ id: "loading", text: "Updating", spinner: true },
|
|
{ id: "success", text: "Updated" }
|
|
]
|
|
}) %>
|
|
</div>
|
|
<p class="hint">Git update checks use the configured remote and branch.</p>
|
|
</div>
|
|
|
|
<div class="field full">
|
|
<h2>Platform Integration</h2>
|
|
<p class="hint">Enable or disable platform adapters and run the setup wizards.</p>
|
|
<div class="platform-grid">
|
|
<% (platforms || []).forEach((platform) => { %>
|
|
<div class="platform-card">
|
|
<div class="platform-card-header">
|
|
<strong><%= platform.label %></strong>
|
|
<% if (!platform.supported) { %>
|
|
<span class="level-pill">Coming soon</span>
|
|
<% } %>
|
|
</div>
|
|
<label class="platform-toggle-row switch">
|
|
<input
|
|
type="checkbox"
|
|
class="switch-input"
|
|
name="<%= platform.enabledKey %>"
|
|
<%= platform.enabled ? 'checked' : '' %>
|
|
<%= platform.supported ? '' : 'disabled' %>
|
|
/>
|
|
<span class="switch-track" aria-hidden="true"></span>
|
|
<span class="switch-text"><%= platform.enabled ? 'Enabled' : 'Disabled' %></span>
|
|
</label>
|
|
<% if (platform.supported) { %>
|
|
<div class="platform-meta">
|
|
<a class="link" href="<%= platform.wizardPath %>">Open wizard</a>
|
|
<span class="hint"><%= platform.configured ? 'Configured' : 'Not configured' %></span>
|
|
</div>
|
|
<% } else { %>
|
|
<p class="hint">Support planned for a future update.</p>
|
|
<% } %>
|
|
</div>
|
|
<% }) %>
|
|
</div>
|
|
</div>
|
|
|
|
<% if (localhostLoginAvailable) { %>
|
|
<div class="field full">
|
|
<h2>Localhost Login</h2>
|
|
<p class="hint">Development-only login shown only on localhost. Defaults are admin / admin until changed.</p>
|
|
</div>
|
|
<div class="field">
|
|
<label>Localhost username</label>
|
|
<input name="localhost_login_username" value="<%= settings.localhost_login_username || 'admin' %>" autocomplete="off" />
|
|
</div>
|
|
<div class="field">
|
|
<label>New localhost password</label>
|
|
<input name="localhost_login_password" type="password" placeholder="Leave blank to keep current password" autocomplete="new-password" />
|
|
</div>
|
|
<% } %>
|
|
|
|
<div class="field full">
|
|
<h2>Homepage content</h2>
|
|
<p class="hint">Configure public homepage link buttons and the priority-based dynamic hero without editing raw JSON.</p>
|
|
</div>
|
|
<div class="field full homepage-builder" data-homepage-builder="links">
|
|
<div class="section-header">
|
|
<div>
|
|
<h3>Homepage link buttons</h3>
|
|
<p class="hint">Add public or role-limited links shown as cards on the homepage.</p>
|
|
</div>
|
|
<button type="button" class="button subtle" data-homepage-add="links">Add link</button>
|
|
</div>
|
|
<textarea name="homepage_link_buttons" class="homepage-json-source" rows="8" spellcheck="false"><%= JSON.stringify(settings.homepage_link_buttons || [], null, 2) %></textarea>
|
|
<div class="homepage-builder-list" data-homepage-list="links"></div>
|
|
</div>
|
|
<div class="field full homepage-builder" data-homepage-builder="heroes">
|
|
<div class="section-header">
|
|
<div>
|
|
<h3>Homepage hero entries</h3>
|
|
<p class="hint">The first available enabled hero by priority is shown on the homepage.</p>
|
|
</div>
|
|
<button type="button" class="button subtle" data-homepage-add="heroes">Add hero</button>
|
|
</div>
|
|
<textarea name="homepage_hero_entries" class="homepage-json-source" rows="10" spellcheck="false"><%= JSON.stringify(settings.homepage_hero_entries || [], null, 2) %></textarea>
|
|
<div class="homepage-builder-list" data-homepage-list="heroes"></div>
|
|
<details class="advanced-theme-controls">
|
|
<summary>Advanced JSON</summary>
|
|
<p class="hint">The builder writes JSON into hidden fields before save. Edit only if you need a field the builder does not expose.</p>
|
|
</details>
|
|
</div>
|
|
|
|
<%- include("partials/state-button", {
|
|
type: "submit",
|
|
states: [
|
|
{ id: "idle", text: "Save settings" },
|
|
{ id: "loading", text: "Saving", spinner: true },
|
|
{ id: "success", text: "Saved" }
|
|
]
|
|
}) %>
|
|
</form>
|
|
</section>
|
|
<section class="card">
|
|
<h2>Navigation icons</h2>
|
|
<p class="hint">Upload SVG or PNG icons for sidebar sublinks.</p>
|
|
<div class="nav-icon-grid">
|
|
<% (navIconItems || []).forEach((item) => { %>
|
|
<div class="nav-icon-row">
|
|
<div class="nav-icon-info">
|
|
<img class="nav-icon-preview" src="<%= item.icon %>" alt="" />
|
|
<div>
|
|
<strong><%= item.label %></strong>
|
|
<div class="hint"><%= item.path %></div>
|
|
</div>
|
|
</div>
|
|
<div class="nav-icon-actions">
|
|
<form method="post" action="/admin/settings/nav-icons" enctype="multipart/form-data" class="inline-form">
|
|
<input type="hidden" name="item_id" value="<%= item.id %>" />
|
|
<div class="input-action-row">
|
|
<input type="file" name="icon_file" accept="image/svg+xml,image/png" />
|
|
<button type="submit" class="button subtle">Upload</button>
|
|
</div>
|
|
</form>
|
|
<form method="post" action="/admin/settings/nav-icons/reset" class="inline-form" data-confirm-title="Reset navigation icon" data-confirm-text="Reset the custom icon for <%= item.label %> to its default." data-confirm-label="Reset icon">
|
|
<input type="hidden" name="item_id" value="<%= item.id %>" />
|
|
<button type="submit" class="button subtle">Reset</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<% }) %>
|
|
</div>
|
|
</section>
|
|
<script src="/homepage-builder.js?v=<%= assetVersion %>" defer></script>
|
|
<%- include("partials/layout-bottom") %>
|