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.

Move app, database and Docker panels onto shared fields

Juan Denis1186594989a0
diff --git a/frontend/src/components/appdetail/BuildTab.jsx b/frontend/src/components/appdetail/BuildTab.jsx
index 366983df..992687d4 100644
--- a/frontend/src/components/appdetail/BuildTab.jsx
+++ b/frontend/src/components/appdetail/BuildTab.jsx
@@ -8,6 +8,7 @@ import { InfoList, InfoItem } from '../InfoList';
import BuildpackPreview from '../buildpack/BuildpackPreview';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
+import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from '@/components/ui/select';
import { Pill, statusKind } from '@/components/ds';
import Modal from '@/components/Modal';
import { useTranslation } from 'react-i18next';
@@ -293,16 +294,19 @@ const BuildTab = ({ appId, app }) => {
<Modal open={showConfigModal} onClose={() => setShowConfigModal(false)} title={t('app.buildTab.buildConfiguration', 'Build Configuration')}>
<form onSubmit={handleConfigureBuild}>
<div className="form-group">
- <label>{t('app.buildTab.buildMethod', 'Build Method')}</label>
- <select
+ <label htmlFor="build-config-method">{t('app.buildTab.buildMethod', 'Build Method')}</label>
+ <Select
value={configForm.buildMethod}
- onChange={e => setConfigForm({...configForm, buildMethod: e.target.value})}
+ onValueChange={value => setConfigForm({...configForm, buildMethod: value})}
>
- <option value="auto">{t('app.buildTab.autoDetect', 'Auto-detect')}</option>
- <option value="dockerfile">{t('app.buildTab.dockerfile2', 'Dockerfile')}</option>
- <option value="docker-compose">{t('app.buildTab.dockerCompose2', 'Docker Compose')}</option>
- <option value="custom">{t('app.buildTab.custom', 'Custom')}</option>
- </select>
+ <SelectTrigger id="build-config-method"><SelectValue /></SelectTrigger>
+ <SelectContent>
+ <SelectItem value="auto">{t('app.buildTab.autoDetect', 'Auto-detect')}</SelectItem>
+ <SelectItem value="dockerfile">{t('app.buildTab.dockerfile2', 'Dockerfile')}</SelectItem>
+ <SelectItem value="docker-compose">{t('app.buildTab.dockerCompose2', 'Docker Compose')}</SelectItem>
+ <SelectItem value="custom">{t('app.buildTab.custom', 'Custom')}</SelectItem>
+ </SelectContent>
+ </Select>
</div>
{configForm.buildMethod === 'dockerfile' && (
<div className="form-group">
diff --git a/frontend/src/components/appdetail/SettingsTab.jsx b/frontend/src/components/appdetail/SettingsTab.jsx
index 64a3e7b4..ef2582e4 100644
--- a/frontend/src/components/appdetail/SettingsTab.jsx
+++ b/frontend/src/components/appdetail/SettingsTab.jsx
@@ -4,6 +4,7 @@ import api from '../../services/api';
import { useConfirm } from '../../hooks/useConfirm';
import { DangerZone } from '../DangerZone';
import { Button } from '@/components/ui/button';
+import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from '@/components/ui/select';
import { EnvTag } from '@/components/ds';
import { useTranslation } from 'react-i18next';
import { Card as SharedCard } from '@/components/ui/card';
@@ -103,17 +104,21 @@ const SettingsTab = ({ app, onUpdate }) => {
{envLabels[app.environment_type] || app.environment_type}
</EnvTag>
) : (
- <select
+ <Select
value={environmentType}
- onChange={(e) => handleEnvironmentChange(e.target.value)}
+ onValueChange={handleEnvironmentChange}
disabled={savingEnvironment}
- className="settings-select"
>
- <option value="standalone">{t('app.settingsTab.standalone', 'Standalone')}</option>
- <option value="development">{t('app.settingsTab.development', 'Development')}</option>
- <option value="staging">{t('app.settingsTab.staging', 'Staging')}</option>
- <option value="production">{t('app.settingsTab.production', 'Production')}</option>
- </select>
+ <SelectTrigger className="settings-select" aria-label={t('app.settingsTab.environmentType', 'Environment Type')}>
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ <SelectItem value="standalone">{t('app.settingsTab.standalone', 'Standalone')}</SelectItem>
+ <SelectItem value="development">{t('app.settingsTab.development', 'Development')}</SelectItem>
+ <SelectItem value="staging">{t('app.settingsTab.staging', 'Staging')}</SelectItem>
+ <SelectItem value="production">{t('app.settingsTab.production', 'Production')}</SelectItem>
+ </SelectContent>
+ </Select>
)}
{savingEnvironment && <span className="settings-saving">{t('common.editing.saving', 'Saving…')}</span>}
</div>
diff --git a/frontend/src/components/apps/ContainerOpsPanel.jsx b/frontend/src/components/apps/ContainerOpsPanel.jsx
index 3936f336..c0a3e932 100644
--- a/frontend/src/components/apps/ContainerOpsPanel.jsx
+++ b/frontend/src/components/apps/ContainerOpsPanel.jsx
@@ -10,6 +10,8 @@ import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { Switch } from '@/components/ui/switch';
+import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from '@/components/ui/select';
+import { InfoList, InfoItem } from '../InfoList';
import { useTranslation } from 'react-i18next';
// Short SHA helper for image digests (handles "sha256:abcdef..." or bare hashes)
@@ -20,6 +22,9 @@ function shortDigest(digest) {
}
+// Radix Select items cannot carry an empty value; this stands for "no registry".
+const NO_REGISTRY = '__none';
+
function formatStatusLabel(status) {
if (!status) return 'Not checked';
return status.replace(/_/g, ' ').replace(/\b\w/g, (c) => c.toUpperCase());
@@ -118,22 +123,14 @@ const ImageUpdateSection = ({ app, onChanged }) => {
</p>
)}
- <div className="app-info-grid container-ops__digests">
- <div className="app-info-item">
- <span className="app-info-label">{t('app.containerOpsPanel.currentDigest', 'Current digest')}</span>
- <span className="app-info-value mono">{shortDigest(info?.current_digest)}</span>
- </div>
- <div className="app-info-item">
- <span className="app-info-label">{t('app.containerOpsPanel.latestDigest', 'Latest digest')}</span>
- <span className="app-info-value mono">{shortDigest(info?.latest_digest)}</span>
- </div>
- <div className="app-info-item">
- <span className="app-info-label">{t('app.containerOpsPanel.lastChecked', 'Last checked')}</span>
- <span className="app-info-value">
- {checkedAt ? new Date(checkedAt).toLocaleString() : 'Never'}
- </span>
- </div>
- </div>
+ <InfoList className="container-ops__digests">
+ <InfoItem label={t('app.containerOpsPanel.currentDigest', 'Current digest')} value={shortDigest(info?.current_digest)} mono />
+ <InfoItem label={t('app.containerOpsPanel.latestDigest', 'Latest digest')} value={shortDigest(info?.latest_digest)} mono />
+ <InfoItem
+ label={t('app.containerOpsPanel.lastChecked', 'Last checked')}
+ value={checkedAt ? new Date(checkedAt).toLocaleString() : 'Never'}
+ />
+ </InfoList>
<div className="app-detail-actions container-ops__actions">
<Button variant="outline" size="sm" onClick={handleCheck} disabled={checking}>
@@ -214,20 +211,23 @@ const RegistrySection = ({ app, onChanged }) => {
{t('app.containerOpsPanel.publicImagesPullAnonymouslyPickA', 'Public images pull anonymously; pick a registry for private images.')}
</span>
</div>
- <select
- id={`registry-${app.id}`}
- className="container-ops__select"
- value={selected}
- onChange={(e) => handleChange(e.target.value)}
+ <Select
+ value={selected === '' || selected == null ? NO_REGISTRY : String(selected)}
+ onValueChange={(value) => handleChange(value === NO_REGISTRY ? '' : value)}
disabled={loading || saving}
>
- <option value="">{t('app.containerOpsPanel.publicNoAuth', 'Public (no auth)')}</option>
- {registries.map((r) => (
- <option key={r.id} value={r.id}>
- {r.name} · {r.login_host}
- </option>
- ))}
- </select>
+ <SelectTrigger id={`registry-${app.id}`} className="container-ops__select">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ <SelectItem value={NO_REGISTRY}>{t('app.containerOpsPanel.publicNoAuth', 'Public (no auth)')}</SelectItem>
+ {registries.map((r) => (
+ <SelectItem key={r.id} value={String(r.id)}>
+ {r.name} · {r.login_host}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
</div>
</div>
</div>
diff --git a/frontend/src/components/backups/AddScheduleModal.jsx b/frontend/src/components/backups/AddScheduleModal.jsx
index acfb84af..6b6cf077 100644
--- a/frontend/src/components/backups/AddScheduleModal.jsx
+++ b/frontend/src/components/backups/AddScheduleModal.jsx
@@ -3,6 +3,7 @@ import Modal from '@/components/Modal';
import { FormField } from '@/components/FormField';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
+import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from '@/components/ui/select';
import useForm from '@/hooks/useForm';
export default function AddScheduleModal({ open, onClose, onCreate, onCreated, remoteEnabled, timezone }) {
@@ -29,11 +30,20 @@ export default function AddScheduleModal({ open, onClose, onCreate, onCreated, r
<Input id="backup-schedule-name" type="text" {...form.getFieldProps('name')} placeholder={t('app.backups.dailyAppBackup', 'Daily App Backup')} required />
</FormField>
<FormField htmlFor="backup-schedule-type" label={t('app.backups.backupType', 'Backup Type')} error={form.getFieldError('backupType')}>
- <select id="backup-schedule-type" {...form.getFieldProps('backupType')}>
- <option value="application">{t('app.backups.application', 'Application')}</option>
- <option value="database">{t('app.backups.database', 'Database')}</option>
- <option value="files">{t('app.backups.filesDirectories', 'Files / Directories')}</option>
- </select>
+ <Select
+ name="backupType"
+ value={form.values.backupType}
+ onValueChange={(value) => form.setValue('backupType', value, { touch: true })}
+ >
+ <SelectTrigger id="backup-schedule-type" aria-invalid={Boolean(form.getFieldError('backupType'))}>
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ <SelectItem value="application">{t('app.backups.application', 'Application')}</SelectItem>
+ <SelectItem value="database">{t('app.backups.database', 'Database')}</SelectItem>
+ <SelectItem value="files">{t('app.backups.filesDirectories', 'Files / Directories')}</SelectItem>
+ </SelectContent>
+ </Select>
</FormField>
<FormField htmlFor="backup-schedule-target" label={targetLabel} error={form.getFieldError('target')} required>
<Input id="backup-schedule-target" type="text" {...form.getFieldProps('target')} placeholder={form.values.backupType === 'files' ? '/etc/nginx,/var/www/config' : form.values.backupType === 'database' ? 'mysql:mydb' : 'my-app'} required />
diff --git a/frontend/src/components/buildpack/BuildpackPreview.jsx b/frontend/src/components/buildpack/BuildpackPreview.jsx
index 311281fb..5f171bde 100644
--- a/frontend/src/components/buildpack/BuildpackPreview.jsx
+++ b/frontend/src/components/buildpack/BuildpackPreview.jsx
@@ -2,6 +2,7 @@ import { useMemo, useState } from 'react';
import { Boxes, ChevronDown, FileCode2, Layers, Terminal, Zap } from 'lucide-react';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
+import PortField from '@/components/PortField';
import { useTranslation } from 'react-i18next';
import { Button as SharedButton } from '@/components/ui/button';
@@ -145,14 +146,13 @@ function BuildpackPreview({ plan, dockerfile, overrides = {}, onChange, loading
)}
<div className="buildpack-preview__field">
<Label htmlFor="bp-port">{t('common.labels.port', 'Port')}</Label>
- <Input
+ {/* The port the app listens on inside its container. */}
+ <PortField
id="bp-port"
- type="number"
+ host={false}
value={portValue}
- onChange={(e) => emit('port', e.target.value)}
+ onChange={(next) => emit('port', next === '' ? '' : String(next))}
placeholder={String(plan.port || '')}
- min="1"
- max="65535"
/>
</div>
<div className="buildpack-preview__field buildpack-preview__field--wide">
diff --git a/frontend/src/components/databases/CreateTableModal.jsx b/frontend/src/components/databases/CreateTableModal.jsx
index 8356301c..75582ede 100644
--- a/frontend/src/components/databases/CreateTableModal.jsx
+++ b/frontend/src/components/databases/CreateTableModal.jsx
@@ -1,6 +1,6 @@
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import {
- Plus, Trash2, Copy, Check, AlertTriangle, Loader2, Table2, ShieldAlert, RefreshCw, ChevronDown,
+ Plus, Trash2, Check, AlertTriangle, Loader2, Table2, ShieldAlert, RefreshCw,
} from 'lucide-react';
import api from '../../services/api';
import Modal from '@/components/Modal';
@@ -8,7 +8,8 @@ import { Button } from '@/components/ui/button';
import { EngineIcon } from '../icons/DatabaseBrands';
import EngineGlyph from './EngineGlyph';
import { runQuery, connKey, ENGINE_META } from './dbAdapter';
-import { copyToClipboard } from '@/utils/clipboard';
+import { CopyButton } from '@/components/CopyButton';
+import { Select, SelectTrigger, SelectContent, SelectGroup, SelectLabel, SelectItem, SelectValue } from '@/components/ui/select';
import { useTranslation } from 'react-i18next';
import {
engineBrandKey, engineInitialDatabase, engineInstanceKey, engineMeta,
@@ -34,7 +35,6 @@ import {
// * a non-admin operator → the builder still generates and copies, and says
// why it will not run.
-const COPY_RESET_MS = 1800;
function targetFromConn(conn, engine, label, sub) {
const dialect = dialectOf(conn);
@@ -86,8 +86,6 @@ export default function CreateTableModal({ preset, engines = [], isAdmin = false
const [cols, setCols] = useState([]);
const [busy, setBusy] = useState(false);
const [result, setResult] = useState(null); // { ok, message }
- const [copied, setCopied] = useState(false);
- const copyTimer = useRef(null);
// The page re-polls its engine list while an install is in flight, so the
// props change under us. Read them through refs: reloading the target list
@@ -97,8 +95,6 @@ export default function CreateTableModal({ preset, engines = [], isAdmin = false
const presetRef = useRef(preset);
presetRef.current = preset;
- useEffect(() => () => clearTimeout(copyTimer.current), []);
-
// The four listings the explorer's tree is built from. Each one is allowed
// to fail on its own — a stopped PostgreSQL must not hide a running MySQL.
const load = useCallback(async () => {
@@ -238,27 +234,23 @@ export default function CreateTableModal({ preset, engines = [], isAdmin = false
}
}
- function copy() {
- copyToClipboard(statement).then((ok) => {
- if (!ok) {
- setResult({ ok: false, messageKey: 'app.createTableModal.couldNotCopyToTheClipboard', message: 'Could not copy to the clipboard.' });
- return;
- }
- setCopied(true);
- clearTimeout(copyTimer.current);
- copyTimer.current = setTimeout(() => setCopied(false), COPY_RESET_MS);
- });
- }
const footer = (
<>
<Button type="button" variant="outline" onClick={onClose}>
{result?.ok ? 'Done' : 'Cancel'}
</Button>
- <Button type="button" variant="outline" onClick={copy} disabled={!statement}>
- {copied ? <Check size={14} aria-hidden="true" /> : <Copy size={14} aria-hidden="true" />}
- {copied ? 'Copied' : 'Copy statement'}
- </Button>
+ {statement && (
+ <CopyButton
+ value={statement}
+ variant="outline"
+ size="default"
+ label={t('app.createTableModal.copyStatement', 'Copy statement')}
+ copiedLabel={t('app.copyField.copied', 'Copied')}
+ >
+ {t('app.createTableModal.copyStatement', 'Copy statement')}
+ </CopyButton>
+ )}
{canRun && (
<Button type="button" onClick={run} disabled={busy || issues.length > 0}>
{busy
@@ -303,29 +295,29 @@ export default function CreateTableModal({ preset, engines = [], isAdmin = false
<div className="dbx-field-row">
<div className="dbx-field">
<label className="dbx-field__label" htmlFor="dbx-builder-target">{t('app.createTableModal.database', 'Database')}</label>
- <div className="dbx-select">
- <select
- id="dbx-builder-target"
- value={targetKey}
- onChange={(e) => setTargetKey(e.target.value)}
- >
- {targets.some((t) => t.dialect) && (
- <optgroup label={t('app.createTableModal.databasesServerkitCanWriteTo', 'Databases ServerKit can write to')}>
- {targets.filter((t) => t.dialect).map((t) => (
- <option key={t.key} value={t.key}>{t.label} · {t.sub}</option>
+ <Select value={targetKey} onValueChange={setTargetKey}>
+ <SelectTrigger id="dbx-builder-target" className="dbx-select">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {targets.some((row) => row.dialect) && (
+ <SelectGroup>
+ <SelectLabel>{t('app.createTableModal.databasesServerkitCanWriteTo', 'Databases ServerKit can write to')}</SelectLabel>
+ {targets.filter((row) => row.dialect).map((row) => (
+ <SelectItem key={row.key} value={row.key}>{row.label} · {row.sub}</SelectItem>
))}
- </optgroup>
+ </SelectGroup>
)}
- {targets.some((t) => !t.dialect) && (
- <optgroup label={t('app.createTableModal.generateOnlyNoClientBridge', 'Generate only — no client bridge')}>
- {targets.filter((t) => !t.dialect).map((t) => (
- <option key={t.key} value={t.key}>{t.label} · {t.sub}</option>
+ {targets.some((row) => !row.dialect) && (
+ <SelectGroup>
+ <SelectLabel>{t('app.createTableModal.generateOnlyNoClientBridge', 'Generate only — no client bridge')}</SelectLabel>
+ {targets.filter((row) => !row.dialect).map((row) => (
+ <SelectItem key={row.key} value={row.key}>{row.label} · {row.sub}</SelectItem>
))}
- </optgroup>
+ </SelectGroup>
)}
- </select>
- <ChevronDown size={14} aria-hidden="true" />
- </div>
+ </SelectContent>
+ </Select>
</div>
<div className="dbx-field">
<label className="dbx-field__label" htmlFor="dbx-builder-name">
@@ -403,16 +395,17 @@ export default function CreateTableModal({ preset, engines = [], isAdmin = false
aria-label={t('app.createTableModal.nameOfColumn', 'Name of column {{value}}', { value: i + 1 })}
/>
</div>
- <div className="dbx-select dbx-select--sm">
- <select
- value={c.type}
- onChange={(e) => setCol(i, 'type', e.target.value)}
+ <Select value={c.type} onValueChange={(value) => setCol(i, 'type', value)}>
+ <SelectTrigger
+ className="dbx-select dbx-select--sm"
aria-label={t('app.createTableModal.typeOfColumn', 'Type of column {{value}}', { value: i + 1 })}
>
- {types.map((t) => <option key={t} value={t}>{t}</option>)}
- </select>
- <ChevronDown size={12} aria-hidden="true" />
- </div>
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {types.map((type) => <SelectItem key={type} value={type}>{type}</SelectItem>)}
+ </SelectContent>
+ </Select>
<Button variant="unstyled"
type="button"
className={`dbx-cbox${c.pk ? ' is-on' : ''}`}
diff --git a/frontend/src/components/databases/DbUsersPanel.jsx b/frontend/src/components/databases/DbUsersPanel.jsx
index fbbd803e..595502cb 100644
--- a/frontend/src/components/databases/DbUsersPanel.jsx
+++ b/frontend/src/components/databases/DbUsersPanel.jsx
@@ -1,10 +1,10 @@
import { useState, useEffect, useCallback } from 'react';
-import { Copy, Plus, Trash2, UserRound } from 'lucide-react';
+import { Plus, Trash2, UserRound } from 'lucide-react';
import api from '../../services/api';
import { useToast } from '../../contexts/useToast.js';
import { useConfirm } from '../../hooks/useConfirm';
import { Button } from '@/components/ui/button';
-import { copyToClipboard } from '@/utils/clipboard';
+import CopyField from '@/components/CopyField';
import { useTranslation } from 'react-i18next';
// Users ServerKit created on a managed database (tracked rows merged with the
@@ -72,24 +72,21 @@ export default function DbUsersPanel({ databaseId }) {
}
}
- async function copySecret() {
- if (oneTimeSecret && await copyToClipboard(oneTimeSecret.password)) {
- toast.success(t('app.dbUsersPanel.passwordCopied', 'Password copied'));
- }
- }
return (
<div className="managed-db__users">
{oneTimeSecret && (
<div className="managed-db__secret">
<span className="managed-db__meta">
- {t('app.dbUsersPanel.passwordFor', 'Password for')} <strong>{oneTimeSecret.username}</strong>:{' '}
- <code>{oneTimeSecret.password}</code> {t('app.dbUsersPanel.shownOnceSaveItNow', '— shown once, save it now.')}
+ {t('app.dbUsersPanel.passwordFor', 'Password for')} <strong>{oneTimeSecret.username}</strong>{' '}
+ {t('app.dbUsersPanel.shownOnceSaveItNow', '— shown once, save it now.')}
</span>
+ <CopyField
+ value={oneTimeSecret.password}
+ secret
+ onCopy={() => toast.success(t('app.dbUsersPanel.passwordCopied', 'Password copied'))}
+ />
<div className="managed-db__actions">
- <Button type="button" size="sm" variant="outline" onClick={copySecret}>
- <Copy size={14} /> {t('common.actions.copy', 'Copy')}
- </Button>
<Button type="button" size="sm" variant="ghost"
onClick={() => setOneTimeSecret(null)}>
{t('common.actions.dismiss', 'Dismiss')}
diff --git a/frontend/src/components/databases/EngineInstallDrawer.jsx b/frontend/src/components/databases/EngineInstallDrawer.jsx
index 376805f5..65d216e2 100644
--- a/frontend/src/components/databases/EngineInstallDrawer.jsx
+++ b/frontend/src/components/databases/EngineInstallDrawer.jsx
@@ -1,7 +1,7 @@
import { useEffect, useMemo, useState } from 'react';
import { useNavigate } from 'react-router-dom';
import {
- Box, Share2, Database, Rocket, Eye, EyeOff, RefreshCw, Copy, ShieldAlert,
+ Box, Database, Rocket, RefreshCw, ShieldAlert,
CheckCircle2, HardDrive, RotateCw, Terminal,
} from 'lucide-react';
import api from '../../services/api';
@@ -11,7 +11,10 @@ import { Input } from '@/components/ui/input';
import { Switch } from '@/components/ui/switch';
import { useToast } from '../../contexts/useToast.js';
import EngineGlyph from './EngineGlyph';
-import { copyToClipboard } from '@/utils/clipboard';
+import CopyField from '@/components/CopyField';
+import PortField from '@/components/PortField';
+import { InfoList, InfoItem } from '@/components/InfoList';
+import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from '@/components/ui/select';
import { useTranslation } from 'react-i18next';
import {
engineMeta, engineVersions, generatePassword, partitionVariables, seedVariables,
@@ -37,49 +40,26 @@ import {
function SecretRow({ password, onRegenerate, disabled }) {
const { t } = useTranslation();
const toast = useToast();
- const [revealed, setRevealed] = useState(false);
-
- const copy = () => {
- copyToClipboard(password).then((ok) => (ok
- ? toast.success(t('app.engineInstallDrawer.passwordCopied', 'Password copied'))
- : toast.error(t('app.engineInstallDrawer.couldNotCopyThePassword', 'Could not copy the password'))));
- };
return (
<div className="dbx-secret">
- <span className="dbx-secret__value">{revealed ? password : '•'.repeat(20)}</span>
- <span className="dbx-secret__actions">
+ <CopyField
+ value={password}
+ secret
+ onCopy={() => toast.success(t('app.engineInstallDrawer.passwordCopied', 'Password copied'))}
+ />
+ {onRegenerate && (
<Button variant="unstyled"
type="button"
className="dbx-icon-xs"
- onClick={() => setRevealed((r) => !r)}
- aria-label={revealed ? t('app.engineInstallDrawer.hidePassword', 'Hide password') : t('app.engineInstallDrawer.revealPassword', 'Reveal password')}
- title={revealed ? t('app.engineInstallDrawer.hide', 'Hide') : t('app.engineInstallDrawer.reveal', 'Reveal')}
+ onClick={onRegenerate}
+ disabled={disabled}
+ aria-label={t('app.engineInstallDrawer.generateANewPassword', 'Generate a new password')}
+ title={t('app.engineInstallDrawer.regenerate', 'Regenerate')}
>
- {revealed ? <EyeOff size={13} aria-hidden="true" /> : <Eye size={13} aria-hidden="true" />}
+ <RefreshCw size={13} aria-hidden="true" />
</Button>
- {onRegenerate && (
- <Button variant="unstyled"
- type="button"
- className="dbx-icon-xs"
- onClick={() => { onRegenerate(); setRevealed(true); }}
- disabled={disabled}
- aria-label={t('app.engineInstallDrawer.generateANewPassword', 'Generate a new password')}
- title={t('app.engineInstallDrawer.regenerate', 'Regenerate')}
- >
- <RefreshCw size={13} aria-hidden="true" />
- </Button>
- )}
- <Button variant="unstyled"
- type="button"
- className="dbx-icon-xs"
- onClick={copy}
- aria-label={t('app.engineInstallDrawer.copyPasswordToClipboard', 'Copy password to clipboard')}
- title={t('common.actions.copy', 'Copy')}
- >
- <Copy size={13} aria-hidden="true" />
- </Button>
- </span>
+ )}
</div>
);
}
@@ -95,20 +75,31 @@ function VariableField({ variable, value, onChange }) {
{variable.required && ' *'}
</label>
{variable.options ? (
- <select
+ <Select
+ value={value == null || value === '' ? '' : String(value)}
+ onValueChange={onChange}
+ required={variable.required}
+ name={variable.name}
+ >
+ <SelectTrigger id={id}>
+ <SelectValue placeholder={t('app.engineInstallDrawer.select', 'Select…')} />
+ </SelectTrigger>
+ <SelectContent>
+ {variable.options.map((opt) => <SelectItem key={opt} value={String(opt)}>{opt}</SelectItem>)}
+ </SelectContent>
+ </Select>
+ ) : variable.type === 'port' ? (
+ <PortField
id={id}
value={value ?? ''}
- onChange={(e) => onChange(e.target.value)}
+ onChange={(next) => onChange(next === '' ? '' : String(next))}
+ placeholder={variable.default != null ? String(variable.default) : ''}
required={variable.required}
- >
- <option value="">{t('app.engineInstallDrawer.select', 'Select…')}</option>
- {variable.options.map((opt) => <option key={opt} value={opt}>{opt}</option>)}
- </select>
+ />
) : (
<Input
id={id}
- type={variable.type === 'port' ? 'number' : 'text'}
- inputMode={variable.type === 'port' ? 'numeric' : undefined}
+ type="text"
value={value ?? ''}
onChange={(e) => onChange(e.target.value)}
placeholder={variable.default != null ? String(variable.default) : ''}
@@ -273,22 +264,15 @@ export default function EngineInstallDrawer({ entry, open, onOpenChange, onInsta
</span>
</div>
- <dl className="dbx-kv">
- <div className="dbx-kv__row">
- <dt>{t('common.labels.service', 'Service')}</dt>
- <dd className="dbx-kv__mono">{result.app?.name || slugifyService(name)}</dd>
- </div>
+ <InfoList className="dbx-kv">
+ <InfoItem label={t('common.labels.service', 'Service')} value={result.app?.name || slugifyService(name)} mono />
{meta.admin_user && (
- <div className="dbx-kv__row">
- <dt>{t('app.engineInstallDrawer.adminUser', 'Admin user')}</dt>
- <dd className="dbx-kv__mono">{meta.admin_user}</dd>
- </div>
+ <InfoItem label={t('app.engineInstallDrawer.adminUser', 'Admin user')} value={meta.admin_user} mono />
)}
- <div className="dbx-kv__row">
- <dt>{t('common.labels.password', 'Password')}</dt>
- <dd><SecretRow password={result.secret} /></dd>
- </div>
- </dl>
+ <InfoItem label={t('common.labels.password', 'Password')}>
+ <SecretRow password={result.secret} />
+ </InfoItem>
+ </InfoList>
<p className="dbx-field-hint">
{t('app.engineInstallDrawer.copyThePasswordNowItIs', 'Copy the password now — it is stored in ServerKit\'s secret store and is not shown again.')}
</p>
@@ -360,16 +344,12 @@ export default function EngineInstallDrawer({ entry, open, onOpenChange, onInsta
{(parts.portVar || meta.default_port != null) && (
<div className="dbx-field">
<label className="dbx-field__label" htmlFor="dbx-eng-port">{t('common.labels.port', 'Port')}</label>
- <div className="dbx-input">
- <Share2 size={15} aria-hidden="true" />
- <input
- id="dbx-eng-port"
- type="text"
- inputMode="numeric"
- value={port}
- onChange={(e) => setPort(e.target.value.replace(/\D/g, ''))}
- />
- </div>
+ <PortField
+ id="dbx-eng-port"
+ value={port}
+ onChange={(next) => setPort(next === '' ? '' : String(next))}
+ placeholder={meta.default_port != null ? String(meta.default_port) : undefined}
+ />
{parts.portVar?.description && (
<p className="dbx-field-hint">{parts.portVar.description}</p>
)}
@@ -388,26 +368,20 @@ export default function EngineInstallDrawer({ entry, open, onOpenChange, onInsta
{(parts.passwordVar || meta.admin_user) && (
<div className="dbx-field">
<span className="dbx-field__label">{t('app.engineInstallDrawer.adminCredentials', 'Admin credentials')}</span>
- <dl className="dbx-kv">
+ <InfoList className="dbx-kv">
{meta.admin_user && (
- <div className="dbx-kv__row">
- <dt>{t('common.labels.user', 'User')}</dt>
- <dd className="dbx-kv__mono">{meta.admin_user}</dd>
- </div>
+ <InfoItem label={t('common.labels.user', 'User')} value={meta.admin_user} mono />
)}
{parts.passwordVar && (
- <div className="dbx-kv__row">
- <dt>{t('common.labels.password', 'Password')}</dt>
- <dd>
- <SecretRow
- password={password}
- disabled={busy}
- onRegenerate={() => setPassword(generatePassword())}
- />
- </dd>
- </div>
+ <InfoItem label={t('common.labels.password', 'Password')}>
+ <SecretRow
+ password={password}
+ disabled={busy}
+ onRegenerate={() => setPassword(generatePassword())}
+ />
+ </InfoItem>
)}
- </dl>
+ </InfoList>
{parts.passwordVar && (
<p className="dbx-field-hint">
{t('app.engineInstallDrawer.shownOnceStoredInServerkitS', 'Shown once. Stored in ServerKit\'s secret store — never in a log or a second API response.')}
@@ -460,19 +434,15 @@ export default function EngineInstallDrawer({ entry, open, onOpenChange, onInsta
/>
</div>
{meta.data_path && (
- <div className="dbx-kv__row">
- <dt className="dbx-kv__key">
- <HardDrive size={12} aria-hidden="true" /> {t('app.engineInstallDrawer.dataPath', 'Data path')}
- </dt>
- <dd className="dbx-kv__mono">{meta.data_path}</dd>
- </div>
+ <InfoItem
+ label={<><HardDrive size={12} aria-hidden="true" /> {t('app.engineInstallDrawer.dataPath', 'Data path')}</>}
+ value={meta.data_path}
+ mono
+ />
)}
- <div className="dbx-kv__row">
- <dt className="dbx-kv__key">
- <RotateCw size={12} aria-hidden="true" /> {t('app.engineInstallDrawer.restartPolicy', 'Restart policy')}
- </dt>
- <dd className="dbx-kv__ok">unless-stopped</dd>
- </div>
+ <InfoItem label={<><RotateCw size={12} aria-hidden="true" /> {t('app.engineInstallDrawer.restartPolicy', 'Restart policy')}</>}>
+ <span className="info-value dbx-kv__ok">unless-stopped</span>
+ </InfoItem>
</div>
{expose && (
<p className="dbx-warn-line">
diff --git a/frontend/src/components/databases/ImportDumpModal.jsx b/frontend/src/components/databases/ImportDumpModal.jsx
index dd57a1c8..a08704a1 100644
--- a/frontend/src/components/databases/ImportDumpModal.jsx
+++ b/frontend/src/components/databases/ImportDumpModal.jsx
@@ -1,15 +1,18 @@
import { useCallback, useEffect, useMemo, useState } from 'react';
import {
- AlertTriangle, Check, ChevronDown, Database, FileCode2, HardDrive, Loader2,
+ AlertTriangle, Check, Database, FileCode2, HardDrive, Loader2,
RefreshCw, ShieldAlert,
} from 'lucide-react';
import api from '../../services/api';
import Modal from '@/components/Modal';
import { Button } from '@/components/ui/button';
+import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from '@/components/ui/select';
+import { SegControl } from '@/components/ds';
import { EngineIcon } from '../icons/DatabaseBrands';
import { formatBytes } from '@/utils/formatBytes';
import { ENGINE_META } from './dbAdapter';
import { useTranslation } from 'react-i18next';
+import { translateLabel } from '@/i18n/labels';
// Import a SQL dump into an existing database.
//
@@ -194,16 +197,18 @@ export default function ImportDumpModal({ preset, isAdmin = false, onClose, onIm
<div className="dbx-field">
<label className="dbx-field__label" htmlFor="dbx-import-target">{t('app.importDumpModal.importInto', 'Import into')}</label>
- <div className="dbx-select">
- <select id="dbx-import-target" value={targetKey} onChange={(e) => setTargetKey(e.target.value)}>
+ <Select value={targetKey} onValueChange={setTargetKey}>
+ <SelectTrigger id="dbx-import-target" className="dbx-select">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
{databases.map((d) => (
- <option key={d.key} value={d.key}>
+ <SelectItem key={d.key} value={d.key}>
{ENGINE_META[d.engine].short} · {d.name}
- </option>
+ </SelectItem>
))}
- </select>
- <ChevronDown size={14} aria-hidden="true" />
- </div>
+ </SelectContent>
+ </Select>
{target && (
<p className="dbx-field-hint">
<span className="dbx-builder__target-ico"><EngineIcon engine={target.engine} size={13} /></span>
@@ -215,19 +220,13 @@ export default function ImportDumpModal({ preset, isAdmin = false, onClose, onIm
<div className="dbx-field">
<span className="dbx-field__label">{t('app.importDumpModal.dumpFile', 'Dump file')}</span>
- <div className="dbx-choice" role="group" aria-label={t('app.importDumpModal.whereTheDumpLives', 'Where the dump lives')}>
- {SOURCES.map((s) => (
- <Button variant="unstyled"
- key={s.id}
- type="button"
- className={`dbx-choice__btn${source === s.id ? ' is-on' : ''}`}
- onClick={() => setSource(s.id)}
- aria-pressed={source === s.id}
- >
- {s.label}
- </Button>
- ))}
- </div>
+ <SegControl
+ className="dbx-choice"
+ aria-label={t('app.importDumpModal.whereTheDumpLives', 'Where the dump lives')}
+ value={source}
+ onChange={setSource}
+ options={SOURCES.map((s) => ({ value: s.id, label: translateLabel(t, s) }))}
+ />
{source === 'backup' ? (
<div className="dbx-dumps">
diff --git a/frontend/src/components/databases/ManagedDatabasesPanel.jsx b/frontend/src/components/databases/ManagedDatabasesPanel.jsx
index 92679543..7fc776a2 100644
--- a/frontend/src/components/databases/ManagedDatabasesPanel.jsx
+++ b/frontend/src/components/databases/ManagedDatabasesPanel.jsx
@@ -7,7 +7,7 @@ import { Button } from '@/components/ui/button';
import { Pill } from '../ds';
import AdminerSsoButton from './AdminerSsoButton';
import DbUsersPanel from './DbUsersPanel';
-import { copyToClipboard } from '@/utils/clipboard';
+import { useClipboard } from '@/hooks/useClipboard';
import { useTranslation } from 'react-i18next';
// Durable list of the databases ServerKit tracks (provisioned or adopted),
@@ -17,6 +17,7 @@ export default function ManagedDatabasesPanel() {
const { t } = useTranslation();
const toast = useToast();
const { confirm } = useConfirm();
+ const { copy } = useClipboard();
const [rows, setRows] = useState([]);
const [loading, setLoading] = useState(true);
const [busyId, setBusyId] = useState(null);
@@ -41,9 +42,9 @@ export default function ManagedDatabasesPanel() {
try {
const data = await api.revealManagedConnectionUri(row.id);
const uri = data?.connection_uri;
- if (uri && await copyToClipboard(uri)) {
- toast.success(t('app.managedDatabasesPanel.connectionStringCopiedRevealWasAudited', 'Connection string copied (reveal was audited)'));
- } else if (uri) {
+ // The string is fetched (and audited) on demand, so it is never
+ // on screen; when the clipboard refuses, show it instead.
+ if (uri && !(await copy(uri, t('app.managedDatabasesPanel.connectionStringCopiedRevealWasAudited', 'Connection string copied (reveal was audited)')))) {
toast.info(uri);
}
} catch (err) {
diff --git a/frontend/src/components/databases/modals.jsx b/frontend/src/components/databases/modals.jsx
index 4e5d21f4..8b320da5 100644
--- a/frontend/src/components/databases/modals.jsx
+++ b/frontend/src/components/databases/modals.jsx
@@ -4,6 +4,8 @@ import api from '../../services/api';
import Modal from '@/components/Modal';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
+import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from '@/components/ui/select';
+import CopyField from '@/components/CopyField';
import { EngineIcon } from '../icons/DatabaseBrands';
import { ENGINE_META } from './dbAdapter';
import { useTranslation } from 'react-i18next';
@@ -14,17 +16,31 @@ import { useTranslation } from 'react-i18next';
// The submit button stays inside <form>, so actions live in the body (not the
// Modal footer slot).
+// Radix Select items cannot carry an empty value; this stands for "none".
+const NONE = '__none';
+
+// "Grant privileges on database": a database name, or '' for none.
+function DatabaseSelect({ id, databases, value, onChange }) {
+ const { t } = useTranslation();
+ return (
+ <Select value={value === '' ? NONE : value} onValueChange={(next) => onChange(next === NONE ? '' : next)}>
+ <SelectTrigger id={id}><SelectValue /></SelectTrigger>
+ <SelectContent>
+ <SelectItem value={NONE}>{t('app.modals.none', '— None —')}</SelectItem>
+ {databases.map((db) => <SelectItem key={db.name} value={db.name}>{db.name}</SelectItem>)}
+ </SelectContent>
+ </Select>
+ );
+}
+
function CredentialsResult({ title, rows, onDone }) {
const { t } = useTranslation();
return (
<Modal open onClose={onDone} title={title}>
- <div className="credentials-box">
+ <div className="credentials-box dbx-credentials">
<p>{t('app.modals.saveTheseCredentialsThePasswordWon', 'Save these credentials — the password won\'t be shown again.')}</p>
- {rows.map(([label, value]) => (
- <div className="credential-item" key={label}>
- <label>{label}:</label>
- <code>{value}</code>
- </div>
+ {rows.map(([label, value, secret]) => (
+ <CopyField key={label} label={label} value={value} secret={Boolean(secret)} />
))}
</div>
<div className="modal-actions">
@@ -149,7 +165,7 @@ export function CreateDatabaseModal({ engine: initialEngine = 'mysql', status, o
rows={[
['Database', createdInfo.database],
['Username', createdInfo.user],
- ['Password', createdInfo.password],
+ ['Password', createdInfo.password, true],
...(attached ? [['Attached to', attached.name]] : []),
]}
onDone={() => { onCreated(); onClose(); }}
@@ -179,44 +195,55 @@ export function CreateDatabaseModal({ engine: initialEngine = 'mysql', status, o
{isMySQL ? (
<div className="form-row">
<div className="form-group">
- <label>{t('app.modals.characterSet', 'Character set')}</label>
- <select value={formData.charset} onChange={(e) => setFormData({ ...formData, charset: e.target.value })}>
- <option value="utf8mb4">utf8mb4</option>
- <option value="utf8">utf8</option>
- <option value="latin1">latin1</option>
- </select>
+ <label htmlFor="dbx-new-charset">{t('app.modals.characterSet', 'Character set')}</label>
+ <Select value={formData.charset} onValueChange={(value) => setFormData({ ...formData, charset: value })}>
+ <SelectTrigger id="dbx-new-charset"><SelectValue /></SelectTrigger>
+ <SelectContent>
+ <SelectItem value="utf8mb4">utf8mb4</SelectItem>
+ <SelectItem value="utf8">utf8</SelectItem>
+ <SelectItem value="latin1">latin1</SelectItem>
+ </SelectContent>
+ </Select>
</div>
<div className="form-group">
- <label>{t('app.modals.collation', 'Collation')}</label>
- <select value={formData.collation} onChange={(e) => setFormData({ ...formData, collation: e.target.value })}>
- <option value="utf8mb4_unicode_ci">utf8mb4_unicode_ci</option>
- <option value="utf8mb4_general_ci">utf8mb4_general_ci</option>
- <option value="utf8_general_ci">utf8_general_ci</option>
- </select>
+ <label htmlFor="dbx-new-collation">{t('app.modals.collation', 'Collation')}</label>
+ <Select value={formData.collation} onValueChange={(value) => setFormData({ ...formData, collation: value })}>
+ <SelectTrigger id="dbx-new-collation"><SelectValue /></SelectTrigger>
+ <SelectContent>
+ <SelectItem value="utf8mb4_unicode_ci">utf8mb4_unicode_ci</SelectItem>
+ <SelectItem value="utf8mb4_general_ci">utf8mb4_general_ci</SelectItem>
+ <SelectItem value="utf8_general_ci">utf8_general_ci</SelectItem>
+ </SelectContent>
+ </Select>
</div>
</div>
) : (
<div className="form-group">
- <label>{t('app.modals.encoding', 'Encoding')}</label>
- <select value={formData.encoding} onChange={(e) => setFormData({ ...formData, encoding: e.target.value })}>
- <option value="UTF8">UTF8</option>
- <option value="LATIN1">LATIN1</option>
- <option value="SQL_ASCII">SQL_ASCII</option>
- </select>
+ <label htmlFor="dbx-new-encoding">{t('app.modals.encoding', 'Encoding')}</label>
+ <Select value={formData.encoding} onValueChange={(value) => setFormData({ ...formData, encoding: value })}>
+ <SelectTrigger id="dbx-new-encoding"><SelectValue /></SelectTrigger>
+ <SelectContent>
+ <SelectItem value="UTF8">UTF8</SelectItem>
+ <SelectItem value="LATIN1">LATIN1</SelectItem>
+ <SelectItem value="SQL_ASCII">SQL_ASCII</SelectItem>
+ </SelectContent>
+ </Select>
</div>
)}
<div className="form-group">
<label htmlFor="dbx-attach-app">{t('app.modals.attachToApplication', 'Attach to application')}</label>
- <select
- id="dbx-attach-app"
- value={applicationId}
- onChange={(e) => setApplicationId(e.target.value)}
+ <Select
+ value={applicationId === '' ? NONE : String(applicationId)}
+ onValueChange={(value) => setApplicationId(value === NONE ? '' : value)}
disabled={appsLoading}
>
- <option value="">{t('app.modals.none', '— None —')}</option>
- {apps.map((app) => <option key={app.id} value={app.id}>{app.name}</option>)}
- </select>
+ <SelectTrigger id="dbx-attach-app"><SelectValue /></SelectTrigger>
+ <SelectContent>
+ <SelectItem value={NONE}>{t('app.modals.none', '— None —')}</SelectItem>
+ {apps.map((app) => <SelectItem key={app.id} value={String(app.id)}>{app.name}</SelectItem>)}
+ </SelectContent>
+ </Select>
<span className="form-help">
{appsLoading
? 'Loading applications…'
@@ -273,7 +300,7 @@ export function CreateMySQLUserModal({ databases, onClose, onCreated }) {
return (
<CredentialsResult
title={t('app.modals.userCreated', 'User created')}
- rows={[['Username', createdInfo.username], ['Password', createdInfo.password], ['Host', createdInfo.host]]}
+ rows={[['Username', createdInfo.username], ['Password', createdInfo.password, true], ['Host', createdInfo.host]]}
onDone={() => { onCreated(); onClose(); }}
/>
);
@@ -295,19 +322,24 @@ export function CreateMySQLUserModal({ databases, onClose, onCreated }) {
</div>
</div>
<div className="form-group">
- <label>{t('app.modals.host', 'Host')}</label>
- <select value={formData.host} onChange={(e) => setFormData({ ...formData, host: e.target.value })}>
- <option value="localhost">localhost</option>
- <option value="%">{t('app.modals.anyHost', '% (any host)')}</option>
- <option value="127.0.0.1">127.0.0.1</option>
- </select>
+ <label htmlFor="dbx-mysql-user-host">{t('app.modals.host', 'Host')}</label>
+ <Select value={formData.host} onValueChange={(value) => setFormData({ ...formData, host: value })}>
+ <SelectTrigger id="dbx-mysql-user-host"><SelectValue /></SelectTrigger>
+ <SelectContent>
+ <SelectItem value="localhost">localhost</SelectItem>
+ <SelectItem value="%">{t('app.modals.anyHost', '% (any host)')}</SelectItem>
+ <SelectItem value="127.0.0.1">127.0.0.1</SelectItem>
+ </SelectContent>
+ </Select>
</div>
<div className="form-group">
- <label>{t('app.modals.grantPrivilegesOnDatabase', 'Grant privileges on database')}</label>
- <select value={formData.database} onChange={(e) => setFormData({ ...formData, database: e.target.value })}>
- <option value="">{t('app.modals.none', '— None —')}</option>
- {databases.map((db) => <option key={db.name} value={db.name}>{db.name}</option>)}
- </select>
+ <label htmlFor="dbx-mysql-user-db">{t('app.modals.grantPrivilegesOnDatabase', 'Grant privileges on database')}</label>
+ <DatabaseSelect
+ id="dbx-mysql-user-db"
+ databases={databases}
+ value={formData.database}
+ onChange={(value) => setFormData({ ...formData, database: value })}
+ />
</div>
<div className="modal-actions">
<Button type="button" variant="outline" onClick={onClose}>{t('common.actions.cancel', 'Cancel')}</Button>
@@ -352,7 +384,7 @@ export function CreatePostgreSQLUserModal({ databases, onClose, onCreated }) {
return (
<CredentialsResult
title={t('app.modals.userCreated', 'User created')}
- rows={[['Username', createdInfo.username], ['Password', createdInfo.password]]}
+ rows={[['Username', createdInfo.username], ['Password', createdInfo.password, true]]}
onDone={() => { onCreated(); onClose(); }}
/>
);
@@ -374,11 +406,13 @@ export function CreatePostgreSQLUserModal({ databases, onClose, onCreated }) {
</div>
</div>
<div className="form-group">
- <label>{t('app.modals.grantPrivilegesOnDatabase', 'Grant privileges on database')}</label>
- <select value={formData.database} onChange={(e) => setFormData({ ...formData, database: e.target.value })}>
- <option value="">{t('app.modals.none', '— None —')}</option>
- {databases.map((db) => <option key={db.name} value={db.name}>{db.name}</option>)}
- </select>
+ <label htmlFor="dbx-pg-user-db">{t('app.modals.grantPrivilegesOnDatabase', 'Grant privileges on database')}</label>
+ <DatabaseSelect
+ id="dbx-pg-user-db"
+ databases={databases}
+ value={formData.database}
+ onChange={(value) => setFormData({ ...formData, database: value })}
+ />
</div>
<div className="modal-actions">
<Button type="button" variant="outline" onClick={onClose}>{t('common.actions.cancel', 'Cancel')}</Button>
diff --git a/frontend/src/components/docker/ComposeTab.jsx b/frontend/src/components/docker/ComposeTab.jsx
index 35d5c5e2..6d7cc1fa 100644
--- a/frontend/src/components/docker/ComposeTab.jsx
+++ b/frontend/src/components/docker/ComposeTab.jsx
@@ -12,6 +12,7 @@ import {
import { useTableSort } from '@/hooks/useTableSort';
import { useColumnVisibility } from '@/hooks/useColumnVisibility';
import { Button } from '@/components/ui/button';
+import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from '@/components/ui/select';
import { Package, Play, Square, RotateCw, FileText, Download } from 'lucide-react';
import { useTranslation } from 'react-i18next';
import {
@@ -23,6 +24,10 @@ import {
// `docker compose ls --format json` capitalises its keys; the label-scanning
// fallback in docker_service builds the same shape by hand. Read through one
// accessor each so a payload from either path lands in the same column.
+// Radix Select items cannot carry an empty value; this stands for "all services".
+const ALL_SERVICES = '__all';
+const LOG_LINE_OPTIONS = [50, 100, 200, 500, 1000];
+
const projectName = (project) => project.Name || project.name || '';
const projectStatus = (project) => project.Status || project.status || '';
const projectConfig = (project) => project.ConfigFiles || project.config_files || '';
@@ -490,25 +495,26 @@ const ComposeLogsModal = ({ project, onClose }) => {
<Modal open onClose={onClose} title={t('app.composeTab.logs2', 'Logs: {{name}}', { name: name })} size="lg">
<div className="modal-body">
<div className="logs-controls docker-compose-log-controls">
- <label>{t('app.composeTab.service', 'Service:')}</label>
- <select
- value={selectedService}
- onChange={(e) => setSelectedService(e.target.value)}
- className="docker-compose-log-select"
+ <label htmlFor="compose-log-service">{t('app.composeTab.service', 'Service:')}</label>
+ <Select
+ value={selectedService === '' ? ALL_SERVICES : selectedService}
+ onValueChange={(value) => setSelectedService(value === ALL_SERVICES ? '' : value)}
>
- <option value="">{t('app.composeTab.allServices', 'All Services')}</option>
- {services.map(service => (
- <option key={service} value={service}>{service}</option>
- ))}
- </select>
- <label>{t('app.composeTab.lines', 'Lines:')}</label>
- <select value={tail} onChange={(e) => setTail(Number(e.target.value))} className="docker-compose-log-select">
- <option value={50}>50</option>
- <option value={100}>100</option>
- <option value={200}>200</option>
- <option value={500}>500</option>
- <option value={1000}>1000</option>
- </select>
+ <SelectTrigger id="compose-log-service" className="docker-compose-log-select"><SelectValue /></SelectTrigger>
+ <SelectContent>
+ <SelectItem value={ALL_SERVICES}>{t('app.composeTab.allServices', 'All Services')}</SelectItem>
+ {services.map(service => (
+ <SelectItem key={service} value={service}>{service}</SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ <label htmlFor="compose-log-lines">{t('app.composeTab.lines', 'Lines:')}</label>
+ <Select value={String(tail)} onValueChange={(value) => setTail(Number(value))}>
+ <SelectTrigger id="compose-log-lines" className="docker-compose-log-select"><SelectValue /></SelectTrigger>
+ <SelectContent>
+ {LOG_LINE_OPTIONS.map((n) => <SelectItem key={n} value={String(n)}>{n}</SelectItem>)}
+ </SelectContent>
+ </Select>
</div>
<pre className="log-viewer">{loading ? 'Loading...' : logs}</pre>
</div>
diff --git a/frontend/src/components/docker/ContainersTab.jsx b/frontend/src/components/docker/ContainersTab.jsx
index 78685e24..4b754c11 100644
--- a/frontend/src/components/docker/ContainersTab.jsx
+++ b/frontend/src/components/docker/ContainersTab.jsx
@@ -17,10 +17,13 @@ import { useTableSort } from '@/hooks/useTableSort';
import { useColumnVisibility } from '@/hooks/useColumnVisibility';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
-import { Textarea } from '@/components/ui/textarea';
+import PortField from '@/components/PortField';
+import EnvEditor from '@/components/EnvEditor';
+import { CopyButton } from '@/components/CopyButton';
+import { envToObject } from '@/utils/dotenv';
import {
Box, X, Trash2, Play, Square, RotateCw,
- Terminal as TerminalLucide, FileText, Activity, Clock3, Copy,
+ Terminal as TerminalLucide, FileText, Activity, Clock3, Plus,
Database, Gauge, Package, Server as ServerIcon, Lock,
} from 'lucide-react';
import {
@@ -40,7 +43,6 @@ import {
getContainerProjectName,
} from './dockerHelpers';
import { ContainerResourceBars } from './dockerShared';
-import { copyToClipboard } from '@/utils/clipboard';
import { downloadBlob } from '@/utils/downloadBlob';
import { usePolling } from '@/hooks/usePolling';
import { useTranslation } from 'react-i18next';
@@ -952,10 +954,6 @@ const ContainerInspector = ({ container, stats, onAction, onOpenLogs, onOpenExec
const health = details?.State?.Health?.Status || getContainerStatusLabel(container);
const projectName = getContainerProjectName(container, details);
- async function copyContainerId() {
- if (await copyToClipboard(containerId)) toast.success(t('app.containersTab.containerIdCopied', 'Container ID copied'));
- else toast.error(t('app.containersTab.couldNotCopyContainerId', 'Could not copy container ID'));
- }
return (
<>
@@ -969,9 +967,14 @@ const ContainerInspector = ({ container, stats, onAction, onOpenLogs, onOpenExec
<h3 title={getContainerName(container)}>{getContainerName(container)}</h3>
<span>{shortId(containerId)}</span>
</div>
- <Button variant="unstyled" type="button" className="dx-row-action" onClick={copyContainerId} title={t('app.containersTab.copyContainerId', 'Copy container ID')}>
- <Copy size={13} />
- </Button>
+ <CopyButton
+ value={containerId}
+ variant="unstyled"
+ className="dx-row-action"
+ label={t('app.containersTab.copyContainerId', 'Copy container ID')}
+ copiedLabel={t('app.containersTab.containerIdCopied', 'Container ID copied')}
+ onCopy={() => toast.success(t('app.containersTab.containerIdCopied', 'Container ID copied'))}
+ />
<Button variant="unstyled" type="button" className="dx-row-action" onClick={onClose} title={t('app.containersTab.closeDetails', 'Close details')}>
<X size={13} />
</Button>
@@ -1123,15 +1126,29 @@ const ContainerInspector = ({ container, stats, onAction, onOpenLogs, onOpenExec
);
};
+// Port rows → the `-p` specs docker run takes: "8080:80", or just "80" to let
+// Docker pick the host side. A host port alone publishes the same port inside.
+function portMappings(rows) {
+ return rows
+ .map(({ host, container }) => {
+ if (host !== '' && container !== '') return `${host}:${container}`;
+ if (container !== '') return String(container);
+ if (host !== '') return `${host}:${host}`;
+ return null;
+ })
+ .filter(Boolean);
+}
+
const RunContainerModal = ({ onClose, onCreated }) => {
const { t } = useTranslation();
const [formData, setFormData] = useState({
image: '',
name: '',
- ports: '',
volumes: '',
- env: '',
});
+ // [{ host, container }] — each row becomes one `-p host:container`.
+ const [ports, setPorts] = useState([{ host: '', container: '' }]);
+ const [env, setEnv] = useState([]);
const [loading, setLoading] = useState(false);
const [error, setError] = useState('');
@@ -1139,6 +1156,9 @@ const RunContainerModal = ({ onClose, onCreated }) => {
setFormData({ ...formData, [e.target.name]: e.target.value });
}
+ const setPortRow = (index, patch) => setPorts(ports.map((row, i) => (i === index ? { ...row, ...patch } : row)));
+ const removePortRow = (index) => setPorts(ports.length > 1 ? ports.filter((_, i) => i !== index) : [{ host: '', container: '' }]);
+
async function handleSubmit(e) {
e.preventDefault();
setError('');
@@ -1148,14 +1168,9 @@ const RunContainerModal = ({ onClose, onCreated }) => {
const data = {
image: formData.image,
name: formData.name || undefined,
- ports: formData.ports ? formData.ports.split(',').map(p => p.trim()) : [],
+ ports: portMappings(ports),
volumes: formData.volumes ? formData.volumes.split(',').map(v => v.trim()) : [],
- env: formData.env ? Object.fromEntries(
- formData.env.split('\n').filter(l => l.includes('=')).map(l => {
- const [key, ...rest] = l.split('=');
- return [key.trim(), rest.join('=').trim()];
- })
- ) : {},
+ env: envToObject(env),
};
await api.runContainer(data);
@@ -1197,14 +1212,50 @@ const RunContainerModal = ({ onClose, onCreated }) => {
</div>
<div className="form-group">
- <label>{t('app.containersTab.portsCommaSeparated', 'Ports (comma-separated)')}</label>
- <Input
- type="text"
- name="ports"
- value={formData.ports}
- onChange={handleChange}
- placeholder="8080:80, 443:443"
- />
+ <label>{t('app.containersTab.ports', 'Ports')}</label>
+ <div className="dx-run-ports">
+ <div className="dx-run-ports__head">
+ <span>{t('app.containersTab.hostPort', 'Host port')}</span>
+ <span aria-hidden="true" />
+ <span>{t('app.containersTab.containerPort', 'Container port')}</span>
+ <span aria-hidden="true" />
+ </div>
+ {ports.map((row, index) => (
+ // Rows have no identity beyond their position while being typed.
+ <div className="dx-run-ports__row" key={index}>
+ <PortField
+ value={row.host}
+ onChange={(host) => setPortRow(index, { host })}
+ placeholder="8080"
+ />
+ <span className="dx-run-ports__sep" aria-hidden="true">:</span>
+ <PortField
+ host={false}
+ value={row.container}
+ onChange={(container) => setPortRow(index, { container })}
+ placeholder="80"
+ />
+ <Button
+ type="button"
+ variant="ghost"
+ size="icon"
+ onClick={() => removePortRow(index)}
+ aria-label={t('app.containersTab.removePortMapping', 'Remove port mapping')}
+ >
+ <Trash2 size={14} />
+ </Button>
+ </div>
+ ))}
+ <Button
+ type="button"
+ variant="outline"
+ size="sm"
+ className="dx-run-ports__add"
+ onClick={() => setPorts([...ports, { host: '', container: '' }])}
+ >
+ <Plus size={14} /> {t('app.containersTab.addPort', 'Add port')}
+ </Button>
+ </div>
</div>
<div className="form-group">
@@ -1219,14 +1270,8 @@ const RunContainerModal = ({ onClose, onCreated }) => {
</div>
<div className="form-group">
- <label>{t('app.containersTab.environmentVariablesOnePerLineKey', 'Environment Variables (one per line, KEY=value)')}</label>
- <Textarea
- name="env"
- value={formData.env}
- onChange={handleChange}
- placeholder={t('app.containersTab.nodeEnvProductionApiKeyXxx', 'NODE_ENV=production\nAPI_KEY=xxx')}
- rows={4}
- />
+ <label>{t('app.containersTab.environmentVariables', 'Environment Variables')}</label>
+ <EnvEditor value={env} onChange={setEnv} />
</div>
<div className="modal-actions">
diff --git a/frontend/src/components/docker/NetworksTab.jsx b/frontend/src/components/docker/NetworksTab.jsx
index 14059312..3f6b7ce6 100644
--- a/frontend/src/components/docker/NetworksTab.jsx
+++ b/frontend/src/components/docker/NetworksTab.jsx
@@ -4,7 +4,7 @@ import { useToast } from '../../contexts/useToast.js';
import { useConfirm } from '../../hooks/useConfirm';
import EmptyState from '../EmptyState';
import Modal from '@/components/Modal';
-import { DataTable, DataTableFooter, Pill, SearchField } from '@/components/ds';
+import { DataTable, DataTableFooter, Pill, SearchField, SegControl } from '@/components/ds';
import {
useTableChrome, GridViewPicker, GridChips, GridFilterButton,
GridToolsMenu, GridFilterDrawer,
@@ -391,11 +391,12 @@ const CreateNetworkModal = ({ onClose, onCreated }) => {
<div className="form-group">
<label>{t('app.networksTab.driver', 'Driver')}</label>
- <select value={driver} onChange={(e) => setDriver(e.target.value)}>
- <option value="bridge">bridge</option>
- <option value="overlay">overlay</option>
- <option value="macvlan">macvlan</option>
- </select>
+ <SegControl
+ aria-label={t('app.networksTab.driver', 'Driver')}
+ value={driver}
+ onChange={setDriver}
+ options={['bridge', 'overlay', 'macvlan']}
+ />
</div>
<div className="modal-actions">
diff --git a/frontend/src/components/git/RepoPicker.jsx b/frontend/src/components/git/RepoPicker.jsx
index 8f8748d9..46030109 100644
--- a/frontend/src/components/git/RepoPicker.jsx
+++ b/frontend/src/components/git/RepoPicker.jsx
@@ -3,6 +3,7 @@ import { RefreshCw, Search, Check } from 'lucide-react';
import { useTranslation } from 'react-i18next';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
+import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from '@/components/ui/select';
/**
* One repo picker for every git provider (plan 79 G1).
@@ -197,15 +198,14 @@ const RepoPicker = ({ provider, onPick }) => {
<label htmlFor={`${provider.id}-branch`}>
{t('git.picker.branch', 'Branch')}
</label>
- <select
- id={`${provider.id}-branch`}
- value={branch}
- onChange={(e) => pickBranch(e.target.value)}
- >
- {branches.map((name) => (
- <option key={name} value={name}>{name}</option>
- ))}
- </select>
+ <Select value={branch} onValueChange={pickBranch}>
+ <SelectTrigger id={`${provider.id}-branch`}><SelectValue /></SelectTrigger>
+ <SelectContent>
+ {branches.map((name) => (
+ <SelectItem key={name} value={name}>{name}</SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
</div>
)}
</div>
diff --git a/frontend/src/components/serverdetail/CloudflaredTab.jsx b/frontend/src/components/serverdetail/CloudflaredTab.jsx
index 55ced9a5..1a85e4b3 100644
--- a/frontend/src/components/serverdetail/CloudflaredTab.jsx
+++ b/frontend/src/components/serverdetail/CloudflaredTab.jsx
@@ -15,7 +15,8 @@ import EmptyState from '../EmptyState';
import { Cloud } from 'lucide-react';
import Modal from '@/components/Modal';
import { Label } from '@/components/ui/label';
-import { copyToClipboard } from '@/utils/clipboard';
+import CopyField from '@/components/CopyField';
+import DomainField from '@/components/DomainField';
import { rooms } from '@/constants/events';
import { useTranslation } from 'react-i18next';
import {
@@ -540,18 +541,17 @@ const CloudflaredTab = ({ serverId, serverStatus }) => {
<form onSubmit={handleRoute} className="sk-form-stack">
<div className="sk-form-field">
<Label htmlFor="cf-host">{t('app.cloudflaredTab.hostname', 'Hostname')}</Label>
- <Input
+ <DomainField
id="cf-host"
+ modes={['custom']}
value={routeHostname}
- onChange={(e) => setRouteHostname(e.target.value)}
- placeholder="app.example.com"
- required
+ onChange={setRouteHostname}
autoFocus
/>
</div>
<div className="modal-actions">
<Button type="button" variant="outline" onClick={() => setShowRouteModal(false)} disabled={routing}>{t('common.actions.cancel', 'Cancel')}</Button>
- <Button type="submit" disabled={routing}>{routing ? 'Adding…' : 'Add Route'}</Button>
+ <Button type="submit" disabled={routing || !routeHostname}>{routing ? 'Adding…' : 'Add Route'}</Button>
</div>
</form>
</Modal>
@@ -581,6 +581,7 @@ const CloudflaredLoginCard = ({ login, onCancel }) => {
<p>
<strong>{t('app.cloudflaredTab.step12', 'Step 1 / 2:')}</strong> {t('app.cloudflaredTab.openTheFollowingUrlInYour', 'open the following URL in your browser, sign in to Cloudflare, and pick the zone you want to associate with this agent.')}
</p>
+ <CopyField value={login.authUrl} />
<div className="cloudflared-login-card__actions">
<a
href={login.authUrl}
@@ -590,13 +591,6 @@ const CloudflaredLoginCard = ({ login, onCancel }) => {
>
{t('app.cloudflaredTab.openCloudflareLogin', 'Open Cloudflare login')}
</a>
- <Button variant="unstyled"
- type="button"
- className="btn btn-outline"
- onClick={() => copyToClipboard(login.authUrl)}
- >
- {t('app.cloudflaredTab.copyUrl', 'Copy URL')}
- </Button>
</div>
<p className="cloudflared-login-card__hint">
<strong>{t('app.cloudflaredTab.step22', 'Step 2 / 2:')}</strong> {t('app.cloudflaredTab.waitingForTheAgentToReceive', 'waiting for the agent to receive cert.pem from Cloudflare. This page will refresh automatically once authorisation completes.')}
diff --git a/frontend/src/components/serverdetail/ServerOverviewTab.jsx b/frontend/src/components/serverdetail/ServerOverviewTab.jsx
index 0bdd6044..f47e7c7d 100644
--- a/frontend/src/components/serverdetail/ServerOverviewTab.jsx
+++ b/frontend/src/components/serverdetail/ServerOverviewTab.jsx
@@ -3,9 +3,9 @@ import { Pill, KpiBand } from '../ds';
import OnboardingWizard from '../server/OnboardingWizard';
import SystemStatusCard from './SystemStatusCard';
import { formatBytes } from '@/utils/formatBytes';
+import { InfoList, InfoItem } from '../InfoList';
import { useTranslation } from 'react-i18next';
import {
- InfoRow,
KpiTile,
KpiGauge,
PulseIcon,
@@ -122,46 +122,44 @@ const ServerOverviewTab = ({ server, metrics, systemInfo, onRefreshServer }) =>
<div className="overview-grid">
<div className="info-card">
<h3><ServerIcon /> {t('app.serverOverviewTab.serverInformation', 'Server Information')}</h3>
- <ul className="info-rows">
- <InfoRow icon={<PulseIcon />} label={t('common.labels.status', 'Status')}>
+ <InfoList className="server-info-list">
+ <InfoItem label={<><PulseIcon /> {t('common.labels.status', 'Status')}</>}>
<Pill kind={serverStatusKind(server.status)}>{server.status}</Pill>
- </InfoRow>
- <InfoRow icon={<HostIcon />} label={t('app.serverOverviewTab.hostname', 'Hostname')} value={server.hostname || 'N/A'} mono />
- <InfoRow icon={<NetworkIcon />} label={t('common.labels.ipAddress', 'IP Address')} value={server.ip_address || 'N/A'} mono />
- <InfoRow icon={<FolderTinyIcon />} label={t('app.serverOverviewTab.group', 'Group')} value={server.group_name || 'Ungrouped'} />
- <InfoRow
- icon={<ClockIcon />}
- label={t('app.serverOverviewTab.lastSeen', 'Last Seen')}
+ </InfoItem>
+ <InfoItem label={<><HostIcon /> {t('app.serverOverviewTab.hostname', 'Hostname')}</>} value={server.hostname || 'N/A'} mono />
+ <InfoItem label={<><NetworkIcon /> {t('common.labels.ipAddress', 'IP Address')}</>} value={server.ip_address || 'N/A'} mono />
+ <InfoItem label={<><FolderTinyIcon /> {t('app.serverOverviewTab.group', 'Group')}</>} value={server.group_name || 'Ungrouped'} />
+ <InfoItem
+ label={<><ClockIcon /> {t('app.serverOverviewTab.lastSeen', 'Last Seen')}</>}
value={server.last_seen ? new Date(server.last_seen).toLocaleString() : 'Never'}
/>
- </ul>
+ </InfoList>
</div>
<div className="info-card">
<h3><ChipIcon /> {t('app.serverOverviewTab.systemInformation', 'System Information')}</h3>
- <ul className="info-rows">
- <InfoRow icon={<OsIcon />} label={t('app.serverOverviewTab.operatingSystem', 'Operating System')} value={osLabel} />
- <InfoRow icon={<ArchIcon />} label={t('app.serverOverviewTab.architecture', 'Architecture')} value={systemInfo?.architecture || server.architecture || 'N/A'} mono />
- <InfoRow
- icon={<CpuIcon />}
- label="CPU"
+ <InfoList className="server-info-list">
+ <InfoItem label={<><OsIcon /> {t('app.serverOverviewTab.operatingSystem', 'Operating System')}</>} value={osLabel} />
+ <InfoItem label={<><ArchIcon /> {t('app.serverOverviewTab.architecture', 'Architecture')}</>} value={systemInfo?.architecture || server.architecture || 'N/A'} mono />
+ <InfoItem
+ label={<><CpuIcon /> CPU</>}
value={
(cpuModel || 'N/A') + (cpuCores ? ` (${cpuCores} cores)` : '')
}
/>
- <InfoRow icon={<MemoryIcon />} label={t('app.serverOverviewTab.totalMemory', 'Total Memory')} value={formatBytes(totalMemory, { defaultValue: 'N/A' })} mono />
- <InfoRow icon={<DiskIcon />} label={t('app.serverOverviewTab.totalDisk', 'Total Disk')} value={formatBytes(totalDisk, { defaultValue: 'N/A' })} mono />
- </ul>
+ <InfoItem label={<><MemoryIcon /> {t('app.serverOverviewTab.totalMemory', 'Total Memory')}</>} value={formatBytes(totalMemory, { defaultValue: 'N/A' })} mono />
+ <InfoItem label={<><DiskIcon /> {t('app.serverOverviewTab.totalDisk', 'Total Disk')}</>} value={formatBytes(totalDisk, { defaultValue: 'N/A' })} mono />
+ </InfoList>
</div>
<div className="info-card overview-grid__full">
<h3><AgentIcon /> {t('app.serverOverviewTab.agentInformation', 'Agent Information')}</h3>
- <ul className="info-rows info-rows--columns">
- <InfoRow icon={<TagIcon />} label={t('app.serverOverviewTab.agentVersion', 'Agent Version')} value={server.agent_version || 'Not installed'} mono />
- <InfoRow icon={<HashIcon />} label={t('app.serverOverviewTab.agentId', 'Agent ID')} value={server.agent_id || 'N/A'} mono />
- <InfoRow icon={<DockerMiniIcon />} label={t('app.serverOverviewTab.dockerVersion', 'Docker Version')} value={server.docker_version || systemInfo?.docker_version || 'N/A'} mono />
- <InfoRow icon={<ClockIcon />} label={t('common.labels.uptime', 'Uptime')} value={formatUptime(metrics?.uptime)} mono />
- </ul>
+ <InfoList className="server-info-list server-info-list--columns">
+ <InfoItem label={<><TagIcon /> {t('app.serverOverviewTab.agentVersion', 'Agent Version')}</>} value={server.agent_version || 'Not installed'} mono />
+ <InfoItem label={<><HashIcon /> {t('app.serverOverviewTab.agentId', 'Agent ID')}</>} value={server.agent_id || 'N/A'} mono />
+ <InfoItem label={<><DockerMiniIcon /> {t('app.serverOverviewTab.dockerVersion', 'Docker Version')}</>} value={server.docker_version || systemInfo?.docker_version || 'N/A'} mono />
+ <InfoItem label={<><ClockIcon /> {t('common.labels.uptime', 'Uptime')}</>} value={formatUptime(metrics?.uptime)} mono />
+ </InfoList>
</div>
<div className="overview-grid__full">
diff --git a/frontend/src/components/serverdetail/ServerRestorePointsTab.jsx b/frontend/src/components/serverdetail/ServerRestorePointsTab.jsx
index 0c4fa8e6..b0dedf1b 100644
--- a/frontend/src/components/serverdetail/ServerRestorePointsTab.jsx
+++ b/frontend/src/components/serverdetail/ServerRestorePointsTab.jsx
@@ -5,6 +5,7 @@ import Modal from '../Modal';
import FormField from '../FormField';
import DeploymentTimeline from '../deployments/DeploymentTimeline';
import { Button } from '../ui/button';
+import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from '../ui/select';
import { useToast } from '../../contexts/useToast.js';
import { useTranslation } from 'react-i18next';
@@ -168,20 +169,23 @@ export default function ServerRestorePointsTab({ serverId }) {
htmlFor="restore-point-app"
required
>
- <select
- id="restore-point-app"
- value={selectedAppId}
- onChange={(event) => {
- setSelectedAppId(event.target.value);
+ <Select
+ value={selectedAppId === '' || selectedAppId == null ? '' : String(selectedAppId)}
+ onValueChange={(value) => {
+ setSelectedAppId(value);
setSaveError(null);
}}
required
>
- <option value="">{t('app.serverRestorePoints.selectApplication', 'Select an application')}</option>
- {serverApps.map((app) => (
- <option key={app.id} value={app.id}>{app.name}</option>
- ))}
- </select>
+ <SelectTrigger id="restore-point-app">
+ <SelectValue placeholder={t('app.serverRestorePoints.selectApplication', 'Select an application')} />
+ </SelectTrigger>
+ <SelectContent>
+ {serverApps.map((app) => (
+ <SelectItem key={app.id} value={String(app.id)}>{app.name}</SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
</FormField>
<FormField
label={t('app.serverRestorePoints.label', 'Label (optional)')}
diff --git a/frontend/src/components/serverdetail/ServerSettingsTab.jsx b/frontend/src/components/serverdetail/ServerSettingsTab.jsx
index e7ffd67e..79582155 100644
--- a/frontend/src/components/serverdetail/ServerSettingsTab.jsx
+++ b/frontend/src/components/serverdetail/ServerSettingsTab.jsx
@@ -3,7 +3,8 @@ import { useCallback, useState, useEffect } from 'react';
import api from '../../services/api';
import { useToast } from '../../contexts/useToast.js';
import { useConfirm } from '../../hooks/useConfirm';
-import { useClipboard } from '@/hooks/useClipboard';
+import CopyField from '@/components/CopyField';
+import { InfoList, InfoItem } from '../InfoList';
import { DangerZone } from '../DangerZone';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
@@ -26,11 +27,11 @@ import {
NetworkIcon,
TrashIcon,
TagIcon,
- TerminalIcon,
- CopyIcon,
- WindowsIcon,
} from './serverDetailShared';
+// Radix Select items cannot carry an empty value; this stands for "no group".
+const NO_GROUP = '__none';
+
const AgentRegistrationSection = ({ server, onRegenerateToken }) => {
const { t } = useTranslation();
const expires = server.registration_expires;
@@ -220,13 +221,20 @@ const ServerSettingsTab = ({ server, onUpdate, onRegenerateToken, onDelete }) =>
</div>
<div className="form-group">
- <label>{t('app.serverSettingsTab.group', 'Group')}</label>
- <select name="group_id" value={formData.group_id} onChange={handleChange}>
- <option value="">{t('app.serverSettingsTab.noGroup', 'No Group')}</option>
- {groups.map(group => (
- <option key={group.id} value={group.id}>{group.name}</option>
- ))}
- </select>
+ <label htmlFor="server-settings-group">{t('app.serverSettingsTab.group', 'Group')}</label>
+ <Select
+ name="group_id"
+ value={formData.group_id === '' || formData.group_id == null ? NO_GROUP : String(formData.group_id)}
+ onValueChange={(value) => setFormData(prev => ({ ...prev, group_id: value === NO_GROUP ? '' : value }))}
+ >
+ <SelectTrigger id="server-settings-group"><SelectValue /></SelectTrigger>
+ <SelectContent>
+ <SelectItem value={NO_GROUP}>{t('app.serverSettingsTab.noGroup', 'No Group')}</SelectItem>
+ {groups.map(group => (
+ <SelectItem key={group.id} value={String(group.id)}>{group.name}</SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
</div>
<Button type="submit" disabled={loading}>
@@ -254,20 +262,19 @@ const ServerSettingsTab = ({ server, onUpdate, onRegenerateToken, onDelete }) =>
</div>
{connectionInfo && (
- <div className="security-info-bar">
- <div className="security-info-item">
- <span className="security-info-label">{t('app.serverSettingsTab.connectionIp', 'Connection IP')}</span>
- <span className="security-info-value">
- <code>{connectionInfo.ip_address || 'Not connected'}</code>
- </span>
- </div>
+ <InfoList className="security-info-bar">
+ <InfoItem
+ label={t('app.serverSettingsTab.connectionIp', 'Connection IP')}
+ value={connectionInfo.ip_address || 'Not connected'}
+ mono
+ />
{connectionInfo.connected_since && (
- <div className="security-info-item">
- <span className="security-info-label">{t('app.serverSettingsTab.connectedSince', 'Connected Since')}</span>
- <span className="security-info-value">{new Date(connectionInfo.connected_since).toLocaleString()}</span>
- </div>
+ <InfoItem
+ label={t('app.serverSettingsTab.connectedSince', 'Connected Since')}
+ value={new Date(connectionInfo.connected_since).toLocaleString()}
+ />
)}
- </div>
+ </InfoList>
)}
<div className="subsection">
@@ -376,7 +383,7 @@ const ServerSettingsTab = ({ server, onUpdate, onRegenerateToken, onDelete }) =>
export const TokenModal = ({ server, onClose, onGenerated }) => {
const { t } = useTranslation();
const toast = useToast();
- const { copy } = useClipboard({ successMessage: 'Copied to clipboard' });
+
const [expiresIn, setExpiresIn] = useState(7 * 24 * 60 * 60);
const [generating, setGenerating] = useState(false);
// Result of the most recent generation in *this* modal session. We
@@ -463,46 +470,27 @@ Install-ServerKitAgent -Server "${window.location.origin}" -Token "${result.regi
</span>
</div>
- <div className="connection-string-field">
- <div className="connection-string-field__header">
- <KeyIcon />
- <span>{t('app.serverSettingsTab.connectionString3', 'Connection string')}</span>
- <Button variant="outline" size="sm" onClick={() => copy(result.connection_string)}>
- <CopyIcon /> {t('common.actions.copy', 'Copy')}
- </Button>
- </div>
- <pre className="connection-string-field__value">{result.connection_string}</pre>
+ <div className="server-connection-string">
+ <CopyField
+ label={t('app.serverSettingsTab.connectionString3', 'Connection string')}
+ value={result.connection_string}
+ multiline
+ />
</div>
<details className="install-fallback">
<summary>{t('app.serverSettingsTab.needToInstallTheAgentFirst', 'Need to install the agent first? Use the one-liner installer.')}</summary>
<div className="install-tabs install-tabs--after-summary">
- <div className="install-tab">
- <div className="install-tab-header">
- <TerminalIcon />
- <div className="install-tab-title">
- <span>{t('app.serverSettingsTab.linux', 'Linux')}</span>
- <span className="install-tab-description">{t('app.serverSettingsTab.curlTarSudoAndSystemd', 'curl, tar, sudo, and systemd')}</span>
- </div>
- <Button variant="outline" size="sm" onClick={() => copy(linuxScript)}>
- <CopyIcon /> {t('common.actions.copy', 'Copy')}
- </Button>
- </div>
- <pre className="install-script">{linuxScript}</pre>
- </div>
- <div className="install-tab">
- <div className="install-tab-header">
- <WindowsIcon />
- <div className="install-tab-title">
- <span>{t('app.serverSettingsTab.windowsPowershell', 'Windows (PowerShell)')}</span>
- <span className="install-tab-description">{t('app.serverSettingsTab.runAsAdministrator', 'Run as Administrator')}</span>
- </div>
- <Button variant="outline" size="sm" onClick={() => copy(windowsScript)}>
- <CopyIcon /> {t('common.actions.copy', 'Copy')}
- </Button>
- </div>
- <pre className="install-script">{windowsScript}</pre>
- </div>
+ <CopyField
+ label={`${t('app.serverSettingsTab.linux', 'Linux')} · ${t('app.serverSettingsTab.curlTarSudoAndSystemd', 'curl, tar, sudo, and systemd')}`}
+ value={linuxScript}
+ multiline
+ />
+ <CopyField
+ label={`${t('app.serverSettingsTab.windowsPowershell', 'Windows (PowerShell)')} · ${t('app.serverSettingsTab.runAsAdministrator', 'Run as Administrator')}`}
+ value={windowsScript}
+ multiline
+ />
</div>
</details>
</>
diff --git a/frontend/src/components/serverdetail/serverDetailShared.jsx b/frontend/src/components/serverdetail/serverDetailShared.jsx
index 7a2c3271..d8bbc150 100644
--- a/frontend/src/components/serverdetail/serverDetailShared.jsx
+++ b/frontend/src/components/serverdetail/serverDetailShared.jsx
@@ -1,7 +1,6 @@
-import { useToast } from '../../contexts/useToast.js';
import { Button } from '@/components/ui/button';
import { Gauge } from '../ds';
-import { copyToClipboard } from '@/utils/clipboard';
+import { useClipboard } from '@/hooks/useClipboard';
import { useTranslation } from 'react-i18next';
export const SecurityAlertItem = ({ alert, onAcknowledge, onResolve }) => {
@@ -44,15 +43,6 @@ export const SecurityAlertItem = ({ alert, onAcknowledge, onResolve }) => {
);
};
-export const InfoRow = ({ icon, label, value, mono, children }) => (
- <li className="info-row">
- <span className="info-row__icon">{icon}</span>
- <span className="info-row__label">{label}</span>
- <span className={`info-row__value${mono ? ' mono' : ''}`}>
- {children ?? value}
- </span>
- </li>
-);
export const KpiTile = ({ icon, label, value, sub, tone }) => (
<div className={`kpi-tile${tone ? ` kpi-tile--${tone}` : ''}`}>
@@ -87,13 +77,12 @@ export const KpiGauge = ({ icon, label, percent, color, sub }) => {
export const CopyChip = ({ label, value, title, mono }) => {
const { t } = useTranslation();
- const toast = useToast();
+ const { copy } = useClipboard();
const handleCopy = (e) => {
e.preventDefault();
e.stopPropagation();
if (!value) return;
- copyToClipboard(value);
- toast.success(`${label[0].toUpperCase()}${label.slice(1)} copied`);
+ copy(String(value), `${label[0].toUpperCase()}${label.slice(1)} copied`);
};
return (
<Button variant="unstyled"
diff --git a/frontend/src/components/service-detail/LogsTab.jsx b/frontend/src/components/service-detail/LogsTab.jsx
index 8ddf528b..bf65ab0c 100644
--- a/frontend/src/components/service-detail/LogsTab.jsx
+++ b/frontend/src/components/service-detail/LogsTab.jsx
@@ -8,7 +8,8 @@ import DeploymentJobProgress from '../DeploymentJobProgress';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Switch } from '@/components/ui/switch';
-import { copyToClipboard } from '@/utils/clipboard';
+import { CopyButton } from '@/components/CopyButton';
+import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from '@/components/ui/select';
import { downloadBlob } from '@/utils/downloadBlob';
import { usePolling } from '@/hooks/usePolling';
import { useTranslation } from 'react-i18next';
@@ -150,9 +151,6 @@ const LogsTab = ({ app }) => {
downloadBlob(rawLogs, `${app.name}-logs-${new Date().toISOString().slice(0, 10)}.txt`);
}
- function handleCopy() {
- copyToClipboard(rawLogs);
- }
const matchCount = searchTerm ? filteredLines.length : null;
@@ -193,27 +191,29 @@ const LogsTab = ({ app }) => {
<span className="logs-toolbar__match-count">{matchCount} matches</span>
)}
</div>
- <select
- className="logs-toolbar__select"
- value={levelFilter}
- onChange={(e) => setLevelFilter(e.target.value)}
- >
- {LOG_LEVELS.map(l => (
- <option key={l} value={l}>
- {l === 'all' ? 'All Levels' : l.charAt(0).toUpperCase() + l.slice(1)}
- </option>
- ))}
- </select>
- <select
- className="logs-toolbar__select"
- value={lineCount}
- onChange={(e) => setLineCount(Number(e.target.value))}
- >
- <option value={100}>{t('app.logsTab.100Lines', '100 lines')}</option>
- <option value={200}>{t('app.logsTab.200Lines', '200 lines')}</option>
- <option value={500}>{t('app.logsTab.500Lines', '500 lines')}</option>
- <option value={1000}>{t('app.logsTab.1000Lines', '1000 lines')}</option>
- </select>
+ <Select value={levelFilter} onValueChange={setLevelFilter}>
+ <SelectTrigger className="logs-toolbar__select" aria-label={t('app.logsTab.logLevel', 'Log level')}>
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {LOG_LEVELS.map(l => (
+ <SelectItem key={l} value={l}>
+ {l === 'all' ? 'All Levels' : l.charAt(0).toUpperCase() + l.slice(1)}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ <Select value={String(lineCount)} onValueChange={(value) => setLineCount(Number(value))}>
+ <SelectTrigger className="logs-toolbar__select" aria-label={t('app.logsTab.lineCount', 'Lines')}>
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ <SelectItem value="100">{t('app.logsTab.100Lines', '100 lines')}</SelectItem>
+ <SelectItem value="200">{t('app.logsTab.200Lines', '200 lines')}</SelectItem>
+ <SelectItem value="500">{t('app.logsTab.500Lines', '500 lines')}</SelectItem>
+ <SelectItem value="1000">{t('app.logsTab.1000Lines', '1000 lines')}</SelectItem>
+ </SelectContent>
+ </Select>
</div>
<div className="logs-toolbar__right">
<label className="logs-toolbar__toggle">
@@ -225,12 +225,11 @@ const LogsTab = ({ app }) => {
<span>{t('app.logsTab.live', 'Live')}</span>
</label>
<div className="logs-toolbar__divider" />
- <Button variant="ghost" size="icon" onClick={handleCopy} title={t('app.logsTab.copyLogs', 'Copy logs')}>
- <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
- <rect x="9" y="9" width="13" height="13" rx="2" ry="2"/>
- <path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/>
- </svg>
- </Button>
+ <CopyButton
+ value={rawLogs}
+ label={t('app.logsTab.copyLogs', 'Copy logs')}
+ copiedLabel={t('app.copyField.copied', 'Copied')}
+ />
<Button variant="ghost" size="icon" onClick={handleDownload} title={t('app.logsTab.downloadLogs', 'Download logs')}>
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>
diff --git a/frontend/src/components/service-detail/OverviewTab.jsx b/frontend/src/components/service-detail/OverviewTab.jsx
index ff948276..7fde341b 100644
--- a/frontend/src/components/service-detail/OverviewTab.jsx
+++ b/frontend/src/components/service-detail/OverviewTab.jsx
@@ -7,6 +7,7 @@ import { useDeployments } from '../../hooks/useDeployments';
import { getDeployStatus, formatRelativeTime, formatDuration } from '../../utils/serviceTypes';
import { formatBytes } from '../../utils/formatBytes';
import BandwidthSparkline from '../BandwidthSparkline';
+import { InfoList, InfoItem } from '../InfoList';
import ScheduledTasksCard from '../ScheduledTasksCard';
import RequestMetricsCard from './RequestMetricsCard';
import AttachmentsCard from './AttachmentsCard';
@@ -144,10 +145,9 @@ const OverviewTab = ({ app, deployConfig }) => {
{/* Service Info Card */}
<div className="overview-tab__card">
<h3 className="overview-tab__card-title">{t('app.overviewTab.serviceInfo', 'Service Info')}</h3>
- <div className="overview-tab__info-list">
- <div className="sk-info-row">
- <span className="k">{t('common.labels.type', 'Type')}</span>
- <span className="v">
+ <InfoList className="overview-tab__info-list">
+ <InfoItem label={t('common.labels.type', 'Type')}>
+ <span className="info-value">
<span
className="overview-tab__info-badge"
style={{ backgroundColor: app.typeInfo.bgColor, color: app.typeInfo.color, borderColor: app.typeInfo.borderColor }}
@@ -155,11 +155,10 @@ const OverviewTab = ({ app, deployConfig }) => {
{app.typeInfo.label}
</span>
</span>
- </div>
+ </InfoItem>
{app.domain && (
- <div className="sk-info-row">
- <span className="k">{t('common.labels.domain', 'Domain')}</span>
- <span className="v">
+ <InfoItem label={t('common.labels.domain', 'Domain')}>
+ <span className="info-value">
<a
href={`https://${app.domain}`}
target="_blank"
@@ -174,12 +173,11 @@ const OverviewTab = ({ app, deployConfig }) => {
</svg>
</a>
</span>
- </div>
+ </InfoItem>
)}
{app.port && (
- <div className="sk-info-row">
- <span className="k">{t('common.labels.port', 'Port')}</span>
- <span className="v">
+ <InfoItem label={t('common.labels.port', 'Port')}>
+ <span className="info-value">
{/* A port with no domain in front of it is
still reachable — the number alone made
you assemble the URL yourself. */}
@@ -196,34 +194,31 @@ const OverviewTab = ({ app, deployConfig }) => {
</a>
) : app.port}
</span>
- </div>
+ </InfoItem>
)}
- <div className="sk-info-row">
- <span className="k">{t('common.labels.created', 'Created')}</span>
- <span className="v">
+ <InfoItem label={t('common.labels.created', 'Created')}>
+ <span className="info-value">
{new Date(app.created_at).toLocaleDateString('en-US', {
year: 'numeric', month: 'short', day: 'numeric'
})}
</span>
- </div>
+ </InfoItem>
{deployConfig && (
- <div className="sk-info-row">
- <span className="k">{t('app.overviewTab.repository', 'Repository')}</span>
- <span className="v">
+ <InfoItem label={t('app.overviewTab.repository', 'Repository')}>
+ <span className="info-value">
{extractRepoDisplay(deployConfig.repo_url)}
<span className="overview-tab__branch">{deployConfig.branch || 'main'}</span>
</span>
- </div>
+ </InfoItem>
)}
{app.environment_type && app.environment_type !== 'standalone' && (
- <div className="sk-info-row">
- <span className="k">{t('app.overviewTab.environment', 'Environment')}</span>
- <span className="v">
+ <InfoItem label={t('app.overviewTab.environment', 'Environment')}>
+ <span className="info-value">
<EnvTag env={ENV_LABEL[app.environment_type] || app.environment_type.toUpperCase()} />
</span>
- </div>
+ </InfoItem>
)}
- </div>
+ </InfoList>
</div>
{/* Resource Usage Card */}
@@ -450,21 +445,19 @@ const RelatedResourcesCard = ({ app, related }) => {
</div>
)}
{backup?.enabled && (
- <div className="sk-info-row">
- <span className="k">{t('common.labels.backups', 'Backups')}</span>
- <span className="v">
+ <InfoItem label={t('common.labels.backups', 'Backups')}>
+ <span className="info-value">
{backup.frequency || 'scheduled'}
{backup.last_status && <Pill kind={backup.last_status === 'success' ? 'green' : 'amber'}>{backup.last_status}</Pill>}
</span>
- </div>
+ </InfoItem>
)}
{deployments?.count > 0 && (
- <div className="sk-info-row">
- <span className="k">{t('app.overviewTab.deployments', 'Deployments')}</span>
- <span className="v">
+ <InfoItem label={t('app.overviewTab.deployments', 'Deployments')}>
+ <span className="info-value">
<Link to={`/services/${app.id}/events`}>{deployments.count} total</Link>
</span>
- </div>
+ </InfoItem>
)}
</div>
)}
diff --git a/frontend/src/components/service-detail/SettingsTab.jsx b/frontend/src/components/service-detail/SettingsTab.jsx
index 232bff55..58961f31 100644
--- a/frontend/src/components/service-detail/SettingsTab.jsx
+++ b/frontend/src/components/service-detail/SettingsTab.jsx
@@ -35,6 +35,7 @@ import BuildTab from '../appdetail/BuildTab';
import DeployTab from '../appdetail/DeployTab';
import Modal from '@/components/Modal';
import DomainField from '@/components/DomainField';
+import { InfoList, InfoItem } from '@/components/InfoList';
import { attachDomain } from '@/services/attachDomain';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
@@ -586,33 +587,22 @@ const DomainSslPanel = ({ app, domains, primaryDomain, onUpdate }) => {
return (
<SharedCard variant="legacy" className="card settings-section svc-domain-panel" data-walkthrough="service-domain-panel">
- <div className="app-info-grid">
- <div className="app-info-item">
- <span className="app-info-label">{t('app.settingsTab.primaryDomain', 'Primary Domain')}</span>
- <span className="app-info-value mono">{primaryDomain || 'None configured'}</span>
- </div>
- <div className="app-info-item">
- <span className="app-info-label">{t('app.settingsTab.sslStatus', 'SSL Status')}</span>
- <span className="app-info-value">
- {!primaryDomain ? '—' : checking ? 'Checking…' : issued ? 'Active' : 'Not Secured'}
- </span>
- </div>
+ <InfoList>
+ <InfoItem label={t('app.settingsTab.primaryDomain', 'Primary Domain')} value={primaryDomain || 'None configured'} mono />
+ <InfoItem
+ label={t('app.settingsTab.sslStatus', 'SSL Status')}
+ value={!primaryDomain ? '—' : checking ? 'Checking…' : issued ? 'Active' : 'Not Secured'}
+ />
{issued && health.expires_at && (
- <div className="app-info-item">
- <span className="app-info-label">{t('app.settingsTab.expires', 'Expires')}</span>
- <span className="app-info-value">
- {new Date(health.expires_at).toLocaleDateString()}
- {typeof health.days_remaining === 'number' ? ` (${health.days_remaining}d)` : ''}
- </span>
- </div>
+ <InfoItem
+ label={t('app.settingsTab.expires', 'Expires')}
+ value={`${new Date(health.expires_at).toLocaleDateString()}${typeof health.days_remaining === 'number' ? ` (${health.days_remaining}d)` : ''}`}
+ />
)}
{issued && health.issuer && (
- <div className="app-info-item">
- <span className="app-info-label">{t('app.settingsTab.issuer', 'Issuer')}</span>
- <span className="app-info-value">{health.issuer}</span>
- </div>
+ <InfoItem label={t('app.settingsTab.issuer', 'Issuer')} value={health.issuer} />
)}
- </div>
+ </InfoList>
{primaryDomain && (
<div className="svc-give-subdomain">
diff --git a/frontend/src/styles/pages/_applications.scss b/frontend/src/styles/pages/_applications.scss
index 538f1c4d..5f509d3c 100644
--- a/frontend/src/styles/pages/_applications.scss
+++ b/frontend/src/styles/pages/_applications.scss
@@ -667,8 +667,8 @@
}
}
- .app-info-grid + .app-detail-actions,
- .app-info-grid + .hint {
+ .info-list + .app-detail-actions,
+ .info-list + .hint {
margin-top: $space-3;
}
}
@@ -684,63 +684,6 @@
}
}
-// Info grids → k/v spec rows (.sk-info-row look)
-.app-info-grid {
- display: flex;
- flex-direction: column;
- gap: 0;
-}
-
-.app-info-item {
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- align-items: center;
- gap: $space-4;
- padding: 10px 0;
- border-top: 1px solid var(--border-soft);
-
- &:first-child {
- border-top: none;
- padding-top: 0;
- }
-
- &:last-child {
- padding-bottom: 0;
- }
-}
-
-.app-info-label {
- font-family: var(--mono);
- font-size: 12px;
- color: var(--text-faint);
- min-width: 0;
- overflow-wrap: anywhere;
-}
-
-.app-info-value {
- display: inline-flex;
- align-items: center;
- justify-content: flex-end;
- flex-wrap: wrap;
- gap: $space-2;
- font-family: var(--mono);
- font-size: 12.5px;
- color: var(--text);
- text-align: right;
- min-width: 0;
- overflow-wrap: anywhere;
-
- a {
- color: var(--accent-bright);
- text-decoration: none;
-
- &:hover {
- text-decoration: underline;
- }
- }
-}
-
// Mono path chip (Root Path row)
.app-path-value {
display: inline-block;
diff --git a/frontend/src/styles/pages/_databases.scss b/frontend/src/styles/pages/_databases.scss
index 3548a2f5..0c293aa1 100644
--- a/frontend/src/styles/pages/_databases.scss
+++ b/frontend/src/styles/pages/_databases.scss
@@ -1268,67 +1268,61 @@ $dbx-sqlite: #3d8fd1;
}
// ─── Key / value facts ────────────────────────────────────
+// InfoList rows boxed for the drawer; the option list reuses the row look.
.dbx-kv {
margin: 0;
+ gap: 0;
border: 1px solid $border-default;
border-radius: $radius-md;
overflow: hidden;
- &__row {
- display: flex;
- align-items: center;
- justify-content: space-between;
+ &__ok { color: $success; }
+}
+
+.dbx-kv,
+.dbx-optlist {
+ .info-item {
gap: $space-3;
padding: 9px 13px;
- border-top: 1px solid $border-subtle;
- &:first-child { border-top: none; }
+ border-bottom: none;
- dt, .dbx-kv__key {
+ .info-label {
display: inline-flex;
align-items: center;
gap: 6px;
- margin: 0;
flex-shrink: 0;
color: $text-tertiary;
font-size: $font-size-xs;
svg { color: $text-tertiary; }
}
- dd {
- margin: 0;
+ .info-value {
min-width: 0;
- color: $text-primary;
font-size: $font-size-sm;
+ font-weight: $font-weight-normal;
text-align: right;
+
+ &.mono {
+ font-family: $font-mono;
+ font-size: $font-size-xs;
+ word-break: break-all;
+ }
}
- }
- &__mono {
- font-family: $font-mono;
- font-size: $font-size-xs;
- word-break: break-all;
+ .info-value.dbx-kv__ok { color: $success; }
}
-
- &__ok { color: $success; }
}
+.dbx-kv .info-item + .info-item { border-top: 1px solid $border-subtle; }
+
// The password is the one thing on the panel you cannot recover later, so it
-// gets reveal, regenerate and copy in the same row as the dots.
+// gets reveal, regenerate and copy in the same row.
.dbx-secret {
display: flex;
align-items: center;
justify-content: flex-end;
gap: 6px;
-
- &__value {
- font-family: $font-mono;
- font-size: $font-size-xs;
- letter-spacing: 0.06em;
- color: $text-primary;
- word-break: break-all;
- }
-
- &__actions { display: inline-flex; gap: 2px; flex-shrink: 0; }
+ min-width: 0;
}
.dbx-icon-xs {
@@ -1566,44 +1560,16 @@ $dbx-sqlite: #3d8fd1;
// ============================================
// ─── Shared: select, notices, statement preview ───────────
-.dbx-select {
- position: relative;
- display: flex;
- align-items: center;
-
- select {
- appearance: none;
- width: 100%;
- padding: 8px 30px 8px 11px;
- background: $bg-elevated;
- border: 1px solid $border-default;
- border-radius: $radius-md;
- color: $text-primary;
- font-family: inherit;
- font-size: $font-size-sm;
- cursor: pointer;
-
- &:focus {
- outline: none;
- border-color: $accent-primary;
- box-shadow: 0 0 0 3px $accent-glow;
- }
- }
-
- > svg {
- position: absolute;
- right: 10px;
- color: $text-tertiary;
- pointer-events: none;
- }
+// Radix select triggers in the builder and import modals.
+.dbx-select.ui-select-trigger {
+ width: 100%;
- &--sm {
- select {
- padding: 5px 22px 5px 8px;
- font-family: $font-mono;
- font-size: 11.5px;
- }
- > svg { right: 6px; }
+ &.dbx-select--sm {
+ height: auto;
+ min-width: 0;
+ padding: 5px 8px;
+ font-family: $font-mono;
+ font-size: 11.5px;
}
}
@@ -1823,33 +1789,7 @@ $dbx-sqlite: #3d8fd1;
}
.dbx-choice {
- display: flex;
- gap: 4px;
margin-bottom: $space-3;
- padding: 3px;
- background: $bg-tertiary;
- border-radius: $radius-md;
-
- &__btn {
- flex: 1;
- padding: 6px 10px;
- background: transparent;
- border: none;
- border-radius: $radius-sm;
- color: $text-secondary;
- font-family: inherit;
- font-size: $font-size-xs;
- cursor: pointer;
- transition: background $transition-fast, color $transition-fast;
-
- &:hover { color: $text-primary; }
- &:focus-visible { outline: 2px solid $accent-primary; outline-offset: -2px; }
- &.is-on {
- background: $bg-card;
- color: $accent-primary;
- box-shadow: $shadow-sm;
- }
- }
}
.dbx-dumps {
@@ -2014,6 +1954,7 @@ $dbx-sqlite: #3d8fd1;
&__secret {
display: flex;
+ flex-wrap: wrap;
align-items: center;
justify-content: space-between;
gap: $spacing-md;
@@ -2021,7 +1962,7 @@ $dbx-sqlite: #3d8fd1;
border: 1px dashed var(--border-soft);
border-radius: 6px;
- code { word-break: break-all; }
+ .sk-copy-field { flex: 1 1 220px; }
}
&__user-form {
@@ -2072,3 +2013,13 @@ $dbx-sqlite: #3d8fd1;
font-size: $font-size-xs;
color: $text-tertiary;
}
+
+// Created-credentials result in the explorer's create modals: one CopyField
+// per credential.
+.dbx-credentials {
+ display: flex;
+ flex-direction: column;
+ gap: $space-3;
+
+ > p { margin: 0; }
+}
diff --git a/frontend/src/styles/pages/_docker.scss b/frontend/src/styles/pages/_docker.scss
index 02205e59..c293cc3c 100644
--- a/frontend/src/styles/pages/_docker.scss
+++ b/frontend/src/styles/pages/_docker.scss
@@ -257,10 +257,6 @@
padding: $space-5;
}
-.dx-target-select {
- min-width: 160px;
-}
-
.dx-stat {
display: flex;
align-items: center;
@@ -1035,7 +1031,35 @@
// Semantic layouts and controls; declarations preserved from the legacy compatibility layer.
.docker-compose-log-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
-.docker-compose-log-select { padding-inline-start: 0.5rem; padding-inline-end: 0.5rem; padding-top: 0.5rem; padding-bottom: 0.5rem; }
+.docker-compose-log-select.ui-select-trigger { width: auto; min-width: 8rem; }
// Semantic layouts and controls; declarations preserved from the legacy compatibility layer.
.docker-compose-actions-column { text-align: right; }
+
+// Run Container modal: host → container port rows.
+.dx-run-ports {
+ display: flex;
+ flex-direction: column;
+ gap: $space-2;
+
+ &__head,
+ &__row {
+ display: grid;
+ grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
+ gap: $space-2;
+ align-items: start;
+ }
+
+ &__head {
+ font-size: $font-size-xs;
+ color: $text-tertiary;
+ }
+
+ &__sep {
+ padding-top: $space-2;
+ color: $text-tertiary;
+ font-family: $font-mono;
+ }
+
+ &__add { align-self: flex-start; }
+}
diff --git a/frontend/src/styles/pages/_service-detail.scss b/frontend/src/styles/pages/_service-detail.scss
index 020582c3..ac7d213f 100644
--- a/frontend/src/styles/pages/_service-detail.scss
+++ b/frontend/src/styles/pages/_service-detail.scss
@@ -1201,17 +1201,10 @@ h3.svc-eyebrow {
white-space: nowrap;
}
+ // Radix select triggers, sized to their content in the toolbar row.
&__select {
- background: var(--surface-2);
- border: 1px solid var(--border);
- border-radius: $radius-md;
- padding: $space-1 $space-2;
- color: $text-secondary;
- font-size: $font-size-sm;
- outline: none;
- cursor: pointer;
-
- &:focus { border-color: var(--accent-primary); }
+ width: auto;
+ min-width: 8rem;
}
&__toggle {