diff --git a/ui/src/api/config.ts b/ui/src/api/config.ts index 5df606e075..d93353b942 100644 --- a/ui/src/api/config.ts +++ b/ui/src/api/config.ts @@ -675,3 +675,23 @@ export const createVersionNameCheck = (bizId: string, appId: number, name: strin */ export const importConfigFromTemplate = (bizId: string, appId: number, query: any) => http.post(`/config/biz/${bizId}/apps/${appId}/template_bindings/import_template_set`, query); + +/** + * 批量恢复kv配置项 + * @param bizId 业务ID + * @param appId 应用ID + * @param ids 恢复的id列表 + * @returns + */ +export const batchUndeleteKv = (bizId: string, appId: number, keys: string[], exclusion_operation: boolean) => + http.post(`config/biz/${bizId}/apps/${appId}/kvs/batch_undelete`, { keys, exclusion_operation }); + +/** + * 批量恢复服务型配置项 + * @param bizId 业务ID + * @param appId 应用ID + * @param ids 恢复的id列表 + * @returns + */ +export const batchUndeleteFile = (bizId: string, appId: number, ids: number[]) => + http.post(`config/biz_id/${bizId}/app_id/${appId}/config_items/batch_undelete`, { ids }); diff --git a/ui/src/i18n/en-us.ts b/ui/src/i18n/en-us.ts index 6224fa74e6..4976b07f25 100644 --- a/ui/src/i18n/en-us.ts +++ b/ui/src/i18n/en-us.ts @@ -528,6 +528,13 @@ export default { '为确保最佳用户体验,此服务的配置文件数量限制为 {n} 个。当前已有 {m} 个,还可添加 {p} 个': 'In order to ensure the best user experience, the number of config files for this service is limited to {n}. There are currently {m} and you can add {p} more', '为确保最佳用户体验,此服务的配置项数量限制为 {n} 个。当前已有 {m} 个,还可添加 {p} 个': 'In order to ensure the best user experience, the number of config items for this service is limited to {n}. There are currently {m} and you can add {p} more', '为确保最佳用户体验,此服务的模板文件数量限制为 {n} 个。当前已有 {m} 个,还可添加 {p} 个': 'In order to ensure the best user experience, the number of template files for this service is limited to {n}. There are currently {m} and you can add {p} more', + 批量恢复: 'Batch restore', + 批量恢复配置文件成功: 'Batch restore configuration file successfully', + 批量恢复配置项成功: 'Batch restore configuration item successfully', + '确认恢复所选的 {n} 个配置文件?': 'Confirm to restore the selected {n} configuration files?', + '确认恢复所选的 {n} 个配置项?': 'Confirm to restore the selected {n} configuration items?', + '如果所选待恢复的配置文件已存在,那么现有配置文件将被覆盖。': 'If the selected configuration file to be restored already exists, the existing configuration file will be overwritten.', + '如果所选待恢复的配置项已存在,那么现有配置项将被覆盖。': 'If the selected configuration item to be restored already exists, the existing configuration item will be overwritten.', // 分组管理 新增分组: 'New group', diff --git a/ui/src/i18n/zh-cn.ts b/ui/src/i18n/zh-cn.ts index e8e576cf68..ac03f9b8a1 100644 --- a/ui/src/i18n/zh-cn.ts +++ b/ui/src/i18n/zh-cn.ts @@ -525,6 +525,13 @@ export default { '为确保最佳用户体验,此服务的配置文件数量限制为 {n} 个。当前已有 {m} 个,还可添加 {p} 个': '为确保最佳用户体验,此服务的配置文件数量限制为 {n} 个。当前已有 {m} 个,还可添加 {p} 个', '为确保最佳用户体验,此服务的配置项数量限制为 {n} 个。当前已有 {m} 个,还可添加 {p} 个': '为确保最佳用户体验,此服务的配置项数量限制为 {n} 个。当前已有 {m} 个,还可添加 {p} 个', '为确保最佳用户体验,此服务的模板文件数量限制为 {n} 个。当前已有 {m} 个,还可添加 {p} 个': '为确保最佳用户体验,此服务的模板文件数量限制为 {n} 个。当前已有 {m} 个,还可添加 {p} 个', + 批量恢复: '批量恢复', + 批量恢复配置文件成功: '批量恢复配置文件成功', + 批量恢复配置项成功: '批量恢复配置项成功', + '确认恢复所选的 {n} 个配置文件?': '确认恢复所选的 {n} 个配置文件?', + '确认恢复所选的 {n} 个配置项?': '确认恢复所选的 {n} 个配置项?', + '如果所选待恢复的配置文件已存在,那么现有配置文件将被覆盖。': '如果所选待恢复的配置文件已存在,那么现有配置文件将被覆盖。', + '如果所选待恢复的配置项已存在,那么现有配置项将被覆盖。': '如果所选待恢复的配置项已存在,那么现有配置项将被覆盖。', // 分组管理 新增分组: '新增分组', diff --git a/ui/src/views/space/service/detail/config/config-list/config-table-list/batch-operation-btn.vue b/ui/src/views/space/service/detail/config/config-list/config-table-list/batch-operation-btn.vue index 2c62be10cf..100e54442d 100644 --- a/ui/src/views/space/service/detail/config/config-list/config-table-list/batch-operation-btn.vue +++ b/ui/src/views/space/service/detail/config/config-list/config-table-list/batch-operation-btn.vue @@ -1,6 +1,5 @@