feat: umfangreiches UI+API-Polish (v1.1.36–1.1.42)

Backend:
- Audit-Log: Search-Endpoint mit ILIKE-Filter (actor/action/subject/date)
- NTP: /ntp/status via chronyc tracking (Stratum, Offset, Quelle)
- System: /service-restart mit Allowlist (haproxy/squid/unbound/chrony/scheduler)
- Domain-Response-Headers + Rate-Limit (Migration 0024)
- Join-Tokens (Migration 0025), Cluster-mTLS, Aggregator-Fan-Out
- apt-Service für Update-Banner (apt-get update + Versionsprüfung)
- Backup-Retry mit exponential backoff (retry_apt 3×)
- publish.sh fail-fast + cleanup-old.sh (max 10 Versionen)

Frontend:
- Audit-Log-Page (/audit) mit Filter + Pagination
- ErrorBoundary an React-Root + Vite build-target festgenagelt (iOS 15+)
- Storage-Schema-Stamp: auto-wipe bei Versions-Mismatch (blank-page-Fix)
- EmptyState-Komponente überall ausgerollt
- SSL: Aggregate-Karte (total/expiring/expired/errors)
- Backups: Aggregate-Karte (letzter Backup/Größe/Fehlschläge 24h) + Backup-Now
- NTP: Sync-Status-Karte (chronyc tracking live)
- Domains: Backend-UP/DOWN-Chip aus HAProxy-Stats
- Backends: HAProxy-Status-Spalte (UP/DEGRADED/DOWN)
- Settings: Service-Neustart-Karte (haproxy/squid/unbound/chrony/scheduler)
- Settings: Upgrade-Status-Card, Wartungsmodus, Auto-Update, Retention
- Dashboard: Recent-Alerts, Cluster-Health, License-Chip, Onboarding-Hint
- System-Regeln im Firewall als eigener Tab

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Debian
2026-05-19 16:18:41 +02:00
parent 3178e25e78
commit 35b7308ce2
82 changed files with 8408 additions and 392 deletions

View File

@@ -1,6 +1,6 @@
import { useEffect, useRef, useState } from 'react'
import {
Alert, Button, Card, Popconfirm, Space, Table, Tag, Tooltip, Typography, message,
Alert, Button, Card, Col, Popconfirm, Row, Space, Statistic, Table, Tag, Tooltip, Typography, message,
} from 'antd'
import type { ColumnsType } from 'antd/es/table'
import {
@@ -252,9 +252,68 @@ export default function HistoryTab() {
},
]
// Aggregat-Zähler. Quelle: die bereits geladene Liste — die Backup-
// History wird in der UI sowieso komplett geladen (Pagination ist
// clientseitig). Keine zusätzlichen Endpoint-Calls.
const all = list.data ?? []
const succ = all.filter((b) => b.status === 'success')
const lastSucc = succ[0] // bereits DESC sortiert vom Backend
const totalSize = succ.reduce((acc, b) => acc + (b.size_bytes || 0), 0)
const last24hMs = Date.now() - 86_400_000
const failsLast24h = all.filter((b) =>
b.status === 'failed' && new Date(b.started_at).getTime() >= last24hMs,
).length
const lastSuccAge = lastSucc
? Math.round((Date.now() - new Date(lastSucc.finished_at).getTime()) / 3_600_000) // hours
: null
return (
<div>
{msgCtx}
{all.length > 0 && (
<Row gutter={12} className="mb-16">
<Col xs={12} sm={6}>
<Card size="small">
<Statistic
title={t('backups.statLastSuccess')}
value={
lastSuccAge == null
? '—'
: lastSuccAge < 24
? t('backups.statHoursAgo', { n: lastSuccAge })
: t('backups.statDaysAgo', { n: Math.round(lastSuccAge / 24) })
}
valueStyle={
lastSuccAge == null ? { color: '#cf1322' }
: lastSuccAge > 48 ? { color: '#d48806' }
: { color: '#0F172A' }
}
/>
</Card>
</Col>
<Col xs={12} sm={6}>
<Card size="small">
<Statistic title={t('backups.statTotal')} value={succ.length} />
</Card>
</Col>
<Col xs={12} sm={6}>
<Card size="small">
<Statistic title={t('backups.statSize')} value={fmtSize(totalSize)} />
</Card>
</Col>
<Col xs={12} sm={6}>
<Card size="small">
<Statistic
title={t('backups.statFails24h')}
value={failsLast24h}
valueStyle={failsLast24h > 0 ? { color: '#cf1322' } : undefined}
/>
</Card>
</Col>
</Row>
)}
<Space style={{ marginBottom: 12 }}>
<Tooltip title={t('backups.refreshTooltip')}>
<Button icon={<ReloadOutlined />} onClick={() => list.refetch()}>