librelad cfdd39386c feat(admin): move Peers into Admin/Tools; lift System next to Overview
Two related UI tidies — both removing surface area from the topbar / Tools
group rather than adding new pages.

Peers → /admin/tools/peers
  Was a top-level /peers route with its own topbar nav item, which doubled
  the navigation surface for what's really an admin tool (same shape as
  SSH Access). Now lives under the Admin sidebar's Tools group alongside
  SSH Access. /peers is kept as a legacy redirect → /admin/tools/peers.

  Plumbing:
  - config-sidebar.js gains a Peers entry under the Tools label.
  - config-manager.js gains a 'peers' branch that fetches
    peers-content.html into config-section, then inits PeersPage.
  - window.adminPath() learns 'peers' → /admin/tools/peers.
  - spa.js handlePeers() is now a redirect (mirrors handleSsh).
  - topbar.html drops the Peers nav item.
  - peers-content.html slimmed to a config-section template (no
    standalone page wrapper) so it embeds cleanly under the admin shell.
  - PeersPage gains a rootId constructor arg for symmetry with SshPage
    (queries still work globally — IDs are unique).

System lifted out of the Tools group
  User feedback: 'overview/system are kinda like, the same thing'. Moved
  System to sit right under Overview at the top of the sidebar, before
  the 'Config' label. Both surfaces are admin-landing pages (Overview =
  ops/health summary, System = live host + per-app stats) — distinct from
  config form pages or the Tools utilities.

  config-sidebar.js: System block moved to the top section (right after
  Overview's click handler). Original Tools-group instance removed.

Signed-off-by: librelad <librelad@digitalangels.vip>
2026-05-26 20:16:45 +01:00

105 lines
4.4 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div class="peers-page">
<div class="page-header config-page-header">
<div class="page-header-title">
<div class="admin-breadcrumb">Tools</div>
<h1>Peers</h1>
<p>Named references to other LibrePortal instances. Use them in the Migrate tab to pull apps across without typing hostnames.</p>
</div>
<div class="page-header-actions">
<button class="backup-refresh-btn" id="peers-refresh-btn" title="Refresh">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polyline points="23 4 23 10 17 10"></polyline>
<path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"></path>
</svg>
Refresh
</button>
<button class="backup-secondary-btn" id="peers-token-btn" title="Show this host's pairing token">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<rect x="3" y="11" width="18" height="11" rx="2"></rect>
<path d="M7 11V7a5 5 0 0110 0v4"></path>
</svg>
Show my token
</button>
<button class="backup-secondary-btn" id="peers-pair-btn" title="Paste a token from another LibrePortal">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M10 13a5 5 0 007.54.54l3-3a5 5 0 00-7.07-7.07L11.5 5.45"></path>
<path d="M14 11a5 5 0 00-7.54-.54l-3 3a5 5 0 007.07 7.07L12.5 18.55"></path>
</svg>
Pair with token
</button>
<button class="backup-primary-btn" id="peers-add-btn">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="12" y1="5" x2="12" y2="19"></line>
<line x1="5" y1="12" x2="19" y2="12"></line>
</svg>
Add backup-channel peer
</button>
</div>
</div>
<div class="peers-empty" id="peers-empty" hidden style="padding:24px; text-align:center; opacity:.75">
<p>No peers yet.</p>
<p class="backup-card-hint">
Add one to give a memorable name to another LibrePortal you share a backup location with.
Or use <strong>Show my token</strong> / <strong>Pair with token</strong> for direct-SSH peers.
</p>
</div>
<div class="peers-list" id="peers-list" style="padding-top:8px"></div>
</div>
<div class="backup-modal" id="peers-add-modal">
<div class="backup-modal-inner">
<div class="backup-modal-header">
<h3>Add a peer</h3>
<button class="backup-modal-close" data-close-modal>×</button>
</div>
<div class="backup-modal-body" id="peers-add-modal-body"></div>
<div class="backup-modal-footer">
<button class="backup-secondary-btn" data-close-modal>Cancel</button>
<button class="backup-primary-btn" id="peers-add-confirm">Add peer</button>
</div>
</div>
</div>
<div class="backup-modal" id="peers-token-modal">
<div class="backup-modal-inner backup-modal-wide">
<div class="backup-modal-header">
<h3>This host's pairing token</h3>
<button class="backup-modal-close" data-close-modal>×</button>
</div>
<div class="backup-modal-body" id="peers-token-modal-body"></div>
<div class="backup-modal-footer">
<button class="backup-secondary-btn" data-close-modal>Done</button>
</div>
</div>
</div>
<div class="backup-modal" id="peers-pair-modal">
<div class="backup-modal-inner backup-modal-wide">
<div class="backup-modal-header">
<h3>Pair with another LibrePortal</h3>
<button class="backup-modal-close" data-close-modal>×</button>
</div>
<div class="backup-modal-body" id="peers-pair-modal-body"></div>
<div class="backup-modal-footer">
<button class="backup-secondary-btn" data-close-modal>Cancel</button>
<button class="backup-primary-btn" id="peers-pair-confirm">Accept token</button>
</div>
</div>
</div>
<div class="backup-modal" id="peers-pull-modal">
<div class="backup-modal-inner">
<div class="backup-modal-header">
<h3>Pull app from peer</h3>
<button class="backup-modal-close" data-close-modal>×</button>
</div>
<div class="backup-modal-body" id="peers-pull-modal-body"></div>
<div class="backup-modal-footer">
<button class="backup-secondary-btn" data-close-modal>Cancel</button>
<button class="backup-primary-btn" id="peers-pull-confirm">Pull app</button>
</div>
</div>
</div>