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(services): port the deploy/services/templates design

Juan Denis0d768ca3777a
diff --git a/backend/app/services/remote_docker_service.py b/backend/app/services/remote_docker_service.py
index 74eb81cc..837ba05f 100644
--- a/backend/app/services/remote_docker_service.py
+++ b/backend/app/services/remote_docker_service.py
@@ -481,12 +481,14 @@ class RemoteDockerService:
Returns servers that are online and have Docker permissions.
"""
- # Always include local server
+ # Always include local server. Its capacity is read live rather than
+ # from the Server table — there is no Server row for the panel host.
servers = [{
'id': 'local',
'name': 'Local (this server)',
'status': 'online',
- 'is_local': True
+ 'is_local': True,
+ **RemoteDockerService._local_capacity(),
}]
# Get remote servers
@@ -518,10 +520,31 @@ class RemoteDockerService:
# reports it connects) — preferred over installer conventions.
'agent_install_dir': server.agent_install_dir,
'agent_config_dir': server.agent_config_dir,
+ # Capacity, so placement UIs (the template deploy drawer) can
+ # show what a target actually has before you pick it. Null until
+ # an agent reports system info.
+ 'cpu_cores': server.cpu_cores,
+ 'total_memory': server.total_memory,
+ 'total_disk': server.total_disk,
})
return servers
+ @staticmethod
+ def _local_capacity() -> Dict[str, Any]:
+ """Best-effort CPU/RAM/disk for the panel host. Absent psutil (or on a
+ platform where a probe raises) the keys come back null and capacity is
+ simply not shown — never a hard failure of the server list."""
+ capacity = {'cpu_cores': None, 'total_memory': None, 'total_disk': None}
+ try:
+ import psutil
+ capacity['cpu_cores'] = psutil.cpu_count(logical=True)
+ capacity['total_memory'] = psutil.virtual_memory().total
+ capacity['total_disk'] = psutil.disk_usage('/').total
+ except Exception:
+ pass
+ return capacity
+
# ==================== Docker Compose ====================
@staticmethod
diff --git a/frontend/src/components/deploy-console/PipelineStrip.jsx b/frontend/src/components/deploy-console/PipelineStrip.jsx
new file mode 100644
index 00000000..fa427ec2
--- /dev/null
+++ b/frontend/src/components/deploy-console/PipelineStrip.jsx
@@ -0,0 +1,68 @@
+import { Check, Loader2, X, Circle } from 'lucide-react';
+
+// Per-step duration formatter (seconds -> "3s" / "1m 4s").
+const fmtSeconds = (s) => {
+ if (s == null) return '';
+ if (s < 60) return `${s < 10 ? s.toFixed(1) : Math.round(s)}s`;
+ const m = Math.floor(s / 60);
+ return `${m}m ${Math.round(s % 60)}s`;
+};
+
+const STATE_ICON = {
+ done: Check,
+ running: Loader2,
+ failed: X,
+ pending: Circle,
+};
+
+// The job plan as a horizontal strip above the log: one segment per step, each
+// carrying a bar sized to that step's share of total runtime, so where the time
+// actually went is readable at a glance. Replaced the left-hand vertical rail,
+// which cost the log pane ~250px of width for a list that never needed it.
+// Clicking a segment scrolls the log pane to that step's first line.
+export default function PipelineStrip({ steps, selected, onStepClick }) {
+ if (!steps || steps.length === 0) return null;
+
+ const total = steps.reduce((sum, s) => sum + (s.seconds || 0), 0) || 1;
+
+ return (
+ <div className="deploy-console__pipeline" role="list" aria-label="Deployment steps">
+ {steps.map((step) => {
+ const Icon = STATE_ICON[step.state] || Circle;
+ const pct = Math.round(((step.seconds || 0) / total) * 100);
+ return (
+ <button
+ type="button"
+ role="listitem"
+ key={step.index}
+ className={[
+ 'deploy-console__seg',
+ `deploy-console__seg--${step.state}`,
+ selected === step.index ? 'is-selected' : '',
+ ].filter(Boolean).join(' ')}
+ onClick={() => onStepClick?.(step.index)}
+ title={step.name}
+ >
+ <span className="deploy-console__seg-head">
+ <Icon
+ size={13}
+ className={step.state === 'running' ? 'deploy-console__spin' : ''}
+ />
+ <span className="deploy-console__seg-name">{step.name}</span>
+ </span>
+ <span className="deploy-console__seg-bar">
+ {/* A finished step always shows a sliver even at 0% of
+ total, so a fast step never reads as "did not run". */}
+ <i style={{ width: `${step.seconds ? Math.max(pct, 3) : 0}%` }} />
+ </span>
+ <span className="deploy-console__seg-dur">
+ {step.state === 'running'
+ ? 'running…'
+ : fmtSeconds(step.seconds) || (step.state === 'pending' ? 'pending' : '—')}
+ </span>
+ </button>
+ );
+ })}
+ </div>
+ );
+}
diff --git a/frontend/src/components/deploy-console/StepRail.jsx b/frontend/src/components/deploy-console/StepRail.jsx
deleted file mode 100644
index 6dd5777f..00000000
--- a/frontend/src/components/deploy-console/StepRail.jsx
+++ /dev/null
@@ -1,54 +0,0 @@
-import { Check, Loader2, X, Circle } from 'lucide-react';
-
-// Per-step duration formatter (seconds -> "3s" / "1m 4s").
-const fmtSeconds = (s) => {
- if (s == null) return '';
- if (s < 60) return `${s < 10 ? s.toFixed(1) : Math.round(s)}s`;
- const m = Math.floor(s / 60);
- return `${m}m ${Math.round(s % 60)}s`;
-};
-
-const STATE_ICON = {
- done: Check,
- running: Loader2,
- failed: X,
- pending: Circle,
-};
-
-// Left-hand checklist of the job plan: ✓ with duration when done, spinner on the
-// current step, ✗ on the failed step, ○ pending. Clicking a step scrolls the log
-// pane to that step's first line (via onStepClick(index)).
-export default function StepRail({ steps, onStepClick }) {
- if (!steps || steps.length === 0) return null;
- return (
- <ol className="deploy-console__rail" aria-label="Deployment steps">
- {steps.map((step) => {
- const Icon = STATE_ICON[step.state] || Circle;
- return (
- <li
- key={step.index}
- className={`deploy-console__rail-item deploy-console__rail-item--${step.state}`}
- >
- <button
- type="button"
- className="deploy-console__rail-btn"
- onClick={() => onStepClick?.(step.index)}
- title={step.name}
- >
- <span className="deploy-console__rail-icon">
- <Icon
- size={15}
- className={step.state === 'running' ? 'deploy-console__spin' : ''}
- />
- </span>
- <span className="deploy-console__rail-name">{step.name}</span>
- {step.seconds != null && (
- <span className="deploy-console__rail-time">{fmtSeconds(step.seconds)}</span>
- )}
- </button>
- </li>
- );
- })}
- </ol>
- );
-}
diff --git a/frontend/src/components/layouts/ResourceListPage.jsx b/frontend/src/components/layouts/ResourceListPage.jsx
index 42c67fd2..834bbe7a 100644
--- a/frontend/src/components/layouts/ResourceListPage.jsx
+++ b/frontend/src/components/layouts/ResourceListPage.jsx
@@ -1,4 +1,5 @@
-import { Search } from 'lucide-react';
+import { useState } from 'react';
+import { Search, Rows3, LayoutGrid } from 'lucide-react';
import { cn } from '@/lib/utils';
import { SegControl } from '@/components/ds';
import { Button } from '@/components/ui/button';
@@ -61,9 +62,31 @@ export default function ResourceListPage({
filteredEmptyIcon,
filteredEmptyTitle = 'No results found',
filteredEmptyDescription = 'Try adjusting your search or filter.',
+ // Opt-in card view: pass a renderer and the toolbar grows a list/cards
+ // switch. Pages that omit it are table-only exactly as before.
+ renderCard,
+ viewStorageKey,
children,
}) {
const resolvedTotal = totalCount ?? items.length;
+ const [view, setView] = useState(() => {
+ if (!renderCard) return 'list';
+ try {
+ return window.localStorage.getItem(viewStorageKey) === 'cards' ? 'cards' : 'list';
+ } catch {
+ return 'list';
+ }
+ });
+
+ const changeView = (next) => {
+ setView(next);
+ if (!viewStorageKey) return;
+ try {
+ window.localStorage.setItem(viewStorageKey, next);
+ } catch {
+ /* private mode / quota — the choice just doesn't persist */
+ }
+ };
if (loading) {
return <EmptyState loading title={loadingTitle} />;
@@ -103,6 +126,23 @@ export default function ResourceListPage({
</div>
)}
{toolbarExtra}
+ {renderCard && (
+ <div className="wp-list__viewswitch" role="group" aria-label="Layout">
+ {[['list', Rows3, 'List'], ['cards', LayoutGrid, 'Cards']].map(([key, Icon, label]) => (
+ <button
+ type="button"
+ key={key}
+ className={view === key ? 'is-active' : ''}
+ onClick={() => changeView(key)}
+ title={label}
+ aria-label={label}
+ aria-pressed={view === key}
+ >
+ <Icon size={15} />
+ </button>
+ ))}
+ </div>
+ )}
</div>
{selectedCount > 0 && (
@@ -125,6 +165,18 @@ export default function ResourceListPage({
title={filteredEmptyTitle}
description={filteredEmptyDescription}
/>
+ ) : view === 'cards' && renderCard ? (
+ <div className="wp-list__cards">
+ {items.map((item) => (
+ <div
+ key={item[keyField]}
+ className={cn('wp-list__cardtile', rowClassName?.(item))}
+ onClick={() => onRowClick?.(item)}
+ >
+ {renderCard(item)}
+ </div>
+ ))}
+ </div>
) : (
<div className="wp-list__card">
<DataTable
diff --git a/frontend/src/components/templates/ServerPicker.jsx b/frontend/src/components/templates/ServerPicker.jsx
new file mode 100644
index 00000000..29c9fa0b
--- /dev/null
+++ b/frontend/src/components/templates/ServerPicker.jsx
@@ -0,0 +1,75 @@
+import { useState, useMemo } from 'react';
+import { Search } from 'lucide-react';
+
+const GIB = 1024 ** 3;
+
+// "8 vCPU · 32 GB" — whichever halves the agent has actually reported.
+function capacityLabel(server) {
+ const parts = [];
+ if (server.cpu_cores) parts.push(`${server.cpu_cores} vCPU`);
+ if (server.total_memory) parts.push(`${Math.round(server.total_memory / GIB)} GB`);
+ return parts.join(' · ');
+}
+
+// Radio list of deploy targets showing each one's capacity, so placing a
+// service on a second box is a visible choice rather than a hidden default.
+// Gains a filter box once the fleet outgrows a glanceable list.
+export default function ServerPicker({ servers, value, onChange, filterThreshold = 6 }) {
+ const [query, setQuery] = useState('');
+
+ const list = useMemo(() => {
+ const q = query.trim().toLowerCase();
+ if (!q) return servers;
+ return servers.filter((s) =>
+ (s.name || '').toLowerCase().includes(q)
+ || (s.group_name || '').toLowerCase().includes(q)
+ || (s.os_type || '').toLowerCase().includes(q)
+ );
+ }, [servers, query]);
+
+ return (
+ <div className="sk-srvpick">
+ {servers.length > filterThreshold && (
+ <div className="sk-srvpick__find">
+ <Search size={14} />
+ <input
+ type="search"
+ placeholder="Find a server…"
+ value={query}
+ onChange={(e) => setQuery(e.target.value)}
+ aria-label="Filter servers"
+ />
+ </div>
+ )}
+ <div className="sk-srvpick__list" role="radiogroup" aria-label="Deploy to server">
+ {list.map((server) => {
+ const capacity = capacityLabel(server);
+ const selected = value === server.id;
+ return (
+ <button
+ type="button"
+ role="radio"
+ aria-checked={selected}
+ key={server.id}
+ className={`sk-srvpick__row${selected ? ' is-selected' : ''}`}
+ onClick={() => onChange(server.id)}
+ >
+ <span className="sk-srvpick__radio" />
+ <span className="sk-srvpick__meta">
+ <span className="sk-srvpick__name">{server.name}</span>
+ <span className="sk-srvpick__sub">
+ {server.is_local ? 'this panel' : (server.group_name || 'remote')}
+ {server.os_type ? ` · ${server.os_type}` : ''}
+ </span>
+ </span>
+ {capacity && <span className="sk-srvpick__tag">{capacity}</span>}
+ </button>
+ );
+ })}
+ {list.length === 0 && (
+ <div className="sk-srvpick__empty">No servers match.</div>
+ )}
+ </div>
+ </div>
+ );
+}
diff --git a/frontend/src/pages/DeployConsole.jsx b/frontend/src/pages/DeployConsole.jsx
index df376d02..5d8079bc 100644
--- a/frontend/src/pages/DeployConsole.jsx
+++ b/frontend/src/pages/DeployConsole.jsx
@@ -3,11 +3,12 @@ import { useParams, useNavigate, Link } from 'react-router-dom';
import { ArrowLeft, Loader2, CheckCircle2, XCircle, Clock, WifiOff } from 'lucide-react';
import useDeployJobStream from '../hooks/useDeployJobStream';
import api from '../services/api';
-import StepRail from '../components/deploy-console/StepRail';
+import PipelineStrip from '../components/deploy-console/PipelineStrip';
import ConsoleToolbar from '../components/deploy-console/ConsoleToolbar';
import LogPane from '../components/deploy-console/LogPane';
import ErrorCard from '../components/deploy-console/ErrorCard';
import SuccessBanner from '../components/deploy-console/SuccessBanner';
+import { sourceRef } from '../utils/deployActivity';
const STATUS_META = {
pending: { label: 'Queued', icon: Clock, cls: 'pending' },
@@ -17,6 +18,15 @@ const STATUS_META = {
cancelled: { label: 'Cancelled', icon: XCircle, cls: 'failed' },
};
+const fmtStarted = (iso) => {
+ if (!iso) return 'not started';
+ try {
+ return new Date(iso).toLocaleString();
+ } catch {
+ return iso;
+ }
+};
+
const fmtElapsed = (ms) => {
if (ms == null || ms < 0) return '0:00';
const total = Math.floor(ms / 1000);
@@ -54,6 +64,7 @@ export default function DeployConsole() {
const [level, setLevel] = useState('all');
const [search, setSearch] = useState('');
const [scrollToStep, setScrollToStep] = useState(null);
+ const [selectedStep, setSelectedStep] = useState(null);
const [retrying, setRetrying] = useState(false);
const [now, setNow] = useState(Date.now());
@@ -118,6 +129,7 @@ export default function DeployConsole() {
const onStepClick = useCallback((index) => {
setFollow(false);
+ setSelectedStep(index);
setScrollToStep(index);
// reset so a repeat click on the same step re-triggers the effect
setTimeout(() => setScrollToStep(null), 100);
@@ -140,6 +152,7 @@ export default function DeployConsole() {
: null;
const appUrl = job?.result?.auto_domain?.url || null;
const degraded = (status === 'running' || status === 'pending') && transport === 'poll';
+ const sourceLabel = job ? sourceRef(job) : null;
if (loading && !job) {
return (
@@ -216,10 +229,17 @@ export default function DeployConsole() {
<SuccessBanner job={job} appUrl={appUrl} />
)}
+ <PipelineStrip steps={steps} selected={selectedStep} onStepClick={onStepClick} />
+
+ <div className="deploy-console__runmeta">
+ <span><b>{jobId}</b></span>
+ <span>trigger <b>{job?.trigger || 'manual'}</b></span>
+ {sourceLabel && <span>source <b>{sourceLabel}</b></span>}
+ <span>target <b>{job?.target_server_name || 'Local server'}</b></span>
+ <span>started <b>{fmtStarted(job?.started_at || job?.created_at)}</b></span>
+ </div>
+
<div className="deploy-console__body">
- {steps.length > 0 && (
- <StepRail steps={steps} onStepClick={onStepClick} />
- )}
<div className="deploy-console__main">
<ConsoleToolbar
follow={follow} onToggleFollow={() => setFollow((v) => !v)}
diff --git a/frontend/src/pages/Deployments.jsx b/frontend/src/pages/Deployments.jsx
index 885d6dd4..dc9cd1e8 100644
--- a/frontend/src/pages/Deployments.jsx
+++ b/frontend/src/pages/Deployments.jsx
@@ -5,50 +5,39 @@ import {
XCircle,
Clock,
RefreshCw,
- Server,
Loader2,
PlayCircle,
FlaskConical,
+ ChevronRight,
} from 'lucide-react';
import api from '../services/api';
-import { StatStrip, Stat } from '../components/StatCard';
import Modal from '../components/Modal';
import Skeleton from '../components/Skeleton';
import { Button } from '@/components/ui/button';
+import { SegControl, SearchField } from '@/components/ds';
import { useTopbarActions } from '@/hooks/useTopbarActions';
+import {
+ KIND_CHIP,
+ stepTicks,
+ sourceRef,
+ formatDuration,
+ relativeTime,
+ groupDeploys,
+} from '../utils/deployActivity';
-const STATUS_ICONS = {
- pending: Clock,
- running: Loader2,
- succeeded: CheckCircle2,
- failed: XCircle,
+const STATE_ICON = {
+ succeeded: { Icon: CheckCircle2, cls: 'succeeded' },
+ failed: { Icon: XCircle, cls: 'failed' },
+ running: { Icon: Loader2, cls: 'running' },
+ pending: { Icon: Clock, cls: 'pending' },
};
-const KIND_LABELS = {
- app_deploy: 'App deploy',
- template_install: 'Template install',
- demo_deploy: 'Test (simulated)',
-};
-
-const formatTime = (iso) => {
- if (!iso) return '—';
- try {
- return new Date(iso).toLocaleString();
- } catch {
- return iso;
- }
-};
-
-const StatusBadge = ({ status }) => {
- const cls = STATUS_ICONS[status] ? status : 'pending';
- const Icon = STATUS_ICONS[cls];
- return (
- <span className={`deployments-page__status-badge deployments-page__status-badge--${cls}`}>
- <Icon size={14} className={cls === 'running' ? 'deployments-page__spin' : ''} />
- {status}
- </span>
- );
-};
+const STATUS_FILTERS = [
+ ['all', 'All'],
+ ['running', 'Running'],
+ ['succeeded', 'Succeeded'],
+ ['failed', 'Failed'],
+];
const Deployments = () => {
const navigate = useNavigate();
@@ -56,6 +45,7 @@ const Deployments = () => {
const [loading, setLoading] = useState(true);
const [statusFilter, setStatusFilter] = useState('all');
const [serverFilter, setServerFilter] = useState('all');
+ const [search, setSearch] = useState('');
const [servers, setServers] = useState([]);
const [autoRefresh, setAutoRefresh] = useState(true);
const refreshRef = useRef(null);
@@ -67,10 +57,11 @@ const Deployments = () => {
const [simSpeed, setSimSpeed] = useState('fast');
const [simBusy, setSimBusy] = useState(null);
+ // Status is filtered client-side so the segmented control can show a live
+ // count per state; only the server filter narrows the query.
const loadJobs = async () => {
try {
- const params = {};
- if (statusFilter !== 'all') params.status = statusFilter;
+ const params = { limit: 100 };
if (serverFilter !== 'all') params.serverId = serverFilter;
const data = await api.getDeploymentJobs(params);
setJobs(data.jobs || []);
@@ -110,25 +101,47 @@ const Deployments = () => {
useEffect(() => {
loadJobs();
- }, [statusFilter, serverFilter]);
+ }, [serverFilter]);
useEffect(() => {
if (refreshRef.current) clearInterval(refreshRef.current);
if (!autoRefresh) return undefined;
refreshRef.current = setInterval(loadJobs, 3000);
return () => clearInterval(refreshRef.current);
- }, [autoRefresh, statusFilter, serverFilter]);
+ }, [autoRefresh, serverFilter]);
+
+ // Search narrows the set the counts are taken from, so the numbers always
+ // describe what a click on that filter would actually show.
+ const searched = useMemo(() => {
+ const q = search.trim().toLowerCase();
+ if (!q) return jobs;
+ return jobs.filter((j) =>
+ (j.app_name || '').toLowerCase().includes(q)
+ || (sourceRef(j) || '').toLowerCase().includes(q)
+ || (j.target_server_name || '').toLowerCase().includes(q)
+ );
+ }, [jobs, search]);
- const summary = useMemo(() => {
- const counts = { running: 0, succeeded: 0, failed: 0, pending: 0 };
- jobs.forEach((j) => {
- counts[j.status] = (counts[j.status] || 0) + 1;
+ const counts = useMemo(() => {
+ const c = { all: searched.length, running: 0, succeeded: 0, failed: 0 };
+ searched.forEach((j) => {
+ if (c[j.status] !== undefined) c[j.status] += 1;
});
- return counts;
- }, [jobs]);
+ return c;
+ }, [searched]);
+
+ const groups = useMemo(() => {
+ const shown = statusFilter === 'all'
+ ? searched
+ : searched.filter((j) => j.status === statusFilter);
+ return groupDeploys(shown);
+ }, [searched, statusFilter]);
useTopbarActions(() =>
<>
+ {/* No "New service" button here: unlike the design mock, this tab
+ group already carries a New Service tab, and a second entry
+ point crowded the strip into overflow. */}
{simInfo?.enabled && (
<Button variant="outline" size="sm" onClick={() => setSimOpen(true)}>
<FlaskConical size={16} />
@@ -147,115 +160,154 @@ const Deployments = () => {
<Button variant="outline" size="sm" onClick={loadJobs}>
<RefreshCw size={16} /> Refresh
</Button>
+ <SearchField
+ value={search}
+ onSearch={setSearch}
+ placeholder="Search deploys…"
+ />
</>,
- [autoRefresh, simInfo?.enabled]
+ [autoRefresh, simInfo?.enabled, search]
);
return (
<div className="sk-tabgroup__inner deployments-page">
- <StatStrip ariaLabel="Deployment summary">
- <Stat label="Running" value={summary.running} state={summary.running > 0 ? 'info' : undefined} />
- <Stat label="Succeeded" value={summary.succeeded} state={summary.succeeded > 0 ? 'success' : undefined} />
- <Stat label="Failed" value={summary.failed} state={summary.failed > 0 ? 'danger' : undefined} />
- <Stat label="Pending" value={summary.pending} />
- </StatStrip>
-
<div className="deployments-page__toolbar">
- <div className="deployments-page__filter">
- <label>Status</label>
- <select value={statusFilter} onChange={(e) => setStatusFilter(e.target.value)}>
- <option value="all">All</option>
- <option value="pending">Pending</option>
- <option value="running">Running</option>
- <option value="succeeded">Succeeded</option>
- <option value="failed">Failed</option>
- </select>
- </div>
- <div className="deployments-page__filter">
- <label>Target server</label>
- <select value={serverFilter} onChange={(e) => setServerFilter(e.target.value)}>
- <option value="all">All servers</option>
- {servers.map((s) => (
- <option key={s.id} value={s.id}>
- {s.name}{s.is_local ? ' (local)' : ''}
- </option>
- ))}
- </select>
- </div>
+ <SegControl
+ value={statusFilter}
+ onChange={setStatusFilter}
+ options={STATUS_FILTERS.map(([value, label]) => ({
+ value,
+ label,
+ count: counts[value],
+ }))}
+ aria-label="Filter by status"
+ />
+ <select
+ className="deployments-page__server-select"
+ value={serverFilter}
+ onChange={(e) => setServerFilter(e.target.value)}
+ aria-label="Filter by target server"
+ >
+ <option value="all">All servers</option>
+ {servers.map((s) => (
+ <option key={s.id} value={s.id}>
+ {s.name}{s.is_local ? ' (local)' : ''}
+ </option>
+ ))}
+ </select>
</div>
- <div className="deployments-page__panel deployments-page__jobs-panel">
- <div className="deployments-page__panel-header">
- <div>
- <h2>Jobs</h2>
- <span>{jobs.length} visible</span>
- </div>
+ {loading ? (
+ <div className="deployments-page__loading" aria-busy="true">
+ {[0, 1, 2, 3].map((i) => (
+ <div key={i} className="deployments-page__loading-row">
+ <Skeleton variant="line" width={96} />
+ <Skeleton variant="line" width="34%" />
+ <Skeleton variant="line" width="20%" />
+ <Skeleton variant="line" width="26%" />
+ </div>
+ ))}
</div>
- {loading ? (
- <div className="deployments-page__loading" aria-busy="true">
- {[0, 1, 2, 3].map((i) => (
- <div key={i} className="deployments-page__loading-row">
- <Skeleton variant="line" width={96} />
- <Skeleton variant="line" width="34%" />
- <Skeleton variant="line" width="20%" />
- <Skeleton variant="line" width="26%" />
- </div>
- ))}
- </div>
- ) : jobs.length === 0 ? (
- <div className="deployments-page__empty">
- <PlayCircle size={34} />
- <strong>No deployment jobs yet</strong>
- <span>
- Create a service from a repository or install a template to see activity here.
- </span>
+ ) : groups.length === 0 ? (
+ <div className="deployments-page__empty">
+ <PlayCircle size={34} />
+ <strong>
+ {jobs.length === 0 ? 'No deployment jobs yet' : 'No deploys match this filter'}
+ </strong>
+ <span>
+ {jobs.length === 0
+ ? 'Create a service from a repository or install a template to see activity here.'
+ : 'Try a different status, server, or search term.'}
+ </span>
+ </div>
+ ) : (
+ <div className="deployments-page__feed">
+ <div className="deployments-page__feed-head" aria-hidden="true">
+ <span />
+ <span>Deploy</span>
+ <span>Pipeline</span>
+ <span>Target</span>
+ <span className="is-right">Took</span>
+ <span className="is-right">Started</span>
+ <span />
</div>
- ) : (
- <table className="deployments-page__jobs-table">
- <thead>
- <tr>
- <th>Status</th>
- <th>Kind</th>
- <th>Target</th>
- <th>App</th>
- <th>Progress</th>
- <th>Started</th>
- </tr>
- </thead>
- <tbody>
- {jobs.map((job) => (
- <tr
- key={job.id}
- onClick={() => navigate(`/deployments/${job.id}`)}
- title="Open the Deploy Console"
- >
- <td><StatusBadge status={job.status} /></td>
- <td>{KIND_LABELS[job.kind] || job.kind}</td>
- <td>
- <span className="deployments-page__server-cell">
- <Server size={12} />
+
+ {groups.map(({ group, items }) => (
+ <div className="deployments-page__group" key={group}>
+ <div className="deployments-page__group-head">
+ {group}
+ <i />
+ </div>
+ {items.map((job) => {
+ const meta = STATE_ICON[job.status] || STATE_ICON.pending;
+ const { Icon } = meta;
+ const ticks = stepTicks(job);
+ return (
+ <button
+ type="button"
+ key={job.id}
+ className={`deployments-page__row deployments-page__row--${meta.cls}`}
+ onClick={() => navigate(`/deployments/${job.id}`)}
+ title="Open the Deploy Console"
+ >
+ <span className={`deployments-page__row-ico is-${meta.cls}`}>
+ <Icon size={15} className={job.status === 'running' ? 'spin' : ''} />
+ </span>
+
+ <span className="deployments-page__row-main">
+ <span className="deployments-page__row-name">
+ {job.app_name || 'deployment'}
+ <span className="deployments-page__row-kind">
+ {KIND_CHIP[job.kind] || job.kind}
+ </span>
+ </span>
+ <span className="deployments-page__row-sub">
+ <span className="deployments-page__row-ref">
+ {sourceRef(job) || job.id.slice(0, 8)}
+ </span>
+ <span className="deployments-page__row-sep">·</span>
+ <span>{job.trigger || 'manual'}</span>
+ {job.status === 'failed' && job.error_message && (
+ <>
+ <span className="deployments-page__row-sep">·</span>
+ <span className="deployments-page__row-error">
+ {job.error_message}
+ </span>
+ </>
+ )}
+ </span>
+ </span>
+
+ <span className="deployments-page__pipe">
+ <span className="deployments-page__ticks">
+ {ticks.map((state, i) => (
+ <i key={i} className={`is-${state}`} />
+ ))}
+ </span>
+ <span className="deployments-page__pipe-count">
+ {job.current_step || 0}/{job.total_steps || 0}
+ </span>
+ </span>
+
+ <span className="deployments-page__row-target">
{job.target_server_name || 'Local server'}
</span>
- </td>
- <td>{job.app_name || '—'}</td>
- <td>
- <div className="deployments-page__progress">
- <div
- className={`deployments-page__progress-fill${job.status === 'failed' ? ' deployments-page__progress-fill--failed' : ''}`}
- style={{ width: `${job.progress_percent || 0}%` }}
- />
- </div>
- <div className="deployments-page__progress-meta">
- {job.current_step || 0}/{job.total_steps || 0}
- </div>
- </td>
- <td className="deployments-page__time-cell">{formatTime(job.started_at || job.created_at)}</td>
- </tr>
- ))}
- </tbody>
- </table>
- )}
- </div>
+ <span className="deployments-page__row-took">
+ {formatDuration(job.duration)}
+ </span>
+ <span className="deployments-page__row-when">
+ {job.status === 'pending'
+ ? 'queued'
+ : relativeTime(job.started_at || job.created_at)}
+ </span>
+ <ChevronRight size={15} className="deployments-page__row-chev" />
+ </button>
+ );
+ })}
+ </div>
+ ))}
+ </div>
+ )}
<Modal
open={simOpen}
@@ -288,7 +340,7 @@ const Deployments = () => {
<span>{s.description}</span>
</span>
{simBusy === s.id && (
- <Loader2 size={15} className="deployments-page__spin" />
+ <Loader2 size={15} className="spin" />
)}
</button>
))}
diff --git a/frontend/src/pages/Services.jsx b/frontend/src/pages/Services.jsx
index 4878b928..f1d289c7 100644
--- a/frontend/src/pages/Services.jsx
+++ b/frontend/src/pages/Services.jsx
@@ -351,6 +351,65 @@ const Services = () => {
filteredEmptyIcon={Layers}
filteredEmptyTitle="No services found"
filteredEmptyDescription="Try adjusting your search or filter"
+ viewStorageKey="serverkit.services.view"
+ renderCard={(app) => {
+ const typeInfo = getServiceType(app.app_type);
+ const primaryDomain = (app.domains?.find(d => d.is_primary) || app.domains?.[0])?.name;
+ const isRunning = app.status === 'running';
+ const bw = bandwidth[String(app.id)];
+ return (
+ <>
+ <div className="services-card__top">
+ <ServiceTile name={app.name} size={40} aria-hidden="true" />
+ <div className="services-card__id">
+ <div className="services-card__name">{app.name}</div>
+ <div className="sk-cell-sub">{typeInfo.label}</div>
+ </div>
+ <Pill kind={STATUS_PILL[app.status] || 'gray'}>
+ {getStatusConfig(app.status).label}
+ </Pill>
+ </div>
+
+ <div className="services-card__domain">
+ {primaryDomain || <span className="wp-list__dash">No domain</span>}
+ </div>
+
+ <div className="services-card__stats">
+ <div>
+ <span className="l">Project</span>
+ <span className="v">{app.project_name || '—'}</span>
+ </div>
+ <div>
+ <span className="l">Transfer</span>
+ <span className="v">{bw?.month_bytes ? `${formatBytes(bw.month_bytes)}/mo` : '—'}</span>
+ </div>
+ <div>
+ <span className="l">Last deploy</span>
+ <span className="v">
+ {app.last_deploy_at ? formatRelativeTime(app.last_deploy_at) : '—'}
+ </span>
+ </div>
+ </div>
+
+ <div className="services-card__foot" onClick={(e) => e.stopPropagation()}>
+ {isRunning ? (
+ <>
+ <Button variant="ghost" size="sm" onClick={(e) => handleAction(e, app.id, 'restart')} disabled={actionLoading === `${app.id}-restart`} title="Restart">
+ <RotateCw size={14} />
+ </Button>
+ <Button variant="ghost" size="sm" onClick={(e) => handleAction(e, app.id, 'stop')} disabled={actionLoading === `${app.id}-stop`} title="Stop">
+ <Square size={14} />
+ </Button>
+ </>
+ ) : (
+ <Button variant="ghost" size="sm" onClick={(e) => handleAction(e, app.id, 'start')} disabled={actionLoading === `${app.id}-start`} title="Start">
+ <Play size={14} />
+ </Button>
+ )}
+ </div>
+ </>
+ );
+ }}
>
<MoveToProjectDialog
open={showMoveDialog}
diff --git a/frontend/src/pages/Templates.jsx b/frontend/src/pages/Templates.jsx
index 913afe05..9d5c8ce2 100644
--- a/frontend/src/pages/Templates.jsx
+++ b/frontend/src/pages/Templates.jsx
@@ -1,21 +1,21 @@
-import { useState, useEffect } from 'react';
+import { useState, useEffect, useMemo } from 'react';
import { useNavigate, useSearchParams } from 'react-router-dom';
import {
Search, X, Star, ExternalLink, BookOpen, Container, Globe, BarChart3,
Database, Shield, Cloud, MessageSquare, Video, Music, Image, Home,
Code, Server, GitBranch, Workflow, HardDrive, Lock, Users, FileText,
Settings, Layers, LayoutTemplate, Copy, Check, Tag, Cpu,
- Newspaper, TrendingUp, Rocket
+ Newspaper, TrendingUp, Rocket, Box, Download, ChevronRight
} from 'lucide-react';
import api from '../services/api';
import { useToast } from '../contexts/ToastContext';
-import Modal from '@/components/Modal';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Badge } from '@/components/ui/badge';
import {
- SearchField, FilterDrawer, FilterButton, countActiveFilters,
+ SearchField, FilterDrawer, FilterButton, countActiveFilters, Drawer,
} from '@/components/ds';
+import ServerPicker from '@/components/templates/ServerPicker';
import { useTopbarActions } from '@/hooks/useTopbarActions';
import EmptyState from '../components/EmptyState';
@@ -464,27 +464,44 @@ const Templates = () => {
: templates;
const sortedTemplates = sortTemplates(kindFiltered);
- // One row of the largest categories as quick chips (no spillover button).
- const quickCategories = categories.slice(0, 8);
-
// The active-filter badge counts real filters only (category + kind); sort is
// an ordering, not a filter, so it never inflates the count.
const activeFilterCount = countActiveFilters({ category: selectedCategory, kind: selectedKind });
const hasActiveFilters = Boolean(selectedCategory || selectedKind || searchQuery
|| (sortBy && sortBy !== 'featured'));
+ // How many templates each option would match, counted over the whole
+ // catalog rather than the current result set — a count that shrank to 0 as
+ // you filtered would say nothing about whether the option is worth a click.
+ const optionCounts = useMemo(() => {
+ const byKind = {};
+ const byCategory = {};
+ templates.forEach((t) => {
+ const kind = t.kind || 'compose';
+ byKind[kind] = (byKind[kind] || 0) + 1;
+ (t.categories || []).forEach((c) => {
+ byCategory[c] = (byCategory[c] || 0) + 1;
+ });
+ });
+ return { byKind, byCategory };
+ }, [templates]);
+
const filterGroups = [
{
key: 'kind',
label: 'Type',
type: 'single',
- options: KIND_OPTIONS,
+ options: KIND_OPTIONS.map(o => ({ ...o, count: optionCounts.byKind[o.value] || 0 })),
},
{
key: 'category',
label: 'Category',
type: 'single',
- options: categories.map(cat => ({ value: cat, label: cat })),
+ options: categories.map(cat => ({
+ value: cat,
+ label: cat,
+ count: optionCounts.byCategory[cat] || 0,
+ })),
},
{
key: 'sort',
@@ -526,68 +543,79 @@ const Templates = () => {
return (
<div className="sk-tabgroup__inner templates-page">
- {/* Quick category chips + result count. The full category list, kind,
- and sort live in the shared FilterDrawer (opened from the topbar). */}
+ {/* The catalog is not the only way in: a repo or an archive skips
+ templates entirely, so both routes lead the page rather than
+ hiding behind the New Service tab. */}
+ <div className="tpl-quickstart">
+ <button type="button" className="tpl-quickstart__card" onClick={() => navigate('/services/new?source=github')}>
+ <span className="tpl-quickstart__ico"><GitBranch size={18} /></span>
+ <span className="tpl-quickstart__body">
+ <span className="tpl-quickstart__title">Import from GitHub</span>
+ <span className="tpl-quickstart__sub">Connect a repo and auto-deploy on every push</span>
+ </span>
+ <ChevronRight size={16} className="tpl-quickstart__arrow" />
+ </button>
+ <button type="button" className="tpl-quickstart__card" onClick={() => navigate('/services/new?source=archive')}>
+ <span className="tpl-quickstart__ico"><Download size={18} /></span>
+ <span className="tpl-quickstart__body">
+ <span className="tpl-quickstart__title">Import a ZIP</span>
+ <span className="tpl-quickstart__sub">Drop in a project archive to build &amp; run</span>
+ </span>
+ <ChevronRight size={16} className="tpl-quickstart__arrow" />
+ </button>
+ </div>
+
+ {/* One header row: result count, whatever filtering is currently in
+ force (as removable chips), and sort. Categories are not listed
+ here — every filter lives in the FilterDrawer, so there is one
+ place to look rather than two competing ones. */}
<div className="templates-results-header">
<span className="results-count">
{sortedTemplates.length} template{sortedTemplates.length !== 1 ? 's' : ''}
</span>
- <div className="category-filters" aria-label="Template categories">
- <button type="button"
- className={`category-btn ${!selectedCategory ? 'active' : ''}`}
- onClick={() => setSelectedCategoryFilter(null)}
- >
- All
- </button>
- {quickCategories.map(category => (
- <button type="button"
- key={category}
- className={`category-btn ${selectedCategory === category ? 'active' : ''}`}
- onClick={() => setSelectedCategoryFilter(
- selectedCategory === category ? null : category
- )}
- >
- {getCategoryIcon(category)} {category}
- </button>
- ))}
- </div>
- </div>
-
- {/* Active Filters */}
- {hasActiveFilters && (
<div className="active-filters">
{selectedKind && (
- <span className="filter-chip">
- <GitBranch size={14} />
+ <button type="button" className="filter-chip"
+ onClick={() => updateFilters({ kind: null })}>
{KIND_OPTIONS.find(k => k.value === selectedKind)?.label || selectedKind}
- <button type="button" onClick={() => updateFilters({ kind: null })}>
- <X size={14} />
- </button>
- </span>
+ <X size={12} />
+ </button>
)}
{selectedCategory && (
- <span className="filter-chip">
- <Tag size={14} />
+ <button type="button" className="filter-chip"
+ onClick={() => setSelectedCategoryFilter(null)}>
{selectedCategory}
- <button type="button" onClick={() => setSelectedCategoryFilter(null)}>
- <X size={14} />
- </button>
- </span>
+ <X size={12} />
+ </button>
)}
{searchQuery && (
- <span className="filter-chip">
- <Search size={14} />
+ <button type="button" className="filter-chip"
+ onClick={() => setSearchQueryFilter('')}>
&ldquo;{searchQuery}&rdquo;
- <button type="button" onClick={() => setSearchQueryFilter('')}>
- <X size={14} />
- </button>
- </span>
+ <X size={12} />
+ </button>
+ )}
+ {hasActiveFilters && (
+ <Button variant="ghost" size="sm" className="clear-all-btn" onClick={clearAllFilters}>
+ Clear all
+ </Button>
)}
- <Button variant="ghost" size="sm" className="clear-all-btn" onClick={clearAllFilters}>
- Clear All
- </Button>
</div>
- )}
+ {/* The two orders people actually reach for; the full sort list
+ (incl. Z–A) stays in the filter drawer. */}
+ <div className="tpl-sort" role="group" aria-label="Sort templates">
+ {[['featured', 'Featured'], ['name-asc', 'A–Z']].map(([value, label]) => (
+ <button
+ type="button"
+ key={value}
+ className={sortBy === value ? 'is-active' : ''}
+ onClick={() => updateFilters({ sort: value === 'featured' ? null : value })}
+ >
+ {label}
+ </button>
+ ))}
+ </div>
+ </div>
{/* Templates Grid */}
<div className="templates-grid">
@@ -824,6 +852,7 @@ const Templates = () => {
{showInstallModal && selectedTemplate && (
<InstallModal
template={selectedTemplate}
+ renderIcon={renderIcon}
onClose={() => {
setShowInstallModal(false);
setSelectedTemplate(null);
@@ -844,6 +873,9 @@ const Templates = () => {
value={filterValue}
onChange={handleFilterChange}
title="Filter templates"
+ activeCount={activeFilterCount}
+ resultCount={sortedTemplates.length}
+ resultNoun="template"
/>
</div>
);
@@ -932,7 +964,7 @@ const RepoTemplateDetailBody = ({ template, manifest, loading, getCategoryIcon }
);
};
-const InstallModal = ({ template, onClose, onSuccess }) => {
+const InstallModal = ({ template, onClose, onSuccess, renderIcon }) => {
const toast = useToast();
const navigate = useNavigate();
const [appName, setAppName] = useState(template.id.toLowerCase().replace(/[^a-z0-9-]/g, '-'));
@@ -941,6 +973,10 @@ const InstallModal = ({ template, onClose, onSuccess }) => {
const [selectedServerId, setSelectedServerId] = useState('local');
const [installing, setInstalling] = useState(false);
const [errors, setErrors] = useState([]);
+ // Managed-sites base domain, so the drawer can offer the subdomain this
+ // service would get instead of leaving the user to wire DNS afterwards.
+ const [baseDomain, setBaseDomain] = useState(null);
+ const [httpsBase, setHttpsBase] = useState(false);
useEffect(() => {
// Initialize variables with defaults
@@ -955,6 +991,14 @@ const InstallModal = ({ template, onClose, onSuccess }) => {
useEffect(() => {
loadServers();
+ api.getSiteBaseDomains()
+ .then((data) => {
+ const bases = data?.base_domains || [];
+ const chosen = bases.find((b) => b.domain === data?.default) || bases[0];
+ setBaseDomain(chosen?.domain || null);
+ setHttpsBase(!!chosen?.https_enabled);
+ })
+ .catch(() => setBaseDomain(null));
}, []);
async function loadServers() {
@@ -971,6 +1015,8 @@ const InstallModal = ({ template, onClose, onSuccess }) => {
}
}
+ const domainPreview = baseDomain && appName ? `${appName}.${baseDomain}` : null;
+
async function handleInstall(e) {
e.preventDefault();
setInstalling(true);
@@ -1006,21 +1052,36 @@ const InstallModal = ({ template, onClose, onSuccess }) => {
}
}
+ const visibleVars = (template.variables || []).filter(v => !v.hidden);
+
return (
- <Modal open onClose={onClose} title={`Install ${template.name}`} size="lg">
- <form onSubmit={handleInstall}>
- <div className="modal-body">
- {errors.length > 0 && (
- <div className="alert alert-danger">
- <ul>
- {errors.map((error, i) => <li key={i}>{error}</li>)}
- </ul>
- </div>
- )}
+ <Drawer
+ open
+ onOpenChange={(next) => { if (!next) onClose?.(); }}
+ title={`Deploy ${template.name}`}
+ subtitle={[`v${template.version}`, ...(template.categories || []).slice(0, 3)].join(' · ')}
+ icon={renderIcon(template, 20)}
+ width={560}
+ className="tpl-deploy-drawer"
+ >
+ <form onSubmit={handleInstall} className="tpl-deploy-drawer__form">
+ <div className="tpl-deploy-drawer__body">
+ {errors.length > 0 && (
+ <div className="alert alert-danger">
+ <ul>
+ {errors.map((error, i) => <li key={i}>{error}</li>)}
+ </ul>
+ </div>
+ )}
- <div className="form-group">
- <label>Application Name *</label>
- <Input
+ <p className="tpl-deploy-drawer__desc">{template.description}</p>
+
+ <div className="tpl-deploy-drawer__field">
+ <label htmlFor="tpl-deploy-name">Service name</label>
+ <div className="tpl-deploy-drawer__input">
+ <Box size={15} />
+ <input
+ id="tpl-deploy-name"
type="text"
value={appName}
onChange={(e) => setAppName(e.target.value.toLowerCase().replace(/[^a-z0-9-]/g, ''))}
@@ -1028,80 +1089,96 @@ const InstallModal = ({ template, onClose, onSuccess }) => {
minLength={2}
required
/>
- <span className="form-help">Lowercase letters, numbers, and hyphens only (min 2 chars)</span>
</div>
+ <span className="tpl-deploy-drawer__hint">
+ Lowercase letters, numbers, and hyphens only (min 2 chars)
+ </span>
+ </div>
- <div className="form-group">
- <label>Target Server</label>
- <select
- value={selectedServerId}
- onChange={(e) => setSelectedServerId(e.target.value)}
- disabled={installing}
- >
- {servers.map(server => (
- <option key={server.id} value={server.id}>
- {server.name}{server.is_local ? ' (local)' : ''}
- </option>
- ))}
- </select>
+ {/* Only shown once a managed-sites base domain exists — with
+ no base there is no subdomain to promise, and a dead
+ field would be worse than none. */}
+ {domainPreview && (
+ <div className="tpl-deploy-drawer__field">
+ <span className="tpl-deploy-drawer__label">Domain</span>
+ <div className="tpl-deploy-drawer__input tpl-deploy-drawer__input--readonly">
+ <Globe size={15} />
+ <span className="tpl-deploy-drawer__domain">{domainPreview}</span>
+ </div>
+ <span className="tpl-deploy-drawer__hint">
+ {httpsBase
+ ? 'Published automatically with HTTPS once the deploy finishes'
+ : 'Published automatically once the deploy finishes'}
+ </span>
</div>
+ )}
- {(template.variables || []).filter(v => !v.hidden).length > 0 && (
- <>
- <h4>Configuration</h4>
- {template.variables.filter(v => !v.hidden).map(variable => (
- <div key={variable.name} className="form-group">
- <label>
- {variable.name}
- {variable.required && ' *'}
- </label>
- {variable.options ? (
- <select
- value={variables[variable.name] || ''}
- onChange={(e) => setVariables({...variables, [variable.name]: e.target.value})}
- required={variable.required}
- >
- <option value="">Select...</option>
- {variable.options.map(opt => (
- <option key={opt} value={opt}>{opt}</option>
- ))}
- </select>
- ) : variable.type === 'password' ? (
- <Input
- type="password"
- value={variables[variable.name] || ''}
- onChange={(e) => setVariables({...variables, [variable.name]: e.target.value})}
- placeholder={variable.default ? '(auto-generated)' : ''}
- required={variable.required && !variable.default}
- />
- ) : (
- <Input
- type={variable.type === 'port' ? 'number' : 'text'}
- value={variables[variable.name] || ''}
- onChange={(e) => setVariables({...variables, [variable.name]: e.target.value})}
- placeholder={variable.default || ''}
- required={variable.required}
- />
- )}
- {variable.description && (
- <span className="form-help">{variable.description}</span>
- )}
- </div>
- ))}
- </>
- )}
-
+ <div className="tpl-deploy-drawer__field">
+ <span className="tpl-deploy-drawer__label">Deploy to server</span>
+ <ServerPicker
+ servers={servers}
+ value={selectedServerId}
+ onChange={setSelectedServerId}
+ />
</div>
- <div className="modal-footer">
- <Button type="button" variant="outline" onClick={onClose} disabled={installing}>
- Cancel
- </Button>
- <Button type="submit" disabled={installing}>
- {installing ? 'Installing...' : 'Install'}
- </Button>
- </div>
- </form>
- </Modal>
+
+ {visibleVars.length > 0 && (
+ <div className="tpl-deploy-drawer__field">
+ <span className="tpl-deploy-drawer__label">Configuration</span>
+ {visibleVars.map(variable => (
+ <div key={variable.name} className="form-group">
+ <label>
+ {variable.name}
+ {variable.required && ' *'}
+ </label>
+ {variable.options ? (
+ <select
+ value={variables[variable.name] || ''}
+ onChange={(e) => setVariables({...variables, [variable.name]: e.target.value})}
+ required={variable.required}
+ >
+ <option value="">Select...</option>
+ {variable.options.map(opt => (
+ <option key={opt} value={opt}>{opt}</option>
+ ))}
+ </select>
+ ) : variable.type === 'password' ? (
+ <Input
+ type="password"
+ value={variables[variable.name] || ''}
+ onChange={(e) => setVariables({...variables, [variable.name]: e.target.value})}
+ placeholder={variable.default ? '(auto-generated)' : ''}
+ required={variable.required && !variable.default}
+ />
+ ) : (
+ <Input
+ type={variable.type === 'port' ? 'number' : 'text'}
+ value={variables[variable.name] || ''}
+ onChange={(e) => setVariables({...variables, [variable.name]: e.target.value})}
+ placeholder={variable.default || ''}
+ required={variable.required}
+ />
+ )}
+ {variable.description && (
+ <span className="form-help">{variable.description}</span>
+ )}
+ </div>
+ ))}
+ </div>
+ )}
+ </div>
+
+ <div className="tpl-deploy-drawer__foot">
+ <Button type="button" variant="outline" onClick={onClose} disabled={installing}>
+ Cancel
+ </Button>
+ <Button type="submit" disabled={installing}>
+ <Rocket size={15} />
+ {installing ? 'Deploying…' : `Deploy ${template.name}`}
+ </Button>
+ </div>
+ </form>
+ </Drawer>
);
};
diff --git a/frontend/src/styles/pages/_deploy-console.scss b/frontend/src/styles/pages/_deploy-console.scss
index 65da0680..5f1acb79 100644
--- a/frontend/src/styles/pages/_deploy-console.scss
+++ b/frontend/src/styles/pages/_deploy-console.scss
@@ -120,22 +120,16 @@ $dc-surface-line: rgba(255, 255, 255, 0.04);
color: var(--accent-bright);
}
- // ---- body: rail + main ----
+ // ---- body: log pane (full width; steps live in the strip above) ----
&__body {
- display: grid;
- grid-template-columns: 248px minmax(0, 1fr);
- gap: $space-3;
- align-items: stretch;
+ display: flex;
flex: 1;
min-height: 0;
-
- @media (max-width: 720px) {
- grid-template-columns: 1fr;
- }
}
&__main {
display: flex;
+ flex: 1;
flex-direction: column;
min-width: 0;
border: 1px solid $border-subtle;
@@ -143,62 +137,108 @@ $dc-surface-line: rgba(255, 255, 255, 0.04);
overflow: hidden;
}
- // ---- step rail ----
- &__rail {
- list-style: none;
- margin: 0;
- padding: $space-2;
+ // ---- pipeline strip (one segment per plan step) ----
+ &__pipeline {
+ display: flex;
+ background: $bg-card;
border: 1px solid $border-subtle;
border-radius: $radius-lg;
- background: $bg-card;
- display: flex;
- flex-direction: column;
- gap: 2px;
- align-self: start;
+ overflow: hidden;
+
+ // Narrow viewports: segments would shrink past legibility, so the strip
+ // scrolls sideways with a readable floor per segment instead.
+ @media (max-width: 720px) {
+ overflow-x: auto;
+ }
}
- &__rail-btn {
- display: flex;
- align-items: center;
- gap: $space-2;
- width: 100%;
- padding: $space-2;
+ &__seg {
+ flex: 1;
+ min-width: 0;
+ padding: 12px 14px 13px;
+ background: none;
border: none;
- background: transparent;
- border-radius: $radius-md;
+ // A 2px top edge carries the step's state colour — the strip reads as a
+ // progress bar from across the room, before any label is legible.
+ border-top: 2px solid var(--surface-3);
+ border-left: 1px solid $border-subtle;
cursor: pointer;
text-align: left;
- color: $text-secondary;
+ transition: background $transition-fast;
- &:hover { background: $bg-hover; }
+ &:first-child { border-left: none; }
+ &:hover,
+ &.is-selected { background: $bg-hover; }
+
+ @media (max-width: 720px) { min-width: 150px; }
+
+ &--done { border-top-color: $success; }
+ &--failed { border-top-color: $danger; }
+ &--running { border-top-color: var(--amber); }
}
- &__rail-icon {
- display: inline-flex;
- flex-shrink: 0;
+ &__seg-head {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ color: var(--text-ghost);
+ font-size: 12.5px;
+ font-weight: 500;
+
+ svg { flex-shrink: 0; }
}
- &__rail-name {
- flex: 1;
+ &__seg--done &__seg-head,
+ &__seg--failed &__seg-head,
+ &__seg--running &__seg-head { color: $text-primary; }
+
+ &__seg--done &__seg-head svg { color: $success; }
+ &__seg--failed &__seg-head svg { color: $danger; }
+ &__seg--running &__seg-head svg { color: var(--amber); }
+
+ &__seg-name {
min-width: 0;
- font-size: $font-size-sm;
- white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
+ white-space: nowrap;
}
- &__rail-time {
- font-size: $font-size-xs;
+ &__seg-bar {
+ display: block;
+ height: 3px;
+ margin-top: 11px;
+ border-radius: 2px;
+ background: var(--surface-3);
+ overflow: hidden;
+
+ i { display: block; height: 100%; border-radius: 2px; background: currentcolor; }
+ }
+
+ &__seg--done &__seg-bar i { background: $success; }
+ &__seg--failed &__seg-bar i { background: $danger; }
+ &__seg--running &__seg-bar i { background: var(--amber); }
+
+ &__seg-dur {
+ display: block;
+ margin-top: 6px;
color: $text-tertiary;
- font-variant-numeric: tabular-nums;
+ font-family: $font-mono;
+ font-size: 10.5px;
}
- &__rail-item {
- &--done .deploy-console__rail-icon { color: $success; }
- &--running .deploy-console__rail-icon { color: var(--accent-bright); }
- &--failed .deploy-console__rail-icon { color: $danger; }
- &--pending .deploy-console__rail-icon { color: $text-tertiary; }
- &--running .deploy-console__rail-name { color: $text-primary; font-weight: 600; }
+ &__seg--running &__seg-dur { color: var(--amber); }
+
+ // ---- run identity line ----
+ &__runmeta {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 6px 20px;
+ padding: 0 3px;
+ color: var(--text-ghost);
+ font-family: $font-mono;
+ font-size: 11.5px;
+
+ b { color: $text-secondary; font-weight: 500; }
}
// ---- toolbar ----
diff --git a/frontend/src/styles/pages/_deployments.scss b/frontend/src/styles/pages/_deployments.scss
index d2ff607c..ea64c0c1 100644
--- a/frontend/src/styles/pages/_deployments.scss
+++ b/frontend/src/styles/pages/_deployments.scss
@@ -1,78 +1,42 @@
// ============================================
// DEPLOYMENTS PAGE (/deployments)
-// Jobs index only — each row deep-links to the Deploy Console
-// (/deployments/:jobId, _deploy-console.scss). The old side detail pane was
-// removed in plan 51; plan 51.5 removed its leftover grid + styles.
+// Deploy Activity — a chronological feed of runs grouped into Queued / Today /
+// Earlier. Each row deep-links to the Deploy Console (/deployments/:jobId,
+// _deploy-console.scss). Replaced the plain jobs table in the plan 51.5 UI pass.
// ============================================
+// Column track shared by the feed header and its rows so the two stay locked
+// together; `minmax(0, 1fr)` lets the long ref/error subline ellipsize instead
+// of stretching the grid.
+$deploy-feed-cols: 20px minmax(0, 1fr) 132px 116px 56px 76px 14px;
+
.deployments-page {
+ // A fixed reading column rather than full bleed: the feed's rightmost
+ // columns (took / started) are narrow and fixed, so on a wide monitor a
+ // full-bleed row strands the name miles from its own timing.
+ max-width: 1180px;
+ margin: 0 auto;
+
&__toolbar {
display: flex;
align-items: center;
gap: $space-3;
- margin-bottom: $space-3;
- padding: $space-3;
- background: $bg-card;
- border: 1px solid $border-subtle;
- border-radius: $radius-lg;
+ margin-bottom: $space-4;
}
- &__filter {
- display: grid;
- gap: 3px;
- min-width: 180px;
-
- label {
- color: $text-tertiary;
- font-size: $font-size-xs;
- font-weight: $font-weight-semibold;
- }
-
- select {
- min-height: 34px;
- padding: $space-1 $space-8 $space-1 $space-2;
- background: $bg-elevated;
- border: 1px solid $border-subtle;
- border-radius: $radius-md;
- color: $text-primary;
- font-size: $font-size-sm;
- cursor: pointer;
-
- &:focus {
- outline: none;
- border-color: $accent-primary;
- box-shadow: 0 0 0 3px $accent-glow;
- }
- }
- }
-
- &__panel {
- background: $bg-card;
- border: 1px solid $border-subtle;
- border-radius: $radius-lg;
- overflow: hidden;
- }
-
- &__panel-header {
- display: flex;
- align-items: center;
- justify-content: space-between;
- min-height: 52px;
- padding: $space-3 $space-4;
- border-bottom: 1px solid $border-subtle;
-
- h2 {
- margin: 0;
- color: $text-primary;
- font-size: $font-size-base;
- font-weight: $font-weight-semibold;
- }
+ &__server-select {
+ min-height: 34px;
+ padding: $space-1 $space-2;
+ background: var(--surface-2);
+ border: 1px solid var(--border);
+ border-radius: $radius-md;
+ color: $text-secondary;
+ font-size: $font-size-sm;
+ cursor: pointer;
- span {
- display: block;
- margin-top: 2px;
- color: $text-tertiary;
- font-size: $font-size-xs;
+ &:focus {
+ outline: none;
+ border-color: $accent-primary;
}
}
@@ -100,120 +64,185 @@
color: $text-tertiary;
text-align: center;
- svg {
- color: $text-tertiary;
- opacity: 0.72;
- }
+ svg { color: $text-tertiary; opacity: 0.72; }
+ strong { color: $text-secondary; font-size: $font-size-sm; font-weight: $font-weight-semibold; }
+ span { max-width: 280px; font-size: $font-size-sm; line-height: 1.45; }
+ }
- strong {
- color: $text-secondary;
- font-size: $font-size-sm;
- font-weight: $font-weight-semibold;
- }
+ // ---- feed ----
+ &__feed-head {
+ display: grid;
+ grid-template-columns: $deploy-feed-cols;
+ align-items: center;
+ gap: 18px;
+ padding: 0 16px 8px;
+ color: var(--text-ghost);
+ font-family: var(--mono);
+ font-size: 10px;
+ letter-spacing: 0.13em;
+ text-transform: uppercase;
+
+ .is-right { text-align: right; }
+ }
- span {
- max-width: 280px;
- font-size: $font-size-sm;
- line-height: 1.45;
- }
+ &__group + &__group { margin-top: 22px; }
+
+ &__group-head {
+ display: flex;
+ align-items: center;
+ gap: 12px;
+ padding: 0 16px 7px;
+ color: $text-tertiary;
+ font-family: var(--mono);
+ font-size: 10.5px;
+ letter-spacing: 0.13em;
+ text-transform: uppercase;
+
+ i { flex: 1; height: 1px; background: $border-subtle; }
}
- &__jobs-table {
+ &__row {
+ display: grid;
+ grid-template-columns: $deploy-feed-cols;
+ align-items: center;
+ gap: 18px;
width: 100%;
- border-collapse: collapse;
- font-size: $font-size-sm;
+ padding: 12px 16px;
+ background: $bg-card;
+ border: 1px solid $border-subtle;
+ border-radius: $radius-lg;
+ text-align: left;
+ cursor: pointer;
+ transition: background $transition-fast, border-color $transition-fast;
- th {
- padding: $space-3 $space-4;
- color: $text-tertiary;
- font-size: $font-size-xs;
- font-weight: $font-weight-semibold;
- text-align: left;
- text-transform: uppercase;
- border-bottom: 1px solid $border-subtle;
- white-space: nowrap;
- }
+ + .deployments-page__row { margin-top: 5px; }
- td {
- padding: $space-3 $space-4;
- color: $text-primary;
- border-bottom: 1px solid $border-subtle;
- vertical-align: middle;
+ &:hover {
+ background: $bg-hover;
+ border-color: var(--border);
}
- tbody tr {
- cursor: pointer;
- transition: background $transition-fast;
+ &--pending .deployments-page__row-name { color: $text-secondary; }
+ }
- &:hover {
- background: $bg-hover;
- }
+ &__row-ico {
+ display: flex;
+ justify-content: center;
- &:last-child td {
- border-bottom: none;
- }
- }
+ &.is-succeeded { color: var(--green); }
+ &.is-failed { color: var(--red); }
+ &.is-running { color: var(--amber); }
+ &.is-pending { color: var(--text-ghost); }
}
- &__server-cell {
- display: inline-flex;
+ &__row-main { min-width: 0; }
+
+ &__row-name {
+ display: flex;
align-items: center;
- gap: $space-1;
- color: $text-secondary;
+ gap: 9px;
+ color: $text-primary;
+ font-size: 13.5px;
+ font-weight: 550;
+ letter-spacing: -0.01em;
+ }
+
+ &__row-kind {
+ padding: 1px 5px;
+ border: 1px solid var(--border);
+ border-radius: 4px;
+ color: var(--text-ghost);
+ font-family: var(--mono);
+ font-size: 9.5px;
+ letter-spacing: 0.08em;
+ text-transform: uppercase;
+ }
+
+ &__row-sub {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ min-width: 0;
+ margin-top: 4px;
+ color: $text-tertiary;
+ font-size: 11.5px;
white-space: nowrap;
}
- &__progress {
- width: 100%;
- min-width: 88px;
- max-width: 220px;
- height: 6px;
- background: $bg-elevated;
- border-radius: $radius-full;
+ &__row-ref {
+ flex-shrink: 0;
+ color: $text-secondary;
+ font-family: var(--mono);
+ }
+
+ &__row-sep { color: var(--text-ghost); }
+
+ &__row-error {
overflow: hidden;
+ color: var(--red);
+ text-overflow: ellipsis;
}
- &__progress-fill {
- height: 100%;
- border-radius: inherit;
- background: var(--accent-primary);
- transition: width 200ms ease;
+ &__pipe {
+ display: flex;
+ align-items: center;
+ gap: 9px;
+ }
+
+ &__ticks {
+ display: flex;
+ gap: 3px;
- &--failed {
- background: var(--red);
+ i {
+ display: block;
+ width: 7px;
+ height: 15px;
+ border-radius: 2px;
+ background: var(--surface-3);
+
+ &.is-done { background: var(--green); }
+ &.is-failed { background: var(--red); }
+ &.is-running {
+ background: var(--amber);
+ animation: deploy-tick-pulse 1.2s ease-in-out infinite;
+ }
}
}
- &__progress-meta,
- &__time-cell {
- color: $text-tertiary;
- font-size: $font-size-xs;
+ &__pipe-count {
+ color: var(--text-ghost);
+ font-family: var(--mono);
+ font-size: 10.5px;
}
- &__progress-meta {
- margin-top: 3px;
+ &__row-target {
+ min-width: 0;
+ overflow: hidden;
+ color: $text-secondary;
+ font-family: var(--mono);
+ font-size: 12px;
+ text-overflow: ellipsis;
+ white-space: nowrap;
}
- &__status-badge {
- display: inline-flex;
- align-items: center;
- gap: 6px;
- padding: 4px 10px;
- border-radius: $radius-full;
- font-size: $font-size-xs;
- font-weight: $font-weight-semibold;
- line-height: 1;
- text-transform: capitalize;
- white-space: nowrap;
+ &__row-took,
+ &__row-when {
+ font-family: var(--mono);
+ font-size: 11.5px;
+ text-align: right;
+ }
- &--pending { background: var(--surface-3); color: var(--text-faint); }
- &--running { background: var(--accent-bg); color: var(--accent-bright); }
- &--succeeded { background: var(--green-bg); color: var(--green); }
- &--failed { background: var(--red-bg); color: var(--red); }
+ &__row-took { color: $text-secondary; }
+ &__row-when { color: $text-tertiary; }
+
+ &__row-chev {
+ color: var(--text-ghost);
+ transition: transform $transition-fast, color $transition-fast;
}
- &__spin {
- animation: deployments-spin 1s linear infinite;
+ &__row:hover &__row-chev {
+ color: var(--accent-bright);
+ transform: translateX(2px);
}
// ---- test-deployment (simulated) scenario picker ----
@@ -279,28 +308,14 @@
gap: 2px;
min-width: 0;
- strong {
- color: $text-primary;
- font-size: $font-size-sm;
- font-weight: $font-weight-semibold;
- }
-
- span {
- color: $text-tertiary;
- font-size: $font-size-xs;
- line-height: 1.4;
- }
+ strong { color: $text-primary; font-size: $font-size-sm; font-weight: $font-weight-semibold; }
+ span { color: $text-tertiary; font-size: $font-size-xs; line-height: 1.4; }
}
}
-@keyframes deployments-spin {
- from {
- transform: rotate(0deg);
- }
-
- to {
- transform: rotate(360deg);
- }
+@keyframes deploy-tick-pulse {
+ 0%, 100% { opacity: 1; }
+ 50% { opacity: 0.35; }
}
@media (max-width: $breakpoint-md) {
@@ -311,16 +326,12 @@
align-items: stretch;
}
- &__filter {
- min-width: 0;
- }
+ .sk-seg { overflow-x: auto; }
- &__jobs-panel {
- overflow-x: auto;
- }
-
- &__jobs-table {
- min-width: 760px;
- }
+ // Below the grid's natural width the feed scrolls sideways rather than
+ // collapsing the pipeline/target columns into unreadable slivers.
+ &__feed { overflow-x: auto; }
+ &__feed-head,
+ &__row { min-width: 720px; }
}
}
diff --git a/frontend/src/styles/pages/_services.scss b/frontend/src/styles/pages/_services.scss
index 299866aa..8950902c 100644
--- a/frontend/src/styles/pages/_services.scss
+++ b/frontend/src/styles/pages/_services.scss
@@ -96,3 +96,73 @@
0%, 100% { opacity: 1; }
50% { opacity: 0.4; }
}
+
+// ---- card view (ResourceListPage renderCard) --------------------------------
+// Same rows as the table, reflowed for scanning by service rather than by
+// column. Toggled from the toolbar; the choice persists per browser.
+.services-card {
+ &__top {
+ display: flex;
+ align-items: center;
+ gap: $space-3;
+ margin-bottom: $space-3;
+ }
+
+ &__id { flex: 1; min-width: 0; }
+
+ &__name {
+ overflow: hidden;
+ color: $text-primary;
+ font-size: 14.5px;
+ font-weight: $font-weight-semibold;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+
+ &__domain {
+ overflow: hidden;
+ margin-bottom: 14px;
+ color: $text-secondary;
+ font-family: var(--mono);
+ font-size: 12px;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+
+ &__stats {
+ display: grid;
+ grid-template-columns: repeat(3, 1fr);
+ gap: 2px;
+ padding-top: 13px;
+ border-top: 1px solid $border-subtle;
+
+ .l {
+ display: block;
+ color: $text-tertiary;
+ font-size: 10px;
+ letter-spacing: 0.05em;
+ text-transform: uppercase;
+ }
+
+ .v {
+ display: block;
+ overflow: hidden;
+ margin-top: 3px;
+ color: $text-primary;
+ font-size: 13px;
+ font-weight: $font-weight-semibold;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+ }
+
+ &__foot {
+ display: flex;
+ align-items: center;
+ justify-content: flex-end;
+ gap: 2px;
+ margin-top: 14px;
+ padding-top: 13px;
+ border-top: 1px solid $border-subtle;
+ }
+}
diff --git a/frontend/src/styles/pages/_templates.scss b/frontend/src/styles/pages/_templates.scss
index aa6a4bb2..a03515d8 100644
--- a/frontend/src/styles/pages/_templates.scss
+++ b/frontend/src/styles/pages/_templates.scss
@@ -247,103 +247,42 @@
}
}
-// Category chips (demo .cat-chip look on the existing buttons)
-.category-filters {
- display: flex;
- flex-wrap: wrap;
- gap: 7px;
- min-width: 0;
-}
-
-.category-btn {
- display: flex;
- align-items: center;
- gap: 6px;
- padding: 5px 12px;
- background: var(--surface-2);
- border: 1px solid var(--border);
- border-radius: 8px;
- color: var(--text-faint);
- font-size: $font-size-sm + 0.5;
- font-weight: $font-weight-medium;
- cursor: pointer;
- transition: 0.12s;
- text-transform: capitalize;
-
- svg {
- color: var(--text-ghost);
- transition: color 0.12s;
- }
-
- &:hover {
- color: $text-primary;
- border-color: var(--border-strong);
-
- svg {
- color: var(--text-faint);
- }
- }
-
- &.active {
- color: var(--accent-bright);
- background: var(--accent-bg);
- border-color: var(--accent-dim);
-
- svg {
- color: var(--accent-bright);
- }
- }
-
- &--more {
- color: var(--accent-bright);
- border-style: dashed;
- }
-}
-
-// Active Filters
+// Active filters — removable chips, inline in the results header.
.active-filters {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: $space-2;
- margin: -$space-2 0 $space-4;
+ min-width: 0;
}
+// The whole chip is the remove control — clicking anywhere on it drops that
+// filter, so there is no small × to aim at.
.filter-chip {
display: inline-flex;
align-items: center;
- gap: $space-2;
- padding: $space-1 $space-2;
- padding-right: $space-1;
+ gap: 5px;
+ padding: 3px 8px;
background: var(--accent-bg);
border: 1px solid var(--accent-dim);
- border-radius: $radius-full;
- font-family: var(--mono);
+ border-radius: $radius-md;
+ color: $text-secondary;
font-size: $font-size-sm;
- color: var(--accent-bright);
+ text-transform: capitalize;
+ cursor: pointer;
+ transition: background $transition-fast, color $transition-fast;
- svg:first-child {
- flex-shrink: 0;
+ &:hover {
+ background: var(--accent-bg-soft, var(--accent-bg));
+ color: $text-primary;
}
- button {
- display: flex;
- align-items: center;
- justify-content: center;
- padding: $space-1;
- margin-left: $space-1;
- background: transparent;
- border: none;
- border-radius: $radius-full;
- color: var(--accent-bright);
- cursor: pointer;
- transition: all $transition-fast;
-
- &:hover {
- background: var(--accent-bg);
- color: var(--text);
- }
+ svg {
+ flex-shrink: 0;
+ color: $text-tertiary;
}
+
+ &:hover svg { color: $text-primary; }
}
.clear-all-btn {
@@ -363,11 +302,11 @@
}
}
-// Quick-chips row + result count. Full category list, kind, and sort live in
-// the shared FilterDrawer opened from the topbar.
+// Quick-chips row + result count + sort. Full category list, kind, and the
+// remaining sort orders live in the shared FilterDrawer opened from the topbar.
.templates-results-header {
display: grid;
- grid-template-columns: auto minmax(0, 1fr);
+ grid-template-columns: auto minmax(0, 1fr) auto;
align-items: center;
gap: $space-3;
margin-bottom: $space-4;
@@ -375,6 +314,100 @@
border-bottom: 1px solid var(--border-soft);
}
+// Two-way sort toggle beside the result count.
+.tpl-sort {
+ display: flex;
+ gap: 2px;
+ padding: 3px;
+ background: var(--surface-2);
+ border: 1px solid var(--border);
+ border-radius: $radius-lg;
+
+ button {
+ padding: 6px 12px;
+ background: none;
+ border: none;
+ border-radius: $radius-md;
+ color: $text-tertiary;
+ font-size: $font-size-sm;
+ font-weight: $font-weight-medium;
+ white-space: nowrap;
+ cursor: pointer;
+ transition: background $transition-fast, color $transition-fast;
+
+ &:hover { color: $text-primary; }
+ &.is-active { background: var(--surface-3); color: $text-primary; }
+ }
+}
+
+// ---- quick-start import banner -------------------------------------------
+// Repo / archive imports sit above the catalog: they are the two ways in that
+// no template can cover.
+.tpl-quickstart {
+ display: grid;
+ grid-template-columns: 1fr 1fr;
+ gap: $space-3;
+ margin-bottom: $space-5;
+
+ @media (max-width: $breakpoint-md) {
+ grid-template-columns: 1fr;
+ }
+
+ &__card {
+ display: flex;
+ align-items: center;
+ gap: 13px;
+ padding: 14px 16px;
+ background: $bg-card;
+ border: 1px solid $border-subtle;
+ border-radius: $radius-lg;
+ text-align: left;
+ cursor: pointer;
+ transition: background $transition-fast, border-color $transition-fast;
+
+ &:hover {
+ background: $bg-hover;
+ border-color: var(--border);
+
+ .tpl-quickstart__arrow { color: $text-secondary; transform: translateX(2px); }
+ }
+ }
+
+ &__ico {
+ display: grid;
+ place-items: center;
+ flex-shrink: 0;
+ width: 36px;
+ height: 36px;
+ border-radius: $radius-md;
+ background: var(--surface-2);
+ border: 1px solid $border-subtle;
+ color: var(--accent-bright);
+ }
+
+ &__body { flex: 1; min-width: 0; }
+
+ &__title {
+ display: block;
+ color: $text-primary;
+ font-size: 13.5px;
+ font-weight: 550;
+ }
+
+ &__sub {
+ display: block;
+ margin-top: 2px;
+ color: $text-tertiary;
+ font-size: $font-size-xs;
+ }
+
+ &__arrow {
+ flex-shrink: 0;
+ color: var(--text-ghost);
+ transition: color $transition-fast, transform $transition-fast;
+ }
+}
+
.results-count {
font-family: var(--mono);
font-size: 11.5px;
@@ -858,8 +891,216 @@
align-items: flex-start;
gap: $space-3;
}
+}
+
+// ============================================
+// TEMPLATE DEPLOY DRAWER (right slide-over from a catalog card)
+// Name → domain → placement → template config, in that order: everything the
+// deploy commits you to, visible before you commit to it.
+// ============================================
+.tpl-deploy-drawer {
+ &__form {
+ display: flex;
+ flex-direction: column;
+ min-height: 0;
+ height: 100%;
+ }
+
+ &__body {
+ flex: 1;
+ overflow-y: auto;
+ min-height: 0;
+ padding: $space-4 $space-5 $space-6;
+ }
+
+ &__desc {
+ margin: 0 0 $space-4;
+ color: $text-tertiary;
+ font-size: $font-size-sm;
+ line-height: 1.5;
+ }
+
+ &__field {
+ margin-bottom: $space-4;
+
+ &:last-child { margin-bottom: 0; }
+ }
+
+ label,
+ &__label {
+ display: block;
+ margin-bottom: 7px;
+ color: $text-secondary;
+ font-size: $font-size-xs;
+ font-weight: $font-weight-medium;
+ }
+
+ &__input {
+ display: flex;
+ align-items: center;
+ gap: 9px;
+ padding: 8px 11px;
+ background: var(--surface-2);
+ border: 1px solid var(--border);
+ border-radius: $radius-md;
+ transition: border-color $transition-fast, box-shadow $transition-fast;
+
+ &:focus-within {
+ border-color: $accent-primary;
+ box-shadow: 0 0 0 3px $accent-glow;
+ }
+
+ // The domain is derived from the service name + base domain, so it is
+ // shown rather than typed — editing it here would silently diverge from
+ // what the finalizer actually publishes.
+ &--readonly {
+ background: $bg-elevated;
+ &:focus-within { border-color: var(--border); box-shadow: none; }
+ }
+
+ svg { flex-shrink: 0; color: $text-tertiary; }
+
+ input {
+ flex: 1;
+ min-width: 0;
+ background: none;
+ border: none;
+ outline: none;
+ color: $text-primary;
+ font-size: $font-size-sm;
+
+ &::placeholder { color: $text-tertiary; }
+ }
+ }
+
+ &__domain {
+ flex: 1;
+ min-width: 0;
+ overflow: hidden;
+ color: $text-primary;
+ font-family: var(--mono);
+ font-size: 12.5px;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+
+ &__hint {
+ display: block;
+ margin-top: 6px;
+ color: $text-tertiary;
+ font-family: var(--mono);
+ font-size: 11.5px;
+ }
+
+ &__foot {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: $space-2;
+ flex-shrink: 0;
+ padding: $space-3 $space-5;
+ border-top: 1px solid $border-subtle;
+ background: $bg-elevated;
+ }
+}
- .category-filters {
+// ---- server picker (shared: template deploy, and any future placement UI) ---
+.sk-srvpick {
+ &__find {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ height: 34px;
+ margin-bottom: 8px;
+ padding: 0 10px;
+ background: var(--surface-2);
+ border: 1px solid var(--border);
+ border-radius: $radius-md;
+
+ svg { flex-shrink: 0; color: $text-tertiary; }
+
+ input {
+ flex: 1;
+ min-width: 0;
+ background: none;
+ border: none;
+ outline: none;
+ color: $text-primary;
+ font-size: $font-size-sm;
+ }
+ }
+
+ &__list {
+ max-height: 210px;
+ overflow-y: auto;
+ background: var(--surface-2);
+ border: 1px solid var(--border);
+ border-radius: $radius-md;
+ }
+
+ &__row {
+ display: flex;
+ align-items: center;
+ gap: 12px;
width: 100%;
+ padding: 10px 13px;
+ background: none;
+ border: none;
+ text-align: left;
+ cursor: pointer;
+ transition: background $transition-fast;
+
+ + .sk-srvpick__row { border-top: 1px solid $border-subtle; }
+ &:hover { background: var(--surface-3); }
+ &.is-selected { background: var(--accent-bg); }
+ }
+
+ &__radio {
+ flex-shrink: 0;
+ width: 15px;
+ height: 15px;
+ border: 2px solid var(--border-strong);
+ border-radius: 50%;
+ transition: border-color $transition-fast;
+ }
+
+ &__row.is-selected &__radio {
+ border-color: var(--accent-bright);
+ background: radial-gradient(circle, var(--accent-bright) 0 4px, transparent 5px);
+ }
+
+ &__meta { flex: 1; min-width: 0; }
+
+ &__name {
+ display: block;
+ overflow: hidden;
+ color: $text-primary;
+ font-size: 13px;
+ font-weight: 550;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+
+ &__sub {
+ display: block;
+ margin-top: 1px;
+ color: $text-tertiary;
+ font-size: 11px;
+ }
+
+ &__tag {
+ flex-shrink: 0;
+ padding: 3px 8px;
+ background: var(--surface-3);
+ border-radius: $radius-sm;
+ color: $text-tertiary;
+ font-family: var(--mono);
+ font-size: 10.5px;
+ }
+
+ &__empty {
+ padding: 14px;
+ color: $text-tertiary;
+ font-size: 12.5px;
}
}
diff --git a/frontend/src/styles/pages/_wordpress.scss b/frontend/src/styles/pages/_wordpress.scss
index 148560b5..67a2d293 100644
--- a/frontend/src/styles/pages/_wordpress.scss
+++ b/frontend/src/styles/pages/_wordpress.scss
@@ -202,6 +202,54 @@
// Count subtitle accent ("M running") in the PageTopbar meta slot.
&__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.
+ &__viewswitch {
+ display: flex;
+ gap: 2px;
+ flex-shrink: 0;
+ padding: 3px;
+ background: var(--surface-2);
+ border: 1px solid var(--border);
+ border-radius: 9px;
+
+ button {
+ display: grid;
+ place-items: center;
+ padding: 6px 9px;
+ background: none;
+ border: none;
+ border-radius: 6px;
+ color: var(--text-faint);
+ cursor: pointer;
+ transition: background 0.14s, color 0.14s;
+
+ &:hover { color: var(--text); }
+ &.is-active { background: var(--surface-3); color: var(--text); }
+ }
+ }
+
+ // Card layout for the same rows the table shows.
+ &__cards {
+ display: grid;
+ grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
+ gap: 14px;
+ }
+
+ &__cardtile {
+ display: flex;
+ flex-direction: column;
+ padding: $space-4;
+ background: var(--surface);
+ border: 1px solid var(--border-soft);
+ border-radius: var(--radius);
+ cursor: pointer;
+ transition: border-color 0.14s, transform 0.14s;
+
+ &:hover { border-color: var(--border-strong); transform: translateY(-2px); }
+ &.is-selected { border-color: var(--accent-dim); background: var(--accent-bg-soft); }
+ }
+
// bulk-select bar (demo's bulkbar) — appears once any row is checked
&__bulkbar {
display: flex;
diff --git a/frontend/src/utils/deployActivity.js b/frontend/src/utils/deployActivity.js
new file mode 100644
index 00000000..36555056
--- /dev/null
+++ b/frontend/src/utils/deployActivity.js
@@ -0,0 +1,99 @@
+// Shaping helpers for the Deploy Activity feed (/deployments) and the deploy
+// console header. The list endpoint returns a flat job row — no per-step array —
+// so the pipeline tick states are derived here from current_step/total_steps/
+// status, keeping the feed a single cheap request.
+
+export const KIND_CHIP = {
+ app_deploy: 'app',
+ template_install: 'template',
+ demo_deploy: 'test',
+};
+
+export const KIND_LABELS = {
+ app_deploy: 'App deploy',
+ template_install: 'Template install',
+ demo_deploy: 'Test (simulated)',
+};
+
+// One tick per pipeline step, coloured by how far the run got.
+export function stepTicks(job) {
+ const total = job.total_steps || 0;
+ const current = job.current_step || 0;
+ const ticks = [];
+ for (let i = 1; i <= total; i += 1) {
+ let state = 'pending';
+ if (job.status === 'succeeded') state = 'done';
+ else if (i < current) state = 'done';
+ else if (i === current) {
+ if (job.status === 'failed') state = 'failed';
+ else if (job.status === 'running') state = 'running';
+ else state = 'done';
+ }
+ ticks.push(state);
+ }
+ return ticks;
+}
+
+// "main@3f8c1d2", an image tag, or the template ref — whatever identifies what
+// was actually deployed. Null when nothing does (a simulated run, say), so
+// callers can choose between a fallback and omitting the field entirely.
+export function sourceRef(job) {
+ if (job.commit_hash) {
+ const short = job.commit_hash.slice(0, 7);
+ const branch = job.branch || job.result?.branch;
+ return branch ? `${branch}@${short}` : short;
+ }
+ if (job.image_tag) return job.image_tag;
+ if (job.kind === 'template_install') return job.result?.template || job.app_name || 'template';
+ return null;
+}
+
+export function formatDuration(seconds) {
+ if (seconds == null) return '—';
+ if (seconds < 10) return `${seconds.toFixed(1)}s`;
+ if (seconds < 60) return `${Math.round(seconds)}s`;
+ const m = Math.floor(seconds / 60);
+ const s = Math.round(seconds % 60);
+ return s ? `${m}m ${s}s` : `${m}m`;
+}
+
+export function relativeTime(iso, now = Date.now()) {
+ if (!iso) return '—';
+ const t = new Date(iso).getTime();
+ if (Number.isNaN(t)) return '—';
+ const mins = (now - t) / 60000;
+ if (mins < 1) return 'just now';
+ if (mins < 60) return `${Math.floor(mins)}m ago`;
+ if (mins < 1440) return `${Math.floor(mins / 60)}h ago`;
+ return `${Math.floor(mins / 1440)}d ago`;
+}
+
+// Queued runs float to the top; everything else falls into a day bucket so the
+// feed reads chronologically without printing a date on every row.
+export function activityGroup(job, now = Date.now()) {
+ if (job.status === 'pending' || !job.started_at) return 'Queued';
+ const mins = (now - new Date(job.started_at).getTime()) / 60000;
+ return mins < 1440 ? 'Today' : 'Earlier';
+}
+
+const GROUP_ORDER = { Queued: 0, Today: 1, Earlier: 2 };
+
+// Group into ordered buckets, newest first inside each.
+export function groupDeploys(jobs, now = Date.now()) {
+ const buckets = new Map();
+ jobs.forEach((job) => {
+ const g = activityGroup(job, now);
+ if (!buckets.has(g)) buckets.set(g, []);
+ buckets.get(g).push(job);
+ });
+ return [...buckets.entries()]
+ .sort((a, b) => GROUP_ORDER[a[0]] - GROUP_ORDER[b[0]])
+ .map(([group, items]) => ({
+ group,
+ items: items.sort((a, b) => {
+ const ta = new Date(a.started_at || a.created_at).getTime() || 0;
+ const tb = new Date(b.started_at || b.created_at).getTime() || 0;
+ return tb - ta;
+ }),
+ }));
+}