feat: 展示通知 outbox 状态

- services: 增加 /notification-outbox 真实接口读取与摘要清洗

- store: 超级管理员加载最近通知 outbox

- settings: 增加通知 outbox 运维表格
This commit is contained in:
湛兮
2026-06-12 03:22:38 +08:00
parent 4988c5be38
commit cc72a24c7d
4 changed files with 170 additions and 1 deletions
+19 -1
View File
@@ -14,6 +14,7 @@ import type {
ProjectConfig,
ProjectRefs,
JenkinsSyncSummary,
NotificationOutboxMessage,
ReleaseRun,
SystemSetting,
} from '../types/devops'
@@ -30,6 +31,7 @@ export const usePlatformStore = defineStore('platform', () => {
const agentCards = ref<AgentCard[]>([])
const settings = ref<SystemSetting[]>([])
const auditLogs = ref<AuditLogEntry[]>([])
const notificationOutbox = ref<NotificationOutboxMessage[]>([])
const integrationConfig = ref<IntegrationConfigStatus>({
checkedAt: '',
integrations: [],
@@ -59,9 +61,17 @@ export const usePlatformStore = defineStore('platform', () => {
const auditLogsPromise = includeAdminData
? devopsApi.getAuditLogs()
: Promise.resolve<AuditLogEntry[]>([])
const [processXml, recentAuditLogs] = await Promise.all([processXmlPromise, auditLogsPromise])
const notificationOutboxPromise = includeAdminData
? devopsApi.getNotificationOutbox()
: Promise.resolve<NotificationOutboxMessage[]>([])
const [processXml, recentAuditLogs, recentNotificationOutbox] = await Promise.all([
processXmlPromise,
auditLogsPromise,
notificationOutboxPromise,
])
releaseProcessXml.value = processXml
auditLogs.value = recentAuditLogs
notificationOutbox.value = recentNotificationOutbox
dataSource.value = devopsApi.getLastDataSource()
} finally {
loading.value = false
@@ -119,6 +129,12 @@ export const usePlatformStore = defineStore('platform', () => {
return auditLogs.value
}
async function loadNotificationOutbox() {
notificationOutbox.value = await devopsApi.getNotificationOutbox()
dataSource.value = devopsApi.getLastDataSource()
return notificationOutbox.value
}
function upsertRun(run: ReleaseRun) {
runs.value = [run, ...runs.value.filter((item) => item.id !== run.id)]
}
@@ -132,6 +148,7 @@ export const usePlatformStore = defineStore('platform', () => {
agentCards,
settings,
auditLogs,
notificationOutbox,
integrationConfig,
releaseProcessXml,
projectRefs,
@@ -145,5 +162,6 @@ export const usePlatformStore = defineStore('platform', () => {
syncJenkinsRuns,
loadProjectRefs,
loadAuditLogs,
loadNotificationOutbox,
}
})