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.

UI: revamp dialogs, badges, and alerts tab

Juan Denisfea0698f3eb3
diff --git a/.gitignore b/.gitignore
index 5f27581a..33989c57 100644
--- a/.gitignore
+++ b/.gitignore
@@ -96,6 +96,7 @@ new_templates/
nul
SECURITY_AUDIT.md
APP_IMPROVEMENTS.md
+UI_REPORT.md
*.png
# MSI / build artifacts that should not be committed.
diff --git a/agent/internal/ipc/server.go b/agent/internal/ipc/server.go
index d337f5be..1f0dfef3 100644
--- a/agent/internal/ipc/server.go
+++ b/agent/internal/ipc/server.go
@@ -144,11 +144,23 @@ func (s *Server) Start(ctx context.Context) error {
// Load or generate the bearer token before binding the listener.
// Token failures are fatal — running the IPC API without auth
// would expose /restart and /logs to any local process.
- tok, err := loadOrGenerateToken(config.IPCTokenPath())
- if err != nil {
- return fmt.Errorf("ipc token: %w", err)
+ //
+ // SERVERKIT_IPC_NO_AUTH=true disables the bearer check entirely.
+ // This exists for dev environments where the desktop console
+ // bundle, asset server, and agent service can't always be
+ // rebuilt in lockstep — the auth requires all three to ship
+ // together. Logged at WARN every startup so it can't be set
+ // silently in production.
+ noAuth := os.Getenv("SERVERKIT_IPC_NO_AUTH") == "true"
+ if noAuth {
+ s.log.Warn("SERVERKIT_IPC_NO_AUTH=true: IPC bearer-token check is DISABLED; only use this for development")
+ } else {
+ tok, err := loadOrGenerateToken(config.IPCTokenPath())
+ if err != nil {
+ return fmt.Errorf("ipc token: %w", err)
+ }
+ s.token = tok
}
- s.token = tok
mux := http.NewServeMux()
@@ -173,9 +185,13 @@ func (s *Server) Start(ctx context.Context) error {
addr = fmt.Sprintf("127.0.0.1:%d", s.cfg.Port)
}
+ var handler http.Handler = mux
+ if !noAuth {
+ handler = authMiddleware(s.token, handler)
+ }
s.server = &http.Server{
Addr: addr,
- Handler: corsMiddleware(authMiddleware(s.token, mux)),
+ Handler: corsMiddleware(handler),
ReadTimeout: 5 * time.Second,
WriteTimeout: 10 * time.Second,
IdleTimeout: 60 * time.Second,
@@ -222,7 +238,15 @@ func (s *Server) Stop() error {
return s.server.Shutdown(ctx)
}
-// corsMiddleware adds CORS headers for local development
+// corsMiddleware adds CORS headers for local development.
+//
+// The desktop console's React UI runs on the asset server (127.0.0.1:<random>)
+// and calls the IPC server (127.0.0.1:19780) — different ports means CORS
+// applies. Authorization must be in Allow-Headers, otherwise the browser
+// preflight refuses to forward the bearer token and every IPC request
+// arrives unauthenticated → 401 storm. The previous list (just Content-Type)
+// was OK before IPC auth existed; with auth required, it silently broke
+// the entire desktop console.
func corsMiddleware(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
// Only allow requests from localhost
@@ -230,7 +254,7 @@ func corsMiddleware(next http.Handler) http.Handler {
if origin == "" || isLocalhost(origin) {
w.Header().Set("Access-Control-Allow-Origin", origin)
w.Header().Set("Access-Control-Allow-Methods", "GET, POST, OPTIONS")
- w.Header().Set("Access-Control-Allow-Headers", "Content-Type")
+ w.Header().Set("Access-Control-Allow-Headers", "Authorization, Content-Type")
}
if r.Method == "OPTIONS" {
diff --git a/frontend/src/components/ConfirmDialog.jsx b/frontend/src/components/ConfirmDialog.jsx
index 6cb1f3e1..ddbd9c00 100644
--- a/frontend/src/components/ConfirmDialog.jsx
+++ b/frontend/src/components/ConfirmDialog.jsx
@@ -16,6 +16,7 @@ import { cn } from '@/lib/utils';
const iconMap = { danger: AlertTriangle, warning: AlertCircle, info: Info };
const iconColor = { danger: 'text-destructive', warning: 'text-yellow-400', info: 'text-blue-400' };
+const iconBg = { danger: 'bg-destructive/10', warning: 'bg-yellow-500/10', info: 'bg-blue-500/10' };
export function ConfirmDialog({
isOpen,
@@ -37,22 +38,31 @@ export function ConfirmDialog({
const Icon = iconMap[variant] || AlertTriangle;
const isConfirmDisabled = requireConfirmation && inputValue !== requireConfirmation;
- return (
- <AlertDialog open={isOpen} onOpenChange={(v) => !v && onCancel()}>
- <AlertDialogContent>
- <AlertDialogHeader>
- <div className="flex items-start gap-3">
- <div className={cn('flex-shrink-0 mt-0.5', iconColor[variant] || 'text-destructive')}>
- <Icon size={22} />
+ return (
+ <AlertDialog open={isOpen} onOpenChange={(v) => !v && onCancel()}>
+ <AlertDialogContent className="sm:max-w-xl">
+ <AlertDialogHeader className="items-center text-center sm:text-center">
+ <div className="flex flex-col items-center gap-3">
+ <div
+ className={cn(
+ 'flex size-12 shrink-0 items-center justify-center rounded-full border',
+ iconBg[variant] || iconBg.danger,
+ iconColor[variant] || 'text-destructive',
+ variant === 'danger' && 'border-destructive/20',
+ variant === 'warning' && 'border-yellow-500/20',
+ variant === 'info' && 'border-blue-500/20'
+ )}
+ >
+ <Icon size={24} />
</div>
- <div className="flex-1 min-w-0">
+ <div className="min-w-0">
<AlertDialogTitle>{title}</AlertDialogTitle>
{message && <AlertDialogDescription className="mt-1.5">{message}</AlertDialogDescription>}
{details && <p className="text-sm text-muted-foreground mt-1.5">{details}</p>}
</div>
</div>
{requireConfirmation && (
- <div className="space-y-1.5 mt-2">
+ <div className="space-y-2 mt-2 w-full text-left">
<Label className="text-muted-foreground">
Type <strong className="text-foreground">{requireConfirmation}</strong> to confirm:
</Label>
@@ -66,7 +76,7 @@ export function ConfirmDialog({
</div>
)}
</AlertDialogHeader>
- <AlertDialogFooter>
+ <AlertDialogFooter className="sm:justify-center">
<AlertDialogCancel onClick={onCancel}>{cancelText}</AlertDialogCancel>
<AlertDialogAction
onClick={onConfirm}
diff --git a/frontend/src/components/Modal.jsx b/frontend/src/components/Modal.jsx
index ce27d351..d8bf74ea 100644
--- a/frontend/src/components/Modal.jsx
+++ b/frontend/src/components/Modal.jsx
@@ -1,19 +1,19 @@
import {
- Sheet,
- SheetContent,
- SheetHeader,
- SheetTitle,
- SheetFooter,
-} from '@/components/ui/sheet';
+ Dialog,
+ DialogContent,
+ DialogHeader,
+ DialogTitle,
+ DialogFooter,
+} from '@/components/ui/dialog';
import { cn } from '@/lib/utils';
-// Size → Tailwind max-width on >=sm screens. Mobile is always full-width.
+// Size → Tailwind max-width on >=sm screens. Mobile is always nearly full-width.
const SIZE_CLASS = {
- sm: 'sm:max-w-sm', // 384px
- md: 'sm:max-w-md', // 448px (default)
- lg: 'sm:max-w-2xl', // 672px
- xl: 'sm:max-w-4xl', // 896px
- '2xl': 'sm:max-w-6xl', // 1152px — large workspaces (QueryRunner, CompareView)
+ sm: 'sm:max-w-sm',
+ md: 'sm:max-w-lg',
+ lg: 'sm:max-w-2xl',
+ xl: 'sm:max-w-4xl',
+ '2xl': 'sm:max-w-6xl',
};
export default function Modal({
@@ -28,30 +28,28 @@ export default function Modal({
const sizeClass = SIZE_CLASS[size] || SIZE_CLASS.md;
return (
- <Sheet open={open} onOpenChange={(v) => !v && onClose()}>
- <SheetContent
- side="right"
+ <Dialog open={open} onOpenChange={(v) => !v && onClose()}>
+ <DialogContent
className={cn(
- // Override Sheet's default sm:max-w-md with our explicit size token.
- 'p-0 flex flex-col gap-0',
+ 'max-h-[90vh] overflow-hidden p-0 flex flex-col gap-0',
sizeClass,
className
)}
>
{title && (
- <SheetHeader className="px-6 py-4 border-b border-border space-y-0">
- <SheetTitle>{title}</SheetTitle>
- </SheetHeader>
+ <DialogHeader className="px-6 py-4 pr-12 border-b border-border space-y-0">
+ <DialogTitle>{title}</DialogTitle>
+ </DialogHeader>
)}
<div className="flex-1 overflow-y-auto px-6 py-4">{children}</div>
{footer && (
- <SheetFooter className="px-6 py-3 border-t border-border bg-card sm:justify-end">
+ <DialogFooter className="px-6 py-3 border-t border-border bg-card sm:justify-end">
{footer}
- </SheetFooter>
+ </DialogFooter>
)}
- </SheetContent>
- </Sheet>
+ </DialogContent>
+ </Dialog>
);
}
diff --git a/frontend/src/components/ProcessTable.jsx b/frontend/src/components/ProcessTable.jsx
index f888f4e7..fc5a21fb 100644
--- a/frontend/src/components/ProcessTable.jsx
+++ b/frontend/src/components/ProcessTable.jsx
@@ -61,12 +61,14 @@ export function ProcessTable({
</td>
<td>
<div className="action-buttons">
- {onKill && (
+ {onKill && (
<Button
variant="outline"
- size="sm"
+ size="icon"
+ className="process-action-button"
onClick={(e) => { e.stopPropagation(); onKill(p); }}
title="Kill"
+ aria-label={`Kill ${p.name}`}
>
<X size={12} />
</Button>
@@ -74,9 +76,11 @@ export function ProcessTable({
{onForceKill && (
<Button
variant="destructive"
- size="sm"
+ size="icon"
+ className="process-action-button"
onClick={(e) => { e.stopPropagation(); onForceKill(p); }}
title="Force Kill"
+ aria-label={`Force kill ${p.name}`}
>
<AlertTriangle size={12} />
</Button>
diff --git a/frontend/src/components/StatusBadge.jsx b/frontend/src/components/StatusBadge.jsx
index 523c29d5..4ca4af27 100644
--- a/frontend/src/components/StatusBadge.jsx
+++ b/frontend/src/components/StatusBadge.jsx
@@ -36,7 +36,7 @@ export default function StatusBadge({ status, label, className = '' }) {
const displayLabel = label || STATUS_LABEL[key] || status;
return (
- <Badge variant={variant} className={cn('gap-1.5', className)}>
+ <Badge variant={variant} className={cn('status-badge-token', className)}>
<span className={cn('size-1.5 rounded-full shrink-0', dotColor)} />
{displayLabel}
</Badge>
diff --git a/frontend/src/components/ui/badge.jsx b/frontend/src/components/ui/badge.jsx
index 7641d026..68d5490f 100644
--- a/frontend/src/components/ui/badge.jsx
+++ b/frontend/src/components/ui/badge.jsx
@@ -3,7 +3,7 @@ import { cva } from 'class-variance-authority';
import { cn } from '@/lib/utils';
const badgeVariants = cva(
- 'inline-flex items-center rounded-md border px-2.5 py-1 text-xs font-semibold transition-colors leading-none',
+ 'inline-flex min-h-6 items-center justify-center gap-1.5 whitespace-nowrap rounded-full border px-2.5 py-1 text-xs font-semibold leading-none transition-colors',
{
variants: {
variant: {
@@ -24,7 +24,12 @@ const badgeVariants = cva(
function Badge({ className, variant, ...props }) {
return (
- <span className={cn(badgeVariants({ variant }), className)} {...props} />
+ <span
+ data-slot="badge"
+ data-variant={variant || 'default'}
+ className={cn(badgeVariants({ variant }), className)}
+ {...props}
+ />
);
}
diff --git a/frontend/src/components/ui/button.jsx b/frontend/src/components/ui/button.jsx
index 2d4de646..3bdcc2c9 100644
--- a/frontend/src/components/ui/button.jsx
+++ b/frontend/src/components/ui/button.jsx
@@ -16,16 +16,23 @@ const buttonVariants = cva(
link: 'text-primary underline-offset-4 hover:underline',
},
size: {
- default: 'h-9 px-4 py-2 has-[>svg]:px-3',
- sm: 'h-8 rounded-md gap-1.5 px-3 text-xs has-[>svg]:px-2.5',
- lg: 'h-10 rounded-md px-6 has-[>svg]:px-4',
- icon: 'size-9',
+ default: 'h-10 min-w-24 px-5 py-2.5 has-[>svg]:px-4',
+ sm: 'h-8 min-w-[4.5rem] rounded-md gap-1.5 px-3.5 text-xs has-[>svg]:px-3',
+ lg: 'h-11 min-w-32 rounded-lg px-7 text-base has-[>svg]:px-5',
+ icon: 'size-9 min-w-0 p-0',
},
},
defaultVariants: {
variant: 'default',
size: 'default',
},
+ compoundVariants: [
+ {
+ variant: 'ghost',
+ size: 'icon',
+ className: 'border border-border bg-transparent text-muted-foreground shadow-xs hover:bg-accent hover:text-accent-foreground',
+ },
+ ],
}
);
diff --git a/frontend/src/components/ui/tabs.jsx b/frontend/src/components/ui/tabs.jsx
index f5f84906..9207d977 100644
--- a/frontend/src/components/ui/tabs.jsx
+++ b/frontend/src/components/ui/tabs.jsx
@@ -169,18 +169,20 @@ const TabsList = React.forwardRef(({ className, children, ...props }, ref) => {
const triggerEl = triggerRefs.current[idx];
const isActive = triggerEl?.dataset?.state === 'active';
return (
- <button
+ <TabsPrimitive.Trigger
key={`overflow-${child.key ?? idx}`}
type="button"
+ value={child.props.value}
+ disabled={child.props.disabled}
className="tabs-overflow-item"
data-state={isActive ? 'active' : 'inactive'}
- onClick={() => {
- triggerRefs.current[idx]?.click();
+ onClick={(event) => {
+ child.props.onClick?.(event);
setPopoverOpen(false);
}}
>
{child.props.children}
- </button>
+ </TabsPrimitive.Trigger>
);
})}
</div>
diff --git a/frontend/src/pages/Docker.jsx b/frontend/src/pages/Docker.jsx
index daf95d0c..26f2c5ab 100644
--- a/frontend/src/pages/Docker.jsx
+++ b/frontend/src/pages/Docker.jsx
@@ -29,6 +29,36 @@ const unwrapRemoteData = (response) => {
return response;
};
+// formatPorts normalises Docker port data from the two shapes the agent
+// returns: a comma-separated string (legacy `docker ps`-style output)
+// or an array of `{ip, private_port, public_port, type}` objects from
+// `docker inspect`. Always returns an array of human-readable strings,
+// or `['-']` when there are no ports — both call sites (the container
+// list grid and the inspector drawer) want array semantics. Rendering
+// the raw inspect array directly triggered React error #31.
+function formatPorts(ports) {
+ if (!ports) return ['-'];
+ if (Array.isArray(ports)) {
+ const formatted = ports
+ .map((p) => {
+ if (!p || typeof p !== 'object') return null;
+ const proto = p.type || p.protocol || 'tcp';
+ const priv = p.private_port ?? p.PrivatePort;
+ const pub = p.public_port ?? p.PublicPort;
+ const ip = p.ip || p.IP;
+ if (pub) {
+ return `${ip ? `${ip}:` : ''}${pub}->${priv}/${proto}`;
+ }
+ return priv ? `${priv}/${proto}` : null;
+ })
+ .filter(Boolean);
+ return formatted.length > 0 ? formatted : ['-'];
+ }
+ if (typeof ports !== 'string') return ['-'];
+ const parts = ports.split(',').map((p) => p.trim()).filter(Boolean);
+ return parts.length > 0 ? parts : ['-'];
+}
+
const normalizeListResponse = (response, key) => {
const data = unwrapRemoteData(response);
if (Array.isArray(data)) return data;
@@ -556,13 +586,6 @@ const ContainersTab = ({ onStatsChange }) => {
return { cpu, memory };
}
- function formatPorts(portsStr) {
- if (!portsStr) return '-';
- // Parse ports like "0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp"
- const ports = portsStr.split(',').map(p => p.trim()).filter(Boolean);
- return ports.length > 0 ? ports : ['-'];
- }
-
const [statusFilter, setStatusFilter] = useState('all');
const counts = useMemo(() => {
@@ -1669,10 +1692,10 @@ const ContainerLogsModal = ({ container, onClose }) => {
<span className="meta-label">ID</span>
<span className="meta-value mono">{container.id}</span>
</div>
- {container.ports && (
+ {container.ports && container.ports.length > 0 && (
<div className="meta-item meta-item-wide">
<span className="meta-label">Ports</span>
- <span className="meta-value mono">{container.ports || '—'}</span>
+ <span className="meta-value mono">{formatPorts(container.ports).join(', ')}</span>
</div>
)}
</div>
diff --git a/frontend/src/pages/ServerDetail.jsx b/frontend/src/pages/ServerDetail.jsx
index 7dd618fa..cf89812b 100644
--- a/frontend/src/pages/ServerDetail.jsx
+++ b/frontend/src/pages/ServerDetail.jsx
@@ -6,12 +6,27 @@ import MetricsGraph from '../components/MetricsGraph';
import { useConfirm } from '../hooks/useConfirm';
import { ConfirmDialog } from '../components/ConfirmDialog';
import { DangerZone } from '../components/DangerZone';
-import { InfoList, InfoItem } from '../components/InfoList';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Textarea } from '@/components/ui/textarea';
import { Badge } from '@/components/ui/badge';
import { Tabs, TabsList, TabsTrigger, TabsContent } from '@/components/ui/tabs';
+import {
+ Dialog,
+ DialogContent,
+ DialogHeader,
+ DialogTitle,
+ DialogDescription,
+ DialogFooter,
+} from '@/components/ui/dialog';
+import { Label } from '@/components/ui/label';
+import {
+ Select,
+ SelectContent,
+ SelectItem,
+ SelectTrigger,
+ SelectValue,
+} from '@/components/ui/select';
import PackagesTab from '../components/serverdetail/PackagesTab';
import ServicesTab from '../components/serverdetail/ServicesTab';
import SystemStatusCard from '../components/serverdetail/SystemStatusCard';
@@ -26,9 +41,10 @@ const ServerDetail = () => {
const [loading, setLoading] = useState(true);
const [error, setError] = useState(null);
const [showTokenModal, setShowTokenModal] = useState(false);
+ const [securityAlerts, setSecurityAlerts] = useState([]);
const toast = useToast();
- const validTabs = ['overview', 'docker', 'cron', 'cloudflared', 'packages', 'services', 'metrics', 'settings'];
+ const validTabs = ['overview', 'docker', 'cron', 'cloudflared', 'packages', 'services', 'metrics', 'alerts', 'settings'];
const activeTab = validTabs.includes(tab) ? tab : 'overview';
const loadServer = useCallback(async () => {
@@ -68,6 +84,39 @@ const ServerDetail = () => {
loadServer();
}, [loadServer]);
+ const loadSecurityAlerts = useCallback(async () => {
+ try {
+ const data = await api.getServerSecurityAlerts(id, { status: 'open', limit: 25 });
+ setSecurityAlerts(Array.isArray(data) ? data : []);
+ } catch (err) {
+ console.error('Failed to load security alerts:', err);
+ }
+ }, [id]);
+
+ useEffect(() => {
+ loadSecurityAlerts();
+ }, [loadSecurityAlerts]);
+
+ async function handleAcknowledgeAlert(alertId) {
+ try {
+ await api.acknowledgeAlert(alertId);
+ setSecurityAlerts(prev => prev.map(a =>
+ a.id === alertId ? { ...a, status: 'acknowledged' } : a
+ ));
+ } catch {
+ toast.error('Failed to acknowledge alert');
+ }
+ }
+
+ async function handleResolveAlert(alertId) {
+ try {
+ await api.resolveAlert(alertId);
+ setSecurityAlerts(prev => prev.filter(a => a.id !== alertId));
+ } catch {
+ toast.error('Failed to resolve alert');
+ }
+ }
+
useEffect(() => {
if (server?.status === 'online') {
loadMetrics();
@@ -150,6 +199,25 @@ const ServerDetail = () => {
);
}
+ // Aggregate any "you should know about this" alerts into a single
+ // Alerts tab. Today only the polling-transport fallback shows up as
+ // a system notification, but this is the place to add future
+ // advisories (stale agent, missing capabilities, expiring tokens,
+ // etc.). Security alerts (raised by the security service) are
+ // surfaced alongside them so there's only one place to look.
+ const systemNotifications = [];
+ if (server.transport === 'poll') {
+ systemNotifications.push({
+ id: 'limited-mode',
+ severity: 'warning',
+ title: 'Limited mode',
+ message:
+ 'This agent connected via the REST polling fallback because the WebSocket link could not be established cleanly. Heartbeats and one-shot commands work; live logs, real-time metrics, and terminal sessions are unavailable until the WS link is restored.',
+ });
+ }
+ const openSecurityAlerts = securityAlerts.filter(a => a.status === 'open');
+ const totalAlertCount = systemNotifications.length + openSecurityAlerts.length;
+
// Show the cron tab only when the agent reported the capability.
// Older agents (pre-1.6.16) and Windows hosts won't have it set —
// hiding the tab matches the rest of the panel's "don't expose what
@@ -162,6 +230,9 @@ const ServerDetail = () => {
...(server.capabilities?.packages ? [{ id: 'packages', label: 'Packages' }] : []),
...(server.capabilities?.systemd ? [{ id: 'services', label: 'Services' }] : []),
{ id: 'metrics', label: 'Metrics' },
+ ...(totalAlertCount > 0
+ ? [{ id: 'alerts', label: 'Alerts', badge: totalAlertCount }]
+ : [{ id: 'alerts', label: 'Alerts' }]),
{ id: 'settings', label: 'Settings' }
];
@@ -181,21 +252,16 @@ const ServerDetail = () => {
<div className="server-detail-header__identity">
<div className="server-detail-header__title-row">
<h1>{server.name}</h1>
- <CopyChip
- label="name"
- value={server.name}
- title="Copy server name"
- />
+ <span className={`status-pill status-pill--${server.status || 'pending'}`}>
+ <span className="status-pill__dot" />
+ {server.status || 'pending'}
+ </span>
<CopyChip
label="id"
value={server.id}
title="Copy server ID"
mono
/>
- <span className={`status-pill status-pill--${server.status || 'pending'}`}>
- <span className="status-pill__dot" />
- {server.status || 'pending'}
- </span>
</div>
<div className="server-detail-header__meta">
<span className="mono">{server.hostname || server.ip_address || 'No endpoint configured'}</span>
@@ -215,24 +281,10 @@ const ServerDetail = () => {
)}
</div>
</div>
- {server.transport === 'poll' && (
- <div className="server-detail-header__transport-banner">
- <strong>Limited mode:</strong> this agent connected via the REST polling
- fallback because the WebSocket link couldn't be established cleanly.
- Heartbeats and one-shot commands work; live logs, real-time metrics, and
- terminal sessions are unavailable until the WS link is restored.
- </div>
- )}
<div className="server-detail-header__actions">
- <Button variant="outline" onClick={handlePingServer}>
+ <Button variant="outline" size="sm" onClick={handlePingServer}>
<RefreshIcon /> Ping
</Button>
- <Button variant="outline" asChild>
- <Link to={`/servers/${id}/docker`}>Docker</Link>
- </Button>
- <Button onClick={handleOpenTokenModal}>
- <KeyIcon /> Connection String
- </Button>
</div>
</header>
@@ -244,7 +296,10 @@ const ServerDetail = () => {
>
<TabsList>
{tabs.map(t => (
- <TabsTrigger key={t.id} value={t.id}>{t.label}</TabsTrigger>
+ <TabsTrigger key={t.id} value={t.id}>
+ {t.label}
+ {t.badge ? <span className="tab-badge">{t.badge}</span> : null}
+ </TabsTrigger>
))}
</TabsList>
@@ -283,6 +338,14 @@ const ServerDetail = () => {
<TabsContent value="metrics">
<MetricsTab serverId={id} metrics={metrics} />
</TabsContent>
+ <TabsContent value="alerts">
+ <AlertsTab
+ notifications={systemNotifications}
+ securityAlerts={securityAlerts}
+ onAcknowledge={handleAcknowledgeAlert}
+ onResolve={handleResolveAlert}
+ />
+ </TabsContent>
<TabsContent value="settings">
<SettingsTab
server={server}
@@ -332,104 +395,295 @@ const OverviewTab = ({ server, metrics, systemInfo, onRefreshServer }) => {
return `${hours}h ${mins}m`;
};
+ const isOnline = server.status === 'online';
+ const cpuCores = systemInfo?.cpu_cores || server.cpu_cores;
+ const cpuModel = systemInfo?.cpu_model || server.cpu_model;
+ const totalMemory = systemInfo?.total_memory || server.total_memory;
+ const totalDisk = systemInfo?.total_disk || server.total_disk;
+ const osLabel = `${systemInfo?.os || server.os_type || 'Unknown'}${systemInfo?.os_version || server.os_version ? ` ${systemInfo?.os_version || server.os_version}` : ''}`;
+
return (
<div className="overview-tab">
+ <div className="server-stats-strip">
+ <KpiTile
+ icon={<PulseIcon />}
+ label="Status"
+ value={server.status || 'pending'}
+ tone={isOnline ? 'success' : server.status === 'connecting' ? 'warning' : 'danger'}
+ accent
+ />
+ <KpiTile
+ icon={<ClockIcon />}
+ label="Uptime"
+ value={isOnline ? formatUptime(metrics?.uptime) : '—'}
+ sub={isOnline && metrics?.uptime ? 'since last boot' : null}
+ />
+ <KpiGauge
+ icon={<CpuIcon />}
+ label="CPU"
+ percent={isOnline ? metrics?.cpu_percent : null}
+ color="var(--accent-primary)"
+ sub={cpuCores ? `${cpuCores} cores` : null}
+ />
+ <KpiGauge
+ icon={<MemoryIcon />}
+ label="Memory"
+ percent={isOnline ? metrics?.memory_percent : null}
+ color="#10B981"
+ sub={totalMemory ? formatBytes(totalMemory) : null}
+ />
+ <KpiGauge
+ icon={<DiskIcon />}
+ label="Disk"
+ percent={isOnline ? metrics?.disk_percent : null}
+ color="#F59E0B"
+ sub={totalDisk ? formatBytes(totalDisk) : null}
+ />
+ </div>
+
+ {!isOnline && (
+ <div className="info-card offline-card">
+ <div className="offline-message">
+ <OfflineIcon />
+ <h4>Server Offline</h4>
+ <p>
+ {server.status === 'pending'
+ ? 'Waiting for agent installation...'
+ : 'Unable to connect to the server agent.'}
+ </p>
+ </div>
+ </div>
+ )}
+
<div className="overview-grid">
- <div className="info-card">
- <h3>Server Information</h3>
- <InfoList>
- <InfoItem label="Status">
+ <div className="info-card info-card--accent">
+ <h3><ServerIcon /> Server Information</h3>
+ <ul className="info-rows">
+ <InfoRow icon={<PulseIcon />} label="Status">
<span className={`status-badge ${server.status}`}>{server.status}</span>
- </InfoItem>
- <InfoItem label="Hostname" value={server.hostname || 'N/A'} />
- <InfoItem label="IP Address" value={server.ip_address || 'N/A'} />
- <InfoItem label="Group" value={server.group_name || 'Ungrouped'} />
- <InfoItem
+ </InfoRow>
+ <InfoRow icon={<HostIcon />} label="Hostname" value={server.hostname || 'N/A'} mono />
+ <InfoRow icon={<NetworkIcon />} label="IP Address" value={server.ip_address || 'N/A'} mono />
+ <InfoRow icon={<FolderTinyIcon />} label="Group" value={server.group_name || 'Ungrouped'} />
+ <InfoRow
+ icon={<ClockIcon />}
label="Last Seen"
value={server.last_seen ? new Date(server.last_seen).toLocaleString() : 'Never'}
/>
- </InfoList>
+ </ul>
</div>
- <div className="info-card">
- <h3>System Information</h3>
- <InfoList>
- <InfoItem
- label="Operating System"
- value={`${systemInfo?.os || server.os_type || 'Unknown'}${systemInfo?.os_version || server.os_version ? ` ${systemInfo?.os_version || server.os_version}` : ''}`}
- />
- <InfoItem label="Architecture" value={systemInfo?.architecture || server.architecture || 'N/A'} />
- <InfoItem
+ <div className="info-card info-card--accent">
+ <h3><ChipIcon /> System Information</h3>
+ <ul className="info-rows">
+ <InfoRow icon={<OsIcon />} label="Operating System" value={osLabel} />
+ <InfoRow icon={<ArchIcon />} label="Architecture" value={systemInfo?.architecture || server.architecture || 'N/A'} mono />
+ <InfoRow
+ icon={<CpuIcon />}
label="CPU"
value={
- ((systemInfo?.cpu_model || server.cpu_model) || 'N/A') +
- (systemInfo?.cpu_cores || server.cpu_cores
- ? ` (${systemInfo?.cpu_cores || server.cpu_cores} cores)`
- : '')
+ (cpuModel || 'N/A') + (cpuCores ? ` (${cpuCores} cores)` : '')
}
/>
- <InfoItem label="Total Memory" value={formatBytes(systemInfo?.total_memory || server.total_memory)} />
- <InfoItem label="Total Disk" value={formatBytes(systemInfo?.total_disk || server.total_disk)} />
- </InfoList>
+ <InfoRow icon={<MemoryIcon />} label="Total Memory" value={formatBytes(totalMemory)} mono />
+ <InfoRow icon={<DiskIcon />} label="Total Disk" value={formatBytes(totalDisk)} mono />
+ </ul>
</div>
- <div className="info-card">
- <h3>Agent Information</h3>
- <InfoList>
- <InfoItem label="Agent Version" value={server.agent_version || 'Not installed'} />
- <InfoItem label="Agent ID" value={server.agent_id || 'N/A'} mono />
- <InfoItem label="Docker Version" value={server.docker_version || systemInfo?.docker_version || 'N/A'} />
- <InfoItem label="Uptime" value={formatUptime(metrics?.uptime)} />
- </InfoList>
+ <div className="info-card info-card--accent overview-grid__full">
+ <h3><AgentIcon /> Agent Information</h3>
+ <ul className="info-rows info-rows--columns">
+ <InfoRow icon={<TagIcon />} label="Agent Version" value={server.agent_version || 'Not installed'} mono />
+ <InfoRow icon={<HashIcon />} label="Agent ID" value={server.agent_id || 'N/A'} mono />
+ <InfoRow icon={<DockerMiniIcon />} label="Docker Version" value={server.docker_version || systemInfo?.docker_version || 'N/A'} mono />
+ <InfoRow icon={<ClockIcon />} label="Uptime" value={formatUptime(metrics?.uptime)} mono />
+ </ul>
</div>
- {server.status === 'online' && metrics && (
- <div className="info-card metrics-card">
- <h3>Current Resources</h3>
- <div className="resource-meters">
- <ResourceMeter label="CPU" value={metrics.cpu_percent} color="#6366F1" />
- <ResourceMeter label="Memory" value={metrics.memory_percent} color="#10B981" />
- <ResourceMeter label="Disk" value={metrics.disk_percent} color="#F59E0B" />
- </div>
- </div>
- )}
+ <div className="overview-grid__full">
+ <SystemStatusCard server={server} onRefresh={onRefreshServer} />
+ </div>
+ </div>
+ </div>
+ );
+};
- {server.status !== 'online' && (
- <div className="info-card offline-card">
- <div className="offline-message">
- <OfflineIcon />
- <h4>Server Offline</h4>
- <p>
- {server.status === 'pending'
- ? 'Waiting for agent installation...'
- : 'Unable to connect to the server agent.'}
- </p>
- </div>
- </div>
- )}
+const AlertsTab = ({ notifications, securityAlerts, onAcknowledge, onResolve }) => {
+ const sysItems = notifications || [];
+ const secItems = securityAlerts || [];
+ const openSec = secItems.filter(a => a.status === 'open');
+ const ackSec = secItems.filter(a => a.status === 'acknowledged');
- <SystemStatusCard server={server} onRefresh={onRefreshServer} />
+ if (sysItems.length === 0 && secItems.length === 0) {
+ return (
+ <div className="alerts-tab">
+ <div className="notifications-empty">
+ <BellIcon />
+ <h4>All clear</h4>
+ <p>No active alerts for this server.</p>
+ </div>
</div>
+ );
+ }
+
+ return (
+ <div className="alerts-tab">
+ {sysItems.length > 0 && (
+ <section className="alerts-section">
+ <header className="alerts-section__header">
+ <h3>System</h3>
+ <span className="alerts-section__count">{sysItems.length}</span>
+ </header>
+ <ul className="notifications-list">
+ {sysItems.map((n) => (
+ <li key={n.id} className={`notification notification--${n.severity || 'info'}`}>
+ <span className="notification__icon">
+ {n.severity === 'warning' || n.severity === 'danger' ? <AlertIcon /> : <InfoCircleIcon />}
+ </span>
+ <div className="notification__body">
+ <div className="notification__title">{n.title}</div>
+ <p className="notification__message">{n.message}</p>
+ </div>
+ </li>
+ ))}
+ </ul>
+ </section>
+ )}
+
+ {openSec.length > 0 && (
+ <section className="alerts-section">
+ <header className="alerts-section__header">
+ <h3>Security</h3>
+ <span className="alerts-section__count">{openSec.length} open</span>
+ </header>
+ <ul className="notifications-list">
+ {openSec.map(a => (
+ <SecurityAlertItem
+ key={a.id}
+ alert={a}
+ onAcknowledge={onAcknowledge}
+ onResolve={onResolve}
+ />
+ ))}
+ </ul>
+ </section>
+ )}
+
+ {ackSec.length > 0 && (
+ <section className="alerts-section alerts-section--muted">
+ <header className="alerts-section__header">
+ <h3>Acknowledged</h3>
+ <span className="alerts-section__count">{ackSec.length}</span>
+ </header>
+ <ul className="notifications-list">
+ {ackSec.map(a => (
+ <SecurityAlertItem
+ key={a.id}
+ alert={a}
+ onAcknowledge={onAcknowledge}
+ onResolve={onResolve}
+ />
+ ))}
+ </ul>
+ </section>
+ )}
</div>
);
};
-const ResourceMeter = ({ label, value, color }) => {
- const safeValue = Math.min(Math.max(value || 0, 0), 100);
+const SecurityAlertItem = ({ alert, onAcknowledge, onResolve }) => {
+ const sev = (alert.severity || 'info').toLowerCase();
+ const tone =
+ sev === 'critical' || sev === 'high' ? 'danger' :
+ sev === 'medium' || sev === 'warning' ? 'warning' : 'info';
+ const title = (alert.alert_type || 'alert').replace(/_/g, ' ');
return (
- <div className="resource-meter">
- <div className="resource-header">
- <span className="resource-label">{label}</span>
- <span className="resource-value">{safeValue.toFixed(1)}%</span>
+ <li className={`notification notification--${tone}`}>
+ <span className="notification__icon">
+ {tone === 'info' ? <InfoCircleIcon /> : <AlertIcon />}
+ </span>
+ <div className="notification__body">
+ <div className="notification__head">
+ <span className="notification__title">{title}</span>
+ <span className={`severity-badge ${sev}`}>{sev}</span>
+ <span className="notification__time">
+ {alert.created_at ? new Date(alert.created_at).toLocaleString() : ''}
+ </span>
+ </div>
+ <p className="notification__message">
+ {alert.source_ip && <><strong>IP:</strong> {alert.source_ip}{' '}</>}
+ {alert.details?.message || ''}
+ {alert.details?.attempts ? ` (${alert.details.attempts} attempts)` : ''}
+ </p>
+ <div className="notification__actions">
+ {alert.status === 'open' && (
+ <Button variant="outline" size="sm" onClick={() => onAcknowledge(alert.id)}>
+ Acknowledge
+ </Button>
+ )}
+ <Button variant="outline" size="sm" onClick={() => onResolve(alert.id)}>
+ Resolve
+ </Button>
+ </div>
</div>
- <div className="resource-bar">
- <div
- className="resource-fill"
- style={{
- width: `${safeValue}%`,
- backgroundColor: safeValue > 80 ? '#EF4444' : color
- }}
- />
+ </li>
+ );
+};
+
+const InfoRow = ({ icon, label, value, mono, children }) => (
+ <li className="info-row">
+ <span className="info-row__icon">{icon}</span>
+ <span className="info-row__label">{label}</span>
+ <span className={`info-row__value${mono ? ' mono' : ''}`}>
+ {children ?? value}
+ </span>
+ </li>
+);
+
+const KpiTile = ({ icon, label, value, sub, tone, accent }) => (
+ <div className={`kpi-tile${accent ? ' kpi-tile--accent' : ''}${tone ? ` kpi-tile--${tone}` : ''}`}>
+ <div className="kpi-tile__head">
+ <span className="kpi-tile__icon">{icon}</span>
+ <span className="kpi-tile__label">{label}</span>
+ </div>
+ <div className="kpi-tile__value">{value}</div>
+ {sub && <div className="kpi-tile__sub">{sub}</div>}
+ </div>
+);
+
+const KpiGauge = ({ icon, label, percent, color, sub }) => {
+ const has = percent !== null && percent !== undefined && Number.isFinite(percent);
+ const safe = has ? Math.min(Math.max(percent, 0), 100) : 0;
+ const danger = safe > 85;
+ const warn = safe > 70 && !danger;
+ const fillColor = danger ? '#EF4444' : warn ? '#F59E0B' : color;
+ const radius = 22;
+ const circumference = 2 * Math.PI * radius;
+ const dash = (safe / 100) * circumference;
+
+ return (
+ <div className={`kpi-tile kpi-tile--gauge${danger ? ' kpi-tile--danger' : warn ? ' kpi-tile--warn' : ''}`}>
+ <div className="kpi-tile__head">
+ <span className="kpi-tile__icon">{icon}</span>
+ <span className="kpi-tile__label">{label}</span>
+ </div>
+ <div className="kpi-tile__gauge-row">
+ <svg className="kpi-gauge" width="56" height="56" viewBox="0 0 56 56">
+ <circle cx="28" cy="28" r={radius} className="kpi-gauge__track" />
+ <circle
+ cx="28"
+ cy="28"
+ r={radius}
+ className="kpi-gauge__bar"
+ stroke={has ? fillColor : 'var(--border-subtle)'}
+ strokeDasharray={`${dash} ${circumference - dash}`}
+ transform="rotate(-90 28 28)"
+ />
+ </svg>
+ <div className="kpi-tile__gauge-text">
+ <span className="kpi-tile__value">{has ? `${safe.toFixed(1)}%` : '—'}</span>
+ {sub && <span className="kpi-tile__sub">{sub}</span>}
+ </div>
</div>
</div>
);
@@ -445,6 +699,26 @@ const unwrapList = (response) => {
return [];
};
+// Docker exposes container ports as an array of {ip, private_port,
+// public_port, type} objects. Render a compact "host:container/proto"
+// string per binding, or fall back to "container/proto" when the port
+// isn't mapped to the host. Older agents may already send a string.
+const formatPorts = (ports) => {
+ if (!ports) return '-';
+ if (typeof ports === 'string') return ports || '-';
+ if (!Array.isArray(ports) || ports.length === 0) return '-';
+ const parts = ports.map((p) => {
+ if (!p || typeof p !== 'object') return String(p);
+ const proto = p.type || 'tcp';
+ if (p.public_port) {
+ const host = p.ip && p.ip !== '0.0.0.0' && p.ip !== '::' ? `${p.ip}:` : '';
+ return `${host}${p.public_port}->${p.private_port}/${proto}`;
+ }
+ return `${p.private_port}/${proto}`;
+ });
+ return parts.join(', ');
+};
+
const DockerTab = ({ serverId, serverStatus, server }) => {
const [containers, setContainers] = useState([]);
const [images, setImages] = useState([]);
@@ -498,7 +772,7 @@ const DockerTab = ({ serverId, serverStatus, server }) => {
<ul>
<li>Docker Desktop / dockerd is not running on the host</li>
<li>The agent user isn&apos;t in the <code>docker</code> group (Linux)</li>
- <li>The npipe socket <code>//./pipe/docker_engine</code> isn&apos;t accessible (Windows)</li>
+ <li>The npipe socket <code>{'//./pipe/docker_engine'}</code> isn&apos;t accessible (Windows)</li>
</ul>
<p>
Start Docker on the host, then click <strong>Refresh</strong> on the Overview tab to
@@ -600,7 +874,7 @@ const DockerTab = ({ serverId, serverStatus, server }) => {
{container.state}
</span>
</td>
- <td>{container.ports || '-'}</td>
+ <td>{formatPorts(container.ports)}</td>
<td className="actions-cell">
{isRunning ? (
<>
@@ -900,69 +1174,74 @@ const CronTab = ({ serverId, serverStatus }) => {
</table>
)}
- {showAddModal && (
- <div className="modal-overlay" onClick={() => !submitting && setShowAddModal(false)}>
- <div className="modal" onClick={(e) => e.stopPropagation()}>
- <div className="modal-header">
- <h3>Add Cron Job</h3>
- <button className="modal-close" onClick={() => setShowAddModal(false)} disabled={submitting}>×</button>
+ <Dialog
+ open={showAddModal}
+ onOpenChange={(open) => { if (!open && !submitting) setShowAddModal(false); }}
+ >
+ <DialogContent>
+ <DialogHeader>
+ <DialogTitle>Add Cron Job</DialogTitle>
+ <DialogDescription>
+ Schedule a command on the host crontab. Runs as the agent user.
+ </DialogDescription>
+ </DialogHeader>
+ <form onSubmit={handleSubmit} className="space-y-4">
+ <div className="space-y-1.5">
+ <Label htmlFor="cron-name">Name (optional)</Label>
+ <Input
+ id="cron-name"
+ value={form.name}
+ onChange={(e) => setForm({ ...form, name: e.target.value })}
+ placeholder="Backup database"
+ />
</div>
- <form onSubmit={handleSubmit}>
- <div className="modal-body">
- <div className="form-group">
- <label htmlFor="cron-name">Name (optional)</label>
- <Input
- id="cron-name"
- value={form.name}
- onChange={(e) => setForm({ ...form, name: e.target.value })}
- placeholder="Backup database"
- />
- </div>
- <div className="form-group">
- <label htmlFor="cron-schedule">Schedule</label>
- <select
- className="form-control"
- value={Object.keys(PRESET_LABELS).includes(form.schedule) ? form.schedule : 'custom'}
- onChange={(e) => {
- if (e.target.value === 'custom') return;
- setForm({ ...form, schedule: e.target.value });
- }}
- >
- {Object.entries(PRESET_LABELS).map(([cron, label]) => (
- <option key={cron} value={cron}>{label} — {cron}</option>
- ))}
- <option value="custom">Custom…</option>
- </select>
- <Input
- id="cron-schedule"
- className="cron-tab__custom-schedule"
- value={form.schedule}
- onChange={(e) => setForm({ ...form, schedule: e.target.value })}
- placeholder="* * * * *"
- />
- <p className="form-hint">5 fields: minute, hour, day, month, weekday.</p>
- </div>
- <div className="form-group">
- <label htmlFor="cron-command">Command</label>
- <Textarea
- id="cron-command"
- rows={3}
- value={form.command}
- onChange={(e) => setForm({ ...form, command: e.target.value })}
- placeholder="/usr/local/bin/my-script.sh"
- required
- />
- <p className="form-hint">Absolute path. Shell operators (;, &&, |, $(), &gt;, &lt;) are not allowed.</p>
- </div>
- </div>
- <div className="modal-footer">
- <Button type="button" variant="outline" onClick={() => setShowAddModal(false)} disabled={submitting}>Cancel</Button>
- <Button type="submit" disabled={submitting}>{submitting ? 'Adding…' : 'Add Job'}</Button>
- </div>
- </form>
- </div>
- </div>
- )}
+ <div className="space-y-1.5">
+ <Label htmlFor="cron-schedule">Schedule</Label>
+ <Select
+ value={Object.keys(PRESET_LABELS).includes(form.schedule) ? form.schedule : 'custom'}
+ onValueChange={(value) => {
+ if (value === 'custom') return;
+ setForm({ ...form, schedule: value });
+ }}
+ >
+ <SelectTrigger>
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {Object.entries(PRESET_LABELS).map(([cron, label]) => (
+ <SelectItem key={cron} value={cron}>{label} — {cron}</SelectItem>
+ ))}
+ <SelectItem value="custom">Custom…</SelectItem>
+ </SelectContent>
+ </Select>
+ <Input
+ id="cron-schedule"
+ value={form.schedule}
+ onChange={(e) => setForm({ ...form, schedule: e.target.value })}
+ placeholder="* * * * *"
+ className="font-mono"
+ />
+ <p className="text-xs text-muted-foreground">5 fields: minute, hour, day, month, weekday.</p>
+ </div>
+ <div className="space-y-1.5">
+ <Label htmlFor="cron-command">Command</Label>
+ <Textarea
+ id="cron-command"
+ rows={3}
+ value={form.command}
+ onChange={(e) => setForm({ ...form, command: e.target.value })}
+ placeholder="/usr/local/bin/my-script.sh"
+ required
+ />
+ <p className="text-xs text-muted-foreground">Absolute path. Shell operators (;, &amp;&amp;, |, $(), &gt;, &lt;) are not allowed.</p>
+ </div>
+ <DialogFooter>
+ <Button type="button" variant="outline" onClick={() => setShowAddModal(false)} disabled={submitting}>Cancel</Button>
+ <Button type="submit" disabled={submitting}>{submitting ? 'Adding…' : 'Add Job'}</Button>
+ </DialogFooter>
+ </form>
+ </DialogContent>
+ </Dialog>
<ConfirmDialog
isOpen={confirmCronState.isOpen}
@@ -1274,67 +1553,68 @@ const CloudflaredTab = ({ serverId, serverStatus }) => {
)
)}
- {showCreateModal && (
- <div className="modal-overlay" onClick={() => !creating && setShowCreateModal(false)}>
- <div className="modal" onClick={(e) => e.stopPropagation()}>
- <div className="modal-header">
- <h3>Create Tunnel</h3>
- <button className="modal-close" onClick={() => setShowCreateModal(false)} disabled={creating}>×</button>
+ <Dialog
+ open={showCreateModal}
+ onOpenChange={(open) => { if (!open && !creating) setShowCreateModal(false); }}
+ >
+ <DialogContent>
+ <DialogHeader>
+ <DialogTitle>Create Tunnel</DialogTitle>
+ <DialogDescription>
+ Provisions a new Cloudflare Tunnel on this server.
+ </DialogDescription>
+ </DialogHeader>
+ <form onSubmit={handleCreate} className="space-y-4">
+ <div className="space-y-1.5">
+ <Label htmlFor="cf-name">Tunnel Name</Label>
+ <Input
+ id="cf-name"
+ value={createName}
+ onChange={(e) => setCreateName(e.target.value)}
+ placeholder="my-app"
+ required
+ autoFocus
+ />
+ <p className="text-xs text-muted-foreground">Letters, numbers, dashes, underscores. Up to 32 chars.</p>
</div>
- <form onSubmit={handleCreate}>
- <div className="modal-body">
- <div className="form-group">
- <label htmlFor="cf-name">Tunnel Name</label>
- <Input
- id="cf-name"
- value={createName}
- onChange={(e) => setCreateName(e.target.value)}
- placeholder="my-app"
- required
- autoFocus
- />
- <p className="form-hint">Letters, numbers, dashes, underscores. Up to 32 chars.</p>
- </div>
- </div>
- <div className="modal-footer">
- <Button type="button" variant="outline" onClick={() => setShowCreateModal(false)} disabled={creating}>Cancel</Button>
- <Button type="submit" disabled={creating}>{creating ? 'Creating…' : 'Create'}</Button>
- </div>
- </form>
- </div>
- </div>
- )}
-
- {showRouteModal && routeTunnel && (
- <div className="modal-overlay" onClick={() => !routing && setShowRouteModal(false)}>
- <div className="modal" onClick={(e) => e.stopPropagation()}>
- <div className="modal-header">
- <h3>Route Subdomain → {routeTunnel.name}</h3>
- <button className="modal-close" onClick={() => setShowRouteModal(false)} disabled={routing}>×</button>
+ <DialogFooter>
+ <Button type="button" variant="outline" onClick={() => setShowCreateModal(false)} disabled={creating}>Cancel</Button>
+ <Button type="submit" disabled={creating}>{creating ? 'Creating…' : 'Create'}</Button>
+ </DialogFooter>
+ </form>
+ </DialogContent>
+ </Dialog>
+
+ <Dialog
+ open={showRouteModal && !!routeTunnel}
+ onOpenChange={(open) => { if (!open && !routing) setShowRouteModal(false); }}
+ >
+ <DialogContent>
+ <DialogHeader>
+ <DialogTitle>Route Subdomain{routeTunnel ? ` → ${routeTunnel.name}` : ''}</DialogTitle>
+ <DialogDescription>
+ A CNAME for this hostname will be created in Cloudflare DNS, pointing at the tunnel.
+ </DialogDescription>
+ </DialogHeader>
+ <form onSubmit={handleRoute} className="space-y-4">
+ <div className="space-y-1.5">
+ <Label htmlFor="cf-host">Hostname</Label>
+ <Input
+ id="cf-host"
+ value={routeHostname}
+ onChange={(e) => setRouteHostname(e.target.value)}
+ placeholder="app.example.com"
+ required
+ autoFocus
+ />
</div>
- <form onSubmit={handleRoute}>
- <div className="modal-body">
- <div className="form-group">
- <label htmlFor="cf-host">Hostname</label>
- <Input
- id="cf-host"
- value={routeHostname}
- onChange={(e) => setRouteHostname(e.target.value)}
- placeholder="app.example.com"
- required
- autoFocus
- />
- <p className="form-hint">A CNAME for this hostname will be created in Cloudflare DNS, pointing at the tunnel.</p>
- </div>
- </div>
- <div className="modal-footer">
- <Button type="button" variant="outline" onClick={() => setShowRouteModal(false)} disabled={routing}>Cancel</Button>
- <Button type="submit" disabled={routing}>{routing ? 'Adding…' : 'Add Route'}</Button>
- </div>
- </form>
- </div>
- </div>
- )}
+ <DialogFooter>
+ <Button type="button" variant="outline" onClick={() => setShowRouteModal(false)} disabled={routing}>Cancel</Button>
+ <Button type="submit" disabled={routing}>{routing ? 'Adding…' : 'Add Route'}</Button>
+ </DialogFooter>
+ </form>
+ </DialogContent>
+ </Dialog>
<ConfirmDialog
isOpen={confirmCfState.isOpen}
@@ -1471,15 +1751,20 @@ const AgentRegistrationSection = ({ server, onRegenerateToken }) => {
const isOnline = server.status === 'online';
return (
- <div className="form-section">
- <h3>Connection String</h3>
- <p className="section-description">
- Generate a fresh connection string to pair (or re-pair) this server.
- Useful after reinstalling the agent — old credentials are gone, but a
- new string brings the agent right back to this row.
- {isOnline && ' This server is currently online; regenerating only affects re-pairing.'}
- {isExpired && ' The previous token has expired.'}
- </p>
+ <div className="form-section form-section--accent">
+ <div className="form-section__header">
+ <span className="form-section__icon"><KeyIcon /></span>
+ <div>
+ <h3>Connection String</h3>
+ <p className="section-description">
+ Generate a fresh connection string to pair (or re-pair) this server.
+ Useful after reinstalling the agent — old credentials are gone, but a
+ new string brings the agent right back to this row.
+ {isOnline && ' This server is currently online; regenerating only affects re-pairing.'}
+ {isExpired && ' The previous token has expired.'}
+ </p>
+ </div>
+ </div>
<Button onClick={onRegenerateToken}>
<KeyIcon /> Generate Connection String
</Button>
@@ -1501,7 +1786,6 @@ const SettingsTab = ({ server, onUpdate, onRegenerateToken, onDelete }) => {
const [allowedIPs, setAllowedIPs] = useState([]);
const [newIP, setNewIP] = useState('');
const [connectionInfo, setConnectionInfo] = useState(null);
- const [securityAlerts, setSecurityAlerts] = useState([]);
const [rotatingKey, setRotatingKey] = useState(false);
const toast = useToast();
@@ -1521,14 +1805,12 @@ const SettingsTab = ({ server, onUpdate, onRegenerateToken, onDelete }) => {
async function loadSecurityData() {
try {
- const [ipsData, connData, alertsData] = await Promise.all([
+ const [ipsData, connData] = await Promise.all([
api.getAllowedIPs(server.id),
api.getConnectionInfo(server.id),
- api.getServerSecurityAlerts(server.id, { status: 'open', limit: 10 })
]);
setAllowedIPs(ipsData.allowed_ips || []);
setConnectionInfo(connData);
- setSecurityAlerts(alertsData || []);
} catch (err) {
console.error('Failed to load security data:', err);
}
@@ -1576,26 +1858,6 @@ const SettingsTab = ({ server, onUpdate, onRegenerateToken, onDelete }) => {
}
}
- async function handleAcknowledgeAlert(alertId) {
- try {
- await api.acknowledgeAlert(alertId);
- setSecurityAlerts(prev => prev.map(a =>
- a.id === alertId ? { ...a, status: 'acknowledged' } : a
- ));
- } catch (err) {
- toast.error('Failed to acknowledge alert');
- }
- }
-
- async function handleResolveAlert(alertId) {
- try {
- await api.resolveAlert(alertId);
- setSecurityAlerts(prev => prev.filter(a => a.id !== alertId));
- } catch (err) {
- toast.error('Failed to resolve alert');
- }
- }
-
async function handleSubmit(e) {
e.preventDefault();
setLoading(true);
@@ -1620,9 +1882,14 @@ const SettingsTab = ({ server, onUpdate, onRegenerateToken, onDelete }) => {
<div className="settings-tab">
<div className="settings-grid">
<form onSubmit={handleSubmit} className="settings-form">
- <div className="form-section">
- <h3>Basic Information</h3>
-
+ <div className="form-section form-section--accent">
+ <div className="form-section__header">
+ <span className="form-section__icon"><ServerIcon /></span>
+ <div>
+ <h3>Basic Information</h3>
+ <p className="section-description">Identity and grouping for this server.</p>
+ </div>
+ </div>
<div className="form-group">
<label>Server Name</label>
<Input
@@ -1688,8 +1955,16 @@ const SettingsTab = ({ server, onUpdate, onRegenerateToken, onDelete }) => {
</div>
<div className="security-grid">
- <div className="form-section">
- <h3>Connection & IP Allowlist</h3>
+ <div className="form-section form-section--accent">
+ <div className="form-section__header">
+ <span className="form-section__icon"><NetworkIcon /></span>
+ <div>
+ <h3>Connection & IP Allowlist</h3>
+ <p className="section-description">
+ Restrict which IPs can connect. Supports single IPs, CIDR notation, and wildcards.
+ </p>
+ </div>
+ </div>
{connectionInfo && (
<div className="security-info-bar">
@@ -1709,10 +1984,6 @@ const SettingsTab = ({ server, onUpdate, onRegenerateToken, onDelete }) => {
)}
<div className="subsection">
- <p className="section-description">
- Restrict which IPs can connect. Supports single IPs, CIDR notation, and wildcards.
- </p>
-
<div className="ip-list">
{allowedIPs.length === 0 ? (
<div className="ip-empty">No IP restrictions (all IPs allowed)</div>
@@ -1758,11 +2029,16 @@ const SettingsTab = ({ server, onUpdate, onRegenerateToken, onDelete }) => {
</div>
</div>
- <div className="form-section">
- <h3>API Key Rotation</h3>
- <p className="section-description">
- Rotate the API credentials used by the agent. The agent must be online to receive new credentials.
- </p>
+ <div className="form-section form-section--accent">
+ <div className="form-section__header">
+ <span className="form-section__icon"><KeyIcon /></span>
+ <div>
+ <h3>API Key Rotation</h3>
+ <p className="section-description">
+ Rotate the API credentials used by the agent. The agent must be online to receive new credentials.
+ </p>
+ </div>
+ </div>
<div className="key-rotation-actions">
<Button
variant="outline"
@@ -1784,46 +2060,6 @@ const SettingsTab = ({ server, onUpdate, onRegenerateToken, onDelete }) => {
</div>
</div>
- {securityAlerts.length > 0 && (
- <div className="form-section">
- <h3>Security Alerts</h3>
- <div className="alerts-list">
- {securityAlerts.map(alert => (
- <div key={alert.id} className={`alert-item severity-${alert.severity}`}>
- <div className="alert-item-header">
- <span className={`severity-badge ${alert.severity}`}>{alert.severity}</span>
- <span className="alert-type">{alert.alert_type.replace('_', ' ')}</span>
- <span className="alert-time">{new Date(alert.created_at).toLocaleString()}</span>
- </div>
- <div className="alert-item-details">
- {alert.source_ip && <span>IP: {alert.source_ip}</span>}
- {alert.details?.message && <span>{alert.details.message}</span>}
- {alert.details?.attempts && <span>Attempts: {alert.details.attempts}</span>}
- </div>
- <div className="alert-item-actions">
- {alert.status === 'open' && (
- <Button
- variant="outline"
- size="sm"
- onClick={() => handleAcknowledgeAlert(alert.id)}
- >
- Acknowledge
- </Button>
- )}
- <Button
- variant="outline"
- size="sm"
- onClick={() => handleResolveAlert(alert.id)}
- >
- Resolve
- </Button>
- </div>
- </div>
- ))}
- </div>
- </div>
- )}
-
<DangerZone
title="Danger Zone"
description="Removing this server will disconnect the agent and delete all associated data."
@@ -1896,106 +2132,104 @@ const TokenModal = ({ server, onClose, onGenerated }) => {
Install-ServerKitAgent -Server "${window.location.origin}" -Token "${result.registration_token}"` : '';
return (
- <div className="modal-overlay" onClick={onClose}>
- <div className="modal modal-lg" onClick={e => e.stopPropagation()}>
- <div className="modal-header">
- <h2>Connection String</h2>
- <button className="modal-close" onClick={onClose}>&times;</button>
- </div>
-
- <div className="install-instructions">
- {!result ? (
- <>
- <p className="section-description">
- Generate a single pasteable string the agent can consume.
- The token inside is single-use — burned the moment any
- agent registers with it.
- </p>
+ <Dialog open onOpenChange={(open) => { if (!open) onClose(); }}>
+ <DialogContent className="sm:max-w-2xl max-h-[90vh] overflow-y-auto">
+ <DialogHeader>
+ <DialogTitle>Connection String</DialogTitle>
+ {!result && (
+ <DialogDescription>
+ Generate a single pasteable string the agent can consume.
+ The token inside is single-use — burned the moment any
+ agent registers with it.
+ </DialogDescription>
+ )}
+ </DialogHeader>
+
+ {!result ? (
+ <>
+ <div className="space-y-2">
+ <Label htmlFor="token-expires">Token expires</Label>
+ <Select value={String(expiresIn)} onValueChange={(v) => setExpiresIn(Number(v))}>
+ <SelectTrigger id="token-expires">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {TOKEN_EXPIRY_OPTIONS.map(opt => (
+ <SelectItem key={opt.value} value={String(opt.value)}>{opt.label}</SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ </div>
- <div className="form-row">
- <div className="form-group">
- <label>Token expires</label>
- <select
- value={expiresIn}
- onChange={(e) => setExpiresIn(Number(e.target.value))}
- >
- {TOKEN_EXPIRY_OPTIONS.map(opt => (
- <option key={opt.value} value={opt.value}>{opt.label}</option>
- ))}
- </select>
- </div>
- </div>
+ <DialogFooter>
+ <Button variant="outline" onClick={onClose}>Cancel</Button>
+ <Button onClick={handleGenerate} disabled={generating}>
+ {generating ? 'Generating…' : 'Generate'}
+ </Button>
+ </DialogFooter>
+ </>
+ ) : (
+ <>
+ <div className="token-status">
+ <span className="token-status-dot active" />
+ <span>
+ Active — expires {new Date(result.registration_expires).toLocaleString()}
+ </span>
+ </div>
- <div className="modal-actions">
- <Button variant="outline" onClick={onClose}>Cancel</Button>
- <Button onClick={handleGenerate} disabled={generating}>
- {generating ? 'Generating…' : 'Generate'}
+ <div className="connection-string-field">
+ <div className="connection-string-field__header">
+ <KeyIcon />
+ <span>Connection string</span>
+ <Button variant="outline" size="sm" onClick={() => copyToClipboard(result.connection_string)}>
+ <CopyIcon /> Copy
</Button>
</div>
- </>
- ) : (
- <>
- <div className="token-status">
- <span className="token-status-dot active" />
- <span>
- Active — expires {new Date(result.registration_expires).toLocaleString()}
- </span>
- </div>
-
- <div className="connection-string-field">
- <div className="connection-string-field__header">
- <KeyIcon />
- <span>Connection string</span>
- <Button variant="outline" size="sm" onClick={() => copyToClipboard(result.connection_string)}>
- <CopyIcon /> Copy
- </Button>
- </div>
- <pre className="connection-string-field__value">{result.connection_string}</pre>
- </div>
+ <pre className="connection-string-field__value">{result.connection_string}</pre>
+ </div>
- <details className="install-fallback">
- <summary>Need to install the agent first? Use the one-liner installer.</summary>
- <div className="install-tabs" style={{ marginTop: '0.75rem' }}>
- <div className="install-tab">
- <div className="install-tab-header">
- <TerminalIcon />
- <div className="install-tab-title">
- <span>Linux</span>
- <span className="install-tab-description">curl, tar, sudo, and systemd</span>
- </div>
- <Button variant="outline" size="sm" onClick={() => copyToClipboard(linuxScript)}>
- <CopyIcon /> Copy
- </Button>
+ <details className="install-fallback">
+ <summary>Need to install the agent first? Use the one-liner installer.</summary>
+ <div className="install-tabs" style={{ marginTop: '0.75rem' }}>
+ <div className="install-tab">
+ <div className="install-tab-header">
+ <TerminalIcon />
+ <div className="install-tab-title">
+ <span>Linux</span>
+ <span className="install-tab-description">curl, tar, sudo, and systemd</span>
</div>
- <pre className="install-script">{linuxScript}</pre>
+ <Button variant="outline" size="sm" onClick={() => copyToClipboard(linuxScript)}>
+ <CopyIcon /> Copy
+ </Button>
</div>
- <div className="install-tab">
- <div className="install-tab-header">
- <WindowsIcon />
- <div className="install-tab-title">
- <span>Windows (PowerShell)</span>
- <span className="install-tab-description">Run as Administrator</span>
- </div>
- <Button variant="outline" size="sm" onClick={() => copyToClipboard(windowsScript)}>
- <CopyIcon /> Copy
- </Button>
+ <pre className="install-script">{linuxScript}</pre>
+ </div>
+ <div className="install-tab">
+ <div className="install-tab-header">
+ <WindowsIcon />
+ <div className="install-tab-title">
+ <span>Windows (PowerShell)</span>
+ <span className="install-tab-description">Run as Administrator</span>
</div>
- <pre className="install-script">{windowsScript}</pre>
+ <Button variant="outline" size="sm" onClick={() => copyToClipboard(windowsScript)}>
+ <CopyIcon /> Copy
+ </Button>
</div>
+ <pre className="install-script">{windowsScript}</pre>
</div>
- </details>
-
- <div className="modal-actions">
- <Button variant="outline" onClick={() => setResult(null)}>
- Generate another
- </Button>
- <Button onClick={onClose}>Done</Button>
</div>
- </>
- )}
- </div>
- </div>
- </div>
+ </details>
+
+ <DialogFooter>
+ <Button variant="outline" onClick={() => setResult(null)}>
+ Generate another
+ </Button>
+ <Button onClick={onClose}>Done</Button>
+ </DialogFooter>
+ </>
+ )}
+ </DialogContent>
+ </Dialog>
);
};
@@ -2093,4 +2327,151 @@ const WindowsIcon = () => (
</svg>
);
+const CpuIcon = () => (
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
+ <rect x="4" y="4" width="16" height="16" rx="2"/>
+ <rect x="9" y="9" width="6" height="6"/>
+ <line x1="9" y1="2" x2="9" y2="4"/><line x1="15" y1="2" x2="15" y2="4"/>
+ <line x1="9" y1="20" x2="9" y2="22"/><line x1="15" y1="20" x2="15" y2="22"/>
+ <line x1="20" y1="9" x2="22" y2="9"/><line x1="20" y1="14" x2="22" y2="14"/>
+ <line x1="2" y1="9" x2="4" y2="9"/><line x1="2" y1="14" x2="4" y2="14"/>
+ </svg>
+);
+
+const MemoryIcon = () => (
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
+ <rect x="2" y="7" width="20" height="10" rx="2"/>
+ <line x1="6" y1="7" x2="6" y2="17"/>
+ <line x1="10" y1="7" x2="10" y2="17"/>
+ <line x1="14" y1="7" x2="14" y2="17"/>
+ <line x1="18" y1="7" x2="18" y2="17"/>
+ </svg>
+);
+
+const DiskIcon = () => (
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
+ <ellipse cx="12" cy="5" rx="9" ry="3"/>
+ <path d="M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5"/>
+ <path d="M3 12c0 1.66 4 3 9 3s9-1.34 9-3"/>
+ </svg>
+);
+
+const ClockIcon = () => (
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
+ <circle cx="12" cy="12" r="10"/>
+ <polyline points="12 6 12 12 16 14"/>
+ </svg>
+);
+
+const NetworkIcon = () => (
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
+ <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"/>
+ </svg>
+);
+
+const ServerIcon = () => (
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
+ <rect x="2" y="3" width="20" height="7" rx="1"/>
+ <rect x="2" y="14" width="20" height="7" rx="1"/>
+ <line x1="6" y1="6.5" x2="6.01" y2="6.5"/>
+ <line x1="6" y1="17.5" x2="6.01" y2="17.5"/>
+ </svg>
+);
+
+const HostIcon = () => (
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
+ <path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/>
+ <polyline points="9 22 9 12 15 12 15 22"/>
+ </svg>
+);
+
+const OsIcon = () => (
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
+ <rect x="2" y="3" width="20" height="14" rx="2"/>
+ <line x1="8" y1="21" x2="16" y2="21"/>
+ <line x1="12" y1="17" x2="12" y2="21"/>
+ </svg>
+);
+
+const ArchIcon = () => (
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
+ <polyline points="16 18 22 12 16 6"/>
+ <polyline points="8 6 2 12 8 18"/>
+ </svg>
+);
+
+const ChipIcon = () => (
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
+ <rect x="5" y="5" width="14" height="14" rx="1"/>
+ <rect x="9" y="9" width="6" height="6"/>
+ <path d="M3 9h2M3 15h2M19 9h2M19 15h2M9 3v2M15 3v2M9 19v2M15 19v2"/>
+ </svg>
+);
+
+const AgentIcon = () => (
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
+ <path d="M12 2a4 4 0 0 0-4 4v2H6a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V10a2 2 0 0 0-2-2h-2V6a4 4 0 0 0-4-4z"/>
+ <circle cx="9" cy="14" r="1"/>
+ <circle cx="15" cy="14" r="1"/>
+ </svg>
+);
+
+const TagIcon = () => (
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
+ <path d="M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"/>
+ <line x1="7" y1="7" x2="7.01" y2="7"/>
+ </svg>
+);
+
+const HashIcon = () => (
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
+ <line x1="4" y1="9" x2="20" y2="9"/>
+ <line x1="4" y1="15" x2="20" y2="15"/>
+ <line x1="10" y1="3" x2="8" y2="21"/>
+ <line x1="16" y1="3" x2="14" y2="21"/>
+ </svg>
+);
+
+const DockerMiniIcon = () => (
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
+ <rect x="3" y="10" width="3" height="3"/>
+ <rect x="7" y="10" width="3" height="3"/>
+ <rect x="11" y="10" width="3" height="3"/>
+ <rect x="7" y="6" width="3" height="3"/>
+ <rect x="11" y="6" width="3" height="3"/>
+ <path d="M2 14c0 4 4 6 10 6s10-2 10-6"/>
+ </svg>
+);
+
+const PulseIcon = () => (
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
+ <polyline points="22 12 18 12 15 21 9 3 6 12 2 12"/>
+ </svg>
+);
+
+const BellIcon = () => (
+ <svg width="40" height="40" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5">
+ <path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"/>
+ <path d="M13.73 21a2 2 0 0 1-3.46 0"/>
+ </svg>
+);
+
+const AlertIcon = () => (
+ <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
+ <path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"/>
+ <line x1="12" y1="9" x2="12" y2="13"/>
+ <line x1="12" y1="17" x2="12.01" y2="17"/>
+ </svg>
+);
+
+const InfoCircleIcon = () => (
+ <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
+ <circle cx="12" cy="12" r="10"/>
+ <line x1="12" y1="16" x2="12" y2="12"/>
+ <line x1="12" y1="8" x2="12.01" y2="8"/>
+ </svg>
+);
+
export default ServerDetail;
diff --git a/frontend/src/pages/StyleGuide.jsx b/frontend/src/pages/StyleGuide.jsx
index 34ea3708..bfdba27e 100644
--- a/frontend/src/pages/StyleGuide.jsx
+++ b/frontend/src/pages/StyleGuide.jsx
@@ -51,6 +51,20 @@ const SECTIONS = [
];
const SECTION_IDS = SECTIONS.map(s => s.id);
+const MANY_TAB_ITEMS = [
+ ['overview', 'Overview'],
+ ['docker', 'Docker'],
+ ['metrics', 'Metrics'],
+ ['settings', 'Settings'],
+ ['cron', 'Cron Jobs'],
+ ['packages', 'Packages'],
+ ['services', 'Services'],
+ ['security', 'Security'],
+ ['cloudflared', 'Cloudflared'],
+ ['terminal', 'Terminal'],
+ ['logs', 'Logs'],
+ ['backups', 'Backups'],
+];
export default function StyleGuide() {
const [activeSection, setActiveSection] = useTabParam('/style-guide', SECTION_IDS, 'colors');
@@ -58,6 +72,9 @@ export default function StyleGuide() {
const [modalOpen, setModalOpen] = useState(false);
const [confirmOpen, setConfirmOpen] = useState(false);
const [confirmVariant, setConfirmVariant] = useState('danger');
+ const [controlledDemoTab, setControlledDemoTab] = useState('general');
+ const [halfDemoTab, setHalfDemoTab] = useState('summary');
+ const [halfOverflowTab, setHalfOverflowTab] = useState('overview');
const [inputValue, setInputValue] = useState('');
const [selectValue, setSelectValue] = useState('');
const [checkValue, setCheckValue] = useState(false);
@@ -745,7 +762,7 @@ export default function StyleGuide() {
{/* ── TABS ── */}
{activeSection === 'tabs' && (
<div className="space-y-6">
- <SectionTitle title="Tabs (shadcn)" />
+ <SectionTitle title="Tabs (Basic)" />
<div className="card" style={{ padding: 24 }}>
<Tabs defaultValue="tab1">
<TabsList>
@@ -764,6 +781,79 @@ export default function StyleGuide() {
</TabsContent>
</Tabs>
</div>
+
+ <SectionTitle title="Tabs (Controlled)" />
+ <p className="text-sm text-secondary mb-2">Controlled value/onValueChange usage. This should match URL-backed pages behaviorally.</p>
+ <div className="card" style={{ padding: 24 }}>
+ <Tabs value={controlledDemoTab} onValueChange={setControlledDemoTab}>
+ <TabsList>
+ <TabsTrigger value="general"><Server size={14} /> General</TabsTrigger>
+ <TabsTrigger value="security"><Shield size={14} /> Security</TabsTrigger>
+ <TabsTrigger value="monitoring"><Activity size={14} /> Monitoring</TabsTrigger>
+ <TabsTrigger value="disabled" disabled><Lock size={14} /> Disabled</TabsTrigger>
+ </TabsList>
+ <TabsContent value="general">
+ <p className="text-secondary" style={{ paddingTop: 16 }}>Controlled general content.</p>
+ </TabsContent>
+ <TabsContent value="security">
+ <p className="text-secondary" style={{ paddingTop: 16 }}>Controlled security content.</p>
+ </TabsContent>
+ <TabsContent value="monitoring">
+ <p className="text-secondary" style={{ paddingTop: 16 }}>Controlled monitoring content.</p>
+ </TabsContent>
+ </Tabs>
+ </div>
+
+ <SectionTitle title="Tabs (Overflow Menu)" />
+ <p className="text-sm text-secondary mb-2">Many tabs force the overflow menu. Selecting an item from the ellipsis must activate the tab and close the popover.</p>
+ <div className="card" style={{ padding: 24 }}>
+ <Tabs defaultValue="overview">
+ <TabsList>
+ {MANY_TAB_ITEMS.map(([value, label]) => (
+ <TabsTrigger key={value} value={value}>{label}</TabsTrigger>
+ ))}
+ </TabsList>
+ {MANY_TAB_ITEMS.map(([value, label]) => (
+ <TabsContent key={value} value={value}>
+ <p className="text-secondary" style={{ paddingTop: 16 }}>{label} tab content.</p>
+ </TabsContent>
+ ))}
+ </Tabs>
+ </div>
+
+ <SectionTitle title="Tabs (Half + Half Layout)" />
+ <p className="text-sm text-secondary mb-2">Constrained cards catch layout bugs that full-width tabs hide.</p>
+ <div className="styleguide__split-demo">
+ <div className="card" style={{ padding: 24 }}>
+ <Tabs value={halfDemoTab} onValueChange={setHalfDemoTab}>
+ <TabsList>
+ <TabsTrigger value="summary">Summary</TabsTrigger>
+ <TabsTrigger value="activity">Activity</TabsTrigger>
+ </TabsList>
+ <TabsContent value="summary">
+ <p className="text-secondary" style={{ paddingTop: 16 }}>Short two-tab card content.</p>
+ </TabsContent>
+ <TabsContent value="activity">
+ <p className="text-secondary" style={{ paddingTop: 16 }}>Recent activity content.</p>
+ </TabsContent>
+ </Tabs>
+ </div>
+
+ <div className="card" style={{ padding: 24 }}>
+ <Tabs value={halfOverflowTab} onValueChange={setHalfOverflowTab}>
+ <TabsList>
+ {MANY_TAB_ITEMS.map(([value, label]) => (
+ <TabsTrigger key={value} value={value}>{label}</TabsTrigger>
+ ))}
+ </TabsList>
+ {MANY_TAB_ITEMS.map(([value, label]) => (
+ <TabsContent key={value} value={value}>
+ <p className="text-secondary" style={{ paddingTop: 16 }}>{label} content inside a half-width card.</p>
+ </TabsContent>
+ ))}
+ </Tabs>
+ </div>
+ </div>
</div>
)}
diff --git a/frontend/src/styles/components/_alerts.scss b/frontend/src/styles/components/_alerts.scss
index 8c11fa62..98ad78a9 100644
--- a/frontend/src/styles/components/_alerts.scss
+++ b/frontend/src/styles/components/_alerts.scss
@@ -63,3 +63,16 @@
opacity: 1;
}
}
+
+.error-message,
+.error-banner {
+ display: flex;
+ align-items: flex-start;
+ gap: $space-2;
+ line-height: 1.5;
+
+ > svg {
+ flex-shrink: 0;
+ margin-top: 2px;
+ }
+}
diff --git a/frontend/src/styles/components/_badges.scss b/frontend/src/styles/components/_badges.scss
index 922dc1f4..cab493ec 100644
--- a/frontend/src/styles/components/_badges.scss
+++ b/frontend/src/styles/components/_badges.scss
@@ -4,14 +4,18 @@
// Status badge
.status-badge {
- display: flex;
+ display: inline-flex;
align-items: center;
- gap: $space-2 - 2;
- padding: $space-1 $space-2 + 2;
+ justify-content: center;
+ gap: $space-1;
+ min-height: 24px;
+ padding: 4px $space-3;
border-radius: $radius-full;
- font-size: $font-size-xs + 1;
+ font-size: $font-size-xs;
font-weight: $font-weight-semibold;
+ line-height: 1;
border: 1px solid transparent;
+ white-space: nowrap;
}
.status-dot {
@@ -46,8 +50,8 @@
// App type badge
.app-type {
background: $bg-hover;
- padding: $space-1 - 2 $space-2;
- border-radius: $radius-sm;
+ padding: 5px $space-3;
+ border-radius: $radius-md;
font-weight: $font-weight-semibold;
font-size: $font-size-xs;
letter-spacing: 0.5px;
@@ -56,10 +60,13 @@
// SSL badge
.ssl-badge {
+ display: inline-flex;
+ align-items: center;
+ gap: $space-1;
background: $success-bg;
color: $success;
- padding: $space-1 - 2 $space-2;
- border-radius: $radius-sm;
+ padding: 6px $space-3;
+ border-radius: $radius-md;
font-size: $font-size-xs;
font-weight: $font-weight-semibold;
}
@@ -80,8 +87,8 @@
align-items: center;
gap: $space-1;
background: $bg-hover;
- padding: $space-1 - 2 $space-2;
- border-radius: $radius-sm;
+ padding: 5px $space-3;
+ border-radius: $radius-md;
font-size: $font-size-xs;
font-weight: $font-weight-semibold;
text-transform: uppercase;
@@ -123,8 +130,8 @@
display: inline-flex;
align-items: center;
gap: $space-1;
- padding: $space-1 - 2 $space-2;
- border-radius: $radius-sm;
+ padding: 5px $space-3;
+ border-radius: $radius-md;
font-size: $font-size-xs;
font-weight: $font-weight-semibold;
text-transform: uppercase;
@@ -159,7 +166,8 @@
display: inline-flex;
align-items: center;
justify-content: center;
- padding: 0.25rem 0.5rem;
+ min-height: 1.5rem;
+ padding: 0.25rem 0.625rem;
font-size: 0.75rem;
font-weight: 600;
line-height: 1;
@@ -191,3 +199,72 @@
background-color: fade($text-tertiary-raw, 15%);
color: $text-tertiary;
}
+
+[data-slot="badge"] {
+ box-sizing: border-box;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ gap: $space-1;
+ min-height: 22px;
+ padding: 4px $space-2;
+ border: 1px solid transparent;
+ border-radius: $radius-md;
+ font-size: $font-size-xs;
+ font-weight: $font-weight-semibold;
+ line-height: 1;
+ letter-spacing: 0;
+ white-space: nowrap;
+ overflow: visible;
+ text-shadow: none;
+ box-shadow: none;
+
+ &[data-variant="default"] {
+ background: $accent-primary;
+ color: white;
+ border-color: transparent;
+ }
+
+ &[data-variant="secondary"] {
+ background: $bg-hover;
+ color: $text-primary;
+ border-color: $border-active;
+ }
+
+ &[data-variant="destructive"] {
+ background: $danger;
+ color: white;
+ border-color: transparent;
+ }
+
+ &[data-variant="outline"] {
+ background: transparent;
+ color: $text-primary;
+ border-color: $border-active;
+ }
+
+ &[data-variant="success"] {
+ background: $success-bg;
+ color: $success;
+ border-color: $success-border;
+ }
+
+ &[data-variant="warning"] {
+ background: $warning-bg;
+ color: $warning;
+ border-color: $warning-border;
+ }
+
+ &[data-variant="info"] {
+ background: $info-bg;
+ color: $info;
+ border-color: $info-border;
+ }
+
+ &.status-badge-token {
+ min-height: 24px;
+ padding: 4px 9px;
+ border-radius: $radius-full;
+ gap: 6px;
+ }
+}
diff --git a/frontend/src/styles/components/_logs.scss b/frontend/src/styles/components/_logs.scss
index 59ea256d..e441cb7c 100644
--- a/frontend/src/styles/components/_logs.scss
+++ b/frontend/src/styles/components/_logs.scss
@@ -25,6 +25,213 @@
}
}
+// Split log viewer used by the reusable LogViewer component.
+.logs-layout {
+ display: grid;
+ grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
+ height: 100%;
+ min-height: 320px;
+ overflow: hidden;
+ background: $bg-card;
+ border: 1px solid $border-subtle;
+ border-radius: $radius-xl;
+}
+
+.logs-sidebar {
+ min-width: 0;
+ border-right: 1px solid $border-subtle;
+ background: rgba($bg-body-raw, 0.35);
+ display: flex;
+ flex-direction: column;
+
+ .sidebar-header {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: $space-3;
+ padding: $space-3;
+ border-bottom: 1px solid $border-subtle;
+
+ h3 {
+ margin: 0;
+ color: $text-primary;
+ font-size: $font-size-sm;
+ font-weight: $font-weight-semibold;
+ }
+ }
+}
+
+.log-files-list {
+ flex: 1;
+ min-height: 0;
+ overflow-y: auto;
+ padding: $space-2;
+ @include custom-scrollbar();
+}
+
+.log-file-item {
+ display: grid;
+ grid-template-columns: 32px minmax(0, 1fr) auto;
+ align-items: center;
+ gap: $space-2;
+ padding: $space-2;
+ border: 1px solid transparent;
+ border-radius: $radius-lg;
+ color: $text-secondary;
+ cursor: pointer;
+ transition: background $transition-fast, border-color $transition-fast, color $transition-fast;
+
+ &:hover {
+ background: $bg-hover;
+ color: $text-primary;
+ }
+
+ &.active {
+ background: $accent-glow;
+ border-color: rgba($accent-primary-raw, 0.35);
+ color: $text-primary;
+ }
+}
+
+.log-icon {
+ width: 32px;
+ height: 32px;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ border-radius: $radius-md;
+ background: $bg-elevated;
+ color: $text-tertiary;
+
+ &.error { color: $danger; background: $danger-bg; }
+ &.access { color: $info; background: $info-bg; }
+}
+
+.log-file-info {
+ min-width: 0;
+ display: flex;
+ flex-direction: column;
+ gap: 2px;
+}
+
+.log-file-name {
+ color: inherit;
+ font-size: $font-size-sm;
+ font-weight: $font-weight-semibold;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.log-file-path,
+.log-file-size {
+ color: $text-tertiary;
+ font-family: $font-mono;
+ font-size: $font-size-xs;
+}
+
+.logs-viewer {
+ min-width: 0;
+ display: flex;
+ flex-direction: column;
+ background: $bg-card;
+}
+
+.viewer-toolbar {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: $space-3;
+ padding: $space-3;
+ border-bottom: 1px solid $border-subtle;
+ flex-wrap: wrap;
+
+ .toolbar-left,
+ .toolbar-right {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+ flex-wrap: wrap;
+ }
+
+ .search-input {
+ position: relative;
+ min-width: 220px;
+
+ svg {
+ position: absolute;
+ left: $space-3;
+ top: 50%;
+ transform: translateY(-50%);
+ color: $text-tertiary;
+ pointer-events: none;
+ }
+
+ input {
+ padding-left: $space-8;
+ }
+ }
+
+ .lines-select {
+ height: 36px;
+ min-width: 120px;
+ padding: 0 $space-3;
+ border: 1px solid $border-subtle;
+ border-radius: $radius-md;
+ background: $bg-body;
+ color: $text-primary;
+ font-size: $font-size-sm;
+ }
+}
+
+.auto-refresh-toggle {
+ display: inline-flex;
+ align-items: center;
+ gap: $space-2;
+ color: $text-secondary;
+ font-size: $font-size-xs;
+ white-space: nowrap;
+}
+
+.log-content {
+ flex: 1;
+ min-height: 0;
+ overflow: auto;
+ background: var(--bg-code);
+ padding: $space-4;
+ @include custom-scrollbar();
+
+ pre {
+ margin: 0;
+ color: var(--text-code);
+ font-family: $font-mono;
+ font-size: $font-size-xs;
+ line-height: 1.7;
+ white-space: pre-wrap;
+ word-break: break-word;
+ }
+}
+
+.logs-viewer__loading,
+.logs-viewer__empty,
+.empty-hint {
+ color: $text-tertiary;
+ font-size: $font-size-sm;
+ padding: $space-4;
+}
+
+@media (max-width: $breakpoint-md) {
+ .logs-layout {
+ grid-template-columns: 1fr;
+ }
+
+ .logs-sidebar {
+ max-height: 180px;
+ border-right: 0;
+ border-bottom: 1px solid $border-subtle;
+ }
+}
+
// Command output
.command-output {
background: $bg-body;
diff --git a/frontend/src/styles/components/_status-badge.scss b/frontend/src/styles/components/_status-badge.scss
index 31a4e728..87563b80 100644
--- a/frontend/src/styles/components/_status-badge.scss
+++ b/frontend/src/styles/components/_status-badge.scss
@@ -2,11 +2,13 @@
display: inline-flex;
align-items: center;
gap: $spacing-xs;
- padding: 2px $spacing-sm;
+ min-height: 24px;
+ padding: 4px $spacing-sm;
border-radius: $radius-full;
- font-size: $font-size-xs + 1;
- font-weight: $font-weight-medium;
- line-height: 1.4;
+ font-size: $font-size-xs;
+ font-weight: $font-weight-semibold;
+ line-height: 1;
+ white-space: nowrap;
&__dot {
width: 6px;
diff --git a/frontend/src/styles/pages/_servers.scss b/frontend/src/styles/pages/_servers.scss
index 2f778bf7..31ecd176 100644
--- a/frontend/src/styles/pages/_servers.scss
+++ b/frontend/src/styles/pages/_servers.scss
@@ -943,6 +943,8 @@
.server-detail-page {
padding: 0;
+ width: min(100%, 1480px);
+ margin: 0 auto;
}
.page-breadcrumb {
@@ -1928,6 +1930,62 @@
}
}
+// Polished form section variant used in Settings tab
+.form-section--accent {
+ position: relative;
+ overflow: hidden;
+ padding: $space-6;
+
+ &::before {
+ content: '';
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ height: 3px;
+ background: linear-gradient(90deg, $accent-primary, transparent 70%);
+ opacity: 0.85;
+ }
+
+ .form-section__header {
+ display: flex;
+ align-items: flex-start;
+ gap: $space-3;
+ margin-bottom: $space-5;
+
+ h3 {
+ margin: 0 0 $space-1;
+ font-size: $font-size-lg;
+ letter-spacing: -0.01em;
+ }
+
+ .section-description {
+ margin: 0;
+ color: $text-secondary;
+ font-size: $font-size-sm;
+ line-height: 1.5;
+ }
+ }
+
+ .form-section__icon {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ width: 36px;
+ height: 36px;
+ flex-shrink: 0;
+ border-radius: $radius-md;
+ background: rgba($accent-primary-raw, 0.12);
+ color: $accent-primary;
+ border: 1px solid rgba($accent-primary-raw, 0.25);
+
+ svg {
+ width: 18px;
+ height: 18px;
+ }
+ }
+}
+
.form-row {
display: grid;
grid-template-columns: repeat(2, 1fr);
@@ -2812,9 +2870,14 @@
align-items: flex-start;
justify-content: space-between;
gap: $space-5;
- padding: $space-5 0 $space-5;
+ padding: $space-6;
margin-bottom: $space-5;
- border-bottom: 1px solid $border-subtle;
+ background:
+ linear-gradient(135deg, rgba($accent-primary-raw, 0.10), transparent 42%),
+ $bg-card;
+ border: 1px solid $border-subtle;
+ border-radius: $radius-2xl;
+ box-shadow: $shadow-sm;
flex-wrap: wrap;
&__main {
@@ -2829,9 +2892,9 @@
flex-basis: 100%;
margin-top: $space-3;
padding: $space-3 $space-4;
- background: rgba(79, 70, 229, 0.08);
- border: 1px solid rgba(99, 102, 241, 0.4);
- border-radius: $radius-md;
+ background: $info-bg;
+ border: 1px solid $info-border;
+ border-radius: $radius-lg;
color: $text-secondary;
font-size: $font-size-sm;
line-height: 1.5;
@@ -2861,7 +2924,7 @@
background: $success-bg;
border-color: $success-border;
color: $success;
- box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.08);
+ box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.08), 0 0 24px rgba(16, 185, 129, 0.14);
}
&--offline {
background: $danger-bg;
@@ -3005,7 +3068,7 @@
// Refine overview info cards (less marketing, more dashboard)
.overview-tab .info-card {
- padding: $space-4 $space-5;
+ padding: $space-5;
border-radius: $radius-xl;
background: $bg-card;
border: 1px solid $border-subtle;
@@ -3040,3 +3103,354 @@
color: $text-primary;
}
}
+
+// ============================================
+// SERVER OVERVIEW — KPI STRIP & ICONIFIED ROWS
+// ============================================
+.server-stats-strip {
+ display: grid;
+ grid-template-columns: repeat(5, minmax(0, 1fr));
+ gap: $space-4;
+ margin-bottom: $space-5;
+
+ @media (max-width: $breakpoint-lg) {
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+ }
+ @media (max-width: $breakpoint-sm) {
+ grid-template-columns: 1fr;
+ }
+}
+
+.kpi-tile {
+ position: relative;
+ display: flex;
+ flex-direction: column;
+ gap: $space-2;
+ padding: $space-4;
+ background:
+ linear-gradient(180deg, rgba(255,255,255,0.02), transparent 60%),
+ $bg-card;
+ border: 1px solid $border-subtle;
+ border-radius: $radius-xl;
+ box-shadow: $shadow-sm;
+ transition: border-color $transition-fast, transform $transition-fast, box-shadow $transition-fast;
+ overflow: hidden;
+
+ &::before {
+ content: '';
+ position: absolute;
+ inset: 0 0 auto 0;
+ height: 2px;
+ background: linear-gradient(90deg, transparent, rgba($accent-primary-raw, 0.6), transparent);
+ opacity: 0.5;
+ }
+
+ &:hover {
+ border-color: $border-active;
+ transform: translateY(-1px);
+ box-shadow: $shadow-md;
+ }
+
+ &__head {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+ color: $text-tertiary;
+ }
+
+ &__icon {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ width: 22px;
+ height: 22px;
+ border-radius: $radius-sm;
+ background: $bg-elevated;
+ border: 1px solid $border-subtle;
+ color: $text-secondary;
+
+ svg { width: 12px; height: 12px; }
+ }
+
+ &__label {
+ font-size: 11px;
+ font-weight: $font-weight-bold;
+ letter-spacing: 0.08em;
+ text-transform: uppercase;
+ color: $text-tertiary;
+ }
+
+ &__value {
+ font-size: $font-size-xl;
+ font-weight: $font-weight-semibold;
+ color: $text-primary;
+ line-height: 1.2;
+ font-feature-settings: "tnum";
+ text-transform: capitalize;
+ }
+
+ &__sub {
+ font-size: $font-size-xs;
+ color: $text-tertiary;
+ }
+
+ &__gauge-row {
+ display: flex;
+ align-items: center;
+ gap: $space-3;
+ }
+
+ &__gauge-text {
+ display: flex;
+ flex-direction: column;
+ gap: 2px;
+ min-width: 0;
+
+ .kpi-tile__value { font-size: $font-size-lg; font-family: $font-mono; }
+ }
+
+ // Tone variants
+ &--accent::before {
+ background: linear-gradient(90deg, transparent, rgba($accent-primary-raw, 0.9), transparent);
+ opacity: 0.9;
+ }
+
+ &--success {
+ .kpi-tile__icon { background: $success-bg; border-color: $success-border; color: $success; }
+ .kpi-tile__value { color: $success; }
+ &::before { background: linear-gradient(90deg, transparent, $success, transparent); opacity: 0.9; }
+ }
+
+ &--danger {
+ .kpi-tile__icon { background: $danger-bg; border-color: $danger-border; color: $danger; }
+ .kpi-tile__value { color: $danger; }
+ &::before { background: linear-gradient(90deg, transparent, $danger, transparent); opacity: 0.9; }
+ }
+
+ &--warning, &--warn {
+ .kpi-tile__icon { background: $warning-bg; border-color: $warning-border; color: $warning; }
+ &::before { background: linear-gradient(90deg, transparent, $warning, transparent); opacity: 0.9; }
+ }
+}
+
+.kpi-gauge {
+ flex-shrink: 0;
+ transform: rotate(0deg);
+
+ &__track {
+ fill: none;
+ stroke: $bg-elevated;
+ stroke-width: 6;
+ }
+
+ &__bar {
+ fill: none;
+ stroke-width: 6;
+ stroke-linecap: round;
+ transition: stroke-dasharray $transition-base, stroke 0.2s ease;
+ }
+}
+
+// Iconified info rows replacing plain InfoList rows in overview cards
+.overview-tab .info-card {
+ h3 {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+ color: $text-tertiary;
+
+ svg {
+ width: 14px;
+ height: 14px;
+ color: $accent-primary;
+ }
+ }
+}
+
+.info-rows {
+ list-style: none;
+ margin: 0;
+ padding: 0;
+ display: flex;
+ flex-direction: column;
+
+ &--columns {
+ display: grid;
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+ gap: 0 $space-5;
+
+ @media (max-width: $breakpoint-md) {
+ grid-template-columns: 1fr;
+ }
+ }
+}
+
+.info-row {
+ display: grid;
+ grid-template-columns: 18px minmax(0, 1fr) auto;
+ align-items: center;
+ gap: $space-3;
+ padding: $space-3 0;
+ border-bottom: 1px dashed $border-subtle;
+ min-height: 40px;
+
+ &:last-child { border-bottom: 0; }
+
+ &__icon {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ color: $text-tertiary;
+
+ svg { width: 14px; height: 14px; }
+ }
+
+ &__label {
+ font-size: $font-size-sm;
+ color: $text-secondary;
+ }
+
+ &__value {
+ font-size: $font-size-sm;
+ color: $text-primary;
+ text-align: right;
+ max-width: 100%;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+
+ &.mono {
+ font-family: $font-mono;
+ font-size: $font-size-xs;
+ color: $text-secondary;
+ }
+ }
+}
+
+.overview-grid__full {
+ grid-column: 1 / -1;
+}
+
+.info-card--accent {
+ position: relative;
+ overflow: hidden;
+
+ &::before {
+ content: '';
+ position: absolute;
+ inset: 0 0 auto 0;
+ height: 1px;
+ background: linear-gradient(90deg, transparent, rgba($accent-primary-raw, 0.5), transparent);
+ }
+}
+
+// ============================================
+// TAB BADGE (notification count on tabs)
+// ============================================
+.tab-badge {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ margin-left: $space-2;
+ min-width: 18px;
+ height: 18px;
+ padding: 0 6px;
+ border-radius: $radius-full;
+ background: $warning;
+ color: #1a1a1a;
+ font-size: 10px;
+ font-weight: $font-weight-bold;
+ line-height: 1;
+ font-feature-settings: "tnum";
+}
+
+// ============================================
+// NOTIFICATIONS TAB
+// ============================================
+.notifications-tab {
+ display: flex;
+ flex-direction: column;
+ gap: $space-4;
+}
+
+.notifications-list {
+ list-style: none;
+ margin: 0;
+ padding: 0;
+ display: flex;
+ flex-direction: column;
+ gap: $space-3;
+}
+
+.notification {
+ display: flex;
+ align-items: flex-start;
+ gap: $space-3;
+ padding: $space-4 $space-5;
+ background: $bg-card;
+ border: 1px solid $border-subtle;
+ border-left-width: 3px;
+ border-radius: $radius-lg;
+ box-shadow: $shadow-sm;
+
+ &__icon {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ width: 32px;
+ height: 32px;
+ border-radius: $radius-md;
+ background: $bg-elevated;
+ flex-shrink: 0;
+ }
+
+ &__body {
+ min-width: 0;
+ flex: 1;
+ }
+
+ &__title {
+ font-weight: $font-weight-semibold;
+ color: $text-primary;
+ margin-bottom: $space-1;
+ }
+
+ &__message {
+ margin: 0;
+ font-size: $font-size-sm;
+ color: $text-secondary;
+ line-height: $line-height-relaxed;
+ }
+
+ &--info {
+ border-left-color: $accent-primary;
+ .notification__icon { background: $accent-glow; color: $accent-primary; }
+ }
+
+ &--warning {
+ border-left-color: $warning;
+ .notification__icon { background: $warning-bg; color: $warning; }
+ }
+
+ &--danger {
+ border-left-color: $danger;
+ .notification__icon { background: $danger-bg; color: $danger; }
+ }
+}
+
+.notifications-empty {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ gap: $space-2;
+ padding: $space-12 $space-6;
+ background: $bg-card;
+ border: 1px dashed $border-subtle;
+ border-radius: $radius-xl;
+ text-align: center;
+
+ svg { color: $text-tertiary; margin-bottom: $space-2; }
+ h4 { margin: 0; color: $text-primary; font-size: $font-size-lg; }
+ p { margin: 0; color: $text-secondary; font-size: $font-size-sm; }
+}
diff --git a/frontend/src/styles/pages/_style-guide.scss b/frontend/src/styles/pages/_style-guide.scss
index 97d5dfb2..0ac60756 100644
--- a/frontend/src/styles/pages/_style-guide.scss
+++ b/frontend/src/styles/pages/_style-guide.scss
@@ -121,4 +121,14 @@
color: $text-secondary;
text-align: center;
}
+
+ &__split-demo {
+ display: grid;
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+ gap: $space-4;
+
+ @media (max-width: $breakpoint-lg) {
+ grid-template-columns: 1fr;
+ }
+ }
}
diff --git a/frontend/src/styles/pages/_terminal.scss b/frontend/src/styles/pages/_terminal.scss
index b9e516cc..7b41e103 100644
--- a/frontend/src/styles/pages/_terminal.scss
+++ b/frontend/src/styles/pages/_terminal.scss
@@ -1105,13 +1105,13 @@ $lk-default: #71717a;
.journal-controls {
display: flex;
align-items: flex-end;
- gap: $space-6;
+ gap: $space-4;
flex-wrap: wrap;
.control-group {
display: flex;
flex-direction: column;
- gap: $space-1;
+ gap: $space-2;
label {
font-size: $font-size-xs;
@@ -1121,9 +1121,10 @@ $lk-default: #71717a;
input,
select {
- padding: $space-1 $space-2;
+ min-height: 36px;
+ padding: $space-2 $space-3;
border: 1px solid $border-subtle;
- border-radius: $radius-sm;
+ border-radius: $radius-md;
background: $bg-card;
font-size: $font-size-sm;
}
@@ -1147,11 +1148,13 @@ $lk-default: #71717a;
}
.unit-chip {
- padding: 2px $space-2;
+ min-height: 24px;
+ padding: 4px $space-3;
border: 1px solid $border-subtle;
border-radius: $radius-full;
background: $bg-card;
font-size: $font-size-xs;
+ color: $text-secondary;
cursor: pointer;
transition: all 0.15s ease;
@@ -1337,6 +1340,12 @@ $lk-default: #71717a;
.action-buttons {
display: flex;
gap: $space-1;
+ align-items: center;
+ }
+
+ .process-action-button {
+ width: 28px;
+ height: 28px;
}
}
@@ -1530,6 +1539,11 @@ $lk-default: #71717a;
margin-top: auto;
padding-top: $space-3;
border-top: 1px solid $border-subtle;
+
+ .size-8,
+ button {
+ min-width: 64px;
+ }
}
}