feat(sj_1.3.0-beta1): 重试任务新增任务失败告警
This commit is contained in:
parent
7f4f1cc1ae
commit
771b1d7ee9
@ -51,7 +51,7 @@ export const retryNotifyScene: Record<Api.NotifyConfig.RetryNotifyScene, App.I18
|
||||
2: 'page.notifyConfig.retryNotifyScene.maxRetryError',
|
||||
3: 'page.notifyConfig.retryNotifyScene.clientReportError',
|
||||
4: 'page.notifyConfig.retryNotifyScene.clientComponentError',
|
||||
5: 'page.notifyConfig.retryNotifyScene.retryTaskReachThreshold',
|
||||
5: 'page.notifyConfig.retryNotifyScene.retryTaskFailError',
|
||||
6: 'page.notifyConfig.retryNotifyScene.retryTaskEnterDeadLetter',
|
||||
7: 'page.notifyConfig.retryNotifyScene.retryNoClientNodesError'
|
||||
};
|
||||
|
@ -567,7 +567,7 @@ const local: App.I18n.Schema = {
|
||||
maxRetryError: 'Maximum retry error count reached',
|
||||
clientReportError: 'Client report error',
|
||||
clientComponentError: 'Client component error',
|
||||
retryTaskReachThreshold: 'Retry task reach threshold',
|
||||
retryTaskFailError: 'Retry task fail error',
|
||||
retryTaskEnterDeadLetter: 'Retry task enter dead letter',
|
||||
retryNoClientNodesError: 'Retry task no client node'
|
||||
},
|
||||
|
@ -575,7 +575,7 @@ const local: App.I18n.Schema = {
|
||||
maxRetryError: '场景重试失败数量超过阈值',
|
||||
clientReportError: '客户端上报失败',
|
||||
clientComponentError: '客户端组件异常',
|
||||
retryTaskReachThreshold: '任务重试失败数量超过阈值',
|
||||
retryTaskFailError: '任务重试失败',
|
||||
retryTaskEnterDeadLetter: '任务重试失败进入死信队列',
|
||||
retryNoClientNodesError: '任务重试失败(没有可执行的客户端节点)'
|
||||
},
|
||||
|
2
src/typings/api.d.ts
vendored
2
src/typings/api.d.ts
vendored
@ -610,7 +610,7 @@ declare namespace Api {
|
||||
/** 任务类型 1、重试任务 2、回调任务、 3、JOB任务 4、WORKFLOW任务 */
|
||||
type SystemTaskType = 1 | 3 | 4;
|
||||
|
||||
/** 1、场景重试数量超过阈值 2、场景重试失败数量超过阈值 3、客户端上报失败 4、客户端组件异常 5、任务重试失败数量超过阈值 6、任务重试失败进入死信队列 7、任务重试失败(没有可执行的客户端节点) */
|
||||
/** 1、场景重试数量超过阈值 2、场景重试失败数量超过阈值 3、客户端上报失败 4、客户端组件异常 5、任务重试失败 6、任务重试失败进入死信队列 7、任务重试失败(没有可执行的客户端节点) */
|
||||
type RetryNotifyScene = 1 | 2 | 3 | 4 | 5 | 6 | 7;
|
||||
|
||||
/** 1、任务执行失败 2、客户端执行失败 3、没有可执行的客户端节点 */
|
||||
|
2
src/typings/app.d.ts
vendored
2
src/typings/app.d.ts
vendored
@ -775,7 +775,7 @@ declare namespace App {
|
||||
maxRetryError: string;
|
||||
clientReportError: string;
|
||||
clientComponentError: string;
|
||||
retryTaskReachThreshold: string;
|
||||
retryTaskFailError: string;
|
||||
retryTaskEnterDeadLetter: string;
|
||||
retryNoClientNodesError: string;
|
||||
};
|
||||
|
@ -53,6 +53,10 @@ const visible = defineModel<boolean>('visible', {
|
||||
default: false
|
||||
});
|
||||
|
||||
const retryNotifyStatusDisable = defineModel<boolean>('retryNotifyStatusDisable', {
|
||||
default: true
|
||||
});
|
||||
|
||||
const retrySceneDisable = defineModel<boolean>('retrySceneDisable', {
|
||||
default: true
|
||||
});
|
||||
@ -107,7 +111,7 @@ function createDefaultModel(): Model {
|
||||
notifyStatus: 1,
|
||||
notifyScene: null,
|
||||
notifyThreshold: 16,
|
||||
rateLimiterStatus: 0,
|
||||
rateLimiterStatus: 1,
|
||||
rateLimiterThreshold: 100,
|
||||
description: ''
|
||||
};
|
||||
@ -140,6 +144,7 @@ function handleUpdateModelWhenEdit() {
|
||||
if (props.operateType === 'add') {
|
||||
Object.assign(model, createDefaultModel());
|
||||
retrySceneDisable.value = true;
|
||||
retryNotifyStatusDisable.value = true;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -239,6 +244,17 @@ async function systemTaskTypeChange(value: number | null) {
|
||||
}) as Api.Workflow.Workflow[];
|
||||
notifySceneOptions.value = translateOptions(workflowNotifySceneOptions);
|
||||
}
|
||||
await retrySceneChange(model.notifyScene);
|
||||
let notifySceneEmpty = false;
|
||||
notifySceneOptions.value.map(i => {
|
||||
if (i.value === model.notifyScene) {
|
||||
notifySceneEmpty = true;
|
||||
}
|
||||
return String(i.value);
|
||||
});
|
||||
if (!notifySceneEmpty) {
|
||||
model.notifyScene = null;
|
||||
}
|
||||
}
|
||||
|
||||
async function retrySceneChange(
|
||||
@ -248,7 +264,14 @@ async function retrySceneChange(
|
||||
| Api.NotifyConfig.WorkflowNotifyScene
|
||||
| null
|
||||
) {
|
||||
retrySceneDisable.value = !(value === 5 || value === 6);
|
||||
retrySceneDisable.value = !(model.systemTaskType === 1 && (value === 1 || value === 2 || value === 5 || value === 6));
|
||||
retryNotifyStatusDisable.value = retrySceneDisable.value;
|
||||
model.notifyStatus = retrySceneDisable.value ? 0 : 1;
|
||||
if (value === 7) {
|
||||
model.notifyThreshold = 0;
|
||||
model.rateLimiterStatus = 1;
|
||||
retrySceneDisable.value = true;
|
||||
}
|
||||
}
|
||||
|
||||
function groupNameUpdate(groupName: string) {
|
||||
@ -303,7 +326,7 @@ watch(visible, () => {
|
||||
<NGrid cols="2 s:1 m:2" responsive="screen" x-gap="20">
|
||||
<NGi>
|
||||
<NFormItem :label="$t('page.notifyConfig.notifyStatus')" path="notifyStatus">
|
||||
<NRadioGroup v-model:value="model.notifyStatus" name="notifyStatus">
|
||||
<NRadioGroup v-model:value="model.notifyStatus" name="notifyStatus" :disabled="retryNotifyStatusDisable">
|
||||
<NSpace>
|
||||
<NRadio
|
||||
v-for="item in enableStatusNumberOptions"
|
||||
|
Loading…
Reference in New Issue
Block a user