mirror of
https://github.com/jhd3197/ServerKit.git
synced 2026-12-01 20:55:16 +09:00
Unify server and service detail layout
The two entity pages shared a top bar but nothing below it: the server page was capped at 1400px and centered while services ran full width, the service header spelled its facts out as unseparated text, and each page had its own stat tiles, cards and settings layout. Both now sit on the same shell body and share the header meta (status dot, info tip, star), the KPI tiles and overview cards, and one grouped settings shell. Server settings sections get URLs like the service ones (/servers/:id/settings/:section).
This commit is contained in:
1 parent
2b8e8aade6
commit
26d3fab766
20 files changed
+668
-728
No files matched your search
@@ -0,0 +1,28 @@
|
||||
import InfoTip from '@/components/InfoTip';
|
||||
import { StatusDot } from '@/components/ds';
|
||||
|
||||
// The top-bar meta every entity detail page shares (services, servers):
|
||||
// [status dot] [(i) with the facts the header used to spell out] [star].
|
||||
// Anything page-specific (an "open" link) rides along as children.
|
||||
//
|
||||
// status: { kind, label } kind = Pill vocabulary
|
||||
// rows: [{ label, value }] falsy values are skipped
|
||||
export default function DetailHeaderMeta({ status, infoTitle, rows, favorite, children }) {
|
||||
return (
|
||||
<>
|
||||
<StatusDot kind={status.kind} label={status.label} />
|
||||
<InfoTip size="md" title={infoTitle}>
|
||||
<dl className="sk-detail-info">
|
||||
{rows.filter((row) => row.value).map((row) => (
|
||||
<div className="sk-detail-info__row" key={row.label}>
|
||||
<dt>{row.label}</dt>
|
||||
<dd>{row.value}</dd>
|
||||
</div>
|
||||
))}
|
||||
</dl>
|
||||
</InfoTip>
|
||||
{favorite}
|
||||
{children}
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
import { Button } from '@/components/ui/button';
|
||||
|
||||
// The settings shell every entity detail page shares (services, servers):
|
||||
// a grouped section nav on the left, the active section's panels on the right.
|
||||
// Pages keep their own sections, URL state, permissions and mutation handlers.
|
||||
//
|
||||
// groups: [{ label, items: [{ id, label, icon }] }]
|
||||
export function DetailSettings({ groups, value, onValueChange, ariaLabel, children }) {
|
||||
return (
|
||||
<div className="sk-detail-settings">
|
||||
<nav className="sk-detail-settings__nav" aria-label={ariaLabel}>
|
||||
{groups.map((group) => (
|
||||
<div className="sk-detail-settings__group" key={group.label}>
|
||||
<div className="sk-detail-settings__grouplabel">{group.label}</div>
|
||||
{group.items.map(({ id, label, icon: Icon }) => (
|
||||
<Button
|
||||
variant="unstyled"
|
||||
type="button"
|
||||
key={id}
|
||||
className={`sk-detail-settings__navitem ${value === id ? 'is-active' : ''}`}
|
||||
aria-current={value === id ? 'page' : undefined}
|
||||
onClick={() => onValueChange(id)}
|
||||
>
|
||||
<Icon size={15} aria-hidden="true" />
|
||||
{label}
|
||||
</Button>
|
||||
))}
|
||||
</div>
|
||||
))}
|
||||
</nav>
|
||||
<div className="sk-detail-settings__content">{children}</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// One section of the content column: a quiet title above its panel(s).
|
||||
export function DetailSettingsSection({ title, children }) {
|
||||
return (
|
||||
<div className="sk-detail-settings__section">
|
||||
<h3 className="sk-detail-settings__section-title">{title}</h3>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,8 +1,7 @@
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import FavoriteStar from '@/components/FavoriteStar';
|
||||
import InfoTip from '@/components/InfoTip';
|
||||
import CopyButton from '@/components/CopyButton';
|
||||
import { StatusDot } from '../ds';
|
||||
import DetailHeaderMeta from '@/components/detail/DetailHeaderMeta';
|
||||
import { serverStatusKind } from './serverDetailData';
|
||||
|
||||
// Header meta: [status dot] [(i) with endpoint + ID] [star]. Everything the
|
||||
@@ -12,22 +11,23 @@ export default function ServerHeaderMeta({ server }) {
|
||||
const status = server.status || 'pending';
|
||||
const endpoint = server.hostname || server.ip_address || t('app.serverDetail.noEndpointConfigured', 'No endpoint configured');
|
||||
return (
|
||||
<>
|
||||
<StatusDot kind={serverStatusKind(status)} label={status.charAt(0).toUpperCase() + status.slice(1)} />
|
||||
<InfoTip size="md" title={t('app.serverDetail.details', 'Server details')}>
|
||||
<dl className="server-detail-info">
|
||||
<dt>{t('common.labels.status', 'Status')}</dt>
|
||||
<dd>{status}</dd>
|
||||
<dt>{t('app.serverDetail.endpoint', 'Endpoint')}</dt>
|
||||
<dd>{endpoint}</dd>
|
||||
<dt>{t('app.serverDetail.serverId', 'ID')}</dt>
|
||||
<dd className="server-detail-info__id">
|
||||
<code>{server.id}</code>
|
||||
<CopyButton value={String(server.id)} label={t('app.serverDetail.copyId', 'Copy ID')} />
|
||||
</dd>
|
||||
</dl>
|
||||
</InfoTip>
|
||||
<FavoriteStar type="server" id={server.id} path={`/servers/${server.id}`} label={server.name} />
|
||||
</>
|
||||
<DetailHeaderMeta
|
||||
status={{ kind: serverStatusKind(status), label: status.charAt(0).toUpperCase() + status.slice(1) }}
|
||||
infoTitle={t('app.serverDetail.details', 'Server details')}
|
||||
rows={[
|
||||
{ label: t('common.labels.status', 'Status'), value: status },
|
||||
{ label: t('app.serverDetail.endpoint', 'Endpoint'), value: endpoint },
|
||||
{
|
||||
label: t('app.serverDetail.serverId', 'ID'),
|
||||
value: (
|
||||
<span className="sk-detail-info__id">
|
||||
<code>{server.id}</code>
|
||||
<CopyButton value={String(server.id)} label={t('app.serverDetail.copyId', 'Copy ID')} />
|
||||
</span>
|
||||
),
|
||||
},
|
||||
]}
|
||||
favorite={<FavoriteStar type="server" id={server.id} path={`/servers/${server.id}`} label={server.name} />}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -50,8 +50,8 @@ const ServerHealthCard = ({ server }) => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="info-card">
|
||||
<h3>{t('app.serverHealthCard.permissionLevel', 'Permission level')}</h3>
|
||||
<div className="overview-tab__card">
|
||||
<h3 className="overview-tab__card-title">{t('app.serverHealthCard.permissionLevel', 'Permission level')}</h3>
|
||||
<InfoList className="server-info-list">
|
||||
<InfoItem label={t('app.serverHealthCard.level', 'Level')}>
|
||||
<Pill kind={levelKind(level)} dot={false}>{levelName}</Pill>
|
||||
@@ -75,8 +75,8 @@ const ServerHealthCard = ({ server }) => {
|
||||
<code>{SET_HINT}</code>
|
||||
</div>
|
||||
|
||||
<div className="info-card">
|
||||
<h3>{t('app.serverHealthCard.health', 'Health')} <Pill kind={health.kind}>{health.code}</Pill></h3>
|
||||
<div className="overview-tab__card">
|
||||
<h3 className="overview-tab__card-title">{t('app.serverHealthCard.health', 'Health')} <Pill kind={health.kind}>{health.code}</Pill></h3>
|
||||
{server.last_report_at && (
|
||||
<p className="text-muted">
|
||||
{t('app.serverHealthCard.lastReport', 'Last report')}: {formatDateTime(server.last_report_at)}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { serverStatusKind } from './serverDetailData';
|
||||
import { Pill, KpiBand } from '../ds';
|
||||
import { Pill, KpiBand, MetricCard, Gauge } from '../ds';
|
||||
import OnboardingWizard from '../server/OnboardingWizard';
|
||||
import SystemStatusCard from './SystemStatusCard';
|
||||
import ServerHealthCard from './ServerHealthCard';
|
||||
@@ -8,8 +8,6 @@ import { InfoList, InfoItem } from '../InfoList';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { formatDateTime } from '@/utils/intl';
|
||||
import {
|
||||
KpiTile,
|
||||
KpiGauge,
|
||||
PulseIcon,
|
||||
ClockIcon,
|
||||
CpuIcon,
|
||||
@@ -29,6 +27,31 @@ import {
|
||||
DockerMiniIcon,
|
||||
} from './serverDetailShared';
|
||||
|
||||
// Usage thresholds for the CPU / memory / disk tiles.
|
||||
const USAGE_DANGER_PERCENT = 85;
|
||||
const USAGE_WARN_PERCENT = 70;
|
||||
|
||||
// A percent tile on the shared MetricCard: the value, a thin meter and the
|
||||
// capacity line underneath. Same tile the service overview's KPI band uses.
|
||||
const UsageTile = ({ icon, label, percent, color, sub }) => {
|
||||
const has = Number.isFinite(percent);
|
||||
const safe = has ? Math.min(Math.max(percent, 0), 100) : 0;
|
||||
const danger = safe > USAGE_DANGER_PERCENT;
|
||||
const warn = safe > USAGE_WARN_PERCENT && !danger;
|
||||
return (
|
||||
<MetricCard
|
||||
icon={icon}
|
||||
tone={danger ? 'red' : warn ? 'amber' : 'accent'}
|
||||
value={has ? safe.toFixed(1) : '—'}
|
||||
unit={has ? '%' : undefined}
|
||||
label={label}
|
||||
>
|
||||
<Gauge className="sk-kpi__meter" value={safe} color={danger ? 'var(--red)' : warn ? 'var(--amber)' : color} />
|
||||
{sub && <div className="sk-kpi__sub">{sub}</div>}
|
||||
</MetricCard>
|
||||
);
|
||||
};
|
||||
|
||||
const ServerOverviewTab = ({ server, metrics, systemInfo, onRefreshServer }) => {
|
||||
const { t } = useTranslation();
|
||||
const formatUptime = (seconds) => {
|
||||
@@ -41,6 +64,7 @@ const ServerOverviewTab = ({ server, metrics, systemInfo, onRefreshServer }) =>
|
||||
};
|
||||
|
||||
const isOnline = server.status === 'online';
|
||||
const statusLabel = server.status || 'pending';
|
||||
const cpuCores = systemInfo?.cpu_cores || server.cpu_cores;
|
||||
const cpuModel = systemInfo?.cpu_model || server.cpu_model;
|
||||
const totalMemory = systemInfo?.total_memory || server.total_memory;
|
||||
@@ -72,33 +96,35 @@ const ServerOverviewTab = ({ server, metrics, systemInfo, onRefreshServer }) =>
|
||||
</div>
|
||||
)}
|
||||
<KpiBand max={5}>
|
||||
<KpiTile
|
||||
<MetricCard
|
||||
icon={<PulseIcon />}
|
||||
tone={isOnline ? 'green' : server.status === 'connecting' ? 'amber' : 'red'}
|
||||
value={statusLabel.charAt(0).toUpperCase() + statusLabel.slice(1)}
|
||||
label={t('common.labels.status', 'Status')}
|
||||
value={server.status || 'pending'}
|
||||
tone={isOnline ? 'success' : server.status === 'connecting' ? 'warning' : 'danger'}
|
||||
/>
|
||||
<KpiTile
|
||||
<MetricCard
|
||||
icon={<ClockIcon />}
|
||||
label={t('common.labels.uptime', 'Uptime')}
|
||||
tone="accent"
|
||||
value={isOnline ? formatUptime(metrics?.uptime) : '—'}
|
||||
sub={isOnline && metrics?.uptime ? 'since last boot' : null}
|
||||
/>
|
||||
<KpiGauge
|
||||
label={t('common.labels.uptime', 'Uptime')}
|
||||
>
|
||||
{isOnline && metrics?.uptime ? <div className="sk-kpi__sub">{t('app.serverOverviewTab.sinceLastBoot', 'since last boot')}</div> : null}
|
||||
</MetricCard>
|
||||
<UsageTile
|
||||
icon={<CpuIcon />}
|
||||
label="CPU"
|
||||
percent={isOnline ? metrics?.cpu_percent : null}
|
||||
color="var(--accent-bright)"
|
||||
sub={cpuCores ? `${cpuCores} cores` : null}
|
||||
/>
|
||||
<KpiGauge
|
||||
<UsageTile
|
||||
icon={<MemoryIcon />}
|
||||
label={t('common.labels.memory', 'Memory')}
|
||||
percent={isOnline ? metrics?.memory_percent : null}
|
||||
color="var(--cyan)"
|
||||
sub={totalMemory ? formatBytes(totalMemory) : null}
|
||||
/>
|
||||
<KpiGauge
|
||||
<UsageTile
|
||||
icon={<DiskIcon />}
|
||||
label={t('common.labels.disk', 'Disk')}
|
||||
percent={isOnline ? metrics?.disk_percent : null}
|
||||
@@ -108,7 +134,7 @@ const ServerOverviewTab = ({ server, metrics, systemInfo, onRefreshServer }) =>
|
||||
</KpiBand>
|
||||
|
||||
{!isOnline && (
|
||||
<div className="info-card offline-card">
|
||||
<div className="overview-tab__card">
|
||||
<div className="offline-message">
|
||||
<OfflineIcon />
|
||||
<h4>{t('app.serverOverviewTab.serverOffline', 'Server offline')}</h4>
|
||||
@@ -121,9 +147,9 @@ const ServerOverviewTab = ({ server, metrics, systemInfo, onRefreshServer }) =>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="overview-grid">
|
||||
<div className="info-card">
|
||||
<h3><ServerIcon /> {t('app.serverOverviewTab.serverInformation', 'Server information')}</h3>
|
||||
<div className="overview-tab__grid">
|
||||
<div className="overview-tab__card">
|
||||
<h3 className="overview-tab__card-title"><ServerIcon /> {t('app.serverOverviewTab.serverInformation', 'Server information')}</h3>
|
||||
<InfoList className="server-info-list">
|
||||
<InfoItem label={<><PulseIcon /> {t('common.labels.status', 'Status')}</>}>
|
||||
<Pill kind={serverStatusKind(server.status)}>{server.status}</Pill>
|
||||
@@ -138,8 +164,8 @@ const ServerOverviewTab = ({ server, metrics, systemInfo, onRefreshServer }) =>
|
||||
</InfoList>
|
||||
</div>
|
||||
|
||||
<div className="info-card">
|
||||
<h3><ChipIcon /> {t('app.serverOverviewTab.systemInformation', 'System information')}</h3>
|
||||
<div className="overview-tab__card">
|
||||
<h3 className="overview-tab__card-title"><ChipIcon /> {t('app.serverOverviewTab.systemInformation', 'System information')}</h3>
|
||||
<InfoList className="server-info-list">
|
||||
<InfoItem label={<><OsIcon /> {t('app.serverOverviewTab.operatingSystem', 'Operating system')}</>} value={osLabel} />
|
||||
<InfoItem label={<><ArchIcon /> {t('app.serverOverviewTab.architecture', 'Architecture')}</>} value={systemInfo?.architecture || server.architecture || 'N/A'} />
|
||||
@@ -154,8 +180,8 @@ const ServerOverviewTab = ({ server, metrics, systemInfo, onRefreshServer }) =>
|
||||
</InfoList>
|
||||
</div>
|
||||
|
||||
<div className="info-card overview-grid__full">
|
||||
<h3><AgentIcon /> {t('app.serverOverviewTab.agentInformation', 'Agent information')}</h3>
|
||||
<div className="overview-tab__card overview-tab__card--full">
|
||||
<h3 className="overview-tab__card-title"><AgentIcon /> {t('app.serverOverviewTab.agentInformation', 'Agent information')}</h3>
|
||||
<InfoList className="server-info-list server-info-list--columns">
|
||||
<InfoItem label={<><TagIcon /> {t('app.serverOverviewTab.agentVersion', 'Agent version')}</>} value={server.agent_version || 'Not installed'} mono />
|
||||
<InfoItem label={<><HashIcon /> {t('app.serverOverviewTab.agentId', 'Agent ID')}</>} value={server.agent_id || 'N/A'} mono />
|
||||
@@ -166,9 +192,7 @@ const ServerOverviewTab = ({ server, metrics, systemInfo, onRefreshServer }) =>
|
||||
|
||||
<ServerHealthCard server={server} />
|
||||
|
||||
<div className="overview-grid__full">
|
||||
<SystemStatusCard server={server} onRefresh={onRefreshServer} />
|
||||
</div>
|
||||
<SystemStatusCard server={server} onRefresh={onRefreshServer} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { TOKEN_EXPIRY_OPTIONS } from './serverDetailData';
|
||||
import { useCallback, useState, useEffect, useId } from 'react';
|
||||
import { useNavigate, useParams } from 'react-router-dom';
|
||||
import { Server, Tags, KeyRound, Shield, RefreshCw, Trash2 } from 'lucide-react';
|
||||
import api from '../../services/api';
|
||||
import { useToast } from '../../contexts/useToast.js';
|
||||
import { useConfirm } from '../../hooks/useConfirm';
|
||||
@@ -8,6 +10,8 @@ import { InfoList, InfoItem } from '../InfoList';
|
||||
import InfoTip from '../InfoTip';
|
||||
import { DangerZone } from '../DangerZone';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Card } from '@/components/ui/card';
|
||||
import { DetailSettings, DetailSettingsSection } from '@/components/detail/DetailSettings';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import { Textarea } from '@/components/ui/textarea';
|
||||
import { Pill } from '../ds';
|
||||
@@ -22,48 +26,57 @@ import {
|
||||
} from '@/components/ui/select';
|
||||
import TagsPanel from '../shared/TagsPanel';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import {
|
||||
KeyIcon,
|
||||
ServerIcon,
|
||||
NetworkIcon,
|
||||
TrashIcon,
|
||||
TagIcon,
|
||||
} from './serverDetailShared';
|
||||
import { KeyIcon, TrashIcon } from './serverDetailShared';
|
||||
import { toastError } from '@/utils/errorMessage';
|
||||
import { formatDateTime } from '@/utils/intl';
|
||||
|
||||
// Radix Select items cannot carry an empty value; this stands for "no group".
|
||||
const NO_GROUP = '__none';
|
||||
|
||||
const AgentRegistrationSection = ({ server, onRegenerateToken }) => {
|
||||
const { t } = useTranslation();
|
||||
// The connection-string InfoTip depends on the server's state, so its copy is
|
||||
// assembled here rather than inline in the section title.
|
||||
const connectionStringHelp = (server, t) => {
|
||||
const expires = server.registration_expires;
|
||||
const isExpired = expires && new Date(expires) < new Date();
|
||||
const isOnline = server.status === 'online';
|
||||
|
||||
return (
|
||||
<div className="form-section form-section--accent">
|
||||
<div className="form-section__header">
|
||||
<span className="form-section__icon"><KeyIcon /></span>
|
||||
<div>
|
||||
<h3>{t('app.serverSettingsTab.connectionString', 'Connection string')}
|
||||
<InfoTip>
|
||||
{t('app.serverSettingsTab.generateAFreshConnectionStringTo', 'Generate a fresh connection string to pair (or re-pair) this server. Useful after reinstalling the agent: old credentials are gone, but a new string brings the agent right back to this row.')}
|
||||
{isOnline && ` ${t('app.serverSettingsTab.onlineRegenerateNote', 'This server is online now; a new string only affects re-pairing.')}`}
|
||||
{isExpired && ` ${t('app.serverSettingsTab.previousTokenExpired', 'The previous token has expired.')}`}
|
||||
</InfoTip></h3>
|
||||
<p className="section-description">{t('app.serverSettingsTab.pairOrRepair', 'Pair or re-pair this server.')}</p>
|
||||
</div>
|
||||
</div>
|
||||
<Button onClick={onRegenerateToken}>
|
||||
<KeyIcon /> {t('app.serverSettingsTab.generateConnectionString', 'Generate connection string')}
|
||||
</Button>
|
||||
</div>
|
||||
);
|
||||
return [
|
||||
t('app.serverSettingsTab.generateAFreshConnectionStringTo', 'Generate a fresh connection string to pair (or re-pair) this server. Useful after reinstalling the agent: old credentials are gone, but a new string brings the agent right back to this row.'),
|
||||
server.status === 'online' && t('app.serverSettingsTab.onlineRegenerateNote', 'This server is online now; a new string only affects re-pairing.'),
|
||||
isExpired && t('app.serverSettingsTab.previousTokenExpired', 'The previous token has expired.'),
|
||||
].filter(Boolean).join(' ');
|
||||
};
|
||||
|
||||
const ServerSettingsTab = ({ server, onUpdate, onRegenerateToken, onDelete }) => {
|
||||
const { t } = useTranslation();
|
||||
const navigate = useNavigate();
|
||||
// Section lives in the URL (/servers/:id/settings/:section), same as the
|
||||
// service detail page, so it is shareable and survives a refresh.
|
||||
const { section: sectionParam } = useParams();
|
||||
const settingsGroups = [
|
||||
{
|
||||
label: t('app.settingsTab.general', 'General'),
|
||||
items: [
|
||||
{ id: 'general', label: t('app.serverSettingsTab.basicInformation', 'Basic information'), icon: Server },
|
||||
{ id: 'tags', label: t('app.serverSettingsTab.tags', 'Tags'), icon: Tags },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: t('app.serverSettingsTab.connection', 'Connection'),
|
||||
items: [
|
||||
{ id: 'connection', label: t('app.serverSettingsTab.connectionString', 'Connection string'), icon: KeyRound },
|
||||
{ id: 'allowlist', label: t('app.serverSettingsTab.ipAllowlist', 'IP allowlist'), icon: Shield },
|
||||
{ id: 'credentials', label: t('app.serverSettingsTab.apiKeyRotation', 'API key rotation'), icon: RefreshCw },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: t('app.settingsTab.advanced', 'Advanced'),
|
||||
items: [
|
||||
{ id: 'danger', label: t('app.serverSettingsTab.removeServer', 'Remove server'), icon: Trash2 },
|
||||
],
|
||||
},
|
||||
];
|
||||
const settingsItems = settingsGroups.flatMap((group) => group.items);
|
||||
const section = settingsItems.some((item) => item.id === sectionParam) ? sectionParam : 'general';
|
||||
const setSection = (next) => navigate(`/servers/${server.id}/settings/${next}`, { replace: true });
|
||||
const fieldId = useId();
|
||||
const { confirm: confirmSettings } = useConfirm();
|
||||
const [formData, setFormData] = useState({
|
||||
@@ -172,218 +185,233 @@ const ServerSettingsTab = ({ server, onUpdate, onRegenerateToken, onDelete }) =>
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="settings-tab">
|
||||
<div className="settings-grid">
|
||||
<form onSubmit={handleSubmit} className="settings-form">
|
||||
<div className="form-section form-section--accent">
|
||||
<div className="form-section__header">
|
||||
<span className="form-section__icon"><ServerIcon /></span>
|
||||
<div>
|
||||
<h3>{t('app.serverSettingsTab.basicInformation', 'Basic information')}</h3>
|
||||
<p className="section-description">{t('app.serverSettingsTab.identityAndGroupingForThisServer', 'Identity and grouping for this server.')}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="form-group">
|
||||
<label htmlFor={`${fieldId}-name`}>{t('app.serverSettingsTab.serverName', 'Server name')}</label>
|
||||
<Input
|
||||
id={`${fieldId}-name`}
|
||||
type="text"
|
||||
name="name"
|
||||
value={formData.name}
|
||||
onChange={handleChange}
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="form-group">
|
||||
<label htmlFor={`${fieldId}-description`}>{t('common.labels.description', 'Description')}</label>
|
||||
<Textarea
|
||||
id={`${fieldId}-description`}
|
||||
name="description"
|
||||
value={formData.description}
|
||||
onChange={handleChange}
|
||||
rows={3}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="form-row">
|
||||
<DetailSettings
|
||||
groups={settingsGroups}
|
||||
value={section}
|
||||
onValueChange={setSection}
|
||||
ariaLabel={t('app.serverSettingsTab.settingsSections', 'Server settings sections')}
|
||||
>
|
||||
{section === 'general' && (
|
||||
<DetailSettingsSection title={t('app.serverSettingsTab.basicInformation', 'Basic information')}>
|
||||
<Card variant="legacy" className="card settings-section">
|
||||
<form onSubmit={handleSubmit} className="settings-form">
|
||||
<p className="hint">{t('app.serverSettingsTab.identityAndGroupingForThisServer', 'Identity and grouping for this server.')}</p>
|
||||
<div className="form-group">
|
||||
<label htmlFor={`${fieldId}-hostname`}>{t('app.serverSettingsTab.hostname', 'Hostname')}</label>
|
||||
<label htmlFor={`${fieldId}-name`}>{t('app.serverSettingsTab.serverName', 'Server name')}</label>
|
||||
<Input
|
||||
id={`${fieldId}-hostname`}
|
||||
id={`${fieldId}-name`}
|
||||
type="text"
|
||||
name="hostname"
|
||||
value={formData.hostname}
|
||||
name="name"
|
||||
value={formData.name}
|
||||
onChange={handleChange}
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="form-group">
|
||||
<label htmlFor={`${fieldId}-ip`}>{t('common.labels.ipAddress', 'IP address')}</label>
|
||||
<Input
|
||||
id={`${fieldId}-ip`}
|
||||
type="text"
|
||||
name="ip_address"
|
||||
value={formData.ip_address}
|
||||
<label htmlFor={`${fieldId}-description`}>{t('common.labels.description', 'Description')}</label>
|
||||
<Textarea
|
||||
id={`${fieldId}-description`}
|
||||
name="description"
|
||||
value={formData.description}
|
||||
onChange={handleChange}
|
||||
rows={3}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="form-group">
|
||||
<label htmlFor="server-settings-group">{t('app.serverSettingsTab.group', 'Group')}</label>
|
||||
<Select
|
||||
name="group_id"
|
||||
value={formData.group_id === '' || formData.group_id == null ? NO_GROUP : String(formData.group_id)}
|
||||
onValueChange={(value) => setFormData(prev => ({ ...prev, group_id: value === NO_GROUP ? '' : value }))}
|
||||
>
|
||||
<SelectTrigger id="server-settings-group"><SelectValue /></SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value={NO_GROUP}>{t('app.serverSettingsTab.noGroup', 'No group')}</SelectItem>
|
||||
{groups.map(group => (
|
||||
<SelectItem key={group.id} value={String(group.id)}>{group.name}</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
<div className="form-row">
|
||||
<div className="form-group">
|
||||
<label htmlFor={`${fieldId}-hostname`}>{t('app.serverSettingsTab.hostname', 'Hostname')}</label>
|
||||
<Input
|
||||
id={`${fieldId}-hostname`}
|
||||
type="text"
|
||||
name="hostname"
|
||||
value={formData.hostname}
|
||||
onChange={handleChange}
|
||||
/>
|
||||
</div>
|
||||
<div className="form-group">
|
||||
<label htmlFor={`${fieldId}-ip`}>{t('common.labels.ipAddress', 'IP address')}</label>
|
||||
<Input
|
||||
id={`${fieldId}-ip`}
|
||||
type="text"
|
||||
name="ip_address"
|
||||
value={formData.ip_address}
|
||||
onChange={handleChange}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Button type="submit" disabled={loading}>
|
||||
{loading ? t('common.saving', 'Saving…') : t('app.serverSettingsTab.saveChanges', 'Save changes')}
|
||||
</Button>
|
||||
</div>
|
||||
</form>
|
||||
<div className="form-group">
|
||||
<label htmlFor="server-settings-group">{t('app.serverSettingsTab.group', 'Group')}</label>
|
||||
<Select
|
||||
name="group_id"
|
||||
value={formData.group_id === '' || formData.group_id == null ? NO_GROUP : String(formData.group_id)}
|
||||
onValueChange={(value) => setFormData(prev => ({ ...prev, group_id: value === NO_GROUP ? '' : value }))}
|
||||
>
|
||||
<SelectTrigger id="server-settings-group"><SelectValue /></SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value={NO_GROUP}>{t('app.serverSettingsTab.noGroup', 'No group')}</SelectItem>
|
||||
{groups.map(group => (
|
||||
<SelectItem key={group.id} value={String(group.id)}>{group.name}</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
|
||||
<AgentRegistrationSection
|
||||
server={server}
|
||||
onRegenerateToken={onRegenerateToken}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="security-grid">
|
||||
<div className="form-section form-section--accent">
|
||||
<div className="form-section__header">
|
||||
<span className="form-section__icon"><NetworkIcon /></span>
|
||||
<div>
|
||||
<h3>{t('app.serverSettingsTab.connectionIpAllowlist', 'Connection and IP allowlist')}
|
||||
<InfoTip>{t('app.serverSettingsTab.restrictWhichIpsCanConnectSupports', 'Restrict which IPs can connect. Supports single IPs, CIDR notation, and wildcards.')}</InfoTip></h3>
|
||||
<p className="section-description">{t('app.serverSettingsTab.allowedIps', 'Allowed IPs only.')}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{connectionInfo && (
|
||||
<InfoList className="security-info-bar">
|
||||
<InfoItem
|
||||
label={t('app.serverSettingsTab.connectionIp', 'Connection IP')}
|
||||
value={connectionInfo.ip_address || 'Not connected'}
|
||||
mono
|
||||
/>
|
||||
{connectionInfo.connected_since && (
|
||||
<InfoItem
|
||||
label={t('app.serverSettingsTab.connectedSince', 'Connected since')}
|
||||
value={formatDateTime(connectionInfo.connected_since)}
|
||||
/>
|
||||
)}
|
||||
</InfoList>
|
||||
)}
|
||||
|
||||
<div className="subsection">
|
||||
<div className="ip-list">
|
||||
{allowedIPs.length === 0 ? (
|
||||
<div className="ip-empty">{t('app.serverSettingsTab.noIpRestrictionsAllIpsAllowed', 'No IP restrictions (all IPs allowed)')}</div>
|
||||
) : (
|
||||
allowedIPs.map((ip, idx) => (
|
||||
<div key={idx} className="ip-item">
|
||||
<code>{ip}</code>
|
||||
{connectionInfo?.ip_address === ip && (
|
||||
<Pill kind="green" dot={false}>{t('common.labels.current', 'Current')}</Pill>
|
||||
)}
|
||||
<Button variant="unstyled" type="button"
|
||||
className="btn-icon danger"
|
||||
onClick={() => handleRemoveIP(ip)}
|
||||
title={t('common.actions.remove', 'Remove')}
|
||||
>
|
||||
<TrashIcon />
|
||||
</Button>
|
||||
</div>
|
||||
))
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="ip-add-form">
|
||||
<Input
|
||||
type="text"
|
||||
placeholder={t('app.serverSettingsTab.ipAddressOrCidrEG', 'IP address or CIDR (e.g. 192.168.1.0/24)')}
|
||||
value={newIP}
|
||||
onChange={(e) => setNewIP(e.target.value)}
|
||||
onKeyPress={(e) => e.key === 'Enter' && (e.preventDefault(), handleAddIP())}
|
||||
/>
|
||||
<Button variant="outline" onClick={handleAddIP}>
|
||||
{t('common.actions.add', 'Add')}
|
||||
<Button type="submit" disabled={loading}>
|
||||
{loading ? t('common.saving', 'Saving…') : t('app.serverSettingsTab.saveChanges', 'Save changes')}
|
||||
</Button>
|
||||
</div>
|
||||
</form>
|
||||
</Card>
|
||||
</DetailSettingsSection>
|
||||
)}
|
||||
|
||||
{connectionInfo?.ip_address && allowedIPs.length > 0 && !allowedIPs.some(ip => {
|
||||
return ip === connectionInfo.ip_address || ip.includes('*') || ip.includes('/');
|
||||
}) && (
|
||||
<div className="security-warning">
|
||||
{t('app.serverSettingsTab.currentConnectionIp', 'Current connection IP (')}{connectionInfo.ip_address}{t('app.serverSettingsTab.mayBeBlockedByTheseRules', ') may be blocked by these rules.')}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="form-section form-section--accent">
|
||||
<div className="form-section__header">
|
||||
<span className="form-section__icon"><KeyIcon /></span>
|
||||
<div>
|
||||
<h3>{t('app.serverSettingsTab.apiKeyRotation', 'API key rotation')}
|
||||
<InfoTip>{t('app.serverSettingsTab.rotateTheApiCredentialsUsedBy', 'Rotate the API credentials used by the agent. The agent must be online to receive new credentials.')}</InfoTip></h3>
|
||||
<p className="section-description">{t('app.serverSettingsTab.rotateAgentCredentials', 'Rotate agent credentials.')}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="key-rotation-actions">
|
||||
<Button
|
||||
variant="outline"
|
||||
onClick={handleRotateKey}
|
||||
disabled={rotatingKey || server.status !== 'online'}
|
||||
>
|
||||
<KeyIcon /> {rotatingKey ? t('app.serverSettingsTab.rotating', 'Rotating…') : t('app.serverSettingsTab.rotateApiKey', 'Rotate API key')}
|
||||
</Button>
|
||||
{server.api_key_last_rotated && (
|
||||
<span className="key-rotation-hint">{t('app.serverSettingsTab.lastRotated', 'Last rotated:')} {formatDateTime(server.api_key_last_rotated)}</span>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{server.status !== 'online' && (
|
||||
<div className="security-notice">
|
||||
{t('app.serverSettingsTab.serverMustBeOnlineToRotate', 'Server must be online to rotate credentials.')}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="form-section form-section--accent shared-resources-section">
|
||||
<div className="form-section__header">
|
||||
<span className="form-section__icon"><TagIcon /></span>
|
||||
<div>
|
||||
<h3>{t('app.serverSettingsTab.tags', 'Tags')}</h3>
|
||||
<p className="section-description">
|
||||
{section === 'tags' && (
|
||||
<DetailSettingsSection title={t('app.serverSettingsTab.tags', 'Tags')}>
|
||||
<Card variant="legacy" className="card settings-section">
|
||||
<p className="hint">
|
||||
{t('app.serverSettingsTab.freeFormLabelsForGroupingAnd', 'Free-form labels for grouping and filtering this server across the panel.')}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<TagsPanel resourceType="server" resourceId={server.id} />
|
||||
</div>
|
||||
<TagsPanel resourceType="server" resourceId={server.id} />
|
||||
</Card>
|
||||
</DetailSettingsSection>
|
||||
)}
|
||||
|
||||
<DangerZone
|
||||
title={t('app.serverSettingsTab.dangerZone', 'Remove server')}
|
||||
description={t('app.serverSettingsTab.removingThisServerWillDisconnectThe', 'Removing this server will disconnect the agent and delete all associated data.')}
|
||||
action={
|
||||
<Button variant="destructive" onClick={onDelete}>
|
||||
<TrashIcon /> {t('app.serverSettingsTab.removeServer', 'Remove server')}
|
||||
</Button>
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
{section === 'connection' && (
|
||||
<DetailSettingsSection
|
||||
title={<>
|
||||
{t('app.serverSettingsTab.connectionString', 'Connection string')}
|
||||
<InfoTip>{connectionStringHelp(server, t)}</InfoTip>
|
||||
</>}
|
||||
>
|
||||
<Card variant="legacy" className="card settings-section">
|
||||
<p className="hint">{t('app.serverSettingsTab.pairOrRepair', 'Pair or re-pair this server.')}</p>
|
||||
<Button onClick={onRegenerateToken}>
|
||||
<KeyIcon /> {t('app.serverSettingsTab.generateConnectionString', 'Generate connection string')}
|
||||
</Button>
|
||||
</Card>
|
||||
</DetailSettingsSection>
|
||||
)}
|
||||
|
||||
{section === 'allowlist' && (
|
||||
<DetailSettingsSection
|
||||
title={<>
|
||||
{t('app.serverSettingsTab.connectionIpAllowlist', 'Connection and IP allowlist')}
|
||||
<InfoTip>{t('app.serverSettingsTab.restrictWhichIpsCanConnectSupports', 'Restrict which IPs can connect. Supports single IPs, CIDR notation, and wildcards.')}</InfoTip>
|
||||
</>}
|
||||
>
|
||||
<Card variant="legacy" className="card settings-section">
|
||||
<p className="hint">{t('app.serverSettingsTab.allowedIps', 'Allowed IPs only.')}</p>
|
||||
|
||||
{connectionInfo && (
|
||||
<InfoList className="security-info-bar">
|
||||
<InfoItem
|
||||
label={t('app.serverSettingsTab.connectionIp', 'Connection IP')}
|
||||
value={connectionInfo.ip_address || 'Not connected'}
|
||||
mono
|
||||
/>
|
||||
{connectionInfo.connected_since && (
|
||||
<InfoItem
|
||||
label={t('app.serverSettingsTab.connectedSince', 'Connected since')}
|
||||
value={formatDateTime(connectionInfo.connected_since)}
|
||||
/>
|
||||
)}
|
||||
</InfoList>
|
||||
)}
|
||||
|
||||
<div className="subsection">
|
||||
<div className="ip-list">
|
||||
{allowedIPs.length === 0 ? (
|
||||
<div className="ip-empty">{t('app.serverSettingsTab.noIpRestrictionsAllIpsAllowed', 'No IP restrictions (all IPs allowed)')}</div>
|
||||
) : (
|
||||
allowedIPs.map((ip, idx) => (
|
||||
<div key={idx} className="ip-item">
|
||||
<code>{ip}</code>
|
||||
{connectionInfo?.ip_address === ip && (
|
||||
<Pill kind="green" dot={false}>{t('common.labels.current', 'Current')}</Pill>
|
||||
)}
|
||||
<Button variant="unstyled" type="button"
|
||||
className="btn-icon danger"
|
||||
onClick={() => handleRemoveIP(ip)}
|
||||
title={t('common.actions.remove', 'Remove')}
|
||||
>
|
||||
<TrashIcon />
|
||||
</Button>
|
||||
</div>
|
||||
))
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="ip-add-form">
|
||||
<Input
|
||||
type="text"
|
||||
placeholder={t('app.serverSettingsTab.ipAddressOrCidrEG', 'IP address or CIDR (e.g. 192.168.1.0/24)')}
|
||||
value={newIP}
|
||||
onChange={(e) => setNewIP(e.target.value)}
|
||||
onKeyPress={(e) => e.key === 'Enter' && (e.preventDefault(), handleAddIP())}
|
||||
/>
|
||||
<Button variant="outline" onClick={handleAddIP}>
|
||||
{t('common.actions.add', 'Add')}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
{connectionInfo?.ip_address && allowedIPs.length > 0 && !allowedIPs.some(ip => {
|
||||
return ip === connectionInfo.ip_address || ip.includes('*') || ip.includes('/');
|
||||
}) && (
|
||||
<div className="security-warning">
|
||||
{t('app.serverSettingsTab.currentConnectionIp', 'Current connection IP (')}{connectionInfo.ip_address}{t('app.serverSettingsTab.mayBeBlockedByTheseRules', ') may be blocked by these rules.')}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</Card>
|
||||
</DetailSettingsSection>
|
||||
)}
|
||||
|
||||
{section === 'credentials' && (
|
||||
<DetailSettingsSection
|
||||
title={<>
|
||||
{t('app.serverSettingsTab.apiKeyRotation', 'API key rotation')}
|
||||
<InfoTip>{t('app.serverSettingsTab.rotateTheApiCredentialsUsedBy', 'Rotate the API credentials used by the agent. The agent must be online to receive new credentials.')}</InfoTip>
|
||||
</>}
|
||||
>
|
||||
<Card variant="legacy" className="card settings-section">
|
||||
<p className="hint">{t('app.serverSettingsTab.rotateAgentCredentials', 'Rotate agent credentials.')}</p>
|
||||
<div className="key-rotation-actions">
|
||||
<Button
|
||||
variant="outline"
|
||||
onClick={handleRotateKey}
|
||||
disabled={rotatingKey || server.status !== 'online'}
|
||||
>
|
||||
<KeyIcon /> {rotatingKey ? t('app.serverSettingsTab.rotating', 'Rotating…') : t('app.serverSettingsTab.rotateApiKey', 'Rotate API key')}
|
||||
</Button>
|
||||
{server.api_key_last_rotated && (
|
||||
<span className="key-rotation-hint">{t('app.serverSettingsTab.lastRotated', 'Last rotated:')} {formatDateTime(server.api_key_last_rotated)}</span>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{server.status !== 'online' && (
|
||||
<div className="security-notice">
|
||||
{t('app.serverSettingsTab.serverMustBeOnlineToRotate', 'Server must be online to rotate credentials.')}
|
||||
</div>
|
||||
)}
|
||||
</Card>
|
||||
</DetailSettingsSection>
|
||||
)}
|
||||
|
||||
{section === 'danger' && (
|
||||
<DetailSettingsSection title={t('app.serverSettingsTab.dangerZone', 'Remove server')}>
|
||||
<DangerZone
|
||||
description={t('app.serverSettingsTab.removingThisServerWillDisconnectThe', 'Removing this server will disconnect the agent and delete all associated data.')}
|
||||
action={
|
||||
<Button variant="destructive" onClick={onDelete}>
|
||||
<TrashIcon /> {t('app.serverSettingsTab.removeServer', 'Remove server')}
|
||||
</Button>
|
||||
}
|
||||
/>
|
||||
</DetailSettingsSection>
|
||||
)}
|
||||
</DetailSettings>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ export default function SystemStatusCard({ server, onRefresh }) {
|
||||
const runtimeKeys = Object.keys(runtimes).filter((k) => runtimes[k]).sort();
|
||||
|
||||
return (
|
||||
<div className="info-card system-status-card">
|
||||
<div className="overview-tab__card overview-tab__card--full system-status-card">
|
||||
<div className="system-status-card__header">
|
||||
<div className="system-status-card__title">
|
||||
<h3>{t('app.systemStatusCard.systemStatus', 'System status')}</h3>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Gauge } from '../ds';
|
||||
import { useClipboard } from '@/hooks/useClipboard';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { formatDateTime } from '@/utils/intl';
|
||||
@@ -47,37 +46,6 @@ export const SecurityAlertItem = ({ alert, onAcknowledge, onResolve }) => {
|
||||
};
|
||||
|
||||
|
||||
export const KpiTile = ({ icon, label, value, sub, tone }) => (
|
||||
<div className={`kpi-tile${tone ? ` kpi-tile--${tone}` : ''}`}>
|
||||
<div className="kpi-tile__head">
|
||||
<span className="kpi-tile__icon">{icon}</span>
|
||||
<span className="kpi-tile__label">{label}</span>
|
||||
</div>
|
||||
<div className="kpi-tile__value">{value}</div>
|
||||
{sub && <div className="kpi-tile__sub">{sub}</div>}
|
||||
</div>
|
||||
);
|
||||
|
||||
export const KpiGauge = ({ icon, label, percent, color, sub }) => {
|
||||
const has = percent !== null && percent !== undefined && Number.isFinite(percent);
|
||||
const safe = has ? Math.min(Math.max(percent, 0), 100) : 0;
|
||||
const danger = safe > 85;
|
||||
const warn = safe > 70 && !danger;
|
||||
const fillColor = danger ? 'var(--red)' : warn ? 'var(--amber)' : color;
|
||||
|
||||
return (
|
||||
<div className={`kpi-tile kpi-tile--gauge${danger ? ' kpi-tile--danger' : warn ? ' kpi-tile--warn' : ''}`}>
|
||||
<div className="kpi-tile__head">
|
||||
<span className="kpi-tile__icon">{icon}</span>
|
||||
<span className="kpi-tile__label">{label}</span>
|
||||
</div>
|
||||
<div className="kpi-tile__value">{has ? `${safe.toFixed(1)}%` : '—'}</div>
|
||||
<Gauge className="kpi-tile__meter" value={safe} color={fillColor} />
|
||||
{sub && <div className="kpi-tile__sub">{sub}</div>}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export const CopyChip = ({ label, value, title, mono }) => {
|
||||
const { t } = useTranslation();
|
||||
const { copy } = useClipboard();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { useEffect, useState, useId } from 'react';
|
||||
import { useNavigate, useParams, Link } from 'react-router-dom';
|
||||
import { DetailSettings } from '@/components/detail/DetailSettings';
|
||||
import {
|
||||
SlidersHorizontal,
|
||||
GitBranch,
|
||||
@@ -231,31 +232,16 @@ const SettingsTab = ({ app, deployConfig, domains, primaryDomain, onUpdate }) =>
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="svc-settings">
|
||||
<nav className="svc-settings__nav" aria-label={t('app.settingsTab.serviceSettingsSections', 'Service settings sections')}>
|
||||
{settingsGroups.map(g => (
|
||||
<div className="svc-settings__group" key={g.label}>
|
||||
<div className="svc-settings__grouplabel">{g.label}</div>
|
||||
{g.items.map(s => (
|
||||
<Button variant="unstyled"
|
||||
type="button"
|
||||
key={s.id}
|
||||
className={`svc-settings__navitem ${section === s.id ? 'is-active' : ''}`}
|
||||
onClick={() => setSection(s.id)}
|
||||
>
|
||||
<s.icon size={15} />
|
||||
{s.label}
|
||||
</Button>
|
||||
))}
|
||||
</div>
|
||||
))}
|
||||
</nav>
|
||||
|
||||
<div className="svc-settings__content">
|
||||
<DetailSettings
|
||||
groups={settingsGroups}
|
||||
value={section}
|
||||
onValueChange={setSection}
|
||||
ariaLabel={t('app.settingsTab.serviceSettingsSections', 'Service settings sections')}
|
||||
>
|
||||
{/* Environment Configuration */}
|
||||
{section === 'environment' && (
|
||||
<div className="svc-settings__section">
|
||||
<h3 className="svc-settings__section-title">{t('app.settingsTab.environmentType', 'Environment type')}</h3>
|
||||
<div className="sk-detail-settings__section">
|
||||
<h3 className="sk-detail-settings__section-title">{t('app.settingsTab.environmentType', 'Environment type')}</h3>
|
||||
<SharedCard variant="legacy" className="card settings-section">
|
||||
<div className="settings-row">
|
||||
<div className="settings-label">
|
||||
@@ -317,8 +303,8 @@ const SettingsTab = ({ app, deployConfig, domains, primaryDomain, onUpdate }) =>
|
||||
|
||||
{/* Domain & SSL — same information architecture as WordPress Settings → SSL. */}
|
||||
{section === 'domain' && (
|
||||
<div className="svc-settings__section">
|
||||
<h3 className="svc-settings__section-title">{t('app.settingsTab.domainSsl', 'Domain and SSL')}</h3>
|
||||
<div className="sk-detail-settings__section">
|
||||
<h3 className="sk-detail-settings__section-title">{t('app.settingsTab.domainSsl', 'Domain and SSL')}</h3>
|
||||
<DomainSslPanel
|
||||
app={app}
|
||||
domains={domains}
|
||||
@@ -331,8 +317,8 @@ const SettingsTab = ({ app, deployConfig, domains, primaryDomain, onUpdate }) =>
|
||||
{/* Container Ops (Docker only) — image updates, restart policy,
|
||||
resource limits, auto-sleep. Relocated from the old top tab. */}
|
||||
{section === 'ops' && (
|
||||
<div className="svc-settings__section">
|
||||
<h3 className="svc-settings__section-title">{t('app.settingsTab.containerOps', 'Container ops')}</h3>
|
||||
<div className="sk-detail-settings__section">
|
||||
<h3 className="sk-detail-settings__section-title">{t('app.settingsTab.containerOps', 'Container ops')}</h3>
|
||||
<ContainerOpsPanel app={app} onChanged={onUpdate} />
|
||||
</div>
|
||||
)}
|
||||
@@ -340,8 +326,8 @@ const SettingsTab = ({ app, deployConfig, domains, primaryDomain, onUpdate }) =>
|
||||
{/* Resource Limits (Docker only) — first-class CPU/memory caps
|
||||
with live usage, instead of compose-file-only limits. */}
|
||||
{section === 'resources' && (
|
||||
<div className="svc-settings__section">
|
||||
<h3 className="svc-settings__section-title">{t('app.settingsTab.resourceLimits', 'Resource limits')}</h3>
|
||||
<div className="sk-detail-settings__section">
|
||||
<h3 className="sk-detail-settings__section-title">{t('app.settingsTab.resourceLimits', 'Resource limits')}</h3>
|
||||
<ResourceLimitsPanel app={app} onChanged={onUpdate} />
|
||||
</div>
|
||||
)}
|
||||
@@ -350,8 +336,8 @@ const SettingsTab = ({ app, deployConfig, domains, primaryDomain, onUpdate }) =>
|
||||
short-TTL page cache with auth/admin/cart bypasses, stale
|
||||
serving, and a per-site purge. */}
|
||||
{section === 'cache' && (
|
||||
<div className="svc-settings__section">
|
||||
<h3 className="svc-settings__section-title">{t('app.settingsTab.cache', 'Cache')}</h3>
|
||||
<div className="sk-detail-settings__section">
|
||||
<h3 className="sk-detail-settings__section-title">{t('app.settingsTab.cache', 'Cache')}</h3>
|
||||
<MicroCachePanel app={app} onChanged={onUpdate} />
|
||||
</div>
|
||||
)}
|
||||
@@ -359,8 +345,8 @@ const SettingsTab = ({ app, deployConfig, domains, primaryDomain, onUpdate }) =>
|
||||
{/* Health & Rollout (Docker only) — the deploy health gate:
|
||||
where a new release is asked, and for how long. */}
|
||||
{section === 'health' && (
|
||||
<div className="svc-settings__section">
|
||||
<h3 className="svc-settings__section-title">{t('app.settingsTab.healthRollout', 'Health and rollout')}</h3>
|
||||
<div className="sk-detail-settings__section">
|
||||
<h3 className="sk-detail-settings__section-title">{t('app.settingsTab.healthRollout', 'Health and rollout')}</h3>
|
||||
<DeploySafetyPanel app={app} onChanged={onUpdate} />
|
||||
<SlotDeploysPanel app={app} onChanged={onUpdate} />
|
||||
</div>
|
||||
@@ -369,8 +355,8 @@ where a new release is asked, and for how long. */}
|
||||
{/* Storage (Docker only) — first-class managed volumes that
|
||||
survive redeploys, replacing fragile relative bind mounts. */}
|
||||
{section === 'storage' && (
|
||||
<div className="svc-settings__section">
|
||||
<h3 className="svc-settings__section-title">{t('common.labels.storage', 'Storage')}</h3>
|
||||
<div className="sk-detail-settings__section">
|
||||
<h3 className="sk-detail-settings__section-title">{t('common.labels.storage', 'Storage')}</h3>
|
||||
<VolumesPanel app={app} onChanged={onUpdate} />
|
||||
</div>
|
||||
)}
|
||||
@@ -382,8 +368,8 @@ where a new release is asked, and for how long. */}
|
||||
config checkpoints) as a separated subsection — no second repo
|
||||
form, and nothing deploy-related shows before connecting. */}
|
||||
{section === 'git' && (
|
||||
<div className="svc-settings__section">
|
||||
<h3 className="svc-settings__section-title">{t('app.settingsTab.gitDeploy', 'Git and deploy')}</h3>
|
||||
<div className="sk-detail-settings__section">
|
||||
<h3 className="sk-detail-settings__section-title">{t('app.settingsTab.gitDeploy', 'Git and deploy')}</h3>
|
||||
<RepoConnectForm
|
||||
gitStatus={gitStatus}
|
||||
onConnect={handleConnectRepo}
|
||||
@@ -396,8 +382,8 @@ where a new release is asked, and for how long. */}
|
||||
idPrefix="svc"
|
||||
/>
|
||||
{deployConfig && (
|
||||
<div className="svc-settings__subsection">
|
||||
<h4 className="svc-settings__subsection-title">{t('app.settingsTab.deployment', 'Deployment')}</h4>
|
||||
<div className="sk-detail-settings__subsection">
|
||||
<h4 className="sk-detail-settings__subsection-title">{t('app.settingsTab.deployment', 'Deployment')}</h4>
|
||||
<DeployTab embedded appId={app.id} appPath={app.path} />
|
||||
</div>
|
||||
)}
|
||||
@@ -407,8 +393,8 @@ where a new release is asked, and for how long. */}
|
||||
{/* Build — build method, Dockerfile / build pack, cache, timeouts,
|
||||
build logs. Relocated from the old top tab, beside Git & Deploy. */}
|
||||
{section === 'build' && (
|
||||
<div className="svc-settings__section">
|
||||
<h3 className="svc-settings__section-title">{t('app.settingsTab.build', 'Build')}</h3>
|
||||
<div className="sk-detail-settings__section">
|
||||
<h3 className="sk-detail-settings__section-title">{t('app.settingsTab.build', 'Build')}</h3>
|
||||
<BuildTab appId={app.id} appPath={app.path} app={app} />
|
||||
</div>
|
||||
)}
|
||||
@@ -417,16 +403,16 @@ where a new release is asked, and for how long. */}
|
||||
when the app's project is manifest-managed, plus scaffold /
|
||||
plan / apply actions. */}
|
||||
{section === 'manifest' && (
|
||||
<div className="svc-settings__section">
|
||||
<h3 className="svc-settings__section-title">{t('app.settingsTab.manifest', 'Manifest')}</h3>
|
||||
<div className="sk-detail-settings__section">
|
||||
<h3 className="sk-detail-settings__section-title">{t('app.settingsTab.manifest', 'Manifest')}</h3>
|
||||
<ManifestSection app={app} />
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* WAF (Docker + Python) — per-app ModSecurity policy + matches. */}
|
||||
{section === 'waf' && (
|
||||
<div className="svc-settings__section">
|
||||
<h3 className="svc-settings__section-title">WAF</h3>
|
||||
<div className="sk-detail-settings__section">
|
||||
<h3 className="sk-detail-settings__section-title">WAF</h3>
|
||||
<AppWafPanel app={app} onChanged={onUpdate} />
|
||||
</div>
|
||||
)}
|
||||
@@ -435,8 +421,8 @@ where a new release is asked, and for how long. */}
|
||||
cost, one-click restore), same component the WordPress
|
||||
detail page renders. */}
|
||||
{section === 'backups' && (
|
||||
<div className="svc-settings__section">
|
||||
<h3 className="svc-settings__section-title">{t('common.labels.backups', 'Backups')}</h3>
|
||||
<div className="sk-detail-settings__section">
|
||||
<h3 className="sk-detail-settings__section-title">{t('common.labels.backups', 'Backups')}</h3>
|
||||
<ProtectionPanel
|
||||
targetType="application"
|
||||
targetId={app.id}
|
||||
@@ -447,8 +433,8 @@ where a new release is asked, and for how long. */}
|
||||
|
||||
{/* Danger Zone */}
|
||||
{section === 'danger' && (
|
||||
<div className="svc-settings__section">
|
||||
<h3 className="svc-settings__section-title">{t('app.settingsTab.dangerZone', 'Delete service')}</h3>
|
||||
<div className="sk-detail-settings__section">
|
||||
<h3 className="sk-detail-settings__section-title">{t('app.settingsTab.dangerZone', 'Delete service')}</h3>
|
||||
<DangerZone
|
||||
description={t('app.settingsTab.onceYouDeleteAServiceThere', "Deleting a service removes all its data. You can't undo this.")}
|
||||
action={
|
||||
@@ -459,8 +445,7 @@ where a new release is asked, and for how long. */}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</DetailSettings>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -5653,6 +5653,7 @@
|
||||
"operatingSystem": "Operating system",
|
||||
"serverInformation": "Server information",
|
||||
"serverOffline": "Server offline",
|
||||
"sinceLastBoot": "since last boot",
|
||||
"systemInformation": "System information",
|
||||
"totalDisk": "Total disk",
|
||||
"totalMemory": "Total memory",
|
||||
@@ -5730,6 +5731,7 @@
|
||||
"apiKeyRotation": "API key rotation",
|
||||
"basicInformation": "Basic information",
|
||||
"connectedSince": "Connected since",
|
||||
"connection": "Connection",
|
||||
"connectionIp": "Connection IP",
|
||||
"connectionIpAllowlist": "Connection and IP allowlist",
|
||||
"connectionString": "Connection string",
|
||||
@@ -5755,6 +5757,7 @@
|
||||
"identityAndGroupingForThisServer": "Identity and grouping for this server.",
|
||||
"invalidIpPattern": "Enter an IP address or CIDR range, like 192.168.1.0/24.",
|
||||
"ipAddressOrCidrEG": "IP address or CIDR (e.g. 192.168.1.0/24)",
|
||||
"ipAllowlist": "IP allowlist",
|
||||
"ipAllowlistUpdated": "IP allowlist updated",
|
||||
"ipRemovedFromAllowlist": "IP removed from allowlist",
|
||||
"lastRotated": "Last rotated:",
|
||||
@@ -5780,6 +5783,7 @@
|
||||
"serverMustBeOnlineToRotate": "Server must be online to rotate credentials.",
|
||||
"serverName": "Server name",
|
||||
"serverUpdatedSuccessfully": "Server updated",
|
||||
"settingsSections": "Server settings sections",
|
||||
"tags": "Tags",
|
||||
"tokenExpires": "Token expires",
|
||||
"windowsPowershell": "Windows (PowerShell)"
|
||||
@@ -5960,6 +5964,7 @@
|
||||
"deployLatestCommit": "Deploy latest commit",
|
||||
"deploying": "Deploying…",
|
||||
"deploymentStarted": "Deployment started",
|
||||
"details": "Service details",
|
||||
"dockerCompose": "Docker Compose",
|
||||
"failedToDeleteService": "Couldn't delete the service.",
|
||||
"failedToDeployLatestCommit": "Couldn't deploy the latest commit.",
|
||||
|
||||
@@ -273,7 +273,8 @@ const ServerDetail = () => {
|
||||
|
||||
return (
|
||||
<PageLayout
|
||||
className="server-detail-page"
|
||||
className="sk-detail-page server-detail-page"
|
||||
contentClassName="sk-detail-body"
|
||||
icon={<Server size={18} />}
|
||||
title={isPlaceholderServerName(server.name) ? t('app.serverDetail.pendingPairing', 'Pending pairing') : server.name}
|
||||
navLabel={t('app.serverDetail.sections', 'Server sections')}
|
||||
|
||||
@@ -23,11 +23,12 @@ import OverviewTab from '../components/service-detail/OverviewTab';
|
||||
import PreviewList from '../components/previews/PreviewList';
|
||||
import EmptyState from '../components/EmptyState';
|
||||
import PluginSlot from '../components/PluginSlot';
|
||||
import { Layers, FileArchive, RotateCcw, LayoutDashboard, History, ScrollText, Variable, Terminal, Activity, Package, Server, SquareTerminal, Settings, Eye, ExternalLink } from 'lucide-react';
|
||||
import { Layers, FileArchive, RotateCcw, ExternalLink } from 'lucide-react';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Pill, statusKind } from '@/components/ds';
|
||||
import { statusKind } from '@/components/ds';
|
||||
import PageLayout from '../layouts/PageLayout';
|
||||
import FavoriteStar from '@/components/FavoriteStar';
|
||||
import DetailHeaderMeta from '@/components/detail/DetailHeaderMeta';
|
||||
import { useRecordVisit } from '@/hooks/useRecordVisit';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { toastError } from '@/utils/errorMessage';
|
||||
@@ -59,21 +60,6 @@ const RETIRED_TAB_REDIRECTS = {
|
||||
deploy: 'settings/git',
|
||||
};
|
||||
|
||||
// Per-tab glyph for the detail tab strip (matches the WordPress detail page).
|
||||
const TAB_ICONS = {
|
||||
overview: LayoutDashboard,
|
||||
events: History,
|
||||
logs: ScrollText,
|
||||
environment: Variable,
|
||||
shell: Terminal,
|
||||
metrics: Activity,
|
||||
packages: Package,
|
||||
gunicorn: Server,
|
||||
commands: SquareTerminal,
|
||||
previews: Eye,
|
||||
settings: Settings,
|
||||
};
|
||||
|
||||
const ServiceDetail = () => {
|
||||
const { t } = useTranslation();
|
||||
const { id, tab: rawTab } = useParams();
|
||||
@@ -281,15 +267,30 @@ const ServiceDetail = () => {
|
||||
|
||||
return (
|
||||
<PageLayout
|
||||
fill
|
||||
className="svc-detail"
|
||||
className="sk-detail-page svc-detail"
|
||||
contentClassName="sk-detail-body"
|
||||
topbarClassName="svc-detail-topbar"
|
||||
icon={<Layers size={18} />}
|
||||
title={service.name}
|
||||
navLabel={t('app.serviceDetail.sections', 'Service sections')}
|
||||
meta={(
|
||||
<>
|
||||
<FavoriteStar type="service" id={service.id} path={`/services/${service.id}`} label={service.name} />
|
||||
<DetailHeaderMeta
|
||||
status={{ kind: statusKind(service.statusInfo.dotClass), label: service.statusInfo.label }}
|
||||
infoTitle={t('app.serviceDetail.details', 'Service details')}
|
||||
rows={[
|
||||
{ label: t('common.labels.status', 'Status'), value: service.statusInfo.label },
|
||||
{ label: t('common.labels.type', 'Type'), value: service.typeInfo.label },
|
||||
{ label: t('common.labels.port', 'Port'), value: service.port },
|
||||
{ label: t('common.labels.created', 'Created'), value: formatDate(service.created_at) },
|
||||
{
|
||||
label: t('common.labels.domain', 'Domain'),
|
||||
value: primaryDomain && (
|
||||
<a href={`https://${primaryDomain}`} target="_blank" rel="noopener noreferrer">{primaryDomain}</a>
|
||||
),
|
||||
},
|
||||
]}
|
||||
favorite={<FavoriteStar type="service" id={service.id} path={`/services/${service.id}`} label={service.name} />}
|
||||
>
|
||||
{openUrl && (
|
||||
<a
|
||||
href={openUrl}
|
||||
@@ -302,30 +303,14 @@ const ServiceDetail = () => {
|
||||
<ExternalLink size={15} />
|
||||
</a>
|
||||
)}
|
||||
<Pill kind={statusKind(service.statusInfo.dotClass)}>{service.statusInfo.label}</Pill>
|
||||
<span
|
||||
className="svc-detail__type-badge"
|
||||
style={{ backgroundColor: service.typeInfo.bgColor, color: service.typeInfo.color, borderColor: service.typeInfo.borderColor }}
|
||||
>
|
||||
{service.typeInfo.label}
|
||||
</span>
|
||||
{service.port && <span>{t('common.labels.port', 'Port')} {service.port}</span>}
|
||||
<span>{t('common.labels.created', 'Created')} {formatDate(service.created_at)}</span>
|
||||
{primaryDomain && (
|
||||
<a href={`https://${primaryDomain}`} target="_blank" rel="noopener noreferrer">{primaryDomain}</a>
|
||||
)}
|
||||
</>
|
||||
</DetailHeaderMeta>
|
||||
)}
|
||||
tabs={availableTabs.map(tab => {
|
||||
const Icon = TAB_ICONS[tab];
|
||||
return {
|
||||
id: tab,
|
||||
label: TAB_LABELS[tab] || tab,
|
||||
icon: Icon ? <Icon size={15} /> : null,
|
||||
active: activeTab === tab,
|
||||
onSelect: () => setActiveTab(tab),
|
||||
};
|
||||
})}
|
||||
tabs={availableTabs.map(tab => ({
|
||||
id: tab,
|
||||
label: TAB_LABELS[tab] || tab,
|
||||
active: activeTab === tab,
|
||||
onSelect: () => setActiveTab(tab),
|
||||
}))}
|
||||
actions={(
|
||||
<>
|
||||
{/* Deploy dropdown */}
|
||||
@@ -438,9 +423,6 @@ const ServiceDetail = () => {
|
||||
)}
|
||||
>
|
||||
|
||||
{/* Everything below the full-bleed top bar lives in a centered, padded
|
||||
column (.app-detail-body), matching the WordPress detail page. */}
|
||||
<div className="app-detail-body">
|
||||
{/* Repo Connection Pill */}
|
||||
<div className="svc-detail__repo-bar">
|
||||
{isUpload ? (
|
||||
@@ -562,7 +544,6 @@ const ServiceDetail = () => {
|
||||
|
||||
{/* Extension slot: widgets contributed to the service detail page */}
|
||||
<PluginSlot name="service.detail.tab" context={{ serviceId: service.id }} />
|
||||
</div>
|
||||
</PageLayout>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
} from '../routeManifest.js';
|
||||
|
||||
test('core route paths and ids are unique', () => {
|
||||
assert.equal(CORE_ROUTES.length, 99, 'route changes must update the parity baseline intentionally');
|
||||
assert.equal(CORE_ROUTES.length, 100, 'route changes must update the parity baseline intentionally');
|
||||
assert.equal(new Set(CORE_ROUTES.map(({ id }) => id)).size, CORE_ROUTES.length);
|
||||
assert.equal(new Set(CORE_ROUTES.map(({ path }) => path)).size, CORE_ROUTES.length);
|
||||
});
|
||||
|
||||
@@ -62,6 +62,7 @@ export const CORE_ROUTES = Object.freeze([
|
||||
{ id: 'server-templates', path: '/server-templates', placement: 'dashboard', group: 'servers', component: 'ServerTemplates', titleKey: 'app.routeManifest.serverTemplates', title: 'Server templates' },
|
||||
{ id: 'server-detail', path: '/servers/:id', placement: 'dashboard', component: 'ServerDetail', titleKey: 'common.labels.servers', title: 'Servers' },
|
||||
{ id: 'server-detail-tab', path: '/servers/:id/:tab', placement: 'dashboard', component: 'ServerDetail', titleKey: 'common.labels.servers', title: 'Servers' },
|
||||
{ id: 'server-detail-section', path: '/servers/:id/:tab/:section', placement: 'dashboard', component: 'ServerDetail', titleKey: 'common.labels.servers', title: 'Servers' },
|
||||
{ id: 'legacy-agent-plugins', path: '/agent-plugins', placement: 'dashboard', redirect: '/extensions', titleKey: 'common.labels.extensions', title: 'Extensions' },
|
||||
|
||||
{ id: 'projects', path: '/projects', placement: 'dashboard', group: 'organization', component: 'Projects', titleKey: 'app.routeManifest.projects', title: 'Projects' },
|
||||
|
||||
@@ -213,6 +213,8 @@ $sk-tones: ('accent', 'green', 'cyan', 'amber', 'red', 'violet');
|
||||
gap: $space-3;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
// Optional thin meter under the label (usage tiles: CPU / memory / disk).
|
||||
&__meter { margin-top: $space-2; }
|
||||
&__trend {
|
||||
grid-area: trend;
|
||||
align-self: start;
|
||||
|
||||
@@ -0,0 +1,179 @@
|
||||
// ============================================
|
||||
// ENTITY DETAIL PAGE
|
||||
// What the service and server detail pages share, so the two read as one
|
||||
// layout: the top-bar meta, the body rhythm and the settings shell. Feature
|
||||
// stylesheets (_service-detail, _servers) own only what is inside the tabs.
|
||||
// components/detail/DetailHeaderMeta.jsx [dot] [(i)] [star]
|
||||
// components/detail/DetailSettings.jsx grouped nav + content column
|
||||
// ============================================
|
||||
|
||||
// Header: dot / (i) / star share one centered row beside the title.
|
||||
.sk-detail-page .sk-topbar {
|
||||
&__titles { align-items: center; }
|
||||
&__meta { display: inline-flex; align-items: center; gap: $space-2; }
|
||||
|
||||
.fav-star {
|
||||
width: 24px; // geometry: matches the InfoTip md footprint
|
||||
height: 24px; // geometry: matches the InfoTip md footprint
|
||||
svg { width: 14px; height: 14px; } // geometry: inline icon
|
||||
opacity: 0.6;
|
||||
&:hover, &.is-on { opacity: 1; }
|
||||
}
|
||||
}
|
||||
|
||||
// Facts behind the header (i): label / value pairs.
|
||||
.sk-detail-info {
|
||||
display: grid;
|
||||
grid-template-columns: auto 1fr;
|
||||
gap: $space-1 $space-3;
|
||||
margin: 0;
|
||||
|
||||
&__row { display: contents; }
|
||||
|
||||
dt { color: var(--text-faint); }
|
||||
dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
|
||||
|
||||
&__id { display: flex; align-items: center; gap: $space-1; code { font-family: $font-mono; } }
|
||||
}
|
||||
|
||||
// Body below the top bar: one column, one gap between its blocks.
|
||||
.sk-detail-body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: $space-5;
|
||||
}
|
||||
|
||||
// Settings shell: grouped left nav + content column.
|
||||
.sk-detail-settings {
|
||||
display: grid;
|
||||
grid-template-columns: 200px 1fr;
|
||||
gap: $space-4;
|
||||
align-items: start;
|
||||
|
||||
@media (max-width: $breakpoint-md) {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
&__nav {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: $space-hair;
|
||||
position: sticky;
|
||||
top: $space-4;
|
||||
|
||||
// Phones: one horizontally scrollable chip row. Groups are flattened
|
||||
// (display: contents) so every item is a direct flex child; the group
|
||||
// labels are hidden and the +$space-4 stagger margin disappears with
|
||||
// the group boxes. The old wrap layout squeezed four group columns
|
||||
// side by side, staggered them 16px apart and clipped the pills.
|
||||
@media (max-width: $breakpoint-md) {
|
||||
position: static;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
gap: $space-tight;
|
||||
overflow-x: auto;
|
||||
padding-bottom: $space-hair; // keep the active pill's ring/shadow unclipped
|
||||
scrollbar-width: none;
|
||||
&::-webkit-scrollbar { display: none; }
|
||||
}
|
||||
}
|
||||
|
||||
// Grouped left nav — an uppercase mono label per group.
|
||||
&__group + &__group {
|
||||
margin-top: $space-4;
|
||||
}
|
||||
|
||||
@media (max-width: $breakpoint-md) {
|
||||
&__group { display: contents; }
|
||||
&__grouplabel { display: none; }
|
||||
}
|
||||
|
||||
&__grouplabel {
|
||||
padding: 0 $space-3;
|
||||
margin-bottom: $space-tight;
|
||||
font-size: $text-xs;
|
||||
font-weight: $font-weight-semibold;
|
||||
color: var(--text-faint);
|
||||
}
|
||||
|
||||
&__navitem {
|
||||
display: flex;
|
||||
width: 100%; // fill the nav column — a flex <button> otherwise shrinks
|
||||
// to its label, so each item's box was a different width
|
||||
align-items: center;
|
||||
gap: $space-2;
|
||||
min-height: $control-md;
|
||||
padding: 0 $space-3;
|
||||
border: none;
|
||||
border-radius: $radius-control;
|
||||
background: none;
|
||||
color: var(--text-dim);
|
||||
font-size: $text-sm;
|
||||
font-weight: $font-weight-medium;
|
||||
text-align: left;
|
||||
cursor: pointer;
|
||||
transition: background 0.14s, color 0.14s;
|
||||
|
||||
svg { color: var(--text-faint); flex-shrink: 0; }
|
||||
|
||||
&:hover { background: var(--surface-hover); color: var(--text); }
|
||||
&.is-active {
|
||||
@include status-variant(var(--accent-bright), var(--accent-bg));
|
||||
svg { color: var(--accent-bright); }
|
||||
}
|
||||
|
||||
// Chip row on phones: shrink to the label, never wrap or stretch.
|
||||
@media (max-width: $breakpoint-md) {
|
||||
width: auto;
|
||||
flex: 0 0 auto;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
&__content {
|
||||
min-width: 0;
|
||||
|
||||
// A form inside a section panel inherits the panel's surface instead
|
||||
// of drawing a second card inside it.
|
||||
.card .settings-form {
|
||||
padding: 0;
|
||||
border: 0;
|
||||
border-radius: 0;
|
||||
background: transparent;
|
||||
|
||||
> button[type='submit'] { margin-top: $space-4; }
|
||||
}
|
||||
}
|
||||
|
||||
&__section {
|
||||
margin-bottom: $space-6;
|
||||
|
||||
&:last-child { margin-bottom: 0; }
|
||||
}
|
||||
|
||||
&__section-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: $space-tight;
|
||||
margin: 0 0 $space-3;
|
||||
font-size: $text-xs;
|
||||
font-weight: $font-weight-semibold;
|
||||
color: var(--text-faint);
|
||||
}
|
||||
|
||||
// A divided sub-block within a section — e.g. the Deployment pipeline under
|
||||
// the Git connect form in "Git & Deploy". Mirrors the .svc-give-subdomain
|
||||
// divider so stacked panels read as distinct steps rather than one slab.
|
||||
&__subsection {
|
||||
margin-top: $space-5;
|
||||
padding-top: $space-5;
|
||||
border-top: 1px solid var(--border-soft);
|
||||
}
|
||||
|
||||
&__subsection-title {
|
||||
margin: 0 0 $space-3;
|
||||
font-size: $text-xs;
|
||||
font-weight: $font-weight-semibold;
|
||||
color: var(--text-faint);
|
||||
}
|
||||
}
|
||||
@@ -68,6 +68,7 @@
|
||||
@import 'components/_status-badge';
|
||||
@import 'components/_connection-status';
|
||||
@import 'components/_detail-tabs';
|
||||
@import 'components/_detail-page'; // header meta, body rhythm and settings shell shared by service + server detail
|
||||
@import 'components/_server-selector';
|
||||
@import 'components/_domain-field'; // shared domain input (DomainField.jsx)
|
||||
@import 'components/_fields'; // CopyField, PortField, EnvEditor, ServerPicker
|
||||
|
||||
@@ -131,8 +131,6 @@
|
||||
// like the existing info-card but with chip rows for the multi-value
|
||||
// fields.
|
||||
.system-status-card {
|
||||
grid-column: span 2;
|
||||
|
||||
&__header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
@@ -310,11 +310,8 @@
|
||||
// SERVER DETAIL PAGE
|
||||
// ============================================
|
||||
|
||||
.server-detail-page {
|
||||
padding: 0;
|
||||
width: min(100%, 1400px);
|
||||
margin: 0 auto;
|
||||
}
|
||||
// No width cap here: the page shell (PageLayout) owns the frame, so the top
|
||||
// bar and body span the content region exactly like the service detail page.
|
||||
|
||||
// Mono breadcrumb (redesign) — only ServerDetail renders this class.
|
||||
.page-breadcrumb {
|
||||
@@ -369,14 +366,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
.offline-card {
|
||||
grid-column: span 2;
|
||||
|
||||
@media (max-width: $breakpoint-lg) {
|
||||
grid-column: span 1;
|
||||
}
|
||||
}
|
||||
|
||||
.offline-message {
|
||||
text-align: center;
|
||||
padding: $space-6;
|
||||
@@ -1876,29 +1865,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Refine overview info cards (less marketing, more dashboard)
|
||||
.overview-tab .info-card {
|
||||
padding: $space-5;
|
||||
border-radius: $radius-overlay;
|
||||
background: $bg-card;
|
||||
border: 1px solid $border-subtle;
|
||||
box-shadow: none;
|
||||
transition: border-color $transition-fast;
|
||||
|
||||
&:hover {
|
||||
border-color: $border-active;
|
||||
}
|
||||
|
||||
h3 {
|
||||
margin: 0 0 $space-3;
|
||||
padding-bottom: $space-2;
|
||||
border-bottom: 1px solid $border-subtle;
|
||||
font-size: $text-xs;
|
||||
font-weight: $font-weight-semibold;
|
||||
color: $text-tertiary;
|
||||
}
|
||||
}
|
||||
|
||||
.overview-tab .info-item {
|
||||
padding: $space-2 0;
|
||||
border-bottom: 1px dashed $border-subtle;
|
||||
@@ -1928,87 +1894,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Demo `.spec-card` look: quiet surface tile, mono uppercase label, big mono
|
||||
// value. Gauge tiles carry a thin .sk-gauge meter (CPU=accent-bright,
|
||||
// RAM=cyan, Disk=green; red>85 / amber>70 thresholds set in JSX).
|
||||
.kpi-tile {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: $space-2;
|
||||
padding: $space-4 $space-4;
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border-soft);
|
||||
border-radius: var(--radius);
|
||||
transition: border-color $transition-fast;
|
||||
|
||||
&:hover {
|
||||
border-color: var(--border-strong);
|
||||
}
|
||||
|
||||
&__head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: $space-2;
|
||||
color: var(--text-faint);
|
||||
}
|
||||
|
||||
&__icon {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: var(--text-ghost);
|
||||
|
||||
svg { width: 13px; height: 13px; }
|
||||
}
|
||||
|
||||
&__label {
|
||||
font-size: $text-xs;
|
||||
font-weight: $font-weight-semibold;
|
||||
color: var(--text-faint);
|
||||
}
|
||||
|
||||
&__value {
|
||||
font-size: $text-lg;
|
||||
font-weight: $font-weight-semibold;
|
||||
letter-spacing: -0.02em;
|
||||
color: var(--text);
|
||||
line-height: 1.15;
|
||||
text-transform: capitalize;
|
||||
}
|
||||
|
||||
&__sub {
|
||||
font-size: $text-xs;
|
||||
color: var(--text-faint);
|
||||
}
|
||||
|
||||
&__meter {
|
||||
margin-top: $space-hair;
|
||||
}
|
||||
|
||||
// Tone variants (status tile + gauge thresholds)
|
||||
&--success .kpi-tile__value { color: var(--green); }
|
||||
&--danger .kpi-tile__value { color: var(--red); }
|
||||
&--warning .kpi-tile__value,
|
||||
&--warn .kpi-tile__value { color: var(--amber); }
|
||||
}
|
||||
|
||||
// Iconified info rows replacing plain InfoList rows in overview cards
|
||||
.overview-tab .info-card {
|
||||
h3 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: $space-2;
|
||||
color: $text-tertiary;
|
||||
|
||||
svg {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
color: $accent-primary;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Server overview spec rows (InfoList): icon + faint key, mono value
|
||||
// right-aligned, soft separators.
|
||||
.server-info-list {
|
||||
@@ -2027,11 +1912,8 @@
|
||||
.info-item {
|
||||
gap: $space-3;
|
||||
padding: $space-3 0;
|
||||
border-bottom: 1px solid var(--border-soft);
|
||||
min-height: 40px; // geometry: table-row height (40 default row)
|
||||
font-size: $text-sm;
|
||||
|
||||
&:last-child { border-bottom: 0; }
|
||||
}
|
||||
|
||||
.info-label {
|
||||
@@ -2067,10 +1949,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
.overview-grid__full {
|
||||
grid-column: 1 / -1;
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// TAB BADGE (notification count on tabs)
|
||||
// ============================================
|
||||
@@ -2301,40 +2179,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
// ---- Overview info cards (quiet surface + mono eyebrow) ----
|
||||
// `> h3` on purpose: SystemStatusCard nests its own h3 (styled in
|
||||
// _server-packages.scss) and must not get a second eyebrow border.
|
||||
.overview-tab .info-card {
|
||||
padding: $space-4 $space-4;
|
||||
border-radius: var(--radius);
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border-soft);
|
||||
box-shadow: none;
|
||||
transition: border-color $transition-fast;
|
||||
|
||||
&:hover {
|
||||
border-color: var(--border-strong);
|
||||
}
|
||||
|
||||
> h3 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: $space-2;
|
||||
margin: 0 0 $space-2;
|
||||
padding-bottom: $space-3;
|
||||
border-bottom: 1px solid var(--border-soft);
|
||||
font-size: $text-xs;
|
||||
font-weight: $font-weight-semibold;
|
||||
color: var(--text-faint);
|
||||
|
||||
svg {
|
||||
width: 13px;
|
||||
height: 13px;
|
||||
color: var(--accent-bright);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.offline-message {
|
||||
svg { color: var(--text-ghost); }
|
||||
h4 { color: var(--text); }
|
||||
@@ -2524,20 +2368,10 @@
|
||||
gap: $space-3;
|
||||
}
|
||||
|
||||
// Header: dot / (i) / star share one centered row beside the title; on narrow
|
||||
// screens the title block and actions stay on ONE row (title truncates), tabs below.
|
||||
// Phones: the server's actions are two icon buttons, so the title block and
|
||||
// actions stay on ONE row (title truncates), tabs below. The shared header
|
||||
// rules (dot / (i) / star) live in components/_detail-page.scss.
|
||||
.server-detail-page .sk-topbar {
|
||||
&__titles { align-items: center; }
|
||||
&__meta { display: inline-flex; align-items: center; gap: $space-2; }
|
||||
|
||||
.fav-star {
|
||||
width: 24px; // geometry: matches the InfoTip md footprint
|
||||
height: 24px; // geometry: matches the InfoTip md footprint
|
||||
svg { width: 14px; height: 14px; } // geometry: inline icon
|
||||
opacity: 0.6;
|
||||
&:hover, &.is-on { opacity: 1; }
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
&__titles { flex: 1 1 0; min-width: 0; flex-wrap: nowrap; }
|
||||
&__title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; overflow-wrap: normal; }
|
||||
@@ -2546,18 +2380,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
.server-detail-info {
|
||||
display: grid;
|
||||
grid-template-columns: auto 1fr;
|
||||
gap: $space-1 $space-3;
|
||||
margin: 0;
|
||||
|
||||
dt { color: var(--text-faint); }
|
||||
dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
|
||||
|
||||
&__id { display: flex; align-items: center; gap: $space-1; code { font-family: $font-mono; } }
|
||||
}
|
||||
|
||||
// Permission-level picker in the Add Server drawer
|
||||
.level-picker {
|
||||
display: grid;
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
// ============================================
|
||||
// SERVICE DETAIL PAGE (redesign — infra console look)
|
||||
// Shares the WordPress detail page's layout: a full-bleed PageTopbar
|
||||
// (.sk-topbar) above a centered .app-detail-body, reusing the shared
|
||||
// app-detail-* base chrome (_applications.scss). Tab bodies consume the
|
||||
// Same frame as the server detail page: PageLayout's full-bleed top bar above
|
||||
// the shell body (.sk-detail-body, components/_detail-page.scss), reusing the
|
||||
// shared app-detail-* base chrome (_applications.scss). Tab bodies consume the
|
||||
// shared sk- primitives (Pill / MetricCard / Gauge / .sk-info-row / .sk-dtable).
|
||||
// ============================================
|
||||
|
||||
// Run the detail page FULL-BLEED like the list pages: drop the .main-content
|
||||
// frame so the .sk-topbar spans edge-to-edge; .app-detail-body re-pads a
|
||||
// centered column below. (Mirrors .main-content:has(.wp-detail-page).)
|
||||
// frame so the .sk-topbar spans edge-to-edge; the page shell pads the body
|
||||
// below. (Mirrors .main-content:has(.wp-detail-page).)
|
||||
.main-content:has(.svc-detail) {
|
||||
padding: 0;
|
||||
|
||||
@@ -27,16 +27,6 @@
|
||||
// frame is dropped by the `:has()` rule at the bottom of this file.
|
||||
gap: 0;
|
||||
|
||||
// Full-width body below the full-bleed top bar.
|
||||
.app-detail-body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: $space-5;
|
||||
width: 100%;
|
||||
// Same full width and gutter as every page body (page-shell-inner).
|
||||
padding: $space-5 $space-5 $space-8;
|
||||
}
|
||||
|
||||
// Identity row — flat (no card): just the tile + name on the page.
|
||||
.app-detail-header {
|
||||
padding: $space-1 0 0;
|
||||
@@ -162,7 +152,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Repo Bar (spacing handled by the .app-detail-body flex gap)
|
||||
// Repo Bar (spacing handled by the .sk-detail-body flex gap)
|
||||
&__repo-bar {
|
||||
display: flex;
|
||||
}
|
||||
@@ -513,128 +503,8 @@ h3.svc-eyebrow {
|
||||
|
||||
// Settings tab within service detail — grouped left sub-nav + content pane,
|
||||
// mirroring the WordPress detail page's settings layout (.wp-settings).
|
||||
.svc-settings {
|
||||
display: grid;
|
||||
grid-template-columns: 200px 1fr;
|
||||
gap: $space-4;
|
||||
align-items: start;
|
||||
|
||||
@media (max-width: $breakpoint-md) {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
&__nav {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: $space-hair;
|
||||
position: sticky;
|
||||
top: $space-4;
|
||||
|
||||
// Phones: one horizontally scrollable chip row. Groups are flattened
|
||||
// (display: contents) so every item is a direct flex child; the group
|
||||
// labels are hidden and the +$space-4 stagger margin disappears with
|
||||
// the group boxes. The old wrap layout squeezed four group columns
|
||||
// side by side, staggered them 16px apart and clipped the pills.
|
||||
@media (max-width: $breakpoint-md) {
|
||||
position: static;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
gap: $space-tight;
|
||||
overflow-x: auto;
|
||||
padding-bottom: $space-hair; // keep the active pill's ring/shadow unclipped
|
||||
scrollbar-width: none;
|
||||
&::-webkit-scrollbar { display: none; }
|
||||
}
|
||||
}
|
||||
|
||||
// Grouped left nav — an uppercase mono label per group.
|
||||
&__group + &__group {
|
||||
margin-top: $space-4;
|
||||
}
|
||||
|
||||
@media (max-width: $breakpoint-md) {
|
||||
&__group { display: contents; }
|
||||
&__grouplabel { display: none; }
|
||||
}
|
||||
|
||||
&__grouplabel {
|
||||
padding: 0 $space-3;
|
||||
margin-bottom: $space-tight;
|
||||
font-size: $text-xs;
|
||||
font-weight: $font-weight-semibold;
|
||||
color: var(--text-faint);
|
||||
}
|
||||
|
||||
&__navitem {
|
||||
display: flex;
|
||||
width: 100%; // fill the nav column — a flex <button> otherwise shrinks
|
||||
// to its label, so each item's box was a different width
|
||||
align-items: center;
|
||||
gap: $space-2;
|
||||
min-height: $control-md;
|
||||
padding: 0 $space-3;
|
||||
border: none;
|
||||
border-radius: $radius-control;
|
||||
background: none;
|
||||
color: var(--text-dim);
|
||||
font-size: $text-sm;
|
||||
font-weight: $font-weight-medium;
|
||||
text-align: left;
|
||||
cursor: pointer;
|
||||
transition: background 0.14s, color 0.14s;
|
||||
|
||||
svg { color: var(--text-faint); flex-shrink: 0; }
|
||||
|
||||
&:hover { background: var(--surface-hover); color: var(--text); }
|
||||
&.is-active {
|
||||
@include status-variant(var(--accent-bright), var(--accent-bg));
|
||||
svg { color: var(--accent-bright); }
|
||||
}
|
||||
|
||||
// Chip row on phones: shrink to the label, never wrap or stretch.
|
||||
@media (max-width: $breakpoint-md) {
|
||||
width: auto;
|
||||
flex: 0 0 auto;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
&__content {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
&__section {
|
||||
margin-bottom: $space-6;
|
||||
|
||||
&:last-child { margin-bottom: 0; }
|
||||
}
|
||||
|
||||
&__section-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: $space-tight;
|
||||
margin: 0 0 $space-3;
|
||||
font-size: $text-xs;
|
||||
font-weight: $font-weight-semibold;
|
||||
color: var(--text-faint);
|
||||
}
|
||||
|
||||
// A divided sub-block within a section — e.g. the Deployment pipeline under
|
||||
// the Git connect form in "Git & Deploy". Mirrors the .svc-give-subdomain
|
||||
// divider so stacked panels read as distinct steps rather than one slab.
|
||||
&__subsection {
|
||||
margin-top: $space-5;
|
||||
padding-top: $space-5;
|
||||
border-top: 1px solid var(--border-soft);
|
||||
}
|
||||
|
||||
&__subsection-title {
|
||||
margin: 0 0 $space-3;
|
||||
font-size: $text-xs;
|
||||
font-weight: $font-weight-semibold;
|
||||
color: var(--text-faint);
|
||||
}
|
||||
}
|
||||
// The settings nav + content frame moved to components/_detail-settings.scss
|
||||
// (.sk-detail-settings), shared with the server detail page.
|
||||
|
||||
// Icon-only button (global utility consumed by several other components)
|
||||
|
||||
@@ -898,6 +768,9 @@ h3.svc-eyebrow {
|
||||
font-size: $text-xs;
|
||||
font-weight: $font-weight-semibold;
|
||||
color: var(--text-faint);
|
||||
|
||||
// Title glyphs (server overview cards, scheduled tasks) share one size.
|
||||
> svg { width: 14px; height: 14px; flex-shrink: 0; } // geometry: icon size
|
||||
}
|
||||
|
||||
&__card-header-row {
|
||||
|
||||
Reference in new issue
Block a user