diff --git a/src/constants/business.ts b/src/constants/business.ts index af1426c..af9b8d5 100644 --- a/src/constants/business.ts +++ b/src/constants/business.ts @@ -89,12 +89,22 @@ export const groupConfigYesOrNoRecord: Record = { +export const retryStatusTypeRecord: Record = { 0: 'page.retryTask.retryStatusType.retrying', 1: 'page.retryTask.retryStatusType.finished', 2: 'page.retryTask.retryStatusType.maxRetry', 3: 'page.retryTask.retryStatusType.paused' }; +export const retryStatusTypeOptions = transformRecordToNumberOption(retryStatusTypeRecord); + +export const retryTaskStatusTypeRecord: Record = { + 1: 'page.retryTask.retryStatusType.finished', + 2: 'page.retryTask.retryStatusType.maxRetry', + 3: 'page.retryTask.retryStatusType.paused', + 4: 'page.retryTask.retryStatusType.paused', + 5: 'page.retryTask.retryStatusType.paused', + 6: 'page.retryTask.retryStatusType.paused' +}; export const retryTaskStatusTypeOptions = transformRecordToNumberOption(retryTaskStatusTypeRecord); export const retryTaskTypeRecord: Record = { diff --git a/src/locales/langs/en-us.ts b/src/locales/langs/en-us.ts index ddf70bc..9633e30 100644 --- a/src/locales/langs/en-us.ts +++ b/src/locales/langs/en-us.ts @@ -684,6 +684,8 @@ const local: App.I18n.Schema = { retryScene: { title: 'Scene List', detail: 'Scene Detail', + baseConfig: 'Base Config', + cbConfig: 'Callback Config', groupName: 'Group name', sceneName: 'Scene name', notifyName: 'Notify name', @@ -697,9 +699,13 @@ const local: App.I18n.Schema = { updateDt: 'Update time', description: 'Describe', routeKey: 'Routing strategy', + cbStatus: 'Callback status', + cbTriggerType: 'Callback TriggerType', + cbTriggerInterval: 'Callback Trigger Interval', + cbMaxCount: 'Callback Max Count', form: { maxRetryCount: 'Please enter Maximum number of retries', - notifyName: 'Plase enter Notify name', + notifyName: 'Please enter Notify name', triggerInterval: 'Please enter Intervals(s)', groupName: 'Please enter Group name', description: 'Please enter Describe', @@ -709,7 +715,10 @@ const local: App.I18n.Schema = { deadlineRequest: 'Please enter Call chain timeout(ms)', routeKey: 'Please enter Routing strategy', backOff: 'Please enter Backoff strategy', - sceneName2: 'Scene name: 1~64 characters. allowing: digit, letters, underscore or hyphens..' + sceneName2: 'Scene name: 1~64 characters. allowing: digit, letters, underscore or hyphens..', + cbTriggerType: 'Please select the retry trigger time', + cbTriggerInterval: 'Please enter trigger interval', + cbMaxCount: 'Please enter Maximum number of callback', }, addScene: 'Add Scenes', editScene: 'Add Scenes', diff --git a/src/locales/langs/zh-cn.ts b/src/locales/langs/zh-cn.ts index a7d1d1c..1d21d48 100644 --- a/src/locales/langs/zh-cn.ts +++ b/src/locales/langs/zh-cn.ts @@ -692,6 +692,8 @@ const local: App.I18n.Schema = { retryScene: { title: '场景列表', detail: '场景详情', + baseConfig: '基础配置', + cbConfig: '回调配置', groupName: '组名', sceneName: '场景名', notifyName: '告警通知', @@ -705,6 +707,10 @@ const local: App.I18n.Schema = { updateDt: '更新时间', description: '描述', routeKey: '路由策略', + cbStatus: '回调开关', + cbTriggerType: '回调触发类型', + cbTriggerInterval: '回调触发间隔', + cbMaxCount: '最大回调执行次数', form: { notifyName: '请选择告警通知名称', maxRetryCount: '请输入最大重试次数', @@ -717,7 +723,10 @@ const local: App.I18n.Schema = { deadlineRequest: '请输入调用链超时时间(毫秒)', routeKey: '请输入路由策略', backOff: '请输入退避策略', - sceneName2: '场景名称: 仅支持长度为:1~64位字符.格式为:数字、字母、下划线和中横线。' + sceneName2: '场景名称: 仅支持长度为:1~64位字符.格式为:数字、字母、下划线和中横线。', + cbTriggerType: '请选择回调触发类型', + cbTriggerInterval: '请输入触发间隔', + cbMaxCount: '请输入回调次数' }, addScene: '新增场景', editScene: '编辑场景', diff --git a/src/service/api/index.ts b/src/service/api/index.ts index 2693549..3208518 100644 --- a/src/service/api/index.ts +++ b/src/service/api/index.ts @@ -5,7 +5,7 @@ export * from './dashboard'; export * from './namespace'; export * from './notify'; export * from './group'; -export * from './retry-task'; +export * from './retry'; export * from './retry-scene'; export * from './retry-log'; export * from './retry-dead-letter'; diff --git a/src/service/api/retry-log.ts b/src/service/api/retry-log.ts index 456a225..a71d461 100644 --- a/src/service/api/retry-log.ts +++ b/src/service/api/retry-log.ts @@ -1,9 +1,9 @@ import { request } from '../request'; /** get retry log list */ -export function fetchRetryLogPageList(params?: Api.RetryLog.RetryLogSearchParams) { +export function fetchRetryLogPageList(params?: Api.RetryLog.RetryTaskSearchParams) { return request({ - url: '/retry-task-log/list', + url: '/retry-task/list', method: 'get', params }); @@ -12,7 +12,7 @@ export function fetchRetryLogPageList(params?: Api.RetryLog.RetryLogSearchParams /** get retry log list */ export function fetchRetryLogById(id: string) { return request({ - url: `/retry-task-log/${id}`, + url: `/retry-task/${id}`, method: 'get' }); } @@ -20,7 +20,7 @@ export function fetchRetryLogById(id: string) { /** delete retry log */ export function fetchDeleteRetryLog(id: number) { return request({ - url: `/retry-task-log/${id}`, + url: `/retry-task/${id}`, method: 'delete' }); } @@ -28,7 +28,7 @@ export function fetchDeleteRetryLog(id: number) { /** delete retry log */ export function fetchBatchDeleteRetryLog(ids: number[]) { return request({ - url: `/retry-task-log/ids`, + url: `/retry-task/ids`, method: 'delete', data: ids }); diff --git a/src/service/api/retry-task.ts b/src/service/api/retry.ts similarity index 83% rename from src/service/api/retry-task.ts rename to src/service/api/retry.ts index 8a324d3..bedc112 100644 --- a/src/service/api/retry-task.ts +++ b/src/service/api/retry.ts @@ -3,7 +3,7 @@ import { request } from '../request'; /** get retryTask list */ export function fetchGetRetryTaskList(params?: Api.RetryTask.RetryTaskSearchParams) { return request({ - url: '/retry-task/list', + url: '/retry/list', method: 'get', params }); @@ -12,7 +12,7 @@ export function fetchGetRetryTaskList(params?: Api.RetryTask.RetryTaskSearchPara /** get retryTask */ export function fetchGetRetryTaskById(id: string, groupName: string) { return request({ - url: `/retry-task/${id}?groupName=${groupName}`, + url: `/retry/${id}?groupName=${groupName}`, method: 'get' }); } @@ -20,7 +20,7 @@ export function fetchGetRetryTaskById(id: string, groupName: string) { /** add retryTask */ export function fetchAddRetryTask(data: Api.RetryTask.RetryTask) { return request({ - url: '/retry-task', + url: '/retry', method: 'post', data }); @@ -29,7 +29,7 @@ export function fetchAddRetryTask(data: Api.RetryTask.RetryTask) { /** batch add retryTask */ export function fetchBatchAddRetryTask(data: Api.RetryTask.RetryTaskBatchAdd) { return request({ - url: '/retry-task/batch', + url: '/retry/batch', method: 'post', data }); @@ -38,7 +38,7 @@ export function fetchBatchAddRetryTask(data: Api.RetryTask.RetryTaskBatchAdd) { /** edit retryTask */ export function fetchEditRetryTask(data: Api.RetryTask.RetryTask) { return request({ - url: '/retry-task', + url: '/retry', method: 'put', data }); @@ -47,7 +47,7 @@ export function fetchEditRetryTask(data: Api.RetryTask.RetryTask) { /** update retryTask status */ export function fetchUpdateRetryTaskStatus(data: Api.RetryTask.RetryTaskUpdateStatusRequest) { return request({ - url: '/retry-task/status', + url: '/retry/status', method: 'put', data }); @@ -56,7 +56,7 @@ export function fetchUpdateRetryTaskStatus(data: Api.RetryTask.RetryTaskUpdateSt /** manual execute retryTask */ export function fetchExecuteRetryTask(data: Api.RetryTask.ManualTriggerTaskRequestVO) { return request({ - url: '/retry-task/manual/trigger/retry/task', + url: '/retry/manual/trigger/retry/task', method: 'post', data }); @@ -65,7 +65,7 @@ export function fetchExecuteRetryTask(data: Api.RetryTask.ManualTriggerTaskReque /** manual execute callbackTask */ export function fetchExecuteCallbackTask(data: Api.RetryTask.ManualTriggerTaskRequestVO) { return request({ - url: '/retry-task/manual/trigger/callback/task', + url: '/retry/manual/trigger/callback/task', method: 'post', data }); @@ -74,7 +74,7 @@ export function fetchExecuteCallbackTask(data: Api.RetryTask.ManualTriggerTaskRe /** batch delete retryTask */ export function fetchBatchDeleteRetryTask(data: Api.RetryTask.BatchDeleteRetryTaskVO) { return request({ - url: '/retry-task/batch', + url: '/retry/batch', method: 'delete', data }); @@ -83,7 +83,7 @@ export function fetchBatchDeleteRetryTask(data: Api.RetryTask.BatchDeleteRetryTa /** generate retryTask idempotent id */ export function fetchIdempotentIdGenerate(data: Api.RetryTask.GenerateRetryIdempotentIdVO) { return request({ - url: '/retry-task/generate/idempotent-id', + url: '/retry/generate/idempotent-id', method: 'post', data }); diff --git a/src/typings/api.d.ts b/src/typings/api.d.ts index 7bfaf07..35ee742 100644 --- a/src/typings/api.d.ts +++ b/src/typings/api.d.ts @@ -747,6 +747,8 @@ declare namespace Api { type RetryStatusType = 0 | 1 | 2 | 3; + type RetryTaskStatusType = 1 | 2 | 3 | 4 | 5 | 6; + type TaskType = 1 | 2; /** RetryTask */ @@ -818,7 +820,7 @@ declare namespace Api { /** RetryTask search params */ type RetryTaskSearchParams = CommonType.RecordNullable< - Pick & + Pick & CommonSearchParams >; @@ -859,6 +861,14 @@ declare namespace Api { executorTimeout: number; /** 描述 */ description: string; + /** 回调状态 0、不开启 1、开启 */ + cbStatus: EnableStatusNumber; + /** 触发类型 */ + cbTriggerType: BackOff; + /** 回调间隔时间 */ + cbTriggerInterval: string; + /** 回调的最大执行次数 */ + cbMaxCount: number; }>; /** scene search params */ @@ -1214,43 +1224,33 @@ declare namespace Api { * backend api module: "retryLog" */ namespace RetryLog { - import RetryStatusType = Api.RetryTask.RetryStatusType; import TaskType = Api.RetryTask.TaskType; + import RetryTaskStatusType = Api.RetryTask.RetryTaskStatusType; type CommonSearchParams = Pick; /** retryLog */ type RetryLog = Common.CommonRecord<{ /** UniqueId */ - uniqueId: string; + retryId: string; /** 组名称 */ groupName: string; /** 场景名称 */ sceneName: string; /** 重试状态 */ - retryStatus: RetryStatusType; + taskStatus: RetryTaskStatusType; /** 任务类型 */ taskType: TaskType; - /** 幂等id */ - idempotentId: string; - /** 业务编号 */ - bizNo: string; - /** 创建时间 */ - createDt: string; - /** 执行器名称 */ - executorName: string; - /** 执行方法参数 */ - argsStr: string; /** 扩展字段 */ extAttrs?: string; - /** 下次触发时间 */ - nextTriggerAt?: string; - /** 重试次数 */ - retryCount?: number; + /** 客户端信息 */ + clientInfo: string; + /** 失败原因 */ + operationReason: Common.OperationReason; }>; /** retryLog search params */ - type RetryLogSearchParams = CommonType.RecordNullable< - Pick & + type RetryTaskSearchParams = CommonType.RecordNullable< + Pick & CommonSearchParams & { datetimeRange?: [string, string] } >; diff --git a/src/typings/app.d.ts b/src/typings/app.d.ts index db55161..3d274da 100644 --- a/src/typings/app.d.ts +++ b/src/typings/app.d.ts @@ -892,6 +892,8 @@ declare namespace App { retryScene: { title: string; detail: string; + baseConfig: string; + cbConfig: string; groupName: string; sceneName: string; notifyName: string; @@ -905,6 +907,10 @@ declare namespace App { updateDt: string; description: string; routeKey: string; + cbStatus: string; + cbTriggerType: string; + cbTriggerInterval: string; + cbMaxCount: string; form: { notifyName: string; maxRetryCount: string; @@ -918,6 +924,9 @@ declare namespace App { routeKey: string; backOff: string; sceneName2: string; + cbTriggerType: string; + cbTriggerInterval: string; + cbMaxCount: string; }; addScene: string; editScene: string; diff --git a/src/views/group/modules/group-operate-drawer.vue b/src/views/group/modules/group-operate-drawer.vue index 662d698..4238938 100644 --- a/src/views/group/modules/group-operate-drawer.vue +++ b/src/views/group/modules/group-operate-drawer.vue @@ -243,13 +243,13 @@ async function handleCopy(source: string) { - - - + + + + + + + @@ -262,13 +262,13 @@ async function handleCopy(source: string) { - - - + + + + + + + diff --git a/src/views/retry/log/index.vue b/src/views/retry/log/index.vue index a9b183f..7bb429e 100644 --- a/src/views/retry/log/index.vue +++ b/src/views/retry/log/index.vue @@ -17,7 +17,7 @@ const appStore = useAppStore(); const detailData = ref(); /** 详情页可见状态 */ const { bool: detailVisible, setTrue: openDetail } = useBoolean(false); -const retryStatus = history.state.retryStatus; +const taskStatus = history.state.taskStatus; const { columns, columnChecks, data, getData, loading, mobilePagination, searchParams, resetSearchParams } = useTable({ apiFn: fetchRetryLogPageList, @@ -26,35 +26,26 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP size: 10, // if you want to use the searchParams in Form, you need to define the following properties, and the value is null // the value can not be undefined, otherwise the property in Form will not be reactive - uniqueId: null, groupName: null, sceneName: null, - idempotentId: null, - bizNo: null, - retryStatus: null, + taskStatus: null, datetimeRange: monthRangeISO8601() }, searchParams: { - retryStatus + taskStatus }, columns: () => [ { type: 'selection', align: 'center', width: 48, - disabled: row => row.retryStatus === 0 + disabled: row => row.taskStatus === 1 }, { key: 'id', title: $t('common.index'), align: 'center', - width: 64 - }, - { - key: 'uniqueId', - title: $t('page.retryLog.UniqueId'), - align: 'left', - minWidth: 120, + width: 64, render: row => { async function showDetailDrawer() { await loadRetryInfo(row); @@ -63,7 +54,7 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP return ( - {row.uniqueId} + {row.id} ); } @@ -81,17 +72,26 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP minWidth: 120 }, { - key: 'retryStatus', + key: 'taskStatus', title: $t('page.retryLog.retryStatus'), align: 'left', minWidth: 120, render: row => { - if (row.retryStatus === null) { + if (row.taskStatus === null) { return null; } - const label = $t(retryTaskStatusTypeRecord[row.retryStatus!]); + const tagMap: Record = { + 1: 'info', + 2: 'info', + 3: 'info', + 4: 'error', + 5: 'error', + 6: 'error' + }; - return {label}; + const label = $t(retryTaskStatusTypeRecord[row.taskStatus!]); + + return {label}; } }, { @@ -108,18 +108,6 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP return {label}; } }, - { - key: 'idempotentId', - title: $t('page.retryLog.idempotentId'), - align: 'left', - minWidth: 120 - }, - { - key: 'bizNo', - title: $t('page.retryLog.bizNo'), - align: 'left', - minWidth: 120 - }, { key: 'createDt', title: $t('page.retryLog.createDt'), @@ -133,7 +121,7 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP width: 80, render: row => (
- {row.retryStatus === 1 || row.retryStatus === 2 ? ( + {row.taskStatus === 1 || row.taskStatus === 2 ? ( handleDelete(row.id)}> {{ default: () => $t('common.confirmDelete'), diff --git a/src/views/retry/log/modules/retry-log-detail-drawer.vue b/src/views/retry/log/modules/retry-log-detail-drawer.vue index 092803f..9f8143b 100644 --- a/src/views/retry/log/modules/retry-log-detail-drawer.vue +++ b/src/views/retry/log/modules/retry-log-detail-drawer.vue @@ -1,7 +1,7 @@