From f3b15727cbc36fbfb3d031dacd47d613bc210c35 Mon Sep 17 00:00:00 2001 From: Michael Bai Date: Sat, 22 May 2021 16:57:20 +0800 Subject: [PATCH 01/33] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=88=9B=E5=BB=BA/=E6=9B=B4=E6=96=B0=E5=AF=86?= =?UTF-8?q?=E7=A0=81=E7=AD=96=E7=95=A5=E9=80=89=E9=A1=B9=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/users/User/UserCreateUpdate.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/views/users/User/UserCreateUpdate.vue b/src/views/users/User/UserCreateUpdate.vue index aa4e43c1a..5a614c9f5 100644 --- a/src/views/users/User/UserCreateUpdate.vue +++ b/src/views/users/User/UserCreateUpdate.vue @@ -59,7 +59,7 @@ export default { password: { component: UserPassword, hidden: (formValue) => { - if (formValue.password_strategy) { + if (formValue.password_strategy === 'custom') { return false } return !formValue.update_password @@ -81,7 +81,7 @@ export default { } ], hidden: (formValue) => { - if (formValue.password_strategy) { + if (formValue.password_strategy === 'custom') { return false } return !formValue.update_password || !this.user.can_public_key_auth @@ -148,7 +148,7 @@ export default { methods: { cleanFormValue(value) { const method = this.getMethod() - if (method === 'post' && !value.password_strategy) { + if (method === 'post' && value.password_strategy === 'email') { delete value['password'] if (this.currentOrgIsRoot) { delete value['groups'] From c7c6f5ac82d3b950a322ed89cb1507b6aeb595de Mon Sep 17 00:00:00 2001 From: Michael Bai Date: Sat, 22 May 2021 00:06:46 +0800 Subject: [PATCH 02/33] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E6=A8=A1=E7=89=88=E7=94=9F=E6=88=90table=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E6=B2=A1=E6=9C=89=E6=98=BE=E7=A4=BAnumber=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E7=B1=BB=E5=9E=8B=E6=89=80=E5=9C=A8=E5=88=97=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ListTable/TableAction/ImportTable.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ListTable/TableAction/ImportTable.vue b/src/components/ListTable/TableAction/ImportTable.vue index 450eecc6c..96ca990dd 100644 --- a/src/components/ListTable/TableAction/ImportTable.vue +++ b/src/components/ListTable/TableAction/ImportTable.vue @@ -207,7 +207,7 @@ export default { if (!d) { return 0 } - if (!itemColData || !itemColData.length) { + if (typeof itemColData !== 'number' && (!itemColData || !itemColData.length)) { return 0 } return itemColData.length From 09a252f2827d56a2cb92ace6e778c40ab480152f Mon Sep 17 00:00:00 2001 From: Bai Date: Tue, 25 May 2021 12:51:28 +0800 Subject: [PATCH 03/33] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E8=B4=A6?= =?UTF-8?q?=E5=8F=B7=E7=AE=A1=E7=90=86=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/langs/cn.json | 2 ++ src/router/accounts.js | 30 +++++++++++++++++++ src/router/index.js | 12 ++++++++ .../AssetAccount/AssetAccountList.vue | 17 +++++++++++ 4 files changed, 61 insertions(+) create mode 100644 src/router/accounts.js create mode 100644 src/views/accounts/AssetAccount/AssetAccountList.vue diff --git a/src/i18n/langs/cn.json b/src/i18n/langs/cn.json index 1a363ca73..5b3496973 100644 --- a/src/i18n/langs/cn.json +++ b/src/i18n/langs/cn.json @@ -522,6 +522,8 @@ }, "route": { "": "", + "Accounts": "账号管理", + "AssetAccount": "资产账号", "Ticket":"工单", "CommandConfirm": "命令复核", "AdminUserCreate": "创建管理用户", diff --git a/src/router/accounts.js b/src/router/accounts.js new file mode 100644 index 000000000..2ee84c8ca --- /dev/null +++ b/src/router/accounts.js @@ -0,0 +1,30 @@ +import i18n from '@/i18n/i18n' +import empty from '@/layout/empty' +export default [ + { + path: 'asset-accounts', + component: empty, + meta: { title: i18n.t('route.AssetAccount') }, + children: [ + { + path: '', + name: 'AssetAccountList', + component: () => import('@/views/accounts/AssetAccount/AssetAccountList'), + meta: { title: i18n.t('route.AssetAccount') } + } + ] + }, + { + path: 'asset-accounts2', + component: empty, + meta: { title: i18n.t('route.AssetAccount') }, + children: [ + { + path: '', + name: 'AssetAccountList2', + component: () => import('@/views/accounts/AssetAccount/AssetAccountList'), + meta: { title: i18n.t('route.AssetAccount') } + } + ] + } +] diff --git a/src/router/index.js b/src/router/index.js index d95d091a4..653933e2a 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -37,6 +37,7 @@ import TicketsRoutes from './tickets' import AuditsRoutes from './audits' import commonRoutes from './common' import aclRoutes from './acl' +import AccountRoutes from './accounts' /** * constantRoutes @@ -82,6 +83,17 @@ export const allRoleRoutes = [ } ] }, + { + path: '/accounts', + component: Layout, + redirect: '/accounts/asset-accounts/', + name: 'Accounts', + meta: { + title: i18n.t('route.Accounts'), + icon: 'address-book' + }, + children: AccountRoutes + }, { path: '/users', component: Layout, diff --git a/src/views/accounts/AssetAccount/AssetAccountList.vue b/src/views/accounts/AssetAccount/AssetAccountList.vue new file mode 100644 index 000000000..a88fc63fa --- /dev/null +++ b/src/views/accounts/AssetAccount/AssetAccountList.vue @@ -0,0 +1,17 @@ + + + + + From 0a19829c4ae72b9b47f559bb5b648ce948ca715c Mon Sep 17 00:00:00 2001 From: Bai Date: Wed, 26 May 2021 17:23:42 +0800 Subject: [PATCH 04/33] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E8=B5=84?= =?UTF-8?q?=E4=BA=A7=E8=B4=A6=E5=8F=B7=E6=A8=A1=E5=9D=97(=E5=9F=BA?= =?UTF-8?q?=E6=9C=AC=E5=AE=8C=E6=88=90=EF=BC=8C=E7=BB=86=E8=8A=82=E5=BE=85?= =?UTF-8?q?=E4=BC=98=E5=8C=96)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/AssetUserTable/index.vue | 38 ++++---- src/router/accounts.js | 7 ++ .../AssetAccount/AssetAccountCreate.vue | 60 ++++++++++++ .../AssetAccount/AssetAccountList.vue | 97 +++++++++++++++++-- 4 files changed, 178 insertions(+), 24 deletions(-) create mode 100644 src/views/accounts/AssetAccount/AssetAccountCreate.vue diff --git a/src/components/AssetUserTable/index.vue b/src/components/AssetUserTable/index.vue index 6524a4c87..ce9e1b072 100644 --- a/src/components/AssetUserTable/index.vue +++ b/src/components/AssetUserTable/index.vue @@ -1,7 +1,7 @@ @@ -34,6 +30,7 @@ import { mapGetters } from 'vuex' import Hamburger from '@/components/Hamburger' import AccountDropdown from './AccountDropdown' +import SiteMessages from './SiteMessages' import Help from './Help' import Language from './Language' import WebTerminal from './WebTerminal' @@ -48,7 +45,8 @@ export default { Language, Help, Tickets, - WebTerminal + WebTerminal, + SiteMessages }, data() { return { @@ -60,13 +58,17 @@ export default { ]), isOrgAuditor() { return rolc.getRolesDisplay(this.currentOrgRoles).includes('OrgAuditor') || rolc.getRolesDisplay(this.currentOrgRoles).includes('Auditor') + }, + showTickets() { + return this.publicSettings.TICKETS_ENABLED && + this.publicSettings.XPACK_LICENSE_IS_VALID && + !this.isOrgAuditor } }, methods: { toggleSideBar() { this.$store.dispatch('app/toggleSideBar') } - } } @@ -91,12 +93,19 @@ export default { .navbar-right { float: right; margin-right: 10px; - } - .header-item { - line-height: 50px; - display: inline-block; - padding-right: 20px; + .header-item { + line-height: 50px; + display: inline-block; + padding-right: 10px; + padding-left: 10px; + } + + .header-icon { + &:hover { + background-color: #e6e6e6; + } + } } .breadcrumb-container { @@ -108,5 +117,9 @@ export default { .el-header { background-color: #ffffff; } + + ul { + margin: 0; + } diff --git a/src/main.js b/src/main.js index b77c4340e..9919009ca 100644 --- a/src/main.js +++ b/src/main.js @@ -40,8 +40,13 @@ Vue.config.productionTip = false import VueCookie from 'vue-cookie' Vue.use(VueCookie) window.$cookie = VueCookie -import VueMoment from 'vue-moment' -Vue.use(VueMoment) + +const moment = require('moment') +require('moment/locale/zh-cn') +Vue.use(require('vue-moment'), { + moment +}) + // logger import VueLogger from 'vuejs-logger' import loggerOptions from './utils/logger' diff --git a/src/router/users.js b/src/router/users.js index 464a73d34..1d087c004 100644 --- a/src/router/users.js +++ b/src/router/users.js @@ -91,28 +91,5 @@ export default [ hidden: true } ] - }, - { - path: 'site-msg', - component: empty, - redirect: '', - meta: { title: i18n.t('route.SiteMessage') }, - hidden: true, - children: [ - { - path: '', - name: 'SiteMessageList', - component: () => import('@/views/users/SiteMsg/SiteMsgList'), - meta: { title: i18n.t('route.SiteMessageList'), activeMenu: '/users/users' }, - hidden: true - }, - { - path: ':id', - name: 'SiteMessageDetail', - component: () => import('@/views/users/SiteMsg/SiteMsgDetail'), - meta: { title: i18n.t('route.SiteMessageDetail'), activeMenu: '/users/users' }, - hidden: true - } - ] } ] diff --git a/src/views/users/SiteMsg/SiteMsgDetail.vue b/src/views/users/SiteMsg/SiteMsgDetail.vue deleted file mode 100644 index b1e4861e3..000000000 --- a/src/views/users/SiteMsg/SiteMsgDetail.vue +++ /dev/null @@ -1,52 +0,0 @@ - - - - - diff --git a/src/views/users/SiteMsg/SiteMsgList.vue b/src/views/users/SiteMsg/SiteMsgList.vue deleted file mode 100644 index c6878efd1..000000000 --- a/src/views/users/SiteMsg/SiteMsgList.vue +++ /dev/null @@ -1,51 +0,0 @@ - - - - - diff --git a/yarn.lock b/yarn.lock index 79c785e4c..638f3db30 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7324,6 +7324,11 @@ moment@^2.19.2: resolved "https://registry.yarnpkg.com/moment/-/moment-2.26.0.tgz#5e1f82c6bafca6e83e808b30c8705eed0dcbd39a" integrity sha512-oIixUO+OamkUkwjhAVE18rAMfRJNsNe/Stid/gwHSOfHrOtw9EhAY2AHvdKZ/k/MggcYELFCJz/Sn2pL8b8JMw== +moment@^2.29.1: + version "2.29.1" + resolved "https://registry.npm.taobao.org/moment/download/moment-2.29.1.tgz?cache=0&sync_timestamp=1601983320283&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmoment%2Fdownload%2Fmoment-2.29.1.tgz#b2be769fa31940be9eeea6469c075e35006fa3d3" + integrity sha1-sr52n6MZQL6e7qZGnAdeNQBvo9M= + move-concurrently@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/move-concurrently/-/move-concurrently-1.0.1.tgz#be2c005fda32e0b29af1f05d7c4b33214c701f92" From 96b002eccbfae385465049a9d69f315f340e9032 Mon Sep 17 00:00:00 2001 From: xinwen Date: Mon, 7 Jun 2021 17:09:10 +0800 Subject: [PATCH 25/33] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=A0=87=E8=AE=B0?= =?UTF-8?q?=E5=B7=B2=E8=AF=BB=E4=B8=8Ewebsockt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/NavHeader/SiteMessages.vue | 43 ++++++++++++++++--- 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/src/layout/components/NavHeader/SiteMessages.vue b/src/layout/components/NavHeader/SiteMessages.vue index 2671bfeab..362311cc8 100644 --- a/src/layout/components/NavHeader/SiteMessages.vue +++ b/src/layout/components/NavHeader/SiteMessages.vue @@ -1,6 +1,6 @@