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.

Add topbar tab groups with overflow + backups/security tabs

Juan Denisf249fd49f053
diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx
index 3f222f29..a72001d1 100644
--- a/frontend/src/App.jsx
+++ b/frontend/src/App.jsx
@@ -41,6 +41,8 @@ import { FILE_TABS } from './components/files/fileTabs';
import { MONITOR_TABS } from './components/monitoring/monitorTabs';
import { MARKET_TABS } from './components/marketplace/marketTabs';
import { WORDPRESS_TABS } from './components/wordpress/wordpressTabs';
+import { BACKUP_TABS } from './components/backups/backupTabs';
+import { SECURITY_TABS } from './components/security/securityTabs';
import Downloads from './pages/Downloads';
import WordPress from './pages/WordPress';
import WordPressDetail from './pages/WordPressDetail';
@@ -334,11 +336,15 @@ function AppRoutes() {
<Route path="status-pages" element={<StatusPages />} />
</Route>
<Route path="gpu" element={<GpuMonitor />} />
- <Route path="backups" element={<Backups />} />
- <Route path="backups/:tab" element={<Backups />} />
+ <Route element={<TabGroupLayout tabs={BACKUP_TABS} />}>
+ <Route path="backups" element={<Backups />} />
+ <Route path="backups/:tab" element={<Backups />} />
+ </Route>
<Route path="cron" element={<CronJobs />} />
- <Route path="security" element={<Security />} />
- <Route path="security/:tab" element={<Security />} />
+ <Route element={<TabGroupLayout tabs={SECURITY_TABS} />}>
+ <Route path="security" element={<Security />} />
+ <Route path="security/:tab" element={<Security />} />
+ </Route>
<Route path="email" element={<Email />} />
<Route path="email/:tab" element={<Email />} />
<Route path="terminal" element={<Terminal />} />
diff --git a/frontend/src/components/backups/backupTabs.jsx b/frontend/src/components/backups/backupTabs.jsx
new file mode 100644
index 00000000..836e7c49
--- /dev/null
+++ b/frontend/src/components/backups/backupTabs.jsx
@@ -0,0 +1,13 @@
+import { Archive, Clock, Cloud, Settings } from 'lucide-react';
+
+// Shared sub-nav for the Backups page group (Backups / Schedules / Storage /
+// Settings). Rendered in the shared PageTopbar tabs so the sections live in the
+// page top bar — matching the Domains/Services top-bar layout (see
+// docs/REDESIGN_MAP.md §6 decision 3). All sections render from the single
+// Backups page, keyed off the /backups/:tab route.
+export const BACKUP_TABS = [
+ { to: '/backups', label: 'Backups', end: true, icon: <Archive size={15} /> },
+ { to: '/backups/schedules', label: 'Schedules', icon: <Clock size={15} /> },
+ { to: '/backups/storage', label: 'Storage', icon: <Cloud size={15} /> },
+ { to: '/backups/settings', label: 'Settings', icon: <Settings size={15} /> },
+];
diff --git a/frontend/src/components/ds/PageTopbar.jsx b/frontend/src/components/ds/PageTopbar.jsx
index 7d010aa0..c7c22941 100644
--- a/frontend/src/components/ds/PageTopbar.jsx
+++ b/frontend/src/components/ds/PageTopbar.jsx
@@ -1,4 +1,7 @@
-import { NavLink } from 'react-router-dom';
+import { useState, useRef, useEffect, useCallback, useMemo } from 'react';
+import { NavLink, useLocation } from 'react-router-dom';
+import { MoreHorizontal } from 'lucide-react';
+import { Popover, PopoverTrigger, PopoverContent } from '@/components/ui/popover';
import { cn } from '@/lib/utils';
// The demo's page top bar (see docs/REDESIGN_MAP.md §6 decision 3): infra pages
@@ -9,6 +12,7 @@ import { cn } from '@/lib/utils';
// tabs={[{ to:'/domains', label:'Domains', end:true }, { to:'/dns', label:'DNS Zones' }]}
// actions={<Button>Add domain</Button>} />
export function PageTopbar({ icon, title, meta, tabs, actions, className }) {
+ const hasTabs = tabs && tabs.length > 0;
return (
<header className={cn('sk-topbar', className)}>
{icon && <span className="sk-topbar__ico">{icon}</span>}
@@ -17,26 +21,183 @@ export function PageTopbar({ icon, title, meta, tabs, actions, className }) {
{meta && <span className="sk-topbar__meta">{meta}</span>}
</div>
- {tabs && tabs.length > 0 && (
- <nav className="sk-topbar__tabs" aria-label={`${title} sections`}>
- {tabs.map((t) => (
- <NavLink
- key={t.to}
- to={t.to}
- end={t.end}
- className={({ isActive }) => cn('sk-topbar__tab', isActive && 'is-active')}
- >
- {t.icon}
- {t.label}
- </NavLink>
- ))}
- </nav>
- )}
+ {/* The tab nav grows to fill the bar; when there are more tabs than
+ fit, the overflow collapses into a "More" menu (so groups with
+ many sections — e.g. Security — stay on one row). Pages without
+ tabs keep the plain spacer that pushes actions to the right. */}
+ {hasTabs ? <TopbarTabs tabs={tabs} label={title} /> : <div className="sk-topbar__spacer" />}
- <div className="sk-topbar__spacer" />
{actions && <div className="sk-topbar__actions">{actions}</div>}
</header>
);
}
+function matchTab(tab, path) {
+ if (tab.end) return path === tab.to;
+ // Segment-aware so "/fleet" doesn't swallow "/fleet-monitor".
+ return path === tab.to || path.startsWith(tab.to + '/');
+}
+
+// Routed sub-nav with overflow handling. Tabs that don't fit the available width
+// are hidden and surfaced through a trailing "More" popover — the same greedy
+// fit + active-stays-visible logic the shadcn TabsList uses (components/ui/tabs).
+function TopbarTabs({ tabs, label }) {
+ const location = useLocation();
+ const containerRef = useRef(null);
+ const linkRefs = useRef([]);
+ const moreBtnRef = useRef(null);
+ const [hiddenIndices, setHiddenIndices] = useState([]);
+ const [popoverOpen, setPopoverOpen] = useState(false);
+
+ linkRefs.current.length = tabs.length;
+
+ const activeIndex = useMemo(
+ () => tabs.findIndex((t) => matchTab(t, location.pathname)),
+ [tabs, location.pathname]
+ );
+
+ const recompute = useCallback(() => {
+ const container = containerRef.current;
+ if (!container) return;
+ const containerWidth = container.clientWidth;
+ if (containerWidth === 0) return;
+
+ // Measure each link's natural width (briefly un-hiding collapsed ones).
+ const widths = linkRefs.current.map((el) => {
+ if (!el) return 0;
+ const wasHidden = el.style.display === 'none';
+ if (wasHidden) el.style.display = '';
+ const w = el.offsetWidth;
+ if (wasHidden) el.style.display = 'none';
+ return w;
+ });
+
+ const moreWidth = moreBtnRef.current?.offsetWidth || 56;
+ const gap = 2; // matches .sk-topbar__tabs gap
+
+ // All fit?
+ const total = widths.reduce((s, w, i) => s + w + (i > 0 ? gap : 0), 0);
+ if (total <= containerWidth) {
+ setHiddenIndices((prev) => (prev.length === 0 ? prev : []));
+ return;
+ }
+
+ // Reserve space for the More button, then greedily fit left-to-right.
+ const budget = Math.max(0, containerWidth - moreWidth - gap);
+ const visible = [];
+ let used = 0;
+ for (let i = 0; i < widths.length; i++) {
+ const cost = widths[i] + (visible.length > 0 ? gap : 0);
+ if (used + cost <= budget) {
+ visible.push(i);
+ used += cost;
+ } else {
+ break;
+ }
+ }
+
+ // The active tab must stay visible — rebuild the visible set around it.
+ let visibleSet = visible;
+ if (activeIndex !== -1 && !visible.includes(activeIndex)) {
+ const others = [];
+ let othersUsed = widths[activeIndex];
+ for (let i = 0; i < widths.length; i++) {
+ if (i === activeIndex) continue;
+ const cost = widths[i] + gap;
+ if (othersUsed + cost <= budget) {
+ others.push(i);
+ othersUsed += cost;
+ }
+ }
+ visibleSet = [...others, activeIndex].sort((a, b) => a - b);
+ }
+
+ const visibleSetObj = new Set(visibleSet);
+ const hidden = [];
+ for (let i = 0; i < widths.length; i++) {
+ if (!visibleSetObj.has(i)) hidden.push(i);
+ }
+ setHiddenIndices((prev) => (arraysEqual(prev, hidden) ? prev : hidden));
+ }, [activeIndex]);
+
+ // Initial measurement + re-run when the tab set or active tab changes.
+ useEffect(() => {
+ recompute();
+ }, [recompute, tabs.length]);
+
+ // Re-fit on container resize.
+ useEffect(() => {
+ const container = containerRef.current;
+ if (!container || typeof ResizeObserver === 'undefined') return undefined;
+ const ro = new ResizeObserver(() => recompute());
+ ro.observe(container);
+ return () => ro.disconnect();
+ }, [recompute]);
+
+ const hiddenSet = new Set(hiddenIndices);
+
+ return (
+ <nav ref={containerRef} className="sk-topbar__tabs" aria-label={`${label} sections`}>
+ {tabs.map((t, i) => {
+ const isHidden = hiddenSet.has(i);
+ return (
+ <NavLink
+ key={t.to}
+ to={t.to}
+ end={t.end}
+ ref={(el) => { linkRefs.current[i] = el; }}
+ className={({ isActive }) => cn('sk-topbar__tab', isActive && 'is-active')}
+ style={{ display: isHidden ? 'none' : undefined }}
+ data-overflow={isHidden ? 'hidden' : undefined}
+ >
+ {t.icon}
+ {t.label}
+ </NavLink>
+ );
+ })}
+ {hiddenIndices.length > 0 && (
+ <Popover open={popoverOpen} onOpenChange={setPopoverOpen}>
+ <PopoverTrigger asChild>
+ <button
+ ref={moreBtnRef}
+ type="button"
+ className="sk-topbar__tab sk-topbar__more"
+ aria-label="More sections"
+ >
+ <MoreHorizontal size={16} />
+ More
+ </button>
+ </PopoverTrigger>
+ <PopoverContent align="end" sideOffset={6} className="ui-popover-content">
+ <div className="tabs-overflow-list">
+ {hiddenIndices.map((idx) => {
+ const t = tabs[idx];
+ return (
+ <NavLink
+ key={t.to}
+ to={t.to}
+ end={t.end}
+ className="tabs-overflow-item"
+ data-state={idx === activeIndex ? 'active' : 'inactive'}
+ onClick={() => setPopoverOpen(false)}
+ >
+ {t.icon}
+ {t.label}
+ </NavLink>
+ );
+ })}
+ </div>
+ </PopoverContent>
+ </Popover>
+ )}
+ </nav>
+ );
+}
+
+function arraysEqual(a, b) {
+ if (a.length !== b.length) return false;
+ for (let i = 0; i < a.length; i++) if (a[i] !== b[i]) return false;
+ return true;
+}
+
export default PageTopbar;
diff --git a/frontend/src/components/security/securityTabs.jsx b/frontend/src/components/security/securityTabs.jsx
new file mode 100644
index 00000000..f9867a63
--- /dev/null
+++ b/frontend/src/components/security/securityTabs.jsx
@@ -0,0 +1,26 @@
+import {
+ LayoutDashboard, Shield, Ban, Key, Network, Radar, ShieldOff,
+ FileCheck, ScrollText, Bug, RefreshCw, Bell, Settings,
+} from 'lucide-react';
+
+// Shared sub-nav for the Security page group. Rendered in the shared PageTopbar
+// tabs so every section lives in the page top bar — matching the Domains/
+// Services top-bar layout (see docs/REDESIGN_MAP.md §6 decision 3). There are 13
+// sections, more than fit on one row, so the PageTopbar collapses the overflow
+// into a "More" menu. All sections render from the single Security page, keyed
+// off the /security/:tab route.
+export const SECURITY_TABS = [
+ { to: '/security', label: 'Overview', end: true, icon: <LayoutDashboard size={15} /> },
+ { to: '/security/firewall', label: 'Firewall', icon: <Shield size={15} /> },
+ { to: '/security/fail2ban', label: 'Fail2ban', icon: <Ban size={15} /> },
+ { to: '/security/ssh-keys', label: 'SSH Keys', icon: <Key size={15} /> },
+ { to: '/security/ip-lists', label: 'IP Lists', icon: <Network size={15} /> },
+ { to: '/security/scanner', label: 'Malware Scanner', icon: <Radar size={15} /> },
+ { to: '/security/quarantine', label: 'Quarantine', icon: <ShieldOff size={15} /> },
+ { to: '/security/integrity', label: 'File Integrity', icon: <FileCheck size={15} /> },
+ { to: '/security/audit', label: 'Audit', icon: <ScrollText size={15} /> },
+ { to: '/security/vulnerability', label: 'Vulnerability Scan', icon: <Bug size={15} /> },
+ { to: '/security/updates', label: 'Auto Updates', icon: <RefreshCw size={15} /> },
+ { to: '/security/events', label: 'Events', icon: <Bell size={15} /> },
+ { to: '/security/settings', label: 'Settings', icon: <Settings size={15} /> },
+];
diff --git a/frontend/src/pages/Backups.jsx b/frontend/src/pages/Backups.jsx
index 51148a95..801ebab0 100644
--- a/frontend/src/pages/Backups.jsx
+++ b/frontend/src/pages/Backups.jsx
@@ -1,6 +1,6 @@
import { useState, useEffect } from 'react';
import useTabParam from '../hooks/useTabParam';
-import { Upload, Check, AlertTriangle, Clock, Database, Package, FolderArchive, HardDrive, Cloud, CloudOff, RefreshCw, Trash2, Plus, CheckCircle, XCircle, FileArchive, Archive } from 'lucide-react';
+import { Upload, Check, AlertTriangle, Clock, Database, Package, FolderArchive, HardDrive, Cloud, CloudOff, RefreshCw, Trash2, Plus, CheckCircle, XCircle, FileArchive } from 'lucide-react';
import api from '../services/api';
import { useToast } from '../contexts/ToastContext';
import { useConfirm } from '../hooks/useConfirm';
@@ -9,8 +9,8 @@ import EmptyState from '../components/EmptyState';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Textarea } from '@/components/ui/textarea';
-import { Tabs, TabsList, TabsTrigger, TabsContent } from '@/components/ui/tabs';
-import { PageTopbar, MetricCard, Pill, SegControl } from '@/components/ds';
+import { MetricCard, Pill, SegControl } from '@/components/ds';
+import { useTopbarActions } from '@/hooks/useTopbarActions';
const VALID_TABS = ['backups', 'schedules', 'storage', 'settings'];
@@ -27,7 +27,7 @@ const Backups = () => {
const [apps, setApps] = useState([]);
const [loading, setLoading] = useState(true);
const [error, setError] = useState(null);
- const [activeTab, setActiveTab] = useTabParam('/backups', VALID_TABS);
+ const [activeTab] = useTabParam('/backups', VALID_TABS);
const [filterType, setFilterType] = useState('all');
// Modal states
@@ -362,31 +362,29 @@ const Backups = () => {
? backups
: backups.filter(b => b.type === filterType);
+ useTopbarActions(() => (
+ <>
+ <Button variant="outline" size="sm" onClick={() => setShowScheduleModal(true)}>
+ <Clock size={16} />
+ Add Schedule
+ </Button>
+ <Button size="sm" onClick={() => setShowBackupModal(true)}>
+ <Plus size={16} />
+ Create Backup
+ </Button>
+ </>
+ ), []);
+
if (loading) {
return (
- <div className="page-container backups-page">
+ <div className="sk-tabgroup__inner backups-page">
<EmptyState loading size="lg" title="Loading backup data..." />
</div>
);
}
return (
- <div className="page-container backups-page">
- <PageTopbar
- icon={<Archive size={18} />}
- title="Backups"
- actions={<>
- <Button variant="outline" onClick={() => setShowScheduleModal(true)}>
- <Clock size={16} />
- Add Schedule
- </Button>
- <Button onClick={() => setShowBackupModal(true)}>
- <Plus size={16} />
- Create Backup
- </Button>
- </>}
- />
-
+ <div className="sk-tabgroup__inner backups-page">
{error && (
<div className="alert alert-danger">
{error}
@@ -411,16 +409,8 @@ const Backups = () => {
)}
</div>
- <Tabs value={activeTab} onValueChange={setActiveTab}>
- <TabsList>
- <TabsTrigger value="backups">Backups</TabsTrigger>
- <TabsTrigger value="schedules">Schedules</TabsTrigger>
- <TabsTrigger value="storage">Storage</TabsTrigger>
- <TabsTrigger value="settings">Settings</TabsTrigger>
- </TabsList>
-
- {/* Backups Tab */}
- <TabsContent value="backups">
+ {activeTab === 'backups' && (
+ <>
<div className="bk-listhead">
<h2>Backup archive</h2>
<SegControl
@@ -523,10 +513,11 @@ const Backups = () => {
</table>
</div>
)}
- </TabsContent>
+ </>
+ )}
- {/* Schedules Tab */}
- <TabsContent value="schedules">
+ {activeTab === 'schedules' && (
+ <>
<div className="bk-listhead">
<h2>Backup schedules</h2>
<Button size="sm" onClick={() => setShowScheduleModal(true)}>
@@ -623,10 +614,11 @@ const Backups = () => {
</table>
</div>
)}
- </TabsContent>
+ </>
+ )}
- {/* Storage Tab */}
- <TabsContent value="storage">
+ {activeTab === 'storage' && (
+ <>
<div className="bk-specs">
<div className="sk-spec-card">
<div className="sk-spec-card__label">Provider</div>
@@ -842,10 +834,11 @@ const Backups = () => {
</form>
</div>
</div>
- </TabsContent>
+ </>
+ )}
- {/* Settings Tab */}
- <TabsContent value="settings">
+ {activeTab === 'settings' && (
+ <>
<div className="card">
<div className="card-header">
<h3>Backup Settings</h3>
@@ -885,8 +878,8 @@ const Backups = () => {
</form>
</div>
</div>
- </TabsContent>
- </Tabs>
+ </>
+ )}
{/* Create Backup Modal */}
{showBackupModal && (
diff --git a/frontend/src/pages/Git.jsx b/frontend/src/pages/Git.jsx
index 062e2071..52186c37 100644
--- a/frontend/src/pages/Git.jsx
+++ b/frontend/src/pages/Git.jsx
@@ -1,4 +1,4 @@
-import { useState, useEffect } from 'react';
+import { useState, useEffect, useMemo } from 'react';
import useTabParam from '../hooks/useTabParam';
import { api } from '../services/api';
import { useToast } from '../contexts/ToastContext';
@@ -10,7 +10,7 @@ import { Pill, MetricCard, PageTopbar, SegControl, Drawer } from '../components/
import {
AlertCircle, FolderGit2, Webhook, Rocket, Server, Globe, Terminal, Tag,
X, GitBranch, RefreshCw, Plus, ExternalLink, Lock, Trash2, ChevronRight,
- Clock, AlertTriangle,
+ Clock, AlertTriangle, Settings,
} from 'lucide-react';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
@@ -18,14 +18,6 @@ import { Textarea } from '@/components/ui/textarea';
import { Label } from '@/components/ui/label';
const VALID_TABS = ['overview', 'repositories', 'access', 'webhooks', 'deployments', 'settings'];
-const TAB_OPTIONS = [
- { value: 'overview', label: 'Overview' },
- { value: 'repositories', label: 'Repositories' },
- { value: 'webhooks', label: 'Webhooks' },
- { value: 'deployments', label: 'Deployments' },
- { value: 'access', label: 'Access' },
- { value: 'settings', label: 'Settings' },
-];
const SOURCE_INITIALS = { github: 'GH', gitlab: 'GL', bitbucket: 'BB' };
@@ -962,15 +954,6 @@ function Git({ basePath = '/git' }) {
}
};
- const tabTitle = {
- overview: 'Overview',
- repositories: 'Repositories',
- access: 'Access Info',
- webhooks: 'Webhooks',
- deployments: 'Deployments',
- settings: 'Settings',
- }[activeTab];
-
const topbarActions = () => {
if (!status?.installed) {
return <Button onClick={() => setShowInstallModal(true)}>Install Git Server</Button>;
@@ -1020,18 +1003,37 @@ function Git({ basePath = '/git' }) {
}
};
+ // Tabs live in the page top bar (like Domains/Services). The single Git page
+ // renders all sections, keyed off the /git/:tab route via useTabParam — the
+ // header title + icon mirror the active tab.
+ const GIT_TABS = useMemo(() => [
+ { slug: 'overview', to: basePath, label: 'Overview', end: true, icon: <Server size={15} /> },
+ { slug: 'repositories', to: `${basePath}/repositories`, label: 'Repositories', icon: <FolderGit2 size={15} /> },
+ { slug: 'webhooks', to: `${basePath}/webhooks`, label: 'Webhooks', icon: <Webhook size={15} /> },
+ { slug: 'deployments', to: `${basePath}/deployments`, label: 'Deployments', icon: <Rocket size={15} /> },
+ { slug: 'access', to: `${basePath}/access`, label: 'Access', icon: <Globe size={15} /> },
+ { slug: 'settings', to: `${basePath}/settings`, label: 'Settings', icon: <Settings size={15} /> },
+ ], [basePath]);
+ const activeGit = GIT_TABS.find((t) => t.slug === activeTab) || GIT_TABS[0];
+
if (loading) {
return (
- <div className="git-page domains-page">
- <div className="page-loading"><Spinner size="lg" /></div>
+ <div className="page-container--full-bleed sk-tabgroup git-page domains-page">
+ <div className="sk-tabgroup__content">
+ <div className="sk-tabgroup__inner">
+ <div className="page-loading"><Spinner size="lg" /></div>
+ </div>
+ </div>
</div>
);
}
return (
- <div className="git-page domains-page">
- <PageTopbar icon={<GitBranch size={18} />} title="Git Server" actions={topbarActions()} />
+ <div className="page-container--full-bleed sk-tabgroup git-page domains-page">
+ <PageTopbar icon={activeGit.icon} title={activeGit.label} tabs={GIT_TABS} actions={topbarActions()} />
+ <div className="sk-tabgroup__content">
+ <div className="sk-tabgroup__inner">
{pageError && (
<div className="error-banner">
{pageError}
@@ -1064,13 +1066,11 @@ function Git({ basePath = '/git' }) {
) : (
<div className="domains-body">
{renderKpis()}
- <div className="dom-listhead">
- <h2 className="dom-listhead__title">{tabTitle}</h2>
- <SegControl value={activeTab} onChange={setActiveTab} options={TAB_OPTIONS} />
- </div>
{renderTabContent()}
</div>
)}
+ </div>
+ </div>
{/* Repository drawer */}
<Drawer
diff --git a/frontend/src/pages/Security.jsx b/frontend/src/pages/Security.jsx
index 0814019e..cf8dcad5 100644
--- a/frontend/src/pages/Security.jsx
+++ b/frontend/src/pages/Security.jsx
@@ -17,9 +17,8 @@ import {
EventsTab,
SecurityConfigTab,
} from '../components/security';
-import { Tabs, TabsList, TabsTrigger, TabsContent } from '@/components/ui/tabs';
import EmptyState from '../components/EmptyState';
-import { PageTopbar, MetricCard } from '@/components/ds';
+import { MetricCard } from '@/components/ds';
import { Siren, Bug, ShieldCheck, Radar } from 'lucide-react';
const VALID_TABS = ['overview', 'firewall', 'fail2ban', 'ssh-keys', 'ip-lists', 'scanner', 'quarantine', 'integrity', 'audit', 'vulnerability', 'updates', 'events', 'settings'];
@@ -28,7 +27,7 @@ const capitalize = (s) => (s ? s.charAt(0).toUpperCase() + s.slice(1) : s);
const Security = () => {
const { isAdmin } = useAuth();
- const [activeTab, setActiveTab] = useTabParam('/security', VALID_TABS);
+ const [activeTab] = useTabParam('/security', VALID_TABS);
const [status, setStatus] = useState(null);
const [clamav, setClamav] = useState(null);
const [clamavLoading, setClamavLoading] = useState(true);
@@ -63,7 +62,7 @@ const Security = () => {
if (loading) {
return (
- <div className="page-container security-page">
+ <div className="sk-tabgroup__inner security-page">
<EmptyState loading title="Loading security status..." />
</div>
);
@@ -73,9 +72,7 @@ const Security = () => {
const scanRunning = status?.scan_status === 'running';
return (
- <div className="page-container security-page">
- <PageTopbar icon={<ShieldCheck size={18} />} title="Security" />
-
+ <div className="sk-tabgroup__inner security-page">
<div className="sec-kpis" role="group" aria-label="Security overview">
<MetricCard
tone={alerts.total > 0 ? 'amber' : 'green'}
@@ -105,39 +102,21 @@ const Security = () => {
/>
</div>
- <Tabs value={activeTab} onValueChange={setActiveTab}>
- <TabsList>
- <TabsTrigger value="overview">Overview</TabsTrigger>
- <TabsTrigger value="firewall">Firewall</TabsTrigger>
- <TabsTrigger value="fail2ban">Fail2ban</TabsTrigger>
- <TabsTrigger value="ssh-keys">SSH Keys</TabsTrigger>
- <TabsTrigger value="ip-lists">IP Lists</TabsTrigger>
- <TabsTrigger value="scanner">Malware Scanner</TabsTrigger>
- <TabsTrigger value="quarantine">Quarantine</TabsTrigger>
- <TabsTrigger value="integrity">File Integrity</TabsTrigger>
- <TabsTrigger value="audit">Audit</TabsTrigger>
- <TabsTrigger value="vulnerability">Vulnerability Scan</TabsTrigger>
- <TabsTrigger value="updates">Auto Updates</TabsTrigger>
- <TabsTrigger value="events">Events</TabsTrigger>
- <TabsTrigger value="settings">Settings</TabsTrigger>
- </TabsList>
-
- <div className="tab-content">
- <TabsContent value="overview"><OverviewTab status={status} clamavStatus={clamav} clamavLoading={clamavLoading} onRefreshClamav={loadClamav} /></TabsContent>
- <TabsContent value="firewall"><FirewallTab /></TabsContent>
- <TabsContent value="fail2ban"><Fail2banTab /></TabsContent>
- <TabsContent value="ssh-keys"><SSHKeysTab /></TabsContent>
- <TabsContent value="ip-lists"><IPListsTab /></TabsContent>
- <TabsContent value="scanner"><ScannerTab /></TabsContent>
- <TabsContent value="quarantine"><QuarantineTab /></TabsContent>
- <TabsContent value="integrity"><IntegrityTab /></TabsContent>
- <TabsContent value="audit"><AuditTab /></TabsContent>
- <TabsContent value="vulnerability"><VulnerabilityTab /></TabsContent>
- <TabsContent value="updates"><AutoUpdatesTab /></TabsContent>
- <TabsContent value="events"><EventsTab /></TabsContent>
- <TabsContent value="settings"><SecurityConfigTab /></TabsContent>
- </div>
- </Tabs>
+ <div className="tab-content">
+ {activeTab === 'overview' && <OverviewTab status={status} clamavStatus={clamav} clamavLoading={clamavLoading} onRefreshClamav={loadClamav} />}
+ {activeTab === 'firewall' && <FirewallTab />}
+ {activeTab === 'fail2ban' && <Fail2banTab />}
+ {activeTab === 'ssh-keys' && <SSHKeysTab />}
+ {activeTab === 'ip-lists' && <IPListsTab />}
+ {activeTab === 'scanner' && <ScannerTab />}
+ {activeTab === 'quarantine' && <QuarantineTab />}
+ {activeTab === 'integrity' && <IntegrityTab />}
+ {activeTab === 'audit' && <AuditTab />}
+ {activeTab === 'vulnerability' && <VulnerabilityTab />}
+ {activeTab === 'updates' && <AutoUpdatesTab />}
+ {activeTab === 'events' && <EventsTab />}
+ {activeTab === 'settings' && <SecurityConfigTab />}
+ </div>
</div>
);
};
diff --git a/frontend/src/styles/components/_design-system.scss b/frontend/src/styles/components/_design-system.scss
index 912b4c31..5cb60231 100644
--- a/frontend/src/styles/components/_design-system.scss
+++ b/frontend/src/styles/components/_design-system.scss
@@ -292,8 +292,18 @@ $sk-tones: ('accent', 'green', 'cyan', 'amber', 'red', 'violet');
&__spacer { flex: 1; }
&__actions { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; }
- // Routed sub-nav (the ex-sidebar sub-items)
- &__tabs { display: inline-flex; align-items: center; gap: 2px; margin-left: 6px; }
+ // Routed sub-nav (the ex-sidebar sub-items). Grows to fill the bar so the
+ // overflow measurement in PageTopbar has a bounded width to fit against;
+ // overflow:hidden suppresses any flash before the first measurement.
+ &__tabs {
+ display: flex;
+ align-items: center;
+ gap: 2px;
+ margin-left: 6px;
+ flex: 1 1 auto;
+ min-width: 0;
+ overflow: hidden;
+ }
&__tab {
display: inline-flex;
align-items: center;
@@ -304,16 +314,26 @@ $sk-tones: ('accent', 'green', 'cyan', 'amber', 'red', 'violet');
font-weight: 450;
color: var(--text-dim);
text-decoration: none;
+ white-space: nowrap;
transition: background 0.14s, color 0.14s;
svg { width: 15px; height: 15px; }
&:hover { background: var(--surface-hover); color: var(--text); }
&.is-active { background: var(--accent-bg); color: var(--accent-bright); font-weight: 500; }
}
+ // Overflow ("More") trigger — a tab-styled button that never collapses.
+ &__more {
+ flex-shrink: 0;
+ border: none;
+ background: transparent;
+ font: inherit;
+ cursor: pointer;
+ &[data-state="open"] { background: var(--surface-hover); color: var(--text); }
+ }
@media (max-width: 768px) {
flex-wrap: wrap;
- &__tabs { order: 3; width: 100%; margin-left: 0; overflow-x: auto; }
+ &__tabs { order: 3; width: 100%; margin-left: 0; }
}
}
diff --git a/frontend/src/styles/pages/_backups.scss b/frontend/src/styles/pages/_backups.scss
index 2da8d83a..335fa890 100644
--- a/frontend/src/styles/pages/_backups.scss
+++ b/frontend/src/styles/pages/_backups.scss
@@ -14,33 +14,6 @@
@media (max-width: $breakpoint-sm) { grid-template-columns: 1fr; }
}
- // ── tab strip (shadcn .tabs/.tab → accent wash) ─────────
- .tabs {
- gap: 2px;
- border-bottom: 1px solid var(--border-soft);
- }
-
- .tab {
- padding: 8px 13px;
- border-radius: 8px 8px 0 0;
- border-bottom: 2px solid transparent;
- margin-bottom: -1px;
- font-size: 13px;
- color: var(--text-dim);
-
- &:hover {
- color: var(--text);
- background: var(--surface-hover);
- }
-
- &.active,
- &[data-state="active"] {
- color: var(--accent-bright);
- background: var(--accent-bg);
- border-bottom-color: var(--accent-bright);
- }
- }
-
// ── list head: mono eyebrow + segmented filter + actions ─
.bk-listhead {
display: flex;
diff --git a/frontend/src/styles/pages/_security.scss b/frontend/src/styles/pages/_security.scss
index 2e3a3cff..4a7fbb0f 100644
--- a/frontend/src/styles/pages/_security.scss
+++ b/frontend/src/styles/pages/_security.scss
@@ -28,33 +28,6 @@
line-height: 1.25;
}
- // ── tab strip — accent wash + underline on active ───────
- .tabs {
- gap: 2px;
- border-bottom: 1px solid var(--border-soft);
- }
-
- .tab {
- padding: 8px 13px;
- border-radius: 8px 8px 0 0;
- border-bottom: 2px solid transparent;
- margin-bottom: -1px;
- font-size: 13px;
- color: var(--text-dim);
-
- &:hover {
- color: var(--text);
- background: var(--surface-hover);
- }
-
- &.active,
- &[data-state="active"] {
- color: var(--accent-bright);
- background: var(--accent-bg);
- border-bottom-color: var(--accent-bright);
- }
- }
-
// ── card chrome (all tabs) ──────────────────────────────
.tab-content {
.card {