diff --git a/src/api/ops/alertRecord.ts b/src/api/ops/alertRecord.ts index 6f81872..c993b67 100644 --- a/src/api/ops/alertRecord.ts +++ b/src/api/ops/alertRecord.ts @@ -28,8 +28,6 @@ export const fetchAlertRecordDetail = (id: number) => request.get(`/Alert/v1/rec export const createAlertProcess = (data: { alert_record_id: number action: string // ack / resolve / silence / comment / assign / escalate / close - operator: string - operator_id?: string comment?: string assign_to?: string assign_to_id?: string diff --git a/src/api/ops/incident.ts b/src/api/ops/incident.ts index 92d01e6..dc54f39 100644 --- a/src/api/ops/incident.ts +++ b/src/api/ops/incident.ts @@ -48,5 +48,5 @@ export const fetchIncidentAlerts = (id: number) => request.get(`/Alert/v1/incide export const fetchIncidentTimeline = (id: number) => request.get(`/Alert/v1/incidents/${id}/timeline`) -export const transitionIncident = (id: number, data: { status: string; comment?: string; operator?: string }) => +export const transitionIncident = (id: number, data: { status: string; comment?: string }) => request.post(`/Alert/v1/incidents/${id}/transition`, data) diff --git a/src/views/ops/pages/alert/tackle/components/AckDialog.vue b/src/views/ops/pages/alert/tackle/components/AckDialog.vue index ef0c395..4001883 100644 --- a/src/views/ops/pages/alert/tackle/components/AckDialog.vue +++ b/src/views/ops/pages/alert/tackle/components/AckDialog.vue @@ -59,7 +59,6 @@ const handleOk = async () => { await createAlertProcess({ alert_record_id: props.alertRecordId, action: 'ack', - operator: getCurrentUser(), comment: form.value.comment, metadata: '{}', }) @@ -77,9 +76,4 @@ const handleOk = async () => { const handleCancel = () => { emit('update:visible', false) } - -function getCurrentUser() { - // TODO: 从全局状态获取当前用户 - return 'admin' -} diff --git a/src/views/ops/pages/alert/tackle/components/CommentDialog.vue b/src/views/ops/pages/alert/tackle/components/CommentDialog.vue index 4c72bb3..7347f9a 100644 --- a/src/views/ops/pages/alert/tackle/components/CommentDialog.vue +++ b/src/views/ops/pages/alert/tackle/components/CommentDialog.vue @@ -64,7 +64,6 @@ const handleOk = async () => { await createAlertProcess({ alert_record_id: props.alertRecordId, action: 'comment', - operator: getCurrentUser(), comment: form.value.comment, metadata: '{}', }) @@ -82,9 +81,4 @@ const handleOk = async () => { const handleCancel = () => { emit('update:visible', false) } - -function getCurrentUser() { - // TODO: 从全局状态获取当前用户 - return 'admin' -} diff --git a/src/views/ops/pages/alert/tackle/components/ResolveDialog.vue b/src/views/ops/pages/alert/tackle/components/ResolveDialog.vue index baf6d18..c83c58d 100644 --- a/src/views/ops/pages/alert/tackle/components/ResolveDialog.vue +++ b/src/views/ops/pages/alert/tackle/components/ResolveDialog.vue @@ -69,7 +69,6 @@ const handleOk = async () => { await createAlertProcess({ alert_record_id: props.alertRecordId, action: 'resolve', - operator: getCurrentUser(), comment: form.value.comment, root_cause: form.value.root_cause, solution: form.value.solution, @@ -89,9 +88,4 @@ const handleOk = async () => { const handleCancel = () => { emit('update:visible', false) } - -function getCurrentUser() { - // TODO: 从全局状态获取当前用户 - return 'admin' -} diff --git a/src/views/ops/pages/alert/tackle/components/SilenceDialog.vue b/src/views/ops/pages/alert/tackle/components/SilenceDialog.vue index bd3a7ce..7b56023 100644 --- a/src/views/ops/pages/alert/tackle/components/SilenceDialog.vue +++ b/src/views/ops/pages/alert/tackle/components/SilenceDialog.vue @@ -84,7 +84,6 @@ const handleOk = async () => { await createAlertProcess({ alert_record_id: props.alertRecordId, action: 'silence', - operator: getCurrentUser(), silence_until: silenceUntil, silence_reason: form.value.silence_reason, comment: form.value.comment, @@ -104,9 +103,4 @@ const handleOk = async () => { const handleCancel = () => { emit('update:visible', false) } - -function getCurrentUser() { - // TODO: 从全局状态获取当前用户 - return 'admin' -}