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 pages onto the shared field components

Juan Denise5cd50227b3b
diff --git a/frontend/src/components/TargetPicker.jsx b/frontend/src/components/TargetPicker.jsx
deleted file mode 100644
index 34c53522..00000000
--- a/frontend/src/components/TargetPicker.jsx
+++ /dev/null
@@ -1,118 +0,0 @@
-import { useEffect, useMemo, useState } from 'react';
-import { useTranslation } from 'react-i18next';
-
-import ResourcePicker from './ResourcePicker';
-import { api } from '../services/api';
-
-const enabledCapabilities = (server) => Object.entries(server?.capabilities || {})
- .filter(([, enabled]) => enabled === true)
- .map(([name]) => name);
-
-const onlineServersOnly = (resource) => (
- resource.type !== 'server' || resource.status === 'online'
-);
-
-// Compatibility adapter around ResourcePicker. Callers keep receiving the
-// operational target shape while selection itself now uses scoped ResourceRef
-// search, capability filters, keyboard navigation, and recent resources.
-export default function TargetPicker({
- feature,
- value,
- onChange,
- includeLocal = true,
- extraOptions = [],
-}) {
- const { t } = useTranslation();
- const [servers, setServers] = useState([]);
-
- useEffect(() => {
- let cancelled = false;
- api.getAvailableServers()
- .then((data) => {
- if (!cancelled) setServers(Array.isArray(data) ? data : []);
- })
- .catch(() => {
- if (!cancelled) setServers([]);
- });
- return () => { cancelled = true; };
- }, []);
-
- const localOption = useMemo(() => ({
- type: 'target',
- id: 'local',
- label: t('app.targetPicker.localThisServer', 'Local (this server)'),
- sublabel: '',
- path: '/servers',
- scope: {},
- status: 'online',
- capabilities: [],
- }), [t]);
-
- const staticOptions = useMemo(() => [
- ...(includeLocal ? [localOption] : []),
- ...extraOptions.map((option) => ({
- type: 'target',
- id: String(option.value),
- label: option.label,
- sublabel: '',
- path: '/files',
- scope: {},
- status: null,
- capabilities: [],
- })),
- ], [extraOptions, includeLocal, localOption]);
-
- const selectedResource = useMemo(() => {
- if (value?.kind === 'agent') {
- const server = servers.find((candidate) => String(candidate.id) === String(value.server_id));
- return {
- type: 'server',
- id: String(value.server_id),
- label: value.name || server?.name || server?.hostname || String(value.server_id),
- sublabel: server?.ip_address || server?.hostname || '',
- path: `/servers/${value.server_id}`,
- scope: {},
- status: server?.status || null,
- capabilities: enabledCapabilities(server),
- };
- }
- if (value?.kind && value.kind !== 'local') {
- return staticOptions.find((option) => option.id === String(value.kind)) || null;
- }
- return localOption;
- }, [localOption, servers, staticOptions, value]);
-
- const handleChange = (resource) => {
- if (resource.type === 'target') {
- onChange(resource.id === 'local' ? { kind: 'local' } : { kind: resource.id });
- return;
- }
- const server = servers.find((candidate) => String(candidate.id) === resource.id);
- onChange({
- kind: 'agent',
- server_id: resource.id,
- name: resource.label,
- allowedPaths: server?.allowed_paths || [],
- os_type: server?.os_type || null,
- agentInstallDir: server?.agent_install_dir || null,
- agentConfigDir: server?.agent_config_dir || null,
- });
- };
-
- return (
- <div className="target-picker">
- <ResourcePicker
- value={selectedResource}
- onChange={handleChange}
- types={['server']}
- capabilities={feature ? [feature] : []}
- staticOptions={staticOptions}
- filterOption={onlineServersOnly}
- label={t('app.serverPicker.filterServers', 'Filter servers')}
- placeholder={t('app.targetPicker.localThisServer', 'Local (this server)')}
- searchPlaceholder={t('app.serverPicker.findAServer', 'Find a server…')}
- className="target-picker__resource"
- />
- </div>
- );
-}
diff --git a/frontend/src/components/templates/ServerPicker.jsx b/frontend/src/components/templates/ServerPicker.jsx
deleted file mode 100644
index db9ad861..00000000
--- a/frontend/src/components/templates/ServerPicker.jsx
+++ /dev/null
@@ -1,85 +0,0 @@
-import { useMemo } from 'react';
-import { Server } from 'lucide-react';
-import { useTranslation } from 'react-i18next';
-
-import ResourcePicker from '../ResourcePicker';
-import { formatBytes } from '../../utils/formatBytes';
-
-const enabledCapabilities = (server) => Object.entries(server?.capabilities || {})
- .filter(([, enabled]) => enabled === true)
- .map(([name]) => name);
-
-function capacityLabel(server) {
- const parts = [];
- if (server.cpu_cores) parts.push(`${server.cpu_cores} vCPU`);
- if (server.total_memory) parts.push(formatBytes(server.total_memory, { decimals: 0 }));
- return parts.join(' · ');
-}
-
-function serverResource(server) {
- const capacity = capacityLabel(server);
- const location = server.is_local ? 'this panel' : (server.group_name || 'remote');
- const platform = server.os_type ? `${location} · ${server.os_type}` : location;
- const capabilities = enabledCapabilities(server);
- if ((server.is_local || server.has_docker) && !capabilities.includes('docker')) {
- capabilities.push('docker');
- }
- return {
- type: server.is_local ? 'server-target' : 'server',
- id: String(server.id),
- label: server.name || String(server.id),
- sublabel: [platform, capacity].filter(Boolean).join(' · '),
- path: server.is_local ? '/servers' : `/servers/${server.id}`,
- scope: { workspaceId: server.workspace_id ?? null },
- status: server.status || null,
- capabilities,
- };
-}
-
-export default function ServerPicker({ servers, value, onChange }) {
- const { t } = useTranslation();
- const serverById = useMemo(
- () => new Map(servers.map((server) => [String(server.id), server])),
- [servers],
- );
- const staticOptions = useMemo(
- () => servers.filter((server) => server.is_local).map(serverResource),
- [servers],
- );
- const selectedServer = serverById.get(String(value));
- const selectedResource = selectedServer ? serverResource(selectedServer) : null;
- const decorateOption = (resource) => {
- const server = serverById.get(resource.id);
- if (!server) return resource;
- const metadata = serverResource(server);
- return {
- ...resource,
- sublabel: metadata.sublabel,
- capabilities: [...new Set([...resource.capabilities, ...metadata.capabilities])],
- };
- };
-
- return (
- <ResourcePicker
- value={selectedResource}
- onChange={(resource) => {
- const server = serverById.get(resource.id);
- onChange(server?.id ?? resource.id);
- }}
- types={['server']}
- capabilities={['docker']}
- staticOptions={staticOptions}
- filterOption={(resource) => (
- resource.type === 'server-target' || serverById.has(resource.id)
- )}
- decorateOption={decorateOption}
- icon={Server}
- showCapabilities
- label={t('app.serverPicker.deployToServer', 'Deploy to server')}
- placeholder={t('app.serverPicker.deployToServer', 'Deploy to server')}
- searchPlaceholder={t('app.serverPicker.findAServer', 'Find a server…')}
- emptyMessage={t('app.serverPicker.noServersMatch', 'No servers match.')}
- className="sk-srvpick__resource-picker"
- />
- );
-}
diff --git a/frontend/src/pages/AgentFleet.jsx b/frontend/src/pages/AgentFleet.jsx
index f15c36af..43c2d278 100644
--- a/frontend/src/pages/AgentFleet.jsx
+++ b/frontend/src/pages/AgentFleet.jsx
@@ -22,6 +22,7 @@ import { useToast } from '../contexts/useToast.js';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Badge } from '@/components/ui/badge';
+import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from '@/components/ui/select';
import { Tabs, TabsList, TabsTrigger } from '@/components/ui/tabs';
import { MetricCard, KpiBand, Pill, Gauge, DataTable, DataTableFooter, statusKind } from '@/components/ds';
import { useTranslation } from 'react-i18next';
@@ -572,29 +573,30 @@ const AgentFleet = () => {
</p>
<div className="fleet-rollout-fields">
<div className="form-group">
- <label>{t('app.agentFleet.targetVersion', 'Target Version')}</label>
- <select
- className="form-select fleet-rollout-select"
- value={selectedVersion}
- onChange={e => setSelectedVersion(e.target.value)}
- >
- <option value="">{t('app.agentFleet.selectVersion', 'Select version…')}</option>
- {versions.map(v => (
- <option key={v.id} value={v.id}>v{v.version} ({v.channel})</option>
- ))}
- </select>
+ <label htmlFor="fleet-rollout-version">{t('app.agentFleet.targetVersion', 'Target Version')}</label>
+ <Select value={selectedVersion} onValueChange={setSelectedVersion}>
+ <SelectTrigger id="fleet-rollout-version" className="fleet-rollout-select">
+ <SelectValue placeholder={t('app.agentFleet.selectVersion', 'Select version…')} />
+ </SelectTrigger>
+ <SelectContent>
+ {versions.map(v => (
+ <SelectItem key={v.id} value={String(v.id)}>v{v.version} ({v.channel})</SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
</div>
<div className="form-group">
- <label>{t('app.agentFleet.rolloutStrategy', 'Rollout Strategy')}</label>
- <select
- className="form-select fleet-rollout-select"
- value={rolloutStrategy}
- onChange={e => setRolloutStrategy(e.target.value)}
- >
- <option value="all">{t('app.agentFleet.allAtOnce', 'All At Once')}</option>
- <option value="staged">{t('app.agentFleet.stagedBatchByBatch', 'Staged (Batch by Batch)')}</option>
- <option value="canary">{t('app.agentFleet.canary1ServerFirst', 'Canary (1 server first)')}</option>
- </select>
+ <label htmlFor="fleet-rollout-strategy">{t('app.agentFleet.rolloutStrategy', 'Rollout Strategy')}</label>
+ <Select value={rolloutStrategy} onValueChange={setRolloutStrategy}>
+ <SelectTrigger id="fleet-rollout-strategy" className="fleet-rollout-select">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ <SelectItem value="all">{t('app.agentFleet.allAtOnce', 'All At Once')}</SelectItem>
+ <SelectItem value="staged">{t('app.agentFleet.stagedBatchByBatch', 'Staged (Batch by Batch)')}</SelectItem>
+ <SelectItem value="canary">{t('app.agentFleet.canary1ServerFirst', 'Canary (1 server first)')}</SelectItem>
+ </SelectContent>
+ </Select>
</div>
{rolloutStrategy === 'staged' && (
<>
diff --git a/frontend/src/pages/Backups.jsx b/frontend/src/pages/Backups.jsx
index 860883cd..1197cd43 100644
--- a/frontend/src/pages/Backups.jsx
+++ b/frontend/src/pages/Backups.jsx
@@ -12,6 +12,8 @@ import { FormField, FormRow } from '../components/FormField';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Textarea } from '@/components/ui/textarea';
+import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from '@/components/ui/select';
+import { InfoList, InfoItem } from '../components/InfoList';
import {
Pill, SearchField, SegControl, DataTable, DataTableFooter,
} from '@/components/ds';
@@ -1152,31 +1154,38 @@ const Backups = () => {
<Modal open={showBackupModal} onClose={() => setShowBackupModal(false)} title={t('app.backups.createBackup', 'Create Backup')}>
<form onSubmit={handleCreateBackup} data-walkthrough="backup-create-form">
<div className="form-group">
- <label>{t('app.backups.backupType', 'Backup Type')}</label>
- <select
+ <label htmlFor="backup-type">{t('app.backups.backupType', 'Backup Type')}</label>
+ <Select
value={backupForm.type}
- onChange={(e) => setBackupForm({...backupForm, type: e.target.value})}
+ onValueChange={(type) => setBackupForm({...backupForm, type})}
>
- <option value="application">{t('app.backups.application', 'Application')}</option>
- <option value="database">{t('app.backups.databaseOnly', 'Database Only')}</option>
- <option value="files">{t('app.backups.filesDirectories', 'Files / Directories')}</option>
- </select>
+ <SelectTrigger id="backup-type"><SelectValue /></SelectTrigger>
+ <SelectContent>
+ <SelectItem value="application">{t('app.backups.application', 'Application')}</SelectItem>
+ <SelectItem value="database">{t('app.backups.databaseOnly', 'Database Only')}</SelectItem>
+ <SelectItem value="files">{t('app.backups.filesDirectories', 'Files / Directories')}</SelectItem>
+ </SelectContent>
+ </Select>
</div>
{backupForm.type === 'application' && (
<>
<div className="form-group">
- <label>{t('app.backups.application', 'Application')}</label>
- <select
+ <label htmlFor="backup-application">{t('app.backups.application', 'Application')}</label>
+ <Select
value={backupForm.applicationId}
- onChange={(e) => setBackupForm({...backupForm, applicationId: e.target.value})}
+ onValueChange={(applicationId) => setBackupForm({...backupForm, applicationId})}
required
>
- <option value="">{t('app.backups.selectApplication', 'Select Application')}</option>
- {apps.map(app => (
- <option key={app.id} value={app.id}>{app.name}</option>
- ))}
- </select>
+ <SelectTrigger id="backup-application">
+ <SelectValue placeholder={t('app.backups.selectApplication', 'Select Application')} />
+ </SelectTrigger>
+ <SelectContent>
+ {apps.map(app => (
+ <SelectItem key={app.id} value={String(app.id)}>{app.name}</SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
</div>
<div className="form-group">
@@ -1220,14 +1229,17 @@ const Backups = () => {
{(backupForm.type === 'database' || backupForm.includeDb) && (
<>
<div className="form-group">
- <label>{t('app.backups.databaseType', 'Database Type')}</label>
- <select
+ <label htmlFor="backup-db-type">{t('app.backups.databaseType', 'Database Type')}</label>
+ <Select
value={backupForm.dbType}
- onChange={(e) => setBackupForm({...backupForm, dbType: e.target.value})}
+ onValueChange={(dbType) => setBackupForm({...backupForm, dbType})}
>
- <option value="mysql">{t('app.backups.mysql', 'MySQL')}</option>
- <option value="postgresql">{t('app.backups.postgresql', 'PostgreSQL')}</option>
- </select>
+ <SelectTrigger id="backup-db-type"><SelectValue /></SelectTrigger>
+ <SelectContent>
+ <SelectItem value="mysql">{t('app.backups.mysql', 'MySQL')}</SelectItem>
+ <SelectItem value="postgresql">{t('app.backups.postgresql', 'PostgreSQL')}</SelectItem>
+ </SelectContent>
+ </Select>
</div>
<div className="form-group">
@@ -1295,24 +1307,12 @@ const Backups = () => {
<AlertTriangle size={18} />
<span><b>{t('app.backups.warning', 'Warning:')}</b> {t('app.backups.restoringThisBackupWillOverwriteExisting', 'restoring this backup will overwrite existing data. This action cannot be undone.')}</span>
</div>
- <div className="bk-restore-details">
- <div className="sk-info-row">
- <span className="k">{t('app.backups.backupName', 'Backup Name')}</span>
- <span className="v">{selectedBackup.name || selectedBackup.app_name}</span>
- </div>
- <div className="sk-info-row">
- <span className="k">{t('common.labels.type', 'Type')}</span>
- <span className="v">{selectedBackup.type}</span>
- </div>
- <div className="sk-info-row">
- <span className="k">{t('common.labels.created', 'Created')}</span>
- <span className="v">{formatTimestamp(selectedBackup.timestamp)}</span>
- </div>
- <div className="sk-info-row">
- <span className="k">{t('common.labels.size', 'Size')}</span>
- <span className="v">{formatBytes(selectedBackup.size, { defaultValue: '0 B' })}</span>
- </div>
- </div>
+ <InfoList>
+ <InfoItem label={t('app.backups.backupName', 'Backup Name')} value={selectedBackup.name || selectedBackup.app_name} />
+ <InfoItem label={t('common.labels.type', 'Type')} value={selectedBackup.type} />
+ <InfoItem label={t('common.labels.created', 'Created')} value={formatTimestamp(selectedBackup.timestamp)} />
+ <InfoItem label={t('common.labels.size', 'Size')} value={formatBytes(selectedBackup.size, { defaultValue: '0 B' })} />
+ </InfoList>
</>)}
<div className="modal-actions">
<Button variant="outline" onClick={() => setShowRestoreModal(false)}>
diff --git a/frontend/src/pages/CloudProvision.jsx b/frontend/src/pages/CloudProvision.jsx
index 39f6e85c..d6e64165 100644
--- a/frontend/src/pages/CloudProvision.jsx
+++ b/frontend/src/pages/CloudProvision.jsx
@@ -10,6 +10,7 @@ import EmptyState from '../components/EmptyState';
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 { Badge } from '@/components/ui/badge';
import { Tabs, TabsList, TabsTrigger, TabsContent } from '@/components/ui/tabs';
import { Cloud, Server } from 'lucide-react';
@@ -204,7 +205,15 @@ const CloudProvision = () => {
</>
)}
>
- <div className="form-group"><label>{t('app.cloudProvision.provider', 'Provider')}</label><select className="form-select" value={providerForm.provider_type} onChange={e => setProviderForm({...providerForm, provider_type: e.target.value})}>{Object.entries(providerTypes).map(([k,v]) => <option key={k} value={k}>{v}</option>)}</select></div>
+ <div className="form-group">
+ <label htmlFor="cloud-provider-type">{t('app.cloudProvision.provider', 'Provider')}</label>
+ <Select value={providerForm.provider_type} onValueChange={provider_type => setProviderForm({...providerForm, provider_type})}>
+ <SelectTrigger id="cloud-provider-type"><SelectValue /></SelectTrigger>
+ <SelectContent>
+ {Object.entries(providerTypes).map(([k,v]) => <SelectItem key={k} value={k}>{v}</SelectItem>)}
+ </SelectContent>
+ </Select>
+ </div>
<div className="form-group"><label>{t('common.labels.name', 'Name')}</label><Input value={providerForm.name} onChange={e => setProviderForm({...providerForm, name: e.target.value})} /></div>
<div className="form-group"><label>{t('app.cloudProvision.apiKey', 'API Key')}</label><Input type="password" value={providerForm.api_key} onChange={e => setProviderForm({...providerForm, api_key: e.target.value})} /></div>
</Modal>
@@ -220,13 +229,48 @@ const CloudProvision = () => {
</>
)}
>
- <div className="form-group"><label>{t('app.cloudProvision.provider', 'Provider')}</label><select className="form-select" value={serverForm.provider_id} onChange={e => { setServerForm({...serverForm, provider_id: parseInt(e.target.value)}); const p = providers.find(x => x.id === parseInt(e.target.value)); if (p) loadProviderOptions(p.provider_type); }}><option value="">{t('app.cloudProvision.selectProvider', 'Select provider')}</option>{providers.map(p => <option key={p.id} value={p.id}>{p.name}</option>)}</select></div>
+ <div className="form-group">
+ <label htmlFor="cloud-server-provider">{t('app.cloudProvision.provider', 'Provider')}</label>
+ <Select
+ value={serverForm.provider_id ? String(serverForm.provider_id) : ''}
+ onValueChange={v => { setServerForm({...serverForm, provider_id: parseInt(v)}); const p = providers.find(x => x.id === parseInt(v)); if (p) loadProviderOptions(p.provider_type); }}
+ >
+ <SelectTrigger id="cloud-server-provider"><SelectValue placeholder={t('app.cloudProvision.selectProvider', 'Select provider')} /></SelectTrigger>
+ <SelectContent>
+ {providers.map(p => <SelectItem key={p.id} value={String(p.id)}>{p.name}</SelectItem>)}
+ </SelectContent>
+ </Select>
+ </div>
<div className="form-group"><label>{t('app.cloudProvision.serverName', 'Server Name')}</label><Input value={serverForm.name} onChange={e => setServerForm({...serverForm, name: e.target.value})} /></div>
{providerOptions && (
<>
- <div className="form-group"><label>{t('app.cloudProvision.region', 'Region')}</label><select className="form-select" value={serverForm.region} onChange={e => setServerForm({...serverForm, region: e.target.value})}><option value="">{t('app.cloudProvision.selectRegion', 'Select region')}</option>{(providerOptions.regions || []).map(r => <option key={r} value={r}>{r}</option>)}</select></div>
- <div className="form-group"><label>{t('common.labels.size', 'Size')}</label><select className="form-select" value={serverForm.size} onChange={e => setServerForm({...serverForm, size: e.target.value})}><option value="">{t('app.cloudProvision.selectSize', 'Select size')}</option>{(providerOptions.sizes || []).map(s => <option key={s} value={s}>{s}</option>)}</select></div>
- <div className="form-group"><label>{t('app.cloudProvision.image', 'Image')}</label><select className="form-select" value={serverForm.image} onChange={e => setServerForm({...serverForm, image: e.target.value})}><option value="">{t('app.cloudProvision.selectImage', 'Select image')}</option>{(providerOptions.images || []).map(i => <option key={i} value={i}>{i}</option>)}</select></div>
+ <div className="form-group">
+ <label htmlFor="cloud-server-region">{t('app.cloudProvision.region', 'Region')}</label>
+ <Select value={serverForm.region} onValueChange={region => setServerForm({...serverForm, region})}>
+ <SelectTrigger id="cloud-server-region"><SelectValue placeholder={t('app.cloudProvision.selectRegion', 'Select region')} /></SelectTrigger>
+ <SelectContent>
+ {(providerOptions.regions || []).filter(Boolean).map(r => <SelectItem key={r} value={r}>{r}</SelectItem>)}
+ </SelectContent>
+ </Select>
+ </div>
+ <div className="form-group">
+ <label htmlFor="cloud-server-size">{t('common.labels.size', 'Size')}</label>
+ <Select value={serverForm.size} onValueChange={size => setServerForm({...serverForm, size})}>
+ <SelectTrigger id="cloud-server-size"><SelectValue placeholder={t('app.cloudProvision.selectSize', 'Select size')} /></SelectTrigger>
+ <SelectContent>
+ {(providerOptions.sizes || []).filter(Boolean).map(s => <SelectItem key={s} value={s}>{s}</SelectItem>)}
+ </SelectContent>
+ </Select>
+ </div>
+ <div className="form-group">
+ <label htmlFor="cloud-server-image">{t('app.cloudProvision.image', 'Image')}</label>
+ <Select value={serverForm.image} onValueChange={image => setServerForm({...serverForm, image})}>
+ <SelectTrigger id="cloud-server-image"><SelectValue placeholder={t('app.cloudProvision.selectImage', 'Select image')} /></SelectTrigger>
+ <SelectContent>
+ {(providerOptions.images || []).filter(Boolean).map(i => <SelectItem key={i} value={i}>{i}</SelectItem>)}
+ </SelectContent>
+ </Select>
+ </div>
</>
)}
<div className="form-group"><label className="checkbox-label"><input type="checkbox" checked={serverForm.install_agent} onChange={e => setServerForm({...serverForm, install_agent: e.target.checked})} /> {t('app.cloudProvision.autoInstallServerkitAgent', 'Auto-install ServerKit agent')}</label></div>
diff --git a/frontend/src/pages/Dashboard.jsx b/frontend/src/pages/Dashboard.jsx
index ceea7c05..24c11a71 100644
--- a/frontend/src/pages/Dashboard.jsx
+++ b/frontend/src/pages/Dashboard.jsx
@@ -1,6 +1,6 @@
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import {
- Check, ChevronDown, Grid2x2, History, Keyboard, Maximize2, Plus,
+ Grid2x2, History, Keyboard, Maximize2, Plus,
RefreshCw, SlidersHorizontal, X,
} from 'lucide-react';
import api from '../services/api';
@@ -8,7 +8,8 @@ import { useAuth } from '../contexts/useAuth.js';
import { useToast } from '../contexts/useToast.js';
import { useMetrics } from '../hooks/useMetrics';
import useDashboardBoards from '../hooks/useDashboardBoards';
-import { Popover, PopoverTrigger, PopoverContent } from '@/components/ui/popover';
+import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from '@/components/ui/select';
+import ServerPicker from '../components/ServerPicker';
import { SegControl } from '@/components/ds';
import { Button } from '@/components/ui/button';
import ChangeBar from '../components/ds/ChangeBar';
@@ -80,7 +81,6 @@ const Dashboard = () => {
const [systemInfo, setSystemInfo] = useState(null);
const [servers, setServers] = useState([]);
const [selectedServer, setSelectedServer] = useState({ id: 'local', name: 'Local (this server)' });
- const [serverMenuOpen, setServerMenuOpen] = useState(false);
const [remoteMetrics, setRemoteMetrics] = useState(null);
const [remoteSystemInfo, setRemoteSystemInfo] = useState(null);
const isRemote = selectedServer.id !== 'local';
@@ -408,8 +408,10 @@ const Dashboard = () => {
await removeBoard(boardId);
}, [leaveEditor, removeBoard]);
- const handleServerChange = (serverId) => {
- const server = servers.find((s) => s.id === serverId) || { id: 'local', name: 'Local (this server)' };
+ const handleServerChange = (serverId, row) => {
+ const server = row
+ || servers.find((s) => String(s.id) === String(serverId))
+ || { id: 'local', name: 'Local (this server)' };
setSelectedServer(server);
lastServerUptime.current = null;
lastServerTime.current = null;
@@ -555,49 +557,12 @@ const Dashboard = () => {
<span className="skw-varpick__v">{hostname}</span>
</span>
) : (
- <Popover open={serverMenuOpen} onOpenChange={setServerMenuOpen}>
- <PopoverTrigger asChild>
- <Button variant="unstyled"
- type="button"
- className={`skw-varpick${serverMenuOpen ? ' is-open' : ''}`}
- aria-label={t('app.dashboard.switchServer', 'Switch server')}
- >
- <span className="skw-varpick__k mono">server</span>
- <span className="skw-varpick__v">{selectedServer.name || hostname}</span>
- <ChevronDown size={13} aria-hidden="true" />
- </Button>
- </PopoverTrigger>
- <PopoverContent align="start" sideOffset={7} className="env-menu">
- <div className="env-menu__head">{t('app.dashboard.dashboardVariableServer', 'Dashboard variable · $server')}</div>
- {servers.map((server) => {
- const online = server.status === 'online';
- return (
- <Button variant="unstyled"
- type="button"
- key={server.id}
- className="env-opt"
- onClick={() => { handleServerChange(server.id); setServerMenuOpen(false); }}
- >
- <span
- className={`env-opt__dot env-opt__dot--${online ? 'online' : 'offline'}`}
- aria-hidden="true"
- ></span>
- <span className="env-opt__body">
- <span className="env-opt__name">{server.name}</span>
- <span className="env-opt__meta">
- {server.group_name || (server.is_local ? 'local' : server.id)}
- {' · '}
- {online ? 'online' : 'offline'}
- </span>
- </span>
- {server.id === selectedServer.id && (
- <span className="env-opt__check" aria-hidden="true"><Check size={15} /></span>
- )}
- </Button>
- );
- })}
- </PopoverContent>
- </Popover>
+ <ServerPicker
+ value={selectedServer.id}
+ onChange={handleServerChange}
+ label={t('app.dashboard.switchServer', 'Switch server')}
+ className="skw-serverpick"
+ />
)}
<SegControl
options={RANGES.map(([value, label]) => ({ value, label }))}
@@ -605,18 +570,23 @@ const Dashboard = () => {
onChange={setRange}
aria-label={t('app.dashboard.timeRange', 'Time range')}
/>
- <div className="skw-refresh">
- <select
- value={refreshInterval}
- onChange={(e) => handleRefreshIntervalChange(parseInt(e.target.value, 10))}
+ <Select
+ value={String(refreshInterval)}
+ onValueChange={(value) => handleRefreshIntervalChange(parseInt(value, 10))}
+ >
+ <SelectTrigger
+ className="skw-refresh-trigger"
title={t('app.dashboard.autoRefreshInterval', 'Auto-refresh interval')}
aria-label={t('app.dashboard.autoRefreshInterval', 'Auto-refresh interval')}
>
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
{REFRESH_OPTIONS.map((opt) => (
- <option key={opt.value} value={opt.value}>↻ {opt.label}</option>
+ <SelectItem key={opt.value} value={String(opt.value)}>↻ {opt.label}</SelectItem>
))}
- </select>
- </div>
+ </SelectContent>
+ </Select>
<Button variant="unstyled"
type="button"
className="skw-iconbtn"
diff --git a/frontend/src/pages/Databases.jsx b/frontend/src/pages/Databases.jsx
index 9be07c39..8bfa3256 100644
--- a/frontend/src/pages/Databases.jsx
+++ b/frontend/src/pages/Databases.jsx
@@ -35,7 +35,7 @@ import {
engineBrandKey, engineInstanceKey, engineTreeStatus, engineUnit, singular,
} from '../components/databases/engineHelpers';
import { listTables, connKey, connLabel, quoteIdent, ENGINE_META } from '../components/databases/dbAdapter';
-import { copyToClipboard } from '@/utils/clipboard';
+import { useClipboard } from '@/hooks/useClipboard';
import { usePolling } from '@/hooks/usePolling';
import { useTranslation } from 'react-i18next';
import { Button as SharedButton, Button } from '@/components/ui/button';
@@ -94,6 +94,10 @@ export default function Databases() {
const { t } = useTranslation();
const toast = useToast();
const { confirm } = useConfirm();
+ const { copy } = useClipboard({
+ successMessage: t('app.databases.copiedName', 'Copied name'),
+ errorMessage: t('app.databases.couldNotCopy', 'Could not copy'),
+ });
const navigate = useNavigate();
const [searchParams, setSearchParams] = useSearchParams();
@@ -578,9 +582,7 @@ export default function Databases() {
}
function copyName(node) {
- copyToClipboard(node.label).then((ok) => (ok
- ? toast.success(t('app.databases.copiedName', 'Copied name'))
- : toast.error(t('app.databases.couldNotCopy', 'Could not copy'))));
+ copy(node.label);
}
function ctxActions(node) {
diff --git a/frontend/src/pages/DeployConsole.jsx b/frontend/src/pages/DeployConsole.jsx
index e78098bd..0c139ce2 100644
--- a/frontend/src/pages/DeployConsole.jsx
+++ b/frontend/src/pages/DeployConsole.jsx
@@ -10,7 +10,7 @@ import LogPane from '../components/deploy-console/LogPane';
import ErrorCard from '../components/deploy-console/ErrorCard';
import SuccessBanner from '../components/deploy-console/SuccessBanner';
import { sourceRef } from '../utils/deployActivity';
-import { copyToClipboard } from '@/utils/clipboard';
+import { useClipboard } from '@/hooks/useClipboard';
import { downloadBlob } from '@/utils/downloadBlob';
import { useTranslation } from 'react-i18next';
@@ -65,6 +65,7 @@ export default function DeployConsole() {
const { jobId } = useParams();
const navigate = useNavigate();
const { job, lines, isLive, transport, error, loading } = useDeployJobStream(jobId, { includePlan: true });
+ const { copy } = useClipboard({ successMessage: t('app.deployConsole.logsCopied', 'Logs copied') });
const [follow, setFollow] = useState(true);
const [wrap, setWrap] = useState(true);
@@ -193,8 +194,8 @@ export default function DeployConsole() {
const copyLogs = useCallback(() => {
const text = lines.map((l) => l.message).join('\n');
- copyToClipboard(text);
- }, [lines]);
+ copy(text);
+ }, [lines, copy]);
const downloadLogs = useCallback(() => {
const text = lines.map((l) => {
diff --git a/frontend/src/pages/Deployments.jsx b/frontend/src/pages/Deployments.jsx
index aa73b8f3..d5a6bd92 100644
--- a/frontend/src/pages/Deployments.jsx
+++ b/frontend/src/pages/Deployments.jsx
@@ -5,7 +5,7 @@ import api from '../services/api';
import Modal from '../components/Modal';
import EmptyState from '../components/EmptyState';
import { Button } from '@/components/ui/button';
-import { DataTable, DataTableFooter, Pill, SearchField, statusKind } from '@/components/ds';
+import { DataTable, DataTableFooter, Pill, SearchField, SegControl, statusKind } from '@/components/ds';
import {
useTableChrome, GridViewPicker, GridChips, GridFilterButton,
GridToolsMenu, GridFilterDrawer,
@@ -417,13 +417,18 @@ const Deployments = () => {
<p className="deployments-page__sim-intro">
{t('app.deployments.streamsScriptedOutputThroughTheReal', 'Streams scripted output through the real deploy pipeline — no containers, files, or servers are touched. Development only.')}
</p>
- <label className="deployments-page__sim-speed">
- {t('app.deployments.speed', 'Speed')}
- <select value={simSpeed} onChange={(e) => setSimSpeed(e.target.value)}>
- <option value="fast">{t('app.deployments.fast', 'Fast')}</option>
- <option value="realtime">{t('app.deployments.realtime', 'Realtime')}</option>
- </select>
- </label>
+ <div className="deployments-page__sim-speed">
+ <span>{t('app.deployments.speed', 'Speed')}</span>
+ <SegControl
+ options={[
+ { value: 'fast', label: t('app.deployments.fast', 'Fast') },
+ { value: 'realtime', label: t('app.deployments.realtime', 'Realtime') },
+ ]}
+ value={simSpeed}
+ onChange={setSimSpeed}
+ aria-label={t('app.deployments.speed', 'Speed')}
+ />
+ </div>
<div className="deployments-page__sim-list">
{(simInfo?.scenarios || []).map((s) => (
<Button variant="unstyled"
diff --git a/frontend/src/pages/Docker.jsx b/frontend/src/pages/Docker.jsx
index 8a8d53f1..7c81c45f 100644
--- a/frontend/src/pages/Docker.jsx
+++ b/frontend/src/pages/Docker.jsx
@@ -4,9 +4,7 @@ import api from '../services/api';
import EmptyState from '../components/EmptyState';
import { Button } from '@/components/ui/button';
import { MetricCard, KpiBand } from '@/components/ds';
-import {
- Select, SelectTrigger, SelectContent, SelectItem, SelectValue,
-} from '@/components/ui/select';
+import ServerPicker from '../components/ServerPicker';
import PageLayout from '@/layouts/PageLayout';
import { Box, Layers, HardDrive, Network as NetworkIcon, Package } from 'lucide-react';
import {
@@ -241,23 +239,16 @@ const Docker = () => {
actions={(
<>
{hasMultipleTargets && (
- <Select
+ <ServerPicker
value={String(selectedServer.id)}
- onValueChange={(id) => setSelectedServer(
- availableServers.find(server => String(server.id) === id) || LOCAL_DOCKER_TARGET
+ capability="docker"
+ label={t('app.docker.targets', 'Targets')}
+ onChange={(id, server) => setSelectedServer(
+ server
+ || availableServers.find(row => String(row.id) === String(id))
+ || LOCAL_DOCKER_TARGET
)}
- >
- <SelectTrigger className="dx-target-select" aria-label={t('app.docker.targets', 'Targets')}>
- <SelectValue />
- </SelectTrigger>
- <SelectContent>
- {availableServers.map(server => (
- <SelectItem key={server.id} value={String(server.id)}>
- {server.name || server.hostname || server.id}
- </SelectItem>
- ))}
- </SelectContent>
- </Select>
+ />
)}
<PruneButton onPruned={loadStats} />
{activeTab === 'containers' && <RunContainerButton />}
diff --git a/frontend/src/pages/Downloads.jsx b/frontend/src/pages/Downloads.jsx
index 60a705ff..40127f7f 100644
--- a/frontend/src/pages/Downloads.jsx
+++ b/frontend/src/pages/Downloads.jsx
@@ -2,7 +2,7 @@ import { useState, useEffect } from 'react';
import api from '../services/api';
import { Button } from '@/components/ui/button';
import { useTopbarActions } from '@/hooks/useTopbarActions';
-import { copyToClipboard } from '@/utils/clipboard';
+import CopyField from '../components/CopyField';
import { scrollBehavior } from '@/utils/reducedMotion';
import { useTranslation } from 'react-i18next';
@@ -42,19 +42,6 @@ const DownloadIcon = () => (
</svg>
);
-const CopyIcon = () => (
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
- <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>
-);
-
-const CheckIcon = () => (
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
- <polyline points="20,6 9,17 4,12" />
- </svg>
-);
-
const RefreshIcon = () => (
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
<polyline points="23,4 23,10 17,10" />
@@ -68,7 +55,6 @@ function Downloads() {
const [versionInfo, setVersionInfo] = useState(null);
const [loading, setLoading] = useState(true);
const [error, setError] = useState(null);
- const [copiedCommand, setCopiedCommand] = useState(null);
useEffect(() => {
fetchVersionInfo();
@@ -87,12 +73,6 @@ function Downloads() {
}
};
- const copyCommand = async (text, commandId) => {
- if (!await copyToClipboard(text)) return;
- setCopiedCommand(commandId);
- setTimeout(() => setCopiedCommand(null), 2000);
- };
-
const getBaseUrl = () => {
// Get the base URL for the API
if (import.meta.env.PROD) {
@@ -250,16 +230,7 @@ function Downloads() {
<h3>{t('app.downloads.linuxBash', 'Linux (Bash)')}</h3>
</div>
<div className="command-content">
- <pre>
- <code>{platforms[0].command}</code>
- </pre>
- <Button variant="unstyled" type="button"
- className="copy-btn"
- onClick={() => copyCommand(platforms[0].command, 'linux')}
- title={t('app.downloads.copyToClipboard', 'Copy to clipboard')}
- >
- {copiedCommand === 'linux' ? <CheckIcon /> : <CopyIcon />}
- </Button>
+ <CopyField value={platforms[0].command} multiline />
</div>
</div>
@@ -269,16 +240,7 @@ function Downloads() {
<h3>{t('app.downloads.windowsPowershell', 'Windows (PowerShell)')}</h3>
</div>
<div className="command-content">
- <pre>
- <code>{platforms[2].command}</code>
- </pre>
- <Button variant="unstyled" type="button"
- className="copy-btn"
- onClick={() => copyCommand(platforms[2].command, 'windows')}
- title={t('app.downloads.copyToClipboard', 'Copy to clipboard')}
- >
- {copiedCommand === 'windows' ? <CheckIcon /> : <CopyIcon />}
- </Button>
+ <CopyField value={platforms[2].command} multiline />
</div>
<p className="command-note">{t('app.downloads.runPowershellAsAdministrator', 'Run PowerShell as Administrator')}</p>
</div>
@@ -312,7 +274,7 @@ function Downloads() {
<div className="step-content">
<h4>{t('app.downloads.registerTheAgent', 'Register the Agent')}</h4>
<p>{t('app.downloads.runTheRegistrationCommandWithYour', 'Run the registration command with your token:')}</p>
- <pre><code>{`serverkit-agent register --token "YOUR_TOKEN" --server "${getBaseUrl()}"`}</code></pre>
+ <CopyField value={`serverkit-agent register --token "YOUR_TOKEN" --server "${getBaseUrl()}"`} multiline />
</div>
</div>
<div className="step">
@@ -320,7 +282,7 @@ function Downloads() {
<div className="step-content">
<h4>{t('app.downloads.startTheAgent', 'Start the Agent')}</h4>
<p>{t('app.downloads.startTheAgentService', 'Start the agent service:')}</p>
- <pre><code>{t('app.downloads.serverkitAgentStart', 'serverkit-agent start')}</code></pre>
+ <CopyField value={t('app.downloads.serverkitAgentStart', 'serverkit-agent start')} />
<p className="step-note">{t('app.downloads.orUseSystemdWindowsServiceFor', 'Or use systemd/Windows Service for automatic startup')}</p>
</div>
</div>
@@ -345,7 +307,7 @@ function Downloads() {
</Button>
)}
<div className="verification-command">
- <pre><code>{t('app.downloads.sha256sumCChecksumsTxt', 'sha256sum -c checksums.txt')}</code></pre>
+ <CopyField value={t('app.downloads.sha256sumCChecksumsTxt', 'sha256sum -c checksums.txt')} />
</div>
</section>
</>
diff --git a/frontend/src/pages/FTPServer.jsx b/frontend/src/pages/FTPServer.jsx
index dbe4af93..8a17d8b7 100644
--- a/frontend/src/pages/FTPServer.jsx
+++ b/frontend/src/pages/FTPServer.jsx
@@ -20,6 +20,8 @@ import Modal from '@/components/Modal';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
+import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from '@/components/ui/select';
+import { InfoList, InfoItem } from '../components/InfoList';
import { Badge } from '@/components/ui/badge';
import { Tabs, TabsList, TabsTrigger, TabsContent } from '@/components/ui/tabs';
import { useTranslation } from 'react-i18next';
@@ -602,42 +604,22 @@ function FTPServer() {
<div className="config-section">
<h3>{t('app.fTPServer.serverConfiguration', 'Server Configuration')}</h3>
{config?.settings ? (
- <div className="config-grid">
- <div className="config-item">
- <span className="config-label">{t('common.labels.port', 'Port')}</span>
- <span className="config-value">{config.settings.listen_port || config.settings.port || 21}</span>
- </div>
- <div className="config-item">
- <span className="config-label">{t('app.fTPServer.anonymousAccess', 'Anonymous Access')}</span>
- <span className={`config-value ${config.settings.anonymous_enable ? 'warning' : 'success'}`}>
+ <InfoList>
+ <InfoItem label={t('common.labels.port', 'Port')} value={config.settings.listen_port || config.settings.port || 21} mono />
+ <InfoItem label={t('app.fTPServer.anonymousAccess', 'Anonymous Access')}>
+ <span className={`info-value mono ${config.settings.anonymous_enable ? 'warning' : 'success'}`}>
{config.settings.anonymous_enable ? 'Enabled' : 'Disabled'}
</span>
- </div>
- <div className="config-item">
- <span className="config-label">{t('app.fTPServer.localUsers', 'Local Users')}</span>
- <span className="config-value">
- {config.settings.local_enable ? 'Enabled' : 'Disabled'}
- </span>
- </div>
- <div className="config-item">
- <span className="config-label">{t('app.fTPServer.writePermission', 'Write Permission')}</span>
- <span className="config-value">
- {config.settings.write_enable ? 'Enabled' : 'Disabled'}
- </span>
- </div>
- <div className="config-item">
- <span className="config-label">{t('app.fTPServer.chrootUsers', 'Chroot Users')}</span>
- <span className="config-value">
- {config.settings.chroot_local_user ? 'Yes' : 'No'}
- </span>
- </div>
- <div className="config-item">
- <span className="config-label">{t('app.fTPServer.sslTls', 'SSL/TLS')}</span>
- <span className={`config-value ${config.settings.ssl_enable ? 'success' : 'warning'}`}>
+ </InfoItem>
+ <InfoItem label={t('app.fTPServer.localUsers', 'Local Users')} value={config.settings.local_enable ? 'Enabled' : 'Disabled'} mono />
+ <InfoItem label={t('app.fTPServer.writePermission', 'Write Permission')} value={config.settings.write_enable ? 'Enabled' : 'Disabled'} mono />
+ <InfoItem label={t('app.fTPServer.chrootUsers', 'Chroot Users')} value={config.settings.chroot_local_user ? 'Yes' : 'No'} mono />
+ <InfoItem label={t('app.fTPServer.sslTls', 'SSL/TLS')}>
+ <span className={`info-value mono ${config.settings.ssl_enable ? 'success' : 'warning'}`}>
{config.settings.ssl_enable ? 'Enabled' : 'Disabled'}
</span>
- </div>
- </div>
+ </InfoItem>
+ </InfoList>
) : (
<p className="text-muted">{t('app.fTPServer.configurationNotAvailable', 'Configuration not available')}</p>
)}
@@ -645,20 +627,11 @@ function FTPServer() {
<div className="info-section">
<h3>{t('app.fTPServer.connectionInformation', 'Connection Information')}</h3>
- <div className="info-grid">
- <div className="info-item">
- <span className="info-label">{t('app.fTPServer.host', 'Host')}</span>
- <code>{t('app.fTPServer.yourServerIpOrDomain', 'Your server IP or domain')}</code>
- </div>
- <div className="info-item">
- <span className="info-label">{t('common.labels.port', 'Port')}</span>
- <code>21</code>
- </div>
- <div className="info-item">
- <span className="info-label">{t('app.fTPServer.protocol', 'Protocol')}</span>
- <code>FTP{config?.settings?.ssl_enable ? 'S' : ''}</code>
- </div>
- </div>
+ <InfoList>
+ <InfoItem label={t('app.fTPServer.host', 'Host')} value={t('app.fTPServer.yourServerIpOrDomain', 'Your server IP or domain')} mono />
+ <InfoItem label={t('common.labels.port', 'Port')} value="21" mono />
+ <InfoItem label={t('app.fTPServer.protocol', 'Protocol')} value={`FTP${config?.settings?.ssl_enable ? 'S' : ''}`} mono />
+ </InfoList>
</div>
</div>
</TabsContent>
@@ -795,14 +768,14 @@ function FTPServer() {
{/* Install Modal */}
<Modal open={showInstallModal} onClose={() => setShowInstallModal(false)} title={t('app.fTPServer.installFtpServer', 'Install FTP Server')}>
<div className="form-group">
- <Label>{t('app.fTPServer.selectFtpServer', 'Select FTP Server')}</Label>
- <select
- value={selectedService}
- onChange={(e) => setSelectedService(e.target.value)}
- >
- <option value="vsftpd">{t('app.fTPServer.vsftpdRecommended', 'vsftpd (Recommended)')}</option>
- <option value="proftpd">{t('app.fTPServer.proftpd', 'ProFTPD')}</option>
- </select>
+ <Label htmlFor="ftp-install-service">{t('app.fTPServer.selectFtpServer', 'Select FTP Server')}</Label>
+ <Select value={selectedService} onValueChange={setSelectedService}>
+ <SelectTrigger id="ftp-install-service"><SelectValue /></SelectTrigger>
+ <SelectContent>
+ <SelectItem value="vsftpd">{t('app.fTPServer.vsftpdRecommended', 'vsftpd (Recommended)')}</SelectItem>
+ <SelectItem value="proftpd">{t('app.fTPServer.proftpd', 'ProFTPD')}</SelectItem>
+ </SelectContent>
+ </Select>
</div>
<div className="install-info">
{selectedService === 'vsftpd' ? (
diff --git a/frontend/src/pages/FileManager.jsx b/frontend/src/pages/FileManager.jsx
index c718f357..2b9fdeef 100644
--- a/frontend/src/pages/FileManager.jsx
+++ b/frontend/src/pages/FileManager.jsx
@@ -23,9 +23,11 @@ import FileCard from '../components/file-manager/FileCard';
import FileRow from '../components/file-manager/FileRow';
import PreviewDrawer from '../components/file-manager/PreviewDrawer';
import ContextMenu from '../components/file-manager/ContextMenu';
-import TargetPicker from '../components/TargetPicker';
+import ServerPicker from '../components/ServerPicker';
+import { serverTarget, targetServerId } from '../utils/serverTarget';
+import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from '@/components/ui/select';
import { TREE_ROOTS, getFileType, formatBytes } from '../components/file-manager/fileTypes';
-import { copyToClipboard } from '@/utils/clipboard';
+import { useClipboard } from '@/hooks/useClipboard';
import { useTranslation } from 'react-i18next';
import { useTopbarActions } from '@/hooks/useTopbarActions';
@@ -139,11 +141,19 @@ function FileManager() {
const [target, setTarget] = useState({ kind: 'local' });
const isRemote = target.kind === 'agent';
const isS3 = target.kind === 's3';
+ const { copy: copyText } = useClipboard({
+ successMessage: t('app.fileManager.pathCopied', 'Path copied'),
+ errorMessage: t('app.fileManager.couldNotCopyPath', 'Could not copy path'),
+ });
const previousTargetRef = useRef({ kind: 'local', server_id: null });
// The "S3 bucket" target is offered only when an S3-compatible backup
// destination is configured (Connections → Storage, or the Backups page).
const [s3Available, setS3Available] = useState(false);
+ const s3Options = useMemo(
+ () => (s3Available ? [{ value: 's3', label: t('app.fileManager.s3Bucket', 'S3 bucket') }] : []),
+ [s3Available, t],
+ );
useEffect(() => {
let cancelled = false;
api.getStorageConfig()
@@ -879,10 +889,7 @@ function FileManager() {
setContextMenu({ x: e.clientX, y: e.clientY, entry });
};
- const copyPathToClipboard = async (path) => {
- if (await copyToClipboard(path)) toast.success(t('app.fileManager.pathCopied', 'Path copied'));
- else toast.error(t('app.fileManager.couldNotCopyPath', 'Could not copy path'));
- };
+ const copyPathToClipboard = (path) => copyText(path);
const downloadSelected = () => {
selectedEntries.filter((e) => !e.is_dir).forEach((e) => fileApi.download(e));
@@ -1028,39 +1035,43 @@ function FileManager() {
)}
</div>
<div className="toolbar-right">
- <label className="file-toolbar-select" title={t('app.fileManager.types', 'Types')}>
- <File size={13} />
- <select
- value={activeFilter}
- onChange={(event) => setActiveFilter(event.target.value)}
+ <Select value={activeFilter} onValueChange={setActiveFilter}>
+ <SelectTrigger
+ className="file-toolbar-select"
+ title={t('app.fileManager.types', 'Types')}
aria-label={t('app.fileManager.types', 'Types')}
>
+ <File size={13} aria-hidden="true" />
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
{FILTER_OPTIONS.map((option) => (
- <option key={option.id} value={option.id}>
+ <SelectItem key={option.id} value={option.id}>
{filterLabels[option.id]} ({filterCounts[option.id] ?? 0})
- </option>
+ </SelectItem>
))}
- </select>
- <ChevronDown size={12} />
- </label>
- <label className="file-toolbar-select" title={t('app.fileManager.sort', 'Sort')}>
- <ArrowUpDown size={13} />
- <select
- value={sortValue}
- onChange={(event) => handleSortChange(event.target.value)}
+ </SelectContent>
+ </Select>
+ <Select value={sortValue} onValueChange={handleSortChange}>
+ <SelectTrigger
+ className="file-toolbar-select"
+ title={t('app.fileManager.sort', 'Sort')}
aria-label={t('app.fileManager.sort', 'Sort')}
>
- <option value="name-asc">{t('app.fileManager.nameAZ', 'Name A-Z')}</option>
- <option value="name-desc">{t('app.fileManager.nameZA', 'Name Z-A')}</option>
- <option value="modified-desc">{t('app.fileManager.newest', 'Newest')}</option>
- <option value="modified-asc">{t('app.fileManager.oldest', 'Oldest')}</option>
- <option value="size-desc">{t('app.fileManager.largest', 'Largest')}</option>
- <option value="size-asc">{t('app.fileManager.smallest', 'Smallest')}</option>
- <option value="type-asc">{t('common.labels.type', 'Type')}</option>
- <option value="type-desc">{t('app.fileManager.typeZA', 'Type Z-A')}</option>
- </select>
- <ChevronDown size={12} />
- </label>
+ <ArrowUpDown size={13} aria-hidden="true" />
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ <SelectItem value="name-asc">{t('app.fileManager.nameAZ', 'Name A-Z')}</SelectItem>
+ <SelectItem value="name-desc">{t('app.fileManager.nameZA', 'Name Z-A')}</SelectItem>
+ <SelectItem value="modified-desc">{t('app.fileManager.newest', 'Newest')}</SelectItem>
+ <SelectItem value="modified-asc">{t('app.fileManager.oldest', 'Oldest')}</SelectItem>
+ <SelectItem value="size-desc">{t('app.fileManager.largest', 'Largest')}</SelectItem>
+ <SelectItem value="size-asc">{t('app.fileManager.smallest', 'Smallest')}</SelectItem>
+ <SelectItem value="type-asc">{t('common.labels.type', 'Type')}</SelectItem>
+ <SelectItem value="type-desc">{t('app.fileManager.typeZA', 'Type Z-A')}</SelectItem>
+ </SelectContent>
+ </Select>
<div className="search-field">
<Search size={14} className="search-field-icon" />
<input
@@ -1155,11 +1166,12 @@ function FileManager() {
>
<X size={14} />
</Button>
- <TargetPicker
- feature="files"
- value={target}
- onChange={setTarget}
- extraOptions={s3Available ? [{ value: 's3', labelKey: 'app.fileManager.s3Bucket', label: 'S3 bucket' }] : []}
+ <ServerPicker
+ capability="files"
+ value={targetServerId(target)}
+ onChange={(id, server) => setTarget(serverTarget(id, server || (id === 's3' ? null : {})))}
+ extraOptions={s3Options}
+ className="file-manager-source__picker"
/>
<div className="file-manager-source__meta">
<span className={`file-manager-source__dot${isS3 ? ' is-cloud' : ''}`} aria-hidden="true" />
diff --git a/frontend/src/pages/Marketplace.jsx b/frontend/src/pages/Marketplace.jsx
index 4a68ad8a..c1bb34b9 100644
--- a/frontend/src/pages/Marketplace.jsx
+++ b/frontend/src/pages/Marketplace.jsx
@@ -27,6 +27,9 @@ import PageLoader from '../components/PageLoader';
import EmptyState from '../components/EmptyState';
import { Button } from '@/components/ui/button';
import { Badge } from '@/components/ui/badge';
+import {
+ Select, SelectTrigger, SelectContent, SelectItem, SelectValue,
+} from '@/components/ui/select';
import {
SearchField, FilterDrawer, FilterButton, countActiveFilters,
CatalogCard, CatalogGrid,
@@ -1109,15 +1112,24 @@ const PluginConfigDialog = ({ plugin, onClose }) => {
onChange={(e) => setField(key, e.target.checked)}
/>
) : Array.isArray(s.enum) ? (
- <select
- className="ui-input"
- value={value}
- onChange={(e) => setField(key, e.target.value)}
+ // Radix items need non-empty string values; the
+ // original (possibly numeric) enum entry is restored on change.
+ <Select
+ value={value === '' ? '' : String(value)}
+ onValueChange={(v) => setField(
+ key,
+ s.enum.find((opt) => String(opt) === v) ?? v,
+ )}
>
- {s.enum.map((opt) => (
- <option key={opt} value={opt}>{opt}</option>
- ))}
- </select>
+ <SelectTrigger aria-label={s.title || key}>
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {s.enum.filter((opt) => String(opt) !== '').map((opt) => (
+ <SelectItem key={String(opt)} value={String(opt)}>{String(opt)}</SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
) : (
<input
className="ui-input"
diff --git a/frontend/src/pages/Monitors.jsx b/frontend/src/pages/Monitors.jsx
index d6fdeec5..ac685143 100644
--- a/frontend/src/pages/Monitors.jsx
+++ b/frontend/src/pages/Monitors.jsx
@@ -28,6 +28,9 @@ 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 { useTopbarActions, useTopbarChrome } from '@/hooks/useTopbarActions';
import { useTableSort } from '@/hooks/useTableSort';
import { useColumnVisibility } from '@/hooks/useColumnVisibility';
@@ -550,14 +553,17 @@ export default function Monitors() {
<div className="form-group">
<Label htmlFor="mon-type">{t('app.monitors.checkType', 'Check type')}</Label>
- <select
- id="mon-type" className="mon-select" value={form.check_type}
- onChange={(e) => setForm({ ...form, check_type: e.target.value })}
+ <Select
+ value={form.check_type}
+ onValueChange={(v) => setForm({ ...form, check_type: v })}
>
- {CHECK_TYPES.map((t) => (
- <option key={t.value} value={t.value}>{t.label} — {t.hint}</option>
- ))}
- </select>
+ <SelectTrigger id="mon-type"><SelectValue /></SelectTrigger>
+ <SelectContent>
+ {CHECK_TYPES.map((t) => (
+ <SelectItem key={t.value} value={t.value}>{t.label} — {t.hint}</SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
</div>
<div className="form-group">
@@ -613,14 +619,17 @@ export default function Monitors() {
<div className="mon-form__row">
<div className="form-group">
<Label htmlFor="mon-method">{t('app.monitors.method', 'Method')}</Label>
- <select
- id="mon-method" className="mon-select" value={form.check_method}
- onChange={(e) => setForm({ ...form, check_method: e.target.value })}
+ <Select
+ value={form.check_method}
+ onValueChange={(v) => setForm({ ...form, check_method: v })}
>
- {['GET', 'HEAD', 'POST', 'PUT', 'OPTIONS'].map((m) => (
- <option key={m} value={m}>{m}</option>
- ))}
- </select>
+ <SelectTrigger id="mon-method"><SelectValue /></SelectTrigger>
+ <SelectContent>
+ {['GET', 'HEAD', 'POST', 'PUT', 'OPTIONS'].map((m) => (
+ <SelectItem key={m} value={m}>{m}</SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
</div>
<div className="form-group">
<Label htmlFor="mon-expected">{t('app.monitors.expectedStatus', 'Expected status')}</Label>
diff --git a/frontend/src/pages/QueueDetail.jsx b/frontend/src/pages/QueueDetail.jsx
index e4a8dcf5..08d0d77e 100644
--- a/frontend/src/pages/QueueDetail.jsx
+++ b/frontend/src/pages/QueueDetail.jsx
@@ -18,6 +18,9 @@ import { Button } from '@/components/ui/button';
import { Label } from '@/components/ui/label';
import { Input } from '@/components/ui/input';
import { Textarea } from '@/components/ui/textarea';
+import {
+ Select, SelectTrigger, SelectContent, SelectItem, SelectValue,
+} from '@/components/ui/select';
import {
DataTable, DataTableFooter, MetricCard, KpiBand, Pill, SortChipBar,
statusKind, statusLabel,
@@ -400,14 +403,15 @@ const QueueDetail = () => {
filter, not table chrome — changing it refetches. */}
<div className="queue-messages-toolbar">
<div className="queue-messages-selects">
- <select
- className="queue-select"
- value={statusFilter}
- onChange={(e) => setStatusFilter(e.target.value)}
- >
- <option value="all">{t('app.queueDetail.allStatuses', 'All statuses')}</option>
- {STATUS_ORDER.map(s => <option key={s} value={s}>{statusLabel(s)}</option>)}
- </select>
+ <Select value={statusFilter} onValueChange={setStatusFilter}>
+ <SelectTrigger className="queue-select" aria-label={t('app.queueDetail.allStatuses', 'All statuses')}>
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ <SelectItem value="all">{t('app.queueDetail.allStatuses', 'All statuses')}</SelectItem>
+ {STATUS_ORDER.map(s => <SelectItem key={s} value={s}>{statusLabel(s)}</SelectItem>)}
+ </SelectContent>
+ </Select>
</div>
</div>
diff --git a/frontend/src/pages/QueueOperations.jsx b/frontend/src/pages/QueueOperations.jsx
index 8fad8cd3..561211cf 100644
--- a/frontend/src/pages/QueueOperations.jsx
+++ b/frontend/src/pages/QueueOperations.jsx
@@ -21,6 +21,9 @@ import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { Textarea } from '@/components/ui/textarea';
+import {
+ Select, SelectTrigger, SelectContent, SelectItem, SelectValue,
+} from '@/components/ui/select';
import {
DataTable, DataTableFooter, MetricCard, Pill, SearchField, SortChipBar,
statusKind, statusLabel,
@@ -35,6 +38,9 @@ import { formatCompact, formatFull } from '../utils/formatNumber';
import { usePolling } from '@/hooks/usePolling';
import { useTranslation } from 'react-i18next';
+// Radix Select items cannot use '' — stands in for "no group filter".
+const ALL_GROUPS = '__all';
+
const STATUS_ORDER = ['pending', 'in_flight', 'completed', 'failed', 'dead_letter'];
const POLL_INTERVAL = 3000;
@@ -576,14 +582,18 @@ const QueueOperations = () => {
rows are shown. */}
<div className="queue-command-bar">
<div className="queue-toolbar">
- <select
- className="queue-select"
- value={selectedGroup}
- onChange={(e) => setSelectedGroup(e.target.value)}
+ <Select
+ value={selectedGroup || ALL_GROUPS}
+ onValueChange={(v) => setSelectedGroup(v === ALL_GROUPS ? '' : v)}
>
- <option value="">{t('app.queueOperations.allGroups', 'All groups')}</option>
- {groups.map(g => <option key={g.id} value={g.slug}>{g.name}</option>)}
- </select>
+ <SelectTrigger className="queue-select" aria-label={t('app.queueOperations.group', 'Group')}>
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ <SelectItem value={ALL_GROUPS}>{t('app.queueOperations.allGroups', 'All groups')}</SelectItem>
+ {groups.map(g => <SelectItem key={g.id} value={g.slug}>{g.name}</SelectItem>)}
+ </SelectContent>
+ </Select>
</div>
{hasActiveFilters && (
<Button variant="unstyled"
@@ -671,16 +681,18 @@ const QueueOperations = () => {
<form onSubmit={handleCreateQueue}>
<div className="form-group">
<Label htmlFor="queue-group">{t('app.queueOperations.group', 'Group')}</Label>
- <select
- id="queue-group"
- className="queue-select queue-select--full"
+ <Select
value={queueForm.groupSlug || selectedGroup || ''}
- onChange={(e) => setQueueForm({ ...queueForm, groupSlug: e.target.value })}
+ onValueChange={(v) => setQueueForm({ ...queueForm, groupSlug: v })}
required
>
- <option value="">{t('app.queueOperations.selectGroup', 'Select group')}</option>
- {groups.map(g => <option key={g.id} value={g.slug}>{g.name}</option>)}
- </select>
+ <SelectTrigger id="queue-group">
+ <SelectValue placeholder={t('app.queueOperations.selectGroup', 'Select group')} />
+ </SelectTrigger>
+ <SelectContent>
+ {groups.map(g => <SelectItem key={g.id} value={g.slug}>{g.name}</SelectItem>)}
+ </SelectContent>
+ </Select>
</div>
<div className="form-group">
<Label htmlFor="queue-name">{t('common.labels.name', 'Name')}</Label>
diff --git a/frontend/src/pages/RemoteAccess.jsx b/frontend/src/pages/RemoteAccess.jsx
index acb40eb7..d8c0a815 100644
--- a/frontend/src/pages/RemoteAccess.jsx
+++ b/frontend/src/pages/RemoteAccess.jsx
@@ -9,7 +9,9 @@ import api from '../services/api';
import { useToast } from '../contexts/useToast.js';
import EmptyState from '../components/EmptyState';
import Modal from '../components/Modal';
-import ResourcePicker from '../components/ResourcePicker';
+import ServerPicker from '../components/ServerPicker';
+import DomainField from '../components/DomainField';
+import PortField from '../components/PortField';
import { Pill } from '@/components/ds';
import { useTopbarActions } from '@/hooks/useTopbarActions';
import { Button } from '@/components/ui/button';
@@ -17,7 +19,6 @@ import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { Switch } from '@/components/ui/switch';
import { useTranslation } from 'react-i18next';
-import { useWorkspace } from '../contexts/useWorkspace.js';
// Tunnel / service status → status-pill tone.
const pillKind = (status) => statusKind(status);
@@ -33,20 +34,8 @@ const EMPTY_FORM = {
ssl: true,
};
-const serverResource = (server, id) => ({
- type: 'server',
- id: String(server?.id ?? id),
- label: server?.name || server?.hostname || String(id),
- sublabel: server?.ip_address || server?.hostname || '',
- path: `/servers/${server?.id ?? id}`,
- scope: { workspaceId: server?.workspace_id ?? null },
- status: server?.status || null,
- capabilities: [],
-});
-
const RemoteAccess = ({ serverId }) => {
const { t } = useTranslation();
- const { activeWorkspaceId, isAllWorkspaces } = useWorkspace();
const toast = useToast();
const [tunnels, setTunnels] = useState([]);
const [services, setServices] = useState({}); // tunnelId -> [service]
@@ -64,17 +53,6 @@ const RemoteAccess = ({ serverId }) => {
() => servers.find((s) => s.id === serverId),
[servers, serverId]
);
- const resourceScope = useMemo(() => ({
- workspaceId: isAllWorkspaces ? null : activeWorkspaceId,
- }), [activeWorkspaceId, isAllWorkspaces]);
- const privateServer = useMemo(
- () => servers.find((server) => String(server.id) === String(form.privateServerId)),
- [form.privateServerId, servers],
- );
- const edgeServer = useMemo(
- () => servers.find((server) => String(server.id) === String(form.edgeServerId)),
- [form.edgeServerId, servers],
- );
// When scoped to a server, only show tunnels that involve it.
const visibleTunnels = useMemo(() => {
@@ -402,48 +380,31 @@ const RemoteAccess = ({ serverId }) => {
disabled
/>
) : (
- <ResourcePicker
- value={form.privateServerId
- ? serverResource(privateServer, form.privateServerId)
- : null}
- onChange={(resource) => setField('privateServerId', resource.id)}
- types={['server']}
- scope={resourceScope}
- capabilities={['wireguard']}
- filterOption={(resource) => (
- resource.status === 'online'
- && resource.id !== String(form.edgeServerId)
- )}
- icon={HardDrive}
- showCapabilities
+ // Tunnel endpoints are agent servers; the panel host
+ // has no server row, so "Local" is not offered.
+ <ServerPicker
+ value={form.privateServerId}
+ onChange={(id) => setField('privateServerId', id)}
+ capability="wireguard"
+ includeLocal={false}
label={t('app.remoteAccess.privateHostWhereTheServiceRuns', 'Private host (where the service runs)')}
- placeholder={t('app.remoteAccess.selectAServer', 'Select a server')}
- searchPlaceholder={t('app.serverPicker.findAServer', 'Find a server…')}
- className="sk-resource-picker__trigger--full"
/>
)}
</div>
<div className="ra-service-field">
<Label>{t('app.remoteAccess.edgeServerPublicIpFrontsThe', 'Edge server (public IP — fronts the tunnel)')}</Label>
- <ResourcePicker
- value={form.edgeServerId
- ? serverResource(edgeServer, form.edgeServerId)
- : null}
- onChange={(resource) => setField('edgeServerId', resource.id)}
- types={['server']}
- scope={resourceScope}
- capabilities={['wireguard']}
- filterOption={(resource) => (
- resource.status === 'online'
- && resource.id !== String(form.privateServerId)
- )}
- icon={Cloud}
- showCapabilities
+ <ServerPicker
+ value={form.edgeServerId}
+ onChange={(id) => setField('edgeServerId', id)}
+ capability="wireguard"
+ includeLocal={false}
label={t('app.remoteAccess.edgeServerPublicIpFrontsThe', 'Edge server (public IP — fronts the tunnel)')}
- placeholder={t('app.remoteAccess.selectAServer', 'Select a server')}
- searchPlaceholder={t('app.serverPicker.findAServer', 'Find a server…')}
- className="sk-resource-picker__trigger--full"
/>
+ {form.edgeServerId && form.edgeServerId === form.privateServerId && (
+ <p className="ra-service-hint">
+ {t('app.remoteAccess.pickTwoDifferentServers', 'Pick two different servers: the edge fronts the private host.')}
+ </p>
+ )}
<p className="ra-service-hint">
{t('app.remoteAccess.aTunnelBetweenTheseTwoIs', 'A tunnel between these two is created (or reused) automatically.')}
</p>
@@ -453,20 +414,23 @@ const RemoteAccess = ({ serverId }) => {
<div className="ra-service-routing">
<div className="ra-service-field ra-service-field--host">
- <Label>{t('app.remoteAccess.publicHostname', 'Public hostname')}</Label>
- <Input
- placeholder="jellyfin.example.com"
+ <Label htmlFor="ra-hostname">{t('app.remoteAccess.publicHostname', 'Public hostname')}</Label>
+ <DomainField
+ id="ra-hostname"
+ modes={['custom']}
value={form.hostname}
- onChange={(e) => setField('hostname', e.target.value)}
+ onChange={(fqdn) => setField('hostname', fqdn)}
/>
</div>
<div className="ra-service-field">
- <Label>{t('app.remoteAccess.servicePort', 'Service port')}</Label>
- <Input
- type="number"
+ <Label htmlFor="ra-port">{t('app.remoteAccess.servicePort', 'Service port')}</Label>
+ {/* The port lives on the private host, not this panel. */}
+ <PortField
+ id="ra-port"
+ host={false}
placeholder="8096"
value={form.port}
- onChange={(e) => setField('port', e.target.value)}
+ onChange={(port) => setField('port', port)}
/>
</div>
</div>
diff --git a/frontend/src/pages/SSLCertificates.jsx b/frontend/src/pages/SSLCertificates.jsx
index 0c3106b9..800d0a81 100644
--- a/frontend/src/pages/SSLCertificates.jsx
+++ b/frontend/src/pages/SSLCertificates.jsx
@@ -14,9 +14,13 @@ import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { Checkbox } from '@/components/ui/checkbox';
+import {
+ Select, SelectTrigger, SelectContent, SelectItem, SelectValue,
+} from '@/components/ui/select';
import {
DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger,
} from '@/components/ui/dropdown-menu';
+import DomainField from '../components/DomainField';
import { formatExpiry } from '../utils/expiry';
import { useTranslation } from 'react-i18next';
@@ -547,14 +551,26 @@ const SSLCertificates = () => {
<p className="hint">{t('app.sSLCertificates.issues', 'Issues')} <code>domain</code> + <code>*.domain</code> {t('app.sSLCertificates.viaYourDnsProvider', 'via your DNS provider.')}</p>
</div>
<div className="form-group">
- <Label>{wildcard ? 'Base Domain' : 'Domains'}</Label>
- <Input
- type="text"
- placeholder={wildcard ? 'example.com' : t('app.sSLCertificates.exampleComWwwExampleCom', 'example.com, www.example.com')}
- value={domains}
- onChange={e => setDomains(e.target.value)}
- required
- />
+ <Label htmlFor="ssl-domains">{wildcard ? 'Base Domain' : 'Domains'}</Label>
+ {/* A wildcard cert covers one base domain; HTTP-01
+ takes a comma-separated list, so it keeps a plain input. */}
+ {wildcard ? (
+ <DomainField
+ id="ssl-domains"
+ modes={['custom']}
+ value={domains}
+ onChange={(fqdn) => setDomains(fqdn)}
+ />
+ ) : (
+ <Input
+ id="ssl-domains"
+ type="text"
+ placeholder={t('app.sSLCertificates.exampleComWwwExampleCom', 'example.com, www.example.com')}
+ value={domains}
+ onChange={e => setDomains(e.target.value)}
+ required
+ />
+ )}
<p className="hint">{wildcard ? 'A single base domain for the wildcard cert' : 'Comma-separated list of domains'}</p>
</div>
{!wildcard && (
@@ -597,15 +613,14 @@ const SSLCertificates = () => {
{wildcard && (
<>
<div className="form-group">
- <Label>{t('app.sSLCertificates.dnsProvider', 'DNS Provider')}</Label>
- <select
- className="ui-select"
- value={dnsProvider}
- onChange={e => setDnsProvider(e.target.value)}
- >
- <option value="cloudflare">{t('app.sSLCertificates.cloudflare', 'Cloudflare')}</option>
- <option value="route53">{t('app.sSLCertificates.awsRoute53', 'AWS Route 53')}</option>
- </select>
+ <Label htmlFor="ssl-dns-provider">{t('app.sSLCertificates.dnsProvider', 'DNS Provider')}</Label>
+ <Select value={dnsProvider} onValueChange={setDnsProvider}>
+ <SelectTrigger id="ssl-dns-provider"><SelectValue /></SelectTrigger>
+ <SelectContent>
+ <SelectItem value="cloudflare">{t('app.sSLCertificates.cloudflare', 'Cloudflare')}</SelectItem>
+ <SelectItem value="route53">{t('app.sSLCertificates.awsRoute53', 'AWS Route 53')}</SelectItem>
+ </SelectContent>
+ </Select>
</div>
{dnsProvider === 'cloudflare' ? (
<div className="form-group">
@@ -652,7 +667,7 @@ const SSLCertificates = () => {
</Button>
<Button
type="submit"
- disabled={actionLoading}
+ disabled={actionLoading || (wildcard && !domains)}
>
{actionLoading ? 'Obtaining...' : 'Obtain Certificate'}
</Button>
@@ -671,13 +686,12 @@ const SSLCertificates = () => {
</div>
</div>
<div className="form-group">
- <Label>{t('common.labels.domain', 'Domain')}</Label>
- <Input
- type="text"
- placeholder="example.com"
+ <Label htmlFor="ssl-upload-domain">{t('common.labels.domain', 'Domain')}</Label>
+ <DomainField
+ id="ssl-upload-domain"
+ modes={['custom']}
value={uploadDomain}
- onChange={e => setUploadDomain(e.target.value)}
- required
+ onChange={(fqdn) => setUploadDomain(fqdn)}
/>
</div>
<div className="form-group">
@@ -716,7 +730,7 @@ const SSLCertificates = () => {
<Button type="button" variant="outline" onClick={() => setShowUploadModal(false)}>
{t('common.actions.cancel', 'Cancel')}
</Button>
- <Button type="submit" disabled={actionLoading}>
+ <Button type="submit" disabled={actionLoading || !uploadDomain}>
{actionLoading ? 'Uploading...' : 'Upload Certificate'}
</Button>
</div>
diff --git a/frontend/src/pages/ServerTemplates.jsx b/frontend/src/pages/ServerTemplates.jsx
index 504c948f..cce2716c 100644
--- a/frontend/src/pages/ServerTemplates.jsx
+++ b/frontend/src/pages/ServerTemplates.jsx
@@ -14,6 +14,9 @@ import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Textarea } from '@/components/ui/textarea';
import { Badge } from '@/components/ui/badge';
+import {
+ Select, SelectTrigger, SelectContent, SelectItem, SelectValue,
+} from '@/components/ui/select';
import { Tabs, TabsList, TabsTrigger, TabsContent } from '@/components/ui/tabs';
import { DataTable, Pill, CatalogCard, CatalogGrid } from '@/components/ds';
import { useTranslation } from 'react-i18next';
@@ -644,10 +647,13 @@ const ServerTemplates = () => {
<Textarea value={form.description} onChange={e => setForm({...form, description: e.target.value})} rows={2} />
</div>
<div className="form-group">
- <label>{t('app.serverTemplates.category', 'Category')}</label>
- <select className="form-select" value={form.category} onChange={e => setForm({...form, category: e.target.value})}>
- {Object.entries(CATEGORY_LABELS).map(([k, v]) => <option key={k} value={k}>{v}</option>)}
- </select>
+ <label htmlFor="server-template-category">{t('app.serverTemplates.category', 'Category')}</label>
+ <Select value={form.category} onValueChange={v => setForm({...form, category: v})}>
+ <SelectTrigger id="server-template-category"><SelectValue /></SelectTrigger>
+ <SelectContent>
+ {Object.entries(CATEGORY_LABELS).map(([k, v]) => <SelectItem key={k} value={k}>{v}</SelectItem>)}
+ </SelectContent>
+ </Select>
</div>
<div className="form-group">
<label>{t('app.serverTemplates.packagesOnePerLine', 'Packages (one per line)')}</label>
diff --git a/frontend/src/pages/Servers.jsx b/frontend/src/pages/Servers.jsx
index 02b8c516..00df1cf1 100644
--- a/frontend/src/pages/Servers.jsx
+++ b/frontend/src/pages/Servers.jsx
@@ -7,6 +7,9 @@ import EmptyState from '../components/EmptyState';
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 {
DataTable, DataTableFooter, Drawer, Gauge, Pill, SearchField, statusKind,
} from '@/components/ds';
@@ -14,7 +17,7 @@ import { useTopbarActions, useTopbarChrome } from '@/hooks/useTopbarActions';
import { useTableSort } from '@/hooks/useTableSort';
import { useColumnVisibility } from '@/hooks/useColumnVisibility';
import { useConfirm } from '@/hooks/useConfirm';
-import { useClipboard } from '@/hooks/useClipboard';
+import CopyField from '../components/CopyField';
import {
useTableChrome, GridViewPicker, GridChips, GridFilterButton,
GridToolsMenu, GridFilterDrawer,
@@ -24,6 +27,9 @@ import LinkPanelForm from '../components/servers/LinkPanelForm';
import { useTranslation } from 'react-i18next';
import { t } from '../i18n/t';
+// Radix Select items cannot use '' — stands in for "no group".
+const NO_GROUP = '__none';
+
// Status -> Pill tone. `connecting` and `pending` both mean "not reporting
// yet" but for different reasons (handshake in flight vs agent never
// installed), so they stay distinct rather than folding into one bucket.
@@ -455,13 +461,11 @@ const Servers = () => {
<div className="sk-bulkbar" role="status">
<span className="sk-bulkbar__count">{selectedIds.size} selected</span>
<div className="sk-bulkbar__actions">
- <select
- className="sk-listhead__select"
- defaultValue=""
+ {/* An action, not a setting: the trigger always reads "Set group…". */}
+ <Select
+ value=""
disabled={bulkBusy}
- aria-label={t('app.servers.setGroupForSelectedServers', 'Set group for selected servers')}
- onChange={async (e) => {
- const groupId = e.target.value;
+ onValueChange={async (groupId) => {
if (!groupId) return;
setBulkBusy(true);
try {
@@ -478,14 +482,20 @@ const Servers = () => {
toast.error(err.message || t('app.servers.couldNotSetTheGroup', 'Could not set the group'));
} finally {
setBulkBusy(false);
- e.target.value = '';
}
}}
>
- <option value="" disabled>{t('app.servers.setGroup', 'Set group…')}</option>
- {groups.map((g) => <option key={g.id} value={g.id}>{g.name}</option>)}
- <option value="none">{t('app.servers.ungrouped', 'Ungrouped')}</option>
- </select>
+ <SelectTrigger
+ className="servers-bulk-group"
+ aria-label={t('app.servers.setGroupForSelectedServers', 'Set group for selected servers')}
+ >
+ <SelectValue placeholder={t('app.servers.setGroup', 'Set group…')} />
+ </SelectTrigger>
+ <SelectContent>
+ {groups.map((g) => <SelectItem key={g.id} value={String(g.id)}>{g.name}</SelectItem>)}
+ <SelectItem value="none">{t('app.servers.ungrouped', 'Ungrouped')}</SelectItem>
+ </SelectContent>
+ </Select>
</div>
<Button variant="unstyled"
type="button"
@@ -685,13 +695,19 @@ const PairAgentForm = ({ groups, onClose, onClaimed }) => {
<span className="form-hint">{t('app.servers.leaveBlankToUseTheAgent', 'Leave blank to use the agent\'s hostname.')}</span>
</div>
<div className="form-group">
- <label>{t('app.servers.group', 'Group')}</label>
- <select value={groupId} onChange={(e) => setGroupId(e.target.value)}>
- <option value="">{t('app.servers.noGroup', 'No Group')}</option>
- {groups.map(g => (
- <option key={g.id} value={g.id}>{g.name}</option>
- ))}
- </select>
+ <label htmlFor="pair-group">{t('app.servers.group', 'Group')}</label>
+ <Select
+ value={groupId === '' ? NO_GROUP : String(groupId)}
+ onValueChange={(v) => setGroupId(v === NO_GROUP ? '' : v)}
+ >
+ <SelectTrigger id="pair-group"><SelectValue /></SelectTrigger>
+ <SelectContent>
+ <SelectItem value={NO_GROUP}>{t('app.servers.noGroup', 'No Group')}</SelectItem>
+ {groups.map(g => (
+ <SelectItem key={g.id} value={String(g.id)}>{g.name}</SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
</div>
</div>
@@ -733,7 +749,6 @@ const AddServerModal = ({ groups, onClose, onCreated }) => {
const [registrationData, setRegistrationData] = useState(null);
const [loading, setLoading] = useState(false);
const [error, setError] = useState('');
- const { copy } = useClipboard();
async function handleCreateServer(e) {
e.preventDefault();
@@ -848,24 +863,33 @@ Install-ServerKitAgent -Server "${window.location.origin}" -Token "${registratio
<div className="form-row">
<div className="form-group">
- <label>{t('app.servers.group', 'Group')}</label>
- <select value={groupId} onChange={(e) => setGroupId(e.target.value)}>
- <option value="">{t('app.servers.noGroup', 'No Group')}</option>
- {groups.map(group => (
- <option key={group.id} value={group.id}>{group.name}</option>
- ))}
- </select>
+ <label htmlFor="add-server-group">{t('app.servers.group', 'Group')}</label>
+ <Select
+ value={groupId === '' ? NO_GROUP : String(groupId)}
+ onValueChange={(v) => setGroupId(v === NO_GROUP ? '' : v)}
+ >
+ <SelectTrigger id="add-server-group"><SelectValue /></SelectTrigger>
+ <SelectContent>
+ <SelectItem value={NO_GROUP}>{t('app.servers.noGroup', 'No Group')}</SelectItem>
+ {groups.map(group => (
+ <SelectItem key={group.id} value={String(group.id)}>{group.name}</SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
</div>
<div className="form-group">
- <label>{t('app.servers.tokenExpires', 'Token expires')}</label>
- <select
- value={expiresIn}
- onChange={(e) => setExpiresIn(Number(e.target.value))}
+ <label htmlFor="add-server-expiry">{t('app.servers.tokenExpires', 'Token expires')}</label>
+ <Select
+ value={String(expiresIn)}
+ onValueChange={(v) => setExpiresIn(Number(v))}
>
- {EXPIRY_OPTIONS.map(opt => (
- <option key={opt.value} value={opt.value}>{opt.label}</option>
- ))}
- </select>
+ <SelectTrigger id="add-server-expiry"><SelectValue /></SelectTrigger>
+ <SelectContent>
+ {EXPIRY_OPTIONS.map(opt => (
+ <SelectItem key={opt.value} value={String(opt.value)}>{opt.label}</SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
<span className="form-hint">{t('app.servers.singleUseBurnedTheMomentAn', 'Single-use. Burned the moment an agent registers with it.')}</span>
</div>
</div>
@@ -891,32 +915,31 @@ Install-ServerKitAgent -Server "${window.location.origin}" -Token "${registratio
</div>
</div>
- <ConnectionStringField
- value={connectionString}
- onCopy={() => {
- copy(connectionString);
- window.dispatchEvent(new CustomEvent('serverkit:walkthrough-signal', {
- detail: { type: 'server-connection-string-copied' },
- }));
- }}
- />
+ <div className="server-connection-string" data-walkthrough="server-connection-string">
+ <CopyField
+ label={t('app.servers.connectionString', 'Connection string')}
+ value={connectionString}
+ multiline
+ onCopy={() => {
+ window.dispatchEvent(new CustomEvent('serverkit:walkthrough-signal', {
+ detail: { type: 'server-connection-string-copied' },
+ }));
+ }}
+ />
+ </div>
<details className="install-fallback">
<summary>{t('app.servers.needToInstallTheAgentFirst', 'Need to install the agent first? Use the one-liner installer.')}</summary>
<div className="install-tabs install-tabs--after-summary">
- <InstallTab
- title={t('app.servers.linux', 'Linux')}
- description={t('app.servers.curlTarSudoAndSystemd', 'curl, tar, sudo, and systemd')}
- icon={<TerminalIcon />}
- script={linuxInstallScript}
- onCopy={() => copy(linuxInstallScript)}
+ <CopyField
+ label={`${t('app.servers.linux', 'Linux')} · ${t('app.servers.curlTarSudoAndSystemd', 'curl, tar, sudo, and systemd')}`}
+ value={linuxInstallScript}
+ multiline
/>
- <InstallTab
- title={t('app.servers.windowsPowershell', 'Windows (PowerShell)')}
- description={t('app.servers.runAsAdministrator', 'Run as Administrator')}
- icon={<WindowsIcon />}
- script={windowsInstallScript}
- onCopy={() => copy(windowsInstallScript)}
+ <CopyField
+ label={`${t('app.servers.windowsPowershell', 'Windows (PowerShell)')} · ${t('app.servers.runAsAdministrator', 'Run as Administrator')}`}
+ value={windowsInstallScript}
+ multiline
/>
</div>
</details>
@@ -945,41 +968,6 @@ Install-ServerKitAgent -Server "${window.location.origin}" -Token "${registratio
);
};
-const ConnectionStringField = ({ value, onCopy }) => {
- const { t } = useTranslation();
- return (
- <div className="connection-string-field" data-walkthrough="server-connection-string">
- <div className="connection-string-field__header">
- <KeyIcon />
- <span>{t('app.servers.connectionString', 'Connection string')}</span>
- <Button variant="outline" size="sm" onClick={onCopy}>
- <CopyIcon /> {t('common.actions.copy', 'Copy')}
- </Button>
- </div>
- <pre className="connection-string-field__value">{value}</pre>
- </div>
- );
-};
-
-const InstallTab = ({ title, description, icon, script, onCopy }) => {
- const { t } = useTranslation();
- return (
- <div className="install-tab">
- <div className="install-tab-header">
- {icon}
- <div className="install-tab-title">
- <span>{title}</span>
- {description && <span className="install-tab-description">{description}</span>}
- </div>
- <Button variant="outline" size="sm" onClick={onCopy}>
- <CopyIcon /> {t('common.actions.copy', 'Copy')}
- </Button>
- </div>
- <pre className="install-script">{script}</pre>
- </div>
- );
-};
-
const ManageGroupsModal = ({ groups, onClose, onUpdated }) => {
const { t } = useTranslation();
const { confirm } = useConfirm();
@@ -1129,26 +1117,6 @@ const CheckCircleIcon = () => (
</svg>
);
-const TerminalIcon = () => (
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
- <polyline points="4 17 10 11 4 5"/>
- <line x1="12" y1="19" x2="20" y2="19"/>
- </svg>
-);
-
-const WindowsIcon = () => (
- <svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
- <path d="M0 3.449L9.75 2.1v9.451H0m10.949-9.602L24 0v11.4H10.949M0 12.6h9.75v9.451L0 20.699M10.949 12.6H24V24l-12.9-1.801"/>
- </svg>
-);
-
-const CopyIcon = () => (
- <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>
-);
-
const EditIcon = () => (
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
<path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/>
@@ -1163,10 +1131,4 @@ const TrashIcon = () => (
</svg>
);
-const KeyIcon = () => (
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
- <path d="M21 2l-2 2m-7.61 7.61a5.5 5.5 0 1 1-7.778 7.778 5.5 5.5 0 0 1 7.777-7.777zm0 0L15.5 7.5m0 0l3 3L22 7l-3-3m-3.5 3.5L19 4"/>
- </svg>
-);
-
export default Servers;
diff --git a/frontend/src/pages/StatusPages.jsx b/frontend/src/pages/StatusPages.jsx
index 38252c11..06859d23 100644
--- a/frontend/src/pages/StatusPages.jsx
+++ b/frontend/src/pages/StatusPages.jsx
@@ -9,15 +9,17 @@ import Modal from '@/components/Modal';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Textarea } from '@/components/ui/textarea';
+import {
+ Select, SelectTrigger, SelectContent, SelectItem, SelectValue,
+} from '@/components/ui/select';
import { Tabs, TabsList, TabsTrigger, TabsContent } from '@/components/ui/tabs';
import { Pill } from '@/components/ds';
import { useTopbarActions } from '@/hooks/useTopbarActions';
-import { copyToClipboard } from '@/utils/clipboard';
+import CopyField from '../components/CopyField';
import { useTranslation } from 'react-i18next';
import {
Activity,
CheckCircle2,
- Copy,
ExternalLink,
Globe2,
Link2,
@@ -296,12 +298,6 @@ const StatusPages = () => {
}
};
- const handleCopyUrl = async () => {
- if (!selectedUrl) return;
- if (await copyToClipboard(selectedUrl)) toast.success(t('app.statusPages.statusPageUrlCopied', 'Status page URL copied'));
- else toast.error(t('app.statusPages.couldNotCopyUrl', 'Could not copy URL'));
- };
-
const handleConfirmDelete = async () => {
if (!deleteConfirm) return;
try {
@@ -401,13 +397,8 @@ const StatusPages = () => {
)}
</div>
<div className="status-url-card">
- <span>{t('app.statusPages.publicUrl', 'Public URL')}</span>
- <code>{selectedUrl}</code>
+ <CopyField label={t('app.statusPages.publicUrl', 'Public URL')} value={selectedUrl} />
<div>
- <Button size="sm" variant="outline" onClick={handleCopyUrl}>
- <Copy size={14} />
- {t('common.actions.copy', 'Copy')}
- </Button>
<Button size="sm" asChild>
<a href={selectedUrl} target="_blank" rel="noreferrer">
<ExternalLink size={14} />
@@ -721,17 +712,19 @@ const StatusPages = () => {
<Input value={compForm.group} onChange={(e) => setCompForm({ ...compForm, group: e.target.value })} />
</div>
<div className="form-group">
- <label>{t('app.statusPages.checkType', 'Check Type')}</label>
- <select
- className="form-select"
+ <label htmlFor="status-comp-check-type">{t('app.statusPages.checkType', 'Check Type')}</label>
+ <Select
value={compForm.check_type}
- onChange={(e) => setCompForm({ ...compForm, check_type: e.target.value })}
+ onValueChange={(v) => setCompForm({ ...compForm, check_type: v })}
>
- <option value="http">HTTP</option>
- <option value="tcp">TCP</option>
- <option value="dns">DNS</option>
- <option value="ping">{t('app.statusPages.ping', 'Ping')}</option>
- </select>
+ <SelectTrigger id="status-comp-check-type"><SelectValue /></SelectTrigger>
+ <SelectContent>
+ <SelectItem value="http">HTTP</SelectItem>
+ <SelectItem value="tcp">TCP</SelectItem>
+ <SelectItem value="dns">DNS</SelectItem>
+ <SelectItem value="ping">{t('app.statusPages.ping', 'Ping')}</SelectItem>
+ </SelectContent>
+ </Select>
</div>
<div className="form-group">
<label>{t('common.labels.target', 'Target')}</label>
@@ -783,28 +776,32 @@ const StatusPages = () => {
</div>
<div className="status-modal-grid">
<div className="form-group">
- <label>{t('common.labels.status', 'Status')}</label>
- <select
- className="form-select"
+ <label htmlFor="status-incident-status">{t('common.labels.status', 'Status')}</label>
+ <Select
value={incidentForm.status}
- onChange={(e) => setIncidentForm({ ...incidentForm, status: e.target.value })}
+ onValueChange={(v) => setIncidentForm({ ...incidentForm, status: v })}
>
- {INCIDENT_STATUS.filter((status) => status.value !== 'resolved').map((status) => (
- <option key={status.value} value={status.value}>{status.label}</option>
- ))}
- </select>
+ <SelectTrigger id="status-incident-status"><SelectValue /></SelectTrigger>
+ <SelectContent>
+ {INCIDENT_STATUS.filter((status) => status.value !== 'resolved').map((status) => (
+ <SelectItem key={status.value} value={status.value}>{status.label}</SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
</div>
<div className="form-group">
- <label>{t('app.statusPages.impact', 'Impact')}</label>
- <select
- className="form-select"
+ <label htmlFor="status-incident-impact">{t('app.statusPages.impact', 'Impact')}</label>
+ <Select
value={incidentForm.impact}
- onChange={(e) => setIncidentForm({ ...incidentForm, impact: e.target.value })}
+ onValueChange={(v) => setIncidentForm({ ...incidentForm, impact: v })}
>
- {IMPACT_OPTIONS.map((impact) => (
- <option key={impact.value} value={impact.value}>{impact.label}</option>
- ))}
- </select>
+ <SelectTrigger id="status-incident-impact"><SelectValue /></SelectTrigger>
+ <SelectContent>
+ {IMPACT_OPTIONS.map((impact) => (
+ <SelectItem key={impact.value} value={impact.value}>{impact.label}</SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
</div>
</div>
<div className="form-group">
diff --git a/frontend/src/pages/StyleGuide.jsx b/frontend/src/pages/StyleGuide.jsx
index cd825de1..3169539e 100644
--- a/frontend/src/pages/StyleGuide.jsx
+++ b/frontend/src/pages/StyleGuide.jsx
@@ -9,7 +9,13 @@ import {
Inbox, Table, AlertCircle, FileText, Monitor, Key, FolderOpen,
GitBranch, WifiOff, Clock
} from 'lucide-react';
-import { PageTopbar, SearchField } from '@/components/ds';
+import { PageTopbar, SearchField, CatalogCard, CatalogGrid } from '@/components/ds';
+import CopyField from '../components/CopyField';
+import PortField from '../components/PortField';
+import EnvEditor from '../components/EnvEditor';
+import ServerPicker from '../components/ServerPicker';
+import DomainField from '../components/DomainField';
+import { LOCAL_SERVER_ID } from '../utils/serverTarget';
import Modal from '../components/Modal';
import { ConfirmDialog } from '../components/ConfirmDialog';
import StatusBadge from '../components/StatusBadge';
@@ -27,7 +33,11 @@ import { ServiceCard, ServicesGrid } from '../components/ServiceCard';
import { JournalControls } from '../components/JournalControls';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
+import { Label } from '@/components/ui/label';
import { Textarea } from '@/components/ui/textarea';
+import {
+ Select, SelectTrigger, SelectContent, SelectItem, SelectValue,
+} from '@/components/ui/select';
import { Badge } from '@/components/ui/badge';
import { Tabs, TabsList, TabsTrigger, TabsContent } from '@/components/ui/tabs';
import { useTranslation } from 'react-i18next';
@@ -42,6 +52,7 @@ const SECTIONS = [
{ id: 'spacing', labelKey: 'app.styleGuide.spacingRadius', label: 'Spacing & Radius', icon: Box },
{ id: 'buttons', labelKey: 'app.styleGuide.buttons', label: 'Buttons', icon: Square },
{ id: 'forms', labelKey: 'app.styleGuide.forms', label: 'Forms', icon: ToggleLeft },
+ { id: 'fields', labelKey: 'app.styleGuide.sharedFields', label: 'Shared Fields', icon: Key },
{ id: 'tables', labelKey: 'app.styleGuide.tables', label: 'Tables', icon: Table },
{ id: 'cards', labelKey: 'app.styleGuide.cardsStats', label: 'Cards & Stats', icon: Layout },
{ id: 'badges', labelKey: 'app.styleGuide.badgesStatus', label: 'Badges & Status', icon: Shield },
@@ -86,6 +97,10 @@ export default function StyleGuide() {
const [halfOverflowTab, setHalfOverflowTab] = useState('overview');
const [inputValue, setInputValue] = useState('');
const [selectValue, setSelectValue] = useState('');
+ const [portValue, setPortValue] = useState(8080);
+ const [envRows, setEnvRows] = useState([{ key: 'NODE_ENV', value: 'production' }, { key: 'API_TOKEN', value: 'demo-token' }]);
+ const [serverValue, setServerValue] = useState(LOCAL_SERVER_ID);
+ const [domainValue, setDomainValue] = useState('');
const [checkValue, setCheckValue] = useState(false);
const sections = SECTIONS;
@@ -354,12 +369,16 @@ export default function StyleGuide() {
<SectionTitle title={t('app.styleGuide.selectTextarea', 'Select & Textarea')} />
<SharedCard variant="legacy" className="card styleguide__demo-card">
<div className="form-group">
- <label>{t('app.styleGuide.selectDropdown', 'Select Dropdown')}</label>
- <select className="form-select" value={selectValue} onChange={e => setSelectValue(e.target.value)}>
- <option value="">{t('app.styleGuide.chooseAnOption', 'Choose an option…')}</option>
- <option value="1">{t('app.styleGuide.option1', 'Option 1')}</option>
- <option value="2">{t('app.styleGuide.option2', 'Option 2')}</option>
- </select>
+ <Label htmlFor="sg-select">{t('app.styleGuide.selectDropdown', 'Select Dropdown')}</Label>
+ <Select value={selectValue} onValueChange={setSelectValue}>
+ <SelectTrigger id="sg-select">
+ <SelectValue placeholder={t('app.styleGuide.chooseAnOption', 'Choose an option…')} />
+ </SelectTrigger>
+ <SelectContent>
+ <SelectItem value="1">{t('app.styleGuide.option1', 'Option 1')}</SelectItem>
+ <SelectItem value="2">{t('app.styleGuide.option2', 'Option 2')}</SelectItem>
+ </SelectContent>
+ </Select>
</div>
<div className="form-group">
<label>{t('app.styleGuide.textarea', 'Textarea')}</label>
@@ -403,6 +422,75 @@ export default function StyleGuide() {
</div>
)}
+ {/* ── SHARED FIELDS ── */}
+ {activeSection === 'fields' && (
+ <div className="styleguide__section">
+ <SectionTitle title={t('app.styleGuide.copyField', 'Copy Field (CopyField)')} />
+ <SharedCard variant="legacy" className="card styleguide__demo-card">
+ <div className="form-group">
+ <CopyField label={t('app.styleGuide.connectionString', 'Connection string')} value="postgresql://[email protected]:5432/app" />
+ </div>
+ <div className="form-group">
+ <CopyField label={t('app.styleGuide.password', 'Password')} value="s3cr3t-demo-value" secret />
+ </div>
+ <div className="form-group">
+ <CopyField value={'curl -fsSL https://example.com/install.sh -o install.sh && \\\n sudo bash install.sh'} multiline />
+ </div>
+ </SharedCard>
+
+ <SectionTitle title={t('app.styleGuide.portField', 'Port Field (PortField)')} />
+ <SharedCard variant="legacy" className="card styleguide__demo-card">
+ <div className="form-group">
+ <Label htmlFor="sg-port">{t('app.styleGuide.containerPort', 'Container port')}</Label>
+ <PortField id="sg-port" host={false} value={portValue} onChange={setPortValue} />
+ <span className="hint">{t('app.styleGuide.portFieldHint', 'host={false}: range checks only. Host ports (the default) are also checked for collisions.')}</span>
+ </div>
+ </SharedCard>
+
+ <SectionTitle title={t('app.styleGuide.envEditor', 'Environment Editor (EnvEditor)')} />
+ <SharedCard variant="legacy" className="card styleguide__demo-card">
+ <EnvEditor value={envRows} onChange={setEnvRows} />
+ </SharedCard>
+
+ <SectionTitle title={t('app.styleGuide.serverPicker', 'Server Picker (ServerPicker)')} />
+ <SharedCard variant="legacy" className="card styleguide__demo-card">
+ <div className="form-group">
+ <ServerPicker value={serverValue} onChange={(id) => setServerValue(id)} capability="docker" />
+ </div>
+ </SharedCard>
+
+ <SectionTitle title={t('app.styleGuide.domainField', 'Domain Field (DomainField)')} />
+ <SharedCard variant="legacy" className="card styleguide__demo-card">
+ <div className="form-group">
+ <Label htmlFor="sg-domain">{t('common.labels.domain', 'Domain')}</Label>
+ <DomainField id="sg-domain" value={domainValue} onChange={(fqdn) => setDomainValue(fqdn)} defaultLabel="my-app" />
+ </div>
+ </SharedCard>
+
+ <SectionTitle title={t('app.styleGuide.catalogCard', 'Catalog Card (CatalogCard)')} />
+ <CatalogGrid>
+ <CatalogCard
+ icon={<Database size={18} />}
+ title={t('app.styleGuide.postgresql', 'PostgreSQL')}
+ sub="v16 · by ServerKit"
+ tag={t('app.styleGuide.database', 'Database')}
+ description={t('app.styleGuide.catalogCardDemo', 'Something you browse to install or deploy. Things you operate are table rows.')}
+ facts=":5432 · 256 MB RAM"
+ action={<Button size="sm">{t('app.styleGuide.deploy', 'Deploy')}</Button>}
+ />
+ <CatalogCard
+ icon={<Globe size={18} />}
+ title={t('app.styleGuide.staticSite', 'Static site')}
+ sub="by ServerKit"
+ featured
+ description={t('app.styleGuide.catalogCardDemo2', 'One tag, one action; counts and versions stay plain text.')}
+ facts=":80"
+ action={<Button size="sm" variant="outline">{t('app.styleGuide.deploy', 'Deploy')}</Button>}
+ />
+ </CatalogGrid>
+ </div>
+ )}
+
{/* ── TABLES ── */}
{activeSection === 'tables' && (
<div className="styleguide__section">
diff --git a/frontend/src/pages/Templates.jsx b/frontend/src/pages/Templates.jsx
index 88cab28f..3caf2aca 100644
--- a/frontend/src/pages/Templates.jsx
+++ b/frontend/src/pages/Templates.jsx
@@ -12,12 +12,17 @@ import api from '../services/api';
import { useToast } from '../contexts/useToast.js';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
+import {
+ Select, SelectTrigger, SelectContent, SelectItem, SelectValue,
+} from '@/components/ui/select';
import {
SearchField, FilterDrawer, FilterButton, countActiveFilters, Drawer,
DataTableFooter, CatalogCard, CatalogGrid,
} from '@/components/ds';
import { useTableChrome, GridViewPicker, GridToolsMenu } from '@/components/ds/grid';
-import ServerPicker from '@/components/templates/ServerPicker';
+import ServerPicker from '@/components/ServerPicker';
+import PortField from '@/components/PortField';
+import { LOCAL_SERVER_ID } from '@/utils/serverTarget';
import { useTopbarChrome } from '@/hooks/useTopbarActions';
import { applyTableSorts, useTableSort } from '@/hooks/useTableSort';
import EmptyState from '../components/EmptyState';
@@ -677,8 +682,7 @@ const InstallModal = ({ template, onClose, onSuccess, renderIcon }) => {
);
const [branch, setBranch] = useState(template.repo?.branch || 'main');
const [variables, setVariables] = useState({});
- const [servers, setServers] = useState([{ id: 'local', name: 'Local server', is_local: true }]);
- const [selectedServerId, setSelectedServerId] = useState('local');
+ const [selectedServerId, setSelectedServerId] = useState(LOCAL_SERVER_ID);
const [capacity, setCapacity] = useState(null);
const [capacityLoading, setCapacityLoading] = useState(false);
const [installing, setInstalling] = useState(false);
@@ -700,7 +704,6 @@ const InstallModal = ({ template, onClose, onSuccess, renderIcon }) => {
}, [template]);
useEffect(() => {
- loadServers();
api.getSiteBaseDomains()
.then((data) => {
const bases = data?.base_domains || [];
@@ -711,20 +714,6 @@ const InstallModal = ({ template, onClose, onSuccess, renderIcon }) => {
.catch(() => setBaseDomain(null));
}, []);
- async function loadServers() {
- try {
- const data = await api.getAvailableServers();
- const list = Array.isArray(data) ? data : [];
- if (list.length > 0) {
- setServers(list);
- setSelectedServerId(list[0].id);
- }
- } catch {
- setServers([{ id: 'local', name: 'Local server', is_local: true }]);
- setSelectedServerId('local');
- }
- }
-
// Ask whether this template fits the chosen server, and re-ask whenever
// they switch — the whole point is to answer before the deploy, not after.
useEffect(() => {
@@ -742,8 +731,7 @@ const InstallModal = ({ template, onClose, onSuccess, renderIcon }) => {
// container on a remote server — and the repo pipeline has no auto-publish
// step at all. Showing it and then landing on host:port is worse than not
// offering it (the operator had to redo the domain in service settings).
- const selectedServer = servers.find((s) => s.id === selectedServerId);
- const isLocalTarget = selectedServerId === 'local' || !!selectedServer?.is_local;
+ const isLocalTarget = selectedServerId === LOCAL_SERVER_ID;
const domainPreview = baseDomain && appName && isLocalTarget && !isRepo
? `${appName}.${baseDomain}` : null;
@@ -917,9 +905,10 @@ const InstallModal = ({ template, onClose, onSuccess, renderIcon }) => {
<div className="sk-formdrawer__field">
<span className="sk-formdrawer__label">{t('app.templates.deployToServer', 'Deploy to server')}</span>
<ServerPicker
- servers={servers}
value={selectedServerId}
- onChange={setSelectedServerId}
+ onChange={(id) => setSelectedServerId(id)}
+ capability="docker"
+ label={t('app.serverPicker.deployToServer', 'Deploy to server')}
/>
{/* Sits under the picker because the answer depends on
which server is chosen — switching re-asks. */}
@@ -936,16 +925,30 @@ const InstallModal = ({ template, onClose, onSuccess, renderIcon }) => {
{variable.required && ' *'}
</label>
{variable.options ? (
- <select
+ <Select
value={variables[variable.name] || ''}
- onChange={(e) => setVariables({...variables, [variable.name]: e.target.value})}
+ onValueChange={(v) => setVariables({...variables, [variable.name]: v})}
required={variable.required}
>
- <option value="">{t('app.templates.select', 'Select…')}</option>
- {variable.options.map(opt => (
- <option key={opt} value={opt}>{opt}</option>
- ))}
- </select>
+ <SelectTrigger aria-label={variable.name}>
+ <SelectValue placeholder={t('app.templates.select', 'Select…')} />
+ </SelectTrigger>
+ <SelectContent>
+ {variable.options.filter(opt => opt !== '').map(opt => (
+ <SelectItem key={opt} value={String(opt)}>{opt}</SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ ) : variable.type === 'port' ? (
+ // Host ports are only checked against this panel's
+ // host; on a remote server just the range applies.
+ <PortField
+ value={variables[variable.name] || ''}
+ onChange={(port) => setVariables({...variables, [variable.name]: port === '' ? '' : String(port)})}
+ host={isLocalTarget}
+ placeholder={variable.default || ''}
+ required={variable.required}
+ />
) : variable.type === 'password' ? (
<Input
type="password"
@@ -956,7 +959,7 @@ const InstallModal = ({ template, onClose, onSuccess, renderIcon }) => {
/>
) : (
<Input
- type={variable.type === 'port' ? 'number' : 'text'}
+ type="text"
value={variables[variable.name] || ''}
onChange={(e) => setVariables({...variables, [variable.name]: e.target.value})}
placeholder={variable.default || ''}
diff --git a/frontend/src/pages/Terminal.jsx b/frontend/src/pages/Terminal.jsx
index b9a65dcf..70857c7e 100644
--- a/frontend/src/pages/Terminal.jsx
+++ b/frontend/src/pages/Terminal.jsx
@@ -3,7 +3,8 @@ import useTabParam from '../hooks/useTabParam';
import api from '../services/api';
import { useToast } from '../contexts/useToast.js';
import { useConfirm } from '../hooks/useConfirm';
-import TargetPicker from '../components/TargetPicker';
+import ServerPicker from '../components/ServerPicker';
+import { serverTarget, targetServerId } from '../utils/serverTarget';
import RemoteTerminal from '../components/RemoteTerminal';
import LogFileList from '../components/log-viewer/LogFileList';
import LogToolbar from '../components/log-viewer/LogToolbar';
@@ -31,6 +32,9 @@ import {
ScrollText, Cpu, Settings,
} from 'lucide-react';
import { Button as SharedButton } from '@/components/ui/button';
+import {
+ Select, SelectTrigger, SelectContent, SelectItem, SelectValue,
+} from '@/components/ui/select';
// 'logs' stays first so the default landing keeps working on installs with no
// paired agents (the interactive shell needs a connected agent).
@@ -332,10 +336,10 @@ const LogFilesTab = () => {
<div className="lv-header">
<div className="lv-header-target">
<span className="lv-header-label">{t('common.labels.source', 'Source')}</span>
- <TargetPicker
- feature="logs"
- value={target}
- onChange={setTarget}
+ <ServerPicker
+ capability="logs"
+ value={targetServerId(target)}
+ onChange={(id, server) => setTarget(serverTarget(id, server))}
/>
{isRemote && (
<span className="lv-header-hint">
@@ -608,7 +612,11 @@ const JournalTab = () => {
<div className="lv-header">
<div className="lv-header-target">
<span className="lv-header-label">{t('common.labels.source', 'Source')}</span>
- <TargetPicker feature="logs" value={target} onChange={setTarget} />
+ <ServerPicker
+ capability="logs"
+ value={targetServerId(target)}
+ onChange={(id, server) => setTarget(serverTarget(id, server))}
+ />
{isRemote && (
<span className="lv-header-hint">
<AlertCircle size={12} />
@@ -888,7 +896,11 @@ const ProcessesTab = () => {
<div className="lv-header">
<div className="lv-header-target">
<span className="lv-header-label">{t('common.labels.source', 'Source')}</span>
- <TargetPicker feature="processes" value={target} onChange={setTarget} />
+ <ServerPicker
+ capability="processes"
+ value={targetServerId(target)}
+ onChange={(id, server) => setTarget(serverTarget(id, server))}
+ />
{isRemote && (
<span className="lv-header-hint">
<AlertCircle size={12} />
@@ -936,16 +948,20 @@ const ProcessesTab = () => {
onSortsChange={setSorts}
actions={(
<>
- <select
- className="lv-select"
- value={limit}
- onChange={(e) => setLimit(parseInt(e.target.value, 10))}
- title={t('app.terminal.processesToFetch', 'Processes to fetch')}
- >
- {PROCESS_LIMITS.map((n) => (
- <option key={n} value={n}>{t('app.terminal.top', 'Top')} {n}</option>
- ))}
- </select>
+ <Select value={String(limit)} onValueChange={(v) => setLimit(parseInt(v, 10))}>
+ <SelectTrigger
+ className="lv-select"
+ title={t('app.terminal.processesToFetch', 'Processes to fetch')}
+ aria-label={t('app.terminal.processesToFetch', 'Processes to fetch')}
+ >
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {PROCESS_LIMITS.map((n) => (
+ <SelectItem key={n} value={String(n)}>{t('app.terminal.top', 'Top')} {n}</SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
<SharedButton variant="unstyled" type="button"
className={`lv-chip ${autoRefresh ? 'active' : ''}`}
onClick={() => setAutoRefresh(!autoRefresh)}
@@ -1042,7 +1058,11 @@ const ServicesTab = () => {
<div className="lv-header">
<div className="lv-header-target">
<span className="lv-header-label">{t('common.labels.source', 'Source')}</span>
- <TargetPicker feature="services" value={target} onChange={setTarget} />
+ <ServerPicker
+ capability="services"
+ value={targetServerId(target)}
+ onChange={(id, server) => setTarget(serverTarget(id, server))}
+ />
</div>
</div>
<SystemdServicesTab
diff --git a/frontend/src/pages/Vaults.jsx b/frontend/src/pages/Vaults.jsx
index 75a07c76..e501e7f7 100644
--- a/frontend/src/pages/Vaults.jsx
+++ b/frontend/src/pages/Vaults.jsx
@@ -8,13 +8,13 @@ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@
import Modal from '@/components/Modal';
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '@/components/ui/dropdown-menu';
import { useToast } from '../contexts/useToast.js';
-import { ArrowLeft, Plus, MoreVertical, Copy, Eye, EyeOff, KeyRound, Trash2 } from 'lucide-react';
+import { ArrowLeft, Plus, MoreVertical, Eye, EyeOff, KeyRound, Trash2 } from 'lucide-react';
import ResourceListPage from '../components/layouts/ResourceListPage';
import { useTopbarActions } from '@/hooks/useTopbarActions';
import { SearchField, ServiceTile } from '@/components/ds';
import { formatRelativeTime } from '@/utils/time';
import { useConfirm } from '@/hooks/useConfirm';
-import { useClipboard } from '@/hooks/useClipboard';
+import { CopyButton } from '../components/CopyButton';
import { useWorkspace } from '../contexts/useWorkspace.js';
import { useTranslation } from 'react-i18next';
@@ -47,7 +47,6 @@ export default function Vaults() {
const toast = useToast();
const toastError = toast.error;
const { confirm } = useConfirm();
- const { copy } = useClipboard({ successMessage: 'Copied' });
const { activeWorkspaceId: workspaceScopeId, isAllWorkspaces } = useWorkspace();
const [vaults, setVaults] = useState([]);
@@ -318,9 +317,11 @@ export default function Vaults() {
<Button variant="ghost" size="icon" onClick={() => (revealed ? setRevealSecretId(null) : revealSecret(s))} title={revealed ? t('app.vaults.hide', 'Hide') : t('app.vaults.reveal', 'Reveal')}>
{revealed ? <EyeOff size={14} /> : <Eye size={14} />}
</Button>
- <Button variant="ghost" size="icon" title={t('common.actions.copy', 'Copy')} onClick={() => copy(revealed ? revealedValue : s.value)}>
- <Copy size={14} />
- </Button>
+ <CopyButton
+ value={revealed ? revealedValue : s.value}
+ label={t('common.actions.copy', 'Copy')}
+ copiedLabel={t('app.copyField.copied', 'Copied')}
+ />
<Button variant="ghost" size="icon" className="text-destructive" title={t('common.actions.delete', 'Delete')} onClick={() => deleteSecret(s.id)}>
<Trash2 size={14} />
</Button>
diff --git a/frontend/src/pages/WorkspaceDetail.jsx b/frontend/src/pages/WorkspaceDetail.jsx
index c051becd..a9041184 100644
--- a/frontend/src/pages/WorkspaceDetail.jsx
+++ b/frontend/src/pages/WorkspaceDetail.jsx
@@ -12,6 +12,9 @@ import Modal from '@/components/Modal';
import { Pill, ServiceTile } from '@/components/ds';
import PageLayout from '../layouts/PageLayout';
import { Button } from '@/components/ui/button';
+import {
+ Select, SelectTrigger, SelectContent, SelectItem, SelectValue,
+} from '@/components/ui/select';
import {
LayoutGrid, ChevronLeft, Server, Box, Globe,
Users, Settings2,
@@ -356,11 +359,14 @@ const WorkspaceDetail = () => {
<hr />
<h4>{t('app.workspaceDetail.grantAccess', 'Grant Access')}</h4>
<div className="form-group">
- <label>{t('app.workspaceDetail.roleForNewGrants', 'Role for new grants')}</label>
- <select value={grantRole} onChange={e => setGrantRole(e.target.value)}>
- <option value="editor">{t('app.workspaceDetail.editorViewOperate', 'Editor · view + operate')}</option>
- <option value="viewer">{t('app.workspaceDetail.viewerReadOnly', 'Viewer · read-only')}</option>
- </select>
+ <label htmlFor="ws-grant-role">{t('app.workspaceDetail.roleForNewGrants', 'Role for new grants')}</label>
+ <Select value={grantRole} onValueChange={setGrantRole}>
+ <SelectTrigger id="ws-grant-role"><SelectValue /></SelectTrigger>
+ <SelectContent>
+ <SelectItem value="editor">{t('app.workspaceDetail.editorViewOperate', 'Editor · view + operate')}</SelectItem>
+ <SelectItem value="viewer">{t('app.workspaceDetail.viewerReadOnly', 'Viewer · read-only')}</SelectItem>
+ </SelectContent>
+ </Select>
</div>
<div className="ws-pick">
{allUsers.filter(u => u.id !== sharingApp.user_id && !grants.find(g => g.user_id === u.id)).map(u => (
diff --git a/frontend/src/pages/new-service/ConnectStep.jsx b/frontend/src/pages/new-service/ConnectStep.jsx
index ebd47578..90e77b42 100644
--- a/frontend/src/pages/new-service/ConnectStep.jsx
+++ b/frontend/src/pages/new-service/ConnectStep.jsx
@@ -6,6 +6,9 @@ import { SiGithub } from 'react-icons/si';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
+import {
+ Select, SelectTrigger, SelectContent, SelectItem, SelectValue,
+} from '@/components/ui/select';
import { SOURCE_NEEDS } from './useNewServiceForm';
import { useTranslation } from 'react-i18next';
@@ -152,11 +155,14 @@ const ConnectStep = ({ form }) => {
</div>
<div className="new-service-page__field">
<Label htmlFor="managed-by">{t('app.connectStep.managedBy', 'Managed by')}</Label>
- <select id="managed-by" value={managedBy} onChange={(e) => setManagedBy(e.target.value)}>
- <option value="auto">{t('app.connectStep.autoDetect', 'Auto-detect')}</option>
- <option value="docker_compose">{t('app.connectStep.dockerCompose', 'Docker Compose')}</option>
- <option value="systemd">systemd</option>
- </select>
+ <Select value={managedBy} onValueChange={setManagedBy}>
+ <SelectTrigger id="managed-by"><SelectValue /></SelectTrigger>
+ <SelectContent>
+ <SelectItem value="auto">{t('app.connectStep.autoDetect', 'Auto-detect')}</SelectItem>
+ <SelectItem value="docker_compose">{t('app.connectStep.dockerCompose', 'Docker Compose')}</SelectItem>
+ <SelectItem value="systemd">systemd</SelectItem>
+ </SelectContent>
+ </Select>
</div>
</div>
)}
@@ -218,16 +224,14 @@ const ConnectStep = ({ form }) => {
<div className="new-service-page__field">
<Label htmlFor="branch-inline">{t('common.labels.branch', 'Branch')}</Label>
{sourceMode === 'github' && branches.length > 0 ? (
- <select
- id="branch-inline"
- value={branch}
- onChange={(e) => setBranch(e.target.value)}
- disabled={branchesLoading}
- >
- {branches.map(option => (
- <option key={option.name} value={option.name}>{option.name}</option>
- ))}
- </select>
+ <Select value={branch} onValueChange={setBranch} disabled={branchesLoading}>
+ <SelectTrigger id="branch-inline"><SelectValue /></SelectTrigger>
+ <SelectContent>
+ {branches.map(option => (
+ <SelectItem key={option.name} value={option.name}>{option.name}</SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
) : (
<Input
id="branch-inline"
diff --git a/frontend/src/pages/new-service/ReviewStep.jsx b/frontend/src/pages/new-service/ReviewStep.jsx
index 8a741fd8..0913bbed 100644
--- a/frontend/src/pages/new-service/ReviewStep.jsx
+++ b/frontend/src/pages/new-service/ReviewStep.jsx
@@ -6,8 +6,12 @@ import {
import { Label } from '@/components/ui/label';
import { Input } from '@/components/ui/input';
import { Switch } from '@/components/ui/switch';
+import {
+ Select, SelectTrigger, SelectContent, SelectItem, SelectValue,
+} from '@/components/ui/select';
import BuildpackPreview from '@/components/buildpack/BuildpackPreview';
import ResourcePicker from '@/components/ResourcePicker';
+import PortField from '@/components/PortField';
import { useWorkspace } from '@/contexts/useWorkspace.js';
import { useTranslation } from 'react-i18next';
import {
@@ -222,42 +226,48 @@ const ReviewStep = ({ form }) => {
)}
<div className="new-service-page__field">
<Label htmlFor="review-type">{t('app.reviewStep.serviceType', 'Service type')}</Label>
- <select id="review-type" value={appType} onChange={(e) => setAppType(e.target.value)}>
- {sourceMode === 'upload' && <option value="auto">{t('app.reviewStep.autoDetect', 'Auto-detect')}</option>}
- {APP_TYPE_OPTIONS.filter(o => o.value !== 'auto').map(option => (
- <option key={option.value} value={option.value}>{option.label}</option>
- ))}
- </select>
+ <Select value={appType} onValueChange={setAppType}>
+ <SelectTrigger id="review-type"><SelectValue /></SelectTrigger>
+ <SelectContent>
+ {sourceMode === 'upload' && <SelectItem value="auto">{t('app.reviewStep.autoDetect', 'Auto-detect')}</SelectItem>}
+ {APP_TYPE_OPTIONS.filter(o => o.value !== 'auto').map(option => (
+ <SelectItem key={option.value} value={option.value}>{option.label}</SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
</div>
{showBuild && (
<div className="new-service-page__field">
<Label htmlFor="review-build">{t('app.reviewStep.buildMethod', 'Build method')}</Label>
- <select id="review-build" value={buildMethod} onChange={(e) => setBuildMethod(e.target.value)}>
- {BUILD_METHOD_OPTIONS.map(option => (
- <option key={option.value} value={option.value}>{option.label}</option>
- ))}
- </select>
+ <Select value={buildMethod} onValueChange={setBuildMethod}>
+ <SelectTrigger id="review-build"><SelectValue /></SelectTrigger>
+ <SelectContent>
+ {BUILD_METHOD_OPTIONS.map(option => (
+ <SelectItem key={option.value} value={option.value}>{option.label}</SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
</div>
)}
<div className="new-service-page__field">
<Label htmlFor="review-port">{t('app.reviewStep.runtimePort', 'Runtime port')}</Label>
- <Input
+ <PortField
id="review-port"
- type="number"
value={port}
- onChange={(e) => setPort(e.target.value)}
+ onChange={setPort}
placeholder="3000"
- min="1"
- max="65535"
/>
</div>
<div className="new-service-page__field">
<Label htmlFor="review-ingress">{t('app.reviewStep.ingress', 'Ingress')}</Label>
{ingressProxyEligible ? (
- <select id="review-ingress" value={ingressPlane} onChange={(e) => setIngressPlane(e.target.value)}>
- <option value="nginx">{t('app.reviewStep.hostNginxDefault', 'Host Nginx (default)')}</option>
- <option value="proxy_stack">{t('app.reviewStep.proxyStackTraefikCaddy', 'Proxy stack (Traefik / Caddy)')}</option>
- </select>
+ <Select value={ingressPlane} onValueChange={setIngressPlane}>
+ <SelectTrigger id="review-ingress"><SelectValue /></SelectTrigger>
+ <SelectContent>
+ <SelectItem value="nginx">{t('app.reviewStep.hostNginxDefault', 'Host Nginx (default)')}</SelectItem>
+ <SelectItem value="proxy_stack">{t('app.reviewStep.proxyStackTraefikCaddy', 'Proxy stack (Traefik / Caddy)')}</SelectItem>
+ </SelectContent>
+ </Select>
) : (
<div className="new-service-page__note">
<Network size={16} />
diff --git a/frontend/src/styles/pages/_backups.scss b/frontend/src/styles/pages/_backups.scss
index 8fbe6ddf..c06ba270 100644
--- a/frontend/src/styles/pages/_backups.scss
+++ b/frontend/src/styles/pages/_backups.scss
@@ -608,14 +608,6 @@
.bk-remote-on { color: $success; }
.bk-remote-off { color: $text-tertiary; }
-.bk-restore-details {
- display: flex;
- flex-direction: column;
- gap: $space-2;
- font-size: $font-size-sm;
- color: $text-secondary;
-}
-
.bk-restore-warn {
display: flex;
align-items: flex-start;
diff --git a/frontend/src/styles/pages/_dashboard.scss b/frontend/src/styles/pages/_dashboard.scss
index 298acbc5..59dbc17d 100644
--- a/frontend/src/styles/pages/_dashboard.scss
+++ b/frontend/src/styles/pages/_dashboard.scss
@@ -657,3 +657,19 @@
padding-left: 0;
}
}
+
+// Bar controls built on the shared pickers: sized to the bar's 32px row and
+// the compact mono look of the other bar controls.
+.skw-bar__ctl .skw-refresh-trigger,
+.skw-bar__ctl .skw-serverpick {
+ height: 32px;
+ width: auto;
+ padding: 0 10px;
+ border-radius: 8px;
+ font-size: 12px;
+}
+
+.skw-bar__ctl .skw-refresh-trigger {
+ min-width: 0;
+ font-family: var(--mono);
+}
diff --git a/frontend/src/styles/pages/_deployments.scss b/frontend/src/styles/pages/_deployments.scss
index 355ab6f7..e23684fe 100644
--- a/frontend/src/styles/pages/_deployments.scss
+++ b/frontend/src/styles/pages/_deployments.scss
@@ -79,17 +79,6 @@
color: $text-tertiary;
font-size: $font-size-xs;
font-weight: $font-weight-semibold;
-
- select {
- min-height: 30px;
- padding: $space-1 $space-2;
- background: $bg-elevated;
- border: 1px solid $border-subtle;
- border-radius: $radius-md;
- color: $text-primary;
- font-size: $font-size-sm;
- cursor: pointer;
- }
}
&__sim-list {
diff --git a/frontend/src/styles/pages/_downloads.scss b/frontend/src/styles/pages/_downloads.scss
index cfafd46b..3f5c1725 100644
--- a/frontend/src/styles/pages/_downloads.scss
+++ b/frontend/src/styles/pages/_downloads.scss
@@ -279,48 +279,8 @@
}
.command-content {
- position: relative;
padding: $space-4;
background: $bg-body;
-
- pre {
- margin: 0;
- padding: 0;
- background: transparent;
- overflow-x: auto;
-
- code {
- font-family: $font-mono;
- font-size: $font-size-sm;
- color: $text-primary;
- white-space: pre-wrap;
- word-break: break-all;
- }
- }
-
- .copy-btn {
- position: absolute;
- top: $space-3;
- right: $space-3;
- background: $bg-secondary;
- border: 1px solid $border-default;
- border-radius: $radius-md;
- padding: $space-2;
- cursor: pointer;
- color: $text-secondary;
- transition: all 0.2s;
-
- &:hover {
- background: $bg-hover;
- color: $text-primary;
- border-color: $accent-primary;
- }
-
- svg {
- width: 16px;
- height: 16px;
- }
- }
}
.command-note {
@@ -389,22 +349,6 @@
}
}
- pre {
- background: $bg-body;
- padding: $space-3;
- border-radius: $radius-md;
- margin: $space-2 0;
- overflow-x: auto;
-
- code {
- font-family: $font-mono;
- font-size: $font-size-sm;
- color: $text-primary;
- background: transparent;
- padding: 0;
- }
- }
-
.step-note {
color: $text-tertiary;
font-size: $font-size-xs;
@@ -416,20 +360,6 @@
// Verification
.verification-command {
margin-top: $space-4;
-
- pre {
- background: $bg-card;
- border: 1px solid $border-default;
- padding: $space-4;
- border-radius: $radius-lg;
- margin: 0;
-
- code {
- font-family: $font-mono;
- font-size: $font-size-sm;
- color: $text-primary;
- }
- }
}
}
diff --git a/frontend/src/styles/pages/_file-manager.scss b/frontend/src/styles/pages/_file-manager.scss
index ab2c5dde..ab2c3bc9 100644
--- a/frontend/src/styles/pages/_file-manager.scss
+++ b/frontend/src/styles/pages/_file-manager.scss
@@ -351,10 +351,13 @@ $ft-default: #646b7a;
&.small { padding: 4px; }
}
+ // Compact Radix Select trigger: icon · value · chevron.
.file-toolbar-select {
position: relative;
display: inline-flex;
align-items: center;
+ justify-content: flex-start;
+ width: auto;
height: 32px;
min-width: 0;
gap: 5px;
@@ -363,29 +366,30 @@ $ft-default: #646b7a;
border-radius: 8px;
background: var(--surface-2);
color: var(--text-faint);
+ font-family: $font-mono;
+ font-size: 10.5px;
transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease;
&:hover,
- &:focus-within {
+ &:focus-visible {
border-color: var(--border-strong);
background: var(--surface-3);
color: var(--text-dim);
}
- select {
+ > span {
width: 78px;
min-width: 0;
- border: 0;
- outline: 0;
- background: transparent;
- color: inherit;
- font-family: $font-mono;
- font-size: 10.5px;
- cursor: pointer;
- appearance: none;
+ text-align: start;
}
- > svg:last-child { opacity: 0.58; pointer-events: none; }
+ > svg { flex-shrink: 0; }
+
+ .ui-select-icon {
+ width: 12px;
+ height: 12px;
+ opacity: 0.58;
+ }
}
// ─── View toggles ───────────────────────────────────
@@ -575,8 +579,7 @@ $ft-default: #646b7a;
padding: 0 2px $space-3;
border-bottom: 1px solid var(--border-soft);
- .target-picker,
- .target-picker__resource { width: 100%; max-width: none; }
+ .file-manager-source__picker { width: 100%; max-width: none; }
&__meta {
display: flex;
@@ -1868,7 +1871,7 @@ $drawer-width: 520px;
.file-toolbar-select {
flex: 1;
- select { width: 100%; }
+ > span { width: 100%; }
}
.file-mount-chip { display: none; }
diff --git a/frontend/src/styles/pages/_ftp-server.scss b/frontend/src/styles/pages/_ftp-server.scss
index 4040cbe9..054e78b1 100644
--- a/frontend/src/styles/pages/_ftp-server.scss
+++ b/frontend/src/styles/pages/_ftp-server.scss
@@ -37,12 +37,10 @@
}
}
- .config-grid,
- .info-grid {
- display: grid;
+ .info-list {
+ gap: 0;
}
- .config-item,
.info-item {
display: flex;
justify-content: space-between;
@@ -55,12 +53,11 @@
&:first-child { padding-top: 0; }
&:last-child { border-bottom: none; padding-bottom: 0; }
- .config-label,
.info-label {
color: var(--text-dim);
}
- .config-value {
+ .info-value {
font-family: var(--mono);
font-size: 12.5px;
font-weight: $font-weight-medium;
@@ -69,16 +66,6 @@
&.success { color: var(--green); }
&.warning { color: var(--amber); }
}
-
- code {
- font-family: var(--mono);
- font-size: 12px;
- color: var(--text);
- background: var(--surface-2);
- border: 1px solid var(--border-soft);
- padding: 2px 7px;
- border-radius: $radius-md;
- }
}
}
diff --git a/frontend/src/styles/pages/_monitors.scss b/frontend/src/styles/pages/_monitors.scss
index 43e25cf1..54629db9 100644
--- a/frontend/src/styles/pages/_monitors.scss
+++ b/frontend/src/styles/pages/_monitors.scss
@@ -927,18 +927,6 @@
border-top: 1px solid var(--border-soft);
}
- .mon-select {
- width: 100%;
- height: 36px;
- padding: 0 10px;
- border-radius: 8px;
- border: 1px solid var(--border);
- background: var(--surface-2);
- color: var(--text);
- font-family: inherit;
- font-size: 13px;
- }
-
.mon-switch-row {
display: flex;
align-items: center;
diff --git a/frontend/src/styles/pages/_new-service.scss b/frontend/src/styles/pages/_new-service.scss
index 20fb8c00..0deab349 100644
--- a/frontend/src/styles/pages/_new-service.scss
+++ b/frontend/src/styles/pages/_new-service.scss
@@ -624,8 +624,7 @@
font-weight: $font-weight-medium;
}
- input,
- select {
+ input {
min-height: 40px;
width: 100%;
background: $bg-elevated;
@@ -640,11 +639,6 @@
box-shadow: 0 0 0 3px $accent-glow;
}
}
-
- select {
- padding: 0 $space-3;
- cursor: pointer;
- }
}
&__resource-picker {
diff --git a/frontend/src/styles/pages/_queue-operations.scss b/frontend/src/styles/pages/_queue-operations.scss
index 7c737af2..d8e6a9ce 100644
--- a/frontend/src/styles/pages/_queue-operations.scss
+++ b/frontend/src/styles/pages/_queue-operations.scss
@@ -410,24 +410,10 @@
gap: $space-1;
}
+// Toolbar filter triggers size to their content instead of the field default.
.queue-select {
- background: $bg-body;
- border: 1px solid $border-subtle;
- border-radius: $radius-xl;
- padding: $space-2 $space-3;
- color: $text-primary;
- font-size: $font-size-sm;
+ width: auto;
min-width: 160px;
- height: 44px;
-
- &:disabled {
- opacity: 0.5;
- cursor: not-allowed;
- }
-
- &--full {
- width: 100%;
- }
}
.queue-messages-toolbar {
diff --git a/frontend/src/styles/pages/_servers.scss b/frontend/src/styles/pages/_servers.scss
index d6ccbdac..d53a8324 100644
--- a/frontend/src/styles/pages/_servers.scss
+++ b/frontend/src/styles/pages/_servers.scss
@@ -909,39 +909,18 @@
}
}
-// Security section styles
+// Security section styles: the connection facts, as an InfoList in a box.
.security-info-bar {
display: flex;
- gap: $space-6;
- padding: $space-4;
+ flex-direction: column;
+ gap: 0;
+ padding: $space-1 $space-4;
background: $bg-elevated;
border: 1px solid $border-subtle;
border-radius: $radius-lg;
margin-bottom: $space-5;
}
-.security-info-item {
- .security-info-label {
- display: block;
- font-size: $font-size-xs;
- color: $text-tertiary;
- margin-bottom: $space-1;
- }
-
- .security-info-value {
- font-size: $font-size-sm;
- color: $text-primary;
-
- code {
- font-family: $font-mono;
- background: $bg-body;
- padding: 2px $space-2;
- border-radius: $radius-sm;
- font-size: $font-size-xs;
- }
- }
-}
-
.subsection {
h4 {
font-size: $font-size-sm;
@@ -1360,109 +1339,16 @@
margin-top: $space-3;
}
-.install-tab {
- background: var(--surface);
- border: 1px solid var(--border-soft);
- border-radius: var(--radius);
- overflow: hidden;
-}
-
-.install-tab-header {
- display: flex;
- align-items: center;
- gap: $space-3;
- padding: $space-3 $space-4;
- background: var(--surface-2);
- border-bottom: 1px solid var(--border-soft);
-
- > svg {
- color: var(--text-faint);
- flex-shrink: 0;
- }
-}
-
-.install-tab-title {
- flex: 1;
- min-width: 0;
-
- > span:first-child {
- display: block;
- font-family: var(--mono);
- font-size: 10.5px;
- font-weight: $font-weight-semibold;
- letter-spacing: 0.08em;
- text-transform: uppercase;
- color: var(--text-dim);
- }
-}
-
-.install-tab-description {
- display: block;
- font-size: 11px;
- color: var(--text-faint);
- font-weight: $font-weight-normal;
- margin-top: 2px;
-}
-
-.install-script {
- padding: $space-4 $space-5;
- margin: 0;
- font-family: var(--mono);
- font-size: 11.5px;
- line-height: 1.6;
- color: var(--text-dim);
- background: var(--bg-code);
- overflow-x: auto;
- white-space: pre-wrap;
- word-break: break-all;
-}
-
-// Hero block on the "connection string ready" screen and the regenerate
-// drawer. Keeps the one pasteable blob visually heavier than the install
-// scripts (which are now an "I haven't installed the agent yet" fallback).
-.connection-string-field {
+// The connection string on the "ready" screen: the one pasteable blob.
+.server-connection-string {
margin-top: $space-5;
- border: 1px solid var(--border);
- border-radius: var(--radius);
- background: var(--surface);
- overflow: hidden;
-}
-
-.connection-string-field__header {
- display: flex;
- align-items: center;
- gap: $space-3;
- padding: $space-3 $space-4;
- background: var(--surface-2);
- border-bottom: 1px solid var(--border-soft);
-
- > svg {
- color: var(--accent-bright);
- flex-shrink: 0;
- }
-
- > span {
- flex: 1;
- font-family: var(--mono);
- font-size: 10.5px;
- font-weight: $font-weight-semibold;
- letter-spacing: 0.08em;
- text-transform: uppercase;
- color: var(--text-dim);
- }
}
-.connection-string-field__value {
- padding: $space-4 $space-5;
- margin: 0;
- font-family: var(--mono);
- font-size: 12.5px;
- line-height: $line-height-relaxed;
- color: var(--text);
- background: var(--bg-code);
- overflow-x: auto;
- white-space: pre-wrap;
- word-break: break-all;
+// "Set group…" in the floating bulk bar sizes to its text, not the field width.
+.servers-bulk-group {
+ width: auto;
+ min-width: 140px;
+ height: 30px;
}
.install-fallback {
@@ -2317,12 +2203,10 @@
}
}
-.info-rows {
- list-style: none;
- margin: 0;
- padding: 0;
- display: flex;
- flex-direction: column;
+// Server overview spec rows (InfoList): icon + faint key, mono value
+// right-aligned, soft separators.
+.server-info-list {
+ gap: 0;
&--columns {
display: grid;
@@ -2333,42 +2217,40 @@
grid-template-columns: 1fr;
}
}
-}
-// Demo `.info-row` key/value spec: faint mono key, mono value right-aligned,
-// soft separators. (Only ServerDetail renders this class.)
-.info-row {
- display: grid;
- grid-template-columns: 18px minmax(0, 1fr) auto;
- align-items: center;
- gap: $space-3;
- padding: 11px 0;
- border-bottom: 1px solid var(--border-soft);
- min-height: 40px;
- font-size: 13px;
+ .info-item {
+ gap: $space-3;
+ padding: 11px 0;
+ border-bottom: 1px solid var(--border-soft);
+ min-height: 40px;
+ font-size: 13px;
- &:last-child { border-bottom: 0; }
+ &:last-child { border-bottom: 0; }
+ }
- &__icon {
+ .info-label {
display: inline-flex;
align-items: center;
- justify-content: center;
- color: var(--text-ghost);
-
- svg { width: 14px; height: 14px; }
- }
-
- &__label {
+ gap: $space-3;
+ min-width: 0;
font-size: 12.5px;
color: var(--text-faint);
+
+ svg {
+ width: 14px;
+ height: 14px;
+ flex-shrink: 0;
+ color: var(--text-ghost);
+ }
}
- &__value {
+ .info-value {
+ min-width: 0;
font-family: var(--mono);
font-size: 12.5px;
+ font-weight: $font-weight-normal;
color: var(--text);
text-align: right;
- max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
@@ -2739,24 +2621,6 @@
border-radius: var(--radius);
}
- .security-info-item {
- .security-info-label {
- font-family: var(--mono);
- font-size: 10.5px;
- letter-spacing: 0.06em;
- text-transform: uppercase;
- color: var(--text-faint);
- margin-bottom: 5px;
- }
-
- .security-info-value code {
- font-family: var(--mono);
- font-size: 12px;
- background: var(--surface-3);
- color: var(--text);
- }
- }
-
.ip-item {
background: var(--surface-2);
border-color: var(--border-soft);
diff --git a/frontend/src/styles/pages/_status-pages.scss b/frontend/src/styles/pages/_status-pages.scss
index fe64f791..6cb62895 100644
--- a/frontend/src/styles/pages/_status-pages.scss
+++ b/frontend/src/styles/pages/_status-pages.scss
@@ -172,25 +172,7 @@
border-radius: var(--radius);
background: var(--surface-2);
- > span {
- color: var(--text-faint);
- font-family: var(--mono);
- font-size: 10.5px;
- font-weight: $font-weight-semibold;
- letter-spacing: 0.08em;
- text-transform: uppercase;
- }
-
- code {
- min-width: 0;
- overflow-wrap: anywhere;
- color: var(--text);
- font-family: var(--mono);
- font-size: 12.5px;
- line-height: 1.5;
- }
-
- > div {
+ > div:not(.sk-copy-field) {
display: flex;
flex-wrap: wrap;
gap: $space-2;
diff --git a/frontend/src/styles/pages/_templates.scss b/frontend/src/styles/pages/_templates.scss
index a82638d6..4f2b27fe 100644
--- a/frontend/src/styles/pages/_templates.scss
+++ b/frontend/src/styles/pages/_templates.scss
@@ -544,11 +544,6 @@
// Responsive
-.sk-srvpick__resource-picker {
- width: 100%;
- max-width: none;
-}
-
// Capacity note in the deploy drawer — does this template fit the server the
// operator just picked. Toned by verdict, but deliberately quiet: it sits under
// the server picker as a sentence, not an alert box, because it never blocks