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.

refactor(ui): one place for search, and drop the KPI restatements

Juan Denisd944b695e793
diff --git a/docs/screenshots/domains.png b/docs/screenshots/domains.png
index a39db25e..2d27e8a5 100644
Binary files a/docs/screenshots/domains.png and b/docs/screenshots/domains.png differ
diff --git a/docs/screenshots/fleet-proxy.png b/docs/screenshots/fleet-proxy.png
new file mode 100644
index 00000000..641545b9
Binary files /dev/null and b/docs/screenshots/fleet-proxy.png differ
diff --git a/docs/screenshots/services-cards.png b/docs/screenshots/services-cards.png
index 2433b46a..dc7a4d23 100644
Binary files a/docs/screenshots/services-cards.png and b/docs/screenshots/services-cards.png differ
diff --git a/docs/screenshots/services.png b/docs/screenshots/services.png
index c05fe9e4..a9a4d7a1 100644
Binary files a/docs/screenshots/services.png and b/docs/screenshots/services.png differ
diff --git a/docs/screenshots/wp-pipelines.png b/docs/screenshots/wp-pipelines.png
new file mode 100644
index 00000000..eee71dab
Binary files /dev/null and b/docs/screenshots/wp-pipelines.png differ
diff --git a/frontend/src/pages/Domains.jsx b/frontend/src/pages/Domains.jsx
index 4c4f9457..ebd76588 100644
--- a/frontend/src/pages/Domains.jsx
+++ b/frontend/src/pages/Domains.jsx
@@ -2,7 +2,7 @@ import { useState, useEffect } from 'react';
import { useSearchParams } from 'react-router-dom';
import {
Globe, Plus, ShieldCheck, RefreshCw, Trash2, ExternalLink,
- AlertTriangle, Clock, Lock, Search, ChevronRight,
+ AlertTriangle, Lock, Search, ChevronRight,
} from 'lucide-react';
import api from '../services/api';
import { useToast } from '../contexts/ToastContext';
@@ -16,7 +16,7 @@ import { Checkbox } from '@/components/ui/checkbox';
import {
Select, SelectTrigger, SelectContent, SelectItem, SelectValue,
} from '@/components/ui/select';
-import { MetricCard, SegControl, Pill, Drawer, DataTable } from '@/components/ds';
+import { SegControl, SearchField, Pill, Drawer, DataTable } from '@/components/ds';
import { useTopbarActions } from '@/hooks/useTopbarActions';
import RegistrarPortfolio from '../components/domains/RegistrarPortfolio';
import { ProviderBrandIcon } from '../components/icons/ProviderBrands';
@@ -34,6 +34,7 @@ const Domains = () => {
const [loading, setLoading] = useState(true);
const [error, setError] = useState('');
const [filter, setFilter] = useState('all');
+ const [search, setSearch] = useState('');
const [drawerDomain, setDrawerDomain] = useState(null);
const [regInfo, setRegInfo] = useState(null); // lazy registration lookup for the open drawer
const [searchParams, setSearchParams] = useSearchParams();
@@ -259,14 +260,32 @@ const Domains = () => {
})),
].sort((a, b) => a.name.localeCompare(b.name));
- const sslActiveCount = domains.filter(d => d.ssl_enabled).length;
- const expiringCount = domains.filter(d => sslState(d) === 'expiring').length;
- const attentionCount = domains.filter(d => !d.ssl_enabled).length;
-
- const shown = mergedRows.filter(d => (
- filter === 'all' ? true
- : filter === 'ssl' ? sslState(d) === 'expiring'
- : filter === 'issues' ? (d.source !== 'provider' && !d.ssl_enabled) : true
+ // Search narrows the set the filter counts are taken from, so each number
+ // always describes what a click on that segment would actually show.
+ const query = search.trim().toLowerCase();
+ const searched = query
+ ? mergedRows.filter(d => (
+ norm(d.name).includes(query)
+ || (d.registrar || '').toLowerCase().includes(query)
+ || (d.config_name || d.provider || '').toLowerCase().includes(query)
+ || (d.application_id ? getAppName(d.application_id) : '').toLowerCase().includes(query)
+ ))
+ : mergedRows;
+
+ // The segmented control carries the numbers the KPI strip used to: an
+ // "Expiring SSL (2)" segment says the same thing as a tile, and is the
+ // control you'd click next anyway.
+ const isExpiring = (d) => sslState(d) === 'expiring';
+ const needsAttention = (d) => d.source !== 'provider' && !d.ssl_enabled;
+ const filterOptions = [
+ { value: 'all', label: 'All', count: searched.length },
+ { value: 'ssl', label: 'Expiring SSL', count: searched.filter(isExpiring).length },
+ { value: 'issues', label: 'Attention', count: searched.filter(needsAttention).length },
+ ];
+
+ const shown = searched.filter(d => (
+ filter === 'ssl' ? isExpiring(d)
+ : filter === 'issues' ? needsAttention(d) : true
));
// Deep-link: /domains?open=<domain> opens that domain's drawer once data has
@@ -291,8 +310,13 @@ const Domains = () => {
<Button size="sm" onClick={() => setShowAddModal(true)}>
<Plus size={15} /> Add domain
</Button>
+ <SearchField
+ value={search}
+ onSearch={setSearch}
+ placeholder="Search domains…"
+ />
</>,
- [],
+ [search],
);
return (
@@ -317,23 +341,13 @@ const Domains = () => {
/>
) : (
<div className="domains-body">
- <div className="dom-kpis">
- <MetricCard tone="accent" icon={<Globe size={16} />} value={mergedRows.length} label="Domains" />
- <MetricCard tone="green" icon={<Lock size={16} />} value={sslActiveCount} label="SSL active" />
- <MetricCard tone="amber" icon={<Clock size={16} />} value={expiringCount} label="Expiring ≤30d" />
- <MetricCard tone="red" icon={<AlertTriangle size={16} />} value={attentionCount} label="Needs attention" />
- </div>
-
+ {/* No KPI strip: every number it carried is already on the
+ segment you would click to act on it. */}
<div className="dom-listhead">
- <h2 className="dom-listhead__title">All domains</h2>
<SegControl
value={filter}
onChange={setFilter}
- options={[
- { value: 'all', label: 'All' },
- { value: 'ssl', label: 'Expiring SSL' },
- { value: 'issues', label: 'Attention' },
- ]}
+ options={filterOptions}
/>
</div>
@@ -350,7 +364,9 @@ const Domains = () => {
)}
{shown.length === 0 ? (
- <div className="dom-empty">No domains match this filter.</div>
+ <div className="dom-empty">
+ {query ? `No domains match “${search.trim()}”.` : 'No domains match this filter.'}
+ </div>
) : (
<div className="dom-card">
<DataTable
diff --git a/frontend/src/pages/FleetProxy.jsx b/frontend/src/pages/FleetProxy.jsx
index 4ac56bc8..fbad1cc7 100644
--- a/frontend/src/pages/FleetProxy.jsx
+++ b/frontend/src/pages/FleetProxy.jsx
@@ -1,11 +1,11 @@
-import { useState, useEffect, useCallback, useMemo } from 'react';
+import { useState, useEffect, useCallback } from 'react';
import { Link } from 'react-router-dom';
-import { AlertTriangle, Boxes, Network, RefreshCw, Router, Server as ServerIcon, Waypoints } from 'lucide-react';
+import { AlertTriangle, Network, RefreshCw, Server as ServerIcon } from 'lucide-react';
import api from '../services/api';
import { useToast } from '../contexts/ToastContext';
import { useTopbarActions } from '@/hooks/useTopbarActions';
import { Button } from '@/components/ui/button';
-import { DataTable, KpiBand, MetricCard, Pill } from '@/components/ds';
+import { DataTable, Pill } from '@/components/ds';
import EmptyState from '../components/EmptyState';
// Fleet-wide reverse-proxy dashboard (Phase 4 of C6). Aggregates every
@@ -93,36 +93,8 @@ const FleetProxy = () => {
</Button>
), [loading]);
- // Summary counts by proxy type for the header, plus fleet-wide app and
- // ingress-mismatch totals (each server row carries app_count / mismatch_count).
- const summary = useMemo(() => {
- const counts = { total: rows.length, nginx: 0, traefik: 0, caddy: 0, apps: 0, mismatches: 0 };
- rows.forEach((row) => {
- const type = row.proxy_type || 'nginx';
- if (counts[type] != null) counts[type] += 1;
- counts.apps += row.app_count || 0;
- counts.mismatches += row.mismatch_count || 0;
- });
- return counts;
- }, [rows]);
-
- // Summary KPIs. Tone mirrors each proxy type's semantic color (Traefik→cyan,
- // Caddy→violet from PROXY_TYPE_META); the neutral fleet counts read accent,
- // and the mismatch tile turns amber only when there is something to act on.
- const summaryTiles = [
- { key: 'total', label: 'Servers', value: summary.total, icon: <ServerIcon size={16} />, tone: 'accent' },
- { key: 'apps', label: 'Apps', value: summary.apps, icon: <Boxes size={16} />, tone: 'accent' },
- { key: 'traefik', label: 'Traefik', value: summary.traefik, icon: <Router size={16} />, tone: 'cyan' },
- { key: 'caddy', label: 'Caddy', value: summary.caddy, icon: <Waypoints size={16} />, tone: 'violet' },
- {
- key: 'mismatches',
- label: 'Ingress mismatches',
- value: summary.mismatches,
- icon: <AlertTriangle size={16} />,
- tone: summary.mismatches > 0 ? 'amber' : 'green',
- },
- ];
-
+ // No KPI band and no page title: every tile it held was a re-count of a
+ // column already on the table below, and the tab strip names the page.
const columns = [
{ key: 'server', header: 'Server' },
{ key: 'type', header: 'Proxy type' },
@@ -136,32 +108,6 @@ const FleetProxy = () => {
return (
<div className="sk-tabgroup__inner fleet-proxy">
- <header className="fleet-proxy__intro">
- <div className="fleet-proxy__intro-icon">
- <Network size={18} />
- </div>
- <div className="fleet-proxy__intro-text">
- <h1>Fleet Proxy</h1>
- <p>
- Reverse-proxy posture across every server. Host Nginx is the default;
- servers can opt into a managed Traefik or Caddy stack. Open a server&apos;s
- Proxy tab to configure it.
- </p>
- </div>
- </header>
-
- <KpiBand max={5}>
- {summaryTiles.map((tile) => (
- <MetricCard
- key={tile.key}
- icon={tile.icon}
- tone={tile.tone}
- value={tile.value}
- label={tile.label}
- />
- ))}
- </KpiBand>
-
{error ? (
<div className="fleet-proxy__error">
<p>{error}</p>
@@ -179,7 +125,7 @@ const FleetProxy = () => {
<EmptyState
icon={Network}
title="No servers in the fleet"
- description="Add a server to see its reverse-proxy posture here."
+ description="This is where each server's reverse-proxy posture lands: which proxy it runs, whether it's healthy, and when its config was last regenerated. Host Nginx is the default; a server can opt into a managed Traefik or Caddy stack from its Proxy tab. Add a server to start."
/>
)}
renderRow={(row, { key }) => {
diff --git a/frontend/src/pages/Services.jsx b/frontend/src/pages/Services.jsx
index f1d289c7..df9f53f6 100644
--- a/frontend/src/pages/Services.jsx
+++ b/frontend/src/pages/Services.jsx
@@ -7,7 +7,7 @@ import { getServiceType, getStatusConfig, formatRelativeTime } from '../utils/se
import ResourceListPage from '../components/layouts/ResourceListPage';
import BandwidthSparkline from '../components/BandwidthSparkline';
import { formatBytes } from '../utils/formatBytes';
-import { Pill, ServiceTile, EnvTag } from '@/components/ds';
+import { Pill, ServiceTile, EnvTag, SearchField } from '@/components/ds';
import { useTopbarActions } from '@/hooks/useTopbarActions';
import { Button } from '@/components/ui/button';
import { Checkbox } from '@/components/ui/checkbox';
@@ -132,8 +132,13 @@ const Services = () => {
New Service
</Link>
</Button>
+ <SearchField
+ value={searchTerm}
+ onSearch={setSearchTerm}
+ placeholder="Search services…"
+ />
</>,
- []
+ [searchTerm]
);
const allSelected = filteredApps.length > 0 && filteredApps.every(a => selectedIds.has(a.id));
@@ -324,9 +329,6 @@ const Services = () => {
]}
activeFilter={statusFilter}
onFilterChange={setStatusFilter}
- searchTerm={searchTerm}
- onSearchChange={setSearchTerm}
- searchPlaceholder="Search services…"
selectedCount={selectedIds.size}
onClearSelection={() => setSelectedIds(new Set())}
bulkActions={
diff --git a/frontend/src/styles/pages/_domains.scss b/frontend/src/styles/pages/_domains.scss
index 4388eff3..f6b429c2 100644
--- a/frontend/src/styles/pages/_domains.scss
+++ b/frontend/src/styles/pages/_domains.scss
@@ -14,31 +14,13 @@
padding-top: $space-5;
}
-// KPI strip
-.dom-kpis {
- display: grid;
- grid-template-columns: repeat(4, 1fr);
- gap: $space-4;
- margin-bottom: $space-5;
-
- @media (max-width: $breakpoint-lg) { grid-template-columns: repeat(2, 1fr); }
- @media (max-width: $breakpoint-sm) { grid-template-columns: 1fr; }
-}
-
-// List header + segmented filter
+// Segmented filter above the table. The counts it carries replaced the KPI
+// strip that used to sit here — same numbers, on the control you'd click.
.dom-listhead {
display: flex;
align-items: center;
- justify-content: space-between;
gap: $space-4;
margin-bottom: $space-3;
-
- &__title {
- margin: 0;
- font-size: 15px;
- font-weight: $font-weight-semibold;
- color: $text-primary;
- }
}
// Table card
diff --git a/frontend/src/styles/pages/_fleet-proxy.scss b/frontend/src/styles/pages/_fleet-proxy.scss
index b79080ff..a705b622 100644
--- a/frontend/src/styles/pages/_fleet-proxy.scss
+++ b/frontend/src/styles/pages/_fleet-proxy.scss
@@ -12,40 +12,9 @@
flex-direction: column;
gap: $space-4;
- // Intro: icon chip + title + one-line explanation.
- &__intro {
- display: flex;
- align-items: flex-start;
- gap: $space-3;
- }
-
- &__intro-icon {
- display: inline-flex;
- flex: none;
- padding: $space-2;
- border-radius: $radius-md;
- background: var(--accent-bg);
- color: var(--accent-bright);
- }
-
- &__intro-text {
- h1 {
- margin: 0 0 $space-1;
- font-size: $font-size-lg;
- font-weight: 600;
- color: $text-primary;
- }
-
- p {
- margin: 0;
- max-width: 62ch;
- font-size: $font-size-sm;
- color: $text-secondary;
- }
- }
-
- // Summary KPIs now render via the shared KpiBand / MetricCard primitives;
- // no bespoke tile styling lives here.
+ // No intro header and no KPI band: the tab strip names the page, and every
+ // tile was a re-count of a column on the table. What the page is for is
+ // explained where it's actually needed — the empty state.
// "Apps" cell: count plus an optional amber mismatch pill.
&__apps {
diff --git a/frontend/src/styles/pages/_wordpress.scss b/frontend/src/styles/pages/_wordpress.scss
index 4e3e2418..8a709800 100644
--- a/frontend/src/styles/pages/_wordpress.scss
+++ b/frontend/src/styles/pages/_wordpress.scss
@@ -203,11 +203,15 @@
&__meta-running { color: var(--green); }
// Table/cards switch — only rendered by pages that pass a card renderer to
- // ResourceListPage. Sits after the search, which already claims margin-left.
+ // ResourceListPage. It claims the free space so it stays right-aligned on
+ // pages whose search lives in the top bar instead (Services); where a
+ // toolbar search IS present that element already claims it, so the switch
+ // gives the margin back and simply trails it.
&__viewswitch {
display: flex;
gap: 2px;
flex-shrink: 0;
+ margin-left: auto;
padding: 3px;
background: var(--surface-2);
border: 1px solid var(--border);
@@ -229,6 +233,8 @@
}
}
+ &__search + &__viewswitch { margin-left: 0; }
+
// Card layout for the same rows the table shows.
&__cards {
display: grid;