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 WordPress group to the top-bar layout (sidebar now flat)

Juan Denise2968b2197db
diff --git a/docs/REDESIGN_MAP.md b/docs/REDESIGN_MAP.md
index 6a0ab5f6..2adaf334 100644
--- a/docs/REDESIGN_MAP.md
+++ b/docs/REDESIGN_MAP.md
@@ -113,7 +113,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 | **✅ 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 |
+| 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 | **✅ top-bar migrated (LAST group — sidebar now fully flat)** — shared `WORDPRESS_TABS` (WordPress/Pipeline); `PageTopbar` on WordPress + WordPressProjects; **sidebar sub-menu removed** (Import/Create actions kept; Pipeline tab now always-visible, was wpInstalled-gated). Body restyle (dense site table, drawer) still pending. |
| 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. |
| 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. |
diff --git a/frontend/src/components/sidebarItems.js b/frontend/src/components/sidebarItems.js
index 48bf870f..1a358191 100644
--- a/frontend/src/components/sidebarItems.js
+++ b/frontend/src/components/sidebarItems.js
@@ -56,14 +56,14 @@ export const SIDEBAR_ITEMS = [
icon: '<path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"/><polyline points="3.27 6.96 12 12.01 20.73 6.96"/><line x1="12" y1="22.08" x2="12" y2="12"/>'
},
{
+ // Redesign: WordPress uses the top-bar layout (REDESIGN_MAP §6 dec. 3).
+ // Pipeline now lives in the page's top bar (PageTopbar WORDPRESS_TABS),
+ // not as a sidebar sub-item. Route /wordpress/projects is unchanged.
id: 'wordpress',
label: 'WordPress',
route: '/wordpress',
category: 'infrastructure',
- icon: '<circle cx="12" cy="12" r="10"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/><path d="M3.5 9h17M3.5 15h17"/>',
- subItems: [
- { id: 'wp-pipeline', label: 'Pipeline', route: '/wordpress/projects', requiresCondition: 'wpInstalled', icon: '<path d="M22 12h-4l-3 9L9 3l-3 9H2"/>' }
- ]
+ icon: '<circle cx="12" cy="12" r="10"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/><path d="M3.5 9h17M3.5 15h17"/>'
},
{
id: 'workflow',
diff --git a/frontend/src/components/wordpress/wordpressTabs.jsx b/frontend/src/components/wordpress/wordpressTabs.jsx
new file mode 100644
index 00000000..784e4cd7
--- /dev/null
+++ b/frontend/src/components/wordpress/wordpressTabs.jsx
@@ -0,0 +1,11 @@
+import { Globe, GitBranch } from 'lucide-react';
+
+// Shared sub-nav for the WordPress page group (WordPress sites / Pipeline).
+// Rendered in each page's <PageTopbar tabs={WORDPRESS_TABS}> — the demo's
+// top-bar layout replaces the old sidebar sub-menu (REDESIGN_MAP §6 dec. 3).
+// (The Pipeline tab was wpInstalled-gated in the sidebar; kept always-visible
+// here for simplicity — the pipeline page shows an empty state when unused.)
+export const WORDPRESS_TABS = [
+ { to: '/wordpress', label: 'WordPress', end: true, icon: <Globe size={15} /> },
+ { to: '/wordpress/projects', label: 'Pipeline', icon: <GitBranch size={15} /> },
+];
diff --git a/frontend/src/pages/WordPress.jsx b/frontend/src/pages/WordPress.jsx
index 5e098edf..635f832a 100644
--- a/frontend/src/pages/WordPress.jsx
+++ b/frontend/src/pages/WordPress.jsx
@@ -7,6 +7,8 @@ import ResourceGate from '../components/ResourceGate';
import Spinner from '../components/Spinner';
import EmptyState from '../components/EmptyState';
import { Globe } from 'lucide-react';
+import { PageTopbar } from '@/components/ds';
+import { WORDPRESS_TABS } from '../components/wordpress/wordpressTabs';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
@@ -111,12 +113,7 @@ function WordPress() {
if (loading) {
return (
<div className="page-container wordpress-page">
- <div className="page-header">
- <div className="page-header-content">
- <h1>WordPress</h1>
- <p className="page-description">Manage your WordPress sites</p>
- </div>
- </div>
+ <PageTopbar icon={<Globe size={18} />} title="WordPress" tabs={WORDPRESS_TABS} />
<div className="wp-sites-grid">
{[1, 2, 3].map(i => (
<div key={i} className="wp-site-card-skeleton">
@@ -158,22 +155,23 @@ function WordPress() {
return (
<div className="page-container wordpress-page">
- <div className="page-header">
- <div className="page-header-content">
- <h1>WordPress</h1>
- <p className="page-description">Manage your WordPress sites</p>
- </div>
- <div className="page-header-actions">
- <Button variant="outline" onClick={() => setShowImportModal(true)}>
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>
- Import Site
- </Button>
- <Button onClick={() => setShowCreateModal(true)}>
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
- Create Site
- </Button>
- </div>
- </div>
+ <PageTopbar
+ icon={<Globe size={18} />}
+ title="WordPress"
+ tabs={WORDPRESS_TABS}
+ actions={(
+ <>
+ <Button variant="outline" size="sm" onClick={() => setShowImportModal(true)}>
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>
+ Import Site
+ </Button>
+ <Button size="sm" onClick={() => setShowCreateModal(true)}>
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
+ Create Site
+ </Button>
+ </>
+ )}
+ />
{createdCreds && (
<div className="wp-creds-banner">
diff --git a/frontend/src/pages/WordPressProjects.jsx b/frontend/src/pages/WordPressProjects.jsx
index df8e450f..deed9869 100644
--- a/frontend/src/pages/WordPressProjects.jsx
+++ b/frontend/src/pages/WordPressProjects.jsx
@@ -1,6 +1,8 @@
import React, { useState, useEffect } from 'react';
import { useNavigate } from 'react-router-dom';
import { ExternalLink, Plus, GitBranch, Layers } from 'lucide-react';
+import { PageTopbar } from '@/components/ds';
+import { WORDPRESS_TABS } from '../components/wordpress/wordpressTabs';
import wordpressApi from '../services/wordpress';
import { useToast } from '../contexts/ToastContext';
import EmptyState from '../components/EmptyState';
@@ -35,12 +37,7 @@ const WordPressProjects = () => {
return (
<div className="wp-projects-page">
- <div className="page-header">
- <div className="page-header-content">
- <h1>WordPress Projects</h1>
- <p className="page-description">Manage WordPress sites with environment pipelines</p>
- </div>
- </div>
+ <PageTopbar icon={<GitBranch size={18} />} title="Pipeline" tabs={WORDPRESS_TABS} />
{projects.length === 0 ? (
<EmptyState