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.
Python astracloudflarecontrol-panelcyberpaneldnsfablehosting-control-panelhosting-panelkimi-k3server-managementserverkitubuntu-web-panelwebserver
feat(ui): migrate the Services page group to the top-bar layout
Juan Denis4e95c2257f73
diff --git a/docs/REDESIGN_MAP.md b/docs/REDESIGN_MAP.mdindex d0fee233..c4d866d0 100644--- a/docs/REDESIGN_MAP.md+++ b/docs/REDESIGN_MAP.md@@ -123,7 +123,7 @@ Effort: S/M/L/XL. Nature: **Restyle** (look only) · **+IA** (layout/tab/route r| 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 || 12 | **Terminal / Logs** | L | Restyle+IA | `pages/Terminal.jsx`, `pages/_terminal.scss` | console/TargetRail, TerminalPane, LogsPane (delegate to existing consoles) | unified targets endpoint; live streaming for non-file targets |-| 13 | **Services (list/new/detail)** | L | Restyle+IA+BE | `pages/Services.jsx`, `NewService.jsx`, `ServiceDetail.jsx`, `service-detail/OverviewTab.jsx`, `MetricsTab.jsx`, 3 partials | TemplateCatalog, area charts | per-service metrics history + requests/min; template-catalog source; image/scratch create paths |+| 13 | **Services (list/new/detail)** | L | Restyle+IA+BE | `pages/Services.jsx`, `NewService.jsx`, `ServiceDetail.jsx`, `service-detail/OverviewTab.jsx`, `MetricsTab.jsx`, 3 partials | TemplateCatalog, area charts | per-service metrics history + requests/min; template-catalog source; image/scratch create paths | **✅ top-bar migrated** — shared `SERVICE_TABS` (Services/New Service/Templates/Deploy Activity); `PageTopbar` on all 4 group pages; **sidebar sub-menu removed**. NewService breadcrumb folded into the active tab; Templates search + Deployments live/refresh actions preserved. **Follow-up:** restyle bodies — NewService method-cards + template catalog, Services dense table, ServiceDetail tabs. || 14 | **Cron Jobs** | L | Restyle+IA+BE | `pages/CronJobs.jsx`, `pages/_cron.scss`, `services/api/system.js` | CronDrawer | run history, next-run, success-rate, job target metadata || 15 | **Security (suite)** | L | Restyle+IA+BE | `pages/Security.jsx`, all `components/security/*Tab.jsx`, `pages/_security.scss`, `services/api/security.js` | ScoreGauge usage | geo-blocking, policy toggles, scan schedules, security sessions, pending-update list, integrity verify/revert. **fail2ban + SSH-keys already exist** (minor missing fields) || 16 | **Workspaces (list + detail)** | L | Restyle+IA+BE | `pages/Workspaces.jsx`, `pages/_workspaces.scss`, `services/api/servers.js` | **`pages/WorkspaceDetail.jsx`** + `/workspaces/:id` route | **plan/billing**, aggregated CPU/Mem/Storage usage, service/site counts, member `last_active` |diff --git a/frontend/src/components/services/serviceTabs.jsx b/frontend/src/components/services/serviceTabs.jsxnew file mode 100644index 00000000..0632d0bf--- /dev/null+++ b/frontend/src/components/services/serviceTabs.jsx@@ -0,0 +1,12 @@+import { Box, Plus, LayoutTemplate, Activity } from 'lucide-react';++// Shared sub-nav for the Services page group (Services / New Service /+// Templates / Deploy Activity). Rendered in each page's+// <PageTopbar tabs={SERVICE_TABS}> — the demo's top-bar layout replaces the old+// sidebar sub-menu (see docs/REDESIGN_MAP.md §6 decision 3).+export const SERVICE_TABS = [+ { to: '/services', label: 'Services', end: true, icon: <Box size={15} /> },+ { to: '/services/new', label: 'New Service', icon: <Plus size={15} /> },+ { to: '/templates', label: 'Templates', icon: <LayoutTemplate size={15} /> },+ { to: '/deployments', label: 'Deploy Activity', icon: <Activity size={15} /> },+];diff --git a/frontend/src/components/sidebarItems.js b/frontend/src/components/sidebarItems.jsindex 6596f64c..cc7173ef 100644--- a/frontend/src/components/sidebarItems.js+++ b/frontend/src/components/sidebarItems.js@@ -45,16 +45,15 @@ export const SIDEBAR_ITEMS = [icon: '<circle cx="12" cy="12" r="10"/><line x1="2" y1="12" x2="22" y2="12"/><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"/>'},{+ // Redesign: Services uses the top-bar layout (REDESIGN_MAP §6 decision 3).+ // New Service / Templates / Deploy Activity now live in the page's top+ // bar (PageTopbar SERVICE_TABS), not as sidebar sub-items. Routes+ // /services/new, /templates, /deployments are unchanged.id: 'services',label: 'Services',route: '/services',category: 'infrastructure',- 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"/>',- subItems: [- { id: 'new-service', label: 'New Service', route: '/services/new', icon: '<line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/>' },- { id: 'templates', label: 'Templates', route: '/templates', icon: '<rect x="3" y="3" width="7" height="9"/><rect x="14" y="3" width="7" height="5"/><rect x="14" y="12" width="7" height="9"/><rect x="3" y="16" width="7" height="5"/>' },- { id: 'deployments', label: 'Deploy Activity', route: '/deployments', icon: '<polyline points="22 12 18 12 15 21 9 3 6 12 2 12"/>' }- ]+ 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"/>'},{id: 'wordpress',diff --git a/frontend/src/pages/Deployments.jsx b/frontend/src/pages/Deployments.jsxindex f79b99ad..6526542a 100644--- a/frontend/src/pages/Deployments.jsx+++ b/frontend/src/pages/Deployments.jsx@@ -15,6 +15,8 @@ import {import api from '../services/api';import { StatStrip, Stat } from '../components/StatCard';import { Button } from '@/components/ui/button';+import { PageTopbar } from '@/components/ds';+import { SERVICE_TABS } from '../components/services/serviceTabs';const STATUS_COLORS = {pending: { bg: 'rgba(148,163,184,0.15)', fg: '#94a3b8', icon: Clock },@@ -136,36 +138,33 @@ const Deployments = () => {return (<div className="page-container deployments-page">- <div className="page-header deployments-page__header">- <div className="deployments-page__heading">- <h1 className="page-title">- <Activity size={22} />- Deployment Activity- </h1>- <p className="deployments-page__description">- Track install and deploy jobs across services and servers with status, progress, and logs.- </p>- </div>- <div className="deployments-page__actions">- <Button variant="outline" asChild>- <Link to="/services/new">- <GitBranch size={16} />- New Service- </Link>- </Button>- <Button- variant={autoRefresh ? 'default' : 'outline'}- onClick={() => setAutoRefresh((v) => !v)}- title="Auto-refresh every 3s"- >- <RefreshCw size={16} className={autoRefresh ? 'spin' : ''} />- {autoRefresh ? 'Live' : 'Paused'}- </Button>- <Button variant="outline" onClick={loadJobs}>- <RefreshCw size={16} /> Refresh- </Button>- </div>- </div>+ <PageTopbar+ icon={<Activity size={18} />}+ title="Deployment Activity"+ tabs={SERVICE_TABS}+ actions={(+ <>+ <Button variant="outline" size="sm" asChild>+ <Link to="/services/new">+ <GitBranch size={16} />+ New Service+ </Link>+ </Button>+ <Button+ variant={autoRefresh ? 'default' : 'outline'}+ size="sm"+ onClick={() => setAutoRefresh((v) => !v)}+ title="Auto-refresh every 3s"+ >+ <RefreshCw size={16} className={autoRefresh ? 'spin' : ''} />+ {autoRefresh ? 'Live' : 'Paused'}+ </Button>+ <Button variant="outline" size="sm" onClick={loadJobs}>+ <RefreshCw size={16} /> Refresh+ </Button>+ </>+ )}+ /><StatStrip ariaLabel="Deployment summary"><Stat label="Running" value={summary.running} state={summary.running > 0 ? 'info' : undefined} />diff --git a/frontend/src/pages/NewService.jsx b/frontend/src/pages/NewService.jsxindex 37f1159b..52239e60 100644--- a/frontend/src/pages/NewService.jsx+++ b/frontend/src/pages/NewService.jsx@@ -10,6 +10,7 @@ import {Link2,Lock,Package,+ Plus,RefreshCw,Rocket,Search,@@ -20,6 +21,8 @@ import {} from 'lucide-react';import api from '../services/api';import { useToast } from '../contexts/ToastContext';+import { PageTopbar } from '@/components/ds';+import { SERVICE_TABS } from '../components/services/serviceTabs';import { Button } from '@/components/ui/button';import { Input } from '@/components/ui/input';import { Label } from '@/components/ui/label';@@ -336,24 +339,19 @@ const NewService = () => {return (<div className="page-container new-service-page">- <div className="new-service-page__breadcrumb">- <Link to="/services">Services</Link>- <span>/</span>- <span>New</span>- </div>-- <div className="new-service-page__header">- <div>- <h1>New Service</h1>- <p>Connect GitHub, pick a repository, and let ServerKit prepare the deployable service.</p>- </div>- <Button type="button" variant="outline" asChild>- <Link to="/settings/connections">- <Link2 size={16} />- Connections- </Link>- </Button>- </div>+ <PageTopbar+ icon={<Plus size={18} />}+ title="New Service"+ tabs={SERVICE_TABS}+ actions={(+ <Button type="button" variant="outline" size="sm" asChild>+ <Link to="/settings/connections">+ <Link2 size={16} />+ Connections+ </Link>+ </Button>+ )}+ /><div className="new-service-page__mode-strip" aria-label="Service source options"><buttondiff --git a/frontend/src/pages/Services.jsx b/frontend/src/pages/Services.jsxindex 8be1ec0f..0857d499 100644--- a/frontend/src/pages/Services.jsx+++ b/frontend/src/pages/Services.jsx@@ -1,11 +1,13 @@import React, { useState, useEffect, useMemo } from 'react';import { useNavigate, Link } from 'react-router-dom';-import { Layers, Plus } from 'lucide-react';+import { Box, Layers, Plus } from 'lucide-react';import api from '../services/api';import { useToast } from '../contexts/ToastContext';import { getServiceType, getStatusConfig, formatRelativeTime } from '../utils/serviceTypes';import EmptyState from '../components/EmptyState';import { StatStrip, Stat } from '../components/StatCard';+import { PageTopbar } from '@/components/ds';+import { SERVICE_TABS } from '../components/services/serviceTabs';import { Button } from '@/components/ui/button';import { Input } from '@/components/ui/input';import { Checkbox } from '@/components/ui/checkbox';@@ -138,20 +140,22 @@ const Services = () => {return (<div className="page-container services-page">- <div className="services-page__header">- <div>- <h1>Services</h1>- <p className="services-page__subtitle">- {stats.total} services · {stats.running} live- </p>- </div>- <Button asChild>- <Link to="/services/new">- <Plus size={16} />- New Service- </Link>- </Button>- </div>+ <PageTopbar+ icon={<Box size={18} />}+ title="Services"+ meta={`${stats.total} services · ${stats.running} live`}+ tabs={SERVICE_TABS}+ actions={(+ <>+ <Button size="sm" asChild>+ <Link to="/services/new">+ <Plus size={16} />+ New Service+ </Link>+ </Button>+ </>+ )}+ />{/* Summary */}{apps.length > 0 && (diff --git a/frontend/src/pages/Templates.jsx b/frontend/src/pages/Templates.jsxindex 4df91975..3773a74a 100644--- a/frontend/src/pages/Templates.jsx+++ b/frontend/src/pages/Templates.jsx@@ -11,6 +11,8 @@ import api from '../services/api';import { useToast } from '../contexts/ToastContext';import { Button } from '@/components/ui/button';import { Input } from '@/components/ui/input';+import { PageTopbar } from '@/components/ds';+import { SERVICE_TABS } from '../components/services/serviceTabs';import EmptyState from '../components/EmptyState';// Featured templates (curated list)@@ -306,23 +308,27 @@ const Templates = () => {return (<div className="page-container templates-page">- <div className="page-header templates-page-header">- <h1>App Templates</h1>- <div className="search-box">- <Search size={18} className="search-icon" />- <Input- type="text"- placeholder="Search templates..."- value={searchQuery}- onChange={(e) => setSearchQueryFilter(e.target.value)}- />- {searchQuery && (- <Button variant="ghost" size="icon" className="search-clear" onClick={() => setSearchQueryFilter('')}>- <X size={16} />- </Button>- )}- </div>- </div>+ <PageTopbar+ icon={<LayoutTemplate size={18} />}+ title="App Templates"+ tabs={SERVICE_TABS}+ actions={(+ <div className="search-box">+ <Search size={18} className="search-icon" />+ <Input+ type="text"+ placeholder="Search templates..."+ value={searchQuery}+ onChange={(e) => setSearchQueryFilter(e.target.value)}+ />+ {searchQuery && (+ <Button variant="ghost" size="icon" className="search-clear" onClick={() => setSearchQueryFilter('')}>+ <X size={16} />+ </Button>+ )}+ </div>+ )}+ />{/* Results and Filters */}<div className="templates-results-header">