+
+ {favorite}
+ {children}
+ >
+ );
+}
diff --git a/frontend/src/components/detail/DetailSettings.jsx b/frontend/src/components/detail/DetailSettings.jsx
new file mode 100644
index 00000000..45dafd05
--- /dev/null
+++ b/frontend/src/components/detail/DetailSettings.jsx
@@ -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 (
+
+
+
{children}
+
+ );
+}
+
+// One section of the content column: a quiet title above its panel(s).
+export function DetailSettingsSection({ title, children }) {
+ return (
+
+
{title}
+ {children}
+
+ );
+}
diff --git a/frontend/src/components/serverdetail/ServerHeaderMeta.jsx b/frontend/src/components/serverdetail/ServerHeaderMeta.jsx
index 1ed9c32d..1c100359 100644
--- a/frontend/src/components/serverdetail/ServerHeaderMeta.jsx
+++ b/frontend/src/components/serverdetail/ServerHeaderMeta.jsx
@@ -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 (
- <>
-
-
-
);
diff --git a/frontend/src/components/serverdetail/ServerSettingsTab.jsx b/frontend/src/components/serverdetail/ServerSettingsTab.jsx
index d36fcce8..acdd8b9e 100644
--- a/frontend/src/components/serverdetail/ServerSettingsTab.jsx
+++ b/frontend/src/components/serverdetail/ServerSettingsTab.jsx
@@ -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 (
-
-
-
-
-
{t('app.serverSettingsTab.connectionString', 'Connection string')}
-
- {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.')}`}
-
-
{t('app.serverSettingsTab.pairOrRepair', 'Pair or re-pair this server.')}
-
-
-
-
- );
+ 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 (
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
{t('app.serverSettingsTab.connectionIpAllowlist', 'Connection and IP allowlist')}
- {t('app.serverSettingsTab.restrictWhichIpsCanConnectSupports', 'Restrict which IPs can connect. Supports single IPs, CIDR notation, and wildcards.')}
- {t('app.serverSettingsTab.currentConnectionIp', 'Current connection IP (')}{connectionInfo.ip_address}{t('app.serverSettingsTab.mayBeBlockedByTheseRules', ') may be blocked by these rules.')}
-
- )}
-
-
-
-
-
-
-
-
{t('app.serverSettingsTab.apiKeyRotation', 'API key rotation')}
- {t('app.serverSettingsTab.rotateTheApiCredentialsUsedBy', 'Rotate the API credentials used by the agent. The agent must be online to receive new credentials.')}
+ {t('app.serverSettingsTab.currentConnectionIp', 'Current connection IP (')}{connectionInfo.ip_address}{t('app.serverSettingsTab.mayBeBlockedByTheseRules', ') may be blocked by these rules.')}
+
+ )}
+
+
+
+ )}
+
+ {section === 'credentials' && (
+
+ {t('app.serverSettingsTab.apiKeyRotation', 'API key rotation')}
+ {t('app.serverSettingsTab.rotateTheApiCredentialsUsedBy', 'Rotate the API credentials used by the agent. The agent must be online to receive new credentials.')}
+ >}
+ >
+
+
)}
@@ -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' && (
-
-
{t('app.settingsTab.cache', 'Cache')}
+
+
{t('app.settingsTab.cache', 'Cache')}
)}
@@ -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' && (
-
-
{t('app.settingsTab.healthRollout', 'Health and rollout')}
+
+
{t('app.settingsTab.healthRollout', 'Health and rollout')}
@@ -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' && (
-
-
{t('common.labels.storage', 'Storage')}
+
+
{t('common.labels.storage', 'Storage')}
)}
@@ -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' && (
-
-
{t('app.settingsTab.gitDeploy', 'Git and deploy')}
+
+
{t('app.settingsTab.gitDeploy', 'Git and deploy')}
{deployConfig && (
-
-
{t('app.settingsTab.deployment', 'Deployment')}
+
+
{t('app.settingsTab.deployment', 'Deployment')}
)}
@@ -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' && (
-
-
{t('app.settingsTab.build', 'Build')}
+
+
{t('app.settingsTab.build', 'Build')}
)}
@@ -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' && (
-
)}
@@ -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' && (
-