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): route every deploy flow to the Deploy Console

Juan Denis16518b55bd95
diff --git a/frontend/src/components/appdetail/BuildTab.jsx b/frontend/src/components/appdetail/BuildTab.jsx
index 2519afb5..c1af3b28 100644
--- a/frontend/src/components/appdetail/BuildTab.jsx
+++ b/frontend/src/components/appdetail/BuildTab.jsx
@@ -1,4 +1,5 @@
import { useState, useEffect } from 'react';
+import { useNavigate } from 'react-router-dom';
import api from '../../services/api';
import EmptyState from '../EmptyState';
import { useToast } from '../../contexts/ToastContext';
@@ -20,6 +21,7 @@ const BuildTab = ({ appId, appPath, app }) => {
const [loading, setLoading] = useState(true);
const [building, setBuilding] = useState(false);
const [deploying, setDeploying] = useState(false);
+ const navigate = useNavigate();
const [showConfigModal, setShowConfigModal] = useState(false);
const [showLogsModal, setShowLogsModal] = useState(false);
const [selectedLog, setSelectedLog] = useState(null);
@@ -130,8 +132,13 @@ const BuildTab = ({ appId, appPath, app }) => {
setError(null);
try {
const result = await api.deployApp(appId, { no_cache: noCache });
+ if (result?.deploy_job_id) {
+ // Async deploy → watch it live on the Deploy Console.
+ navigate(`/deployments/${result.deploy_job_id}`);
+ return;
+ }
if (result.success) {
- toast.success(`Deployment v${result.deployment.version} successful!`);
+ toast.success('Deployment started');
} else {
setError(result.error || 'Deployment failed');
}
diff --git a/frontend/src/pages/ServiceDetail.jsx b/frontend/src/pages/ServiceDetail.jsx
index b4871e65..1f029894 100644
--- a/frontend/src/pages/ServiceDetail.jsx
+++ b/frontend/src/pages/ServiceDetail.jsx
@@ -164,7 +164,12 @@ const ServiceDetail = () => {
}
if (hasBuildConfig) {
- await api.deployApp(service.id);
+ const res = await api.deployApp(service.id);
+ if (res?.deploy_job_id) {
+ // Async deploy → watch it live on the Deploy Console.
+ navigate(`/deployments/${res.deploy_job_id}`);
+ return;
+ }
} else {
await api.triggerAppDeploy(service.id, true);
}
diff --git a/frontend/src/pages/Templates.jsx b/frontend/src/pages/Templates.jsx
index 3099d917..913afe05 100644
--- a/frontend/src/pages/Templates.jsx
+++ b/frontend/src/pages/Templates.jsx
@@ -18,7 +18,6 @@ import {
} from '@/components/ds';
import { useTopbarActions } from '@/hooks/useTopbarActions';
import EmptyState from '../components/EmptyState';
-import DeploymentJobProgress from '../components/DeploymentJobProgress';
// Featured templates (curated list)
const FEATURED_TEMPLATES = [
@@ -935,13 +934,13 @@ const RepoTemplateDetailBody = ({ template, manifest, loading, getCategoryIcon }
const InstallModal = ({ template, onClose, onSuccess }) => {
const toast = useToast();
+ const navigate = useNavigate();
const [appName, setAppName] = useState(template.id.toLowerCase().replace(/[^a-z0-9-]/g, '-'));
const [variables, setVariables] = useState({});
const [servers, setServers] = useState([{ id: 'local', name: 'Local server', is_local: true }]);
const [selectedServerId, setSelectedServerId] = useState('local');
const [installing, setInstalling] = useState(false);
const [errors, setErrors] = useState([]);
- const [jobId, setJobId] = useState(null);
useEffect(() => {
// Initialize variables with defaults
@@ -972,22 +971,10 @@ const InstallModal = ({ template, onClose, onSuccess }) => {
}
}
- function handleJobSuccess(latestJob) {
- setInstalling(false);
- onSuccess(latestJob.result?.app_id || latestJob.app_id);
- }
-
- function handleJobFailure(message) {
- setInstalling(false);
- setErrors([message]);
- toast.error(message);
- }
-
async function handleInstall(e) {
e.preventDefault();
setInstalling(true);
setErrors([]);
- setJobId(null);
try {
// Validate first
@@ -1003,7 +990,9 @@ const InstallModal = ({ template, onClose, onSuccess }) => {
serverId: selectedServerId
});
if (result.success && result.job_id) {
- setJobId(result.job_id);
+ // Job started — hand off to the full-page Deploy Console.
+ onClose?.();
+ navigate(`/deployments/${result.job_id}`);
} else if (result.success) {
setInstalling(false);
onSuccess(result.app_id);
@@ -1102,16 +1091,6 @@ const InstallModal = ({ template, onClose, onSuccess }) => {
</>
)}
- {jobId && (
- <div className="detail-section">
- <h4>Deployment Status</h4>
- <DeploymentJobProgress
- jobId={jobId}
- onSuccess={handleJobSuccess}
- onFailure={handleJobFailure}
- />
- </div>
- )}
</div>
<div className="modal-footer">
<Button type="button" variant="outline" onClick={onClose} disabled={installing}>
diff --git a/frontend/src/pages/new-service/useNewServiceForm.js b/frontend/src/pages/new-service/useNewServiceForm.js
index 59d6b5ac..1a812f22 100644
--- a/frontend/src/pages/new-service/useNewServiceForm.js
+++ b/frontend/src/pages/new-service/useNewServiceForm.js
@@ -538,9 +538,9 @@ export function useNewServiceForm() {
const result = await api.createAppFromRepository(payload);
if (result.deploy_job_id) {
// A deploy job was queued — take the user straight to the
- // Logs tab so they can watch the build/startup live.
+ // full-page Deploy Console to watch the build/startup live.
toast.success('Repository service created — deploying…');
- navigate(`/services/${result.app.id}/logs?deploy_job=${encodeURIComponent(result.deploy_job_id)}`);
+ navigate(`/deployments/${result.deploy_job_id}`);
} else {
toast.success('Repository service created');
toast.warning('Service was created without auto-deploy — start it manually from the service page.');