feat: 展示真实运维审计日志
This commit is contained in:
+16
-1
@@ -3,6 +3,7 @@ import { defineStore } from 'pinia'
|
||||
import { devopsApi } from '../services/devopsApi'
|
||||
import type {
|
||||
AgentCard,
|
||||
AuditLogEntry,
|
||||
CreateDeployRunPayload,
|
||||
IntegrationStatus,
|
||||
IntegrationConfigStatus,
|
||||
@@ -24,6 +25,7 @@ export const usePlatformStore = defineStore('platform', () => {
|
||||
const integrations = ref<IntegrationStatus[]>([])
|
||||
const agentCards = ref<AgentCard[]>([])
|
||||
const settings = ref<SystemSetting[]>([])
|
||||
const auditLogs = ref<AuditLogEntry[]>([])
|
||||
const integrationConfig = ref<IntegrationConfigStatus>({
|
||||
checkedAt: '',
|
||||
integrations: [],
|
||||
@@ -46,7 +48,12 @@ export const usePlatformStore = defineStore('platform', () => {
|
||||
agentCards.value = summary.agentCards
|
||||
settings.value = summary.settings
|
||||
integrationConfig.value = summary.integrationConfig
|
||||
releaseProcessXml.value = await devopsApi.getReleaseProcessXml()
|
||||
const [processXml, recentAuditLogs] = await Promise.all([
|
||||
devopsApi.getReleaseProcessXml(),
|
||||
devopsApi.getAuditLogs(),
|
||||
])
|
||||
releaseProcessXml.value = processXml
|
||||
auditLogs.value = recentAuditLogs
|
||||
dataSource.value = devopsApi.getLastDataSource()
|
||||
} finally {
|
||||
loading.value = false
|
||||
@@ -98,6 +105,12 @@ export const usePlatformStore = defineStore('platform', () => {
|
||||
return refs
|
||||
}
|
||||
|
||||
async function loadAuditLogs() {
|
||||
auditLogs.value = await devopsApi.getAuditLogs()
|
||||
dataSource.value = devopsApi.getLastDataSource()
|
||||
return auditLogs.value
|
||||
}
|
||||
|
||||
function upsertRun(run: ReleaseRun) {
|
||||
runs.value = [run, ...runs.value.filter((item) => item.id !== run.id)]
|
||||
}
|
||||
@@ -110,6 +123,7 @@ export const usePlatformStore = defineStore('platform', () => {
|
||||
integrations,
|
||||
agentCards,
|
||||
settings,
|
||||
auditLogs,
|
||||
integrationConfig,
|
||||
releaseProcessXml,
|
||||
projectRefs,
|
||||
@@ -122,5 +136,6 @@ export const usePlatformStore = defineStore('platform', () => {
|
||||
syncJenkinsRun,
|
||||
syncJenkinsRuns,
|
||||
loadProjectRefs,
|
||||
loadAuditLogs,
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user