From e811fe496ff96ae64e39c6dab32f538a28ea5a38 Mon Sep 17 00:00:00 2001 From: Luo Fan <44999219+luofann@users.noreply.github.com> Date: Mon, 29 Jan 2024 10:27:49 +0800 Subject: [PATCH 1/5] =?UTF-8?q?chore:=20=E5=89=8D=E7=AB=AF=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E4=BC=98=E5=8C=96=20(#2932)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: 开发模式加入eslint校验 # Reviewed, transaction id: 2297 * chore: 更新prettier配置 * chore: 前端代码lint处理 * chore: 前端代码lint处理 * chore: 前端代码lint处理 # Reviewed, transaction id: 2378 * chore: 增加vite构建分析 # Reviewed, transaction id: 2397 --- bcs-services/bcs-bscp/ui/.editorconfig | 8 +- bcs-services/bcs-bscp/ui/.eslintrc | 54 +- bcs-services/bcs-bscp/ui/.prettierignore | 4 + bcs-services/bcs-bscp/ui/.prettierrc | 17 +- bcs-services/bcs-bscp/ui/package.json | 9 +- bcs-services/bcs-bscp/ui/src/App.vue | 68 +- bcs-services/bcs-bscp/ui/src/api/config.ts | 229 +-- .../bcs-bscp/ui/src/api/credentials.ts | 20 +- bcs-services/bcs-bscp/ui/src/api/group.ts | 26 +- bcs-services/bcs-bscp/ui/src/api/index.ts | 74 +- bcs-services/bcs-bscp/ui/src/api/script.ts | 54 +- bcs-services/bcs-bscp/ui/src/api/template.ts | 334 +++-- bcs-services/bcs-bscp/ui/src/api/variable.ts | 39 +- bcs-services/bcs-bscp/ui/src/common/auth.ts | 2 +- .../ui/src/components/code-editor/index.vue | 635 ++++---- .../src/components/delete-confirm-dialog.vue | 44 +- .../bcs-bscp/ui/src/components/diff/file.vue | 234 +-- .../bcs-bscp/ui/src/components/diff/index.vue | 126 +- .../bcs-bscp/ui/src/components/diff/kv.vue | 52 +- .../ui/src/components/diff/navigator.vue | 246 ++-- .../bcs-bscp/ui/src/components/diff/text.vue | 439 +++--- .../ui/src/components/features-dialog.vue | 44 +- .../bcs-bscp/ui/src/components/footer.vue | 26 +- .../bcs-bscp/ui/src/components/head.vue | 738 +++++----- .../ui/src/components/layout-top-bar.vue | 62 +- .../components/permission-input-picker.vue | 265 ++-- .../components/permission/apply-dialog.vue | 213 ++- .../ui/src/components/permission/cursor.css | 2 +- .../ui/src/components/search-input.vue | 53 +- .../table/table-column-with-selection.vue | 8 +- .../ui/src/components/table/table-empty.vue | 66 +- .../ui/src/components/version-log.vue | 162 ++- .../bcs-bscp/ui/src/constants/config.ts | 2 +- .../bcs-bscp/ui/src/constants/group.ts | 2 +- bcs-services/bcs-bscp/ui/src/css/common.scss | 2 +- bcs-services/bcs-bscp/ui/src/css/font.css | 92 +- .../bcs-bscp/ui/src/css/markdown.scss | 171 ++- bcs-services/bcs-bscp/ui/src/css/style.css | 18 +- bcs-services/bcs-bscp/ui/src/css/style.scss | 2 +- bcs-services/bcs-bscp/ui/src/i18n/index.ts | 1 - bcs-services/bcs-bscp/ui/src/main.ts | 5 +- .../bcs-bscp/ui/src/request/axios.d.ts | 2 +- bcs-services/bcs-bscp/ui/src/request/index.ts | 12 +- bcs-services/bcs-bscp/ui/src/store/global.ts | 2 +- bcs-services/bcs-bscp/ui/src/store/user.ts | 7 +- bcs-services/bcs-bscp/ui/src/types.ts | 26 +- bcs-services/bcs-bscp/ui/src/utils/config.ts | 2 +- .../hooks/use-delete-template-configs.ts | 8 +- .../hooks/use-diff-editor-variable-replace.ts | 9 +- .../hooks/use-editor-variable-replace.ts | 7 +- .../hooks/use-modal-close-confirmation.ts | 27 +- bcs-services/bcs-bscp/ui/src/utils/index.ts | 17 +- bcs-services/bcs-bscp/ui/src/views/404.vue | 10 +- .../ui/src/views/space/apply-perm-page.vue | 69 +- .../associate-config-items/index.vue | 257 ++-- .../matching-result.vue | 40 +- .../associate-config-items/rule-edit.vue | 526 ++++--- .../associate-config-items/rule-view.vue | 81 +- .../view-rule-example.vue | 110 +- .../ui/src/views/space/credentials/index.vue | 1025 +++++++------ .../groups/components/group-edit-form.vue | 394 +++-- .../space/groups/components/rule-tag.vue | 42 +- .../src/views/space/groups/create-group.vue | 159 +- .../ui/src/views/space/groups/edit-group.vue | 201 ++- .../ui/src/views/space/groups/index.vue | 844 +++++------ .../space/groups/services-to-published.vue | 199 ++- .../bcs-bscp/ui/src/views/space/index.vue | 61 +- .../scripts/components/detail-layout.vue | 25 +- .../scripts/components/script-editor.vue | 88 +- .../space/scripts/list/create-script.vue | 259 ++-- .../views/space/scripts/list/script-cited.vue | 198 +-- .../views/space/scripts/list/script-list.vue | 605 ++++---- .../scripts/version-manage/create-version.vue | 178 ++- .../space/scripts/version-manage/index.vue | 623 ++++---- .../version-manage/script-version-diff.vue | 168 ++- .../scripts/version-manage/version-edit.vue | 326 ++--- .../version-list-full-table.vue | 101 +- .../version-list-simple-table.vue | 117 +- .../space/service/detail/client/index.vue | 3 +- .../create-version/create-version-slider.vue | 385 ++--- .../components/create-version/index.vue | 146 +- .../detail/components/detail-header.vue | 459 +++--- .../components/modify-group-publish.vue | 384 +++-- .../publish-version/confirm-dialog.vue | 265 ++-- .../default-group-rules-popover.vue | 21 +- .../components/publish-version/index.vue | 365 +++-- .../publish-version/select-group/group.vue | 161 +- .../publish-version/select-group/index.vue | 232 ++- .../select-group/preview-version-group.vue | 210 +-- .../publish-version/select-group/preview.vue | 237 ++- .../publish-version/select-group/tree.vue | 403 ++--- .../detail/components/service-selector.vue | 346 +++-- .../components/config-content-editor.vue | 178 ++- .../components/kv-config-content-editor.vue | 174 ++- .../config/components/kv-import-editor.vue | 327 ++--- .../config/components/read-file-content.vue | 35 +- .../components/released-group-viewer.vue | 88 +- .../version-diff/aside-menu/configs-kv.vue | 681 +++++---- .../version-diff/aside-menu/configs.vue | 1295 ++++++++--------- .../version-diff/aside-menu/index.vue | 87 +- .../version-diff/aside-menu/menu-list.vue | 35 +- .../version-diff/aside-menu/scripts.vue | 194 +-- .../config/components/version-diff/index.vue | 377 +++-- .../config/components/version-layout.vue | 86 +- .../config-list-kv-with-template.vue | 298 ++-- .../config-list-with-templates.vue | 549 ++++--- .../config-simple-list/config-list.vue | 190 ++- .../config-list/config-simple-list/index.vue | 24 +- .../config-table-list/config-form-kv.vue | 219 ++- .../config-table-list/config-form.vue | 752 +++++----- .../create-config/batch-import-kv.vue | 104 +- .../create-config/batch-upload.vue | 286 ++-- .../create-config/import-from-templates.vue | 449 +++--- .../config-table-list/create-config/index.vue | 234 ++- .../create-config/manual-create-kv.vue | 170 +-- .../create-config/manual-create.vue | 214 ++- .../create-config/pkg-templates-table.vue | 467 +++--- .../create-config/pkg-tree.vue | 333 ++--- .../config-table-list/edit-config-kv.vue | 167 ++- .../config-table-list/edit-config.vue | 269 ++-- .../config-list/config-table-list/index.vue | 144 +- .../replace-template-version.vue | 209 ++- .../config-table-list/tables/status-tag.ts | 22 +- .../tables/table-with-kv.vue | 469 +++--- .../tables/table-with-pagination.vue | 235 ++- .../tables/table-with-templates.vue | 993 +++++++------ .../variables/edit-variables.vue | 232 +-- .../variables/reset-default-value.vue | 93 +- .../variables/variables-table.vue | 341 ++--- .../variables/view-variables.vue | 70 +- .../config-table-list/view-config-kv.vue | 104 +- .../config-table-list/view-config.vue | 319 ++-- .../detail/config/config-list/index.vue | 13 +- .../space/service/detail/config/index.vue | 24 +- .../config/version-list-aside/index.vue | 13 +- .../version-operate-confirm-dialog.vue | 62 +- .../version-simple-list.vue | 573 ++++---- .../version-list-aside/version-table-list.vue | 610 ++++---- .../src/views/space/service/detail/index.vue | 314 ++-- .../service/detail/init-script/index.vue | 422 +++--- .../detail/init-script/script-selector.vue | 171 ++- .../space/service/list/components/card.vue | 326 ++--- .../list/components/create-service.vue | 302 ++-- .../service/list/components/edit-service.vue | 352 ++--- .../service/list/components/service-form.vue | 132 +- .../list/components/service-list-content.vue | 554 ++++--- .../ui/src/views/space/service/list/index.vue | 137 +- .../templates/list/components/link-to-app.vue | 27 +- .../list/components/packages-tag.vue | 109 +- .../src/views/space/templates/list/index.vue | 118 +- .../package-detail/apps-bound-by-template.vue | 229 ++- .../templates/list/package-detail/index.vue | 270 ++-- .../operations/add-configs/add-button.vue | 197 +-- .../add-from-existing-configs/index.vue | 405 +++--- .../package-table.vue | 254 ++-- .../add-configs/create-new-config/index.vue | 213 ++- .../create-new-config/select-package.vue | 384 ++--- .../import-configs/config-table.vue | 738 +++++----- .../add-configs/import-configs/index.vue | 293 ++-- .../import-configs/select-package.vue | 378 ++--- .../operations/add-to-pkgs/add-to-button.vue | 22 +- .../operations/add-to-pkgs/add-to-dialog.vue | 319 ++-- .../operations/config-cited/cited.vue | 80 +- .../delete-configs/delete-button.vue | 57 +- .../delete-configs/delete-config-dialog.vue | 118 +- .../operations/edit-config/edit-config.vue | 74 +- .../batch-move-out-button.vue | 48 +- .../batch-move-out-from-pkg-dialog.vue | 213 ++- .../move-out-from-pkgs-dialog.vue | 350 +++-- .../tables/common-config-table.vue | 597 ++++---- .../package-detail/tables/config-in-all.vue | 67 +- .../tables/config-in-package.vue | 79 +- .../tables/config-without-package.vue | 109 +- .../list/package-detail/use-package-apps.vue | 304 ++-- .../templates/list/package-menu/item.vue | 205 ++- .../templates/list/package-menu/menu.vue | 518 ++++--- .../list/package-menu/package-clone.vue | 167 +-- .../list/package-menu/package-create.vue | 163 ++- .../list/package-menu/package-delete.vue | 213 +-- .../list/package-menu/package-edit.vue | 179 +-- .../list/package-menu/package-form.vue | 204 +-- .../space/templates/list/space/create.vue | 115 +- .../space/templates/list/space/delete.vue | 7 +- .../views/space/templates/list/space/edit.vue | 131 +- .../space/templates/list/space/selector.vue | 534 +++---- .../space/templates/version-manage/index.vue | 433 +++--- .../version-manage/template-version-diff.vue | 264 ++-- .../version-bound-by-apps-detail.vue | 233 ++- .../create-version-confirm-dialog.vue | 212 ++- .../version-manage/version-detail/list.vue | 59 +- .../version-detail/version-detail-table.vue | 141 +- .../version-detail/version-editor.vue | 664 ++++----- .../version-manage/version-full-table.vue | 136 +- .../views/space/variables/editing-form.vue | 180 +-- .../ui/src/views/space/variables/index.vue | 298 ++-- .../space/variables/separator-select.vue | 173 ++- .../views/space/variables/variable-create.vue | 181 +-- .../views/space/variables/variable-edit.vue | 183 +-- .../views/space/variables/variable-import.vue | 54 +- .../variables/variables-content-editor.vue | 335 +++-- .../src/views/space/whitelist-apply-page.vue | 10 +- bcs-services/bcs-bscp/ui/static/403.html | 16 +- bcs-services/bcs-bscp/ui/static/config.json | 4 +- .../bcs-bscp/ui/static/login_success.html | 56 +- bcs-services/bcs-bscp/ui/types.d.ts | 18 +- bcs-services/bcs-bscp/ui/types/config.ts | 6 +- bcs-services/bcs-bscp/ui/types/credential.ts | 15 +- bcs-services/bcs-bscp/ui/types/group.ts | 27 +- bcs-services/bcs-bscp/ui/types/index.ts | 11 +- bcs-services/bcs-bscp/ui/types/script.ts | 54 +- bcs-services/bcs-bscp/ui/types/service.ts | 12 +- bcs-services/bcs-bscp/ui/types/template.ts | 18 +- bcs-services/bcs-bscp/ui/types/variable.ts | 3 +- bcs-services/bcs-bscp/ui/vite.config.ts | 23 +- bcs-services/bcs-bscp/ui/yarn.lock | 271 ++-- 215 files changed, 21692 insertions(+), 21494 deletions(-) create mode 100644 bcs-services/bcs-bscp/ui/.prettierignore diff --git a/bcs-services/bcs-bscp/ui/.editorconfig b/bcs-services/bcs-bscp/ui/.editorconfig index a848a2827a..c71603a031 100644 --- a/bcs-services/bcs-bscp/ui/.editorconfig +++ b/bcs-services/bcs-bscp/ui/.editorconfig @@ -1,9 +1,9 @@ root = true [*.{js,jsx,ts,tsx,vue}] -intent_style = space -indent = 2 -end_of_line = lf charset = utf-8 -trim_trailing_whitespace = true # 不保留行末的空格 +end_of_line = lf +indent_size = 2 +indent_style = space insert_final_newline = true +trim_trailing_whitespace = true # 不保留行末的空格 diff --git a/bcs-services/bcs-bscp/ui/.eslintrc b/bcs-services/bcs-bscp/ui/.eslintrc index b561a6541f..c7149d25f6 100644 --- a/bcs-services/bcs-bscp/ui/.eslintrc +++ b/bcs-services/bcs-bscp/ui/.eslintrc @@ -25,17 +25,11 @@ /** * 要求箭头函数体使用大括号 */ - "arrow-body-style": ["warn", "as-needed"], + "arrow-body-style": ["off", "as-needed"], /** * 要求箭头函数的参数使用圆括号 */ - "arrow-parens": [ - "warn", - "as-needed", - { - "requireForBlockBody": true - } - ], + "arrow-parens": ["warn", "always"], /** * 强制箭头函数的箭头前后使用一致的空格 */ @@ -103,7 +97,7 @@ /** * 强制在函数括号内使用一致的换行 */ - "function-paren-newline": ["warn", "multiline"], + "function-paren-newline": "off", /** * 强制 generator 函数中 * 号周围使用一致的空格 */ @@ -121,7 +115,7 @@ /** * 强制隐式返回的箭头函数体的位置 */ - "implicit-arrow-linebreak": ["warn", "beside"], + "implicit-arrow-linebreak": "off", /** * 使用 2 个空格缩进 */ @@ -208,7 +202,8 @@ "ignoreStrings": true, "ignoreUrls": true, "ignoreRegExpLiterals": true, - "ignoreTemplateLiterals": true + "ignoreTemplateLiterals": true, + "ignoreComments": true } ], /** @@ -221,7 +216,7 @@ * 在编写多个方法链式调用(超过两个方法链式调用)时。 使用前导点,强调这行是一个方法调用,而不是一个语句。 */ "newline-per-chained-call": [ - "warn", + "off", { "ignoreChainWithDepth": 2 } @@ -391,7 +386,6 @@ * 禁止变量申明时用逗号一次申明多个 */ "one-var": ["warn", "never"], - /** * 要求或禁止块内填充 */ @@ -700,8 +694,40 @@ "vue/no-multiple-template-root": "off", "vue/no-v-for-template-key": "off", "vue/no-useless-template-attributes": "off", - "vue/no-deprecated-slot-attribute": "off" + "vue/no-deprecated-slot-attribute": "off", + "vue/attribute-hyphenation": ["error", "always"], + "vue/html-closing-bracket-newline": [ + "error", + { + "singleline": "never", + "multiline": "never" + } + ], + "vue/first-attribute-linebreak": [ + "error", + { + "singleline": "ignore", + "multiline": "below" + } + ], + "vue/script-indent": [ + "error", + 2, + { + "baseIndent": 1, + "switchCase": 1, + "ignores": [] + } + ] }, + "overrides": [ + { + "files": ["*.vue"], + "rules": { + "indent": "off" + } + } + ], "settings": { "import/resolver": { "node": { diff --git a/bcs-services/bcs-bscp/ui/.prettierignore b/bcs-services/bcs-bscp/ui/.prettierignore new file mode 100644 index 0000000000..ad57e529bc --- /dev/null +++ b/bcs-services/bcs-bscp/ui/.prettierignore @@ -0,0 +1,4 @@ +# 忽略国际化文件 + +src/i18n/en-us.ts +src/i18n/zh-cn.ts \ No newline at end of file diff --git a/bcs-services/bcs-bscp/ui/.prettierrc b/bcs-services/bcs-bscp/ui/.prettierrc index 95be97a0a3..d1968d1f7e 100644 --- a/bcs-services/bcs-bscp/ui/.prettierrc +++ b/bcs-services/bcs-bscp/ui/.prettierrc @@ -1,7 +1,16 @@ { - "singleQuote": true, - "useTabs": false, "printWidth": 120, + "tabWidth": 2, + "useTabs": false, "semi": true, - "trailingComma": "es5" -} \ No newline at end of file + "singleQuote": true, + "quoteProps": "as-needed", + "trailingComma": "all", + "arrowParens": "always", + "bracketSpacing": true, + "bracketSameLine": true, + "vueIndentScriptAndStyle": true, + "endOfLine": "lf", + "singleAttributePerLine": false, + "htmlWhitespaceSensitivity": "css" +} diff --git a/bcs-services/bcs-bscp/ui/package.json b/bcs-services/bcs-bscp/ui/package.json index dd02c1d971..3e25bcb778 100644 --- a/bcs-services/bcs-bscp/ui/package.json +++ b/bcs-services/bcs-bscp/ui/package.json @@ -6,7 +6,9 @@ "scripts": { "dev": "vite --force", "build": "vue-tsc --noEmit && vite build", - "preview": "vite preview" + "preview": "vite preview", + "format": "npx prettier ./ --write", + "lint": "npx eslint \"./src/**/*.{js,vue,ts}\"" }, "dependencies": { "@blueking/notice-component": "^2.0.1", @@ -32,8 +34,8 @@ "@babel/eslint-parser": "^7.22.15", "@blueking/eslint-config": "^1.0.6", "@types/axios": "^0.14.0", - "@typescript-eslint/eslint-plugin": "^6.7.3", - "@typescript-eslint/parser": "^6.7.3", + "@typescript-eslint/eslint-plugin": "^5.62.0", + "@typescript-eslint/parser": "^5.62.0", "@vitejs/plugin-basic-ssl": "^1.0.1", "@vitejs/plugin-vue": "^3.0.3", "eslint": "^8.23.0", @@ -42,6 +44,7 @@ "eslint-plugin-prettier": "^5.0.0", "eslint-plugin-vue": "^9.4.0", "prettier": "^3.0.3", + "rollup-plugin-visualizer": "^5.12.0", "typescript": "^4.6.4", "vite": "^3.0.7", "vite-plugin-compression": "^0.5.1", diff --git a/bcs-services/bcs-bscp/ui/src/App.vue b/bcs-services/bcs-bscp/ui/src/App.vue index caf7621044..9adbbee03c 100644 --- a/bcs-services/bcs-bscp/ui/src/App.vue +++ b/bcs-services/bcs-bscp/ui/src/App.vue @@ -10,45 +10,45 @@ diff --git a/bcs-services/bcs-bscp/ui/src/api/config.ts b/bcs-services/bcs-bscp/ui/src/api/config.ts index 1aa4cbd067..8aa55de26f 100644 --- a/bcs-services/bcs-bscp/ui/src/api/config.ts +++ b/bcs-services/bcs-bscp/ui/src/api/config.ts @@ -20,9 +20,10 @@ export const getDefaultConfigScriptData = () => ({ * @param query 查询参数 * @returns */ -export const getConfigList = (biz_id: string, app_id: number, query: ICommonQuery) => http - .get(`/config/biz/${biz_id}/apps/${app_id}/config_items`, { params: { ...query, with_status: true } }) - .then(res => res.data); +export const getConfigList = (biz_id: string, app_id: number, query: ICommonQuery) => + http + .get(`/config/biz/${biz_id}/apps/${app_id}/config_items`, { params: { ...query, with_status: true } }) + .then((res) => res.data); /** * 获取已发布版本的非模板配置文件列表 @@ -32,13 +33,14 @@ export const getConfigList = (biz_id: string, app_id: number, query: ICommonQuer * @param params 查询参数 * @returns */ -export const getReleasedConfigList = (biz_id: string, app_id: number, release_id: number, params: ICommonQuery) => http.get(`/config/biz/${biz_id}/apps/${app_id}/releases/${release_id}/config_items`, { params }).then((res) => { - res.data.details.forEach((item: any) => { - // 接口返回的config_item_id为实际的配置文件id,id字段没有到,统一替换 - item.id = item.config_item_id; +export const getReleasedConfigList = (biz_id: string, app_id: number, release_id: number, params: ICommonQuery) => + http.get(`/config/biz/${biz_id}/apps/${app_id}/releases/${release_id}/config_items`, { params }).then((res) => { + res.data.details.forEach((item: any) => { + // 接口返回的config_item_id为实际的配置文件id,id字段没有到,统一替换 + item.id = item.config_item_id; + }); + return res.data; }); - return res.data; -}); /** * 新增配置 @@ -47,7 +49,8 @@ export const getReleasedConfigList = (biz_id: string, app_id: number, release_id * @param params 配置参数内容 * @returns */ -export const createServiceConfigItem = (app_id: number, biz_id: string, params: IConfigEditParams) => http.post(`/config/create/config_item/config_item/app_id/${app_id}/biz_id/${biz_id}`, params); +export const createServiceConfigItem = (app_id: number, biz_id: string, params: IConfigEditParams) => + http.post(`/config/create/config_item/config_item/app_id/${app_id}/biz_id/${biz_id}`, params); /** * 更新配置 @@ -57,7 +60,8 @@ export const createServiceConfigItem = (app_id: number, biz_id: string, params: * @param params 配置参数内容 * @returns */ -export const updateServiceConfigItem = (id: number, app_id: number, biz_id: string, params: IConfigEditParams) => http.put(`/config/update/config_item/config_item/config_item_id/${id}/app_id/${app_id}/biz_id/${biz_id}`, params); +export const updateServiceConfigItem = (id: number, app_id: number, biz_id: string, params: IConfigEditParams) => + http.put(`/config/update/config_item/config_item/config_item_id/${id}/app_id/${app_id}/biz_id/${biz_id}`, params); /** * 删除配置 @@ -66,7 +70,8 @@ export const updateServiceConfigItem = (id: number, app_id: number, biz_id: stri * @param appId 应用ID * @returns */ -export const deleteServiceConfigItem = (id: number, bizId: string, appId: number) => http.delete(`/config/delete/config_item/config_item/config_item_id/${id}/app_id/${appId}/biz_id/${bizId}`, {}); +export const deleteServiceConfigItem = (id: number, bizId: string, appId: number) => + http.delete(`/config/delete/config_item/config_item/config_item_id/${id}/app_id/${appId}/biz_id/${bizId}`, {}); /** * 获取未命名版本配置文件详情 @@ -75,7 +80,8 @@ export const deleteServiceConfigItem = (id: number, bizId: string, appId: number * @param appId 应用ID * @returns */ -export const getConfigItemDetail = (biz_id: string, id: number, appId: number) => http.get(`/config/biz/${biz_id}/apps/${appId}/config_items/${id}`).then(resp => resp.data); +export const getConfigItemDetail = (biz_id: string, id: number, appId: number) => + http.get(`/config/biz/${biz_id}/apps/${appId}/config_items/${id}`).then((resp) => resp.data); /** * 获取已发布版本配置文件详情 @@ -90,12 +96,13 @@ export const getReleasedConfigItemDetail = ( app_id: number, release_id: number, config_item_id: number, -) => http - .get(`/config/biz/${biz_id}/apps/${app_id}/releases/${release_id}/config_items/${config_item_id}`) - .then((resp) => { - resp.data.config_item.id = resp.data.config_item_id; - return resp.data; - }); +) => + http + .get(`/config/biz/${biz_id}/apps/${app_id}/releases/${release_id}/config_items/${config_item_id}`) + .then((resp) => { + resp.data.config_item.id = resp.data.config_item_id; + return resp.data; + }); /** * 上传配置文件内容 @@ -105,16 +112,17 @@ export const getReleasedConfigItemDetail = ( * @param signature 文件内容的SHA256值 * @returns */ -export const updateConfigContent = (bizId: string, appId: number, data: string | File, signature: string) => http - .put(`/biz/${bizId}/content/upload`, data, { - headers: { - 'X-Bscp-App-Id': appId, - 'X-Bkapi-File-Content-Id': signature, - 'X-Bkapi-File-Content-Overwrite': 'false', - 'Content-Type': 'text/plain', - }, - }) - .then(res => res.data); +export const updateConfigContent = (bizId: string, appId: number, data: string | File, signature: string) => + http + .put(`/biz/${bizId}/content/upload`, data, { + headers: { + 'X-Bscp-App-Id': appId, + 'X-Bkapi-File-Content-Id': signature, + 'X-Bkapi-File-Content-Overwrite': 'false', + 'Content-Type': 'text/plain', + }, + }) + .then((res) => res.data); /** * 下载配置文件内容 @@ -123,17 +131,18 @@ export const updateConfigContent = (bizId: string, appId: number, data: string | * @param signature sha256签名 * @returns */ -export const downloadConfigContent = (bizId: string, appId: number, signature: string) => http - .get(`/biz/${bizId}/content/download`, { - headers: { - 'X-Bscp-Template-Space-Id': appId, - 'X-Bkapi-File-Content-Id': signature, - }, - transitional: { - forcedJSONParsing: false, - }, - }) - .then(res => res); +export const downloadConfigContent = (bizId: string, appId: number, signature: string) => + http + .get(`/biz/${bizId}/content/download`, { + headers: { + 'X-Bscp-Template-Space-Id': appId, + 'X-Bkapi-File-Content-Id': signature, + }, + transitional: { + forcedJSONParsing: false, + }, + }) + .then((res) => res); /** * 创建配置版本 @@ -147,7 +156,8 @@ interface ICreateVersionParams { memo: string; variables: IVariableEditParams[]; } -export const createVersion = (bizId: string, appId: number, params: ICreateVersionParams) => http.post(`/config/create/release/release/app_id/${appId}/biz_id/${bizId}`, params); +export const createVersion = (bizId: string, appId: number, params: ICreateVersionParams) => + http.post(`/config/create/release/release/app_id/${appId}/biz_id/${bizId}`, params); /** * 废弃版本 @@ -156,7 +166,8 @@ export const createVersion = (bizId: string, appId: number, params: ICreateVersi * @param releaseId 版本ID * @returns */ -export const deprecateVersion = (bizId: string, appId: number, releaseId: number) => http.put(`/config/biz/${bizId}/apps/${appId}/releases/${releaseId}/deprecate`); +export const deprecateVersion = (bizId: string, appId: number, releaseId: number) => + http.put(`/config/biz/${bizId}/apps/${appId}/releases/${releaseId}/deprecate`); /** * 恢复版本 @@ -165,7 +176,8 @@ export const deprecateVersion = (bizId: string, appId: number, releaseId: number * @param releaseId 版本ID * @returns */ -export const undeprecateVersion = (bizId: string, appId: number, releaseId: number) => http.put(`/config/biz/${bizId}/apps/${appId}/releases/${releaseId}/undeprecate`); +export const undeprecateVersion = (bizId: string, appId: number, releaseId: number) => + http.put(`/config/biz/${bizId}/apps/${appId}/releases/${releaseId}/undeprecate`); /** * 删除版本 @@ -174,7 +186,8 @@ export const undeprecateVersion = (bizId: string, appId: number, releaseId: numb * @param releaseId 版本ID * @returns */ -export const deleteVersion = (bizId: string, appId: number, releaseId: number) => http.delete(`/config/biz/${bizId}/apps/${appId}/releases/${releaseId}`); +export const deleteVersion = (bizId: string, appId: number, releaseId: number) => + http.delete(`/config/biz/${bizId}/apps/${appId}/releases/${releaseId}`); /** * 获取版本列表 @@ -183,7 +196,8 @@ export const deleteVersion = (bizId: string, appId: number, releaseId: number) = * @param params 查询参数 * @returns */ -export const getConfigVersionList = (bizId: string, appId: number, params: IConfigVersionQueryParams) => http.get(`config/biz/${bizId}/apps/${appId}/releases`, { params }); +export const getConfigVersionList = (bizId: string, appId: number, params: IConfigVersionQueryParams) => + http.get(`config/biz/${bizId}/apps/${appId}/releases`, { params }); /** * 发布版本 @@ -211,20 +225,21 @@ export const publishVersion = ( * @param releaseId 版本ID * @returns */ -export const getConfigScript = (bizId: string, appId: number, releaseId: number) => http.get(`/config/biz/${bizId}/apps/${appId}/releases/${releaseId}/hooks`).then((response) => { - const { pre_hook, post_hook } = response.data; - const data = { - pre_hook: getDefaultConfigScriptData(), - post_hook: getDefaultConfigScriptData(), - }; - if (pre_hook) { - data.pre_hook = pre_hook; - } - if (post_hook) { - data.post_hook = post_hook; - } - return data; -}); +export const getConfigScript = (bizId: string, appId: number, releaseId: number) => + http.get(`/config/biz/${bizId}/apps/${appId}/releases/${releaseId}/hooks`).then((response) => { + const { pre_hook, post_hook } = response.data; + const data = { + pre_hook: getDefaultConfigScriptData(), + post_hook: getDefaultConfigScriptData(), + }; + if (pre_hook) { + data.pre_hook = pre_hook; + } + if (post_hook) { + data.post_hook = post_hook; + } + return data; + }); /** * 更新服务下初始化脚本引用配置 @@ -249,18 +264,20 @@ export const checkAppTemplateBinding = ( bizId: string, appId: number, params: { bindings: ITemplateBoundByAppData[] }, -) => http.post(`/config/biz/${bizId}/apps/${appId}/template_bindings/conflict_check`, params).then((res) => { - const conflictData: { [key: number]: number[] } = {}; - res.data.details.forEach((item: - { template_id: number; template_name: string; template_set_id: number; template_set_name: string }) => { - if (Array.isArray(conflictData[item.template_set_id])) { - conflictData[item.template_set_id].push(item.template_id); - } else { - conflictData[item.template_set_id] = [item.template_id]; - } +) => + http.post(`/config/biz/${bizId}/apps/${appId}/template_bindings/conflict_check`, params).then((res) => { + const conflictData: { [key: number]: number[] } = {}; + res.data.details.forEach( + (item: { template_id: number; template_name: string; template_set_id: number; template_set_name: string }) => { + if (Array.isArray(conflictData[item.template_set_id])) { + conflictData[item.template_set_id].push(item.template_id); + } else { + conflictData[item.template_set_id] = [item.template_id]; + } + }, + ); + return conflictData; }); - return conflictData; -}); /** * 新建模板配置文件和服务绑定关系 @@ -297,9 +314,10 @@ export const updateTemplateConfigPkgs = ( * @param query 查询参数 * @returns */ -export const getBoundTemplates = (bizId: string, appId: number, query: ICommonQuery) => http - .get(`/config/biz/${bizId}/apps/${appId}/template_revisions`, { params: { ...query, with_status: true } }) - .then(res => res.data); +export const getBoundTemplates = (bizId: string, appId: number, query: ICommonQuery) => + http + .get(`/config/biz/${bizId}/apps/${appId}/template_revisions`, { params: { ...query, with_status: true } }) + .then((res) => res.data); /** * 获取服务下已命名版本绑定的模板配置文件列表 @@ -308,10 +326,10 @@ export const getBoundTemplates = (bizId: string, appId: number, query: ICommonQu * @param releaseId * @returns */ -export const getBoundTemplatesByAppVersion = - (bizId: string, appId: number, releaseId: number, params: ICommonQuery) => http +export const getBoundTemplatesByAppVersion = (bizId: string, appId: number, releaseId: number, params: ICommonQuery) => + http .get(`/config/biz/${bizId}/apps/${appId}/releases/${releaseId}/template_revisions`, { params }) - .then(res => res.data); + .then((res) => res.data); /** * 更新服务下模板配置文件版本 @@ -336,9 +354,10 @@ export const updateBoundTemplateVersion = ( * @param template_set_ids 模板套餐ID列表 * @returns */ -export const deleteBoundPkg = (bizId: string, appId: number, bindingId: number, template_set_ids: number[]) => http.delete(`/config/biz/${bizId}/apps/${appId}/template_bindings/${bindingId}/template_sets`, { - params: { template_set_ids: template_set_ids.join(',') }, -}); +export const deleteBoundPkg = (bizId: string, appId: number, bindingId: number, template_set_ids: number[]) => + http.delete(`/config/biz/${bizId}/apps/${appId}/template_bindings/${bindingId}/template_sets`, { + params: { template_set_ids: template_set_ids.join(',') }, + }); /** * 导入非模板配置文件压缩包 @@ -347,13 +366,14 @@ export const deleteBoundPkg = (bizId: string, appId: number, bindingId: number, * @param fill 导入文件 * @returns */ -export const importNonTemplateConfigFile = (biz_id: string, appId: number, fill: any) => http - .post(`/config/biz/${biz_id}/apps/${appId}/config_item/import`, fill, { - headers: { - 'Content-Type': 'application/zip', - }, - }) - .then(res => res.data); +export const importNonTemplateConfigFile = (biz_id: string, appId: number, fill: any) => + http + .post(`/config/biz/${biz_id}/apps/${appId}/config_item/import`, fill, { + headers: { + 'Content-Type': 'application/zip', + }, + }) + .then((res) => res.data); /** * 批量添加非模板配置列表 @@ -363,9 +383,12 @@ export const importNonTemplateConfigFile = (biz_id: string, appId: number, fill: * @param template_set_ids 模板套餐ID列表 * @returns */ -export const batchAddConfigList = (bizId: string, appId: number, list: any) => http.put(`/config/biz/${bizId}/apps/${appId}/config_items`, { - items: list, -}).then(res => res.data); +export const batchAddConfigList = (bizId: string, appId: number, list: any) => + http + .put(`/config/biz/${bizId}/apps/${appId}/config_items`, { + items: list, + }) + .then((res) => res.data); /** * 创建kv @@ -374,8 +397,8 @@ export const batchAddConfigList = (bizId: string, appId: number, list: any) => h * @param kv 配置键值类型 * @returns */ -export const createKv = (bizId: string, appId: number, kv: any) => http.post(`/config/biz/${bizId}/apps/${appId}/kvs`, kv); - +export const createKv = (bizId: string, appId: number, kv: any) => + http.post(`/config/biz/${bizId}/apps/${appId}/kvs`, kv); /** * 获取kv @@ -383,7 +406,8 @@ export const createKv = (bizId: string, appId: number, kv: any) => http.post(`/c * @param appId 应用ID * @returns */ -export const getKvList = (bizId: string, appId: number, query: ICommonQuery) => http.get(`/config/biz/${bizId}/apps/${appId}/kvs`, { params: query }).then(res => res.data); +export const getKvList = (bizId: string, appId: number, query: ICommonQuery) => + http.get(`/config/biz/${bizId}/apps/${appId}/kvs`, { params: query }).then((res) => res.data); /** * 批量上传|更新kv @@ -392,7 +416,8 @@ export const getKvList = (bizId: string, appId: number, query: ICommonQuery) => * @param kvs 上传kv列表 * @returns */ -export const batchUpsertKv = (bizId: string, appId: number, kvs: any) => http.put(`/config/biz/${bizId}/apps/${appId}/kvs`, { kvs }); +export const batchUpsertKv = (bizId: string, appId: number, kvs: any) => + http.put(`/config/biz/${bizId}/apps/${appId}/kvs`, { kvs }); /** * 更新kv @@ -402,7 +427,8 @@ export const batchUpsertKv = (bizId: string, appId: number, kvs: any) => http.pu * @param value 配置值 * @returns */ -export const updateKv = (bizId: string, appId: number, key: string, value: string) => http.put(`/config/biz/${bizId}/apps/${appId}/kvs/${key}`, { value }); +export const updateKv = (bizId: string, appId: number, key: string, value: string) => + http.put(`/config/biz/${bizId}/apps/${appId}/kvs/${key}`, { value }); /** * 删除kv @@ -411,8 +437,8 @@ export const updateKv = (bizId: string, appId: number, key: string, value: strin * @param configId 配置项ID * @returns */ -export const deleteKv = (bizId: string, appId: number, configId: number) => http.delete(`/config/biz/${bizId}/apps/${appId}/kvs/${configId}`); - +export const deleteKv = (bizId: string, appId: number, configId: number) => + http.delete(`/config/biz/${bizId}/apps/${appId}/kvs/${configId}`); /** * 获取已发布kv @@ -422,8 +448,8 @@ export const deleteKv = (bizId: string, appId: number, configId: number) => http * @param key 配置键 * @returns */ -export const getReleaseKv = (bizId: string, appId: number, releaseId: number, key: string) => http.get(`/config/biz/${bizId}/apps/${appId}/releases/${releaseId}/kvs/${key}`).then(res => res.data); - +export const getReleaseKv = (bizId: string, appId: number, releaseId: number, key: string) => + http.get(`/config/biz/${bizId}/apps/${appId}/releases/${releaseId}/kvs/${key}`).then((res) => res.data); /** * 获取已发布kv列表 @@ -432,7 +458,8 @@ export const getReleaseKv = (bizId: string, appId: number, releaseId: number, ke * @param releaseId 版本id * @returns */ -export const getReleaseKvList = (bizId: string, appId: number, releaseId: number, query: ICommonQuery) => http.get(`/config/biz/${bizId}/apps/${appId}/releases/${releaseId}/kvs`, { params: query }).then(res => res.data); +export const getReleaseKvList = (bizId: string, appId: number, releaseId: number, query: ICommonQuery) => + http.get(`/config/biz/${bizId}/apps/${appId}/releases/${releaseId}/kvs`, { params: query }).then((res) => res.data); /** * 撤销删除kv @@ -441,5 +468,5 @@ export const getReleaseKvList = (bizId: string, appId: number, releaseId: number * @param kv 配置键值类型 * @returns */ -export const undeleteKv = (bizId: string, appId: number, key: string) => http.post(`/config/biz/${bizId}/apps/${appId}/kvs/${key}/undelete`); - +export const undeleteKv = (bizId: string, appId: number, key: string) => + http.post(`/config/biz/${bizId}/apps/${appId}/kvs/${key}/undelete`); diff --git a/bcs-services/bcs-bscp/ui/src/api/credentials.ts b/bcs-services/bcs-bscp/ui/src/api/credentials.ts index 115c43a07b..662be4d4fd 100644 --- a/bcs-services/bcs-bscp/ui/src/api/credentials.ts +++ b/bcs-services/bcs-bscp/ui/src/api/credentials.ts @@ -6,14 +6,16 @@ import { IRuleUpdateParams } from '../../types/credential'; * @param biz_id 空间ID * @returns */ -export const createCredential = (biz_id: string, params: { memo: string }) => http.post(`/config/biz_id/${biz_id}/credentials`, params).then(res => res.data); +export const createCredential = (biz_id: string, params: { memo: string }) => + http.post(`/config/biz_id/${biz_id}/credentials`, params).then((res) => res.data); /** * 获取密钥列表 * @param biz_id 空间ID * @returns */ -export const getCredentialList = (biz_id: string, query: { limit: number, start: number, searchKey?: string }) => http.get(`/config/biz_id/${biz_id}/credentials`, { params: query }).then(res => res.data); +export const getCredentialList = (biz_id: string, query: { limit: number; start: number; searchKey?: string }) => + http.get(`/config/biz_id/${biz_id}/credentials`, { params: query }).then((res) => res.data); /** * 删除密钥 @@ -21,14 +23,18 @@ export const getCredentialList = (biz_id: string, query: { limit: number, start: * @param id 密钥ID * @returns */ -export const deleteCredential = (biz_id: string, id: number) => http.delete(`/config/biz_id/${biz_id}/credential`, { params: { id } }).then(res => res.data); +export const deleteCredential = (biz_id: string, id: number) => + http.delete(`/config/biz_id/${biz_id}/credential`, { params: { id } }).then((res) => res.data); /** * 更新密钥 * @param biz_id 空间ID * @returns */ -export const updateCredential = (biz_id: string, params: { id: number; memo?: string; enable?: boolean, name?: string }) => http.put(`/config/biz_id/${biz_id}/credential`, params).then(res => res.data); +export const updateCredential = ( + biz_id: string, + params: { id: number; memo?: string; enable?: boolean; name?: string }, +) => http.put(`/config/biz_id/${biz_id}/credential`, params).then((res) => res.data); /** * 获取密钥关联的配置文件规则 @@ -36,7 +42,8 @@ export const updateCredential = (biz_id: string, params: { id: number; memo?: st * @param credential_id 密钥ID * @returns */ -export const getCredentialScopes = (biz_id: string, credential_id: number) => http.get(`/config/biz_id/${biz_id}/credential/${credential_id}/scopes`).then(res => res.data); +export const getCredentialScopes = (biz_id: string, credential_id: number) => + http.get(`/config/biz_id/${biz_id}/credential/${credential_id}/scopes`).then((res) => res.data); /** * 更新密钥关联的配置文件规则 @@ -44,4 +51,5 @@ export const getCredentialScopes = (biz_id: string, credential_id: number) => ht * @param credential_id 密钥ID * @returns */ -export const updateCredentialScopes = (biz_id: string, credential_id: number, params: IRuleUpdateParams) => http.put(`/config/biz_id/${biz_id}/credential/${credential_id}/scope`, params).then(res => res.data); +export const updateCredentialScopes = (biz_id: string, credential_id: number, params: IRuleUpdateParams) => + http.put(`/config/biz_id/${biz_id}/credential/${credential_id}/scope`, params).then((res) => res.data); diff --git a/bcs-services/bcs-bscp/ui/src/api/group.ts b/bcs-services/bcs-bscp/ui/src/api/group.ts index 8294f374f1..4aa08a815f 100644 --- a/bcs-services/bcs-bscp/ui/src/api/group.ts +++ b/bcs-services/bcs-bscp/ui/src/api/group.ts @@ -8,7 +8,8 @@ import { ICommonQuery } from '../../types/index'; * @param params 查询参数 * @returns */ -export const getGroupCategories = (app_id: number, params: IGroupCategoriesQuery) => http.get(`/config/apps/${app_id}/group_categories`, { params }).then(res => res.data); +export const getGroupCategories = (app_id: number, params: IGroupCategoriesQuery) => + http.get(`/config/apps/${app_id}/group_categories`, { params }).then((res) => res.data); /** * 新增分类 @@ -16,7 +17,8 @@ export const getGroupCategories = (app_id: number, params: IGroupCategoriesQuery * @param name 分类名称 * @returns */ -export const createCategory = (app_id: number, name: string) => http.post(`/config/apps/${app_id}/group_categories`, { name }).then(res => res.data); +export const createCategory = (app_id: number, name: string) => + http.post(`/config/apps/${app_id}/group_categories`, { name }).then((res) => res.data); /** * 删除分类 @@ -24,7 +26,8 @@ export const createCategory = (app_id: number, name: string) => http.post(`/conf * @param group_category_id 分类ID * @returns */ -export const delCategory = (app_id: number, group_category_id: number) => http.delete(`/config/apps/${app_id}/groups/${group_category_id}`).then(res => res.data); +export const delCategory = (app_id: number, group_category_id: number) => + http.delete(`/config/apps/${app_id}/groups/${group_category_id}`).then((res) => res.data); /** * 获取服务下分组列表 @@ -32,14 +35,15 @@ export const delCategory = (app_id: number, group_category_id: number) => http.d * @param app_id 应用ID * @returns */ -export const getServiceGroupList = (biz_id: string, app_id: number) => http.get(`/config/biz/${biz_id}/apps/${app_id}/groups`).then(res => res.data); +export const getServiceGroupList = (biz_id: string, app_id: number) => + http.get(`/config/biz/${biz_id}/apps/${app_id}/groups`).then((res) => res.data); /** * 获取空间下分组 * @param biz_id 空间ID * @returns */ -export const getSpaceGroupList = (biz_id: string) => http.get(`/config/biz/${biz_id}/groups`).then(res => res.data); +export const getSpaceGroupList = (biz_id: string) => http.get(`/config/biz/${biz_id}/groups`).then((res) => res.data); /** * 新增分组 @@ -47,7 +51,8 @@ export const getSpaceGroupList = (biz_id: string) => http.get(`/config/biz/${biz * @param params 分组编辑参数 * @returns */ -export const createGroup = (biz_id: string, params: IGroupEditArg) => http.post(`/config/biz/${biz_id}/groups`, params).then(res => res.data); +export const createGroup = (biz_id: string, params: IGroupEditArg) => + http.post(`/config/biz/${biz_id}/groups`, params).then((res) => res.data); /** * 编辑分组 @@ -56,7 +61,8 @@ export const createGroup = (biz_id: string, params: IGroupEditArg) => http.post( * @param params 分组编辑参数 * @returns */ -export const updateGroup = (biz_id: string, group_id: number, params: IGroupEditArg) => http.put(`/config/biz/${biz_id}/groups/${group_id}`, params).then(res => res.data); +export const updateGroup = (biz_id: string, group_id: number, params: IGroupEditArg) => + http.put(`/config/biz/${biz_id}/groups/${group_id}`, params).then((res) => res.data); /** * 删除分组 @@ -64,7 +70,8 @@ export const updateGroup = (biz_id: string, group_id: number, params: IGroupEdit * @param group_id 分组ID * @returns */ -export const deleteGroup = (biz_id: string, group_id: number) => http.delete(`/config/biz/${biz_id}/groups/${group_id}`); +export const deleteGroup = (biz_id: string, group_id: number) => + http.delete(`/config/biz/${biz_id}/groups/${group_id}`); /** * 获取分组已上线服务 @@ -73,4 +80,5 @@ export const deleteGroup = (biz_id: string, group_id: number) => http.delete(`/c * @param params 查询参数 * @returns */ -export const getGroupReleasedApps = (biz_id: string, group_id: number, params: ICommonQuery) => http.get(`/config/biz/${biz_id}/groups/${group_id}/released_apps`, { params }).then(res => res.data); +export const getGroupReleasedApps = (biz_id: string, group_id: number, params: ICommonQuery) => + http.get(`/config/biz/${biz_id}/groups/${group_id}/released_apps`, { params }).then((res) => res.data); diff --git a/bcs-services/bcs-bscp/ui/src/api/index.ts b/bcs-services/bcs-bscp/ui/src/api/index.ts index 2038769150..7e8df15238 100644 --- a/bcs-services/bcs-bscp/ui/src/api/index.ts +++ b/bcs-services/bcs-bscp/ui/src/api/index.ts @@ -2,7 +2,6 @@ import http from '../request'; import { ISpaceDetail, IPermissionQueryResourceItem } from '../../types/index'; import { IAppItem, IAppListQuery } from '../../types/app'; - /** * 获取空间、项目列表 * @param biz_id 业务ID @@ -10,29 +9,31 @@ import { IAppItem, IAppListQuery } from '../../types/app'; * @returns */ -export const getSpaceList = () => http.get('auth/user/spaces').then((resp) => { - const permissioned: ISpaceDetail[] = []; - const noPermissions: ISpaceDetail[] = []; - resp.data.items.forEach((item: ISpaceDetail) => { - const { space_id } = item; - // @ts-ignore - item.permission = resp.web_annotations.perms[space_id].find_business_resource; - if (item.permission) { - permissioned.push(item); - } else { - noPermissions.push(item); - } +export const getSpaceList = () => + http.get('auth/user/spaces').then((resp) => { + const permissioned: ISpaceDetail[] = []; + const noPermissions: ISpaceDetail[] = []; + resp.data.items.forEach((item: ISpaceDetail) => { + const { space_id } = item; + // @ts-ignore + item.permission = resp.web_annotations.perms[space_id].find_business_resource; + if (item.permission) { + permissioned.push(item); + } else { + noPermissions.push(item); + } + }); + resp.data.items = [...permissioned, ...noPermissions]; + return resp.data; }); - resp.data.items = [...permissioned, ...noPermissions]; - return resp.data; -}); /** * 获取业务的特性开关配置 * @param biz 业务ID * @returns */ -export const getSpaceFeatureFlag = (biz: string) => http.get(`feature_flags`, { params: { biz } }).then(resp => resp.data); +export const getSpaceFeatureFlag = (biz: string) => + http.get('feature_flags', { params: { biz } }).then((resp) => resp.data); /** * 获取服务列表 @@ -40,18 +41,20 @@ export const getSpaceFeatureFlag = (biz: string) => http.get(`feature_flags`, { * @param params 查询过滤条件 * @returns */ -export const getAppList = (biz_id: string, params: IAppListQuery = {}) => http.get(`config/list/app/app/biz_id/${biz_id}`, { params }).then((resp) => { - resp.data.details.forEach((item: IAppItem) => { - // @ts-ignore - item.permissions = resp.web_annotations.perms[item.id] || {}; +export const getAppList = (biz_id: string, params: IAppListQuery = {}) => + http.get(`config/list/app/app/biz_id/${biz_id}`, { params }).then((resp) => { + resp.data.details.forEach((item: IAppItem) => { + // @ts-ignore + item.permissions = resp.web_annotations.perms[item.id] || {}; + }); + return resp.data; }); - return resp.data; -}); /** * 获取服务下配置文件数量、更新时间等信息 */ -export const getAppsConfigData = (biz_id: string, app_id: number[]) => http.post(`/config/config_item_count/biz_id/${biz_id}`, { biz_id, app_id }).then(resp => resp.data); +export const getAppsConfigData = (biz_id: string, app_id: number[]) => + http.post(`/config/config_item_count/biz_id/${biz_id}`, { biz_id, app_id }).then((resp) => resp.data); /** * 获取服务详情 @@ -59,7 +62,8 @@ export const getAppsConfigData = (biz_id: string, app_id: number[]) => http.post * @param app_id 服务ID * @returns */ -export const getAppDetail = (biz_id: string, app_id: number) => http.get(`config/biz/${biz_id}/apps/${app_id}`).then(resp => resp.data); +export const getAppDetail = (biz_id: string, app_id: number) => + http.get(`config/biz/${biz_id}/apps/${app_id}`).then((resp) => resp.data); /** * 删除服务 @@ -67,7 +71,8 @@ export const getAppDetail = (biz_id: string, app_id: number) => http.get(`config * @param biz_id 业务ID * @returns */ -export const deleteApp = (id: number, biz_id: number) => http.delete(`config/delete/app/app/app_id/${id}/biz_id/${biz_id}`); +export const deleteApp = (id: number, biz_id: number) => + http.delete(`config/delete/app/app/app_id/${id}/biz_id/${biz_id}`); /** * 创建服务 @@ -75,7 +80,8 @@ export const deleteApp = (id: number, biz_id: number) => http.delete(`config/del * @param params * @returns */ -export const createApp = (biz_id: string, params: any) => http.post(`config/create/app/app/biz_id/${biz_id}`, { biz_id, ...params }).then(resp => resp.data); +export const createApp = (biz_id: string, params: any) => + http.post(`config/create/app/app/biz_id/${biz_id}`, { biz_id, ...params }).then((resp) => resp.data); /** * 更新服务 @@ -84,25 +90,27 @@ export const createApp = (biz_id: string, params: any) => http.post(`config/crea */ export const updateApp = (params: any) => { const { id, biz_id, data } = params; - return http.put(`config/update/app/app/app_id/${id}/biz_id/${biz_id}`, data).then(resp => resp.data); + return http.put(`config/update/app/app/app_id/${id}/biz_id/${biz_id}`, data).then((resp) => resp.data); }; /** * 查询资源权限以及返回权限申请链接 * @param params IPermissionQueryResourceItem 查询参数 */ -export const permissionCheck = (params: { resources: IPermissionQueryResourceItem[] }) => http.post('/auth/iam/permission/check', params).then(resp => resp.data); +export const permissionCheck = (params: { resources: IPermissionQueryResourceItem[] }) => + http.post('/auth/iam/permission/check', params).then((resp) => resp.data); /** * 获取消息通知信息 * @returns */ -export const getNotice = () => http.get('/announcements').then(resp => resp.data); +export const getNotice = () => http.get('/announcements').then((resp) => resp.data); /** * 退出登录 * @returns */ -export const loginOut = () => http.get('/logout').then((resp) => { - window.location.href = resp.data.login_url + window.location.href; -}); +export const loginOut = () => + http.get('/logout').then((resp) => { + window.location.href = resp.data.login_url + window.location.href; + }); diff --git a/bcs-services/bcs-bscp/ui/src/api/script.ts b/bcs-services/bcs-bscp/ui/src/api/script.ts index 32232938b0..94d9833889 100644 --- a/bcs-services/bcs-bscp/ui/src/api/script.ts +++ b/bcs-services/bcs-bscp/ui/src/api/script.ts @@ -6,7 +6,8 @@ import { IScriptEditingForm, IScriptCiteQuery, IScriptListQuery } from '../../ty * @param biz_id 空间ID * @returns */ -export const createScript = (biz_id: string, params: IScriptEditingForm) => http.post(`/config/biz/${biz_id}/hooks`, params).then(res => res.data); +export const createScript = (biz_id: string, params: IScriptEditingForm) => + http.post(`/config/biz/${biz_id}/hooks`, params).then((res) => res.data); /** * 获取脚本列表 @@ -15,7 +16,8 @@ export const createScript = (biz_id: string, params: IScriptEditingForm) => http * @returns */ -export const getScriptList = (biz_id: string, params: IScriptListQuery) => http.get(`/config/biz/${biz_id}/hooks`, { params }).then(res => res.data); +export const getScriptList = (biz_id: string, params: IScriptListQuery) => + http.get(`/config/biz/${biz_id}/hooks`, { params }).then((res) => res.data); /** * 获取脚本详情 @@ -23,7 +25,8 @@ export const getScriptList = (biz_id: string, params: IScriptListQuery) => http. * @param id 脚本ID * @returns */ -export const getScriptDetail = (biz_id: string, id: number) => http.get(`/config/biz/${biz_id}/hooks/${id}`).then(res => res.data); +export const getScriptDetail = (biz_id: string, id: number) => + http.get(`/config/biz/${biz_id}/hooks/${id}`).then((res) => res.data); /** * 获取脚本某个版本下详情 @@ -32,7 +35,8 @@ export const getScriptDetail = (biz_id: string, id: number) => http.get(`/config * @param release_id 版本ID * @returns */ -export const getScriptVersionDetail = (biz_id: string, id: number, release_id: number) => http.get(`/config/biz/${biz_id}/hooks/${id}/hook_revisions/${release_id}`).then(res => res.data); +export const getScriptVersionDetail = (biz_id: string, id: number, release_id: number) => + http.get(`/config/biz/${biz_id}/hooks/${id}/hook_revisions/${release_id}`).then((res) => res.data); /** * 删除脚本 @@ -40,7 +44,8 @@ export const getScriptVersionDetail = (biz_id: string, id: number, release_id: n * @param id 脚本ID * @returns */ -export const deleteScript = (biz_id: string, id: number) => http.delete(`/config/biz/${biz_id}/hooks/${id}`, { params: { force: true } }).then(res => res.data); +export const deleteScript = (biz_id: string, id: number) => + http.delete(`/config/biz/${biz_id}/hooks/${id}`, { params: { force: true } }).then((res) => res.data); /** * 获取脚本标签列表 @@ -48,7 +53,7 @@ export const deleteScript = (biz_id: string, id: number) => http.delete(`/config * @param params 查询参数 * @returns */ -export const getScriptTagList = (biz_id: string) => http.get(`/config/biz/${biz_id}/hook_tags`).then(res => res.data); +export const getScriptTagList = (biz_id: string) => http.get(`/config/biz/${biz_id}/hook_tags`).then((res) => res.data); /** * 获取脚本版本列表 @@ -57,7 +62,11 @@ export const getScriptTagList = (biz_id: string) => http.get(`/config/biz/${biz_ * @param params 查询参数 * @returns */ -export const getScriptVersionList = (biz_id: string, hook_id: number, params: { start: number; limit?: number; searchKey?: string; all?: boolean }) => http.get(`/config/biz/${biz_id}/hooks/${hook_id}/hook_revisions`, { params }).then(res => res.data); +export const getScriptVersionList = ( + biz_id: string, + hook_id: number, + params: { start: number; limit?: number; searchKey?: string; all?: boolean }, +) => http.get(`/config/biz/${biz_id}/hooks/${hook_id}/hook_revisions`, { params }).then((res) => res.data); /** * 创建脚本版本 @@ -66,7 +75,8 @@ export const getScriptVersionList = (biz_id: string, hook_id: number, params: { * @param params 查询参数 * @returns */ -export const createScriptVersion = (biz_id: string, hook_id: number, params: { memo: string; content: string; }) => http.post(`/config/biz/${biz_id}/hooks/${hook_id}/hook_revisions`, params).then(res => res.data); +export const createScriptVersion = (biz_id: string, hook_id: number, params: { memo: string; content: string }) => + http.post(`/config/biz/${biz_id}/hooks/${hook_id}/hook_revisions`, params).then((res) => res.data); /** * 更新脚本版本 @@ -75,7 +85,12 @@ export const createScriptVersion = (biz_id: string, hook_id: number, params: { m * @param params 查询参数 * @returns */ -export const updateScriptVersion = (biz_id: string, hook_id: number, release_id: number, params: { name: string; memo: string; content: string; }) => http.put(`/config/biz/${biz_id}/hooks/${hook_id}/hook_revisions/${release_id}`, params).then(res => res.data); +export const updateScriptVersion = ( + biz_id: string, + hook_id: number, + release_id: number, + params: { name: string; memo: string; content: string }, +) => http.put(`/config/biz/${biz_id}/hooks/${hook_id}/hook_revisions/${release_id}`, params).then((res) => res.data); /** * 删除脚本版本 @@ -84,7 +99,10 @@ export const updateScriptVersion = (biz_id: string, hook_id: number, release_id: * @param release_id 版本ID * @returns */ -export const deleteScriptVersion = (biz_id: string, hook_id: number, release_id: number) => http.delete(`/config/biz/${biz_id}/hooks/${hook_id}/hook_revisions/${release_id}`, { params: { force: true } }).then(res => res.data); +export const deleteScriptVersion = (biz_id: string, hook_id: number, release_id: number) => + http + .delete(`/config/biz/${biz_id}/hooks/${hook_id}/hook_revisions/${release_id}`, { params: { force: true } }) + .then((res) => res.data); /** * 上线版本 @@ -93,7 +111,8 @@ export const deleteScriptVersion = (biz_id: string, hook_id: number, release_id: * @param release_id 版本ID * @returns */ -export const publishVersion = (biz_id: string, hook_id: number, release_id: number) => http.put(`/config/biz/${biz_id}/hooks/${hook_id}/hook_revisions/${release_id}/publish`).then(res => res.data); +export const publishVersion = (biz_id: string, hook_id: number, release_id: number) => + http.put(`/config/biz/${biz_id}/hooks/${hook_id}/hook_revisions/${release_id}/publish`).then((res) => res.data); /** * 获取脚本被引用列表 @@ -102,7 +121,8 @@ export const publishVersion = (biz_id: string, hook_id: number, release_id: numb * @param params 查询参数 * @returns */ -export const getScriptCiteList = (biz_id: string, hook_id: number, params: IScriptCiteQuery) => http.get(`/config/biz/${biz_id}/hooks/${hook_id}/references`, { params }).then(res => res.data); +export const getScriptCiteList = (biz_id: string, hook_id: number, params: IScriptCiteQuery) => + http.get(`/config/biz/${biz_id}/hooks/${hook_id}/references`, { params }).then((res) => res.data); /** * 获取脚本某个版本被引用列表 @@ -112,7 +132,15 @@ export const getScriptCiteList = (biz_id: string, hook_id: number, params: IScri * @param params 查询参数 * @returns */ -export const getScriptVersionCiteList = (biz_id: string, hook_id: number, version_id: number, params: IScriptCiteQuery) => http.get(`/config/biz/${biz_id}/hooks/${hook_id}/hook_revisions/${version_id}/references`, { params }).then(res => res.data); +export const getScriptVersionCiteList = ( + biz_id: string, + hook_id: number, + version_id: number, + params: IScriptCiteQuery, +) => + http + .get(`/config/biz/${biz_id}/hooks/${hook_id}/hook_revisions/${version_id}/references`, { params }) + .then((res) => res.data); // // 获取配置文件版本下的初始化脚本配置 // export const getConfigScript = (biz_id: string, app_id: number, release_id: number) => { diff --git a/bcs-services/bcs-bscp/ui/src/api/template.ts b/bcs-services/bcs-bscp/ui/src/api/template.ts index 5a5dceb009..a184412b9d 100644 --- a/bcs-services/bcs-bscp/ui/src/api/template.ts +++ b/bcs-services/bcs-bscp/ui/src/api/template.ts @@ -9,7 +9,8 @@ import { IConfigEditParams } from '../../types/config'; * @param params 查询参数 * @returns */ -export const getTemplateSpaceList = (biz_id: string, params: ICommonQuery) => http.get(`/config/biz/${biz_id}/template_spaces`, { params }).then(res => res.data); +export const getTemplateSpaceList = (biz_id: string, params: ICommonQuery) => + http.get(`/config/biz/${biz_id}/template_spaces`, { params }).then((res) => res.data); /** * 创建模板空间 @@ -17,7 +18,8 @@ export const getTemplateSpaceList = (biz_id: string, params: ICommonQuery) => ht * @param params 创建模板参数 * @returns */ -export const createTemplateSpace = (biz_id: string, params: { name: string; memo: string }) => http.post(`/config/biz/${biz_id}/template_spaces`, params).then(res => res.data); +export const createTemplateSpace = (biz_id: string, params: { name: string; memo: string }) => + http.post(`/config/biz/${biz_id}/template_spaces`, params).then((res) => res.data); /** * 更新模板空间 @@ -26,7 +28,8 @@ export const createTemplateSpace = (biz_id: string, params: { name: string; memo * @param params 模板参数 * @returns */ -export const updateTemplateSpace = (biz_id: string, id: number, params: { memo: string }) => http.put(`/config/biz/${biz_id}/template_spaces/${id}`, params).then(res => res.data); +export const updateTemplateSpace = (biz_id: string, id: number, params: { memo: string }) => + http.put(`/config/biz/${biz_id}/template_spaces/${id}`, params).then((res) => res.data); /** * 删除模板空间 @@ -34,7 +37,8 @@ export const updateTemplateSpace = (biz_id: string, id: number, params: { memo: * @param id 模板ID * @returns */ -export const deleteTemplateSpace = (biz_id: string, id: number) => http.delete(`/config/biz/${biz_id}/template_spaces/${id}`); +export const deleteTemplateSpace = (biz_id: string, id: number) => + http.delete(`/config/biz/${biz_id}/template_spaces/${id}`); /** * 创建模板套餐 @@ -43,7 +47,8 @@ export const deleteTemplateSpace = (biz_id: string, id: number) => http.delete(` * @param params 创建模板套餐参数 * @returns */ -export const createTemplatePackage = (biz_id: string, template_space_id: number, params: ITemplatePackageEditParams) => http.post(`/config/biz/${biz_id}/template_spaces/${template_space_id}/template_sets`, params).then(res => res.data); +export const createTemplatePackage = (biz_id: string, template_space_id: number, params: ITemplatePackageEditParams) => + http.post(`/config/biz/${biz_id}/template_spaces/${template_space_id}/template_sets`, params).then((res) => res.data); /** * 编辑模板套餐 @@ -58,9 +63,10 @@ export const updateTemplatePackage = ( template_space_id: number, template_set_id: number, params: ITemplatePackageEditParams, -) => http - .put(`/config/biz/${biz_id}/template_spaces/${template_space_id}/template_sets/${template_set_id}`, params) - .then(res => res.data); +) => + http + .put(`/config/biz/${biz_id}/template_spaces/${template_space_id}/template_sets/${template_set_id}`, params) + .then((res) => res.data); /** * 删除模板套餐 @@ -69,11 +75,12 @@ export const updateTemplatePackage = ( * @param template_set_id 模板套餐ID * @returns */ -export const deleteTemplatePackage = (biz_id: string, template_space_id: number, template_set_id: number) => http - .delete(`/config/biz/${biz_id}/template_spaces/${template_space_id}/template_sets/${template_set_id}`, { - params: { force: true }, - }) - .then(res => res.data); +export const deleteTemplatePackage = (biz_id: string, template_space_id: number, template_set_id: number) => + http + .delete(`/config/biz/${biz_id}/template_spaces/${template_space_id}/template_sets/${template_set_id}`, { + params: { force: true }, + }) + .then((res) => res.data); /** * 获取空间下的模板套餐列表 @@ -82,9 +89,10 @@ export const deleteTemplatePackage = (biz_id: string, template_space_id: number, * @param params 查询参数 * @returns */ -export const getTemplatePackageList = (biz_id: string, template_space_id: string, params: ICommonQuery) => http - .get(`/config/biz/${biz_id}/template_spaces/${template_space_id}/template_sets`, { params }) - .then(res => res.data); +export const getTemplatePackageList = (biz_id: string, template_space_id: string, params: ICommonQuery) => + http + .get(`/config/biz/${biz_id}/template_spaces/${template_space_id}/template_sets`, { params }) + .then((res) => res.data); /** * 获取业务下所有模板套餐(按模板空间分组) @@ -92,7 +100,8 @@ export const getTemplatePackageList = (biz_id: string, template_space_id: string * @param params 查询参数,传app_id可筛选服务下的套餐模板 * @returns */ -export const getAllPackagesGroupBySpace = (biz_id: string, params: { app_id?: number }) => http.get(`/config/biz/${biz_id}/template_sets/list_all_of_biz`, { params }).then(res => res.data); +export const getAllPackagesGroupBySpace = (biz_id: string, params: { app_id?: number }) => + http.get(`/config/biz/${biz_id}/template_sets/list_all_of_biz`, { params }).then((res) => res.data); /** * 获取模板空间下的全部配置文件模板列表 @@ -100,7 +109,8 @@ export const getAllPackagesGroupBySpace = (biz_id: string, params: { app_id?: nu * @param template_space_id 模板空间ID * @returns */ -export const getTemplatesBySpaceId = (biz_id: string, template_space_id: number, params: ICommonQuery) => http.get(`/config/biz/${biz_id}/template_spaces/${template_space_id}/templates`, { params }).then(res => res.data); +export const getTemplatesBySpaceId = (biz_id: string, template_space_id: number, params: ICommonQuery) => + http.get(`/config/biz/${biz_id}/template_spaces/${template_space_id}/templates`, { params }).then((res) => res.data); /** * 获取模板空间下未指定套餐的模板列表 @@ -108,10 +118,10 @@ export const getTemplatesBySpaceId = (biz_id: string, template_space_id: number, * @param template_space_id 模板空间ID * @returns */ -export const getTemplatesWithNoSpecifiedPackage = - (biz_id: string, template_space_id: number, params: ICommonQuery) => http +export const getTemplatesWithNoSpecifiedPackage = (biz_id: string, template_space_id: number, params: ICommonQuery) => + http .get(`/config/biz/${biz_id}/template_spaces/${template_space_id}/templates/list_not_bound`, { params }) - .then(res => res.data); + .then((res) => res.data); /** * 获取当前模板套餐被未命名版本引用的服务引用列表 @@ -126,12 +136,13 @@ export const getUnNamedVersionAppsBoundByPackage = ( template_space_id: number, template_set_id: number, params: ICommonQuery, -) => http - .get( - `/config/biz/${biz_id}/template_spaces/${template_space_id}/template_sets/${template_set_id}/bound_unnamed_app_details`, - { params }, - ) - .then(res => res.data); +) => + http + .get( + `/config/biz/${biz_id}/template_spaces/${template_space_id}/template_sets/${template_set_id}/bound_unnamed_app_details`, + { params }, + ) + .then((res) => res.data); /** * 获取多个模板套餐被未命名版本引用的服务引用列表 @@ -144,11 +155,12 @@ export const getUnNamedVersionAppsBoundByPackages = ( template_space_id: number, template_sets: number[], params: ICommonQuery, -) => http - .get(`/config/biz/${biz_id}/template_spaces/${template_space_id}/template_sets/bound_unnamed_app_details`, { - params: { template_set_ids: template_sets.join(','), ...params }, - }) - .then(res => res.data); +) => + http + .get(`/config/biz/${biz_id}/template_spaces/${template_space_id}/template_sets/bound_unnamed_app_details`, { + params: { template_set_ids: template_sets.join(','), ...params }, + }) + .then((res) => res.data); /** * 获取当前模板套餐被已生成版本引用的服务引用列表 @@ -163,12 +175,13 @@ export const getReleasedVersionAppsBoundByPackage = ( template_space_id: number, template_set_id: number, params: ICommonQuery, -) => http - .get( - `/config/biz/${biz_id}/template_spaces/${template_space_id}/template_sets/${template_set_id}/bound_unnamed_app_details`, - { params }, - ) - .then(res => res.data); +) => + http + .get( + `/config/biz/${biz_id}/template_spaces/${template_space_id}/template_sets/${template_set_id}/bound_unnamed_app_details`, + { params }, + ) + .then((res) => res.data); /** * 获取模板套餐下的配置文件模板列表 @@ -181,11 +194,12 @@ export const getTemplatesByPackageId = ( template_space_id: number, template_set_id: number, params: ICommonQuery, -) => http - .get(`/config/biz/${biz_id}/template_spaces/${template_space_id}/template_sets/${template_set_id}/templates`, { - params, - }) - .then(res => res.data); +) => + http + .get(`/config/biz/${biz_id}/template_spaces/${template_space_id}/template_sets/${template_set_id}/templates`, { + params, + }) + .then((res) => res.data); /** * 创建模板 @@ -194,7 +208,8 @@ export const getTemplatesByPackageId = ( * @param params 配置文件参数 * @returns */ -export const createTemplate = (biz_id: string, template_space_id: number, params: IConfigEditParams) => http.post(`/config/biz/${biz_id}/template_spaces/${template_space_id}/templates`, params); +export const createTemplate = (biz_id: string, template_space_id: number, params: IConfigEditParams) => + http.post(`/config/biz/${biz_id}/template_spaces/${template_space_id}/templates`, params); /** * 上传模板配置内容 @@ -209,16 +224,17 @@ export const updateTemplateContent = ( templateSpaceId: number, data: string | File, signature: string, -) => http - .put(`/biz/${biz_id}/content/upload`, data, { - headers: { - 'X-Bscp-Template-Space-Id': templateSpaceId, - 'X-Bkapi-File-Content-Id': signature, - 'X-Bkapi-File-Content-Overwrite': 'false', - 'Content-Type': 'text/plain', - }, - }) - .then(res => res.data); +) => + http + .put(`/biz/${biz_id}/content/upload`, data, { + headers: { + 'X-Bscp-Template-Space-Id': templateSpaceId, + 'X-Bkapi-File-Content-Id': signature, + 'X-Bkapi-File-Content-Overwrite': 'false', + 'Content-Type': 'text/plain', + }, + }) + .then((res) => res.data); /** * 下载模板配置内容 @@ -227,17 +243,18 @@ export const updateTemplateContent = ( * @param signature sha256签名 * @returns */ -export const downloadTemplateContent = (biz_id: string, templateSpaceId: number, signature: string) => http - .get(`/biz/${biz_id}/content/download`, { - headers: { - 'X-Bscp-Template-Space-Id': templateSpaceId, - 'X-Bkapi-File-Content-Id': signature, - }, - transitional: { - forcedJSONParsing: false, - }, - }) - .then(res => res); +export const downloadTemplateContent = (biz_id: string, templateSpaceId: number, signature: string) => + http + .get(`/biz/${biz_id}/content/download`, { + headers: { + 'X-Bscp-Template-Space-Id': templateSpaceId, + 'X-Bkapi-File-Content-Id': signature, + }, + transitional: { + forcedJSONParsing: false, + }, + }) + .then((res) => res); /** * 批量删除模板 @@ -246,9 +263,10 @@ export const downloadTemplateContent = (biz_id: string, templateSpaceId: number, * @param template_ids 模板ID列表 * @returns */ -export const deleteTemplate = (biz_id: string, template_space_id: number, template_ids: number[]) => http.delete(`/config/biz/${biz_id}/template_spaces/${template_space_id}/templates`, { - params: { template_ids: template_ids.join(',') }, -}); +export const deleteTemplate = (biz_id: string, template_space_id: number, template_ids: number[]) => + http.delete(`/config/biz/${biz_id}/template_spaces/${template_space_id}/templates`, { + params: { template_ids: template_ids.join(',') }, + }); /** * 根据模板id列表查询对应模板详情 @@ -256,7 +274,8 @@ export const deleteTemplate = (biz_id: string, template_space_id: number, templa * @param ids 模板ID列表 * @returns */ -export const getTemplatesDetailByIds = (biz_id: string, ids: number[]) => http.post(`/config/biz/${biz_id}/templates/list_by_ids`, { ids }).then(res => res.data); +export const getTemplatesDetailByIds = (biz_id: string, ids: number[]) => + http.post(`/config/biz/${biz_id}/templates/list_by_ids`, { ids }).then((res) => res.data); /** * 添加模版到模版套餐(多个模板添加到多个套餐) @@ -271,10 +290,11 @@ export const addTemplateToPackage = ( template_space_id: number, template_ids: number[], template_set_ids: number[], -) => http.post(`/config/biz/${biz_id}/template_spaces/${template_space_id}/templates/add_to_template_sets`, { - template_ids, - template_set_ids, -}); +) => + http.post(`/config/biz/${biz_id}/template_spaces/${template_space_id}/templates/add_to_template_sets`, { + template_ids, + template_set_ids, + }); /** * 将模版移出套餐(多个模板移出多个套餐) @@ -289,10 +309,11 @@ export const moveOutTemplateFromPackage = ( template_space_id: number, template_ids: number[], template_set_ids: number[], -) => http.post(`/config/biz/${biz_id}/template_spaces/${template_space_id}/templates/delete_from_template_sets`, { - template_ids, - template_set_ids, -}); +) => + http.post(`/config/biz/${biz_id}/template_spaces/${template_space_id}/templates/delete_from_template_sets`, { + template_ids, + template_set_ids, + }); /** * 查询单个模板被套餐引用详情 @@ -307,12 +328,13 @@ export const getPackagesByTemplateId = ( template_space_id: number, template_id: number, params: ICommonQuery, -) => http - .get( - `/config/biz/${biz_id}/template_spaces/${template_space_id}/templates/${template_id}/bound_template_set_details`, - { params }, - ) - .then(res => res.data); +) => + http + .get( + `/config/biz/${biz_id}/template_spaces/${template_space_id}/templates/${template_id}/bound_template_set_details`, + { params }, + ) + .then((res) => res.data); /** * 查询多个模板被套餐引用详情 @@ -347,9 +369,10 @@ export const getPackagesByTemplateIds = (biz_id: string, template_space_id: numb * @param template_ids 模板ID列表 * @returns */ -export const getCountsByTemplateIds = (biz_id: string, template_space_id: number, template_ids: number[]) => http - .post(`/config/biz/${biz_id}/template_spaces/${template_space_id}/templates/bound_counts`, { template_ids }) - .then(res => res.data); +export const getCountsByTemplateIds = (biz_id: string, template_space_id: number, template_ids: number[]) => + http + .post(`/config/biz/${biz_id}/template_spaces/${template_space_id}/templates/bound_counts`, { template_ids }) + .then((res) => res.data); /** * 查询模板被未命名版本服务引用详情 @@ -364,12 +387,13 @@ export const getUnNamedVersionAppsBoundByTemplate = ( template_space_id: number, template_id: number, params: ICommonQuery, -) => http - .get( - `/config/biz/${biz_id}/template_spaces/${template_space_id}/templates/${template_id}/bound_unnamed_app_details`, - { params }, - ) - .then(res => res.data); +) => + http + .get( + `/config/biz/${biz_id}/template_spaces/${template_space_id}/templates/${template_id}/bound_unnamed_app_details`, + { params }, + ) + .then((res) => res.data); /** * 创建模板版本 @@ -384,12 +408,13 @@ export const createTemplateVersion = ( template_space_id: number, template_id: number, params: ITemplateVersionEditingData, -) => http - .post( - `/config/biz/${biz_id}/template_spaces/${template_space_id}/templates/${template_id}/template_revisions`, - params, - ) - .then(res => res.data); +) => + http + .post( + `/config/biz/${biz_id}/template_spaces/${template_space_id}/templates/${template_id}/template_revisions`, + params, + ) + .then((res) => res.data); /** * 获取模板版本列表 @@ -404,11 +429,12 @@ export const getTemplateVersionList = ( template_space_id: number, template_id: number, params: ICommonQuery, -) => http - .get(`/config/biz/${biz_id}/template_spaces/${template_space_id}/templates/${template_id}/template_revisions`, { - params, - }) - .then(res => res.data); +) => + http + .get(`/config/biz/${biz_id}/template_spaces/${template_space_id}/templates/${template_id}/template_revisions`, { + params, + }) + .then((res) => res.data); /** * 根据模板版本id列表查询对应模板版本详情 @@ -416,7 +442,8 @@ export const getTemplateVersionList = ( * @param ids 模板版本ID列表 * @returns */ -export const getTemplateVersionsDetailByIds = (biz_id: string, ids: number[]) => http.post(`/config/biz/${biz_id}/template_revisions/list_by_ids`, { ids }).then(res => res.data); +export const getTemplateVersionsDetailByIds = (biz_id: string, ids: number[]) => + http.post(`/config/biz/${biz_id}/template_revisions/list_by_ids`, { ids }).then((res) => res.data); /** * @@ -431,9 +458,10 @@ export const getTemplateVersionDetail = ( app_id: number, release_id: number, template_revision_id: number, -) => http - .get(`/config/biz/${biz_id}/apps/${app_id}/releases/${release_id}/template_revisions/${template_revision_id}`) - .then(res => res.data); +) => + http + .get(`/config/biz/${biz_id}/apps/${app_id}/releases/${release_id}/template_revisions/${template_revision_id}`) + .then((res) => res.data); /** * 删除模板版本 @@ -448,7 +476,10 @@ export const deleteTemplateVersion = ( template_space_id: number, template_id: number, template_revision_id: number, -) => http.delete(`/config/biz/${biz_id}/template_spaces/${template_space_id}/templates/${template_id}/template_revisions/${template_revision_id}`); +) => + http.delete( + `/config/biz/${biz_id}/template_spaces/${template_space_id}/templates/${template_id}/template_revisions/${template_revision_id}`, + ); /** * 查询模板版本被引用计数 @@ -463,12 +494,13 @@ export const getCountsByTemplateVersionIds = ( template_space_id: number, template_id: number, ids: number[], -) => http - .post( - `/config/biz/${biz_id}/template_spaces/${template_space_id}/templates/${template_id}/template_revisions/bound_counts`, - { template_revision_ids: ids }, - ) - .then(res => res.data); +) => + http + .post( + `/config/biz/${biz_id}/template_spaces/${template_space_id}/templates/${template_id}/template_revisions/bound_counts`, + { template_revision_ids: ids }, + ) + .then((res) => res.data); /** * 获取模板版本被未命名版本服务引用详情 @@ -484,12 +516,13 @@ export const getUnNamedVersionAppsBoundByTemplateVersion = ( template_id: number, template_revision_id: number, params: ICommonQuery, -) => http - .get( - `/config/biz/${biz_id}/template_spaces/${template_space_id}/templates/${template_id}/template_revisions/${template_revision_id}/bound_unnamed_app_details`, - { params }, - ) - .then(res => res.data); +) => + http + .get( + `/config/biz/${biz_id}/template_spaces/${template_space_id}/templates/${template_id}/template_revisions/${template_revision_id}/bound_unnamed_app_details`, + { params }, + ) + .then((res) => res.data); /** * 获取模板latest版本被未命名版本服务引用详情 @@ -503,12 +536,13 @@ export const getUnNamedVersionAppsBoundByLatestTemplateVersion = ( template_space_id: number, template_id: number, params: ICommonQuery, -) => http - .get( - `/config/biz/${biz_id}/template_spaces/${template_space_id}/templates/${template_id}/latest/bound_unnamed_app_details`, - { params }, - ) - .then(res => res.data); +) => + http + .get( + `/config/biz/${biz_id}/template_spaces/${template_space_id}/templates/${template_id}/latest/bound_unnamed_app_details`, + { params }, + ) + .then((res) => res.data); /** * 获取模板版被已生成版本服务引用详情 @@ -524,12 +558,13 @@ export const getAppsVersionBoundByTemplateVersion = ( template_id: number, template_revision_id: number, params: ICommonQuery, -) => http - .get( - `/config/biz/${biz_id}/template_spaces/${template_space_id}/templates/${template_id}/template_revisions/${template_revision_id}/bound_named_app_details`, - { params }, - ) - .then(res => res.data); +) => + http + .get( + `/config/biz/${biz_id}/template_spaces/${template_space_id}/templates/${template_id}/template_revisions/${template_revision_id}/bound_named_app_details`, + { params }, + ) + .then((res) => res.data); /** * 查询模板套餐和服务的绑定关系 @@ -537,7 +572,8 @@ export const getAppsVersionBoundByTemplateVersion = ( * @param app_id 应用ID * @returns */ -export const getAppPkgBindingRelations = (biz_id: string, app_id: number) => http.get(`/config/biz/${biz_id}/apps/${app_id}/template_bindings`).then(res => res.data); +export const getAppPkgBindingRelations = (biz_id: string, app_id: number) => + http.get(`/config/biz/${biz_id}/apps/${app_id}/template_bindings`).then((res) => res.data); /** * 批量查询模板的版本名称 @@ -545,9 +581,10 @@ export const getAppPkgBindingRelations = (biz_id: string, app_id: number) => htt * @param template_ids 模板ID列表 * @returns */ -export const getTemplateVersionsNameByIds = (biz_id: string, template_ids: number[]) => http - .post(`/config/biz/${biz_id}/template_revisions/list_names_by_template_ids`, { template_ids }) - .then(res => res.data); +export const getTemplateVersionsNameByIds = (biz_id: string, template_ids: number[]) => + http + .post(`/config/biz/${biz_id}/template_revisions/list_names_by_template_ids`, { template_ids }) + .then((res) => res.data); /** * 导入配置文件压缩包 @@ -556,13 +593,14 @@ export const getTemplateVersionsNameByIds = (biz_id: string, template_ids: numbe * @param fill 导入文件 * @returns */ -export const importTemplateFile = (biz_id: string, template_space_id: number, fill: any) => http - .post(`/config/biz/${biz_id}/template_spaces/${template_space_id}/templates/import`, fill, { - headers: { - 'Content-Type': 'application/zip', - }, - }) - .then(res => res.data); +export const importTemplateFile = (biz_id: string, template_space_id: number, fill: any) => + http + .post(`/config/biz/${biz_id}/template_spaces/${template_space_id}/templates/import`, fill, { + headers: { + 'Content-Type': 'application/zip', + }, + }) + .then((res) => res.data); /** * 模板批量新增 @@ -571,7 +609,9 @@ export const importTemplateFile = (biz_id: string, template_space_id: number, fi * @param configData 配置列表 * @returns */ -export const importTemplateBatchAdd = (biz_id: string, template_space_id: number, configData: any) => http - .post(`/config/biz/${biz_id}/template_spaces/${template_space_id}/templates/batch_upsert_templates`, { items: configData }) - .then(res => res.data); - +export const importTemplateBatchAdd = (biz_id: string, template_space_id: number, configData: any) => + http + .post(`/config/biz/${biz_id}/template_spaces/${template_space_id}/templates/batch_upsert_templates`, { + items: configData, + }) + .then((res) => res.data); diff --git a/bcs-services/bcs-bscp/ui/src/api/variable.ts b/bcs-services/bcs-bscp/ui/src/api/variable.ts index 97d0ea6747..e9c1a780b5 100644 --- a/bcs-services/bcs-bscp/ui/src/api/variable.ts +++ b/bcs-services/bcs-bscp/ui/src/api/variable.ts @@ -8,7 +8,8 @@ import { IVariableEditParams, IVariableImportParams } from '../../types/variable * @param params * @returns */ -export const getVariableList = (biz_id: string, params: ICommonQuery) => http.get(`/config/biz/${biz_id}/template_variables`, { params }).then(res => res.data); +export const getVariableList = (biz_id: string, params: ICommonQuery) => + http.get(`/config/biz/${biz_id}/template_variables`, { params }).then((res) => res.data); /** * 创建变量 @@ -16,7 +17,8 @@ export const getVariableList = (biz_id: string, params: ICommonQuery) => http.ge * @param params 创建参数 * @returns */ -export const createVariable = (biz_id: string, params: IVariableEditParams) => http.post(`/config/biz/${biz_id}/template_variables`, params); +export const createVariable = (biz_id: string, params: IVariableEditParams) => + http.post(`/config/biz/${biz_id}/template_variables`, params); /** * 编辑变量 @@ -25,7 +27,11 @@ export const createVariable = (biz_id: string, params: IVariableEditParams) => h * @param params 编辑参数 * @returns */ -export const updateVariable = (biz_id: string, template_variable_id: number, params: { default_val: string; memo: string; }) => http.put(`/config/biz/${biz_id}/template_variables/${template_variable_id}`, params); +export const updateVariable = ( + biz_id: string, + template_variable_id: number, + params: { default_val: string; memo: string }, +) => http.put(`/config/biz/${biz_id}/template_variables/${template_variable_id}`, params); /** * 删除变量 @@ -33,7 +39,8 @@ export const updateVariable = (biz_id: string, template_variable_id: number, par * @param template_variable_id 变量ID * @returns */ -export const deleteVariable = (biz_id: string, template_variable_id: number) => http.delete(`/config/biz/${biz_id}/template_variables/${template_variable_id}`); +export const deleteVariable = (biz_id: string, template_variable_id: number) => + http.delete(`/config/biz/${biz_id}/template_variables/${template_variable_id}`); /** * 获取未命名版本服务变量列表 @@ -41,7 +48,8 @@ export const deleteVariable = (biz_id: string, template_variable_id: number) => * @param app_id 应用ID * @returns */ -export const getUnReleasedAppVariables = (biz_id: string, app_id: number) => http.get(`/config/biz/${biz_id}/apps/${app_id}/template_variables`).then(res => res.data); +export const getUnReleasedAppVariables = (biz_id: string, app_id: number) => + http.get(`/config/biz/${biz_id}/apps/${app_id}/template_variables`).then((res) => res.data); /** * 更新未命名版本服务变量列表 @@ -49,7 +57,8 @@ export const getUnReleasedAppVariables = (biz_id: string, app_id: number) => htt * @param app_id 应用ID * @returns */ -export const updateUnReleasedAppVariables = (biz_id: string, app_id: number, variables: IVariableEditParams[]) => http.put(`/config/biz/${biz_id}/apps/${app_id}/template_variables`, { variables }).then(res => res.data); +export const updateUnReleasedAppVariables = (biz_id: string, app_id: number, variables: IVariableEditParams[]) => + http.put(`/config/biz/${biz_id}/apps/${app_id}/template_variables`, { variables }).then((res) => res.data); /** * 获取服务某个版本的变量列表 @@ -58,7 +67,10 @@ export const updateUnReleasedAppVariables = (biz_id: string, app_id: number, var * @param release_id 服务版本ID * @returns */ -export const getReleasedAppVariables = (biz_id: string, app_id: number, release_id: number) => http.get(`/config/biz/${biz_id}/apps/${app_id}/releases/${release_id}/template_variables`, { params: { } }).then(res => res.data); +export const getReleasedAppVariables = (biz_id: string, app_id: number, release_id: number) => + http + .get(`/config/biz/${biz_id}/apps/${app_id}/releases/${release_id}/template_variables`, { params: {} }) + .then((res) => res.data); /** * 查询未命名版本服务中变量被配置文件引用详情 @@ -66,7 +78,8 @@ export const getReleasedAppVariables = (biz_id: string, app_id: number, release_ * @param app_id 应用ID * @returns */ -export const getUnReleasedAppVariablesCitedDetail = (biz_id: string, app_id: number) => http.get(`/config/biz/${biz_id}/apps/${app_id}/template_variables_references`).then(res => res.data); +export const getUnReleasedAppVariablesCitedDetail = (biz_id: string, app_id: number) => + http.get(`/config/biz/${biz_id}/apps/${app_id}/template_variables_references`).then((res) => res.data); /** * 查询服务某个版本的变量被配置文件引用详情 @@ -75,7 +88,10 @@ export const getUnReleasedAppVariablesCitedDetail = (biz_id: string, app_id: num * @param release_id 服务版本ID * @returns */ -export const getReleasedAppVariablesCitedDetail = (biz_id: string, app_id: number, release_id: number) => http.get(`/config/biz/${biz_id}/apps/${app_id}/releases/${release_id}/template_variables_references`).then(res => res.data); +export const getReleasedAppVariablesCitedDetail = (biz_id: string, app_id: number, release_id: number) => + http + .get(`/config/biz/${biz_id}/apps/${app_id}/releases/${release_id}/template_variables_references`) + .then((res) => res.data); /** * 批量导入变量 @@ -84,7 +100,6 @@ export const getReleasedAppVariablesCitedDetail = (biz_id: string, app_id: numbe * @param release_id 服务版本ID * @returns */ -export const batchImportTemplateVariables = (biz_id: string, params: IVariableImportParams) => http.post(`config/biz/${biz_id}/template_variables/import`, params); +export const batchImportTemplateVariables = (biz_id: string, params: IVariableImportParams) => + http.post(`config/biz/${biz_id}/template_variables/import`, params); // @todo 待接口支持 - - diff --git a/bcs-services/bcs-bscp/ui/src/common/auth.ts b/bcs-services/bcs-bscp/ui/src/common/auth.ts index e9532d0571..94b4378e12 100644 --- a/bcs-services/bcs-bscp/ui/src/common/auth.ts +++ b/bcs-services/bcs-bscp/ui/src/common/auth.ts @@ -1,4 +1,4 @@ -import pinia from '../store/index'; +import pinia from '../store/index'; import { getSpaceList } from '../api'; import useGlobalStore from '../store/global'; import useUserStore from '../store/user'; diff --git a/bcs-services/bcs-bscp/ui/src/components/code-editor/index.vue b/bcs-services/bcs-bscp/ui/src/components/code-editor/index.vue index 84440bc5d9..0df0d307dc 100644 --- a/bcs-services/bcs-bscp/ui/src/components/code-editor/index.vue +++ b/bcs-services/bcs-bscp/ui/src/components/code-editor/index.vue @@ -8,357 +8,356 @@
diff --git a/bcs-services/bcs-bscp/ui/src/components/delete-confirm-dialog.vue b/bcs-services/bcs-bscp/ui/src/components/delete-confirm-dialog.vue index 7e9f0ac65a..692cc1f74d 100644 --- a/bcs-services/bcs-bscp/ui/src/components/delete-confirm-dialog.vue +++ b/bcs-services/bcs-bscp/ui/src/components/delete-confirm-dialog.vue @@ -5,44 +5,44 @@ :theme="'primary'" quick-close ext-cls="delete-confirm-dialog" - @closed="handleClose" - > + @closed="handleClose"> diff --git a/bcs-services/bcs-bscp/ui/src/components/diff/file.vue b/bcs-services/bcs-bscp/ui/src/components/diff/file.vue index 8b28481c28..50b67e54d3 100644 --- a/bcs-services/bcs-bscp/ui/src/components/diff/file.vue +++ b/bcs-services/bcs-bscp/ui/src/components/diff/file.vue @@ -1,131 +1,133 @@ diff --git a/bcs-services/bcs-bscp/ui/src/components/diff/index.vue b/bcs-services/bcs-bscp/ui/src/components/diff/index.vue index d96907df25..0c13e81832 100644 --- a/bcs-services/bcs-bscp/ui/src/components/diff/index.vue +++ b/bcs-services/bcs-bscp/ui/src/components/diff/index.vue @@ -17,95 +17,89 @@ :downloadable="false" :current="props.diff.current.content as IFileConfigContentSummary" :base="props.diff.base.content as IFileConfigContentSummary" - :id="props.id" - /> + :id="props.id" /> - + :base-permission="basePermission" /> + diff --git a/bcs-services/bcs-bscp/ui/src/components/diff/kv.vue b/bcs-services/bcs-bscp/ui/src/components/diff/kv.vue index a720452711..41b855e397 100644 --- a/bcs-services/bcs-bscp/ui/src/components/diff/kv.vue +++ b/bcs-services/bcs-bscp/ui/src/components/diff/kv.vue @@ -14,33 +14,33 @@ diff --git a/bcs-services/bcs-bscp/ui/src/components/diff/navigator.vue b/bcs-services/bcs-bscp/ui/src/components/diff/navigator.vue index c64f5ff709..f1f708285d 100644 --- a/bcs-services/bcs-bscp/ui/src/components/diff/navigator.vue +++ b/bcs-services/bcs-bscp/ui/src/components/diff/navigator.vue @@ -29,152 +29,152 @@ diff --git a/bcs-services/bcs-bscp/ui/src/components/diff/text.vue b/bcs-services/bcs-bscp/ui/src/components/diff/text.vue index 1b48ea9223..d3fb0b6c4e 100644 --- a/bcs-services/bcs-bscp/ui/src/components/diff/text.vue +++ b/bcs-services/bcs-bscp/ui/src/components/diff/text.vue @@ -12,257 +12,256 @@ + :permission-editor="permissionEditor"> diff --git a/bcs-services/bcs-bscp/ui/src/components/features-dialog.vue b/bcs-services/bcs-bscp/ui/src/components/features-dialog.vue index 11e8f0cd57..6498808271 100644 --- a/bcs-services/bcs-bscp/ui/src/components/features-dialog.vue +++ b/bcs-services/bcs-bscp/ui/src/components/features-dialog.vue @@ -1,34 +1,34 @@ diff --git a/bcs-services/bcs-bscp/ui/src/components/footer.vue b/bcs-services/bcs-bscp/ui/src/components/footer.vue index c6dbacf748..2fb35c97ca 100644 --- a/bcs-services/bcs-bscp/ui/src/components/footer.vue +++ b/bcs-services/bcs-bscp/ui/src/components/footer.vue @@ -9,20 +9,20 @@ diff --git a/bcs-services/bcs-bscp/ui/src/components/head.vue b/bcs-services/bcs-bscp/ui/src/components/head.vue index 81772fbc75..03c1df48cc 100644 --- a/bcs-services/bcs-bscp/ui/src/components/head.vue +++ b/bcs-services/bcs-bscp/ui/src/components/head.vue @@ -13,8 +13,7 @@ :class="['nav-item', { actived: isNavActived(nav.module) }]" :key="nav.id" :to="{ name: nav.id, params: { spaceId: spaceId || 0 } }" - @click="handleNavClick(nav.id)" - > + @click="handleNavClick(nav.id)"> {{ nav.name }} @@ -30,8 +29,7 @@ :clearable="false" :input-search="false" :remote-method="handleSpaceSearch" - @change="handleSelectSpace" - > + @change="handleSelectSpace"> diff --git a/bcs-services/bcs-bscp/ui/src/components/permission-input-picker.vue b/bcs-services/bcs-bscp/ui/src/components/permission-input-picker.vue index 51808510d5..22472c35dc 100644 --- a/bcs-services/bcs-bscp/ui/src/components/permission-input-picker.vue +++ b/bcs-services/bcs-bscp/ui/src/components/permission-input-picker.vue @@ -5,15 +5,13 @@ theme="light" trigger="manual" placement="top" - :is-show="showPrivilegeErrorTips" - > + :is-show="showPrivilegeErrorTips"> + @blur="handleInputBlur" /> diff --git a/bcs-services/bcs-bscp/ui/src/components/permission/apply-dialog.vue b/bcs-services/bcs-bscp/ui/src/components/permission/apply-dialog.vue index 10850c83ff..a5c95745cb 100644 --- a/bcs-services/bcs-bscp/ui/src/components/permission/apply-dialog.vue +++ b/bcs-services/bcs-bscp/ui/src/components/permission/apply-dialog.vue @@ -6,8 +6,7 @@ :is-show="show" :esc-close="false" :quick-close="false" - @closed="handleClose" - > + @closed="handleClose">
@@ -54,129 +53,129 @@ diff --git a/bcs-services/bcs-bscp/ui/src/components/permission/cursor.css b/bcs-services/bcs-bscp/ui/src/components/permission/cursor.css index 7444afaef4..6d23a5d709 100644 --- a/bcs-services/bcs-bscp/ui/src/components/permission/cursor.css +++ b/bcs-services/bcs-bscp/ui/src/components/permission/cursor.css @@ -2,4 +2,4 @@ width: 12px; height: 16px; background: url('../../assets/lock.svg') no-repeat; -} \ No newline at end of file +} diff --git a/bcs-services/bcs-bscp/ui/src/components/search-input.vue b/bcs-services/bcs-bscp/ui/src/components/search-input.vue index 22be0c0e90..52b7a6eecc 100644 --- a/bcs-services/bcs-bscp/ui/src/components/search-input.vue +++ b/bcs-services/bcs-bscp/ui/src/components/search-input.vue @@ -6,39 +6,44 @@ :clearable="true" @clear="triggerSearch" @input="triggerSearch"> - +
diff --git a/bcs-services/bcs-bscp/ui/src/components/table/table-empty.vue b/bcs-services/bcs-bscp/ui/src/components/table/table-empty.vue index 390fc17b3b..a83d5edf07 100644 --- a/bcs-services/bcs-bscp/ui/src/components/table/table-empty.vue +++ b/bcs-services/bcs-bscp/ui/src/components/table/table-empty.vue @@ -1,47 +1,43 @@ diff --git a/bcs-services/bcs-bscp/ui/src/components/version-log.vue b/bcs-services/bcs-bscp/ui/src/components/version-log.vue index 2e3e5dc932..73aa7afa76 100644 --- a/bcs-services/bcs-bscp/ui/src/components/version-log.vue +++ b/bcs-services/bcs-bscp/ui/src/components/version-log.vue @@ -1,13 +1,15 @@ diff --git a/bcs-services/bcs-bscp/ui/src/constants/config.ts b/bcs-services/bcs-bscp/ui/src/constants/config.ts index f5b6a53d61..014d12cc39 100644 --- a/bcs-services/bcs-bscp/ui/src/constants/config.ts +++ b/bcs-services/bcs-bscp/ui/src/constants/config.ts @@ -1,5 +1,5 @@ import { IConfigVersion } from '../../types/config'; -import { localT } from '../i18n'; +import { localT } from '../i18n'; // kv类型的配置项包含的子类型 export const CONFIG_KV_TYPE = [ { id: 'string', name: 'String' }, diff --git a/bcs-services/bcs-bscp/ui/src/constants/group.ts b/bcs-services/bcs-bscp/ui/src/constants/group.ts index 3af6ea5517..6ea6e0b092 100644 --- a/bcs-services/bcs-bscp/ui/src/constants/group.ts +++ b/bcs-services/bcs-bscp/ui/src/constants/group.ts @@ -1,4 +1,4 @@ -export default [ +export default [ { id: 'eq', name: '=' }, { id: 'ne', name: '!=' }, { id: 'gt', name: '>' }, diff --git a/bcs-services/bcs-bscp/ui/src/css/common.scss b/bcs-services/bcs-bscp/ui/src/css/common.scss index 4703571dea..b440e23c6b 100644 --- a/bcs-services/bcs-bscp/ui/src/css/common.scss +++ b/bcs-services/bcs-bscp/ui/src/css/common.scss @@ -33,4 +33,4 @@ .info-box-style .bk-modal-content { min-height: auto !important; -} \ No newline at end of file +} diff --git a/bcs-services/bcs-bscp/ui/src/css/font.css b/bcs-services/bcs-bscp/ui/src/css/font.css index 1a7366b1b2..45389bf184 100644 --- a/bcs-services/bcs-bscp/ui/src/css/font.css +++ b/bcs-services/bcs-bscp/ui/src/css/font.css @@ -1,95 +1,97 @@ @font-face { - font-family: "bk-bscp"; - src: url("../assets/fonts/iconcool.svg#iconcool") format("svg"), - url("../assets/fonts/iconcool.ttf") format("truetype"), - url("../assets/fonts/iconcool.woff") format("woff"), - url("../assets/fonts/iconcool.eot?#iefix") format("embedded-opentype"); - src: url("../assets/fonts/iconcool.svg#iconcool") format("svg"), - url("../assets/fonts/iconcool.ttf") format("truetype"), - url("../assets/fonts/iconcool.woff") format("woff"), - url("../assets/fonts/iconcool.eot?#iefix") format("embedded-opentype"); - font-weight: normal; - font-style: normal; + font-family: 'bk-bscp'; + src: + url('../assets/fonts/iconcool.svg#iconcool') format('svg'), + url('../assets/fonts/iconcool.ttf') format('truetype'), + url('../assets/fonts/iconcool.woff') format('woff'), + url('../assets/fonts/iconcool.eot?#iefix') format('embedded-opentype'); + src: + url('../assets/fonts/iconcool.svg#iconcool') format('svg'), + url('../assets/fonts/iconcool.ttf') format('truetype'), + url('../assets/fonts/iconcool.woff') format('woff'), + url('../assets/fonts/iconcool.eot?#iefix') format('embedded-opentype'); + font-weight: normal; + font-style: normal; } .bk-bscp-icon { - /* use !important to prevent issues with browser extensions that change fonts */ - font-family: 'bk-bscp' !important; - speak: none; - font-style: normal; - font-weight: normal; - font-variant: normal; - text-transform: none; - line-height: 1; - text-align: center; - /* Better Font Rendering =========== */ - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; + /* use !important to prevent issues with browser extensions that change fonts */ + font-family: 'bk-bscp' !important; + speak: none; + font-style: normal; + font-weight: normal; + font-variant: normal; + text-transform: none; + line-height: 1; + text-align: center; + /* Better Font Rendering =========== */ + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; } .icon-help-fill:before { - content: "\e107"; + content: '\e107'; } .icon-help:before { - content: "\e106"; + content: '\e106'; } .icon-help-document-fill:before { - content: "\e105"; + content: '\e105'; } .icon-edit-small:before { - content: "\e104"; + content: '\e104'; } .icon-configuration-line:before { - content: "\e101"; + content: '\e101'; } .icon-time-2:before { - content: "\e102"; + content: '\e102'; } .icon-reduce:before { - content: "\e108"; + content: '\e108'; } .icon-add:before { - content: "\e109"; + content: '\e109'; } .icon-app-store:before { - content: "\e10a"; + content: '\e10a'; } .icon-revoke:before { - content: "\e10b"; + content: '\e10b'; } .icon-tags:before { - content: "\e10c"; + content: '\e10c'; } .icon-block-shape:before { - content: "\e10d"; + content: '\e10d'; } .icon-empty:before { - content: "\e10e"; + content: '\e10e'; } .icon-folder:before { - content: "\e10f"; + content: '\e10f'; } .icon-setting:before { - content: "\e110"; + content: '\e110'; } .icon-separator:before { - content: "\e111"; + content: '\e111'; } .icon-resources-fill:before { - content: "\e112"; + content: '\e112'; } .icon-file-line:before { - content: "\e113"; + content: '\e113'; } .icon-kv:before { - content: "\e114"; + content: '\e114'; } .icon-resources:before { - content: "\e115"; + content: '\e115'; } .icon-lang-en:before { - content: "\e116"; + content: '\e116'; } .icon-lang-cn:before { - content: "\e117"; + content: '\e117'; } diff --git a/bcs-services/bcs-bscp/ui/src/css/markdown.scss b/bcs-services/bcs-bscp/ui/src/css/markdown.scss index c38135a0a1..abfd6f3cc1 100644 --- a/bcs-services/bcs-bscp/ui/src/css/markdown.scss +++ b/bcs-services/bcs-bscp/ui/src/css/markdown.scss @@ -7,43 +7,42 @@ h3, h4, h5 { - height: auto; - margin: 10px 0; - font: - normal 14px/1.5 - "Helvetica Neue", - Helvetica, - Arial, - "Lantinghei SC", - "Hiragino Sans GB", - "Microsoft Yahei", - sans-serif; - font-weight: bold; - color: #34383e; + height: auto; + margin: 10px 0; + font: + normal 14px/1.5 'Helvetica Neue', + Helvetica, + Arial, + 'Lantinghei SC', + 'Hiragino Sans GB', + 'Microsoft Yahei', + sans-serif; + font-weight: bold; + color: #34383e; } h1 { - font-size: 30px; + font-size: 30px; } h2 { - font-size: 24px; + font-size: 24px; } h3 { - font-size: 18px; + font-size: 18px; } h4 { - font-size: 16px; + font-size: 16px; } h5 { - font-size: 14px; + font-size: 14px; } em { - font-style: italic; + font-style: italic; } div, @@ -51,116 +50,116 @@ font, span, li { - line-height: 1.3; + line-height: 1.3; } p { - margin: 0 0 1em; + margin: 0 0 1em; } table, table p { - margin: 0; + margin: 0; } ul, ol { - padding-left: 40px; - margin: 10px 0 10px; - text-indent: 0; + padding-left: 40px; + margin: 10px 0 10px; + text-indent: 0; } ul { + list-style: disc; + & > li { + line-height: 1.8; + white-space: normal; list-style: disc; - & > li { - line-height: 1.8; - white-space: normal; - list-style: disc; - } + } } ol { + list-style: decimal; + & > li { + line-height: 1.8; + white-space: normal; list-style: decimal; - & > li { - line-height: 1.8; - white-space: normal; - list-style: decimal; - } + } } li > ul { - margin-bottom: 10px; + margin-bottom: 10px; } li ol { - padding-left: 20px !important; + padding-left: 20px !important; } ul ul, ul ol, ol ol, ol ul { - margin-bottom: 0; - margin-left: 20px; + margin-bottom: 0; + margin-left: 20px; } pre, code { - width: 95%; - padding: 0 3px 2px; - font-family: Monaco, Menlo, Consolas, "Courier New", monospace; - font-size: 14px; - color: #333; - border-radius: 3px; + width: 95%; + padding: 0 3px 2px; + font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; + font-size: 14px; + color: #333; + border-radius: 3px; } code { - padding: 2px 4px; - font-family: Consolas, monospace, tahoma, Arial; - color: #d14; - border: 1px solid #e1e1e8; + padding: 2px 4px; + font-family: Consolas, monospace, tahoma, Arial; + color: #d14; + border: 1px solid #e1e1e8; } pre { - display: block; - padding: 9.5px; - margin: 0 0 10px; - font-family: Consolas, monospace, tahoma, Arial; - font-size: 13px; - word-break: break-all; - word-wrap: break-word; + display: block; + padding: 9.5px; + margin: 0 0 10px; + font-family: Consolas, monospace, tahoma, Arial; + font-size: 13px; + word-break: break-all; + word-wrap: break-word; + white-space: pre-wrap; + background-color: #f6f6f6; + border: 1px solid #ddd; + border: 1px solid rgba(0, 0, 0, 0.15); + border-radius: 2px; + code { + padding: 0; white-space: pre-wrap; - background-color: #f6f6f6; - border: 1px solid #ddd; - border: 1px solid rgba(0,0,0,0.15); - border-radius: 2px; - code { - padding: 0; - white-space: pre-wrap; - border: 0; - } + border: 0; + } } blockquote { - padding: 0 0 0 14px; - margin: 0 0 20px; - border-left: 5px solid #dfdfdf; - ::before, - ::after { - content: ""; - } - p { - margin-bottom: 0; - font-size: 14px; - font-weight: 300; - line-height: 25px; - } - small { - display: block; - line-height: 20px; - color: #999; - ::before { - content: "\2014 \00A0"; - } + padding: 0 0 0 14px; + margin: 0 0 20px; + border-left: 5px solid #dfdfdf; + ::before, + ::after { + content: ''; + } + p { + margin-bottom: 0; + font-size: 14px; + font-weight: 300; + line-height: 25px; + } + small { + display: block; + line-height: 20px; + color: #999; + ::before { + content: '\2014 \00A0'; } + } } -} \ No newline at end of file +} diff --git a/bcs-services/bcs-bscp/ui/src/css/style.css b/bcs-services/bcs-bscp/ui/src/css/style.css index 585e6c655f..8fe978b9ed 100644 --- a/bcs-services/bcs-bscp/ui/src/css/style.css +++ b/bcs-services/bcs-bscp/ui/src/css/style.css @@ -1,7 +1,14 @@ @import './font.css'; :root { - font-family: -apple-system, BlinkMacSystemFont, PingFang SC, Microsoft YaHei, Helvetica Neue, Arial, sans-serif; + font-family: + -apple-system, + BlinkMacSystemFont, + PingFang SC, + Microsoft YaHei, + Helvetica Neue, + Arial, + sans-serif; font-size: 14px; font-weight: 400; color-scheme: light dark; @@ -29,18 +36,19 @@ h1 { line-height: 1.1; } -ul, ol { +ul, +ol { list-style: none; padding: 0; margin: 0; } li { -list-style: none; + list-style: none; } a { - color: #3A84FF; + color: #3a84ff; text-decoration: none; } textarea { @@ -76,4 +84,4 @@ textarea { .bk-textarea.resizable { resize: vertical; -} \ No newline at end of file +} diff --git a/bcs-services/bcs-bscp/ui/src/css/style.scss b/bcs-services/bcs-bscp/ui/src/css/style.scss index 7ac76203ae..ddf7d559e0 100644 --- a/bcs-services/bcs-bscp/ui/src/css/style.scss +++ b/bcs-services/bcs-bscp/ui/src/css/style.scss @@ -1,2 +1,2 @@ @import './common.scss'; -@import './markdown.scss'; \ No newline at end of file +@import './markdown.scss'; diff --git a/bcs-services/bcs-bscp/ui/src/i18n/index.ts b/bcs-services/bcs-bscp/ui/src/i18n/index.ts index 43634a39e7..fcc388a9c3 100644 --- a/bcs-services/bcs-bscp/ui/src/i18n/index.ts +++ b/bcs-services/bcs-bscp/ui/src/i18n/index.ts @@ -10,6 +10,5 @@ const i18n = createI18n({ }, }); - export const localT = i18n.global.t; export default i18n; diff --git a/bcs-services/bcs-bscp/ui/src/main.ts b/bcs-services/bcs-bscp/ui/src/main.ts index 2d938a9998..17d18133f8 100644 --- a/bcs-services/bcs-bscp/ui/src/main.ts +++ b/bcs-services/bcs-bscp/ui/src/main.ts @@ -18,8 +18,5 @@ auth().then(() => { app.directive('overflowTitle', overflowTitle); app.directive('cursor', cursor); - app.use(pinia).use(i18n) - .use(router) - .use(bkui) - .mount('#app'); + app.use(pinia).use(i18n).use(router).use(bkui).mount('#app'); }); diff --git a/bcs-services/bcs-bscp/ui/src/request/axios.d.ts b/bcs-services/bcs-bscp/ui/src/request/axios.d.ts index ef800ab5b7..ca694d6716 100644 --- a/bcs-services/bcs-bscp/ui/src/request/axios.d.ts +++ b/bcs-services/bcs-bscp/ui/src/request/axios.d.ts @@ -2,6 +2,6 @@ import * as axios from 'axios'; declare module 'axios' { - type AxiosInstance = (config: AxiosRequestConfig) => Promise + type AxiosInstance = (config: AxiosRequestConfig) => Promise; } /* eslint-enable */ diff --git a/bcs-services/bcs-bscp/ui/src/request/index.ts b/bcs-services/bcs-bscp/ui/src/request/index.ts index 3ebb4c1595..7d2fd69266 100644 --- a/bcs-services/bcs-bscp/ui/src/request/index.ts +++ b/bcs-services/bcs-bscp/ui/src/request/index.ts @@ -1,6 +1,6 @@ import axios from 'axios'; import BkMessage from 'bkui-vue/lib/message'; -import pinia from '../store/index'; +import pinia from '../store/index'; import useUserStore from '../store/user'; import useGlobalStore from '../store/global'; @@ -32,18 +32,22 @@ http.interceptors.response.use( if (response.status === 401) { userStore.$patch((state) => { - state.loginUrl = `${response.data.error.data.login_plain_url + window.location.origin}/web/login_success.html`; + state.loginUrl = `${ + response.data.error.data.login_plain_url + window.location.origin + }/web/login_success.html`; state.showLoginModal = true; }); return; - } else if (response.status === 403) { + } + if (response.status === 403) { globalStore.$patch((state) => { state.showPermApplyPage = true; state.applyPermUrl = response.data.error.data.apply_url; state.applyPermResource = response.data.error.data.resources; }); return response.data.error; - } else if (response.status === 404) { + } + if (response.status === 404) { return Promise.reject(error); } diff --git a/bcs-services/bcs-bscp/ui/src/store/global.ts b/bcs-services/bcs-bscp/ui/src/store/global.ts index 15b49a9bdd..44479260f5 100644 --- a/bcs-services/bcs-bscp/ui/src/store/global.ts +++ b/bcs-services/bcs-bscp/ui/src/store/global.ts @@ -6,7 +6,7 @@ import { ISpaceDetail, IPermissionResource, IPermissionQueryResourceItem } from export default defineStore('global', () => { const bscpVersion = ref(''); // 产品版本号 const spaceId = ref(''); // 空间id - const spaceFeatureFlags = ref<{ [key: string]: boolean; }>({}); // 空间的配置开关 + const spaceFeatureFlags = ref<{ [key: string]: boolean }>({}); // 空间的配置开关 const spaceList = ref([]); // @ts-ignore const showNotice = ref(window.ENABLE_BK_NOTICE === 'true'); // 是否展示消息通知 diff --git a/bcs-services/bcs-bscp/ui/src/store/user.ts b/bcs-services/bcs-bscp/ui/src/store/user.ts index d45dcc65cf..a079065824 100644 --- a/bcs-services/bcs-bscp/ui/src/store/user.ts +++ b/bcs-services/bcs-bscp/ui/src/store/user.ts @@ -15,9 +15,10 @@ export default defineStore('user', () => { username: '', }); - const getUserInfo = () => http.get('/auth/user/info').then((res) => { - userInfo.value = res.data as IUserInfo; - }); + const getUserInfo = () => + http.get('/auth/user/info').then((res) => { + userInfo.value = res.data as IUserInfo; + }); return { loginUrl, showLoginModal, userInfo, getUserInfo }; }); diff --git a/bcs-services/bcs-bscp/ui/src/types.ts b/bcs-services/bcs-bscp/ui/src/types.ts index eb9fac3881..31c9d90ef8 100644 --- a/bcs-services/bcs-bscp/ui/src/types.ts +++ b/bcs-services/bcs-bscp/ui/src/types.ts @@ -1,12 +1,12 @@ export type IPageFilter = { - count: Boolean, - start: number, - limit: number -} + count: Boolean; + start: number; + limit: number; +}; export const enum FilterOp { AND = 'and', - OR = 'or' + OR = 'or', } export const enum RuleOp { @@ -17,16 +17,16 @@ export const enum RuleOp { lt = 'lt', lte = 'lte', in = 'in', - nin = 'nin' + nin = 'nin', } export type IRequestFilter = { - op: FilterOp, - rules: IRequestFilterRule[], -} + op: FilterOp; + rules: IRequestFilterRule[]; +}; export type IRequestFilterRule = { - field: string, - op: RuleOp, - value: any -} + field: string; + op: RuleOp; + value: any; +}; diff --git a/bcs-services/bcs-bscp/ui/src/utils/config.ts b/bcs-services/bcs-bscp/ui/src/utils/config.ts index 6989119559..9f78c332e7 100644 --- a/bcs-services/bcs-bscp/ui/src/utils/config.ts +++ b/bcs-services/bcs-bscp/ui/src/utils/config.ts @@ -2,7 +2,7 @@ import { CONFIG_FILE_TYPE } from '../constants/config'; // 查询配置文件类型名称 export const getConfigTypeName = (type: string) => { - const fileType = CONFIG_FILE_TYPE.find(item => item.id === type); + const fileType = CONFIG_FILE_TYPE.find((item) => item.id === type); return fileType ? fileType.name : '未知格式'; }; diff --git a/bcs-services/bcs-bscp/ui/src/utils/hooks/use-delete-template-configs.ts b/bcs-services/bcs-bscp/ui/src/utils/hooks/use-delete-template-configs.ts index 1d83712957..6b27d54050 100644 --- a/bcs-services/bcs-bscp/ui/src/utils/hooks/use-delete-template-configs.ts +++ b/bcs-services/bcs-bscp/ui/src/utils/hooks/use-delete-template-configs.ts @@ -6,12 +6,16 @@ const useDeleteTemplateConfigs = (space_id: string, current_template_space: numb if (!configs || configs.length === 0) return; return new Promise((resolve) => { InfoBox({ - title: `${localT('确认彻底删除')}${configs.length > 1 ? `${configs.length}${localT('条配置文件')}` : `${localT('配置文件')}【${configs[0].spec.name}】`}?`, + title: `${localT('确认彻底删除')}${ + configs.length > 1 + ? `${configs.length}${localT('条配置文件')}` + : `${localT('配置文件')}【${configs[0].spec.name}】` + }?`, subTitle: localT('删除后不可找回,请谨慎操作。'), confirmText: localT('确认删除'), infoType: 'warning', onConfirm: async () => { - const ids = configs.map(config => config.id); + const ids = configs.map((config) => config.id); return deleteTemplate(space_id, current_template_space, ids); }, onClosed: () => resolve(false), diff --git a/bcs-services/bcs-bscp/ui/src/utils/hooks/use-diff-editor-variable-replace.ts b/bcs-services/bcs-bscp/ui/src/utils/hooks/use-diff-editor-variable-replace.ts index cd8d6eb874..2976a5c7fd 100644 --- a/bcs-services/bcs-bscp/ui/src/utils/hooks/use-diff-editor-variable-replace.ts +++ b/bcs-services/bcs-bscp/ui/src/utils/hooks/use-diff-editor-variable-replace.ts @@ -25,7 +25,7 @@ class VariableReplace { public currentReplacedList: IReplacedVariableItem[] = []; public baseReplacedList: IReplacedVariableItem[] = []; - public constructor( + public constructor( editor: monaco.editor.IStandaloneDiffEditor, currentVariables: IVariableEditParams[], baseVariables: IVariableEditParams[], @@ -103,7 +103,7 @@ class VariableReplace { } public highlightVariables(editor: monaco.editor.ICodeEditor, replacedList: IReplacedVariableItem[]) { - const configs = replacedList.map(variable => ({ + const configs = replacedList.map((variable) => ({ range: variable.range, options: { inlineClassName: 'template-variable-item', @@ -133,8 +133,9 @@ class VariableReplace { } public getProviderConfig(replacedList: IReplacedVariableItem[] = [], lineNumber: number, column: number) { - const variable = replacedList.find(v => v.range.startLineNumber === lineNumber - && v.range.startColumn <= column && column <= v.range.endColumn); + const variable = replacedList.find( + (v) => v.range.startLineNumber === lineNumber && v.range.startColumn <= column && column <= v.range.endColumn, + ); if (variable) { return { range: variable.range, diff --git a/bcs-services/bcs-bscp/ui/src/utils/hooks/use-editor-variable-replace.ts b/bcs-services/bcs-bscp/ui/src/utils/hooks/use-editor-variable-replace.ts index 55df023757..1a4ed64f1b 100644 --- a/bcs-services/bcs-bscp/ui/src/utils/hooks/use-editor-variable-replace.ts +++ b/bcs-services/bcs-bscp/ui/src/utils/hooks/use-editor-variable-replace.ts @@ -73,7 +73,7 @@ class VariableReplace { } public highlightVariables() { - const configs = this.replacedList.map(variable => ({ + const configs = this.replacedList.map((variable) => ({ range: variable.range, options: { inlineClassName: 'template-variable-item', @@ -90,8 +90,9 @@ class VariableReplace { VariableReplace.hoverProvider = monaco.languages.registerHoverProvider('*', { provideHover(model, position) { const { lineNumber, column } = position; - const variable = self.replacedList.find(v => v.range.startLineNumber === lineNumber - && v.range.startColumn <= column && column <= v.range.endColumn); + const variable = self.replacedList.find( + (v) => v.range.startLineNumber === lineNumber && v.range.startColumn <= column && column <= v.range.endColumn, + ); if (variable) { return { range: variable.range, diff --git a/bcs-services/bcs-bscp/ui/src/utils/hooks/use-modal-close-confirmation.ts b/bcs-services/bcs-bscp/ui/src/utils/hooks/use-modal-close-confirmation.ts index dcf9f413d6..5a2acb2a55 100644 --- a/bcs-services/bcs-bscp/ui/src/utils/hooks/use-modal-close-confirmation.ts +++ b/bcs-services/bcs-bscp/ui/src/utils/hooks/use-modal-close-confirmation.ts @@ -1,18 +1,19 @@ import { InfoBox } from 'bkui-vue'; import { localT } from '../../i18n'; -const useModalCloseConfirmation = (title?: string, subTitle?: string) => new Promise((resolve) => { - InfoBox({ - title: title || localT('确认离开当前页?'), - subTitle: subTitle || localT('离开会导致未保存信息丢失'), - confirmText: localT('离开'), - 'ext-cls': 'info-box-style', - onConfirm: () => { - resolve(true); - }, - onClosed: () => { - resolve(false); - }, +const useModalCloseConfirmation = (title?: string, subTitle?: string) => + new Promise((resolve) => { + InfoBox({ + title: title || localT('确认离开当前页?'), + subTitle: subTitle || localT('离开会导致未保存信息丢失'), + confirmText: localT('离开'), + 'ext-cls': 'info-box-style', + onConfirm: () => { + resolve(true); + }, + onClosed: () => { + resolve(false); + }, + }); }); -}); export default useModalCloseConfirmation; diff --git a/bcs-services/bcs-bscp/ui/src/utils/index.ts b/bcs-services/bcs-bscp/ui/src/utils/index.ts index d59dbc395e..c77946ace4 100644 --- a/bcs-services/bcs-bscp/ui/src/utils/index.ts +++ b/bcs-services/bcs-bscp/ui/src/utils/index.ts @@ -4,11 +4,14 @@ import dayjs from 'dayjs'; export const byteUnitConverse = (size: number): string => { if (0 <= size && size < 1024) { return `${size}B`; - } if (1024 <= size && size < 1024 * 1024) { + } + if (1024 <= size && size < 1024 * 1024) { return `${Math.ceil(size / 1024)}KB`; - } if (1024 * 1024 <= size && size < 1024 * 1024 * 1024) { + } + if (1024 * 1024 <= size && size < 1024 * 1024 * 1024) { return `${(size / (1024 * 1024)).toFixed(1)}MB`; - } if (1024 * 1024 * 1024 <= size) { + } + if (1024 * 1024 * 1024 <= size) { return `${(size / (1024 * 1024 * 1024)).toFixed(1)}GB`; } return ''; @@ -16,7 +19,7 @@ export const byteUnitConverse = (size: number): string => { // 字符串内容的字节大小 // @notice:edge 79版本才开始支持,发布时间2020-01-15 https://developer.mozilla.org/zh-CN/docs/Web/API/TextEncode -export const stringLengthInBytes = (content: string) => (new TextEncoder().encode(content)).length; +export const stringLengthInBytes = (content: string) => new TextEncoder().encode(content).length; export const copyToClipBoard = (content: string) => { if (navigator.clipboard) { @@ -41,9 +44,11 @@ export const datetimeFormat = (str: string): string => dayjs(str).format('YYYY-M export const getDiffType = (base: string, current: string) => { if (base === '' && current !== '') { return 'add'; - } if (base !== '' && current === '') { + } + if (base !== '' && current === '') { return 'delete'; - } if (base !== '' && current !== '' && base !== current) { + } + if (base !== '' && current !== '' && base !== current) { return 'modify'; } return ''; diff --git a/bcs-services/bcs-bscp/ui/src/views/404.vue b/bcs-services/bcs-bscp/ui/src/views/404.vue index 4c16b87e54..eada914c75 100644 --- a/bcs-services/bcs-bscp/ui/src/views/404.vue +++ b/bcs-services/bcs-bscp/ui/src/views/404.vue @@ -1,11 +1,7 @@ diff --git a/bcs-services/bcs-bscp/ui/src/views/space/apply-perm-page.vue b/bcs-services/bcs-bscp/ui/src/views/space/apply-perm-page.vue index 6a15e8337b..0ca1cf186e 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/apply-perm-page.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/apply-perm-page.vue @@ -12,43 +12,46 @@
diff --git a/bcs-services/bcs-bscp/ui/src/views/space/credentials/associate-config-items/index.vue b/bcs-services/bcs-bscp/ui/src/views/space/credentials/associate-config-items/index.vue index a3a35f961c..aea381894a 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/credentials/associate-config-items/index.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/credentials/associate-config-items/index.vue @@ -4,8 +4,7 @@ width="400" :is-show="props.show" :before-close="handleBeforeClose" - @closed="handleClose" - > + @closed="handleClose">
+ @form-change="isFormChange = true" />
@@ -17,11 +17,16 @@ :max-data="1" :list="tagsData" :allow-create="true" - trigger="focus" - /> + trigger="focus" /> - +
@@ -32,8 +37,7 @@ v-for="item in SCRIPT_TYPE" :key="item.id" :class="['tab', { actived: formData.type === item.id }]" - @click="formData.type = item.id" - > + @click="formData.type = item.id"> {{ item.name }}
@@ -53,141 +57,142 @@ diff --git a/bcs-services/bcs-bscp/ui/src/views/space/scripts/list/script-cited.vue b/bcs-services/bcs-bscp/ui/src/views/space/scripts/list/script-cited.vue index b92170c1af..59feeb06e3 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/scripts/list/script-cited.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/scripts/list/script-cited.vue @@ -11,8 +11,7 @@ :remote-pagination="true" :pagination="pagination" @page-limit-change="handlePageLimitChange" - @page-value-change="refreshList" - > + @page-value-change="refreshList"> diff --git a/bcs-services/bcs-bscp/ui/src/views/space/scripts/list/script-list.vue b/bcs-services/bcs-bscp/ui/src/views/space/scripts/list/script-list.vue index f2b19c995a..b34b3df57c 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/scripts/list/script-list.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/scripts/list/script-list.vue @@ -14,8 +14,7 @@ v-for="(item, index) in tagsData" :key="index" :class="['group-item', { actived: selectedTag === item.tag }]" - @click="handleSelectTag(item.tag)" - > + @click="handleSelectTag(item.tag)"> {{ item.tag }} {{ item.counts }} @@ -24,15 +23,17 @@
- {{ t('新建脚本') }} + + + {{ t('新建脚本') }} + + @input="handleNameInputChange"> @@ -45,20 +46,16 @@ :remote-pagination="true" :pagination="pagination" @page-limit-change="handlePageLimitChange" - @page-value-change="handlePageCurrentChange" - > + @page-value-change="handlePageCurrentChange"> - + + @@ -104,12 +101,13 @@ + @confirm="handleDeleteScriptConfirm">
{{ t('脚本') }}: {{ deleteScriptItem?.hook.spec.name }}
-
{{ t('一旦删除,该操作将无法撤销,以下服务配置的未命名版本中引用该脚本也将清除') }}
+
+ {{ t('一旦删除,该操作将无法撤销,以下服务配置的未命名版本中引用该脚本也将清除') }} +
@@ -127,333 +125,334 @@ diff --git a/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/create-version.vue b/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/create-version.vue index 30f2d9a646..b7753acce6 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/create-version.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/create-version.vue @@ -6,8 +6,7 @@ placement="bottom-start" :disabled="props.creatable" :is-show="popoverShow" - @after-hidden="closePopover" - > + @after-hidden="closePopover"> {{ t('新建版本') }} @@ -31,8 +30,7 @@ :is-loading="listLoading" @value-change="afterDialogShow" @confirm="handleLoadScript" - @closed="dialogShow = false" - > + @closed="dialogShow = false"> + :input-search="false"> + :label="option.name"> diff --git a/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/index.vue b/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/index.vue index 82f3591ee0..dcbb037b99 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/index.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/index.vue @@ -8,8 +8,7 @@ :disabled="createBtnDisabled" :creatable="!unPublishVersion" @create="handleCreateVersionClick" - @edit="handleEditVersionClick" - /> + @edit="handleEditVersionClick" /> + @change="handleSearchInputChange"> @@ -35,32 +33,32 @@ @view="handleViewVersionClick" @page-change="refreshList" @page-limit-change="handlePageLimitChange" - @clear-str="clearStr" - > + @clear-str="clearStr"> @@ -84,8 +82,7 @@ :list="versionList" :pagination="pagination" @select="handleSelectVersion" - @page-change="refreshList" - /> + @page-change="refreshList" />
@@ -95,8 +92,7 @@ :script-id="scriptId" :editable="versionEditData.editable" @submitted="handleVersionEditSubmitted" - @close="versionEditData.panelOpen = false" - /> + @close="versionEditData.panelOpen = false" />
@@ -108,345 +104,346 @@ :type="scriptDetail.spec.type" :crt-version="crtVersion as IScriptVersion" :space-id="spaceId" - :script-id="scriptId" - /> + :script-id="scriptId" /> -
- {{ t('脚本名称') }}: {{ deleteScriptVersionItem?.hook_revision.spec.name }} + @confirm="handleDeleteScriptVersionConfirm"> +
+ {{ t('脚本名称') }}: + + {{ deleteScriptVersionItem?.hook_revision.spec.name }} +
{{ t('一旦删除,该操作将无法撤销,请谨慎操作') }}
diff --git a/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/script-version-diff.vue b/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/script-version-diff.vue index b8f52893a1..91ad3319be 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/script-version-diff.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/script-version-diff.vue @@ -10,8 +10,7 @@ :clearable="false" :filterable="true" @change="handleSelectVersion" - :show-on-init="true" - > + :show-on-init="true"> @@ -23,8 +22,7 @@ :current="crtVersion.spec.content" :current-language="props.type" :base="baseContent" - :base-language="props.type" - /> + :base-language="props.type" />
@@ -33,103 +31,103 @@ diff --git a/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/version-edit.vue b/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/version-edit.vue index 052f38b583..332dfbfcaf 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/version-edit.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/version-edit.vue @@ -4,8 +4,7 @@ v-model="localVal.content" :language="props.type" :editable="props.editable" - :upload-icon="props.editable" - > + :upload-icon="props.editable"> @@ -13,7 +12,7 @@
- + @@ -26,194 +25,197 @@ {{ props.versionData.id ? t('保存') : t('提交') }} - {{t('取消')}} + {{ t('取消') }}
diff --git a/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/version-list-full-table.vue b/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/version-list-full-table.vue index 8d16a20f05..a3f79cf452 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/version-list-full-table.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/version-list-full-table.vue @@ -5,8 +5,7 @@ :remote-pagination="true" :pagination="pagination" @page-limit-change="emits('pageLimitChange', $event)" - @page-value-change="emits('pageChange', $event)" - > + @page-value-change="emits('pageChange', $event)"> diff --git a/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/version-list-simple-table.vue b/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/version-list-simple-table.vue index 15f6ca1026..b8b66e9c2e 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/version-list-simple-table.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/version-list-simple-table.vue @@ -18,79 +18,78 @@ :limit="props.pagination.limit" :show-limit="false" :show-total-count="false" - @change="emits('pageChange', $event)" - /> + @change="emits('pageChange', $event)" /> diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/client/index.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/client/index.vue index 0067db69c6..b9ae7aae0f 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/client/index.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/client/index.vue @@ -1,5 +1,4 @@ - + diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/create-version/create-version-slider.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/create-version/create-version-slider.vue index 2d70a2a161..f37154f0c0 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/create-version/create-version-slider.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/create-version/create-version-slider.vue @@ -1,27 +1,42 @@ diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/create-version/index.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/create-version/index.vue index e3b6fe7fa6..be0508bbd1 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/create-version/index.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/create-version/index.vue @@ -5,9 +5,8 @@ theme="primary" :class="['trigger-button', { 'bk-button-with-no-perm': !props.hasPerm }]" :disabled="(props.hasPerm && allConfigCount === 0) || props.permCheckLoading" - @click="handleBtnClick" - > - {{t('生成版本')}} + @click="handleBtnClick"> + {{ t('生成版本') }} + @created="handleCreated" /> diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/detail-header.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/detail-header.vue index 16d46b5224..050a79b2e0 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/detail-header.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/detail-header.vue @@ -1,7 +1,7 @@ diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/modify-group-publish.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/modify-group-publish.vue index 552e292b41..f09d750ffe 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/modify-group-publish.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/modify-group-publish.vue @@ -6,8 +6,7 @@ theme="primary" :class="['trigger-button', { 'bk-button-with-no-perm': !props.hasPerm }]" :disabled="props.permCheckLoading" - @click="handleBtnClick" - > + @click="handleBtnClick"> {{ t('调整分组上线') }} @@ -31,8 +30,7 @@ :released-groups="releasedGroups" @open-preview-version-diff="openPreviewVersionDiff" @release-type-change="releaseType = $event" - @change="groups = $event" - > + @change="groups = $event"> diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/publish-version/confirm-dialog.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/publish-version/confirm-dialog.vue index 0df807b280..f44223b50a 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/publish-version/confirm-dialog.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/publish-version/confirm-dialog.vue @@ -7,13 +7,14 @@ :quick-close="false" :is-loading="pending" @closed="handleClose" - @confirm="handleConfirm" - > + @confirm="handleConfirm">
{{ group.name }}
- +
@@ -26,161 +27,163 @@ - + diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/publish-version/default-group-rules-popover.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/publish-version/default-group-rules-popover.vue index 864a1a907c..3ff9a51d97 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/publish-version/default-group-rules-popover.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/publish-version/default-group-rules-popover.vue @@ -1,11 +1,8 @@ diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/publish-version/select-group/preview.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/publish-version/select-group/preview.vue index 250ee860a4..b01210badf 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/publish-version/select-group/preview.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/publish-version/select-group/preview.vue @@ -1,14 +1,14 @@ diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/publish-version/select-group/tree.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/publish-version/select-group/tree.vue index a194aa9d6b..ee20abf844 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/publish-version/select-group/tree.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/publish-version/select-group/tree.vue @@ -2,8 +2,8 @@
- {{t('全选')}} - {{t('全不选')}} + {{ t('全选') }} + {{ t('全不选') }}
- + @@ -43,8 +47,7 @@ :selectable="false" :data="searchTreeData" :expand-all="false" - :show-node-type-icon="false" - > + :show-node-type-icon="false"> diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/service-selector.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/service-selector.vue index 4360aa0fcc..64f968b9a5 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/service-selector.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/service-selector.vue @@ -18,20 +18,16 @@
- +
-
{{ item.spec.name }}
-
{{ item.spec.config_type === 'file' ? t('文件型'): t('键值型') }}
-
+ v-cursor="{ + active: !item.permissions.view, + }" + :class="['service-option-item', { 'no-perm': !item.permissions.view }]" + @click="handleOptionClick(item, $event)"> +
{{ item.spec.name }}
+
{{ item.spec.config_type === 'file' ? t('文件型') : t('键值型') }}
+
diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/components/kv-config-content-editor.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/components/kv-config-content-editor.vue index 3d7d4f0582..ac252fc839 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/components/kv-config-content-editor.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/components/kv-config-content-editor.vue @@ -4,7 +4,7 @@
- {{t('仅支持大小不超过')}}2M + {{ t('仅支持大小不超过') }}2M
+ @click="handleOpenFullScreen" /> + @click="handleCloseFullScreen" />
@@ -33,112 +31,110 @@ :model-value="props.content" :editable="editable" :language="languages" - @update:model-value="emits('change', $event)" - /> + @update:model-value="emits('change', $event)" />
diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/components/kv-import-editor.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/components/kv-import-editor.vue index 5fff48759e..9271e19e3b 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/components/kv-import-editor.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/components/kv-import-editor.vue @@ -14,16 +14,14 @@ placement: 'top', distance: 20, }" - @click="separatorShow = !separatorShow" - /> + @click="separatorShow = !separatorShow" /> + @click="codeEditorRef.openSearch()" /> + @click="handleOpenFullScreen" /> + @click="handleCloseFullScreen" />
@@ -50,8 +46,7 @@ v-model="kvsContent" @enter="separatorShow = true" :error-line="errorLine" - :placeholder="editorPlaceholder" - /> + :placeholder="editorPlaceholder" />
@@ -60,184 +55,184 @@ diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/components/read-file-content.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/components/read-file-content.vue index 7708e991a0..acc7eb2af8 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/components/read-file-content.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/components/read-file-content.vue @@ -1,31 +1,30 @@ diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/components/version-diff/aside-menu/configs.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/components/version-diff/aside-menu/configs.vue index fdaa509a59..f4afa34e5f 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/components/version-diff/aside-menu/configs.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/components/version-diff/aside-menu/configs.vue @@ -7,8 +7,7 @@ v-if="isBaseVersionExist" v-model="isOnlyShowDiff" class="view-diff-checkbox" - @change="handleSearch" - > + @change="handleSearch"> {{ t('只查看差异文件') }}({{ diffCount }})
@@ -38,8 +37,7 @@ version: config.template_revision_id, permission: config.permission, }) - " - > + "> {{ config.name }}
@@ -50,724 +48,723 @@ class="empty-tips" :is-search-empty="isSearchEmpty" :empty-title="t('没有差异配置文件')" - @clear="clearStr" - > + @clear="clearStr">
diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/components/version-diff/aside-menu/index.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/components/version-diff/aside-menu/index.vue index 546c0d0e8a..de8cf14cdb 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/components/version-diff/aside-menu/index.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/components/version-diff/aside-menu/index.vue @@ -1,6 +1,6 @@ diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/components/version-diff/aside-menu/menu-list.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/components/version-diff/aside-menu/menu-list.vue index 37de5ea928..de7a0cd7e7 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/components/version-diff/aside-menu/menu-list.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/components/version-diff/aside-menu/menu-list.vue @@ -19,29 +19,32 @@ diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/components/version-diff/index.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/components/version-diff/index.vue index 7adb0e5e0f..b58b5e3e21 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/components/version-diff/index.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/components/version-diff/index.vue @@ -4,8 +4,7 @@ :title="t('版本对比')" ext-cls="config-version-diff-slider" :width="1200" - @closed="handleClose" - > + @closed="handleClose">
+ @selected="handleSelectDiffItem" />
diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-simple-list/config-list-kv-with-template.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-simple-list/config-list-kv-with-template.vue index 8ff31df0f8..cec9882681 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-simple-list/config-list-kv-with-template.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-simple-list/config-list-kv-with-template.vue @@ -4,8 +4,7 @@ v-model="searchStr" class="config-search-input" :placeholder="t('配置项名/创建人/修改人')" - @search="getListData" - /> + @search="getListData" />
{{ config.spec.key }}
@@ -17,176 +16,175 @@ v-model:show="isShowEdit" :bk-biz-id="props.bkBizId" :app-id="props.appId" - :config="(selectedConfig as IConfigKvItem)" + :config="selectedConfig as IConfigKvItem" :editable="true" - @confirm="getListData" - /> - + @confirm="getListData" /> + diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-simple-list/config-list-with-templates.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-simple-list/config-list-with-templates.vue index bc5ac5c8cb..5bd548901c 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-simple-list/config-list-with-templates.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-simple-list/config-list-with-templates.vue @@ -4,8 +4,7 @@ v-model="searchStr" class="config-search-input" :placeholder="t('配置文件名/创建人/修改人')" - @search="getListData" - /> + @search="getListData" />
@@ -17,12 +16,11 @@ v-for="config in group.configs" :class="['config-item', { disabled: config.file_state === 'DELETE' }]" :key="config.id" - @click="handleConfigClick(config, group.id)" - > + @click="handleConfigClick(config, group.id)">
{{ config.name }}
{{ getConfigTypeName(config.file_type) }}
- +
@@ -30,314 +28,313 @@ v-model:show="editConfigSliderData.open" :bk-biz-id="props.bkBizId" :app-id="props.appId" - :config-id="editConfigSliderData.id" - /> + :config-id="editConfigSliderData.id" /> + :version-id="versionData.id" /> diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-simple-list/config-list.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-simple-list/config-list.vue index 8e204ea305..60928f41ab 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-simple-list/config-list.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-simple-list/config-list.vue @@ -6,8 +6,7 @@ v-for="config in configList" :class="['config-item', { disabled: config.file_state === 'DELETE' }]" :key="config.id" - @click="handleEditConfigOpen(config)" - > + @click="handleEditConfigOpen(config)">
{{ config.spec.name }}
{{ getConfigTypeName(config.spec.file_type) }}
@@ -18,113 +17,112 @@ diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-simple-list/index.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-simple-list/index.vue index 0343677cd1..3181250508 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-simple-list/index.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-simple-list/index.vue @@ -1,19 +1,19 @@ diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/config-form-kv.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/config-form-kv.vue index 088ab348a7..f0d5e24e70 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/config-form-kv.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/config-form-kv.vue @@ -1,7 +1,7 @@ diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/config-form.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/config-form.vue index ee343f7f0b..7537de7ec4 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/config-form.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/config-form.vue @@ -5,18 +5,19 @@ v-model="localVal.name" :placeholder="t('请输入1~64个字符,只允许英文、数字、下划线、中划线或点')" :disabled="!editable" - @input="change" - /> + @input="change" /> @@ -28,8 +29,7 @@ :disabled="!editable" :placeholder="t('请输入')" :resize="true" - @input="change" - /> + @input="change" /> @@ -46,15 +46,13 @@ theme="light" trigger="manual" placement="top" - :is-show="showPrivilegeErrorTips" - > + :is-show="showPrivilegeErrorTips"> + @blur="handlePrivilegeInputBlur" /> diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/create-config/pkg-templates-table.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/create-config/pkg-templates-table.vue index 4cd8c247d2..58bc194967 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/create-config/pkg-templates-table.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/create-config/pkg-templates-table.vue @@ -8,8 +8,7 @@ v-bk-tooltips="{ content: t('检测到模板冲突,请先删除冲突套餐'), }" - class="conflict-icon" - /> + class="conflict-icon" />
@@ -25,8 +24,7 @@ + :class="{ 'has-conflict': props.conflictTpls.includes(tpl.id) }"> @@ -38,21 +36,18 @@ :clearable="false" :popover-options="{ theme: 'light bk-select-popover add-config-selector-popover' }" :model-value="getVersionSelectVal(tpl.id)" - @change="handleSelectVersion(tpl.id, tpl.versions, $event)" - > + @change="handleSelectVersion(tpl.id, tpl.versions, $event)"> + :label="version.name">
+ class="version-name"> {{ version.name }}
@@ -70,262 +65,264 @@ diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/create-config/pkg-tree.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/create-config/pkg-tree.vue index 8371723bb0..a3ce3ab21a 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/create-config/pkg-tree.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/create-config/pkg-tree.vue @@ -2,7 +2,9 @@

