From c89eca737f489835281eb80ee4d93c27c4d7b59d Mon Sep 17 00:00:00 2001 From: Bai Date: Thu, 4 Jun 2020 20:28:23 +0800 Subject: [PATCH 1/5] =?UTF-8?q?[Update]=20=E6=B7=BB=E5=8A=A0=E5=AF=86?= =?UTF-8?q?=E7=A0=81=E5=8C=A3=E5=AD=90=E5=88=97=E8=A1=A8=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/langs/cn.json | 3 + .../components/GenericTreeListPage/index.vue | 2 +- src/views/xpack/Vault/VaultList.vue | 201 ++++++++++++++++++ src/views/xpack/router.js | 14 +- 4 files changed, 218 insertions(+), 2 deletions(-) create mode 100644 src/views/xpack/Vault/VaultList.vue diff --git a/src/i18n/langs/cn.json b/src/i18n/langs/cn.json index 71fbb6659..44cd623fa 100644 --- a/src/i18n/langs/cn.json +++ b/src/i18n/langs/cn.json @@ -731,6 +731,9 @@ "dateLastLogin": "" }, "xpack": { + "Vault": { + "Vault": "密码匣子" + }, "Basic": "基本", "Other": "其他", "Admin": "管理员", diff --git a/src/layout/components/GenericTreeListPage/index.vue b/src/layout/components/GenericTreeListPage/index.vue index 4674f5403..a917eb055 100644 --- a/src/layout/components/GenericTreeListPage/index.vue +++ b/src/layout/components/GenericTreeListPage/index.vue @@ -1,7 +1,7 @@ diff --git a/src/views/xpack/Vault/VaultList.vue b/src/views/xpack/Vault/VaultList.vue new file mode 100644 index 000000000..339d9a7fa --- /dev/null +++ b/src/views/xpack/Vault/VaultList.vue @@ -0,0 +1,201 @@ + + + + + diff --git a/src/views/xpack/router.js b/src/views/xpack/router.js index d2c6dea54..dd758557b 100644 --- a/src/views/xpack/router.js +++ b/src/views/xpack/router.js @@ -182,7 +182,19 @@ export default { meta: { title: i18n.t('xpack.Cloud.SyncInstanceTaskUpdate') } } ] + }, + { + path: 'vault', + component: empty, + meta: { title: i18n.t('xpack.Vault.Vault'), activeMenu: '/xpack/vault/vault' }, + children: [ + { + path: 'vault', + component: () => import('@/views/xpack/Vault/VaultList.vue'), + name: 'VaultList', + meta: { title: i18n.t('xpack.Vault.Vault'), activeMenu: '/xpack/vault/vault' } + } + ] } - ] } From 2e25d4c91fc22298045d8b35a62e04bb731173d7 Mon Sep 17 00:00:00 2001 From: xinwen Date: Thu, 4 Jun 2020 20:42:14 +0800 Subject: [PATCH 2/5] =?UTF-8?q?[Fix]=20=E7=B3=BB=E7=BB=9F=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE/=E9=82=AE=E4=BB=B6=E8=AE=BE=E7=BD=AE=20=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E9=93=BE=E6=8E=A5=20=E9=94=99=E8=AF=AF=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/settings/Email.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/views/settings/Email.vue b/src/views/settings/Email.vue index c6c1150cb..3d943f17a 100644 --- a/src/views/settings/Email.vue +++ b/src/views/settings/Email.vue @@ -93,6 +93,8 @@ export default { } testEmailSetting(value).then(res => { vm.$message.success(res['msg']) + }).catch(res => { + vm.$message.error(res['response']['data']['error']) }) } } From 01e00cca73b5bee0998b471e57db880f5f571646 Mon Sep 17 00:00:00 2001 From: Bai Date: Thu, 4 Jun 2020 20:53:06 +0800 Subject: [PATCH 3/5] =?UTF-8?q?[Update]=20=E6=B7=BB=E5=8A=A0=E5=AF=86?= =?UTF-8?q?=E7=A0=81=E5=8C=A3=E5=AD=90=E5=88=9B=E5=BB=BA=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/langs/cn.json | 3 +- src/i18n/langs/en.json | 4 ++ src/views/xpack/Vault/VaultCreate.vue | 60 +++++++++++++++++++++++++++ src/views/xpack/Vault/index.vue | 13 ------ src/views/xpack/router.js | 7 ++++ 5 files changed, 73 insertions(+), 14 deletions(-) create mode 100644 src/views/xpack/Vault/VaultCreate.vue delete mode 100644 src/views/xpack/Vault/index.vue diff --git a/src/i18n/langs/cn.json b/src/i18n/langs/cn.json index 44cd623fa..838981dae 100644 --- a/src/i18n/langs/cn.json +++ b/src/i18n/langs/cn.json @@ -732,7 +732,8 @@ }, "xpack": { "Vault": { - "Vault": "密码匣子" + "Vault": "密码匣子", + "Create": "创建" }, "Basic": "基本", "Other": "其他", diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index 1bbd92ef4..1125967d0 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -724,6 +724,10 @@ "ResetAndDownloadSSHKey": "Reset and download SSH Key" }, "xpack": { + "Vault": { + "Vault": "Vault", + "Create": "Create" + }, "Admin": "Admin", "AssetCount": "Asset count", "Auditor": "Auditor", diff --git a/src/views/xpack/Vault/VaultCreate.vue b/src/views/xpack/Vault/VaultCreate.vue new file mode 100644 index 000000000..793fedfbd --- /dev/null +++ b/src/views/xpack/Vault/VaultCreate.vue @@ -0,0 +1,60 @@ + + + + + diff --git a/src/views/xpack/Vault/index.vue b/src/views/xpack/Vault/index.vue deleted file mode 100644 index 4b15380b0..000000000 --- a/src/views/xpack/Vault/index.vue +++ /dev/null @@ -1,13 +0,0 @@ - - - - - diff --git a/src/views/xpack/router.js b/src/views/xpack/router.js index dd758557b..bdbe3f911 100644 --- a/src/views/xpack/router.js +++ b/src/views/xpack/router.js @@ -193,6 +193,13 @@ export default { component: () => import('@/views/xpack/Vault/VaultList.vue'), name: 'VaultList', meta: { title: i18n.t('xpack.Vault.Vault'), activeMenu: '/xpack/vault/vault' } + }, + { + path: 'vault/create', + component: () => import('@/views/xpack/Vault/VaultCreate'), + name: 'VaultCreate', + meta: { title: i18n.t('xpack.Vault.Create'), activeMenu: '/xpack/vault/vault' }, + hidden: true } ] } From dae24502742a47111dffac8f7167501e1a66ac45 Mon Sep 17 00:00:00 2001 From: OrangeM21 Date: Thu, 4 Jun 2020 20:53:08 +0800 Subject: [PATCH 4/5] =?UTF-8?q?[fix]=E4=BF=AE=E5=A4=8DTree=20Error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/components/AutoDataZTree/index.vue | 8 +++++++- .../DataZTree/components/ZTree/index.vue | 2 +- .../components/NavHeader/AccountDropdown.vue | 8 ++++++-- yarn.lock | 14 +++++++------- 5 files changed, 22 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 0e3ac0ae3..92536773e 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "vuex": "3.1.0", "xterm": "^4.5.0", "xterm-addon-fit": "^0.3.0", - "ztree": "^3.5.24" + "@ztree/ztree_v3": "3.5.44" }, "devDependencies": { "@babel/core": "7.0.0", diff --git a/src/components/AutoDataZTree/index.vue b/src/components/AutoDataZTree/index.vue index 4e813bd8a..3ca9c3cf2 100644 --- a/src/components/AutoDataZTree/index.vue +++ b/src/components/AutoDataZTree/index.vue @@ -38,7 +38,10 @@ export default { enable: true, url: (process.env.VUE_APP_ENV === 'production') ? (`${this.setting.treeUrl}`) : (`${process.env.VUE_APP_BASE_API}${this.setting.treeUrl}`), autoParam: ['id=key', 'name=n', 'level=lv'], - type: 'get' + type: 'get', + headers: { + 'X-JMS-ORG': JSON.parse(this.$cookie.get('jms_current_org')).id || '' + } }, callback: { onRightClick: this.onRightClick.bind(this), @@ -68,6 +71,9 @@ export default { rMenu() { return this.$refs.dataztree.rMenu } + }, + mounted() { + }, methods: { editTreeNode: function() { diff --git a/src/components/DataZTree/components/ZTree/index.vue b/src/components/DataZTree/components/ZTree/index.vue index 884466a25..a44596d87 100644 --- a/src/components/DataZTree/components/ZTree/index.vue +++ b/src/components/DataZTree/components/ZTree/index.vue @@ -18,7 +18,7 @@ // 导入JQuery // eslint-disable-next-line no-unused-vars import $ from '@/utils/jquery-vendor.js' -import 'ztree' +import '@ztree/ztree_v3/js/jquery.ztree.core.min.js' import '@/styles/ztree.css' const defaultObject = { diff --git a/src/layout/components/NavHeader/AccountDropdown.vue b/src/layout/components/NavHeader/AccountDropdown.vue index 6d9449e43..e5b59bdd4 100644 --- a/src/layout/components/NavHeader/AccountDropdown.vue +++ b/src/layout/components/NavHeader/AccountDropdown.vue @@ -8,7 +8,7 @@ {{ $t('common.nav.Profile') }} -
+
{{ $t('common.nav.UserPage') }} @@ -46,13 +46,17 @@ export default { this.$log.debug('Current in admin role: ', inAdmin) return inAdmin }, + hasAdminOrg() { + return this.userAdminOrgList.length > 0 + }, hasAdminRole() { return this.currentOrgRoles.includes('Admin') }, ...mapGetters([ 'currentUser', 'currentRole', - 'currentOrgRoles' + 'currentOrgRoles', + 'userAdminOrgList' ]) }, methods: { diff --git a/yarn.lock b/yarn.lock index 3b2bdd359..3bd45af7c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1315,6 +1315,13 @@ version "4.2.2" resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d" +"@ztree/ztree_v3@3.5.44": + version "3.5.44" + resolved "https://registry.yarnpkg.com/@ztree/ztree_v3/-/ztree_v3-3.5.44.tgz#940890a91483bc8a7347f4fe4c9e6e3ffc7d61ec" + integrity sha512-+W6z8rCnls3/Zw9Q9JgpK9C6krQANoGk6wFupNY/aPumjb7JWQiX2V5Uzl12ClCPponaROle7cZxz4bsBWQPWw== + dependencies: + jquery ">=1.4.4" + abab@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.3.tgz#623e2075e02eb2d3f2475e49f99c91846467907a" @@ -10183,10 +10190,3 @@ zrender@4.3.0: version "4.3.0" resolved "https://registry.npm.taobao.org/zrender/download/zrender-4.3.0.tgz#9f056121b20bbae44414d287bf6a119ff7042661" integrity sha1-nwVhIbILuuREFNKHv2oRn/cEJmE= - -ztree@^3.5.24: - version "3.5.24" - resolved "https://registry.yarnpkg.com/ztree/-/ztree-3.5.24.tgz#b63fe52981fdf2c329675cfd2772f0d147521ff1" - integrity sha1-tj/lKYH98sMpZ1z9J3Lw0UdSH/E= - dependencies: - jquery ">=1.4.4" From d9016a4dcfa1a0a2559c13f30f1bef953be1bcfe Mon Sep 17 00:00:00 2001 From: Bai Date: Thu, 4 Jun 2020 21:02:44 +0800 Subject: [PATCH 5/5] =?UTF-8?q?[Update]=20=E4=BF=AE=E6=94=B9=20route=20?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=EF=BC=8Cvault=20/=20cloud?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/xpack/router.js | 40 +++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/views/xpack/router.js b/src/views/xpack/router.js index bdbe3f911..ad62ffea5 100644 --- a/src/views/xpack/router.js +++ b/src/views/xpack/router.js @@ -134,6 +134,26 @@ export default { } ] }, + { + path: 'vault', + component: empty, + meta: { title: i18n.t('xpack.Vault.Vault'), activeMenu: '/xpack/vault/vault' }, + children: [ + { + path: 'vault', + component: () => import('@/views/xpack/Vault/VaultList.vue'), + name: 'VaultList', + meta: { title: i18n.t('xpack.Vault.Vault'), activeMenu: '/xpack/vault/vault' } + }, + { + path: 'vault/create', + component: () => import('@/views/xpack/Vault/VaultCreate'), + name: 'VaultCreate', + meta: { title: i18n.t('xpack.Vault.Create'), activeMenu: '/xpack/vault/vault' }, + hidden: true + } + ] + }, { path: '/cloud', component: empty, @@ -182,26 +202,6 @@ export default { meta: { title: i18n.t('xpack.Cloud.SyncInstanceTaskUpdate') } } ] - }, - { - path: 'vault', - component: empty, - meta: { title: i18n.t('xpack.Vault.Vault'), activeMenu: '/xpack/vault/vault' }, - children: [ - { - path: 'vault', - component: () => import('@/views/xpack/Vault/VaultList.vue'), - name: 'VaultList', - meta: { title: i18n.t('xpack.Vault.Vault'), activeMenu: '/xpack/vault/vault' } - }, - { - path: 'vault/create', - component: () => import('@/views/xpack/Vault/VaultCreate'), - name: 'VaultCreate', - meta: { title: i18n.t('xpack.Vault.Create'), activeMenu: '/xpack/vault/vault' }, - hidden: true - } - ] } ] }