feat: 完善发布运维前端体验

This commit is contained in:
湛兮
2026-06-12 17:53:41 +08:00
parent 3c964b68ed
commit 94649fe604
16 changed files with 428 additions and 277 deletions
+12 -26
View File
@@ -91,6 +91,7 @@ interface BackendProject {
interface BackendDeployRunStep {
id?: string
nodeId?: string
bpmnNodeId?: string
name?: string
status?: BackendRunStatus
@@ -151,13 +152,6 @@ interface BackendJenkinsImportSummary {
}>
}
interface BackendProcessDefinition {
key: 'release'
version: string
xml: string
nodeIds: string[]
}
interface BackendIntegrationConfigItem {
key: IntegrationConfigKey
name: string
@@ -231,7 +225,7 @@ const agentCards: AgentCard[] = [
mode: 'incidentReview',
title: '事故复盘草稿',
description: '基于失败 run、流程耗时、Jenkins 摘要和 Runbook 生成复盘草稿。',
inputScope: ['失败 run', 'BPMN 节点', '脱敏日志片段', 'Runbook'],
inputScope: ['失败 run', '失败节点', '脱敏日志片段', 'Runbook'],
outputPreview: ['时间线', '根因假设', '修复和预防项'],
},
]
@@ -246,12 +240,12 @@ const settings: SystemSetting[] = [
boundary: '前端不写死真实 token,不直接访问 Jenkins/Gitea/LLM。',
},
{
key: 'bpmn',
name: 'BPMN 流程定义',
key: 'pipeline',
name: '发布步骤流转',
status: 'healthy',
owner: '平台流程配置',
contract: 'step.bpmnNodeId 必须和 BPMN XML 节点 id 一致。',
boundary: '前端只展示流程和状态,不推进状态机。',
owner: '后端发布状态机',
contract: 'run.steps 由后端返回,前端只按节点顺序展示状态、耗时和日志摘要。',
boundary: '前端只展示步骤和日志,不推进状态机。',
},
{
key: 'agent',
@@ -539,14 +533,6 @@ export const devopsApi = {
return data
},
async getReleaseProcessXml(): Promise<string> {
const { data } = await http.get<BackendProcessDefinition>(
'/process-definitions/release',
)
lastDataSource = 'backend'
return data.xml
},
async createAgentInvocation(
payload: CreateAgentInvocationPayload,
): Promise<AgentInvocation> {
@@ -1153,14 +1139,14 @@ function sanitizeNotificationOutboxMessage(
}
function toPipelineStep(step: BackendDeployRunStep): PipelineStep {
const bpmnNodeId = step.bpmnNodeId || step.id || 'unknown-step'
const name = step.name || bpmnNodeId
const nodeId = step.nodeId || step.bpmnNodeId || step.id || 'unknown-step'
const name = step.name || nodeId
return {
id: step.id || bpmnNodeId,
bpmnNodeId,
id: step.id || nodeId,
nodeId,
name,
owner: stepOwner(bpmnNodeId),
owner: stepOwner(nodeId),
status: toStepStatus(step.status),
duration: formatDuration(step.startedAt, step.finishedAt, step.status),
summary: step.errorSummary || step.message || name,