Skip to content

ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.

feat(ui): restyle the WordPress site list to a dense table

Juan Denisd18d20ce3634
diff --git a/docs/REDESIGN_MAP.md b/docs/REDESIGN_MAP.md
index 32110c6d..732b7d3f 100644
--- a/docs/REDESIGN_MAP.md
+++ b/docs/REDESIGN_MAP.md
@@ -113,7 +113,7 @@ Effort: S/M/L/XL. Nature: **Restyle** (look only) · **+IA** (layout/tab/route r
| 0 | **Design system + chrome** | L | Restyle+IA | `_variables.scss`, `_theme-variables.scss`, `layout/_sidebar.scss`, `Sidebar.jsx`, `sidebarItems.js`, `index.html` | shared primitives (§3) | none (badge data minor) |
| 1 | **Dashboard** | M | Restyle+IA | `pages/Dashboard.jsx`, `MetricsGraph.jsx`, `pages/_dashboard.scss` | ServerSwitcher, ActivityFeed | activity-feed source (maybe) | **✅ pass 1 done** — metric tiles → `MetricCard`, apps status → `Pill`, chart retinted to new palette (kept the real `MetricsGraph` intact), dotsep meta. Deferred: server-switcher dropdown + activity feed. |
| 2 | **Servers list + detail** | L | Restyle+IA | `pages/Servers.jsx`, `pages/ServerDetail.jsx`, `pages/_servers.scss` | — (reuse MetricsGraph) | reboot cmd, per-server SSH launch; region/load = mock-only | **✅ top-bar migrated** — built shared `SERVER_TABS`; `PageTopbar` (Servers/Agent Fleet/Fleet Monitor/Cloud/Config Templates) added to all 5 pages; **sidebar sub-menu removed**. Main Servers page: top bar added ABOVE the ops workspace — **fleet rail / groups / workbar / bulk / pairing fully preserved** (no over-trim). Sub-page headers swapped to PageTopbar (actions kept). **List body restyled** — the existing `.servers-table` (already capable: bulk-select/group/telemetry/actions) got the demo's dense look: mono uppercase headers + thin token-colored gauges (CPU=accent-bright, RAM=cyan, Disk=green). Region/Load columns omitted (mock-only, no backend). **Follow-up:** ServerDetail tabs body. |
-| 3 | **WordPress list** | L | Restyle+IA+BE | `pages/WordPress.jsx`, `pages/_wordpress.scss` | DataTable usage | enrich `get_sites` payload (plugins/updates/visits/uptime/server/php/env); optional bulk route | **✅ top-bar migrated (LAST group — sidebar now fully flat)** — shared `WORDPRESS_TABS` (WordPress/Pipeline); `PageTopbar` on WordPress + WordPressProjects; **sidebar sub-menu removed** (Import/Create actions kept; Pipeline tab now always-visible, was wpInstalled-gated). Body restyle (dense site table, drawer) still pending. |
+| 3 | **WordPress list** | L | Restyle+IA+BE | `pages/WordPress.jsx`, `pages/_wordpress.scss` | DataTable usage | enrich `get_sites` payload (plugins/updates/visits/uptime/server/php/env); optional bulk route | **✅ top-bar migrated (LAST group — sidebar now fully flat)** — shared `WORDPRESS_TABS` (WordPress/Pipeline); `PageTopbar` on WordPress + WordPressProjects; **sidebar sub-menu removed** (Import/Create actions kept; Pipeline tab now always-visible, was wpInstalled-gated). **List body restyled** — the `.wp-site-card` grid is now a dense `.sk-dtable` (Site tile / Environments / Version / Status `Pill` / tag chips / Open-Site + WP-Admin links), with a status `SegControl` (All/Running/Stopped) + the kept tag filter. Omitted SSL/plugins/visits/uptime/server columns (not in `get_sites` — no list backend) per restyle-first. **Follow-up:** multi-select + bulk ops (needs a bulk route or per-site fan-out), list-payload enrichment. |
| 4 | **WordPress detail (tabbed)** | **XL** | Restyle+IA+BE | `pages/WordPressDetail.jsx` (owns all 14 tabs), `pages/_wordpress.scss`, `_applications.scss` | header env-switcher, FilesDrawer/code-viewer, StatCard/gauge/bar-h | DB largest-tables, OPcache/extensions, uptime response-time + 90d, analytics referrers/devices, posture score |
| 5 | **Docker** | M | Restyle | `pages/Docker.jsx`, `pages/_docker.scss` | KPI tiles | none (strict subset of current) | **✅ pass 1 done** — added `MetricCard` KPI strip (Containers/Images/Volumes/Networks from existing `stats`) atop `dx-main`, restyled status filter → segmented control. KEPT the richer dx- rail/5-tabs/inspector/exec/multi-server. Deferred: per-container accent dot, Projects KPI, logs modal→drawer. |
| 6 | **Database Explorer** | M | Restyle | `pages/Databases.jsx`, `databases/ConsoleTab.jsx`, `SourceTree.jsx`, `ResultsGrid.jsx`, `pages/_databases.scss` | syntax-highlight/gutter editor wrapper | optional "Export as SQL" dump | **✅ pass 1 done** — page already matched the target shell (token-aligned in Phase 0); added engine status-dot glow, green result count, `UTF-8` + `● Connected` status-bar segments. Deferred: syntax-highlight editor + gutter, `+` new-tab pill, ctx-menu Browse-rows/Export-SQL, semantic cell tints. |
diff --git a/frontend/src/pages/WordPress.jsx b/frontend/src/pages/WordPress.jsx
index 635f832a..38240cd7 100644
--- a/frontend/src/pages/WordPress.jsx
+++ b/frontend/src/pages/WordPress.jsx
@@ -6,18 +6,18 @@ import { useResourceTier } from '../contexts/ResourceTierContext';
import ResourceGate from '../components/ResourceGate';
import Spinner from '../components/Spinner';
import EmptyState from '../components/EmptyState';
-import { Globe } from 'lucide-react';
-import { PageTopbar } from '@/components/ds';
+import { Globe, ChevronRight } from 'lucide-react';
+import { PageTopbar, Pill, SegControl } from '@/components/ds';
import { WORDPRESS_TABS } from '../components/wordpress/wordpressTabs';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
-import { Badge } from '@/components/ui/badge';
function WordPress() {
const [sites, setSites] = useState([]);
const [loading, setLoading] = useState(true);
const [activeTag, setActiveTag] = useState(null); // null = show all
+ const [statusFilter, setStatusFilter] = useState('all'); // all | running | stopped
const [showCreateModal, setShowCreateModal] = useState(false);
const [createLoading, setCreateLoading] = useState(false);
const [createForm, setCreateForm] = useState({
@@ -196,105 +196,106 @@ function WordPress() {
</Button>
}
/>
- ) : (
- <>
- {(() => {
- const allTags = Array.from(new Set(sites.flatMap(s => s.tags || []))).sort();
- if (allTags.length === 0) return null;
- return (
- <div className="wp-tag-filter">
- <button
- className={`wp-tag-chip wp-tag-chip--filter ${activeTag === null ? 'is-active' : ''}`}
- onClick={() => setActiveTag(null)}
- >
- All
- </button>
- {allTags.map(tag => (
- <button
- key={tag}
- className={`wp-tag-chip wp-tag-chip--filter ${activeTag === tag ? 'is-active' : ''}`}
- onClick={() => setActiveTag(tag)}
- >
- {tag}
- </button>
- ))}
- </div>
- );
- })()}
- <div className="wp-sites-grid">
- {sites.filter(site => activeTag === null || (site.tags || []).includes(activeTag)).map(site => (
- <div
- key={site.id}
- className="wp-site-card"
- onClick={() => navigate(`/wordpress/${site.id}`)}
- >
- <div className="wp-site-card-header">
- <div className="wp-site-icon">
- <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
- <circle cx="12" cy="12" r="10"/>
- <path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/>
- <path d="M2 12h20"/>
- </svg>
- </div>
- <div className="wp-site-info">
- <h3 className="wp-site-name">{site.name || site.application?.name || `Site ${site.id}`}</h3>
- {site.port && (
- <span className="wp-site-url">:{site.port}</span>
- )}
- </div>
- <div className={`wp-site-status ${site.status === 'running' ? 'running' : 'stopped'}`}>
- <span className="status-dot" />
- {site.status === 'running' ? 'Running' : 'Stopped'}
- </div>
- </div>
- <div className="wp-site-card-body">
- <div className="wp-site-meta">
- <div className="wp-site-meta-item">
- <span className="meta-label">Version</span>
- <span className="meta-value">{site.wp_version || '6.4'}</span>
- </div>
- <div className="wp-site-meta-item">
- <span className="meta-label">Environments</span>
- <span className="meta-value">{(site.environment_count || 0) + 1}</span>
- </div>
- </div>
- {site.tags && site.tags.length > 0 && (
- <div className="wp-site-tags">
- {site.tags.map(tag => (
- <span key={tag} className="wp-tag-chip">{tag}</span>
- ))}
- </div>
- )}
- {site.url && site.status === 'running' && (
- <div className="wp-site-card-links">
- <a
- href={site.url}
- target="_blank"
- rel="noopener noreferrer"
- className="wp-site-link"
- onClick={e => e.stopPropagation()}
+ ) : (() => {
+ const allTags = Array.from(new Set(sites.flatMap(s => s.tags || []))).sort();
+ const shownSites = sites.filter(site => (
+ (statusFilter === 'all'
+ || (statusFilter === 'running' ? site.status === 'running' : site.status !== 'running'))
+ && (activeTag === null || (site.tags || []).includes(activeTag))
+ ));
+ return (
+ <div className="wp-list">
+ <div className="wp-list__toolbar">
+ <SegControl
+ value={statusFilter}
+ onChange={setStatusFilter}
+ options={[
+ { value: 'all', label: 'All' },
+ { value: 'running', label: 'Running' },
+ { value: 'stopped', label: 'Stopped' },
+ ]}
+ />
+ {allTags.length > 0 && (
+ <div className="wp-tag-filter">
+ <button
+ className={`wp-tag-chip wp-tag-chip--filter ${activeTag === null ? 'is-active' : ''}`}
+ onClick={() => setActiveTag(null)}
+ >
+ All tags
+ </button>
+ {allTags.map(tag => (
+ <button
+ key={tag}
+ className={`wp-tag-chip wp-tag-chip--filter ${activeTag === tag ? 'is-active' : ''}`}
+ onClick={() => setActiveTag(tag)}
>
- <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" y1="14" x2="21" y2="3"/></svg>
- Open Site
- </a>
- <a
- href={`${site.url}/wp-admin`}
- target="_blank"
- rel="noopener noreferrer"
- className="wp-site-link"
- onClick={e => e.stopPropagation()}
- >
- <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg>
- WP Admin
- </a>
- </div>
- )}
- </div>
+ {tag}
+ </button>
+ ))}
+ </div>
+ )}
</div>
- ))}
- </div>
- </>
- )}
+
+ <div className="wp-list__card">
+ <table className="sk-dtable">
+ <thead>
+ <tr>
+ <th>Site</th>
+ <th>Environments</th>
+ <th>Version</th>
+ <th>Status</th>
+ <th>Tags</th>
+ <th style={{ width: 70 }} />
+ </tr>
+ </thead>
+ <tbody>
+ {shownSites.map(site => (
+ <tr key={site.id} className="is-clickable" onClick={() => navigate(`/wordpress/${site.id}`)}>
+ <td>
+ <div className="sk-cell-name">
+ <span className="wp-list__tile" aria-hidden="true">
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2"><circle cx="12" cy="12" r="10"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/><path d="M2 12h20"/></svg>
+ </span>
+ <span>
+ <div>{site.name || site.application?.name || `Site ${site.id}`}</div>
+ {site.port && <div className="sk-cell-sub">:{site.port}</div>}
+ </span>
+ </div>
+ </td>
+ <td className="sk-cell-mono">{(site.environment_count || 0) + 1}</td>
+ <td className="sk-cell-mono">WP {site.wp_version || '6.4'}</td>
+ <td>
+ <Pill kind={site.status === 'running' ? 'green' : 'gray'}>
+ {site.status === 'running' ? 'Running' : 'Stopped'}
+ </Pill>
+ </td>
+ <td>
+ {site.tags?.length
+ ? site.tags.map(tag => <span key={tag} className="sk-tag">{tag}</span>)
+ : <span className="wp-list__dash">—</span>}
+ </td>
+ <td>
+ {site.url && site.status === 'running' ? (
+ <div className="wp-list__links" onClick={e => e.stopPropagation()}>
+ <a href={site.url} target="_blank" rel="noopener noreferrer" title="Open site" aria-label="Open site">
+ <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" y1="14" x2="21" y2="3"/></svg>
+ </a>
+ <a href={`${site.url}/wp-admin`} target="_blank" rel="noopener noreferrer" title="WP Admin" aria-label="WP Admin">
+ <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg>
+ </a>
+ </div>
+ ) : (
+ <ChevronRight size={16} className="wp-list__chev" />
+ )}
+ </td>
+ </tr>
+ ))}
+ </tbody>
+ </table>
+ </div>
+ </div>
+ );
+ })()}
{/* Import Site Modal */}
{showImportModal && (
diff --git a/frontend/src/styles/pages/_wordpress.scss b/frontend/src/styles/pages/_wordpress.scss
index 77b0cad1..775a7fe5 100644
--- a/frontend/src/styles/pages/_wordpress.scss
+++ b/frontend/src/styles/pages/_wordpress.scss
@@ -151,6 +151,56 @@
padding: $space-4;
}
+// Redesign: dense WordPress site table (replaces the .wp-site-card grid).
+.wp-list {
+ padding: $space-4;
+
+ &__toolbar {
+ display: flex;
+ align-items: center;
+ gap: $space-3;
+ flex-wrap: wrap;
+ margin-bottom: $space-3;
+
+ .wp-tag-filter { margin: 0; }
+ }
+
+ &__card {
+ background: var(--surface);
+ border: 1px solid var(--border-soft);
+ border-radius: var(--radius);
+ overflow: hidden;
+ }
+
+ &__tile {
+ width: 30px;
+ height: 30px;
+ border-radius: 8px;
+ display: grid;
+ place-items: center;
+ flex-shrink: 0;
+ background: var(--accent-bg);
+ color: var(--accent-bright);
+ }
+
+ &__links {
+ display: inline-flex;
+ gap: $space-2;
+
+ a {
+ display: inline-flex;
+ color: var(--text-faint);
+ transition: color 0.14s;
+ &:hover { color: var(--accent-bright); }
+ }
+ }
+
+ &__dash { color: var(--text-ghost); font-family: var(--mono); font-size: 12px; }
+ &__chev { color: var(--text-ghost); }
+
+ .sk-tag + .sk-tag { margin-left: 4px; }
+}
+
// Site tags / labels (chips + filter bar)
.wp-tag-filter {
display: flex;