From 4ae2f63a88567088c9c221d4b7682606b27eb9e5 Mon Sep 17 00:00:00 2001 From: ibuler Date: Tue, 15 Mar 2022 20:52:15 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=BA=9Bbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ListTable/TableAction/ImportDialog.vue | 16 ++++++++++++++-- src/i18n/langs/cn.json | 1 + src/i18n/langs/en.json | 1 + src/views/accounts/GatheredUser/TaskList.vue | 5 +++-- src/views/assets/Asset/AssetList.vue | 10 +++++----- src/views/users/Role/RoleList/BaseRoleList.vue | 3 +++ 6 files changed, 27 insertions(+), 9 deletions(-) diff --git a/src/components/ListTable/TableAction/ImportDialog.vue b/src/components/ListTable/TableAction/ImportDialog.vue index c24976ac9..67fe24e3b 100644 --- a/src/components/ListTable/TableAction/ImportDialog.vue +++ b/src/components/ListTable/TableAction/ImportDialog.vue @@ -13,8 +13,12 @@ > - {{ this.$t('common.Create') }} - {{ this.$t('common.Update') }} + + {{ this.$t('common.Create') }} + + + {{ this.$t('common.Update') }} +
{{ downloadTemplateTitle }} @@ -77,6 +81,14 @@ export default { url: { type: String, default: () => '' + }, + canImportCreate: { + type: Boolean, + default: true + }, + canImportUpdate: { + type: Boolean, + default: true } }, data() { diff --git a/src/i18n/langs/cn.json b/src/i18n/langs/cn.json index 186f901fc..232259091 100644 --- a/src/i18n/langs/cn.json +++ b/src/i18n/langs/cn.json @@ -455,6 +455,7 @@ "Loading": "加载中" }, "updateErrorMsg": "更新失败", + "ErrorMsg": "错误", "updateSelected": "更新所选", "updateSuccessMsg": "更新成功", "SelectProperties": "选择属性", diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index a97c2707f..bef067614 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -443,6 +443,7 @@ "Loading": "Loading" }, "updateErrorMsg": "Update failed", + "ErrorMsg": "Error", "updateSelected": "Update selected", "updateSuccessMsg": "Update success", "SelectProperties": "Select properties", diff --git a/src/views/accounts/GatheredUser/TaskList.vue b/src/views/accounts/GatheredUser/TaskList.vue index 9f7f1da30..365e483a1 100644 --- a/src/views/accounts/GatheredUser/TaskList.vue +++ b/src/views/accounts/GatheredUser/TaskList.vue @@ -23,7 +23,8 @@ export default { resource: 'gatherusertask' }, columns: [ - 'name', 'nodes', 'is_periodic', 'periodic_display', 'executed_times', 'actions' + 'name', 'nodes', 'is_periodic', 'periodic_display', + 'executed_times', 'actions' ], columnsShow: { min: ['name', 'nodes', 'is_periodic', 'periodic_display', 'executed_times', 'actions'] @@ -74,7 +75,7 @@ export default { title: vm.$t('xpack.Execute'), name: 'execute', type: 'info', - can: vm.$hasPerm('xpack.change_gatherusertask'), + can: vm.$hasPerm('xpack.add_gatherusertaskexecution'), callback: function(data) { this.$axios.post( `/api/v1/xpack/gathered-user/task-executions/`, diff --git a/src/views/assets/Asset/AssetList.vue b/src/views/assets/Asset/AssetList.vue index 57c35da32..367a5a156 100644 --- a/src/views/assets/Asset/AssetList.vue +++ b/src/views/assets/Asset/AssetList.vue @@ -9,14 +9,14 @@
  • {{ this.$t('tree.MoveAssetToNode') }}
  • -
  • +
  • {{ this.$t('tree.UpdateNodeAssetHardwareInfo') }}
  • {{ this.$t('tree.TestNodeAssetConnectivity') }}
  • -
  • +
  • {{ this.$t('tree.ShowAssetOnlyCurrentNode') }}
  • @@ -24,7 +24,7 @@ {{ this.$t('tree.ShowAssetAllChildrenNode') }}
  • -
  • +
  • {{ this.$t('tree.CheckAssetsAmount') }}
  • @@ -385,7 +385,7 @@ export default { { key: 'fullName', label: this.$t('assets.FullName'), value: res.full_value } ] }).catch(error => { - this.$message.error(this.$t('common.getErrorMsg' + ' ' + error)) + this.$message.error(this.$t('common.ErrorMsg' + ' ' + error)) }) }, rCheckAssetsAmount: function() { @@ -394,7 +394,7 @@ export default { ).then(res => { openTaskPage(res['task']) }).catch(error => { - this.$message.error(this.$t('common.getErrorMsg' + ' ' + error)) + this.$message.error(this.$t('common.updateErrorMsg' + ' ' + error)) }) } } diff --git a/src/views/users/Role/RoleList/BaseRoleList.vue b/src/views/users/Role/RoleList/BaseRoleList.vue index 576377220..f017776b0 100644 --- a/src/views/users/Role/RoleList/BaseRoleList.vue +++ b/src/views/users/Role/RoleList/BaseRoleList.vue @@ -97,6 +97,9 @@ export default { hasMoreActions: false, canCreate: () => { return this.$hasPerm(`rbac.add_${this.scopeRole}`) + }, + importOptions: { + canImportUpdate: false } } }