fix: 保留项目 Jenkins 诊断结果
This commit is contained in:
+16
-2
@@ -33,6 +33,7 @@ export const usePlatformStore = defineStore('platform', () => {
|
||||
const settings = ref<SystemSetting[]>([])
|
||||
const auditLogs = ref<AuditLogEntry[]>([])
|
||||
const notificationOutbox = ref<NotificationOutboxMessage[]>([])
|
||||
const projectJenkinsDiagnostics = ref<ProjectJenkinsDiagnosticsSummary | null>(null)
|
||||
const integrationConfig = ref<IntegrationConfigStatus>({
|
||||
checkedAt: '',
|
||||
integrations: [],
|
||||
@@ -73,6 +74,7 @@ export const usePlatformStore = defineStore('platform', () => {
|
||||
releaseProcessXml.value = processXml
|
||||
auditLogs.value = recentAuditLogs
|
||||
notificationOutbox.value = recentNotificationOutbox
|
||||
applyProjectJenkinsDiagnostics()
|
||||
dataSource.value = devopsApi.getLastDataSource()
|
||||
} finally {
|
||||
loading.value = false
|
||||
@@ -126,6 +128,19 @@ export const usePlatformStore = defineStore('platform', () => {
|
||||
|
||||
async function loadProjectJenkinsDiagnostics(): Promise<ProjectJenkinsDiagnosticsSummary> {
|
||||
const diagnostics = await devopsApi.getProjectJenkinsDiagnostics()
|
||||
projectJenkinsDiagnostics.value = diagnostics
|
||||
applyProjectJenkinsDiagnostics()
|
||||
dataSource.value = devopsApi.getLastDataSource()
|
||||
return diagnostics
|
||||
}
|
||||
|
||||
function applyProjectJenkinsDiagnostics() {
|
||||
const diagnostics = projectJenkinsDiagnostics.value
|
||||
|
||||
if (!diagnostics) {
|
||||
return
|
||||
}
|
||||
|
||||
const jobByEnvironment = new Map(
|
||||
diagnostics.jobs.map((job) => [`${job.projectKey}:${job.environment}`, job]),
|
||||
)
|
||||
@@ -159,8 +174,6 @@ export const usePlatformStore = defineStore('platform', () => {
|
||||
},
|
||||
}
|
||||
})
|
||||
dataSource.value = devopsApi.getLastDataSource()
|
||||
return diagnostics
|
||||
}
|
||||
|
||||
async function loadAuditLogs() {
|
||||
@@ -199,6 +212,7 @@ export const usePlatformStore = defineStore('platform', () => {
|
||||
settings,
|
||||
auditLogs,
|
||||
notificationOutbox,
|
||||
projectJenkinsDiagnostics,
|
||||
integrationConfig,
|
||||
releaseProcessXml,
|
||||
projectRefs,
|
||||
|
||||
Reference in New Issue
Block a user