From 0c33c7cd59cef4b1453bae043c3fd982fe2f687f Mon Sep 17 00:00:00 2001 From: jym503558564 <503558564@qq.com> Date: Thu, 21 May 2020 11:59:33 +0800 Subject: [PATCH 1/5] =?UTF-8?q?[Update]=20=E5=88=9D=E6=AD=A5=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0=E7=BB=84=E7=BB=87=E7=AE=A1=E7=90=86Page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/langs/cn.json | 2 +- src/views/xpack/Organization.vue | 13 ------- .../xpack/org/OrganizationDetail/index.vue | 38 +++++++++++++++++++ src/views/xpack/router.js | 27 +++++++++++++ 4 files changed, 66 insertions(+), 14 deletions(-) delete mode 100644 src/views/xpack/Organization.vue create mode 100644 src/views/xpack/org/OrganizationDetail/index.vue diff --git a/src/i18n/langs/cn.json b/src/i18n/langs/cn.json index 11b2932dc..0356fbd80 100644 --- a/src/i18n/langs/cn.json +++ b/src/i18n/langs/cn.json @@ -426,7 +426,7 @@ "options": "选项", "taskName": "任务名称", "dateStart": "开始日期", - "versionDetail": "" + "versionDetail": "版本详情" }, "perms": { "assetPermissions": "资产授权", diff --git a/src/views/xpack/Organization.vue b/src/views/xpack/Organization.vue deleted file mode 100644 index 79d434ce4..000000000 --- a/src/views/xpack/Organization.vue +++ /dev/null @@ -1,13 +0,0 @@ - - - - - diff --git a/src/views/xpack/org/OrganizationDetail/index.vue b/src/views/xpack/org/OrganizationDetail/index.vue new file mode 100644 index 000000000..c30243272 --- /dev/null +++ b/src/views/xpack/org/OrganizationDetail/index.vue @@ -0,0 +1,38 @@ + + + + + diff --git a/src/views/xpack/router.js b/src/views/xpack/router.js index 70a305604..0744f8b18 100644 --- a/src/views/xpack/router.js +++ b/src/views/xpack/router.js @@ -24,6 +24,33 @@ export default { component: () => import('@/views/xpack/GatherUser'), name: 'GatherUser', meta: { title: 'GatherUser' } + }, + { + path: 'orgs', + component: () => import('@/views/xpack/org/OrganizationList'), + name: 'OrganizationList', + meta: { title: 'OrganizationList' } + }, + { + path: 'orgs/create', + component: () => import('@/views/xpack/org/OrganizationCreateUpdate'), + name: 'OrganizationCreate', + hidden: true, + meta: { title: 'OrganizationCreate', activeMenu: '/xpack/orgs', action: 'create' } + }, + { + path: 'orgs/:id/update', + component: () => import('@/views/xpack/org/OrganizationCreateUpdate'), + name: 'OrganizationUpdate', + hidden: true, + meta: { title: 'OrganizationUpdate', activeMenu: '/xpack/orgs', action: 'update' } + }, + { + path: 'orgs/:id', + component: () => import('@/views/xpack/org/OrganizationDetail/index'), + name: 'OrganizationDetail', + hidden: true, + meta: { title: 'OrganizationDetail', activeMenu: '/xpack/orgs', action: 'detail' } } ] } From c821ef7e64db196d8c74f062af2926ec3c71ed74 Mon Sep 17 00:00:00 2001 From: jym503558564 <503558564@qq.com> Date: Thu, 21 May 2020 14:16:48 +0800 Subject: [PATCH 2/5] =?UTF-8?q?[Update]=20=E4=BF=AE=E6=94=B9=E7=BF=BB?= =?UTF-8?q?=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/langs/cn.json | 16 ++++++++++++++- .../OrganizationDetail/OrganizationDetail.vue | 7 +++---- .../xpack/org/OrganizationDetail/index.vue | 4 ++-- src/views/xpack/org/OrganizationList.vue | 20 +++++++++---------- src/views/xpack/router.js | 8 ++++---- 5 files changed, 34 insertions(+), 21 deletions(-) diff --git a/src/i18n/langs/cn.json b/src/i18n/langs/cn.json index f6b1a71bc..b7999f568 100644 --- a/src/i18n/langs/cn.json +++ b/src/i18n/langs/cn.json @@ -799,6 +799,20 @@ "GatherUserTaskList": "任务列表", "GatherUserTaskCreate": "创建任务", "Timer": "定时执行", - "GatherUserTaskUpdate": "更新任务" + "GatherUserTaskUpdate": "更新任务", + "OrganizationList": "组织管理", + "OrganizationCreate": "创建组织", + "OrganizationUpdate": "更新组织", + "OrganizationDetail": "组织详情", + "Admin": "管理员", + "Auditor": "审计员", + "User": "用户", + "UserGroup": "用户组", + "Asset": "资产", + "Domain": "网域", + "AdminUser": "管理用户", + "SystemUser": "系统用户", + "Label": "标签" + } } diff --git a/src/views/xpack/org/OrganizationDetail/OrganizationDetail.vue b/src/views/xpack/org/OrganizationDetail/OrganizationDetail.vue index c82a94dd8..277727fc2 100644 --- a/src/views/xpack/org/OrganizationDetail/OrganizationDetail.vue +++ b/src/views/xpack/org/OrganizationDetail/OrganizationDetail.vue @@ -11,8 +11,7 @@ diff --git a/src/views/xpack/api.js b/src/views/xpack/api.js index 25d386ca6..b07383122 100644 --- a/src/views/xpack/api.js +++ b/src/views/xpack/api.js @@ -23,3 +23,14 @@ export function restoreInterface() { method: 'get' }) } + +export function importLicense(formData) { + return request({ + url: '/api/v1/xpack/license/import', + method: 'post', + headers: { + 'Content-Type': 'multipart/form-data' + }, + data: formData + }) +} From 2d6792e197b36278025d613ecabece90594f655a Mon Sep 17 00:00:00 2001 From: jym503558564 <503558564@qq.com> Date: Thu, 21 May 2020 15:24:30 +0800 Subject: [PATCH 4/5] =?UTF-8?q?[Update]=20=E6=9B=B4=E6=96=B0=E5=A6=82?= =?UTF-8?q?=E6=9E=9Corg=E7=9A=84page=EF=BC=8C=E5=88=99getApiPath=E4=B8=8D?= =?UTF-8?q?=E5=8F=96xpack=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/common.js | 4 ++++ .../OrganizationDetail/OrganizationDetail.vue | 18 +++++++++--------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/utils/common.js b/src/utils/common.js index a0ab50c7f..f96219419 100644 --- a/src/utils/common.js +++ b/src/utils/common.js @@ -79,6 +79,10 @@ export function toSafeLocalDateStr(d) { export function getApiPath(that) { const pagePath = that.$route.path + const isOrgPath = pagePath.split('/').indexOf('orgs') !== -1 + if (isOrgPath) { + return `/api/v1/orgs/orgs/${pagePath.split('/').pop()}/` + } return `/api/v1${pagePath}/` } diff --git a/src/views/xpack/org/OrganizationDetail/OrganizationDetail.vue b/src/views/xpack/org/OrganizationDetail/OrganizationDetail.vue index 277727fc2..b7cf14527 100644 --- a/src/views/xpack/org/OrganizationDetail/OrganizationDetail.vue +++ b/src/views/xpack/org/OrganizationDetail/OrganizationDetail.vue @@ -43,15 +43,15 @@ export default { }, hasObjectsId: this.object.users, performAdd: (items) => { - // const objectId = this.object.id - const relationUrl = `/api/v1/orgs/orgs/${this.$route.params.id}/` + const objectId = this.object.id + const relationUrl = `/api/v1/orgs/orgs/${objectId}/` const usersId = items.map(v => v.value) const data = { users: usersId } return this.$axios.patch(relationUrl, data) }, performDelete: (item) => { - // const objectId = this.object.id - const relationUrl = `/api/v1/orgs/orgs/${this.$route.params.id}/` + const objectId = this.object.id + const relationUrl = `/api/v1/orgs/orgs/${objectId}/` const objectOldRelationUsers = this.object.users const objectNewRelationUsers = objectOldRelationUsers.filter(v => v !== item.value) const data = { users: objectNewRelationUsers } @@ -74,15 +74,15 @@ export default { }, hasObjectsId: this.object.admin_users, performAdd: (items) => { - // const objectId = this.object.id - const relationUrl = `/api/v1/orgs/orgs/${this.$route.params.id}/` + const objectId = this.object.id + const relationUrl = `/api/v1/orgs/orgs/${objectId}/` const adminUsersId = items.map(v => v.value) const data = { admin_users: adminUsersId } return this.$axios.patch(relationUrl, data) }, performDelete: (item) => { - // const objectId = this.object.id - const relationUrl = `/api/v1/orgs/orgs/${this.$route.params.id}/` + const objectId = this.object.id + const relationUrl = `/api/v1/orgs/orgs/${objectId}/` const objectOldRelationAdminUsers = this.object.admin_users const objectNewRelationAdminUsers = objectOldRelationAdminUsers.filter(v => v !== item.value) const data = { system_users: objectNewRelationAdminUsers } @@ -110,7 +110,7 @@ export default { value: this.object.date_created }, { - key: this.$t('common.name'), + key: this.$t('common.Comment'), value: this.object.comment } ] From 253be38771520f87de983c5284af34a473d64b31 Mon Sep 17 00:00:00 2001 From: Eric Date: Thu, 21 May 2020 15:29:53 +0800 Subject: [PATCH 5/5] [Update] update license view --- src/i18n/langs/cn.json | 3 ++- src/views/xpack/License.vue | 8 ++++++-- src/views/xpack/router.js | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/i18n/langs/cn.json b/src/i18n/langs/cn.json index 70d7f30c9..981e61e29 100644 --- a/src/i18n/langs/cn.json +++ b/src/i18n/langs/cn.json @@ -822,6 +822,7 @@ "Edition": "版本", "LicenseDetail": "许可证详情", "ImportLicense": "导入许可证", - "LicenseFile": "许可证文件" + "LicenseFile": "许可证文件", + "ImportLicenseTip": "请导入许可证" } } diff --git a/src/views/xpack/License.vue b/src/views/xpack/License.vue index 37f5e009c..0f2249723 100644 --- a/src/views/xpack/License.vue +++ b/src/views/xpack/License.vue @@ -2,6 +2,9 @@
+ + {{ this.$t('xpack.ImportLicenseTip') }} + @@ -83,6 +86,9 @@ export default { ...mapGetters([ 'publicSettings' ]), + isValidateLicense() { + return this.publicSettings.XPACK_LICENSE_IS_VALID + }, cardTitle() { return '' }, @@ -136,8 +142,6 @@ export default { ] } }, - mounted() { - }, methods: { handleButtonAction: function(index, row) { switch (row.value) { diff --git a/src/views/xpack/router.js b/src/views/xpack/router.js index 4b06c43ed..8b80db343 100644 --- a/src/views/xpack/router.js +++ b/src/views/xpack/router.js @@ -18,7 +18,7 @@ export default { path: 'license', component: () => import('@/views/xpack/License.vue'), name: 'License', - meta: { title: 'License' } + meta: { title: i18n.t('xpack.License') } }, { path: 'gathered-users',