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.

refactor(drawers,modals): standard width scale + Modal.jsx wrapper

Juan Denis27acadebaf45
diff --git a/frontend/src/components/backups/BackupDetailDrawer.jsx b/frontend/src/components/backups/BackupDetailDrawer.jsx
index bb3350b6..a7bfbf4f 100644
--- a/frontend/src/components/backups/BackupDetailDrawer.jsx
+++ b/frontend/src/components/backups/BackupDetailDrawer.jsx
@@ -11,7 +11,7 @@ export default function BackupDetailDrawer({ run, open, onClose, onRestore, onVe
// No run selected: render an empty Drawer so the close animation still plays.
if (!run) {
return (
- <Drawer open={open} onOpenChange={(v) => !v && onClose()} title="Backup" width={560}>
+ <Drawer open={open} onOpenChange={(v) => !v && onClose()} title="Backup" width={520}>
<div />
</Drawer>
);
@@ -29,7 +29,7 @@ export default function BackupDetailDrawer({ run, open, onClose, onRestore, onVe
title={title}
subtitle={run.kind}
icon={<Archive size={18} />}
- width={560}
+ width={520}
>
<div className="backup-detail-drawer">
<div className="backup-detail-drawer__head">
diff --git a/frontend/src/components/dashboard/grid/WidgetLibrary.jsx b/frontend/src/components/dashboard/grid/WidgetLibrary.jsx
index 506578c3..b55984d3 100644
--- a/frontend/src/components/dashboard/grid/WidgetLibrary.jsx
+++ b/frontend/src/components/dashboard/grid/WidgetLibrary.jsx
@@ -239,7 +239,7 @@ export function WidgetLibrary({ types = [], onAdd, onClose }) {
title="Add a widget"
subtitle={`${types.length} types · drag to reposition after adding`}
icon={<LayoutGrid size={18} />}
- width={700}
+ width={720}
className="skw-lib"
>
<div className="skw-lib__filters">
diff --git a/frontend/src/components/databases/EngineCatalogDrawer.jsx b/frontend/src/components/databases/EngineCatalogDrawer.jsx
index 94c3c5af..825c319d 100644
--- a/frontend/src/components/databases/EngineCatalogDrawer.jsx
+++ b/frontend/src/components/databases/EngineCatalogDrawer.jsx
@@ -182,7 +182,7 @@ export default function EngineCatalogDrawer({
? 'catalog unavailable'
: `${catalog.length} engines · same catalog as Services › Templates`}
icon={<Layers size={18} aria-hidden="true" />}
- width={800}
+ width={720}
className="dbx-drawer"
>
<div className="dbx-drawer__shell">
diff --git a/frontend/src/components/databases/EngineInstallDrawer.jsx b/frontend/src/components/databases/EngineInstallDrawer.jsx
index db911571..2479e1fb 100644
--- a/frontend/src/components/databases/EngineInstallDrawer.jsx
+++ b/frontend/src/components/databases/EngineInstallDrawer.jsx
@@ -256,7 +256,7 @@ export default function EngineInstallDrawer({ entry, open, onOpenChange, onInsta
subtitle={[meta.family, template.id, template.version ? `v${template.version}` : null]
.filter(Boolean).join(' · ')}
icon={<EngineGlyph entry={template} size={20} />}
- width={560}
+ width={520}
className="dbx-drawer"
>
{result ? (
diff --git a/frontend/src/components/monitoring/DoctorPanel.jsx b/frontend/src/components/monitoring/DoctorPanel.jsx
index b3f7ccb9..4c0ad319 100644
--- a/frontend/src/components/monitoring/DoctorPanel.jsx
+++ b/frontend/src/components/monitoring/DoctorPanel.jsx
@@ -2,12 +2,7 @@ import { useEffect, useState } from 'react';
import api from '../../services/api';
import { useToast } from '../../contexts/ToastContext';
import { Button } from '@/components/ui/button';
-import {
- Dialog,
- DialogContent,
- DialogDescription,
- DialogTitle,
-} from '@/components/ui/dialog';
+import Modal from '@/components/Modal';
import { Pill } from '@/components/ds';
import EmptyState from '../EmptyState';
import { ChevronDown, ChevronRight, Stethoscope, Wrench } from 'lucide-react';
@@ -171,27 +166,29 @@ const DoctorPanel = () => {
)}
</section>
- <Dialog open={Boolean(confirm)} onOpenChange={(open) => { if (!open) setConfirm(null); }}>
- <DialogContent className="doctor-confirm">
- <DialogTitle>{confirm?.title}</DialogTitle>
- <DialogDescription>
- This rewrites the managed file(s) from ServerKit&apos;s configuration and
- reloads the affected service. Manual edits to those files will be lost.
- </DialogDescription>
- {confirm?.diff && (
- <pre className="doctor-diff doctor-diff--modal">{confirm.diff}</pre>
- )}
- <div className="doctor-confirm__actions">
- <Button variant="outline" onClick={() => setConfirm(null)} disabled={repairing}>
- Cancel
- </Button>
- <Button onClick={() => doRepair(confirm.items)} disabled={repairing}>
- <Wrench size={14} />
- {repairing ? 'Repairing...' : 'Repair'}
- </Button>
- </div>
- </DialogContent>
- </Dialog>
+ <Modal
+ open={Boolean(confirm)}
+ onClose={() => setConfirm(null)}
+ title={confirm?.title}
+ className="doctor-confirm"
+ >
+ <p className="sk-modal__subtitle">
+ This rewrites the managed file(s) from ServerKit&apos;s configuration and
+ reloads the affected service. Manual edits to those files will be lost.
+ </p>
+ {confirm?.diff && (
+ <pre className="doctor-diff doctor-diff--modal">{confirm.diff}</pre>
+ )}
+ <div className="doctor-confirm__actions">
+ <Button variant="outline" onClick={() => setConfirm(null)} disabled={repairing}>
+ Cancel
+ </Button>
+ <Button onClick={() => doRepair(confirm.items)} disabled={repairing}>
+ <Wrench size={14} />
+ {repairing ? 'Repairing...' : 'Repair'}
+ </Button>
+ </div>
+ </Modal>
</div>
);
};
diff --git a/frontend/src/components/serverdetail/CloudflaredTab.jsx b/frontend/src/components/serverdetail/CloudflaredTab.jsx
index b7344f7c..5b537565 100644
--- a/frontend/src/components/serverdetail/CloudflaredTab.jsx
+++ b/frontend/src/components/serverdetail/CloudflaredTab.jsx
@@ -9,14 +9,7 @@ import { useTableSort } from '@/hooks/useTableSort';
import { useColumnVisibility } from '@/hooks/useColumnVisibility';
import EmptyState from '../EmptyState';
import { Cloud } from 'lucide-react';
-import {
- Dialog,
- DialogContent,
- DialogHeader,
- DialogTitle,
- DialogDescription,
- DialogFooter,
-} from '@/components/ui/dialog';
+import Modal from '@/components/Modal';
import { Label } from '@/components/ui/label';
import {
OfflineIcon,
@@ -367,18 +360,15 @@ const CloudflaredTab = ({ serverId, serverStatus }) => {
)
)}
- <Dialog
+ <Modal
open={showCreateModal}
- onOpenChange={(open) => { if (!open && !creating) setShowCreateModal(false); }}
+ onClose={() => { if (!creating) setShowCreateModal(false); }}
+ title="Create Tunnel"
>
- <DialogContent>
- <DialogHeader>
- <DialogTitle>Create Tunnel</DialogTitle>
- <DialogDescription>
- Provisions a new Cloudflare Tunnel on this server.
- </DialogDescription>
- </DialogHeader>
- <form onSubmit={handleCreate} className="space-y-4">
+ <p className="sk-modal__subtitle">
+ Provisions a new Cloudflare Tunnel on this server.
+ </p>
+ <form onSubmit={handleCreate} className="space-y-4">
<div className="space-y-1.5">
<Label htmlFor="cf-name">Tunnel Name</Label>
<Input
@@ -391,26 +381,22 @@ const CloudflaredTab = ({ serverId, serverStatus }) => {
/>
<p className="text-xs text-muted-foreground">Letters, numbers, dashes, underscores. Up to 32 chars.</p>
</div>
- <DialogFooter>
+ <div className="modal-actions">
<Button type="button" variant="outline" onClick={() => setShowCreateModal(false)} disabled={creating}>Cancel</Button>
<Button type="submit" disabled={creating}>{creating ? 'Creating…' : 'Create'}</Button>
- </DialogFooter>
+ </div>
</form>
- </DialogContent>
- </Dialog>
+ </Modal>
- <Dialog
+ <Modal
open={showRouteModal && !!routeTunnel}
- onOpenChange={(open) => { if (!open && !routing) setShowRouteModal(false); }}
+ onClose={() => { if (!routing) setShowRouteModal(false); }}
+ title={`Route Subdomain${routeTunnel ? ` → ${routeTunnel.name}` : ''}`}
>
- <DialogContent>
- <DialogHeader>
- <DialogTitle>Route Subdomain{routeTunnel ? ` → ${routeTunnel.name}` : ''}</DialogTitle>
- <DialogDescription>
- A CNAME for this hostname will be created in Cloudflare DNS, pointing at the tunnel.
- </DialogDescription>
- </DialogHeader>
- <form onSubmit={handleRoute} className="space-y-4">
+ <p className="sk-modal__subtitle">
+ A CNAME for this hostname will be created in Cloudflare DNS, pointing at the tunnel.
+ </p>
+ <form onSubmit={handleRoute} className="space-y-4">
<div className="space-y-1.5">
<Label htmlFor="cf-host">Hostname</Label>
<Input
@@ -422,13 +408,12 @@ const CloudflaredTab = ({ serverId, serverStatus }) => {
autoFocus
/>
</div>
- <DialogFooter>
+ <div className="modal-actions">
<Button type="button" variant="outline" onClick={() => setShowRouteModal(false)} disabled={routing}>Cancel</Button>
<Button type="submit" disabled={routing}>{routing ? 'Adding…' : 'Add Route'}</Button>
- </DialogFooter>
+ </div>
</form>
- </DialogContent>
- </Dialog>
+ </Modal>
</div>
);
};
diff --git a/frontend/src/components/serverdetail/CronTab.jsx b/frontend/src/components/serverdetail/CronTab.jsx
index 6b7af24b..4cf576ad 100644
--- a/frontend/src/components/serverdetail/CronTab.jsx
+++ b/frontend/src/components/serverdetail/CronTab.jsx
@@ -10,14 +10,7 @@ import { useTableSort } from '@/hooks/useTableSort';
import { useColumnVisibility } from '@/hooks/useColumnVisibility';
import EmptyState from '../EmptyState';
import { Clock3 } from 'lucide-react';
-import {
- Dialog,
- DialogContent,
- DialogHeader,
- DialogTitle,
- DialogDescription,
- DialogFooter,
-} from '@/components/ui/dialog';
+import Modal from '@/components/Modal';
import { Label } from '@/components/ui/label';
import {
Select,
@@ -284,18 +277,15 @@ const CronTab = ({ serverId, serverStatus }) => {
/>
)}
- <Dialog
+ <Modal
open={showAddModal}
- onOpenChange={(open) => { if (!open && !submitting) setShowAddModal(false); }}
+ onClose={() => { if (!submitting) setShowAddModal(false); }}
+ title="Add Cron Job"
>
- <DialogContent>
- <DialogHeader>
- <DialogTitle>Add Cron Job</DialogTitle>
- <DialogDescription>
- Schedule a command on the host crontab. Runs as the agent user.
- </DialogDescription>
- </DialogHeader>
- <form onSubmit={handleSubmit} className="space-y-4">
+ <p className="sk-modal__subtitle">
+ Schedule a command on the host crontab. Runs as the agent user.
+ </p>
+ <form onSubmit={handleSubmit} className="space-y-4">
<div className="space-y-1.5">
<Label htmlFor="cron-name">Name (optional)</Label>
<Input
@@ -345,13 +335,12 @@ const CronTab = ({ serverId, serverStatus }) => {
/>
<p className="text-xs text-muted-foreground">Absolute path. Shell operators (;, &amp;&amp;, |, $(), &gt;, &lt;) are not allowed.</p>
</div>
- <DialogFooter>
+ <div className="modal-actions">
<Button type="button" variant="outline" onClick={() => setShowAddModal(false)} disabled={submitting}>Cancel</Button>
<Button type="submit" disabled={submitting}>{submitting ? 'Adding…' : 'Add Job'}</Button>
- </DialogFooter>
+ </div>
</form>
- </DialogContent>
- </Dialog>
+ </Modal>
</div>
);
};
diff --git a/frontend/src/components/serverdetail/ServerSettingsTab.jsx b/frontend/src/components/serverdetail/ServerSettingsTab.jsx
index 26a41b2e..10f31c0f 100644
--- a/frontend/src/components/serverdetail/ServerSettingsTab.jsx
+++ b/frontend/src/components/serverdetail/ServerSettingsTab.jsx
@@ -7,14 +7,7 @@ import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Textarea } from '@/components/ui/textarea';
import { Pill } from '../ds';
-import {
- Dialog,
- DialogContent,
- DialogHeader,
- DialogTitle,
- DialogDescription,
- DialogFooter,
-} from '@/components/ui/dialog';
+import Modal from '@/components/Modal';
import { Label } from '@/components/ui/label';
import {
Select,
@@ -414,21 +407,37 @@ export const TokenModal = ({ server, onClose, onGenerated }) => {
Install-ServerKitAgent -Server "${window.location.origin}" -Token "${result.registration_token}"` : '';
return (
- <Dialog open onOpenChange={(open) => { if (!open) onClose(); }}>
- <DialogContent className="sm:max-w-2xl max-h-[90vh] overflow-y-auto">
- <DialogHeader>
- <DialogTitle>Connection String</DialogTitle>
- {!result && (
- <DialogDescription>
- Generate a single pasteable string the agent can consume.
- The token inside is single-use — burned the moment any
- agent registers with it.
- </DialogDescription>
- )}
- </DialogHeader>
-
- {!result ? (
- <>
+ <Modal
+ open
+ onClose={onClose}
+ title="Connection String"
+ size="lg"
+ footer={!result ? (
+ <>
+ <Button variant="outline" onClick={onClose}>Cancel</Button>
+ <Button onClick={handleGenerate} disabled={generating}>
+ {generating ? 'Generating…' : 'Generate'}
+ </Button>
+ </>
+ ) : (
+ <>
+ <Button variant="outline" onClick={() => setResult(null)}>
+ Generate another
+ </Button>
+ <Button onClick={onClose}>Done</Button>
+ </>
+ )}
+ >
+ {!result && (
+ <p className="sk-modal__subtitle">
+ Generate a single pasteable string the agent can consume.
+ The token inside is single-use — burned the moment any
+ agent registers with it.
+ </p>
+ )}
+
+ {!result ? (
+ <>
<div className="space-y-2">
<Label htmlFor="token-expires">Token expires</Label>
<Select value={String(expiresIn)} onValueChange={(v) => setExpiresIn(Number(v))}>
@@ -442,13 +451,6 @@ Install-ServerKitAgent -Server "${window.location.origin}" -Token "${result.regi
</SelectContent>
</Select>
</div>
-
- <DialogFooter>
- <Button variant="outline" onClick={onClose}>Cancel</Button>
- <Button onClick={handleGenerate} disabled={generating}>
- {generating ? 'Generating…' : 'Generate'}
- </Button>
- </DialogFooter>
</>
) : (
<>
@@ -501,17 +503,9 @@ Install-ServerKitAgent -Server "${window.location.origin}" -Token "${result.regi
</div>
</div>
</details>
-
- <DialogFooter>
- <Button variant="outline" onClick={() => setResult(null)}>
- Generate another
- </Button>
- <Button onClick={onClose}>Done</Button>
- </DialogFooter>
</>
)}
- </DialogContent>
- </Dialog>
+ </Modal>
);
};
diff --git a/frontend/src/components/settings/WebhooksTab.jsx b/frontend/src/components/settings/WebhooksTab.jsx
index 0448b6d3..7aecd192 100644
--- a/frontend/src/components/settings/WebhooksTab.jsx
+++ b/frontend/src/components/settings/WebhooksTab.jsx
@@ -6,7 +6,7 @@ import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { Textarea } from '@/components/ui/textarea';
import { Badge } from '@/components/ui/badge';
-import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter } from '@/components/ui/dialog';
+import Modal from '@/components/Modal';
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table';
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '@/components/ui/dropdown-menu';
import { useToast } from '../../contexts/ToastContext';
@@ -234,13 +234,9 @@ export default function WebhooksTab() {
</Card>
)}
- <Dialog open={endpointForm.open} onOpenChange={(open) => setEndpointForm({ ...endpointForm, open })}>
- <DialogContent>
- <DialogHeader>
- <DialogTitle>New Webhook Endpoint</DialogTitle>
- <DialogDescription>Create a slug, secret, and optional forward URL.</DialogDescription>
- </DialogHeader>
- <form onSubmit={createEndpoint} className="space-y-4">
+ <Modal open={endpointForm.open} onClose={() => setEndpointForm({ ...endpointForm, open: false })} title="New Webhook Endpoint">
+ <p className="sk-modal__subtitle">Create a slug, secret, and optional forward URL.</p>
+ <form onSubmit={createEndpoint} className="space-y-4">
<div>
<Label htmlFor="epName">Name</Label>
<Input id="epName" value={endpointForm.name} onChange={(e) => setEndpointForm({ ...endpointForm, name: e.target.value })} required />
@@ -257,20 +253,22 @@ export default function WebhooksTab() {
<Label htmlFor="epRetry">Retries</Label>
<Input id="epRetry" type="number" min={0} max={10} value={endpointForm.retry_count} onChange={(e) => setEndpointForm({ ...endpointForm, retry_count: e.target.value })} />
</div>
- <DialogFooter>
+ <div className="modal-actions">
<Button type="submit">Create Endpoint</Button>
- </DialogFooter>
+ </div>
</form>
- </DialogContent>
- </Dialog>
+ </Modal>
- <Dialog open={!!regeneratedSecret} onOpenChange={() => setRegeneratedSecret(null)}>
- <DialogContent>
- <DialogHeader>
- <DialogTitle>Webhook Secret</DialogTitle>
- <DialogDescription>Copy this secret now. It will not be shown again.</DialogDescription>
- </DialogHeader>
- <div className="space-y-2">
+ <Modal
+ open={!!regeneratedSecret}
+ onClose={() => setRegeneratedSecret(null)}
+ title="Webhook Secret"
+ footer={(
+ <Button onClick={() => setRegeneratedSecret(null)}>Done</Button>
+ )}
+ >
+ <p className="sk-modal__subtitle">Copy this secret now. It will not be shown again.</p>
+ <div className="space-y-2">
<Label>Endpoint</Label>
<Input readOnly value={regeneratedSecret?.name || ''} />
<Label>Secret</Label>
@@ -281,11 +279,7 @@ export default function WebhooksTab() {
</Button>
</div>
</div>
- <DialogFooter>
- <Button onClick={() => setRegeneratedSecret(null)}>Done</Button>
- </DialogFooter>
- </DialogContent>
- </Dialog>
+ </Modal>
</div>
);
}
diff --git a/frontend/src/pages/ProjectDetail.jsx b/frontend/src/pages/ProjectDetail.jsx
index 47dce9ff..3ebc0b38 100644
--- a/frontend/src/pages/ProjectDetail.jsx
+++ b/frontend/src/pages/ProjectDetail.jsx
@@ -19,14 +19,7 @@ import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { Badge } from '@/components/ui/badge';
-import {
- Dialog,
- DialogContent,
- DialogHeader,
- DialogTitle,
- DialogDescription,
- DialogFooter,
-} from '@/components/ui/dialog';
+import Modal from '@/components/Modal';
const ProjectDetail = () => {
const { id } = useParams();
@@ -331,17 +324,13 @@ const CreateEnvironmentDialog = ({ projectId, open, onOpenChange, onCreated }) =
}
return (
- <Dialog open={open} onOpenChange={(v) => { if (!v) setName(''); onOpenChange(v); }}>
- <DialogContent>
- <form onSubmit={handleSubmit}>
- <DialogHeader>
- <DialogTitle>New Environment</DialogTitle>
- <DialogDescription>
- Common names are production, staging, and development — but any name works.
- </DialogDescription>
- </DialogHeader>
+ <Modal open={open} onClose={() => { setName(''); onOpenChange(false); }} title="New Environment">
+ <form onSubmit={handleSubmit}>
+ <p className="sk-modal__subtitle">
+ Common names are production, staging, and development — but any name works.
+ </p>
- <div className="projects-form">
+ <div className="projects-form">
<div className="projects-form__field">
<Label htmlFor="env-name">Name</Label>
<Input
@@ -355,17 +344,16 @@ const CreateEnvironmentDialog = ({ projectId, open, onOpenChange, onCreated }) =
</div>
</div>
- <DialogFooter>
+ <div className="modal-actions">
<Button type="button" variant="outline" onClick={() => onOpenChange(false)}>
Cancel
</Button>
<Button type="submit" disabled={submitting || !name.trim()}>
{submitting ? 'Creating…' : 'Create Environment'}
</Button>
- </DialogFooter>
+ </div>
</form>
- </DialogContent>
- </Dialog>
+ </Modal>
);
};
diff --git a/frontend/src/pages/Projects.jsx b/frontend/src/pages/Projects.jsx
index 2efdab30..203a84fa 100644
--- a/frontend/src/pages/Projects.jsx
+++ b/frontend/src/pages/Projects.jsx
@@ -9,14 +9,7 @@ import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { Textarea } from '@/components/ui/textarea';
-import {
- Dialog,
- DialogContent,
- DialogHeader,
- DialogTitle,
- DialogDescription,
- DialogFooter,
-} from '@/components/ui/dialog';
+import Modal from '@/components/Modal';
const Projects = () => {
const [projects, setProjects] = useState([]);
@@ -149,18 +142,14 @@ const CreateProjectDialog = ({ open, onOpenChange, onCreated }) => {
}
return (
- <Dialog open={open} onOpenChange={(v) => { if (!v) reset(); onOpenChange(v); }}>
- <DialogContent>
- <form onSubmit={handleSubmit}>
- <DialogHeader>
- <DialogTitle>New Project</DialogTitle>
- <DialogDescription>
- A project groups your applications. It starts with a default
- &quot;production&quot; environment you can rename or expand.
- </DialogDescription>
- </DialogHeader>
+ <Modal open={open} onClose={() => { reset(); onOpenChange(false); }} title="New Project">
+ <form onSubmit={handleSubmit}>
+ <p className="sk-modal__subtitle">
+ A project groups your applications. It starts with a default
+ &quot;production&quot; environment you can rename or expand.
+ </p>
- <div className="projects-form">
+ <div className="projects-form">
<div className="projects-form__field">
<Label htmlFor="project-name">Name</Label>
<Input
@@ -184,17 +173,16 @@ const CreateProjectDialog = ({ open, onOpenChange, onCreated }) => {
</div>
</div>
- <DialogFooter>
+ <div className="modal-actions">
<Button type="button" variant="outline" onClick={() => onOpenChange(false)}>
Cancel
</Button>
<Button type="submit" disabled={submitting || !name.trim()}>
{submitting ? 'Creating…' : 'Create Project'}
</Button>
- </DialogFooter>
+ </div>
</form>
- </DialogContent>
- </Dialog>
+ </Modal>
);
};
diff --git a/frontend/src/pages/Services.jsx b/frontend/src/pages/Services.jsx
index 856cb41a..2c38c629 100644
--- a/frontend/src/pages/Services.jsx
+++ b/frontend/src/pages/Services.jsx
@@ -19,14 +19,7 @@ import {
SelectTrigger,
SelectValue,
} from '@/components/ui/select';
-import {
- Dialog,
- DialogContent,
- DialogHeader,
- DialogTitle,
- DialogDescription,
- DialogFooter,
-} from '@/components/ui/dialog';
+import Modal from '@/components/Modal';
import RequiresDocker from '../components/RequiresDocker';
const STATUS_PILL = { running: 'green', stopped: 'gray', deploying: 'amber', building: 'amber', failed: 'red' };
@@ -524,17 +517,27 @@ const MoveToProjectDialog = ({ open, onOpenChange, count, onMove }) => {
}
return (
- <Dialog open={open} onOpenChange={onOpenChange}>
- <DialogContent>
- <DialogHeader>
- <DialogTitle>Move to project</DialogTitle>
- <DialogDescription>
- Assign {count} selected service{count === 1 ? '' : 's'} to a project and
- environment, or leave them unassigned.
- </DialogDescription>
- </DialogHeader>
+ <Modal
+ open={open}
+ onClose={() => onOpenChange(false)}
+ title="Move to project"
+ footer={(
+ <>
+ <Button type="button" variant="outline" onClick={() => onOpenChange(false)}>
+ Cancel
+ </Button>
+ <Button type="button" onClick={handleSubmit} disabled={submitting || loadingProjects}>
+ {submitting ? 'Moving…' : (projectValue === UNASSIGN ? 'Unassign' : 'Move')}
+ </Button>
+ </>
+ )}
+ >
+ <p className="sk-modal__subtitle">
+ Assign {count} selected service{count === 1 ? '' : 's'} to a project and
+ environment, or leave them unassigned.
+ </p>
- <div className="services-move">
+ <div className="services-move">
<div className="services-move__field">
<Label htmlFor="move-project">Project</Label>
<Select value={projectValue} onValueChange={handleProjectChange} disabled={loadingProjects}>
@@ -567,17 +570,7 @@ const MoveToProjectDialog = ({ open, onOpenChange, count, onMove }) => {
</div>
)}
</div>
-
- <DialogFooter>
- <Button type="button" variant="outline" onClick={() => onOpenChange(false)}>
- Cancel
- </Button>
- <Button type="button" onClick={handleSubmit} disabled={submitting || loadingProjects}>
- {submitting ? 'Moving…' : (projectValue === UNASSIGN ? 'Unassign' : 'Move')}
- </Button>
- </DialogFooter>
- </DialogContent>
- </Dialog>
+ </Modal>
);
};
diff --git a/frontend/src/pages/Templates.jsx b/frontend/src/pages/Templates.jsx
index 75848c2f..30a4d7c9 100644
--- a/frontend/src/pages/Templates.jsx
+++ b/frontend/src/pages/Templates.jsx
@@ -890,7 +890,7 @@ const InstallModal = ({ template, onClose, onSuccess, renderIcon }) => {
title={`Deploy ${template.name}`}
subtitle={[`v${template.version}`, ...(template.categories || []).slice(0, 3)].join(' · ')}
icon={renderIcon(template, 20)}
- width={560}
+ width={520}
className="sk-formdrawer"
>
<form onSubmit={handleInstall} className="sk-formdrawer__form">
diff --git a/frontend/src/pages/Vaults.jsx b/frontend/src/pages/Vaults.jsx
index 21204704..37f09187 100644
--- a/frontend/src/pages/Vaults.jsx
+++ b/frontend/src/pages/Vaults.jsx
@@ -6,7 +6,7 @@ import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { Textarea } from '@/components/ui/textarea';
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
-import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter } from '@/components/ui/dialog';
+import Modal from '@/components/Modal';
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table';
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '@/components/ui/dropdown-menu';
import { useToast } from '../contexts/ToastContext';
@@ -253,13 +253,9 @@ export default function Vaults() {
</Card>
)}
- <Dialog open={vaultForm.open} onOpenChange={(open) => setVaultForm({ ...vaultForm, open })}>
- <DialogContent>
- <DialogHeader>
- <DialogTitle>New Vault</DialogTitle>
- <DialogDescription>Create an encrypted vault to group secrets.</DialogDescription>
- </DialogHeader>
- <form onSubmit={createVault} className="space-y-4">
+ <Modal open={vaultForm.open} onClose={() => setVaultForm({ ...vaultForm, open: false })} title="New Vault">
+ <p className="sk-modal__subtitle">Create an encrypted vault to group secrets.</p>
+ <form onSubmit={createVault} className="space-y-4">
<div>
<Label htmlFor="vaultName">Name</Label>
<Input id="vaultName" value={vaultForm.name} onChange={(e) => setVaultForm({ ...vaultForm, name: e.target.value })} required />
@@ -287,20 +283,15 @@ export default function Vaults() {
</Select>
</div>
)}
- <DialogFooter>
+ <div className="modal-actions">
<Button type="submit">Create Vault</Button>
- </DialogFooter>
+ </div>
</form>
- </DialogContent>
- </Dialog>
+ </Modal>
- <Dialog open={secretForm.open} onOpenChange={(open) => setSecretForm({ ...secretForm, open })}>
- <DialogContent>
- <DialogHeader>
- <DialogTitle>Add Secret</DialogTitle>
- <DialogDescription>Add an encrypted secret to {selectedVault?.name}.</DialogDescription>
- </DialogHeader>
- <form onSubmit={createSecret} className="space-y-4">
+ <Modal open={secretForm.open} onClose={() => setSecretForm({ ...secretForm, open: false })} title="Add Secret">
+ <p className="sk-modal__subtitle">Add an encrypted secret to {selectedVault?.name}.</p>
+ <form onSubmit={createSecret} className="space-y-4">
<div>
<Label htmlFor="secretName">Name</Label>
<Input id="secretName" value={secretForm.name} onChange={(e) => setSecretForm({ ...secretForm, name: e.target.value })} required />
@@ -313,12 +304,11 @@ export default function Vaults() {
<Label htmlFor="secretDesc">Description</Label>
<Textarea id="secretDesc" value={secretForm.description} onChange={(e) => setSecretForm({ ...secretForm, description: e.target.value })} />
</div>
- <DialogFooter>
+ <div className="modal-actions">
<Button type="submit">Save Secret</Button>
- </DialogFooter>
+ </div>
</form>
- </DialogContent>
- </Dialog>
+ </Modal>
</div>
);
}