Merge claude/1
This commit is contained in:
commit
1a0d5e9a8a
@ -139,6 +139,20 @@ class AdminOverview {
|
|||||||
return `<div class="admin-card-line"><span>${this.escape(label)}</span><strong>${this.escape(value)}</strong></div>`;
|
return `<div class="admin-card-line"><span>${this.escape(label)}</span><strong>${this.escape(value)}</strong></div>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Small inline icon for a card action button. Inherits the button's text
|
||||||
|
// colour (no per-button colour) — the icon + the card's status dot do the
|
||||||
|
// distinguishing, so the footer stays calm.
|
||||||
|
icon(name) {
|
||||||
|
const paths = {
|
||||||
|
update: '<path d="M21 2v6h-6"/><path d="M3 12a9 9 0 0 1 15-6.7L21 8"/><path d="M3 22v-6h6"/><path d="M21 12a9 9 0 0 1-15 6.7L3 16"/>',
|
||||||
|
verify: '<path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/><polyline points="9 12 11 14 15 10"/>',
|
||||||
|
backup: '<rect x="3" y="4" width="18" height="4" rx="1"/><path d="M5 8v11a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V8"/><line x1="10" y1="12" x2="14" y2="12"/>',
|
||||||
|
ssh: '<circle cx="7.5" cy="15.5" r="4.5"/><path d="M10.6 12.4 20 3l1.5 1.5L20 6l1.5 1.5L19 10l-2-2"/>',
|
||||||
|
system: '<polyline points="22 12 18 12 15 21 9 3 6 12 2 12"/>',
|
||||||
|
};
|
||||||
|
return `<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${paths[name] || ''}</svg>`;
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const root = this.root();
|
const root = this.root();
|
||||||
if (!root) return;
|
if (!root) return;
|
||||||
@ -157,8 +171,8 @@ class AdminOverview {
|
|||||||
|
|
||||||
// Update now takes priority when one's available; otherwise offer Verify now.
|
// Update now takes priority when one's available; otherwise offer Verify now.
|
||||||
const updActions = (updAvail && upd.can_update)
|
const updActions = (updAvail && upd.can_update)
|
||||||
? `<button type="button" class="backup-primary-btn" data-admin-update>Update now</button>`
|
? `<button type="button" class="backup-primary-btn" data-admin-update>${this.icon('update')}Update now</button>`
|
||||||
: `<button type="button" class="backup-secondary-btn" data-admin-verify>Verify now</button>`;
|
: `<button type="button" class="backup-secondary-btn" data-admin-verify>${this.icon('verify')}Verify now</button>`;
|
||||||
|
|
||||||
const updCard = this.card(
|
const updCard = this.card(
|
||||||
'Updates',
|
'Updates',
|
||||||
@ -180,7 +194,7 @@ class AdminOverview {
|
|||||||
this.line('Apps protected', `${protectedApps} / ${apps.length}`)
|
this.line('Apps protected', `${protectedApps} / ${apps.length}`)
|
||||||
+ this.line('Locations', String(locs.length))
|
+ this.line('Locations', String(locs.length))
|
||||||
+ this.line('Stored', this.bytes(totalSize)),
|
+ this.line('Stored', this.bytes(totalSize)),
|
||||||
`<button type="button" class="backup-secondary-btn" data-admin-go="backup">Manage backups →</button>`
|
`<button type="button" class="backup-secondary-btn" data-admin-go="backup">${this.icon('backup')}Manage backups →</button>`
|
||||||
);
|
);
|
||||||
|
|
||||||
// SSH & Security
|
// SSH & Security
|
||||||
@ -195,7 +209,7 @@ class AdminOverview {
|
|||||||
this.line('Password login', pwOn ? 'On' : 'Key-only')
|
this.line('Password login', pwOn ? 'On' : 'Key-only')
|
||||||
+ this.line('Authorized keys', String(keyCount))
|
+ this.line('Authorized keys', String(keyCount))
|
||||||
+ this.line('Login user', s.user || '—'),
|
+ this.line('Login user', s.user || '—'),
|
||||||
`<button type="button" class="backup-secondary-btn" data-admin-go="ssh">Manage SSH access →</button>`
|
`<button type="button" class="backup-secondary-btn" data-admin-go="ssh">${this.icon('ssh')}Manage SSH access →</button>`
|
||||||
);
|
);
|
||||||
|
|
||||||
// System health
|
// System health
|
||||||
@ -212,7 +226,7 @@ class AdminOverview {
|
|||||||
? `${this.gb(mem.used)} / ${this.gb(mem.total)} (${Math.round(mem.percent) || 0}%)`
|
? `${this.gb(mem.used)} / ${this.gb(mem.total)} (${Math.round(mem.percent) || 0}%)`
|
||||||
: (mem.text || '—'))
|
: (mem.text || '—'))
|
||||||
+ this.line('Uptime', this.shortUptime(info.uptime)),
|
+ this.line('Uptime', this.shortUptime(info.uptime)),
|
||||||
`<button type="button" class="backup-secondary-btn" data-admin-go="system">View system stats →</button>`
|
`<button type="button" class="backup-secondary-btn" data-admin-go="system">${this.icon('system')}View system stats →</button>`
|
||||||
);
|
);
|
||||||
|
|
||||||
root.innerHTML = `
|
root.innerHTML = `
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user