Pages auf PageHeader/StatusDot/ActionButtons-Pattern migriert:
* Dashboard — Komplett-Rewrite. KPI-Tiles (Domains, Backends, Iface,
FW-Rules, NAT, WG), Detail-Cards (WireGuard live status, Firewall
zone overview, SSL expiring soon, Cluster nodes, Routing summary,
System info). Polled queries pro Card.
* Domains, Backends, RoutingRules, Networks, IPAddresses, SSL,
Cluster, Settings, Firewall (index) — alle inline Action-Buttons
→ ActionButtons; alle Yes/No-Renders → StatusDot; Add-Button in
DataTable.extraActions; PageHeader oben.
WireGuard
---------
* Neuer /wireguard/status-Endpoint parsed `wg show all dump`,
liefert {iface, peer_pubkey, endpoint, last_handshake_unix, rx, tx}.
Sudoers im postinst um `wg show` erweitert.
* Server-Drawer Peer-Liste zeigt jetzt Live-Status (Online/Offline-
Dot, "vor Xs", Traffic-Counter) per 10s-Polling. Importierte
"Unify Home" peer kann jetzt im UI verifiziert werden.
* Importer-Bug fixed: nextName ("# Unify Home" comment) wurde beim
Sektionswechsel zu früh geresettet — jetzt nur nach echtem
flushPeer.
Routing-Rules
-------------
* Aus Sidebar entfernt. URL bleibt funktional, aber für 90% der
Setups reicht domains.primary_backend_id (das HAProxy ohnehin
als default_backend rendert). Path-basiertes Routing ist ein
Advanced-Feature und kommt später als Domain-Modal-Tab zurück.
* nav.routing-Sidebar-Eintrag + BranchesOutlined-Import entfernt.
Misc
----
* "Firewall (v2)" → "Firewall" im Nav (DE).
* Dashboard-i18n Block in DE+EN.
* Version 1.0.11 → 1.0.12.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
72 lines
2.2 KiB
TypeScript
72 lines
2.2 KiB
TypeScript
import { Card, Descriptions, Spin } from 'antd'
|
|
import { SettingOutlined } from '@ant-design/icons'
|
|
import { useQuery } from '@tanstack/react-query'
|
|
import { useTranslation } from 'react-i18next'
|
|
|
|
import apiClient, { isEnvelope } from '../../api/client'
|
|
import PageHeader from '../../components/PageHeader'
|
|
|
|
interface SetupStatus {
|
|
completed: boolean
|
|
admin_email: string
|
|
fqdn: string
|
|
}
|
|
|
|
interface SystemHealth {
|
|
status: string
|
|
version: string
|
|
}
|
|
|
|
export default function SettingsPage() {
|
|
const { t } = useTranslation()
|
|
|
|
const { data: setupStatus, isLoading: loadingSetup } = useQuery({
|
|
queryKey: ['setup', 'status'],
|
|
queryFn: async () => {
|
|
const r = await apiClient.get('/setup/status')
|
|
if (isEnvelope(r.data)) return r.data.data as SetupStatus
|
|
return null
|
|
},
|
|
})
|
|
|
|
const { data: health, isLoading: loadingHealth } = useQuery({
|
|
queryKey: ['system', 'health'],
|
|
queryFn: async () => {
|
|
const r = await apiClient.get('/system/health')
|
|
if (isEnvelope(r.data)) return r.data.data as SystemHealth
|
|
return null
|
|
},
|
|
})
|
|
|
|
if (loadingSetup || loadingHealth) {
|
|
return <Spin />
|
|
}
|
|
|
|
return (
|
|
<div>
|
|
<PageHeader
|
|
icon={<SettingOutlined />}
|
|
title={t('settings.title')}
|
|
subtitle={t('settings.intro')}
|
|
/>
|
|
|
|
<Card title={t('settings.systemInfo')} className="mb-12" size="small">
|
|
<Descriptions column={1}>
|
|
<Descriptions.Item label={t('settings.version')}>{health?.version ?? '—'}</Descriptions.Item>
|
|
<Descriptions.Item label={t('settings.status')}>{health?.status ?? '—'}</Descriptions.Item>
|
|
</Descriptions>
|
|
</Card>
|
|
|
|
<Card title={t('settings.setupInfo')} size="small">
|
|
<Descriptions column={1}>
|
|
<Descriptions.Item label={t('settings.adminEmail')}>{setupStatus?.admin_email ?? '—'}</Descriptions.Item>
|
|
<Descriptions.Item label={t('settings.fqdn')}>{setupStatus?.fqdn ?? '—'}</Descriptions.Item>
|
|
<Descriptions.Item label={t('settings.setupCompleted')}>
|
|
{setupStatus?.completed ? t('common.yes') : t('common.no')}
|
|
</Descriptions.Item>
|
|
</Descriptions>
|
|
</Card>
|
|
</div>
|
|
)
|
|
}
|