release: prepare RealeseV2.3
This commit is contained in:
@@ -38,19 +38,22 @@ import type { LoginSession } from '@/api/session';
|
||||
import { AppShell } from '@/layouts/AppShell';
|
||||
import { PortalSessionBoundary } from '@/layouts/PortalSessionBoundary';
|
||||
|
||||
const EMPTY_PENDING_AUDITS = { enterpriseCertifications: 0, smsAudits: 0, templates: 0, signatures: 0, drainageInfos: 0 };
|
||||
|
||||
export function AdminLayout() {
|
||||
return <PortalSessionBoundary portal="admin">{(session) => <AdminAuthenticatedLayout session={session} />}</PortalSessionBoundary>;
|
||||
}
|
||||
|
||||
function AdminAuthenticatedLayout({ session }: { session: LoginSession }) {
|
||||
const [pendingAudits, setPendingAudits] = useState({ enterpriseCertifications: 0, smsAudits: 0, templates: 0, signatures: 0, drainageInfos: 0 });
|
||||
const [pendingAudits, setPendingAudits] = useState(EMPTY_PENDING_AUDITS);
|
||||
const loadPendingAuditCount = useCallback(() => {
|
||||
adminApi.getDashboard()
|
||||
.then((dashboard) => {
|
||||
setPendingAudits(dashboard.pendingAudits ?? { enterpriseCertifications: 0, smsAudits: 0, templates: 0, signatures: 0, drainageInfos: 0 });
|
||||
// This runs globally and on a timer, so it must not fan out through the full dashboard aggregation.
|
||||
adminApi.getPendingAudits()
|
||||
.then((counts) => {
|
||||
setPendingAudits(counts);
|
||||
})
|
||||
.catch(() => {
|
||||
setPendingAudits({ enterpriseCertifications: 0, smsAudits: 0, templates: 0, signatures: 0, drainageInfos: 0 });
|
||||
setPendingAudits(EMPTY_PENDING_AUDITS);
|
||||
});
|
||||
}, []);
|
||||
|
||||
@@ -94,7 +97,7 @@ function AdminAuthenticatedLayout({ session }: { session: LoginSession }) {
|
||||
items: [
|
||||
{ label: '运营看板', to: '/admin', icon: Gauge },
|
||||
{ label: '发送监控', to: '/admin/monitor', icon: Activity },
|
||||
{ label: 'Gateway提交异常', to: '/admin/gateway-submit-exceptions', icon: AlertTriangle },
|
||||
{ label: '网关异常', to: '/admin/gateway-submit-exceptions', icon: AlertTriangle },
|
||||
{ label: '数据统计', to: '/admin/analytics', icon: BarChart3 },
|
||||
],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user