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): migrate the Servers page group to the top-bar layout

Juan Denis8e61ad08d819
diff --git a/docs/REDESIGN_MAP.md b/docs/REDESIGN_MAP.md
index f35dfe82..d0fee233 100644
--- a/docs/REDESIGN_MAP.md
+++ b/docs/REDESIGN_MAP.md
@@ -112,7 +112,7 @@ Effort: S/M/L/XL. Nature: **Restyle** (look only) · **+IA** (layout/tab/route r
|---|---|---|---|---|---|---|
| 0 | **Design system + chrome** | L | Restyle+IA | `_variables.scss`, `_theme-variables.scss`, `layout/_sidebar.scss`, `Sidebar.jsx`, `sidebarItems.js`, `index.html` | shared primitives (§3) | none (badge data minor) |
| 1 | **Dashboard** | M | Restyle+IA | `pages/Dashboard.jsx`, `MetricsGraph.jsx`, `pages/_dashboard.scss` | ServerSwitcher, ActivityFeed | activity-feed source (maybe) | **✅ pass 1 done** — metric tiles → `MetricCard`, apps status → `Pill`, chart retinted to new palette (kept the real `MetricsGraph` intact), dotsep meta. Deferred: server-switcher dropdown + activity feed. |
-| 2 | **Servers list + detail** | L | Restyle+IA | `pages/Servers.jsx`, `pages/ServerDetail.jsx`, `pages/_servers.scss` | — (reuse MetricsGraph) | reboot cmd, per-server SSH launch; region/load = mock-only |
+| 2 | **Servers list + detail** | L | Restyle+IA | `pages/Servers.jsx`, `pages/ServerDetail.jsx`, `pages/_servers.scss` | — (reuse MetricsGraph) | reboot cmd, per-server SSH launch; region/load = mock-only | **✅ top-bar migrated** — built shared `SERVER_TABS`; `PageTopbar` (Servers/Agent Fleet/Fleet Monitor/Cloud/Config Templates) added to all 5 pages; **sidebar sub-menu removed**. Main Servers page: top bar added ABOVE the ops workspace — **fleet rail / groups / workbar / bulk / pairing fully preserved** (no over-trim). Sub-page headers swapped to PageTopbar (actions kept). **Follow-up:** restyle the Servers LIST to the demo's dense table (Host/Region/CPU/Memory/Apps/Load) + ServerDetail tabs — bodies still old-look. |
| 3 | **WordPress list** | L | Restyle+IA+BE | `pages/WordPress.jsx`, `pages/_wordpress.scss` | DataTable usage | enrich `get_sites` payload (plugins/updates/visits/uptime/server/php/env); optional bulk route |
| 4 | **WordPress detail (tabbed)** | **XL** | Restyle+IA+BE | `pages/WordPressDetail.jsx` (owns all 14 tabs), `pages/_wordpress.scss`, `_applications.scss` | header env-switcher, FilesDrawer/code-viewer, StatCard/gauge/bar-h | DB largest-tables, OPcache/extensions, uptime response-time + 90d, analytics referrers/devices, posture score |
| 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. |
diff --git a/frontend/src/components/servers/serverTabs.jsx b/frontend/src/components/servers/serverTabs.jsx
new file mode 100644
index 00000000..1cd63f73
--- /dev/null
+++ b/frontend/src/components/servers/serverTabs.jsx
@@ -0,0 +1,13 @@
+import { Server, Users, Activity, Cloud, FileCog } from 'lucide-react';
+
+// Shared sub-nav for the Servers page group (Servers / Agent Fleet / Fleet
+// Monitor / Cloud Servers / Config Templates). Rendered in each page's
+// <PageTopbar tabs={SERVER_TABS}> — the demo's top-bar layout replaces the old
+// sidebar sub-menu (see docs/REDESIGN_MAP.md §6 decision 3).
+export const SERVER_TABS = [
+ { to: '/servers', label: 'Servers', end: true, icon: <Server size={15} /> },
+ { to: '/fleet', label: 'Agent Fleet', icon: <Users size={15} /> },
+ { to: '/fleet-monitor', label: 'Fleet Monitor', icon: <Activity size={15} /> },
+ { to: '/cloud', label: 'Cloud Servers', icon: <Cloud size={15} /> },
+ { to: '/server-templates', label: 'Config Templates', icon: <FileCog size={15} /> },
+];
diff --git a/frontend/src/components/sidebarItems.js b/frontend/src/components/sidebarItems.js
index a0969876..6596f64c 100644
--- a/frontend/src/components/sidebarItems.js
+++ b/frontend/src/components/sidebarItems.js
@@ -22,17 +22,16 @@ export const SIDEBAR_ITEMS = [
icon: '<rect x="3" y="3" width="7" height="7"/><rect x="14" y="3" width="7" height="7"/><rect x="14" y="14" width="7" height="7"/><rect x="3" y="14" width="7" height="7"/>'
},
{
+ // Redesign: Servers uses the top-bar layout (REDESIGN_MAP §6 decision 3).
+ // Its Agent Fleet / Fleet Monitor / Cloud Servers / Config Templates
+ // sub-nav now lives in the page's top bar (PageTopbar SERVER_TABS), not
+ // as sidebar sub-items. Routes /fleet, /fleet-monitor, /cloud,
+ // /server-templates are unchanged and reachable from those tabs.
id: 'servers',
label: 'Servers',
route: '/servers',
category: 'infrastructure',
- icon: '<rect x="2" y="2" width="20" height="8" rx="2" ry="2"/><rect x="2" y="14" width="20" height="8" rx="2" ry="2"/><line x1="6" y1="6" x2="6.01" y2="6"/><line x1="6" y1="18" x2="6.01" y2="18"/>',
- subItems: [
- { id: 'fleet', label: 'Agent Fleet', route: '/fleet', icon: '<path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M23 21v-2a4 4 0 0 0-3-3.87"/><path d="M16 3.13a4 4 0 0 1 0 7.75"/>' },
- { id: 'fleet-monitor', label: 'Fleet Monitor', route: '/fleet-monitor', icon: '<path d="M22 12h-4l-3 9L9 3l-3 9H2"/>' },
- { id: 'cloud', label: 'Cloud Servers', route: '/cloud', icon: '<path d="M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z"/>' },
- { id: 'server-templates', label: 'Config Templates', route: '/server-templates', icon: '<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/><polyline points="10 9 9 9 8 9"/>' }
- ]
+ icon: '<rect x="2" y="2" width="20" height="8" rx="2" ry="2"/><rect x="2" y="14" width="20" height="8" rx="2" ry="2"/><line x1="6" y1="6" x2="6.01" y2="6"/><line x1="6" y1="18" x2="6.01" y2="18"/>'
},
{
// Redesign: Domains is migrated to the top-bar layout (REDESIGN_MAP §6
diff --git a/frontend/src/pages/AgentFleet.jsx b/frontend/src/pages/AgentFleet.jsx
index a583ed74..0422a567 100644
--- a/frontend/src/pages/AgentFleet.jsx
+++ b/frontend/src/pages/AgentFleet.jsx
@@ -32,6 +32,8 @@ import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Badge } from '@/components/ui/badge';
import { Tabs, TabsList, TabsTrigger } from '@/components/ui/tabs';
+import { PageTopbar } from '@/components/ds';
+import { SERVER_TABS } from '../components/servers/serverTabs';
const AgentFleet = () => {
const [activeTab, setActiveTab] = useState('dashboard');
@@ -197,18 +199,19 @@ const AgentFleet = () => {
return (
<div className="page-container">
- <div className="page-header">
- <div className="header-info">
- <h1>Agent Fleet Management</h1>
- <p>Monitor health, manage versions, and control updates across your infrastructure.</p>
- </div>
- <div className="header-actions">
- <Button onClick={fetchData} disabled={loading}>
- <RefreshCw size={18} className={loading ? 'animate-spin' : ''} />
- Refresh
- </Button>
- </div>
- </div>
+ <PageTopbar
+ icon={<Users size={18} />}
+ title="Agent Fleet"
+ tabs={SERVER_TABS}
+ actions={(
+ <>
+ <Button size="sm" onClick={fetchData} disabled={loading}>
+ <RefreshCw size={18} className={loading ? 'animate-spin' : ''} />
+ Refresh
+ </Button>
+ </>
+ )}
+ />
<Tabs value={activeTab} onValueChange={setActiveTab}>
<TabsList>
diff --git a/frontend/src/pages/CloudProvision.jsx b/frontend/src/pages/CloudProvision.jsx
index 05a07cfd..732ecf76 100644
--- a/frontend/src/pages/CloudProvision.jsx
+++ b/frontend/src/pages/CloudProvision.jsx
@@ -10,6 +10,8 @@ import { Input } from '@/components/ui/input';
import { Badge } from '@/components/ui/badge';
import { Tabs, TabsList, TabsTrigger, TabsContent } from '@/components/ui/tabs';
import { Cloud, Server } from 'lucide-react';
+import { PageTopbar } from '@/components/ds';
+import { SERVER_TABS } from '../components/servers/serverTabs';
const CloudProvision = () => {
const toast = useToast();
@@ -93,23 +95,21 @@ const CloudProvision = () => {
return (
<div className="page-container cloud-provision-page">
- <div className="page-header">
- <div className="page-header-content">
- <h1>Cloud Provisioning</h1>
- <p className="page-description">
- {servers.length} server{servers.length !== 1 ? 's' : ''}
- {costs && ` • $${costs.total_monthly}/mo`}
- </p>
- </div>
- <div className="page-header-actions">
- {user?.is_admin && (
- <>
- <Button variant="outline" onClick={() => setShowCreateProvider(true)}>Add Provider</Button>
- <Button onClick={() => setShowCreateServer(true)}>New Server</Button>
- </>
- )}
- </div>
- </div>
+ <PageTopbar
+ icon={<Cloud size={18} />}
+ title="Cloud Provisioning"
+ tabs={SERVER_TABS}
+ actions={(
+ <>
+ {user?.is_admin && (
+ <>
+ <Button size="sm" variant="outline" onClick={() => setShowCreateProvider(true)}>Add Provider</Button>
+ <Button size="sm" onClick={() => setShowCreateServer(true)}>New Server</Button>
+ </>
+ )}
+ </>
+ )}
+ />
<Tabs defaultValue="servers">
<TabsList>
diff --git a/frontend/src/pages/FleetMonitor.jsx b/frontend/src/pages/FleetMonitor.jsx
index 10a70623..b596c856 100644
--- a/frontend/src/pages/FleetMonitor.jsx
+++ b/frontend/src/pages/FleetMonitor.jsx
@@ -25,6 +25,8 @@ import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Tabs, TabsList, TabsTrigger } from '@/components/ui/tabs';
import { Badge } from '@/components/ui/badge';
+import { PageTopbar } from '@/components/ds';
+import { SERVER_TABS } from '../components/servers/serverTabs';
const CHART_COLORS = [
'#6366f1', '#ec4899', '#14b8a6', '#f59e0b',
@@ -234,18 +236,19 @@ const FleetMonitor = () => {
return (
<div className="page-container">
- <div className="page-header">
- <div className="header-info">
- <h1>Fleet Monitor</h1>
- <p>Cross-server monitoring, alerts, and capacity planning.</p>
- </div>
- <div className="header-actions">
- <Button onClick={fetchTabData} disabled={loading}>
- <RefreshCw size={18} className={loading ? 'animate-spin' : ''} />
- Refresh
- </Button>
- </div>
- </div>
+ <PageTopbar
+ icon={<Activity size={18} />}
+ title="Fleet Monitor"
+ tabs={SERVER_TABS}
+ actions={(
+ <>
+ <Button size="sm" onClick={fetchTabData} disabled={loading}>
+ <RefreshCw size={18} className={loading ? 'animate-spin' : ''} />
+ Refresh
+ </Button>
+ </>
+ )}
+ />
<Tabs value={activeTab} onValueChange={setActiveTab}>
<TabsList>
@@ -828,7 +831,7 @@ const FleetMonitor = () => {
) : searchQuery.length >= 2 && !loading ? (
<div className="py-8 text-center text-gray-500">
<Search size={36} className="mx-auto text-gray-300 mb-3" />
- <p>No results found for "{searchQuery}".</p>
+ <p>No results found for &quot;{searchQuery}&quot;.</p>
</div>
) : (
<div className="py-8 text-center text-gray-500">
diff --git a/frontend/src/pages/ServerTemplates.jsx b/frontend/src/pages/ServerTemplates.jsx
index c25be101..d8fc8028 100644
--- a/frontend/src/pages/ServerTemplates.jsx
+++ b/frontend/src/pages/ServerTemplates.jsx
@@ -5,7 +5,9 @@ import { useAuth } from '../contexts/AuthContext';
import Spinner from '../components/Spinner';
import ConfirmDialog from '../components/ConfirmDialog';
import EmptyState from '../components/EmptyState';
-import { LayoutTemplate } from 'lucide-react';
+import { LayoutTemplate, FileCog } from 'lucide-react';
+import { PageTopbar } from '@/components/ds';
+import { SERVER_TABS } from '../components/servers/serverTabs';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Textarea } from '@/components/ui/textarea';
@@ -129,22 +131,20 @@ const ServerTemplates = () => {
return (
<div className="page-container server-templates-page">
- <div className="page-header">
- <div className="page-header-content">
- <h1>Server Templates</h1>
- <p className="page-description">
- {templates.length} template{templates.length !== 1 ? 's' : ''}
- {compliance && ` • ${compliance.compliance_pct}% fleet compliance`}
- </p>
- </div>
- <div className="page-header-actions">
- {user?.is_admin && (
- <Button onClick={() => setShowCreateModal(true)}>
- Create Template
- </Button>
- )}
- </div>
- </div>
+ <PageTopbar
+ icon={<FileCog size={18} />}
+ title="Server Templates"
+ tabs={SERVER_TABS}
+ actions={(
+ <>
+ {user?.is_admin && (
+ <Button size="sm" onClick={() => setShowCreateModal(true)}>
+ Create Template
+ </Button>
+ )}
+ </>
+ )}
+ />
{compliance && (
<div className="compliance-bar">
diff --git a/frontend/src/pages/Servers.jsx b/frontend/src/pages/Servers.jsx
index 77489c8e..ff758d2d 100644
--- a/frontend/src/pages/Servers.jsx
+++ b/frontend/src/pages/Servers.jsx
@@ -12,6 +12,8 @@ import {
XCircle,
} from 'lucide-react';
import api from '../services/api';
+import { PageTopbar } from '@/components/ds';
+import { SERVER_TABS } from '../components/servers/serverTabs';
import { useToast } from '../contexts/ToastContext';
import { ConfirmDialog } from '../components/ConfirmDialog';
import EmptyState from '../components/EmptyState';
@@ -234,6 +236,11 @@ const Servers = () => {
return (
<div className="page-container page-container--full-bleed servers-page servers-page--ops">
+ <PageTopbar
+ icon={<ServerLucideIcon size={18} />}
+ title="Servers"
+ tabs={SERVER_TABS}
+ />
<div className="servers-ops-workspace">
<aside className="servers-fleet-rail">
<section className="servers-rail-section servers-rail-section--health">
diff --git a/frontend/src/styles/pages/_servers.scss b/frontend/src/styles/pages/_servers.scss
index 4ee909d8..d4f21f85 100644
--- a/frontend/src/styles/pages/_servers.scss
+++ b/frontend/src/styles/pages/_servers.scss
@@ -2854,8 +2854,12 @@
margin: 0;
padding: $space-3;
display: flex;
+ flex-direction: column; // top bar stacks above the ops workspace (redesign)
background: transparent;
+ // PageTopbar sits flush at the top of the full-bleed ops layout.
+ > .sk-topbar { padding-left: $space-2; padding-right: $space-2; margin-bottom: $space-3; }
+
.servers-ops-workspace {
flex: 1;
min-height: 0;