{{ t('从配置模板导入') }}

- {{ t('管理模板') }} + + {{ t('管理模板') }} +
+ :show-node-type-icon="false"> diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/edit-config-kv.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/edit-config-kv.vue index 95787a5332..cbf0a015fd 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/edit-config-kv.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/edit-config-kv.vue @@ -4,115 +4,114 @@ :title="t('编辑配置项')" :is-show="props.show" :before-close="handleBeforeClose" - @closed="close" - > + @closed="close">
+ @change="handleChange" />
-
- {{ t('保存') }} - {{ t('取消') }} + {{ t('保存') }} + {{ t('取消') }}
diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/edit-config.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/edit-config.vue index 3b8d35e919..5233f215bd 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/edit-config.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/edit-config.vue @@ -4,8 +4,7 @@ :title="t('编辑配置文件')" :is-show="props.show" :before-close="handleBeforeClose" - @closed="close" - > + @closed="close"> + @change="handleChange" />
+ @click="handleSubmit"> {{ t('保存') }} {{ t('取消') }} @@ -34,152 +31,152 @@ diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/index.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/index.vue index b4d35d83f0..bae732414b 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/index.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/index.vue @@ -8,23 +8,16 @@ :app-id="props.appId" @created="refreshConfigList" @imported="refreshConfigList" - @uploaded="refreshConfigList(true)" - /> + @uploaded="refreshConfigList(true)" /> + :verision-id="versionData.id" />
- +
+ @clear-str="clearStr" />
diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/replace-template-version.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/replace-template-version.vue index 7f4ffea8f3..4d881b4956 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/replace-template-version.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/replace-template-version.vue @@ -9,8 +9,7 @@ :confirm-text="t('确定')" :cancel-text="t('取消')" @confirm="handleReplaceConfirm" - @closed="close" - > + @closed="close">
{{ props.versionName }}
@@ -22,15 +21,13 @@ v-overflow-title :key="option.isLatest ? 0 : option.id" :value="option.isLatest ? 0 : option.id" - :label="option.name" - > + :label="option.name">
+ class="version-name"> {{ option.name }}
@@ -40,117 +37,117 @@ diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/tables/status-tag.ts b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/tables/status-tag.ts index 608a8e5ceb..dfa2aea836 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/tables/status-tag.ts +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/tables/status-tag.ts @@ -6,16 +6,20 @@ const StatusTag = (props: { status: string }) => { return '--'; } const tag = CONFIG_STATUS_MAP[props.status as keyof typeof CONFIG_STATUS_MAP]; - return h('span', { - class: ['status-tag', props.status.toLocaleLowerCase()], - style: { - color: tag.color, - backgroundColor: tag.bgColor, - padding: '4px 10px', - borderRadius: '2px', - fontSize: '12px', + return h( + 'span', + { + class: ['status-tag', props.status.toLocaleLowerCase()], + style: { + color: tag.color, + backgroundColor: tag.bgColor, + padding: '4px 10px', + borderRadius: '2px', + fontSize: '12px', + }, }, - }, tag.text); + tag.text, + ); }; export default StatusTag; diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/tables/table-with-kv.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/tables/table-with-kv.vue index 7dd88055c0..7a75e56d62 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/tables/table-with-kv.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/tables/table-with-kv.vue @@ -11,8 +11,7 @@ @page-limit-change="handlePageLimitChange" @page-value-change="refresh" @column-sort="handleSort" - @column-filter="handleFilter" - > + @column-filter="handleFilter"> @@ -30,15 +28,14 @@ + :filter="{ filterFn: () => true, list: filterList, checked: filterChecked }"> @@ -54,9 +51,9 @@ @@ -80,19 +79,17 @@ - + @confirm="getListData" /> + + @confirm="handleDeleteConfigConfirm">
{{ t('配置项') }}:{{ deleteConfig?.spec.key }}
@@ -100,255 +97,257 @@
diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/tables/table-with-pagination.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/tables/table-with-pagination.vue index 88b5f814c6..a649f8fe1c 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/tables/table-with-pagination.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/tables/table-with-pagination.vue @@ -7,8 +7,7 @@ :remote-pagination="true" :pagination="pagination" @page-limit-change="handlePageLimitChange" - @page-value-change="refresh($event)" - > + @page-value-change="refresh($event)"> @@ -43,24 +41,24 @@ @@ -71,130 +69,129 @@ :config-id="activeConfig" :bk-biz-id="props.bkBizId" :app-id="props.appId" - @confirm="getListData" - /> + @confirm="getListData" /> diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/tables/table-with-templates.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/tables/table-with-templates.vue index 0cf425def5..af2e7d9c75 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/tables/table-with-templates.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/tables/table-with-templates.vue @@ -3,13 +3,15 @@
{{ tpl.spec.name }}
- + - + @@ -26,8 +28,7 @@ v-if="isUnNamedVersion && group.id !== 0" v-cursor="{ active: !hasEditServicePerm }" :class="['delete-btn', { 'bk-text-with-no-perm': !hasEditServicePerm }]" - @click="handleDeletePkg(group.id, group.name)" - > + @click="handleDeletePkg(group.id, group.name)"> {{ t('移除套餐') }} @@ -50,8 +51,7 @@ theme="primary" :class="{ 'bk-text-with-no-perm': !hasEditServicePerm }" :disabled="hasEditServicePerm && config.file_state === 'DELETE'" - @click="handleViewConfig(config.id, 'config')" - > + @click="handleViewConfig(config.id, 'config')"> {{ config.name }} + @click="handleViewConfig(config.id, 'config')"> {{ config.name }} @@ -69,8 +68,7 @@ text theme="primary" :disabled="config.file_state === 'DELETE'" - @click="handleViewConfig(config.versionId, 'template')" - > + @click="handleViewConfig(config.versionId, 'template')"> {{ config.name }} @@ -79,7 +77,9 @@ - + @@ -55,151 +53,151 @@ diff --git a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-detail/operations/add-configs/create-new-config/index.vue b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-detail/operations/add-configs/create-new-config/index.vue index 76100bc784..3e89ea886b 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-detail/operations/add-configs/create-new-config/index.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-detail/operations/add-configs/create-new-config/index.vue @@ -5,8 +5,7 @@ :is-show="props.show" :quick-close="!isSelectPkgDialogShow" :before-close="handleBeforeClose" - @closed="close" - > + @closed="close">
+ @change="handleFormChange" />
{{ t('去创建') }} @@ -29,124 +27,123 @@ v-model:show="isSelectPkgDialogShow" :pending="pending" :config-form="configForm" - @confirm="handleCreateConfirm" - /> + @confirm="handleCreateConfirm" /> diff --git a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-detail/operations/add-configs/create-new-config/select-package.vue b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-detail/operations/add-configs/create-new-config/select-package.vue index 8733f8abde..e97391921a 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-detail/operations/add-configs/create-new-config/select-package.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-detail/operations/add-configs/create-new-config/select-package.vue @@ -9,8 +9,7 @@ :quick-close="false" :is-loading="props.pending" @confirm="handleConfirm" - @closed="close" - > + @closed="close"> diff --git a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-detail/tables/common-config-table.vue b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-detail/tables/common-config-table.vue index e88dbf77f1..938f2462db 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-detail/tables/common-config-table.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-detail/tables/common-config-table.vue @@ -10,8 +10,7 @@ :placeholder="t('配置文件名称/路径/描述/创建人/更新人')" :clearable="true" @clear="refreshList()" - @input="handleSearchInputChange" - > + @input="handleSearchInputChange"> @@ -27,10 +26,9 @@ :pagination="pagination" :is-selected-fn="isSelectedFn" @page-limit-change="handlePageLimitChange" - @page-value-change="refreshList($event,true)" + @page-value-change="refreshList($event, true)" @selection-change="handleSelectionChange" - @select-all="handleSelectAll" - > + @select-all="handleSelectAll"> diff --git a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-detail/tables/config-in-all.vue b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-detail/tables/config-in-all.vue index 2b50de8696..e37a19c0e1 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-detail/tables/config-in-all.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-detail/tables/config-in-all.vue @@ -5,8 +5,7 @@ current-pkg="all" :show-cited-by-pkgs-col="true" :show-bound-by-apps-col="true" - :get-config-list="getConfigList" - > + :get-config-list="getConfigList"> diff --git a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-detail/tables/config-in-package.vue b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-detail/tables/config-in-package.vue index b62d6138ed..1d2060b3ad 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-detail/tables/config-in-package.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-detail/tables/config-in-package.vue @@ -6,8 +6,7 @@ :show-cited-by-pkgs-col="true" :show-bound-by-apps-col="true" :current-pkg="currentPkg" - :get-config-list="getConfigList" - > + :get-config-list="getConfigList"> diff --git a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-detail/tables/config-without-package.vue b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-detail/tables/config-without-package.vue index d617c60582..42c8beef6e 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-detail/tables/config-without-package.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-detail/tables/config-without-package.vue @@ -5,16 +5,14 @@ :current-template-space="currentTemplateSpace" current-pkg="no_specified" :space-id="spaceId" - :get-config-list="getConfigList" - > + :get-config-list="getConfigList"> diff --git a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-detail/use-package-apps.vue b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-detail/use-package-apps.vue index 096361cbc6..2d8a9b6db3 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-detail/use-package-apps.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-detail/use-package-apps.vue @@ -5,16 +5,14 @@ :disabled="tplCounts === 0" :filterable="true" :input-search="false" - :search-placeholder="$t('请输入关键字')" - > + :search-placeholder="$t('请输入关键字')"> diff --git a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-menu/item.vue b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-menu/item.vue index a501eac4b5..a4b8cbbacb 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-menu/item.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-menu/item.vue @@ -16,8 +16,7 @@ placement="bottom-end" :popover-delay="[0, 100]" :arrow="false" - :is-show="popoverShow" - > + :is-show="popoverShow"> diff --git a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-menu/menu.vue b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-menu/menu.vue index 1244f1d1b6..110d2d0519 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-menu/menu.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-menu/menu.vue @@ -15,8 +15,7 @@ :pkg="pkg" :current-pkg="currentPkg" @select="handleSelect" - @open-slider="handlePkgAction" - /> + @open-slider="handlePkgAction" />
@@ -31,8 +30,7 @@ v-if="countOfTemplatesForNoSpecifiedPackage" :pkg="menuItemOfNoSpecifiedPackage" :current-pkg="currentPkg" - @select="handleSelect" - > + @select="handleSelect"> @@ -42,303 +40,299 @@ + @created="handlePkgCreated" /> + :pkg="editingPkgData.data as ITemplatePackageItem" + @edited="getList" /> + :pkg="cloningPkgData.data as ITemplatePackageItem" + @created="getList" /> + :pkg="deletingPkgData.data as ITemplatePackageItem" + @deleted="handlePkgDeleted" /> diff --git a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-menu/package-clone.vue b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-menu/package-clone.vue index 0b336c069f..e81f07d311 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-menu/package-clone.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-menu/package-clone.vue @@ -1,5 +1,10 @@ diff --git a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-menu/package-create.vue b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-menu/package-create.vue index 8b3863a406..64376555fc 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-menu/package-create.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-menu/package-create.vue @@ -1,5 +1,10 @@ diff --git a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-menu/package-delete.vue b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-menu/package-delete.vue index 4a5729c950..ecbb7d6f08 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-menu/package-delete.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-menu/package-delete.vue @@ -3,19 +3,20 @@ :is-show="isShow" :title="t('确认删除该配置模板套餐?')" @confirm="handleDelete" - @close="emits('update:show',false)" - > -
- {{ t('配置模板套餐') }}: {{ props.pkg.spec.name }} + @close="emits('update:show', false)"> +
+ {{ t('配置模板套餐') }}: {{ props.pkg.spec.name }} +
+
+ {{ t('一旦删除,该操作将无法撤销,以下服务配置的未命名版本中引用该套餐的内容也将清除') }}
-
{{ t('一旦删除,该操作将无法撤销,以下服务配置的未命名版本中引用该套餐的内容也将清除') }}
@@ -26,125 +27,125 @@ diff --git a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-menu/package-edit.vue b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-menu/package-edit.vue index 1e73d6cda7..874c5f8047 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-menu/package-edit.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-menu/package-edit.vue @@ -1,5 +1,10 @@ diff --git a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-menu/package-form.vue b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-menu/package-form.vue index b3002127eb..889855d797 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-menu/package-form.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-menu/package-form.vue @@ -4,7 +4,14 @@ - + @@ -19,14 +26,9 @@ filterable :placeholder="t('请选择服务')" :loading="serviceLoading" - @change="handleServiceChange" - > - + @change="handleServiceChange"> + +

