mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-03 01:40:21 +08:00
fix(admin): repair system maintenance controls
Implement server-side searchable user filtering for usage records, including backend search parameters and a shared frontend selector with loading, empty, and pinned-selected states. Fix announcement deletion by cascading announcement read rows through a Postgres migration and defensive repository cleanup across supported backends. Wire admin system purge and cleanup endpoints to real data deletion/maintenance flows, improve DataManagement messages, rebuild stats after stats purge, and add runtime OAuth token refresh maintenance when enabled. Verified with rust-ci equivalent checks: cargo fmt, split clippy, split cargo tests, SQLite/Postgres/MySQL smoke tests, plus frontend npm ci, build, pages build, type-check, and targeted usage selector tests.
This commit is contained in:
@@ -106,11 +106,11 @@ const purgeItems: PurgeItem[] = [
|
||||
},
|
||||
{
|
||||
key: 'stats',
|
||||
title: '清空聚合数据',
|
||||
description: '清空仪表盘统计和聚合数据,保留原始使用记录',
|
||||
buttonText: '清空聚合数据',
|
||||
title: '清空统计聚合',
|
||||
description: '删除统计聚合数据,保留原始使用记录;统计可从原始使用记录重新构建',
|
||||
buttonText: '清空统计聚合',
|
||||
icon: markRaw(PieChart),
|
||||
confirmMessage: '确定要清空全部聚合统计数据吗?仪表盘数据将被清除,用户和 Key 的累计统计也会归零,操作不可逆。',
|
||||
confirmMessage: '确定要清空全部统计聚合数据吗?原始使用记录会保留,仪表盘和累计统计可从原始记录重新构建。',
|
||||
action: () => adminApi.purgeStats(),
|
||||
},
|
||||
]
|
||||
@@ -122,9 +122,9 @@ async function handlePurge(item: PurgeItem) {
|
||||
loadingKey.value = item.key
|
||||
try {
|
||||
const result = await item.action()
|
||||
success(result.message)
|
||||
success(result.message || '操作成功')
|
||||
} catch (e) {
|
||||
error(parseApiError(e))
|
||||
error(parseApiError(e, '清空失败'))
|
||||
} finally {
|
||||
loadingKey.value = null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user