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(deploy): the Deploy Console — full-page live install/deploy view

Juan Denisb0148d03f90f
diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx
index ebf1379b..7bbb6593 100644
--- a/frontend/src/App.jsx
+++ b/frontend/src/App.jsx
@@ -67,6 +67,7 @@ import NotFound from './pages/NotFound';
import AppMap from './pages/AppMap';
import Documentation from './pages/Documentation';
import Deployments from './pages/Deployments';
+import DeployConsole from './pages/DeployConsole';
import QueueOperations from './pages/QueueOperations';
import QueueDetail from './pages/QueueDetail';
import Notifications from './pages/Notifications';
@@ -322,7 +323,7 @@ function AppRoutes() {
<Route path="services/new" element={<NewService />} />
<Route path="templates" element={<Templates />} />
<Route path="deployments" element={<Deployments />} />
- <Route path="deployments/:jobId" element={<Deployments />} />
+ <Route path="deployments/:jobId" element={<DeployConsole />} />
</Route>
<Route path="services/:id" element={<ServiceDetail />} />
<Route path="services/:id/:tab" element={<ServiceDetail />} />
diff --git a/frontend/src/components/deploy-console/ConsoleToolbar.jsx b/frontend/src/components/deploy-console/ConsoleToolbar.jsx
new file mode 100644
index 00000000..964498e8
--- /dev/null
+++ b/frontend/src/components/deploy-console/ConsoleToolbar.jsx
@@ -0,0 +1,71 @@
+import { Copy, Download, Search } from 'lucide-react';
+
+const LEVELS = ['all', 'info', 'warn', 'error', 'debug'];
+
+// Log toolbar: follow / wrap / timestamps toggles, a level filter, a client-side
+// search box, plus copy-all and download-.txt actions.
+export default function ConsoleToolbar({
+ follow, onToggleFollow,
+ wrap, onToggleWrap,
+ timestamps, onToggleTimestamps,
+ level, onLevelChange,
+ search, onSearchChange,
+ onCopy, onDownload,
+}) {
+ return (
+ <div className="deploy-console__toolbar">
+ <div className="deploy-console__toolbar-group">
+ <button
+ type="button"
+ className={`deploy-console__toggle ${follow ? 'is-active' : ''}`}
+ onClick={onToggleFollow}
+ aria-pressed={follow}
+ >
+ Follow
+ </button>
+ <button
+ type="button"
+ className={`deploy-console__toggle ${wrap ? 'is-active' : ''}`}
+ onClick={onToggleWrap}
+ aria-pressed={wrap}
+ >
+ Wrap
+ </button>
+ <button
+ type="button"
+ className={`deploy-console__toggle ${timestamps ? 'is-active' : ''}`}
+ onClick={onToggleTimestamps}
+ aria-pressed={timestamps}
+ >
+ Timestamps
+ </button>
+ <label className="deploy-console__level">
+ <span className="sr-only">Log level</span>
+ <select value={level} onChange={(e) => onLevelChange(e.target.value)}>
+ {LEVELS.map((l) => (
+ <option key={l} value={l}>{l === 'all' ? 'All levels' : l}</option>
+ ))}
+ </select>
+ </label>
+ </div>
+
+ <div className="deploy-console__toolbar-group">
+ <div className="deploy-console__search">
+ <Search size={14} />
+ <input
+ type="text"
+ placeholder="Search logs…"
+ value={search}
+ onChange={(e) => onSearchChange(e.target.value)}
+ />
+ </div>
+ <button type="button" className="deploy-console__toggle" onClick={onCopy} title="Copy all logs">
+ <Copy size={14} /> Copy
+ </button>
+ <button type="button" className="deploy-console__toggle" onClick={onDownload} title="Download logs as .txt">
+ <Download size={14} /> Download
+ </button>
+ </div>
+ </div>
+ );
+}
diff --git a/frontend/src/components/deploy-console/ErrorCard.jsx b/frontend/src/components/deploy-console/ErrorCard.jsx
new file mode 100644
index 00000000..72d4e329
--- /dev/null
+++ b/frontend/src/components/deploy-console/ErrorCard.jsx
@@ -0,0 +1,73 @@
+import { useContext } from 'react';
+import { AlertTriangle, RefreshCw, Copy, Sparkles } from 'lucide-react';
+import { AIContext } from '../../contexts/AIContext';
+
+// Pinned failure card (plan 51 §1.1): failed step name, the persisted failure
+// tail (the real reason, not a summary), the one-line error, a plain-language
+// hint when a heuristic matched, and actions: Retry / Copy error / Ask AI.
+export default function ErrorCard({ failedStepName, failureTail, hint, errorMessage, onRetry, retrying }) {
+ // Read the AI drawer context directly (null when no AIProvider is mounted),
+ // so the hook is called unconditionally and the "Ask AI" button degrades
+ // gracefully.
+ const ai = useContext(AIContext);
+
+ const tailText = Array.isArray(failureTail) ? failureTail.join('\n') : (failureTail || '');
+
+ const copyError = () => {
+ const blob = [
+ failedStepName ? `Failed step: ${failedStepName}` : null,
+ errorMessage ? `Error: ${errorMessage}` : null,
+ tailText ? `\n${tailText}` : null,
+ ].filter(Boolean).join('\n');
+ navigator.clipboard?.writeText(blob);
+ };
+
+ const askAI = () => {
+ if (!ai?.open) return;
+ const prompt = [
+ 'A deployment on my server failed. Here is the failing step and the tail',
+ 'of the build output — explain what went wrong and how to fix it:\n',
+ failedStepName ? `Failed step: ${failedStepName}` : '',
+ errorMessage ? `Error: ${errorMessage}` : '',
+ tailText ? `\nOutput:\n${tailText}` : '',
+ ].join('\n');
+ ai.open(prompt);
+ };
+
+ return (
+ <div className="deploy-console__error" role="alert">
+ <div className="deploy-console__error-head">
+ <AlertTriangle size={18} />
+ <div>
+ <strong>Deployment failed{failedStepName ? ` at "${failedStepName}"` : ''}</strong>
+ {errorMessage && <p className="deploy-console__error-msg">{errorMessage}</p>}
+ </div>
+ </div>
+
+ {hint && (
+ <p className="deploy-console__error-hint">
+ <Sparkles size={14} /> {hint}
+ </p>
+ )}
+
+ {tailText && (
+ <pre className="deploy-console__error-tail">{tailText}</pre>
+ )}
+
+ <div className="deploy-console__error-actions">
+ <button type="button" className="deploy-console__btn deploy-console__btn--primary" onClick={onRetry} disabled={retrying}>
+ <RefreshCw size={14} className={retrying ? 'deploy-console__spin' : ''} />
+ {retrying ? 'Retrying…' : 'Retry deploy'}
+ </button>
+ <button type="button" className="deploy-console__btn" onClick={copyError}>
+ <Copy size={14} /> Copy error
+ </button>
+ {ai?.open && (
+ <button type="button" className="deploy-console__btn" onClick={askAI}>
+ <Sparkles size={14} /> Ask AI
+ </button>
+ )}
+ </div>
+ </div>
+ );
+}
diff --git a/frontend/src/components/deploy-console/LogPane.jsx b/frontend/src/components/deploy-console/LogPane.jsx
new file mode 100644
index 00000000..e4cb9045
--- /dev/null
+++ b/frontend/src/components/deploy-console/LogPane.jsx
@@ -0,0 +1,82 @@
+import { useEffect, useRef, useState } from 'react';
+import { ArrowDown } from 'lucide-react';
+
+// Monospace console surface. Auto-scrolls while "follow" is on; disengages when
+// the user scrolls up and re-engages via a "Jump to live" chip. Lines carry a
+// data-step attribute so the step rail can scroll a step into view.
+export default function LogPane({ lines, wrap, timestamps, follow, onFollowChange, scrollToStep }) {
+ const paneRef = useRef(null);
+ const endRef = useRef(null);
+ const [showJump, setShowJump] = useState(false);
+
+ // Follow: keep pinned to the bottom as new lines arrive.
+ useEffect(() => {
+ if (follow && paneRef.current) {
+ paneRef.current.scrollTop = paneRef.current.scrollHeight;
+ setShowJump(false);
+ }
+ }, [lines, follow]);
+
+ // Scroll a given step's first line into view when the rail is clicked.
+ useEffect(() => {
+ if (scrollToStep == null || !paneRef.current) return;
+ const el = paneRef.current.querySelector(`[data-step="${scrollToStep}"]`);
+ if (el) el.scrollIntoView({ block: 'start', behavior: 'smooth' });
+ }, [scrollToStep]);
+
+ const onScroll = () => {
+ const pane = paneRef.current;
+ if (!pane) return;
+ const atBottom = pane.scrollHeight - pane.scrollTop - pane.clientHeight < 40;
+ if (!atBottom && follow) onFollowChange(false);
+ setShowJump(!atBottom);
+ };
+
+ const jumpToLive = () => {
+ onFollowChange(true);
+ if (paneRef.current) paneRef.current.scrollTop = paneRef.current.scrollHeight;
+ setShowJump(false);
+ };
+
+ let lastStep = null;
+
+ return (
+ <div className="deploy-console__logwrap">
+ <div
+ ref={paneRef}
+ className={`deploy-console__log ${wrap ? 'deploy-console__log--wrap' : ''}`}
+ onScroll={onScroll}
+ role="log"
+ aria-live="polite"
+ >
+ {lines.length === 0 ? (
+ <div className="deploy-console__log-empty">Waiting for output…</div>
+ ) : (
+ lines.map((ln, i) => {
+ const isNewStep = ln.step_index != null && ln.step_index !== lastStep;
+ if (ln.step_index != null) lastStep = ln.step_index;
+ const ts = timestamps && ln.ts
+ ? new Date(ln.ts).toLocaleTimeString()
+ : (timestamps && ln.created_at ? new Date(ln.created_at).toLocaleTimeString() : '');
+ return (
+ <div
+ key={ln.id ?? `i${i}`}
+ className={`deploy-console__line deploy-console__line--${ln.level || 'info'}`}
+ data-step={isNewStep ? ln.step_index : undefined}
+ >
+ {timestamps && <span className="deploy-console__line-ts">{ts}</span>}
+ <span className="deploy-console__line-msg">{ln.message}</span>
+ </div>
+ );
+ })
+ )}
+ <div ref={endRef} />
+ </div>
+ {showJump && (
+ <button type="button" className="deploy-console__jump" onClick={jumpToLive}>
+ <ArrowDown size={14} /> Jump to live
+ </button>
+ )}
+ </div>
+ );
+}
diff --git a/frontend/src/components/deploy-console/StepRail.jsx b/frontend/src/components/deploy-console/StepRail.jsx
new file mode 100644
index 00000000..6dd5777f
--- /dev/null
+++ b/frontend/src/components/deploy-console/StepRail.jsx
@@ -0,0 +1,54 @@
+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/deploy-console/SuccessBanner.jsx b/frontend/src/components/deploy-console/SuccessBanner.jsx
new file mode 100644
index 00000000..28e3c33a
--- /dev/null
+++ b/frontend/src/components/deploy-console/SuccessBanner.jsx
@@ -0,0 +1,60 @@
+import { Link } from 'react-router-dom';
+import { CheckCircle2, ExternalLink, LayoutGrid, ScrollText } from 'lucide-react';
+
+const fmtSeconds = (s) => {
+ if (s == null) return '—';
+ if (s < 60) return `${s.toFixed(1)}s`;
+ const m = Math.floor(s / 60);
+ return `${m}m ${Math.round(s % 60)}s`;
+};
+
+// Completion banner (plan 51 §1.1): total duration, per-step timings, and the
+// payoff actions — Open app (when a live URL exists), View service, View
+// runtime logs.
+export default function SuccessBanner({ job, appUrl }) {
+ const timings = job?.result?.step_timings || [];
+ const appId = job?.app_id;
+
+ return (
+ <div className="deploy-console__success">
+ <div className="deploy-console__success-head">
+ <CheckCircle2 size={20} />
+ <div>
+ <strong>Deployed successfully</strong>
+ <span className="deploy-console__success-dur">
+ Completed in {fmtSeconds(job?.duration)}
+ </span>
+ </div>
+ </div>
+
+ {timings.length > 0 && (
+ <ul className="deploy-console__success-timings">
+ {timings.map((t) => (
+ <li key={t.index}>
+ <span>{t.name || `Step ${t.index}`}</span>
+ <span>{fmtSeconds(t.seconds)}</span>
+ </li>
+ ))}
+ </ul>
+ )}
+
+ <div className="deploy-console__success-actions">
+ {appUrl && (
+ <a className="deploy-console__btn deploy-console__btn--primary" href={appUrl} target="_blank" rel="noreferrer">
+ <ExternalLink size={14} /> Open app
+ </a>
+ )}
+ {appId && (
+ <Link className="deploy-console__btn" to={`/services/${appId}`}>
+ <LayoutGrid size={14} /> View service
+ </Link>
+ )}
+ {appId && (
+ <Link className="deploy-console__btn" to={`/services/${appId}/logs`}>
+ <ScrollText size={14} /> View runtime logs
+ </Link>
+ )}
+ </div>
+ </div>
+ );
+}
diff --git a/frontend/src/pages/DeployConsole.jsx b/frontend/src/pages/DeployConsole.jsx
new file mode 100644
index 00000000..fcbb89a3
--- /dev/null
+++ b/frontend/src/pages/DeployConsole.jsx
@@ -0,0 +1,235 @@
+import { useEffect, useMemo, useState, useCallback } from 'react';
+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 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';
+
+const STATUS_META = {
+ pending: { label: 'Queued', icon: Clock, cls: 'pending' },
+ running: { label: 'Running', icon: Loader2, cls: 'running' },
+ succeeded: { label: 'Succeeded', icon: CheckCircle2, cls: 'succeeded' },
+ failed: { label: 'Failed', icon: XCircle, cls: 'failed' },
+ cancelled: { label: 'Cancelled', icon: XCircle, cls: 'failed' },
+};
+
+const fmtElapsed = (ms) => {
+ if (ms == null || ms < 0) return '0:00';
+ const total = Math.floor(ms / 1000);
+ const m = Math.floor(total / 60);
+ const s = total % 60;
+ return `${m}:${String(s).padStart(2, '0')}`;
+};
+
+function humanizeTitle(job) {
+ if (!job) return 'Deployment';
+ if (job.kind === 'template_install') {
+ const name = job.plan?.template_name || job.plan?.app_name || job.app_name || 'app';
+ return `Installing ${name}`;
+ }
+ if (job.kind === 'app_deploy') {
+ const target = job.target_server_name && job.target_server_name !== 'Local server'
+ ? ` on ${job.target_server_name}` : '';
+ return `Deploying ${job.app_name || 'service'}${target}`;
+ }
+ return `Deployment · ${job.kind}`;
+}
+
+export default function DeployConsole() {
+ const { jobId } = useParams();
+ const navigate = useNavigate();
+ const { job, lines, isLive, transport, error, loading } = useDeployJobStream(jobId, { includePlan: true });
+
+ const [follow, setFollow] = useState(true);
+ const [wrap, setWrap] = useState(true);
+ const [timestamps, setTimestamps] = useState(false);
+ const [level, setLevel] = useState('all');
+ const [search, setSearch] = useState('');
+ const [scrollToStep, setScrollToStep] = useState(null);
+ const [retrying, setRetrying] = useState(false);
+ const [now, setNow] = useState(Date.now());
+
+ const status = job?.status || 'pending';
+
+ // Live elapsed timer while running.
+ useEffect(() => {
+ if (status !== 'running' && status !== 'pending') return undefined;
+ const t = setInterval(() => setNow(Date.now()), 1000);
+ return () => clearInterval(t);
+ }, [status]);
+
+ const steps = useMemo(() => {
+ const planSteps = job?.plan?.steps || [];
+ const timingByIndex = {};
+ (job?.result?.step_timings || []).forEach((t) => { timingByIndex[t.index] = t; });
+ const current = job?.current_step || 0;
+ return planSteps.map((s, i) => {
+ const index = i + 1;
+ const name = s.name || s.type || `Step ${index}`;
+ let state;
+ if (status === 'failed' && index === current) state = 'failed';
+ else if (status === 'succeeded' || timingByIndex[index] || index < current) state = 'done';
+ else if (index === current && status === 'running') state = 'running';
+ else state = 'pending';
+ return { index, name, state, seconds: timingByIndex[index]?.seconds };
+ });
+ }, [job, status]);
+
+ const visibleLines = useMemo(() => {
+ const q = search.trim().toLowerCase();
+ return lines.filter((l) =>
+ (level === 'all' || (l.level || 'info') === level)
+ && (!q || (l.message || '').toLowerCase().includes(q))
+ );
+ }, [lines, level, search]);
+
+ const elapsedMs = useMemo(() => {
+ if (!job?.started_at) return job?.created_at ? now - new Date(job.created_at).getTime() : 0;
+ const end = job.completed_at ? new Date(job.completed_at).getTime() : now;
+ return end - new Date(job.started_at).getTime();
+ }, [job, now]);
+
+ const copyLogs = useCallback(() => {
+ const text = lines.map((l) => l.message).join('\n');
+ navigator.clipboard?.writeText(text);
+ }, [lines]);
+
+ const downloadLogs = useCallback(() => {
+ const text = lines.map((l) => {
+ const ts = l.ts || l.created_at || '';
+ return `${ts ? `[${ts}] ` : ''}${(l.level || 'info').toUpperCase()} ${l.message}`;
+ }).join('\n');
+ const blob = new Blob([text], { type: 'text/plain' });
+ const url = URL.createObjectURL(blob);
+ const a = document.createElement('a');
+ a.href = url;
+ a.download = `deploy-${jobId}.txt`;
+ a.click();
+ URL.revokeObjectURL(url);
+ }, [lines, jobId]);
+
+ const onStepClick = useCallback((index) => {
+ setFollow(false);
+ setScrollToStep(index);
+ // reset so a repeat click on the same step re-triggers the effect
+ setTimeout(() => setScrollToStep(null), 100);
+ }, []);
+
+ const onRetry = useCallback(async () => {
+ setRetrying(true);
+ try {
+ const res = await api.retryDeploymentJob(jobId);
+ if (res?.job_id) navigate(`/deployments/${res.job_id}`);
+ } catch {
+ setRetrying(false);
+ }
+ }, [jobId, navigate]);
+
+ const meta = STATUS_META[status] || STATUS_META.pending;
+ const StatusIcon = meta.icon;
+ const failedStepName = status === 'failed'
+ ? (job?.current_step_name || steps.find((s) => s.state === 'failed')?.name)
+ : null;
+ const appUrl = job?.result?.auto_domain?.url || null;
+ const degraded = (status === 'running' || status === 'pending') && transport === 'poll';
+
+ if (loading && !job) {
+ return (
+ <div className="deploy-console deploy-console--loading">
+ <Loader2 size={22} className="deploy-console__spin" />
+ <span>Loading deployment…</span>
+ </div>
+ );
+ }
+
+ if (error && !job) {
+ return (
+ <div className="deploy-console deploy-console--error-page">
+ <XCircle size={22} />
+ <strong>Deployment not found</strong>
+ <p>{error}</p>
+ <Link to="/deployments" className="deploy-console__btn">
+ <ArrowLeft size={14} /> Back to deployments
+ </Link>
+ </div>
+ );
+ }
+
+ return (
+ <div className="deploy-console">
+ <header className="deploy-console__header">
+ <Link to="/deployments" className="deploy-console__back" title="Back to deployments">
+ <ArrowLeft size={18} />
+ </Link>
+ <h1 className="deploy-console__title">{humanizeTitle(job)}</h1>
+ <div className="deploy-console__meta">
+ <span className={`deploy-console__pill deploy-console__pill--${meta.cls}`}>
+ <StatusIcon size={14} className={status === 'running' ? 'deploy-console__spin' : ''} />
+ {meta.label}
+ </span>
+ {job?.total_steps > 0 && (
+ <span className="deploy-console__step-count">
+ step {Math.min(job.current_step || 0, job.total_steps)}/{job.total_steps}
+ </span>
+ )}
+ <span className="deploy-console__elapsed">{fmtElapsed(elapsedMs)}</span>
+ </div>
+ </header>
+
+ {degraded && (
+ <div className="deploy-console__degraded">
+ <WifiOff size={14} /> Live updates unavailable — refreshing every 2s.
+ </div>
+ )}
+
+ {status === 'pending' && (
+ <div className="deploy-console__queued">
+ <Loader2 size={16} className="deploy-console__spin" /> Waiting for a worker to pick up this deployment…
+ </div>
+ )}
+
+ {status === 'failed' && (
+ <ErrorCard
+ failedStepName={failedStepName}
+ failureTail={job?.result?.failure_tail}
+ hint={job?.result?.hint}
+ errorMessage={job?.error_message}
+ onRetry={onRetry}
+ retrying={retrying}
+ />
+ )}
+
+ {status === 'succeeded' && (
+ <SuccessBanner job={job} appUrl={appUrl} />
+ )}
+
+ <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)}
+ wrap={wrap} onToggleWrap={() => setWrap((v) => !v)}
+ timestamps={timestamps} onToggleTimestamps={() => setTimestamps((v) => !v)}
+ level={level} onLevelChange={setLevel}
+ search={search} onSearchChange={setSearch}
+ onCopy={copyLogs} onDownload={downloadLogs}
+ />
+ <LogPane
+ lines={visibleLines}
+ wrap={wrap}
+ timestamps={timestamps}
+ follow={follow && isLive}
+ onFollowChange={setFollow}
+ scrollToStep={scrollToStep}
+ />
+ </div>
+ </div>
+ </div>
+ );
+}
diff --git a/frontend/src/styles/main.scss b/frontend/src/styles/main.scss
index 9298c8f5..a876da26 100644
--- a/frontend/src/styles/main.scss
+++ b/frontend/src/styles/main.scss
@@ -100,6 +100,7 @@
@import 'pages/_monitoring';
@import 'pages/_backups';
@import 'pages/_deployments';
+@import 'pages/_deploy-console';
@import 'pages/_terminal';
@import 'pages/_settings';
@import 'pages/_notification-center';
diff --git a/frontend/src/styles/pages/_deploy-console.scss b/frontend/src/styles/pages/_deploy-console.scss
new file mode 100644
index 00000000..51571160
--- /dev/null
+++ b/frontend/src/styles/pages/_deploy-console.scss
@@ -0,0 +1,475 @@
+// ============================================
+// DEPLOY CONSOLE (/deployments/:jobId)
+// The signature "watch it deploy live" full-page console (plan 51).
+// ============================================
+
+// Console log-level colors (mirrors the terminal/logs treatment).
+$dc-info: #49c7f0;
+$dc-warn: #f5b945;
+$dc-error: #fb6f6f;
+$dc-debug: #9aa1af;
+// Dark console surface, intentionally the same in light + dark themes.
+$dc-surface: #0d1117;
+$dc-surface-line: rgba(255, 255, 255, 0.04);
+
+.deploy-console {
+ display: flex;
+ flex-direction: column;
+ gap: $space-3;
+ min-height: 0;
+
+ &__spin {
+ animation: dc-spin 1s linear infinite;
+ }
+
+ // ---- header ----
+ &__header {
+ display: flex;
+ align-items: center;
+ gap: $space-3;
+ flex-wrap: wrap;
+ }
+
+ &__back {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ width: 32px;
+ height: 32px;
+ border-radius: $radius-md;
+ border: 1px solid $border-subtle;
+ color: $text-secondary;
+ background: $bg-card;
+
+ &:hover {
+ color: $text-primary;
+ background: $bg-hover;
+ }
+ }
+
+ &__title {
+ margin: 0;
+ font-size: 18px;
+ font-weight: 600;
+ color: $text-primary;
+ min-width: 0;
+ flex: 1;
+ }
+
+ &__meta {
+ display: flex;
+ align-items: center;
+ gap: $space-3;
+ }
+
+ &__pill {
+ display: inline-flex;
+ align-items: center;
+ gap: $space-1;
+ padding: 3px 10px;
+ border-radius: 999px;
+ font-size: $font-size-sm;
+ font-weight: 600;
+ text-transform: capitalize;
+
+ &--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); }
+ }
+
+ &__step-count,
+ &__elapsed {
+ font-size: $font-size-sm;
+ color: $text-tertiary;
+ font-variant-numeric: tabular-nums;
+ }
+
+ &__elapsed {
+ font-family: $font-mono;
+ }
+
+ // ---- transient state strips ----
+ &__degraded,
+ &__queued {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+ padding: $space-2 $space-3;
+ border-radius: $radius-md;
+ font-size: $font-size-sm;
+ }
+
+ &__degraded {
+ background: rgba($warning, 0.1);
+ color: $warning;
+ }
+
+ &__queued {
+ background: var(--accent-bg);
+ color: var(--accent-bright);
+ }
+
+ // ---- body: rail + main ----
+ &__body {
+ display: grid;
+ grid-template-columns: 220px minmax(0, 1fr);
+ gap: $space-3;
+ align-items: stretch;
+ min-height: 0;
+
+ @media (max-width: 720px) {
+ grid-template-columns: 1fr;
+ }
+ }
+
+ &__main {
+ display: flex;
+ flex-direction: column;
+ min-width: 0;
+ border: 1px solid $border-subtle;
+ border-radius: $radius-lg;
+ overflow: hidden;
+ }
+
+ // ---- step rail ----
+ &__rail {
+ list-style: none;
+ margin: 0;
+ padding: $space-2;
+ border: 1px solid $border-subtle;
+ border-radius: $radius-lg;
+ background: $bg-card;
+ display: flex;
+ flex-direction: column;
+ gap: 2px;
+ align-self: start;
+ }
+
+ &__rail-btn {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+ width: 100%;
+ padding: $space-2;
+ border: none;
+ background: transparent;
+ border-radius: $radius-md;
+ cursor: pointer;
+ text-align: left;
+ color: $text-secondary;
+
+ &:hover { background: $bg-hover; }
+ }
+
+ &__rail-icon {
+ display: inline-flex;
+ flex-shrink: 0;
+ }
+
+ &__rail-name {
+ flex: 1;
+ min-width: 0;
+ font-size: $font-size-sm;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ }
+
+ &__rail-time {
+ font-size: $font-size-xs;
+ color: $text-tertiary;
+ font-variant-numeric: tabular-nums;
+ }
+
+ &__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; }
+ }
+
+ // ---- toolbar ----
+ &__toolbar {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: $space-2;
+ padding: $space-2;
+ background: $bg-card;
+ border-bottom: 1px solid $border-subtle;
+ flex-wrap: wrap;
+ }
+
+ &__toolbar-group {
+ display: flex;
+ align-items: center;
+ gap: $space-1;
+ }
+
+ &__toggle {
+ display: inline-flex;
+ align-items: center;
+ gap: 4px;
+ padding: 4px 8px;
+ font-size: $font-size-sm;
+ border-radius: $radius-md;
+ border: 1px solid $border-subtle;
+ background: transparent;
+ color: $text-secondary;
+ cursor: pointer;
+
+ &:hover { background: $bg-hover; color: $text-primary; }
+ &.is-active {
+ background: var(--accent-bg);
+ color: var(--accent-bright);
+ border-color: transparent;
+ }
+ }
+
+ &__level select {
+ padding: 4px 6px;
+ font-size: $font-size-sm;
+ border-radius: $radius-md;
+ border: 1px solid $border-subtle;
+ background: $bg-card;
+ color: $text-secondary;
+ }
+
+ &__search {
+ display: inline-flex;
+ align-items: center;
+ gap: 4px;
+ padding: 2px 8px;
+ border-radius: $radius-md;
+ border: 1px solid $border-subtle;
+ color: $text-tertiary;
+
+ input {
+ border: none;
+ background: transparent;
+ color: $text-primary;
+ font-size: $font-size-sm;
+ outline: none;
+ width: 140px;
+ }
+ }
+
+ // ---- log pane ----
+ &__logwrap {
+ position: relative;
+ flex: 1;
+ min-height: 320px;
+ }
+
+ &__log {
+ position: absolute;
+ inset: 0;
+ overflow: auto;
+ padding: $space-2 $space-3;
+ background: $dc-surface;
+ font-family: $font-mono;
+ font-size: $font-size-sm;
+ line-height: 1.55;
+ color: #c9d1d9;
+
+ &--wrap .deploy-console__line-msg {
+ white-space: pre-wrap;
+ word-break: break-word;
+ }
+ }
+
+ &__line {
+ display: flex;
+ gap: $space-2;
+ padding: 0 4px;
+ border-radius: 3px;
+
+ &[data-step] { scroll-margin-top: $space-2; }
+
+ &--warn .deploy-console__line-msg { color: $dc-warn; }
+ &--error .deploy-console__line-msg { color: $dc-error; }
+ &--debug .deploy-console__line-msg { color: $dc-debug; }
+ &--info .deploy-console__line-msg { color: #c9d1d9; }
+ }
+
+ &__line-ts {
+ flex-shrink: 0;
+ color: #6b7280;
+ font-variant-numeric: tabular-nums;
+ }
+
+ &__line-msg {
+ white-space: pre;
+ min-width: 0;
+ }
+
+ &__log-empty {
+ color: #6b7280;
+ font-style: italic;
+ }
+
+ &__jump {
+ position: absolute;
+ bottom: $space-3;
+ left: 50%;
+ transform: translateX(-50%);
+ display: inline-flex;
+ align-items: center;
+ gap: 4px;
+ padding: 4px 12px;
+ border-radius: 999px;
+ border: none;
+ background: var(--accent-primary);
+ color: #fff;
+ font-size: $font-size-sm;
+ cursor: pointer;
+ box-shadow: $shadow-lg;
+ }
+
+ // ---- error card ----
+ &__error {
+ border: 1px solid var(--red-bg);
+ border-left: 3px solid $danger;
+ border-radius: $radius-lg;
+ background: var(--red-bg);
+ padding: $space-3;
+ display: flex;
+ flex-direction: column;
+ gap: $space-2;
+ }
+
+ &__error-head {
+ display: flex;
+ gap: $space-2;
+ color: $danger;
+
+ strong { color: $text-primary; }
+ }
+
+ &__error-msg {
+ margin: 2px 0 0;
+ color: $text-secondary;
+ font-size: $font-size-sm;
+ }
+
+ &__error-hint {
+ display: flex;
+ align-items: center;
+ gap: $space-1;
+ margin: 0;
+ padding: $space-2;
+ border-radius: $radius-md;
+ background: rgba($warning, 0.12);
+ color: $warning;
+ font-size: $font-size-sm;
+ }
+
+ &__error-tail {
+ margin: 0;
+ max-height: 220px;
+ overflow: auto;
+ padding: $space-2;
+ background: $dc-surface;
+ border-radius: $radius-md;
+ font-family: $font-mono;
+ font-size: $font-size-sm;
+ line-height: 1.5;
+ color: #c9d1d9;
+ white-space: pre-wrap;
+ word-break: break-word;
+ }
+
+ &__error-actions,
+ &__success-actions {
+ display: flex;
+ flex-wrap: wrap;
+ gap: $space-2;
+ }
+
+ // ---- success banner ----
+ &__success {
+ border: 1px solid var(--green-bg);
+ border-left: 3px solid $success;
+ border-radius: $radius-lg;
+ background: var(--green-bg);
+ padding: $space-3;
+ display: flex;
+ flex-direction: column;
+ gap: $space-3;
+ }
+
+ &__success-head {
+ display: flex;
+ gap: $space-2;
+ color: $success;
+
+ strong { color: $text-primary; display: block; }
+ }
+
+ &__success-dur {
+ font-size: $font-size-sm;
+ color: $text-secondary;
+ }
+
+ &__success-timings {
+ list-style: none;
+ margin: 0;
+ padding: 0;
+ display: grid;
+ gap: 2px;
+
+ li {
+ display: flex;
+ justify-content: space-between;
+ font-size: $font-size-sm;
+ color: $text-secondary;
+ padding: 2px 0;
+ border-bottom: 1px solid $dc-surface-line;
+
+ span:last-child { font-variant-numeric: tabular-nums; }
+ }
+ }
+
+ // ---- shared buttons ----
+ &__btn {
+ display: inline-flex;
+ align-items: center;
+ gap: $space-1;
+ padding: 6px 12px;
+ border-radius: $radius-md;
+ border: 1px solid $border-subtle;
+ background: $bg-card;
+ color: $text-primary;
+ font-size: $font-size-sm;
+ font-weight: 500;
+ cursor: pointer;
+
+ &:hover { background: $bg-hover; }
+ &:disabled { opacity: 0.6; cursor: default; }
+
+ &--primary {
+ background: var(--accent-primary);
+ border-color: transparent;
+ color: #fff;
+
+ &:hover { filter: brightness(1.05); background: var(--accent-primary); }
+ }
+ }
+
+ // ---- full-page loading / not-found ----
+ &--loading,
+ &--error-page {
+ align-items: center;
+ justify-content: center;
+ text-align: center;
+ gap: $space-2;
+ padding: $space-5;
+ color: $text-secondary;
+ }
+}
+
+@keyframes dc-spin {
+ to { transform: rotate(360deg); }
+}