{{ t('提醒:修改可见范围后,服务') }} @@ -37,111 +39,111 @@ diff --git a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/space/create.vue b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/space/create.vue index 9125a91516..b52a6de3db 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/space/create.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/space/create.vue @@ -10,79 +10,84 @@ :esc-close="false" :quick-close="false" @confirm="handleCreate" - @closed="handleClose" - > + @closed="handleClose"> - + diff --git a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/space/delete.vue b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/space/delete.vue index 68444a00e5..ffcebc2783 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/space/delete.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/space/delete.vue @@ -1,8 +1,5 @@ - - + + diff --git a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/space/edit.vue b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/space/edit.vue index 05e602a328..9909e4d548 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/space/edit.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/space/edit.vue @@ -9,11 +9,10 @@ :esc-close="false" :quick-close="false" @confirm="handleEdit" - @closed="handleClose" - > + @closed="handleClose"> @@ -25,77 +24,77 @@ diff --git a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/space/selector.vue b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/space/selector.vue index 7957930243..7959c84bc9 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/space/selector.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/space/selector.vue @@ -8,8 +8,7 @@ :model-value="currentTemplateSpace" :popover-options="{ theme: 'light bk-select-popover template-space-selector-popover' }" @toggle="selectorOpen = $event" - @change="handleSelect" - > + @change="handleSelect"> diff --git a/bcs-services/bcs-bscp/ui/src/views/space/templates/version-manage/index.vue b/bcs-services/bcs-bscp/ui/src/views/space/templates/version-manage/index.vue index 2203bb704e..94df5be8c4 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/templates/version-manage/index.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/templates/version-manage/index.vue @@ -3,16 +3,20 @@

