Skip to content

ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.

feat(ui): share the top-bar tab group across Domains/DNS/SSL

Juan Denis0eab32096b9e
diff --git a/docs/REDESIGN_MAP.md b/docs/REDESIGN_MAP.md
index ac74c3a5..f35dfe82 100644
--- a/docs/REDESIGN_MAP.md
+++ b/docs/REDESIGN_MAP.md
@@ -118,7 +118,7 @@ Effort: S/M/L/XL. Nature: **Restyle** (look only) · **+IA** (layout/tab/route r
| 5 | **Docker** | M | Restyle | `pages/Docker.jsx`, `pages/_docker.scss` | KPI tiles | none (strict subset of current) | **✅ pass 1 done** — added `MetricCard` KPI strip (Containers/Images/Volumes/Networks from existing `stats`) atop `dx-main`, restyled status filter → segmented control. KEPT the richer dx- rail/5-tabs/inspector/exec/multi-server. Deferred: per-container accent dot, Projects KPI, logs modal→drawer. |
| 6 | **Database Explorer** | M | Restyle | `pages/Databases.jsx`, `databases/ConsoleTab.jsx`, `SourceTree.jsx`, `ResultsGrid.jsx`, `pages/_databases.scss` | syntax-highlight/gutter editor wrapper | optional "Export as SQL" dump | **✅ pass 1 done** — page already matched the target shell (token-aligned in Phase 0); added engine status-dot glow, green result count, `UTF-8` + `● Connected` status-bar segments. Deferred: syntax-highlight editor + gutter, `+` new-tab pill, ctx-menu Browse-rows/Export-SQL, semantic cell tints. |
| 7 | **File Manager** | M | Restyle+IA | `pages/FileManager.jsx`, `file-manager/FolderTree.jsx`, `PreviewDrawer.jsx`, `ContextMenu.jsx`, `pages/_file-manager.scss` | `file-manager/highlight.js` | cloud/S3 sources = **out of scope** |
-| 8 | **Domains** | L | Restyle+IA+BE | `pages/Domains.jsx`, `pages/_domains.scss` | DomainDrawer (SSL/registration/DNSSEC/NS + inline DNS records) | registrar, registration-expiry, DNSSEC, nameservers, registration auto-renew, status (WHOIS) | **✅ migrated (first top-bar page)** — built shared **`PageTopbar`** ds primitive; Domains now uses the demo's top-bar layout with routed sub-nav (Domains/DNS Zones/SSL) replacing the **removed sidebar sub-menu**; KPI strip + segmented filter + `.sk-dtable` + detail **Drawer**. Omitted unbacked columns (registrar/DNSSEC/nameservers — no WHOIS backend). **Follow-up:** give DNSZones + SSLCertificates pages the same top bar so the tab group persists. |
+| 8 | **Domains** | L | Restyle+IA+BE | `pages/Domains.jsx`, `pages/_domains.scss` | DomainDrawer (SSL/registration/DNSSEC/NS + inline DNS records) | registrar, registration-expiry, DNSSEC, nameservers, registration auto-renew, status (WHOIS) | **✅ migrated (first top-bar page)** — built shared **`PageTopbar`** ds primitive; Domains now uses the demo's top-bar layout with routed sub-nav (Domains/DNS Zones/SSL) replacing the **removed sidebar sub-menu**; KPI strip + segmented filter + `.sk-dtable` + detail **Drawer**. Omitted unbacked columns (registrar/DNSSEC/nameservers — no WHOIS backend). **Trio complete:** DNSZones + SSLCertificates pages now render the same `PageTopbar` (shared `DOMAIN_TABS`), so the Domains/DNS/SSL tab group persists across all three. DNS/SSL page *bodies* are not yet fully restyled (their lists/forms still old-look) — a later pass. |
| 9 | **Monitoring** | **XL** | Restyle+IA+BE | `pages/Monitoring.jsx`, `pages/_monitoring.scss` | `services/api/monitoring.js`, monitors/status/incidents subviews | synthetic monitors (HTTP/Ping/Port/Keyword); **status pages + incidents already have backend** — wire in; request-volume/p50-p95 per-app likely gap |
| 10 | **Backups** | **XL** | Restyle+IA+BE | `pages/Backups.jsx`, `pages/_backups.scss` | RestoreDrawer, Heatmap | activity timeseries, GFS retention, multi-destination storage, selective/clone restore, per-snapshot duration/progress |
| 11 | **Git** | L | Restyle+IA+BE | `pages/Git.jsx`, `pages/_git.scss`, `services/api/files.js` | RepoDeployDrawer | provider OAuth connect/disconnect + provider list; Gitea storage/users/runners metrics |
diff --git a/frontend/src/components/domains/domainTabs.jsx b/frontend/src/components/domains/domainTabs.jsx
new file mode 100644
index 00000000..f3d93f6b
--- /dev/null
+++ b/frontend/src/components/domains/domainTabs.jsx
@@ -0,0 +1,11 @@
+import { Globe, Network, Lock } from 'lucide-react';
+
+// Shared sub-nav for the Domains / DNS / SSL page group. Rendered in each page's
+// <PageTopbar tabs={DOMAIN_TABS}> so the tab group persists across all three
+// (the demo's top-bar layout replaces the old sidebar sub-menu — see
+// docs/REDESIGN_MAP.md §6 decision 3).
+export const DOMAIN_TABS = [
+ { to: '/domains', label: 'Domains', end: true, icon: <Globe size={15} /> },
+ { to: '/dns', label: 'DNS Zones', icon: <Network size={15} /> },
+ { to: '/ssl', label: 'SSL', icon: <Lock size={15} /> },
+];
diff --git a/frontend/src/pages/DNSZones.jsx b/frontend/src/pages/DNSZones.jsx
index 09e22735..8aaa868b 100644
--- a/frontend/src/pages/DNSZones.jsx
+++ b/frontend/src/pages/DNSZones.jsx
@@ -1,5 +1,7 @@
import React, { useState, useEffect, useCallback } from 'react';
-import { Globe } from 'lucide-react';
+import { Globe, Network } from 'lucide-react';
+import { PageTopbar } from '@/components/ds';
+import { DOMAIN_TABS } from '../components/domains/domainTabs';
import api from '../services/api';
import { useToast } from '../contexts/ToastContext';
import { useAuth } from '../contexts/AuthContext';
@@ -176,17 +178,15 @@ const DNSZones = () => {
return (
<div className="page-container dns-zones-page">
- <div className="page-header">
- <div className="page-header-content">
- <h1>DNS Zones</h1>
- <p className="page-description">{zones.length} zone{zones.length !== 1 ? 's' : ''} configured</p>
- </div>
- <div className="page-header-actions">
- {user?.is_admin && (
- <Button onClick={() => setShowCreateZone(true)}>Add Zone</Button>
- )}
- </div>
- </div>
+ <PageTopbar
+ icon={<Network size={18} />}
+ title="DNS Zones"
+ meta={`${zones.length} zone${zones.length !== 1 ? 's' : ''}`}
+ tabs={DOMAIN_TABS}
+ actions={user?.is_admin && (
+ <Button size="sm" onClick={() => setShowCreateZone(true)}>Add Zone</Button>
+ )}
+ />
<div className="dns-layout">
<div className="dns-zones-list">
diff --git a/frontend/src/pages/Domains.jsx b/frontend/src/pages/Domains.jsx
index 5ba87e6b..3a471343 100644
--- a/frontend/src/pages/Domains.jsx
+++ b/frontend/src/pages/Domains.jsx
@@ -15,12 +15,7 @@ import {
Select, SelectTrigger, SelectContent, SelectItem, SelectValue,
} from '@/components/ui/select';
import { PageTopbar, MetricCard, SegControl, Pill, Drawer } from '@/components/ds';
-
-const DOMAIN_TABS = [
- { to: '/domains', label: 'Domains', end: true, icon: <Globe size={15} /> },
- { to: '/dns', label: 'DNS Zones', icon: <NetworkIcon size={15} /> },
- { to: '/ssl', label: 'SSL', icon: <Lock size={15} /> },
-];
+import { DOMAIN_TABS } from '../components/domains/domainTabs';
const Domains = () => {
const toast = useToast();
diff --git a/frontend/src/pages/SSLCertificates.jsx b/frontend/src/pages/SSLCertificates.jsx
index 98bb5ce3..c5df460f 100644
--- a/frontend/src/pages/SSLCertificates.jsx
+++ b/frontend/src/pages/SSLCertificates.jsx
@@ -5,6 +5,8 @@ import {
Settings, Download
} from 'lucide-react';
import api from '../services/api';
+import { PageTopbar } from '@/components/ds';
+import { DOMAIN_TABS } from '../components/domains/domainTabs';
import { useToast } from '../contexts/ToastContext';
import { useConfirm } from '../hooks/useConfirm';
import EmptyState from '../components/EmptyState';
@@ -168,12 +170,7 @@ const SSLCertificates = () => {
if (loading) {
return (
<div className="page-container ssl-page">
- <header className="top-bar">
- <div>
- <h1>SSL Certificates</h1>
- <p className="subtitle">Manage Let's Encrypt SSL certificates</p>
- </div>
- </header>
+ <PageTopbar icon={<Lock size={18} />} title="SSL Certificates" tabs={DOMAIN_TABS} />
<div className="ssl-status-bar">
{[1, 2, 3].map(i => (
<div key={i} className="ssl-status-item">
@@ -206,44 +203,39 @@ const SSLCertificates = () => {
return (
<div className="page-container ssl-page">
- <header className="top-bar">
- <div>
- <h1>SSL Certificates</h1>
- <p className="subtitle">Manage Let's Encrypt SSL certificates</p>
- </div>
- <div className="top-bar-actions">
- <Button
- variant="outline"
- onClick={handleSetupAutoRenewal}
- disabled={actionLoading || !certbotInstalled}
- title="Configure automatic renewal via systemd or cron"
- >
- <Settings size={16} />
- Auto-Renew
- </Button>
- {certificates.length > 0 && (
+ <PageTopbar
+ icon={<Lock size={18} />}
+ title="SSL Certificates"
+ tabs={DOMAIN_TABS}
+ actions={(
+ <>
<Button
variant="outline"
- onClick={handleRenewAll}
- disabled={actionLoading}
+ size="sm"
+ onClick={handleSetupAutoRenewal}
+ disabled={actionLoading || !certbotInstalled}
+ title="Configure automatic renewal via systemd or cron"
>
- <RefreshCw size={16} />
- Renew All
+ <Settings size={15} />
+ Auto-Renew
</Button>
- )}
- <Button variant="outline" onClick={loadData}>
- <RefreshCw size={16} />
- Refresh
- </Button>
- <Button
- onClick={() => setShowObtainModal(true)}
- disabled={!certbotInstalled}
- >
- <Plus size={16} />
- New Certificate
- </Button>
- </div>
- </header>
+ {certificates.length > 0 && (
+ <Button variant="outline" size="sm" onClick={handleRenewAll} disabled={actionLoading}>
+ <RefreshCw size={15} />
+ Renew All
+ </Button>
+ )}
+ <Button variant="outline" size="sm" onClick={loadData}>
+ <RefreshCw size={15} />
+ Refresh
+ </Button>
+ <Button size="sm" onClick={() => setShowObtainModal(true)} disabled={!certbotInstalled}>
+ <Plus size={15} />
+ New Certificate
+ </Button>
+ </>
+ )}
+ />
{/* Status Cards */}
<div className="ssl-status-bar">
@@ -404,7 +396,7 @@ const SSLCertificates = () => {
<div className="ssl-info-box">
<ShieldCheck size={32} />
<div>
- <h4>Free SSL from Let's Encrypt</h4>
+ <h4>Free SSL from Let&apos;s Encrypt</h4>
<p>Obtain a free, automatically-renewed SSL certificate for your domains.</p>
</div>
</div>