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): deployments index deep-links to the console + global "deploy running" pill

Juan Denis0c094aea8d2c
diff --git a/frontend/src/components/DeployPill.jsx b/frontend/src/components/DeployPill.jsx
new file mode 100644
index 00000000..d47cb1ab
--- /dev/null
+++ b/frontend/src/components/DeployPill.jsx
@@ -0,0 +1,55 @@
+import { useEffect, useState, useCallback } from 'react';
+import { Link } from 'react-router-dom';
+import { Loader2 } from 'lucide-react';
+import api from '../services/api';
+import socketService from '../services/socket';
+
+// A small global "deploy in progress" pill: while any deployment job is
+// pending/running it appears (bottom-left) so you can navigate away mid-deploy
+// and always find your way back to the live Deploy Console (plan 51 §1.3).
+// Driven by a lightweight poll of GET /deployment-jobs?status=running, refreshed
+// on socket reconnect and on any deploy_status event that flows through.
+const POLL_MS = 6000;
+
+export default function DeployPill() {
+ const [active, setActive] = useState([]);
+
+ const refresh = useCallback(async () => {
+ try {
+ const [running, pending] = await Promise.all([
+ api.getDeploymentJobs({ status: 'running', limit: 20 }),
+ api.getDeploymentJobs({ status: 'pending', limit: 20 }),
+ ]);
+ const jobs = [...(running?.jobs || []), ...(pending?.jobs || [])];
+ setActive(jobs);
+ } catch {
+ // Silent — the pill is a convenience, not critical chrome.
+ }
+ }, []);
+
+ useEffect(() => {
+ refresh();
+ const t = setInterval(refresh, POLL_MS);
+ // React quickly to live status changes when a console elsewhere is streaming.
+ const unsubStatus = socketService.on('deploy_status', refresh);
+ const unsubConnect = socketService.on('connected', refresh);
+ return () => {
+ clearInterval(t);
+ unsubStatus();
+ unsubConnect();
+ };
+ }, [refresh]);
+
+ if (active.length === 0) return null;
+
+ const count = active.length;
+ const to = count === 1 ? `/deployments/${active[0].id}` : '/deployments';
+ const label = count === 1 ? '1 deploy running' : `${count} deploys running`;
+
+ return (
+ <Link to={to} className="deploy-pill" title="Open the Deploy Console">
+ <Loader2 size={14} className="deploy-pill__spin" />
+ <span>{label}</span>
+ </Link>
+ );
+}
diff --git a/frontend/src/layouts/DashboardLayout.jsx b/frontend/src/layouts/DashboardLayout.jsx
index 867b7fce..1290469d 100644
--- a/frontend/src/layouts/DashboardLayout.jsx
+++ b/frontend/src/layouts/DashboardLayout.jsx
@@ -15,6 +15,7 @@ import { useLockBodyScroll } from '../hooks/useLockBodyScroll';
import api from '../services/api';
import SystemNotices from '../components/SystemNotices';
import StagingBanner from '../components/StagingBanner';
+import DeployPill from '../components/DeployPill';
// The Automations extension (tramo) contributes /automations/edit/:slug with
// layout:'full', so it's picked up dynamically via fullPagePaths below.
@@ -109,6 +110,7 @@ const DashboardLayout = () => {
</main>
<CommandPalette open={paletteOpen} onClose={() => setPaletteOpen(false)} />
<LogsDrawer />
+ <DeployPill />
<AIAssistant />
<PluginLoader api={api} />
</div>
diff --git a/frontend/src/pages/Deployments.jsx b/frontend/src/pages/Deployments.jsx
index b8b1d47c..35e077d2 100644
--- a/frontend/src/pages/Deployments.jsx
+++ b/frontend/src/pages/Deployments.jsx
@@ -1,14 +1,12 @@
import { useState, useEffect, useRef, useMemo } from 'react';
-import { Link } from 'react-router-dom';
+import { Link, useNavigate } from 'react-router-dom';
import {
- Activity,
CheckCircle2,
XCircle,
Clock,
RefreshCw,
Server,
Loader2,
- AlertTriangle,
GitBranch,
PlayCircle,
} from 'lucide-react';
@@ -24,14 +22,6 @@ const STATUS_COLORS = {
failed: { bg: 'var(--red-bg)', fg: 'var(--red)', icon: XCircle },
};
-const formatDuration = (seconds) => {
- if (seconds == null) return '—';
- if (seconds < 60) return `${seconds.toFixed(1)}s`;
- const m = Math.floor(seconds / 60);
- const s = Math.floor(seconds % 60);
- return `${m}m ${s}s`;
-};
-
const formatTime = (iso) => {
if (!iso) return '—';
try {
@@ -54,16 +44,14 @@ const StatusBadge = ({ status }) => {
};
const Deployments = () => {
+ const navigate = useNavigate();
const [jobs, setJobs] = useState([]);
const [loading, setLoading] = useState(true);
const [statusFilter, setStatusFilter] = useState('all');
const [serverFilter, setServerFilter] = useState('all');
const [servers, setServers] = useState([]);
- const [selectedJob, setSelectedJob] = useState(null);
- const [jobDetail, setJobDetail] = useState(null);
const [autoRefresh, setAutoRefresh] = useState(true);
const refreshRef = useRef(null);
- const detailRef = useRef(null);
const loadJobs = async () => {
try {
@@ -88,16 +76,6 @@ const Deployments = () => {
}
};
- const loadJobDetail = async (jobId) => {
- if (!jobId) return;
- try {
- const data = await api.getDeploymentJob(jobId, true);
- setJobDetail(data.job || null);
- } catch (err) {
- console.error('Failed to load deployment job detail', err);
- }
- };
-
useEffect(() => {
loadServers();
}, []);
@@ -109,23 +87,9 @@ const Deployments = () => {
useEffect(() => {
if (refreshRef.current) clearInterval(refreshRef.current);
if (!autoRefresh) return undefined;
- refreshRef.current = setInterval(() => {
- loadJobs();
- if (selectedJob) loadJobDetail(selectedJob);
- }, 3000);
+ refreshRef.current = setInterval(loadJobs, 3000);
return () => clearInterval(refreshRef.current);
- }, [autoRefresh, selectedJob, statusFilter, serverFilter]);
-
- useEffect(() => {
- if (selectedJob) loadJobDetail(selectedJob);
- else setJobDetail(null);
- }, [selectedJob]);
-
- useEffect(() => {
- if (detailRef.current) {
- detailRef.current.scrollTop = detailRef.current.scrollHeight;
- }
- }, [jobDetail?.logs?.length]);
+ }, [autoRefresh, statusFilter, serverFilter]);
const summary = useMemo(() => {
const counts = { running: 0, succeeded: 0, failed: 0, pending: 0 };
@@ -226,8 +190,8 @@ const Deployments = () => {
{jobs.map((job) => (
<tr
key={job.id}
- onClick={() => setSelectedJob(job.id)}
- className={selectedJob === job.id ? 'is-selected' : ''}
+ onClick={() => navigate(`/deployments/${job.id}`)}
+ title="Open the Deploy Console"
>
<td><StatusBadge status={job.status} /></td>
<td>{job.kind}</td>
@@ -259,95 +223,6 @@ const Deployments = () => {
</table>
)}
</div>
-
- <div className="deployments-page__panel deployments-page__detail-panel">
- <div className="deployments-page__panel-header">
- <div>
- <h2>Details</h2>
- <span>Plan and logs</span>
- </div>
- </div>
- {!selectedJob ? (
- <div className="deployments-page__empty">
- <Activity size={34} />
- <strong>No job selected</strong>
- Select a job to view its plan and logs.
- </div>
- ) : !jobDetail ? (
- <div className="deployments-page__empty">Loading...</div>
- ) : (
- <div className="deployments-page__detail-content">
- <div className="deployments-page__detail-title">
- <div>
- <h3>{jobDetail.app_name || jobDetail.kind}</h3>
- <div>
- {jobDetail.id}
- </div>
- </div>
- <StatusBadge status={jobDetail.status} />
- </div>
-
- <div className="deployments-page__detail-grid">
- <div className="deployments-page__detail-metric">
- <span>Target</span>
- <div>{jobDetail.target_server_name}</div>
- </div>
- <div className="deployments-page__detail-metric">
- <span>Step</span>
- <div>{jobDetail.current_step || 0} / {jobDetail.total_steps || 0}</div>
- </div>
- <div className="deployments-page__detail-metric">
- <span>Duration</span>
- <div>{formatDuration(jobDetail.duration)}</div>
- </div>
- <div className="deployments-page__detail-metric">
- <span>Started</span>
- <div>{formatTime(jobDetail.started_at)}</div>
- </div>
- </div>
-
- {jobDetail.current_step_name && jobDetail.status === 'running' && (
- <div className="deployments-page__notice deployments-page__notice--running">
- <Loader2 size={14} className="deployments-page__spin" />
- {jobDetail.current_step_name}
- </div>
- )}
-
- {jobDetail.error_message && (
- <div className="deployments-page__notice deployments-page__notice--error">
- <AlertTriangle size={14} />
- {jobDetail.error_message}
- </div>
- )}
-
- <h4 className="deployments-page__logs-title">Logs</h4>
- <div
- ref={detailRef}
- className="deployments-page__logs"
- >
- {(jobDetail.logs || []).length === 0
- ? 'Waiting for logs…'
- : jobDetail.logs.map((log) => {
- const ts = log.created_at ? new Date(log.created_at).toLocaleTimeString() : '';
- const stepPrefix = log.step_index ? `[${log.step_index}] ` : '';
- const color =
- log.level === 'error'
- ? 'var(--red)'
- : log.level === 'debug'
- ? 'var(--text-faint)'
- : 'var(--text-dim)';
- return (
- <div key={log.id} style={{ color }}>
- <span className="deployments-page__log-time">{ts}</span>{' '}
- <span className="deployments-page__log-level">{log.level.toUpperCase()}</span>{' '}
- {stepPrefix}{log.message}
- </div>
- );
- })}
- </div>
- </div>
- )}
- </div>
</div>
</div>
);
diff --git a/frontend/src/styles/pages/_deploy-console.scss b/frontend/src/styles/pages/_deploy-console.scss
index 51571160..a4bbdb07 100644
--- a/frontend/src/styles/pages/_deploy-console.scss
+++ b/frontend/src/styles/pages/_deploy-console.scss
@@ -473,3 +473,32 @@ $dc-surface-line: rgba(255, 255, 255, 0.04);
@keyframes dc-spin {
to { transform: rotate(360deg); }
}
+
+// Global "deploy in progress" pill (fixed, bottom-left). Sits clear of the AI
+// chat bubble (bottom-right).
+.deploy-pill {
+ position: fixed;
+ left: $space-4;
+ bottom: $space-4;
+ z-index: 60;
+ display: inline-flex;
+ align-items: center;
+ gap: $space-2;
+ padding: $space-2 $space-3;
+ border-radius: 999px;
+ background: var(--accent-primary);
+ color: #fff;
+ font-size: $font-size-sm;
+ font-weight: 600;
+ box-shadow: $shadow-lg;
+
+ &:hover { filter: brightness(1.05); }
+
+ &__spin {
+ animation: dc-spin 1s linear infinite;
+ }
+
+ @media (max-width: 768px) {
+ bottom: calc(#{$space-4} + 56px); // clear the mobile bottom bar
+ }
+}