- {{t('新建版本')}} + {{ t('新建版本') }} - +
+ @select="handleOpenDetailTable($event, 'view')" /> + @select="handleOpenDetailTable($event, 'view')" />
+ @closed="selectVersionDialog.open = false"> @@ -62,236 +63,236 @@
diff --git a/bcs-services/bcs-bscp/ui/src/views/space/templates/version-manage/template-version-diff.vue b/bcs-services/bcs-bscp/ui/src/views/space/templates/version-manage/template-version-diff.vue index 26bccb925f..2df418b7f2 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/templates/version-manage/template-version-diff.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/templates/version-manage/template-version-diff.vue @@ -5,20 +5,18 @@ diff --git a/bcs-services/bcs-bscp/ui/src/views/space/variables/variables-content-editor.vue b/bcs-services/bcs-bscp/ui/src/views/space/variables/variables-content-editor.vue index dae17c1ff8..4a9bd689c0 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/variables/variables-content-editor.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/variables/variables-content-editor.vue @@ -14,16 +14,14 @@ placement: 'top', distance: 20, }" - @click="separatorShow = !separatorShow" - /> + @click="separatorShow = !separatorShow" /> + @click="codeEditorRef.openSearch()" /> + @click="handleOpenFullScreen" /> + @click="handleCloseFullScreen" />
@@ -51,8 +47,7 @@ @enter="separatorShow = true" @validate="handleValidateEditor" :error-line="errorLine" - :placeholder="editorPlaceholder" - /> + :placeholder="editorPlaceholder" />
@@ -61,185 +56,189 @@ diff --git a/bcs-services/bcs-bscp/ui/src/views/space/whitelist-apply-page.vue b/bcs-services/bcs-bscp/ui/src/views/space/whitelist-apply-page.vue index ea08af8e7a..793e555ff8 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/whitelist-apply-page.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/whitelist-apply-page.vue @@ -1,7 +1,5 @@ diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/create-config/batch-upload.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/create-config/batch-upload.vue index 361d0d47b4..fcd349460d 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/create-config/batch-upload.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/create-config/batch-upload.vue @@ -115,7 +115,6 @@ loading.value = true; try { const res = await importNonTemplateConfigFile(props.bkBizId, props.appId, option.file); - console.log(res); existConfigList.value = res.exist; nonExistConfigList.value = res.non_exist; nonExistConfigList.value.forEach((item: IConfigImportItem) => { diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/index.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/index.vue index bae732414b..de39b013f7 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/index.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/index.vue @@ -17,7 +17,7 @@ :app-id="props.appId" :verision-id="versionData.id" />
- +
{{t('配置文件名称')}}{{ t('配置文件名称') }} {{ t('配置模板版本') }} {{ t('配置路径') }} {{ t('创建人') }} {{ t('修改人') }} {{ t('修改时间') }}{{ t('变更状态') }} + {{ t('变更状态') }} + {{ t('操作') }}
{{ config.creator }} {{ config.reviser }} {{ config.update_at }} + +
@@ -91,8 +91,7 @@ theme="primary" :class="{ 'bk-text-with-no-perm': !hasEditServicePerm }" :disabled="hasEditServicePerm && config.file_state === 'DELETE'" - @click="handleEditOpen(config)" - > + @click="handleEditOpen(config)"> {{ t('编辑') }} + @click="handleDel(config)"> {{ t('删除') }} @@ -127,21 +125,20 @@ text theme="primary" :class="{ 'bk-text-with-no-perm': !hasEditServicePerm }" - @click="handleOpenReplaceVersionDialog(group.id, config)" - > + @click="handleOpenReplaceVersionDialog(group.id, config)"> {{ t('替换版本') }}
@@ -167,15 +164,13 @@ :config-id="activeConfig" :bk-biz-id="props.bkBizId" :app-id="props.appId" - @confirm="handleEditConfigConfirm" - /> + @confirm="handleEditConfigConfirm" /> + :version-id="versionData.id" /> + @updated="getAllConfigList" /> + @confirm="handleDeleteConfigConfirm">
- {{t('配置文件')}}:{{ deleteConfig?.name }} + {{ t('配置文件') }}:{{ deleteConfig?.name }}
{{ t('一旦删除,该操作将无法撤销,请谨慎操作') }}
@@ -199,545 +192,545 @@ v-model:isShow="isDeletePkgDialogShow" :title="t('确认移除该配置模板套餐?')" :confirm-text="t('移除')" - @confirm="handleDeletePkgConfirm" - > + @confirm="handleDeletePkgConfirm">
- {{t('配置模板套餐')}}: {{ deleteTemplatePkgName }} + {{ t('配置模板套餐') }}: {{ deleteTemplatePkgName }}
{{ t('移除后本服务配置将不再引用该配置模板套餐,以后需要时可以重新从配置模板导入') }}
diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/variables/edit-variables.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/variables/edit-variables.vue index 8e5f4b23ae..03c89f21c3 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/variables/edit-variables.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/variables/edit-variables.vue @@ -3,148 +3,154 @@ v-cursor="{ active: !hasEditServicePerm }" :class="{ 'bk-button-with-no-perm': !hasEditServicePerm }" @click="handleOpenSlider" - :disabled="variableList.length === 0" - > + :disabled="variableList.length === 0"> {{ t('设置变量') }} - + - + + @change="handleVariablesChange" />
- {{t('保存')}} + {{ t('保存') }} {{ t('取消') }}
diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/variables/reset-default-value.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/variables/reset-default-value.vue index 1452ddae67..94c2c9c6a5 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/variables/reset-default-value.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/variables/reset-default-value.vue @@ -1,62 +1,67 @@ diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/variables/variables-table.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/variables/variables-table.vue index f2b0c099b5..5d7b5a4a0e 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/variables/variables-table.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/variables/variables-table.vue @@ -22,15 +22,13 @@ 'td-cell-edit': isCellEditable(col.prop), 'has-error': errorDetails[variable.name]?.includes(col.prop), }, - ]" - > + ]"> diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/variables/view-variables.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/variables/view-variables.vue index be218b2fe3..77e9c8d297 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/variables/view-variables.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/variables/view-variables.vue @@ -1,10 +1,6 @@ diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/view-config.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/view-config.vue index 65fc3c4623..262543b7fc 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/view-config.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/config-table-list/view-config.vue @@ -10,8 +10,7 @@ :variables="variables" :bk-biz-id="props.bkBizId" :is-tpl="props.type === 'template'" - :id="props.type === 'template' ? tplSpaceId : props.appId" - /> + :id="props.type === 'template' ? tplSpaceId : props.appId" />
{{ t('关闭') }} @@ -19,180 +18,180 @@ diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/index.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/index.vue index bb59d98e47..21c7ebc7ff 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/index.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/config-list/index.vue @@ -5,15 +5,14 @@ diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/version-list-aside/index.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/version-list-aside/index.vue index 5af6562fef..2410026348 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/version-list-aside/index.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/version-list-aside/index.vue @@ -5,15 +5,14 @@ diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/version-list-aside/version-table-list.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/version-list-aside/version-table-list.vue index 38188f27eb..c435459365 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/version-list-aside/version-table-list.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/config/version-list-aside/version-table-list.vue @@ -19,7 +19,7 @@ class="version-search-input" :placeholder="t('版本名称/版本说明/修改人')" :width="320" - @search="handleSearch"/> + @search="handleSearch" /> + @page-value-change="refreshVersionList($event)"> diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/init-script/index.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/init-script/index.vue index 956108509a..8eb98f54f2 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/init-script/index.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/init-script/index.vue @@ -11,16 +11,14 @@ :loading="scriptsLoading" :list="scriptsData" @change="handleSelectScript" - @refresh="getScripts" - /> + @refresh="getScripts" /> - {{t('预览')}} + @click="handleOpenPreview('pre')"> + {{ t('预览') }} @@ -33,15 +31,13 @@ :loading="scriptsLoading" :list="scriptsData" @change="handleSelectScript" - @refresh="getScripts" - /> + @refresh="getScripts" /> + @click="handleOpenPreview('post')"> {{ t('预览') }} @@ -54,8 +50,7 @@ theme="primary" :disabled="hasEditServicePerm && submitButtonDisabled" :loading="pending" - @click="handleSubmit" - > + @click="handleSubmit"> {{ t('保存设置') }} @@ -64,8 +59,7 @@ :model-value="previewConfig.content" :editable="false" :upload-icon="false" - :language="previewConfig.type" - > + :language="previewConfig.type"> diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/init-script/script-selector.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/init-script/script-selector.vue index c230dec55a..7b4c99eeb2 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/init-script/script-selector.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/init-script/script-selector.vue @@ -7,20 +7,17 @@ :loading="props.loading" filterable :input-search="false" - @change="emits('change', $event, props.type)" - > + @change="emits('change', $event, props.type)"> + :label="script.name">
+ @click="handleScriptOptionClick(script.id, script.versionId, $event)"> {{ script.name }}
@@ -28,7 +25,7 @@
- {{t('脚本管理')}} + {{ t('脚本管理') }}
@@ -38,107 +35,107 @@ diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/list/components/card.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/list/components/card.vue index 2765674a9f..2e29035668 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/list/components/card.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/list/components/card.vue @@ -2,7 +2,7 @@
- {{ isFileType ? t('文件型') : t('键值型')}} + {{ isFileType ? t('文件型') : t('键值型') }}
{{ props.service.spec?.name }} @@ -18,7 +18,7 @@
- {{ props.service.config?.count }}{{ isFileType ? t('个配置文件') : t('个配置项')}} + {{ props.service.config?.count }}{{ isFileType ? t('个配置文件') : t('个配置项') }}
@@ -44,206 +44,206 @@
diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/list/components/create-service.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/list/components/create-service.vue index 8ba5e0914f..0f80198477 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/list/components/create-service.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/list/components/create-service.vue @@ -4,8 +4,7 @@ :is-show="props.show" :title="t('新建服务')" :before-close="handleBeforeClose" - @closed="close" - > + @closed="close">
@@ -21,12 +20,13 @@ :is-show="isShowConfirmDialog" :show-mask="true" :quick-close="false" - @closed="isShowConfirmDialog = false" - > + @closed="isShowConfirmDialog = false">
-
{{t('服务新建成功')}}
+
{{ t('服务新建成功') }}
@@ -33,8 +31,7 @@ text theme="primary" :class="{ 'bk-button-with-no-perm': props.permCheckLoading || !props.hasCreateServicePerm }" - @click="handleCreateServiceClick" - > + @click="handleCreateServiceClick"> {{ t('立即创建') }} @@ -53,8 +50,7 @@ :service="service" @edit="handleEditService" @delete="handleDeleteService" - @update="handleDeletedUpdate" - /> + @update="handleDeletedUpdate" />
+ @limit-change="handleLimitChange" />
@@ -79,8 +74,7 @@ header-align="center" footer-align="center" @value-change="dialogInputStr = ''" - :draggable="false" - > + :draggable="false">
确认删除服务?
@@ -100,9 +94,9 @@ theme="danger" style="margin-right: 20px" :disabled="dialogInputStr !== deleteService!.spec.name" - @click="handleDeleteConfirm" - >删除 + @click="handleDeleteConfirm"> + 删除 + 取消
@@ -110,311 +104,311 @@
diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/list/index.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/list/index.vue index 5db8cd6bf1..53d28bc666 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/list/index.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/list/index.vue @@ -11,92 +11,91 @@ :type="activeTabName" :space-id="spaceId" :perm-check-loading="permCheckLoading" - :has-create-service-perm="hasCreateServicePerm" - /> + :has-create-service-perm="hasCreateServicePerm" /> diff --git a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/components/link-to-app.vue b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/components/link-to-app.vue index 94464cdd45..406c2d711d 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/components/link-to-app.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/components/link-to-app.vue @@ -2,27 +2,26 @@