feat(sj_1.0.0): 告警通知通知类型新增每秒限流阈值、通知状态
This commit is contained in:
parent
17385bc241
commit
12b6a1a09f
@ -703,7 +703,7 @@ const local: App.I18n.Schema = {
|
|||||||
title: '告警通知列表',
|
title: '告警通知列表',
|
||||||
groupName: '组名称',
|
groupName: '组名称',
|
||||||
businessName: '业务ID',
|
businessName: '业务ID',
|
||||||
notifyStatus: '状态',
|
notifyStatus: '通知状态',
|
||||||
notifyType: '通知类型',
|
notifyType: '通知类型',
|
||||||
notifyScene: '通知场景',
|
notifyScene: '通知场景',
|
||||||
notifyThreshold: '通知阈值',
|
notifyThreshold: '通知阈值',
|
||||||
@ -748,7 +748,7 @@ const local: App.I18n.Schema = {
|
|||||||
workflowClientError: '客户端执行失败'
|
workflowClientError: '客户端执行失败'
|
||||||
},
|
},
|
||||||
notifyRecipient: '通知人信息',
|
notifyRecipient: '通知人信息',
|
||||||
rateLimiterStatus: '限流开关',
|
rateLimiterStatus: '限流状态',
|
||||||
rateLimiterThreshold: '每秒限流阈值'
|
rateLimiterThreshold: '每秒限流阈值'
|
||||||
},
|
},
|
||||||
notifyRecipient: {
|
notifyRecipient: {
|
||||||
|
2
src/typings/api.d.ts
vendored
2
src/typings/api.d.ts
vendored
@ -547,7 +547,7 @@ declare namespace Api {
|
|||||||
/** 通知人id */
|
/** 通知人id */
|
||||||
recipientIds: number[];
|
recipientIds: number[];
|
||||||
/** 任务类型 1、重试任务 2、回调任务、3、JOB任务 4、WORKFLOW任务 */
|
/** 任务类型 1、重试任务 2、回调任务、3、JOB任务 4、WORKFLOW任务 */
|
||||||
systemTaskType: SystemTaskType;
|
systemTaskType: SystemTaskType | null;
|
||||||
/** 业务名称 */
|
/** 业务名称 */
|
||||||
businessName?: string;
|
businessName?: string;
|
||||||
/** 状态 */
|
/** 状态 */
|
||||||
|
@ -39,6 +39,10 @@ const workflows = ref<Api.Workflow.Workflow[]>([]);
|
|||||||
|
|
||||||
const props = defineProps<Props>();
|
const props = defineProps<Props>();
|
||||||
|
|
||||||
|
interface Emits {
|
||||||
|
(e: 'update:value', value: Api.NotifyConfig.RetryNotifyScene): void;
|
||||||
|
}
|
||||||
|
|
||||||
interface Emits {
|
interface Emits {
|
||||||
(e: 'submitted'): void;
|
(e: 'submitted'): void;
|
||||||
}
|
}
|
||||||
@ -49,6 +53,10 @@ const visible = defineModel<boolean>('visible', {
|
|||||||
default: false
|
default: false
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const retrySceneDisable = defineModel<boolean>('retrySceneDisable', {
|
||||||
|
default: true
|
||||||
|
});
|
||||||
|
|
||||||
const notifySceneOptions = ref<CommonType.Option<string | number>[]>(translateOptions(retryNotifySceneOptions));
|
const notifySceneOptions = ref<CommonType.Option<string | number>[]>(translateOptions(retryNotifySceneOptions));
|
||||||
|
|
||||||
const { formRef, validate, restoreValidation } = useNaiveForm();
|
const { formRef, validate, restoreValidation } = useNaiveForm();
|
||||||
@ -95,12 +103,12 @@ function createDefaultModel(): Model {
|
|||||||
groupName: '',
|
groupName: '',
|
||||||
businessId: '',
|
businessId: '',
|
||||||
recipientIds: [],
|
recipientIds: [],
|
||||||
systemTaskType: 1,
|
systemTaskType: null,
|
||||||
notifyStatus: 1,
|
notifyStatus: 1,
|
||||||
notifyScene: 1,
|
notifyScene: null,
|
||||||
notifyThreshold: 16,
|
notifyThreshold: 16,
|
||||||
rateLimiterStatus: 0,
|
rateLimiterStatus: 0,
|
||||||
rateLimiterThreshold: null,
|
rateLimiterThreshold: 100,
|
||||||
description: ''
|
description: ''
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -129,6 +137,7 @@ function handleUpdateModelWhenEdit() {
|
|||||||
if (props.operateType === 'edit' && props.rowData) {
|
if (props.operateType === 'edit' && props.rowData) {
|
||||||
Object.assign(model, props.rowData);
|
Object.assign(model, props.rowData);
|
||||||
systemTaskTypeChange(model.systemTaskType);
|
systemTaskTypeChange(model.systemTaskType);
|
||||||
|
retrySceneChange(model.notifyScene);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -201,7 +210,7 @@ async function handleSubmit() {
|
|||||||
emit('submitted');
|
emit('submitted');
|
||||||
}
|
}
|
||||||
|
|
||||||
async function systemTaskTypeChange(value: number) {
|
async function systemTaskTypeChange(value: number | null) {
|
||||||
if (value === 1) {
|
if (value === 1) {
|
||||||
const res = await fetchGetRetrySceneList({ groupName: model.groupName });
|
const res = await fetchGetRetrySceneList({ groupName: model.groupName });
|
||||||
retryScenes.value = res.data as Api.RetryScene.Scene[];
|
retryScenes.value = res.data as Api.RetryScene.Scene[];
|
||||||
@ -231,10 +240,21 @@ async function systemTaskTypeChange(value: number) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function retrySceneChange(
|
||||||
|
value:
|
||||||
|
| Api.NotifyConfig.JobNotifyScene
|
||||||
|
| Api.NotifyConfig.RetryNotifyScene
|
||||||
|
| Api.NotifyConfig.WorkflowNotifyScene
|
||||||
|
| null
|
||||||
|
) {
|
||||||
|
retrySceneDisable.value = !(value === 5 || value === 6);
|
||||||
|
}
|
||||||
|
|
||||||
function groupNameUpdate(groupName: string) {
|
function groupNameUpdate(groupName: string) {
|
||||||
handleUpdateModelWhenEdit();
|
handleUpdateModelWhenEdit();
|
||||||
model.groupName = groupName;
|
model.groupName = groupName;
|
||||||
systemTaskTypeChange(1);
|
systemTaskTypeChange(1);
|
||||||
|
retrySceneChange(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(visible, () => {
|
watch(visible, () => {
|
||||||
@ -306,8 +326,9 @@ watch(visible, () => {
|
|||||||
<NSelect
|
<NSelect
|
||||||
v-model:value="model.notifyScene"
|
v-model:value="model.notifyScene"
|
||||||
:placeholder="$t('page.notifyConfig.form.notifyScene')"
|
:placeholder="$t('page.notifyConfig.form.notifyScene')"
|
||||||
:options="translateOptions(notifySceneOptions)"
|
:options="notifySceneOptions"
|
||||||
clearable
|
clearable
|
||||||
|
@update:value="retrySceneChange"
|
||||||
/>
|
/>
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
<NFormItem :label="$t('page.notifyConfig.notifyRecipient')" path="recipientIds">
|
<NFormItem :label="$t('page.notifyConfig.notifyRecipient')" path="recipientIds">
|
||||||
@ -320,7 +341,27 @@ watch(visible, () => {
|
|||||||
/>
|
/>
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
<NFormItem :label="$t('page.notifyConfig.rateLimiterStatus')" path="rateLimiterStatus">
|
<NFormItem :label="$t('page.notifyConfig.rateLimiterStatus')" path="rateLimiterStatus">
|
||||||
<NRadioGroup v-model:value="model.rateLimiterStatus" name="rateLimiterStatus" disabled>
|
<NRadioGroup v-model:value="model.rateLimiterStatus" name="rateLimiterStatus" :disabled="retrySceneDisable">
|
||||||
|
<NSpace>
|
||||||
|
<NRadio
|
||||||
|
v-for="item in enableStatusNumberOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:value="item.value"
|
||||||
|
:label="$t(item.label)"
|
||||||
|
/>
|
||||||
|
</NSpace>
|
||||||
|
</NRadioGroup>
|
||||||
|
</NFormItem>
|
||||||
|
<NFormItem :label="$t('page.notifyConfig.rateLimiterThreshold')" path="notifyThreshold">
|
||||||
|
<NInputNumber
|
||||||
|
v-model:value="model.rateLimiterThreshold"
|
||||||
|
:min="1"
|
||||||
|
:placeholder="$t('page.notifyConfig.form.notifyThreshold')"
|
||||||
|
:disabled="retrySceneDisable"
|
||||||
|
/>
|
||||||
|
</NFormItem>
|
||||||
|
<NFormItem :label="$t('page.notifyConfig.notifyStatus')" path="rateLimiterStatus">
|
||||||
|
<NRadioGroup v-model:value="model.notifyStatus" name="rateLimiterStatus">
|
||||||
<NSpace>
|
<NSpace>
|
||||||
<NRadio
|
<NRadio
|
||||||
v-for="item in enableStatusNumberOptions"
|
v-for="item in enableStatusNumberOptions"
|
||||||
@ -336,7 +377,7 @@ watch(visible, () => {
|
|||||||
v-model:value="model.notifyThreshold"
|
v-model:value="model.notifyThreshold"
|
||||||
:min="1"
|
:min="1"
|
||||||
:placeholder="$t('page.notifyConfig.form.notifyThreshold')"
|
:placeholder="$t('page.notifyConfig.form.notifyThreshold')"
|
||||||
disabled
|
:disabled="retrySceneDisable"
|
||||||
/>
|
/>
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
<NFormItem :label="$t('page.notifyConfig.description')" path="description">
|
<NFormItem :label="$t('page.notifyConfig.description')" path="description">
|
||||||
|
Loading…
Reference in New Issue
Block a user