Refactor: Remove summary cards from various pages and update UI components

- Removed summary cards from Managed Domains, Nodes, Proxy Routes, TLS Certificates, Users pages to streamline UI.
- Updated Nodes and Proxy Routes pages to enhance action buttons and descriptions.
- Added new runtime configuration options for rate limiting in Settings page, allowing for dynamic updates.
- Updated documentation to reflect new runtime configurations and their effects.
- Enhanced unit tests for DashboardOverview to include mock data for comprehensive coverage.
This commit is contained in:
ryan
2026-03-11 19:49:30 +08:00
parent f7d18f712e
commit db3f9b0c0a
20 changed files with 1171 additions and 555 deletions
@@ -179,32 +179,6 @@ export function TlsCertificatesPage() {
});
const certificates = useMemo(() => certificatesQuery.data ?? [], [certificatesQuery.data]);
const summary = useMemo(
() => [
{ label: '证书总数', value: certificates.length },
{
label: '30 天内到期',
value: certificates.filter((item) => {
const expiresAt = new Date(item.not_after).getTime();
if (Number.isNaN(expiresAt)) {
return false;
}
const diffMs = expiresAt - Date.now();
return diffMs >= 0 && diffMs <= 30 * 24 * 60 * 60 * 1000;
}).length,
},
{
label: '已过期',
value: certificates.filter((item) => {
const expiresAt = new Date(item.not_after).getTime();
return !Number.isNaN(expiresAt) && expiresAt < Date.now();
}).length,
},
{ label: '最近更新', value: certificates[0] ? formatDateTime(certificates[0].updated_at) : '—' },
],
[certificates],
);
const handleManualSubmit = manualForm.handleSubmit((values) => {
setFeedback(null);
@@ -245,20 +219,6 @@ export function TlsCertificatesPage() {
{feedback ? <InlineMessage tone={feedback.tone} message={feedback.message} /> : null}
<AppCard title='证书概览' description='上线前可先检查证书存量、过期风险与最近更新时间。'>
<div className='grid gap-4 md:grid-cols-2 xl:grid-cols-4'>
{summary.map((item) => (
<div
key={item.label}
className='rounded-2xl border border-[var(--border-default)] bg-[var(--surface-elevated)] px-4 py-4'
>
<p className='text-xs uppercase tracking-[0.2em] text-[var(--foreground-muted)]'>{item.label}</p>
<p className='mt-2 text-lg font-semibold text-[var(--foreground-primary)]'>{item.value}</p>
</div>
))}
</div>
</AppCard>
<AppCard
title='证书列表'
description='展示证书有效期、到期状态与最近更新时间。删除前会提示确认。'