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 79a18c88a..3763d3459 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/i18n/langs/cn.json b/src/i18n/langs/cn.json index 12b05c9b3..39e1ef468 100644 --- a/src/i18n/langs/cn.json +++ b/src/i18n/langs/cn.json @@ -734,6 +734,10 @@ "dateLastLogin": "" }, "xpack": { + "Vault": { + "Vault": "密码匣子", + "Create": "创建" + }, "Basic": "基本", "Other": "其他", "Admin": "管理员", diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index c089f57d2..d1aeb296f 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -727,6 +727,10 @@ "ResetAndDownloadSSHKey": "Reset and download SSH Key" }, "xpack": { + "Vault": { + "Vault": "Vault", + "Create": "Create" + }, "Admin": "Admin", "AssetCount": "Asset count", "Auditor": "Auditor", 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/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/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']) }) } } 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/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/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 d2c6dea54..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, @@ -183,6 +203,5 @@ export default { } ] } - ] } 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"