From 7305bf772c4b2bd9e88f97d0a8c9e96040f5ae4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com> Date: Mon, 24 Apr 2023 11:28:22 +0800 Subject: [PATCH 01/47] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=B5=84?= =?UTF-8?q?=E4=BA=A7=E7=A1=AC=E4=BB=B6=E4=BF=A1=E6=81=AF=E6=98=BE=E7=A4=BA?= =?UTF-8?q?undefined=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Asset/AssetList/components/BaseList.vue | 4 +-- .../assets/Asset/AssetMoreInformationEdit.vue | 26 +++---------------- 2 files changed, 5 insertions(+), 25 deletions(-) diff --git a/src/views/assets/Asset/AssetList/components/BaseList.vue b/src/views/assets/Asset/AssetList/components/BaseList.vue index a34225d79..71d083db1 100644 --- a/src/views/assets/Asset/AssetList/components/BaseList.vue +++ b/src/views/assets/Asset/AssetList/components/BaseList.vue @@ -149,7 +149,7 @@ export default { nodes_display: { formatter: ArrayFormatter }, - info: { + gathered_info: { label: this.$t('assets.HardwareInfo'), formatter: HostInfoFormatter, formatterArgs: { @@ -299,7 +299,7 @@ export default { }, watch: { optionInfo(iNew) { - this.$set(this.defaultConfig.columnsMeta.info.formatterArgs, 'info', iNew) + this.$set(this.defaultConfig.columnsMeta.gathered_info.formatterArgs, 'info', iNew) } }, methods: { diff --git a/src/views/assets/Asset/AssetMoreInformationEdit.vue b/src/views/assets/Asset/AssetMoreInformationEdit.vue index 4e14e34a3..3f4b42761 100644 --- a/src/views/assets/Asset/AssetMoreInformationEdit.vue +++ b/src/views/assets/Asset/AssetMoreInformationEdit.vue @@ -11,34 +11,14 @@ export default { GenericCreateUpdatePage }, data() { - const nodesInitial = [] - if (this.$route.query['node']) { - nodesInitial.push(this.$route.query.node) - } return { - initial: { - is_active: true, - platform: 'Linux', - protocols: ['ssh/22'], - nodes: nodesInitial - }, + initial: {}, fields: [ [this.$t('common.Basic'), ['name', 'address']], - [this.$t('assets.Hardware'), ['info']] + [this.$t('assets.Hardware'), ['gathered_info']] ], fieldsMeta: { - platform: { - el: { - multiple: false, - ajax: { - url: '/api/v1/assets/platforms/', - transformOption: (item) => { - return { label: `${item.name}`, value: item.name } - } - } - } - }, - info: { + gathered_info: { fields: [ 'vendor', 'model', 'sn', 'cpu_model', 'cpu_count', 'cpu_cores', 'cpu_vcpus', 'memory', 'disk_total', From a055b4fe45affde43ac17bc23ec38a89f97354f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com> Date: Mon, 24 Apr 2023 14:37:47 +0800 Subject: [PATCH 02/47] =?UTF-8?q?perf:=20=E4=BF=AE=E6=94=B9=E4=BA=A4?= =?UTF-8?q?=E6=8D=A2=E6=9C=BA=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/styles/icons/switch.png | Bin 0 -> 236 bytes src/styles/ztree_icon.css | 5 ++++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 src/styles/icons/switch.png diff --git a/src/styles/icons/switch.png b/src/styles/icons/switch.png new file mode 100644 index 0000000000000000000000000000000000000000..de4c8f43258eef41ef55fe54370f1e0d97c73dae GIT binary patch literal 236 zcmeAS@N?(olHy`uVBq!ia0vp@Ak4uAB#T}@sR2@q#X;^)4C~IxyaaNVdAc};Xavul z&Q&rO z2v6L?kf+GP)4|BP;tOx|zA1}VRsCw1VX{DczU&w0i<&82W{b}zJP_HWl=%G4u^ZL) zKDTN)4@e%EJAG~Jwo{S(@wbW#9rk<(irKVB+NHyIhShE1iGs!TtE#qE#lOo@Piwk* i?`*<5_NX7CpBQR&Ckg5VyU7Dx%;4$j=d#Wzp$PypSz3$$ literal 0 HcmV?d00001 diff --git a/src/styles/ztree_icon.css b/src/styles/ztree_icon.css index e6c168d35..646cb1e09 100644 --- a/src/styles/ztree_icon.css +++ b/src/styles/ztree_icon.css @@ -243,12 +243,15 @@ .ztree li span.button.public_ico_docu::before, .ztree li span.button.router_ico_docu::before, .ztree li span.button.other_ico_docu::before, -.ztree li span.button.switch_ico_docu::before, .ztree li span.button.firewall_ico_docu::before, .ztree li span.button.general_ico_docu::before { content: "\F07B"; } +.ztree li span.button.switch_ico_docu { + background: url('./icons/switch.png') no-repeat center left transparent; +} + .ztree li span.button.k8s_ico_docu { background: url('./icons/k8s.png') center left no-repeat; } From 43eaaf3eba987d1fe13f492c71d442591767199e Mon Sep 17 00:00:00 2001 From: Bai Date: Thu, 27 Apr 2023 19:22:42 +0800 Subject: [PATCH 03/47] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BA=91?= =?UTF-8?q?=E8=B4=A6=E5=8F=B7LAN=E4=B8=8D=E8=83=BD=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../assets/Cloud/Account/AccountCreateUpdate.vue | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/views/assets/Cloud/Account/AccountCreateUpdate.vue b/src/views/assets/Cloud/Account/AccountCreateUpdate.vue index fa9788e40..f47ea7923 100644 --- a/src/views/assets/Cloud/Account/AccountCreateUpdate.vue +++ b/src/views/assets/Cloud/Account/AccountCreateUpdate.vue @@ -123,18 +123,6 @@ export default { } attrs[item] = encryptPassword(value) } - const toListFields = ['ip_group'] - for (const item of toListFields) { - let value = attrs[item] - if (!value) { - continue - } - value = value?.split(',') || [] - value = value.filter((value, index) => { - if (value) return true - }) - attrs[item] = value - } return values }, afterGetFormValue(formValue) { From da3e6aff7619301e79041ddc71c10e8500377791 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com> Date: Mon, 24 Apr 2023 10:58:28 +0800 Subject: [PATCH 04/47] =?UTF-8?q?perf:=20DetailFormatter=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=85=8D=E7=BD=AE=E5=8F=82=E6=95=B0createInN?= =?UTF-8?q?ewPage=E6=8E=A7=E5=88=B6=E6=98=AF=E5=90=A6=E6=96=B0=E9=A1=B5?= =?UTF-8?q?=E5=8D=A1=E6=89=93=E5=BC=80=EF=BC=9B=E5=91=BD=E4=BB=A4=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E4=BC=9A=E8=AF=9D=E7=82=B9=E5=87=BB=E6=96=B0=E9=A1=B5?= =?UTF-8?q?=E5=8D=A1=E6=89=93=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/TableFormatters/DetailFormatter.vue | 8 +++++++- src/views/sessions/CommandList.vue | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/TableFormatters/DetailFormatter.vue b/src/components/TableFormatters/DetailFormatter.vue index 2e596bd18..ca68157a2 100644 --- a/src/components/TableFormatters/DetailFormatter.vue +++ b/src/components/TableFormatters/DetailFormatter.vue @@ -29,6 +29,7 @@ export default { getRoute: null, routeQuery: null, can: true, + openInNewPage: false, getTitle({ col, row, cellValue }) { return cellValue }, @@ -98,7 +99,12 @@ export default { }, methods: { goDetail() { - this.$router.push(this.detailRoute) + if (this.formatterArgs.openInNewPage) { + const { href } = this.$router.resolve(this.detailRoute) + window.open(href, '_blank') + } else { + this.$router.push(this.detailRoute) + } // const routeName = this.formatterArgs.route // this.$log.debug('Will go to detail route: ', routeName) // this.$router.push({ name: routeName, params: { id: this.row.id }, query: routeQuery }) diff --git a/src/views/sessions/CommandList.vue b/src/views/sessions/CommandList.vue index 1124ad971..4d58bc0fb 100644 --- a/src/views/sessions/CommandList.vue +++ b/src/views/sessions/CommandList.vue @@ -88,6 +88,7 @@ export default { formatter: DetailFormatter, width: '80px', formatterArgs: { + openInNewPage: true, can: this.$hasPerm('terminal.view_session'), getTitle() { return vm.$t('sessions.goto') From cb7a492b74ebe53e35e9a419b9034c8d8b280e0b Mon Sep 17 00:00:00 2001 From: ibuler Date: Thu, 27 Apr 2023 17:57:57 +0800 Subject: [PATCH 05/47] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E8=B5=84=E4=BA=A7=E6=97=B6=EF=BC=8C=E5=85=B6=E5=AE=83?= =?UTF-8?q?=E8=B5=84=E4=BA=A7=E5=8D=8F=E8=AE=AE=E4=B8=A2=E5=A4=B1=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/FormFields/ProtocolSelector/index.vue | 7 +++++++ .../Asset/AssetCreateUpdate/BaseAssetCreateUpdate.vue | 2 ++ 2 files changed, 9 insertions(+) diff --git a/src/components/FormFields/ProtocolSelector/index.vue b/src/components/FormFields/ProtocolSelector/index.vue index 7166266fd..34b68f623 100644 --- a/src/components/FormFields/ProtocolSelector/index.vue +++ b/src/components/FormFields/ProtocolSelector/index.vue @@ -90,10 +90,12 @@ export default { default: () => ([]) }, readonly: { + // 这个是在详情中,不可编辑,包括所有 type: Boolean, default: false }, settingReadonly: { + // 这个是在资产添加时设置协议使用,不能修改 setting type: Boolean, default: false }, @@ -146,6 +148,11 @@ export default { }, items: { handler(value) { + if (this.settingReadonly) { + value = value.map(i => { + return { name: i.name, port: i.port } + }) + } this.$emit('input', value) }, immediate: true, diff --git a/src/views/assets/Asset/AssetCreateUpdate/BaseAssetCreateUpdate.vue b/src/views/assets/Asset/AssetCreateUpdate/BaseAssetCreateUpdate.vue index 02f598a60..046925627 100644 --- a/src/views/assets/Asset/AssetCreateUpdate/BaseAssetCreateUpdate.vue +++ b/src/views/assets/Asset/AssetCreateUpdate/BaseAssetCreateUpdate.vue @@ -152,6 +152,8 @@ export default { if (i.name === 'http') { i.display_name = 'http(s)' } + // 这个不删除会导致时,把 platform id 提交成 asset 的 + delete i['id'] return i }) const protocolChoices = this.defaultConfig.fieldsMeta.protocols.el.choices From 152301b0f31127b97ee7ae72ba2998361bb62b54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com> Date: Sun, 23 Apr 2023 17:01:44 +0800 Subject: [PATCH 06/47] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=AE=89?= =?UTF-8?q?=E5=85=A8=E8=AE=BE=E7=BD=AE-=E7=99=BB=E5=BD=95=E9=99=90?= =?UTF-8?q?=E5=88=B6=E9=BB=91=E7=99=BD=E5=90=8D=E5=8D=95=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E6=98=BE=E7=A4=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/settings/Security/AuthLimit.vue | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/views/settings/Security/AuthLimit.vue b/src/views/settings/Security/AuthLimit.vue index fecde5419..74f8ba90b 100644 --- a/src/views/settings/Security/AuthLimit.vue +++ b/src/views/settings/Security/AuthLimit.vue @@ -70,11 +70,6 @@ export default { ], successUrl: { name: 'Settings', params: { activeMenu: 'EmailContent' }}, fieldsMeta: {}, - afterGetFormValue(validValues) { - validValues.SECURITY_LOGIN_IP_BLACK_LIST = validValues.SECURITY_LOGIN_IP_BLACK_LIST.toString() - validValues.SECURITY_LOGIN_IP_WHITE_LIST = validValues.SECURITY_LOGIN_IP_WHITE_LIST.toString() - return validValues - }, cleanFormValue(value) { const ipBlackList = value.SECURITY_LOGIN_IP_BLACK_LIST const ipWhiltList = value.SECURITY_LOGIN_IP_WHITE_LIST From fd4223e107f0dfdb8c21b91e70cfe847840f8b4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com> Date: Fri, 5 May 2023 15:54:51 +0800 Subject: [PATCH 07/47] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E9=99=90=E5=88=B6=E6=8F=90=E4=BA=A4=E6=8A=A5=E9=94=99?= =?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/views/settings/Security/AuthLimit.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/views/settings/Security/AuthLimit.vue b/src/views/settings/Security/AuthLimit.vue index 74f8ba90b..b4891135f 100644 --- a/src/views/settings/Security/AuthLimit.vue +++ b/src/views/settings/Security/AuthLimit.vue @@ -73,11 +73,11 @@ export default { cleanFormValue(value) { const ipBlackList = value.SECURITY_LOGIN_IP_BLACK_LIST const ipWhiltList = value.SECURITY_LOGIN_IP_WHITE_LIST - if (!Array.isArray(ipBlackList)) { - value.SECURITY_LOGIN_IP_BLACK_LIST = ipBlackList ? ipBlackList.split(',') : [] + if (Array.isArray(ipBlackList)) { + value.SECURITY_LOGIN_IP_BLACK_LIST = ipBlackList.filter(Boolean) } - if (!Array.isArray(ipWhiltList)) { - value.SECURITY_LOGIN_IP_WHITE_LIST = ipWhiltList ? ipWhiltList.split(',') : [] + if (Array.isArray(ipWhiltList)) { + value.SECURITY_LOGIN_IP_WHITE_LIST = ipWhiltList.filter(Boolean) } return value }, From 1598b4e4ad21f472969cb216c769d823878f80d7 Mon Sep 17 00:00:00 2001 From: jiangweidong Date: Sat, 6 May 2023 18:25:42 +0800 Subject: [PATCH 08/47] =?UTF-8?q?=E6=97=B6=E9=97=B4=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=BF=AB=E6=8D=B7=E6=94=AF=E6=8C=81->=E5=8D=8A=E5=B9=B4?= =?UTF-8?q?=E3=80=811=E5=B9=B4=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FormFields/DatetimeRangePicker.vue | 18 ++++++++++++++++++ src/i18n/langs/en.json | 2 ++ src/i18n/langs/ja.json | 2 ++ src/i18n/langs/zh.json | 2 ++ 4 files changed, 24 insertions(+) diff --git a/src/components/FormFields/DatetimeRangePicker.vue b/src/components/FormFields/DatetimeRangePicker.vue index 0fa7e2814..9a6e21ce9 100644 --- a/src/components/FormFields/DatetimeRangePicker.vue +++ b/src/components/FormFields/DatetimeRangePicker.vue @@ -72,6 +72,24 @@ export default { start.setTime(start.getTime() - 3600 * 1000 * 24 * 90) picker.$emit('pick', [start, end]) } + }, + { + text: this.$t('common.DateLastHarfYear'), + onClick(picker) { + const end = new Date() + const start = new Date() + start.setTime(start.getTime() - 3600 * 1000 * 24 * 183) + picker.$emit('pick', [start, end]) + } + }, + { + text: this.$t('common.DateLastYear'), + onClick(picker) { + const end = new Date() + const start = new Date() + start.setTime(start.getTime() - 3600 * 1000 * 24 * 365) + picker.$emit('pick', [start, end]) + } } ] } diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index af6942ed8..d5cdbe6ee 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -558,6 +558,8 @@ "Resource": "Resource", "DateLast24Hours": "Last 24 hours", "DateLast3Months": "Last 3 months", + "DateLastHarfYear": "Last half year", + "DateLastYear": "Last year", "DateLastMonth": "Last month", "DateLastWeek": "Last week", "DateStart": "Date start", diff --git a/src/i18n/langs/ja.json b/src/i18n/langs/ja.json index 1ddc2664e..ed71c0d62 100644 --- a/src/i18n/langs/ja.json +++ b/src/i18n/langs/ja.json @@ -557,6 +557,8 @@ "Resource": "リソース", "DateLast24Hours": "最近の日", "DateLast3Months": "直近3月", + "DateLastHarfYear": "ここ半年です", + "DateLastYear": "ここ1年です", "DateLastMonth": "直近1月", "DateLastWeek": "最近の一週間", "DateStart": "開始日", diff --git a/src/i18n/langs/zh.json b/src/i18n/langs/zh.json index 7518a240b..0901f98ab 100644 --- a/src/i18n/langs/zh.json +++ b/src/i18n/langs/zh.json @@ -578,6 +578,8 @@ "Resource": "资源", "DateLast24Hours": "最近一天", "DateLast3Months": "最近三月", + "DateLastHarfYear": "最近半年", + "DateLastYear": "最近一年", "DateLastMonth": "最近一月", "DateLastWeek": "最近一周", "DateStart": "开始日期", From f486da001847c01f60b4ad23c82c9fa795c2ffd1 Mon Sep 17 00:00:00 2001 From: jiangweidong Date: Sat, 6 May 2023 18:27:00 +0800 Subject: [PATCH 09/47] =?UTF-8?q?perf:=20=E7=BB=9F=E4=B8=80=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/FormFields/DatetimeRangePicker.vue | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/components/FormFields/DatetimeRangePicker.vue b/src/components/FormFields/DatetimeRangePicker.vue index 9a6e21ce9..aab117a3e 100644 --- a/src/components/FormFields/DatetimeRangePicker.vue +++ b/src/components/FormFields/DatetimeRangePicker.vue @@ -72,8 +72,7 @@ export default { start.setTime(start.getTime() - 3600 * 1000 * 24 * 90) picker.$emit('pick', [start, end]) } - }, - { + }, { text: this.$t('common.DateLastHarfYear'), onClick(picker) { const end = new Date() @@ -81,8 +80,7 @@ export default { start.setTime(start.getTime() - 3600 * 1000 * 24 * 183) picker.$emit('pick', [start, end]) } - }, - { + }, { text: this.$t('common.DateLastYear'), onClick(picker) { const end = new Date() From 574b7b54c5259cf62ecab555f92a2f3f1fc78acf Mon Sep 17 00:00:00 2001 From: jiangweidong Date: Sat, 6 May 2023 18:44:34 +0800 Subject: [PATCH 10/47] =?UTF-8?q?perf:=20=E9=87=8D=E5=A4=8D=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E6=8A=BD=E7=A6=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FormFields/DatetimeRangePicker.vue | 50 +++++-------------- 1 file changed, 13 insertions(+), 37 deletions(-) diff --git a/src/components/FormFields/DatetimeRangePicker.vue b/src/components/FormFields/DatetimeRangePicker.vue index aab117a3e..ff96adeba 100644 --- a/src/components/FormFields/DatetimeRangePicker.vue +++ b/src/components/FormFields/DatetimeRangePicker.vue @@ -41,53 +41,23 @@ export default { shortcuts: [ { text: this.$t('common.DateLast24Hours'), - onClick(picker) { - const end = new Date() - const start = new Date() - start.setTime(start.getTime() - 3600 * 1000 * 24) - picker.$emit('pick', [start, end]) - } + onClick: (picker) => this.handleShortcutClick(picker, 1) }, { text: this.$t('common.DateLastWeek'), - onClick(picker) { - const end = new Date() - const start = new Date() - start.setTime(start.getTime() - 3600 * 1000 * 24 * 7) - picker.$emit('pick', [start, end]) - } + onClick: (picker) => this.handleShortcutClick(picker, 7) }, { text: this.$t('common.DateLastMonth'), - onClick(picker) { - const end = new Date() - const start = new Date() - start.setTime(start.getTime() - 3600 * 1000 * 24 * 30) - picker.$emit('pick', [start, end]) - } + onClick: (picker) => this.handleShortcutClick(picker, 30) }, { text: this.$t('common.DateLast3Months'), - onClick(picker) { - const end = new Date() - const start = new Date() - start.setTime(start.getTime() - 3600 * 1000 * 24 * 90) - picker.$emit('pick', [start, end]) - } + onClick: (picker) => this.handleShortcutClick(picker, 90) }, { text: this.$t('common.DateLastHarfYear'), - onClick(picker) { - const end = new Date() - const start = new Date() - start.setTime(start.getTime() - 3600 * 1000 * 24 * 183) - picker.$emit('pick', [start, end]) - } + onClick: (picker) => this.handleShortcutClick(picker, 183) }, { text: this.$t('common.DateLastYear'), - onClick(picker) { - const end = new Date() - const start = new Date() - start.setTime(start.getTime() - 3600 * 1000 * 24 * 365) - picker.$emit('pick', [start, end]) - } + onClick: (picker) => this.handleShortcutClick(picker, 365) } ] } @@ -102,6 +72,12 @@ export default { this.$log.debug('Date change: ', val) this.$emit('dateChange', val) } + }, + handleShortcutClick(picker, day) { + const end = new Date() + const start = new Date() + start.setTime(start.getTime() - 3600 * 1000 * 24 * day) + picker.$emit('pick', [start, end]) } } } @@ -124,7 +100,7 @@ export default { .el-input__inner { border: 1px solid #dcdee2; border-radius: 3px; - height: 32x; + height: 32px; } .el-date-editor ::v-deep .el-range-separator { From fcd7d17ef111e591119b6b1dccab32f0edff1740 Mon Sep 17 00:00:00 2001 From: jiangweidong Date: Sat, 6 May 2023 18:49:42 +0800 Subject: [PATCH 11/47] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E5=8F=98?= =?UTF-8?q?=E9=87=8F=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/FormFields/DatetimeRangePicker.vue | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/FormFields/DatetimeRangePicker.vue b/src/components/FormFields/DatetimeRangePicker.vue index ff96adeba..cb1487b28 100644 --- a/src/components/FormFields/DatetimeRangePicker.vue +++ b/src/components/FormFields/DatetimeRangePicker.vue @@ -41,23 +41,23 @@ export default { shortcuts: [ { text: this.$t('common.DateLast24Hours'), - onClick: (picker) => this.handleShortcutClick(picker, 1) + onClick: (picker) => this.onShortcutClick(picker, 1) }, { text: this.$t('common.DateLastWeek'), - onClick: (picker) => this.handleShortcutClick(picker, 7) + onClick: (picker) => this.onShortcutClick(picker, 7) }, { text: this.$t('common.DateLastMonth'), - onClick: (picker) => this.handleShortcutClick(picker, 30) + onClick: (picker) => this.onShortcutClick(picker, 30) }, { text: this.$t('common.DateLast3Months'), - onClick: (picker) => this.handleShortcutClick(picker, 90) + onClick: (picker) => this.onShortcutClick(picker, 90) }, { text: this.$t('common.DateLastHarfYear'), - onClick: (picker) => this.handleShortcutClick(picker, 183) + onClick: (picker) => this.onShortcutClick(picker, 183) }, { text: this.$t('common.DateLastYear'), - onClick: (picker) => this.handleShortcutClick(picker, 365) + onClick: (picker) => this.onShortcutClick(picker, 365) } ] } @@ -73,7 +73,7 @@ export default { this.$emit('dateChange', val) } }, - handleShortcutClick(picker, day) { + onShortcutClick(picker, day) { const end = new Date() const start = new Date() start.setTime(start.getTime() - 3600 * 1000 * 24 * day) From 640e758016b8da66da5d822d40a75a2f0161eb2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com> Date: Mon, 8 May 2023 11:36:17 +0800 Subject: [PATCH 12/47] =?UTF-8?q?feat:=20=E5=AF=BC=E5=87=BA=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=E5=A2=9E=E5=8A=A0=E5=AF=BC=E5=87=BA=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=EF=BC=9B=E8=B4=A6=E5=8F=B7=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AF=BC=E5=87=BA=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/AccountListTable/AccountList.vue | 3 ++- src/components/ListTable/TableAction/ExportDialog.vue | 11 +++++++++++ src/i18n/langs/en.json | 1 + src/i18n/langs/ja.json | 1 + src/i18n/langs/zh.json | 1 + 5 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/components/AccountListTable/AccountList.vue b/src/components/AccountListTable/AccountList.vue index d95add6ec..62ef7909f 100644 --- a/src/components/AccountListTable/AccountList.vue +++ b/src/components/AccountListTable/AccountList.vue @@ -294,7 +294,8 @@ export default { }, exportOptions: { url: this.exportUrl, - mfaVerifyRequired: true + mfaVerifyRequired: true, + tips: this.$t('accounts.AccountExportTips') }, importOptions: { canImportCreate: this.$hasPerm('accounts.add_account'), diff --git a/src/components/ListTable/TableAction/ExportDialog.vue b/src/components/ListTable/TableAction/ExportDialog.vue index 47b429bdb..00d51b00c 100644 --- a/src/components/ListTable/TableAction/ExportDialog.vue +++ b/src/components/ListTable/TableAction/ExportDialog.vue @@ -17,6 +17,9 @@ @cancel="handleExportCancel()" @confirm="handleExportConfirm()" > + + {{ tips }} + @@ -92,6 +95,14 @@ export default { canExportFiltered: { type: Boolean, default: true + }, + tips: { + type: String, + default: '' + }, + tipsType: { + type: String, + default: 'success' } }, data() { diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index d5cdbe6ee..5291405d9 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -104,6 +104,7 @@ }, "DynamicUsername": "Dynamic username", "AutoCreate": "Auto create", + "AccountExportTips": "The exported information contains account secret, which involves sensitive information. The exported format is an encrypted zip file (if no encryption password is set, please go to personal information to set the file encryption password).", "TaskID": "Task ID", "AccountTemplate": "Account template", "AddAccountResult": "Add account result" diff --git a/src/i18n/langs/ja.json b/src/i18n/langs/ja.json index ed71c0d62..0d6259267 100644 --- a/src/i18n/langs/ja.json +++ b/src/i18n/langs/ja.json @@ -104,6 +104,7 @@ }, "DynamicUsername": "動的ユーザー名", "AutoCreate": "自動作成", + "AccountExportTips": "エクスポート情報には機密情報を含むアカウント暗号文が含まれており、エクスポートされたフォーマットは暗号化されたzipファイルです(暗号化パスワードが設定されていない場合は、個人情報にファイル暗号化パスワードを設定してください)。", "TaskID": "タスク ID", "AccountTemplate": "账号模版", "AddAccountResult": "账号批量添加结果" diff --git a/src/i18n/langs/zh.json b/src/i18n/langs/zh.json index 0901f98ab..f499e4b31 100644 --- a/src/i18n/langs/zh.json +++ b/src/i18n/langs/zh.json @@ -17,6 +17,7 @@ "PleaseClickLeftApplicationToViewApplicationAccount": "应用账号列表,点击左侧应用进行查看", "PleaseClickLeftAssetToViewGatheredUser": "收集用户列表,点击左侧资产进行查看", "AutoCreate": "自动创建", + "AccountExportTips": "导出信息中包含账号密文涉及敏感信息,导出的格式为一个加密的zip文件(若没有设置加密密码,请前往个人信息中设置文件加密密码)。", "AccountPush": { "WindowsPushHelpText": "windows 资产暂不支持推送密钥", "AccountPushList": "账号推送", From b85de1de337849f14fc04ae86f282bafb48431c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com> Date: Mon, 8 May 2023 14:42:10 +0800 Subject: [PATCH 13/47] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E7=AB=AF=E7=82=B9=E8=A7=84=E5=88=99ip=E4=B8=8D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Terminal/EndpointRule/EndpointRuleCreateUpdate.vue | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/views/settings/Terminal/EndpointRule/EndpointRuleCreateUpdate.vue b/src/views/settings/Terminal/EndpointRule/EndpointRuleCreateUpdate.vue index 05a231594..be511bea8 100644 --- a/src/views/settings/Terminal/EndpointRule/EndpointRuleCreateUpdate.vue +++ b/src/views/settings/Terminal/EndpointRule/EndpointRuleCreateUpdate.vue @@ -41,14 +41,10 @@ export default { }, hasDetailInMsg: false, cleanFormValue(value) { - if (!Array.isArray(value.ip_group)) { - value.ip_group = value.ip_group ? value.ip_group.split(',') : [] + if (Array.isArray(value.ip_group)) { + value.ip_group = value.ip_group.filter(Boolean) } return value - }, - afterGetFormValue(formValue) { - formValue.ip_group = formValue.ip_group?.toString() - return formValue } } } From 40ccff9685a906754b934ada2fabd008e11f012d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com> Date: Mon, 8 May 2023 16:52:54 +0800 Subject: [PATCH 14/47] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E7=AB=AF=E7=82=B9=E8=A7=84=E5=88=99=E4=B8=8D=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=BB=98=E8=AE=A4=E5=80=BC=E9=97=AE=E9=A2=98=EF=BC=9B?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=91=E5=90=8C=E6=AD=A5-=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E8=B4=A6=E5=8F=B7=E4=B8=8D=E6=98=BE=E7=A4=BAIP?= =?UTF-8?q?=E7=BD=91=E6=AE=B5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/assets/Cloud/Account/AccountCreateUpdate.vue | 6 +++--- .../Terminal/EndpointRule/EndpointRuleCreateUpdate.vue | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/views/assets/Cloud/Account/AccountCreateUpdate.vue b/src/views/assets/Cloud/Account/AccountCreateUpdate.vue index f47ea7923..902a73aa1 100644 --- a/src/views/assets/Cloud/Account/AccountCreateUpdate.vue +++ b/src/views/assets/Cloud/Account/AccountCreateUpdate.vue @@ -123,15 +123,15 @@ export default { } attrs[item] = encryptPassword(value) } + if (Array.isArray(attrs.ip_group)) { + values.attrs.ip_group = attrs.ip_group.filter(Boolean) + } return values }, afterGetFormValue(formValue) { if (!formValue.attrs) { return formValue } - if (Array.isArray(formValue.attrs.ip_group)) { - formValue.attrs.ip_group = formValue.attrs.ip_group.toString() - } return formValue } } diff --git a/src/views/settings/Terminal/EndpointRule/EndpointRuleCreateUpdate.vue b/src/views/settings/Terminal/EndpointRule/EndpointRuleCreateUpdate.vue index be511bea8..43d034e6b 100644 --- a/src/views/settings/Terminal/EndpointRule/EndpointRuleCreateUpdate.vue +++ b/src/views/settings/Terminal/EndpointRule/EndpointRuleCreateUpdate.vue @@ -3,7 +3,6 @@ v-bind="$data" :create-success-next-route="successUrl" :update-success-next-route="successUrl" - :after-get-form-value="afterGetFormValue" /> @@ -18,7 +17,7 @@ export default { return { url: '/api/v1/terminal/endpoint-rules/', initial: { - ip_group: '*' + ip_group: ['*'] }, successUrl: { name: 'TerminalSetting', params: { activeMenu: 'EndpointRuleList' }}, fields: [ From d14cbce2d6c0cbebdb7fb4435c24024860e25b76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com> Date: Mon, 24 Apr 2023 10:28:53 +0800 Subject: [PATCH 15/47] =?UTF-8?q?perf:=20=E7=94=A8=E6=88=B7=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E3=80=81=E8=B5=84=E4=BA=A7=E5=88=97=E8=A1=A8=E3=80=81?= =?UTF-8?q?=E8=B5=84=E4=BA=A7=E6=8E=88=E6=9D=83=E6=89=B9=E9=87=8F=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E5=90=8E=E8=87=AA=E5=8A=A8=E5=85=B3=E9=97=AD=E6=89=B9?= =?UTF-8?q?=E9=87=8F=E6=9B=B4=E6=96=B0=E7=AA=97=E5=8F=A3=EF=BC=9B=E8=B5=84?= =?UTF-8?q?=E4=BA=A7=E6=8E=88=E6=9D=83=E6=89=B9=E9=87=8F=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=90=8E=E8=87=AA=E5=8A=A8=E5=88=B7=E6=96=B0=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/assets/Asset/AssetList/components/BaseList.vue | 1 + src/views/perms/AssetPermission/AssetPermissionList.vue | 9 ++++++++- src/views/users/User/UserList.vue | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/views/assets/Asset/AssetList/components/BaseList.vue b/src/views/assets/Asset/AssetList/components/BaseList.vue index 71d083db1..f642d9cc8 100644 --- a/src/views/assets/Asset/AssetList/components/BaseList.vue +++ b/src/views/assets/Asset/AssetList/components/BaseList.vue @@ -304,6 +304,7 @@ export default { }, methods: { handleAssetBulkUpdate() { + this.updateSelectedDialogSetting.visible = false this.$refs.ListTable.reloadTable() } } diff --git a/src/views/perms/AssetPermission/AssetPermissionList.vue b/src/views/perms/AssetPermission/AssetPermissionList.vue index b060ec5cf..4b11b60b5 100644 --- a/src/views/perms/AssetPermission/AssetPermissionList.vue +++ b/src/views/perms/AssetPermission/AssetPermissionList.vue @@ -1,6 +1,7 @@ @@ -174,7 +176,12 @@ export default { computed: { ...mapGetters(['currentOrgIsRoot']) }, - methods: {} + methods: { + handlePermBulkUpdate() { + this.updateSelectedDialogSetting.visible = false + this.$refs.AssetTreeTable.$refs.TreeList.$refs?.ListTable?.reloadTable() + } + } } diff --git a/src/views/users/User/UserList.vue b/src/views/users/User/UserList.vue index c0568d372..c7a2223c1 100644 --- a/src/views/users/User/UserList.vue +++ b/src/views/users/User/UserList.vue @@ -279,6 +279,7 @@ export default { this.$refs.GenericListPage.$refs.ListTable.$refs.ListTable.reloadTable() }, handleDialogUpdate() { + this.updateSelectedDialogSetting.visible = false this.$refs.GenericListPage.$refs.ListTable.$refs.ListTable.reloadTable() } } From e365eaef8a1f773df09e2b3519d3e431484f0cae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com> Date: Wed, 26 Apr 2023 15:24:12 +0800 Subject: [PATCH 16/47] =?UTF-8?q?feat:=20=E8=B4=A6=E5=8F=B7=E5=88=97?= =?UTF-8?q?=E8=A1=A8-=E6=9F=A5=E7=9C=8B=E8=B4=A6=E5=8F=B7=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E7=B1=BB=E5=9E=8B=E4=B8=BApassword=E7=9A=84=E8=B4=A6?= =?UTF-8?q?=E5=8F=B7=E4=BF=AE=E6=94=B9=E5=AF=86=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AccountListTable/ViewSecret.vue | 17 +++ .../TableFormatters/ShowKeyCopyFormatter.vue | 107 +++++++++++++----- src/i18n/langs/en.json | 1 + src/i18n/langs/ja.json | 1 + src/i18n/langs/zh.json | 1 + 5 files changed, 97 insertions(+), 30 deletions(-) diff --git a/src/components/AccountListTable/ViewSecret.vue b/src/components/AccountListTable/ViewSecret.vue index 284d8b564..b38234d63 100644 --- a/src/components/AccountListTable/ViewSecret.vue +++ b/src/components/AccountListTable/ViewSecret.vue @@ -29,7 +29,9 @@ :cell-value="secretInfo.secret" :col="{ formatterArgs: { name: account['name'], + secretType: secretType || '' }}" + @input="onShowKeyCopyFormatterChange" /> @@ -102,6 +104,7 @@ export default { }, data() { return { + modifiedSecret: '', secretInfo: {}, versions: '-', showSecret: false, @@ -129,9 +132,19 @@ export default { }, methods: { accountConfirmHandle() { + this.modifiedSecret && this.onChangeSecretSubmit() this.showSecret = false this.mfaDialogVisible = false }, + onChangeSecretSubmit() { + const params = { + name: this.secretInfo.name, + secret: this.secretInfo.secret + } + this.$axios.patch(`/api/v1/accounts/accounts/${this.account.id}/`, params).then(() => { + this.$message.success(this.$tc('common.updateSuccessMsg')) + }) + }, getAuthInfo() { this.$axios.get(this.url, { disableFlashErrorMsg: true }).then(resp => { this.secretInfo = resp @@ -144,6 +157,10 @@ export default { }, showHistoryDialog() { this.showPasswordHistoryDialog = true + }, + onShowKeyCopyFormatterChange(value) { + if (value === this.secretInfo.secret) return + this.modifiedSecret = value } } } diff --git a/src/components/TableFormatters/ShowKeyCopyFormatter.vue b/src/components/TableFormatters/ShowKeyCopyFormatter.vue index 3893074ac..90549301a 100644 --- a/src/components/TableFormatters/ShowKeyCopyFormatter.vue +++ b/src/components/TableFormatters/ShowKeyCopyFormatter.vue @@ -1,31 +1,26 @@ @@ -47,6 +42,7 @@ export default { hasShow: true, hasDownload: true, hasCopy: true, + hasEdit: true, defaultShow: false } } @@ -54,6 +50,8 @@ export default { }, data() { return { + isEdit: false, + realValue: this.cellValue, formatterArgs: Object.assign(this.formatterArgsDefault, this.col.formatterArgs || {}), isShow: false } @@ -68,14 +66,46 @@ export default { hasCopy: function() { return this.formatterArgs.hasCopy }, + hasEdit: function() { + return this.formatterArgs.hasEdit + }, name: function() { return this.formatterArgs.name }, + iActions() { + const actions = [ + { + has: this.hasEdit && this.formatterArgs?.secretType === 'password', + class: this.isEdit ? 'fa-check' : 'fa-pencil', + action: this.onEdit, + tooltip: this.$t('common.Edit') + }, + { + has: this.hasShow, + class: this.isShow ? 'fa-eye-slash' : 'fa-eye', + action: this.onShow, + tooltip: this.$t('common.View') + }, + { + has: this.hasDownload, + icon: 'fa-download', + action: this.onDownload, + tooltip: this.$t('common.Download') + }, + { + has: this.hasCopy, + icon: 'fa-clone', + action: this.onCopy, + tooltip: this.$t('common.Copy') + } + ] + return actions + }, currentValue() { if (this.isShow) { - return this.cellValue || '-' + return this.realValue || '-' } else { - return this.cellValue ? '******' : '-' + return this.realValue ? '******' : '-' } } }, @@ -87,10 +117,21 @@ export default { this.isShow = !this.isShow }, onCopy() { - copy(this.cellValue) + copy(this.realValue) }, onDownload() { - downloadText(this.cellValue, this.name + '.txt') + downloadText(this.realValue, this.name + '.txt') + }, + onEdit() { + this.isEdit = !this.isEdit + if (this.isEdit) { + this.$nextTick(() => { + this.$refs.editInput.focus() + }) + } + }, + onEditBlur() { + this.$emit('input', this.realValue) } } } @@ -128,4 +169,10 @@ export default { } } } + .edit-input >>> input { + border-left: none; + border-right: none; + border-top: none; + height: 30px; + } diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index 5291405d9..31e79baff 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -622,6 +622,7 @@ "Username": "Username", "Validity": "Validity", "Invalidity": "Invalidity", + "Edit": "Edit", "View": "View", "Yes": "Yes", "action": "Action", diff --git a/src/i18n/langs/ja.json b/src/i18n/langs/ja.json index 0d6259267..b49eb56d4 100644 --- a/src/i18n/langs/ja.json +++ b/src/i18n/langs/ja.json @@ -620,6 +620,7 @@ "Username": "ユーザー名", "Validity": "有効", "Invalidity": "無効", + "Edit": "編集", "View": "表示", "Yes": "はい", "action": "アクション", diff --git a/src/i18n/langs/zh.json b/src/i18n/langs/zh.json index f499e4b31..c8843bde7 100644 --- a/src/i18n/langs/zh.json +++ b/src/i18n/langs/zh.json @@ -643,6 +643,7 @@ "Username": "用户名", "Validity": "有效", "Invalidity": "无效", + "Edit": "编辑", "View": "查看", "Yes": "是", "action": "动作", From 14b5eb5239802b02d01a0faf7c69f0963cba844e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com> Date: Sun, 23 Apr 2023 11:26:13 +0800 Subject: [PATCH 17/47] =?UTF-8?q?perf:=20=E5=86=85=E7=BD=AE=E7=9A=84?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E8=AF=A6=E6=83=85=E5=8D=8F=E8=AE=AE=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E5=BC=B9=E7=AA=97=E4=B8=8D=E6=98=BE=E7=A4=BAalert?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FormFields/ProtocolSelector/ProtocolSettingDialog.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/FormFields/ProtocolSelector/ProtocolSettingDialog.vue b/src/components/FormFields/ProtocolSelector/ProtocolSettingDialog.vue index 87191b136..2d590466b 100644 --- a/src/components/FormFields/ProtocolSelector/ProtocolSettingDialog.vue +++ b/src/components/FormFields/ProtocolSelector/ProtocolSettingDialog.vue @@ -10,7 +10,7 @@ width="70%" v-on="$listeners" > - + {{ $t('assets.InheritPlatformConfig') }} {{ $t('common.View') }} @@ -48,6 +48,7 @@ export default { }, data() { const vm = this + const platform = this.$route.query.platform return { baseAttrs: ['primary', 'required', 'default'], // 基础属性, 放到 setting 中处理了,处理完成后,还得返回回去 defaultSetting: { @@ -61,7 +62,7 @@ export default { }, loading: true, form: {}, - platformDetail: '#/console/assets/platforms/' + this.$route.query.platform, + platformDetail: platform ? '#/console/assets/platforms/' + platform : '', config: { hasSaveContinue: false, hasButtons: !this.disabled, From fabf60ac47b048e41fd03dd8e137759d70a971a4 Mon Sep 17 00:00:00 2001 From: feng <1304903146@qq.com> Date: Sat, 6 May 2023 17:01:16 +0800 Subject: [PATCH 18/47] =?UTF-8?q?feat:=20=E8=B4=A6=E5=8F=B7=E6=A8=A1?= =?UTF-8?q?=E7=89=88=20=E5=88=87=E6=8D=A2=E8=87=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AccountCreateUpdateForm/index.vue | 8 +++++++- src/utils/common.js | 10 ++++++++++ src/views/accounts/AccountTemplate/const.js | 18 +++++++++++++++++- 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/components/AccountCreateUpdateForm/index.vue b/src/components/AccountCreateUpdateForm/index.vue index 087fdbeb1..536132c3c 100644 --- a/src/components/AccountCreateUpdateForm/index.vue +++ b/src/components/AccountCreateUpdateForm/index.vue @@ -65,7 +65,7 @@ export default { fields: [ [this.$t('assets.Asset'), ['assets']], [this.$t('accounts.AccountTemplate'), ['template']], - [this.$t('common.Basic'), ['name', 'username', 'privileged', 'su_from']], + [this.$t('common.Basic'), ['name', 'username', 'privileged', 'su_from', 'su_from_username']], [this.$t('assets.Secret'), [ 'secret_type', 'secret', 'ssh_key', 'token', 'access_key', 'passphrase' @@ -167,6 +167,12 @@ export default { } } }, + su_from_username: { + label: this.$t('assets.UserSwitchFrom'), + hidden: (formValue) => { + return this.platform || this.asset + } + }, secret: { label: this.$t('assets.Password'), component: UpdateToken, diff --git a/src/utils/common.js b/src/utils/common.js index fdac73aa8..ca159fd14 100644 --- a/src/utils/common.js +++ b/src/utils/common.js @@ -156,6 +156,7 @@ export function formatDate(inputTime) { } const uuidPattern = /[0-9a-zA-Z\-]{36}/ +const uuidRegex = /\/([a-f\d]{8}(-[a-f\d]{4}){3}-[a-f\d]{12})\// export function hasUUID(path) { const index = path.indexOf('?') @@ -165,6 +166,15 @@ export function hasUUID(path) { return path.search(uuidPattern) !== -1 } +export function getUuidUpdateFromUrl(path) { + const matches = uuidRegex.exec(path) + if (matches !== null) { + return matches[1] + } else { + return '' + } +} + export function replaceUUID(s, n) { const index = s.search(uuidPattern) if (index > 0) return s.substr(0, index) diff --git a/src/views/accounts/AccountTemplate/const.js b/src/views/accounts/AccountTemplate/const.js index 802453524..79ce0ad05 100644 --- a/src/views/accounts/AccountTemplate/const.js +++ b/src/views/accounts/AccountTemplate/const.js @@ -1,8 +1,10 @@ +import { getUuidUpdateFromUrl } from '@/utils/common' import { UpdateToken } from '@/components/FormFields' +import Select2 from '@/components/FormFields/Select2' export const templateFields = (vm) => { return [ - [vm.$t('common.Basic'), ['name', 'username', 'privileged']], + [vm.$t('common.Basic'), ['name', 'username', 'privileged', 'su_from']], [vm.$t('assets.Secret'), [ 'secret_type', 'secret', 'ssh_key', 'token', 'access_key', 'passphrase' @@ -12,7 +14,21 @@ export const templateFields = (vm) => { } export const templateFieldsMeta = (vm) => { + const id = getUuidUpdateFromUrl(vm.$route.path) return { + su_from: { + component: Select2, + el: { + multiple: false, + clearable: true, + ajax: { + url: `/api/v1/accounts/account-templates/su-from-account-templates/?${id ? 'template_id=' + id : ''}`, + transformOption: (item) => { + return { label: `${item.name}(${item.username})`, value: item.id } + } + } + } + }, secret: { label: vm.$t('assets.Password'), component: UpdateToken, From a99a5a6312edd1074f65eec224fbdc9ead78c60a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com> Date: Sun, 23 Apr 2023 15:31:07 +0800 Subject: [PATCH 19/47] =?UTF-8?q?perf:=20=E8=BF=9B=E5=BA=A6=E6=9D=A1?= =?UTF-8?q?=E9=A2=9C=E8=89=B2=E6=A0=B9=E6=8D=AE=E7=B3=BB=E7=BB=9F=E9=A2=9C?= =?UTF-8?q?=E8=89=B2=E5=8F=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/theme/element-extra.css | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/public/theme/element-extra.css b/public/theme/element-extra.css index 69826efa3..554d56008 100644 --- a/public/theme/element-extra.css +++ b/public/theme/element-extra.css @@ -496,3 +496,11 @@ td .el-button.el-button--mini { .el-alert.el-alert--error.is-light { border-color: var(--color-danger-light); } + +#nprogress .bar { + background: light-5!important; +} + +#nprogress .peg { + box-shadow: 0 0 10px light-5, 0 0 5px light-5!important; +} From 7e6d78d223495142081e0df7b0e7911220bc9811 Mon Sep 17 00:00:00 2001 From: halo Date: Mon, 8 May 2023 21:41:17 +0800 Subject: [PATCH 20/47] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E8=BF=9C?= =?UTF-8?q?=E7=A8=8B=E5=BA=94=E7=94=A8=E4=B8=8A=E4=BC=A0=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/langs/en.json | 1 + src/i18n/langs/ja.json | 1 + src/i18n/langs/zh.json | 1 + src/views/settings/Applet/Applet/UploadDialog.vue | 15 ++++++++++++++- 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index 31e79baff..9fa1c5101 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -1330,6 +1330,7 @@ }, "terminal": { "Author": "Author", + "Uploading": "File uploading", "UploadSucceed": "Upload succeed", "UploadFailed": "Upload failed", "Applets": "Remote apps", diff --git a/src/i18n/langs/ja.json b/src/i18n/langs/ja.json index b49eb56d4..9eb4675a3 100644 --- a/src/i18n/langs/ja.json +++ b/src/i18n/langs/ja.json @@ -1325,6 +1325,7 @@ }, "terminal": { "Author": "作者", + "Uploading": "ファイルのアップロード", "UploadSucceed": "アップロード成功", "UploadFailed": "アップロードに失敗しました", "Applets": "リモートアプリケーション", diff --git a/src/i18n/langs/zh.json b/src/i18n/langs/zh.json index c8843bde7..46106c87d 100644 --- a/src/i18n/langs/zh.json +++ b/src/i18n/langs/zh.json @@ -1320,6 +1320,7 @@ "Author": "作者", "BasePort": "监听端口", "DatabasePort": "数据库协议端口", + "Uploading": "文件上传中", "UploadSucceed": "上传成功", "UploadFailed": "上传失败", "Applets": "远程应用", diff --git a/src/views/settings/Applet/Applet/UploadDialog.vue b/src/views/settings/Applet/Applet/UploadDialog.vue index 7867b83ef..ff9a5ffe5 100644 --- a/src/views/settings/Applet/Applet/UploadDialog.vue +++ b/src/views/settings/Applet/Applet/UploadDialog.vue @@ -2,6 +2,8 @@ { + this.isFinished = true this.$message.success(this.$tc('terminal.UploadSucceed')) this.$emit('update:visible', false) this.$emit('upload-event', res) }).catch(err => { + this.isFinished = true const error = err.response.data const msg = error?.message || error?.detail || error?.error || JSON.stringify(error) this.$message.error(msg) From 49f63d638c3ecbc432501edba47c9a93b9e015ef Mon Sep 17 00:00:00 2001 From: ibuler Date: Wed, 10 May 2023 15:00:13 +0800 Subject: [PATCH 21/47] =?UTF-8?q?feat:=20=E5=8F=91=E5=B8=83=E6=9C=BA?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E4=B8=AD=E5=A2=9E=E5=8A=A0=E7=94=9F=E6=88=90?= =?UTF-8?q?=E8=B4=A6=E5=8F=B7=20api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AccountListTable/AccountList.vue | 13 +++++++- src/components/AutoDataTable/index.vue | 9 +++-- src/i18n/langs/en.json | 3 ++ src/i18n/langs/ja.json | 3 ++ src/i18n/langs/zh.json | 3 ++ .../AppletHost/AppletHostDetail/Accounts.vue | 33 +++++++++++++++++-- 6 files changed, 58 insertions(+), 6 deletions(-) diff --git a/src/components/AccountListTable/AccountList.vue b/src/components/AccountListTable/AccountList.vue index d95add6ec..427c8ee10 100644 --- a/src/components/AccountListTable/AccountList.vue +++ b/src/components/AccountListTable/AccountList.vue @@ -25,8 +25,8 @@ { } }, + columnsDefault: { + type: Array, + default: () => ([ + 'name', 'username', 'asset', 'privileged', + 'secret_type', 'date_updated' + ]) + }, headerExtraActions: { type: Array, default: () => [] @@ -135,6 +142,10 @@ export default { 'name', 'username', 'asset', 'privileged', 'secret_type', 'source', 'actions' ], + columnsShow: { + min: ['name', 'username', 'actions'], + default: this.columnsDefault + }, columnsMeta: { name: { formatter: function(row) { diff --git a/src/components/AutoDataTable/index.vue b/src/components/AutoDataTable/index.vue index a381576b6..ec90d80c5 100644 --- a/src/components/AutoDataTable/index.vue +++ b/src/components/AutoDataTable/index.vue @@ -22,7 +22,12 @@ - diff --git a/src/views/ops/Job/QuickJob.vue b/src/views/ops/Job/QuickJob.vue index 5f934da08..d6e1058e1 100644 --- a/src/views/ops/Job/QuickJob.vue +++ b/src/views/ops/Job/QuickJob.vue @@ -225,6 +225,7 @@ export default { }, treeSetting: { treeUrl: '/api/v1/perms/users/self/nodes/children-with-assets/tree/', + searchUrl: '/api/v1/perms/users/self/assets/tree/', showRefresh: true, showMenu: false, showSearch: true, From c4ad25bfe38ad0c6794ba42cb280bcf652138543 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com> Date: Mon, 15 May 2023 15:49:26 +0800 Subject: [PATCH 27/47] =?UTF-8?q?perf=EF=BC=9A=E8=B4=A6=E5=8F=B7=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B-=E4=BF=AE=E6=94=B9=E7=9A=84=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E5=8A=A0=E5=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/AccountListTable/ViewSecret.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/AccountListTable/ViewSecret.vue b/src/components/AccountListTable/ViewSecret.vue index b38234d63..88f0915fc 100644 --- a/src/components/AccountListTable/ViewSecret.vue +++ b/src/components/AccountListTable/ViewSecret.vue @@ -69,6 +69,7 @@ import Dialog from '@/components/Dialog' import PasswordHistoryDialog from './PasswordHistoryDialog' import UserConfirmDialog from '@/components/UserConfirmDialog' import { ShowKeyCopyFormatter } from '@/components/TableFormatters' +import { encryptPassword } from '@/utils/crypto' export default { name: 'ShowSecretInfo', @@ -139,7 +140,7 @@ export default { onChangeSecretSubmit() { const params = { name: this.secretInfo.name, - secret: this.secretInfo.secret + secret: encryptPassword(this.modifiedSecret) } this.$axios.patch(`/api/v1/accounts/accounts/${this.account.id}/`, params).then(() => { this.$message.success(this.$tc('common.updateSuccessMsg')) From 1fdcf9ff757bce4d9d53e7af79f1e5c65f366a4e Mon Sep 17 00:00:00 2001 From: Bai Date: Mon, 15 May 2023 19:01:23 +0800 Subject: [PATCH 28/47] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E8=B5=84?= =?UTF-8?q?=E4=BA=A7=E3=80=81=E7=BD=91=E5=85=B3=E5=88=97=E8=A1=A8=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=98=BE=E7=A4=BA=20labels=20=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E4=B8=8D=E5=85=A8=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/TableFormatters/TagsFormatter.vue | 10 +++++++++- .../assets/Asset/AssetList/components/BaseList.vue | 9 +++++++-- src/views/assets/Domain/DomainDetail/GatewayList.vue | 9 +++++++-- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/src/components/TableFormatters/TagsFormatter.vue b/src/components/TableFormatters/TagsFormatter.vue index 9d96fc496..7e1cfd084 100644 --- a/src/components/TableFormatters/TagsFormatter.vue +++ b/src/components/TableFormatters/TagsFormatter.vue @@ -1,7 +1,7 @@ diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index 5e73fd09f..8423c7eae 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -1733,6 +1733,7 @@ "UpdateNodeAssetHardwareInfo": "Update node asset hardware information" }, "users": { + "UnbindHelpText": "The user is not a local user and cannot be unbound. Contact the administrator", "SetStatus": "Set status", "Set": "Set", "NotSet": "Not set", diff --git a/src/i18n/langs/ja.json b/src/i18n/langs/ja.json index 951a4504f..05b8eed52 100644 --- a/src/i18n/langs/ja.json +++ b/src/i18n/langs/ja.json @@ -1725,6 +1725,7 @@ "UpdateNodeAssetHardwareInfo": "ノード資産ハードウェア情報の更新" }, "users": { + "UnbindHelpText": "このユーザーはローカルユーザーではありませんので、解除できません。管理者に連絡してください。", "SetStatus": "ステータスの設定", "Set": "設定", "NotSet": "未設定", diff --git a/src/i18n/langs/zh.json b/src/i18n/langs/zh.json index 8ed068b09..d560e569f 100644 --- a/src/i18n/langs/zh.json +++ b/src/i18n/langs/zh.json @@ -1720,6 +1720,7 @@ "UpdateNodeAssetHardwareInfo": "更新节点资产硬件信息" }, "users": { + "UnbindHelpText": "此用户非本地用户,无法进行解绑,请联系管理员", "SetStatus": "设置状态", "Set": "已设置", "NotSet": "未设置", diff --git a/src/views/profile/ProfileInfo.vue b/src/views/profile/ProfileInfo.vue index 245ad6f2f..d33f04eab 100644 --- a/src/views/profile/ProfileInfo.vue +++ b/src/views/profile/ProfileInfo.vue @@ -63,7 +63,10 @@ export default { title: this.$t('users.setWeCom'), attrs: { type: 'primary', - label: this.$store.state.users.profile.wecom_id ? this.$t('common.unbind') : this.$t('common.bind') + label: this.$store.state.users.profile.wecom_id ? this.$t('common.unbind') : this.$t('common.bind'), + disabled: this.isComponentDisabled('wecom_id'), + showTip: this.isComponentDisabled('wecom_id'), + tip: this.$t('users.UnbindHelpText') }, has: this.$store.getters.publicSettings.AUTH_WECOM, callbacks: { @@ -77,7 +80,10 @@ export default { title: this.$t('users.setDingTalk'), attrs: { type: 'primary', - label: this.$store.state.users.profile.dingtalk_id ? this.$t('common.unbind') : this.$t('common.bind') + label: this.$store.state.users.profile.dingtalk_id ? this.$t('common.unbind') : this.$t('common.bind'), + disabled: this.isComponentDisabled('dingtalk_id'), + showTip: this.isComponentDisabled('dingtalk_id'), + tip: this.$t('users.UnbindHelpText') }, has: this.$store.getters.publicSettings.AUTH_DINGTALK, callbacks: { @@ -91,7 +97,10 @@ export default { title: this.$t('users.setFeiShu'), attrs: { type: 'primary', - label: this.$store.state.users.profile.feishu_id ? this.$t('common.unbind') : this.$t('common.bind') + label: this.$store.state.users.profile.feishu_id ? this.$t('common.unbind') : this.$t('common.bind'), + disabled: this.isComponentDisabled('feishu_id'), + showTip: this.isComponentDisabled('feishu_id'), + tip: this.$t('users.UnbindHelpText') }, has: this.$store.getters.publicSettings.AUTH_FEISHU, callbacks: { @@ -300,6 +309,9 @@ export default { } }, methods: { + isComponentDisabled(source) { + return !!this.$store.state.users.profile[source] && this.$store.state.users.profile.source.value !== 'local' + }, updateUserReceiveBackends(val) { this.$axios.patch( `/api/v1/notifications/user-msg-subscription/${this.object.id}/`, From 40ccab1a19bc64d47de4c84388f65c349d94eda5 Mon Sep 17 00:00:00 2001 From: jiangweidong Date: Tue, 16 May 2023 17:39:57 +0800 Subject: [PATCH 31/47] =?UTF-8?q?perf:=20=E5=87=BD=E6=95=B0=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E6=8A=BD=E7=A6=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/profile/ProfileInfo.vue | 33 ++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/src/views/profile/ProfileInfo.vue b/src/views/profile/ProfileInfo.vue index d33f04eab..94e009907 100644 --- a/src/views/profile/ProfileInfo.vue +++ b/src/views/profile/ProfileInfo.vue @@ -63,9 +63,9 @@ export default { title: this.$t('users.setWeCom'), attrs: { type: 'primary', - label: this.$store.state.users.profile.wecom_id ? this.$t('common.unbind') : this.$t('common.bind'), - disabled: this.isComponentDisabled('wecom_id'), - showTip: this.isComponentDisabled('wecom_id'), + label: this.getBindLabel('wecom_id'), + disabled: this.isDisabled('wecom_id'), + showTip: this.isDisabled('wecom_id'), tip: this.$t('users.UnbindHelpText') }, has: this.$store.getters.publicSettings.AUTH_WECOM, @@ -80,9 +80,9 @@ export default { title: this.$t('users.setDingTalk'), attrs: { type: 'primary', - label: this.$store.state.users.profile.dingtalk_id ? this.$t('common.unbind') : this.$t('common.bind'), - disabled: this.isComponentDisabled('dingtalk_id'), - showTip: this.isComponentDisabled('dingtalk_id'), + label: this.getBindLabel('dingtalk_id'), + disabled: this.isDisabled('dingtalk_id'), + showTip: this.isDisabled('dingtalk_id'), tip: this.$t('users.UnbindHelpText') }, has: this.$store.getters.publicSettings.AUTH_DINGTALK, @@ -97,9 +97,9 @@ export default { title: this.$t('users.setFeiShu'), attrs: { type: 'primary', - label: this.$store.state.users.profile.feishu_id ? this.$t('common.unbind') : this.$t('common.bind'), - disabled: this.isComponentDisabled('feishu_id'), - showTip: this.isComponentDisabled('feishu_id'), + label: this.getBindLabel('feishu_id'), + disabled: this.isDisabled('feishu_id'), + showTip: this.isDisabled('feishu_id'), tip: this.$t('users.UnbindHelpText') }, has: this.$store.getters.publicSettings.AUTH_FEISHU, @@ -127,7 +127,7 @@ export default { attrs: { type: 'primary', label: this.$t('common.Update'), - disabled: this.$store.state.users.profile.source.value !== 'local' + disabled: this.isUserFromSource('local') }, callbacks: { click: function() { @@ -309,8 +309,17 @@ export default { } }, methods: { - isComponentDisabled(source) { - return !!this.$store.state.users.profile[source] && this.$store.state.users.profile.source.value !== 'local' + isBind(sourceField) { + return !!this.$store.state.users.profile[sourceField] + }, + getBindLabel(sourceField) { + return this.isBind(sourceField) ? this.$t('common.unbind') : this.$t('common.bind') + }, + isUserFromSource(sourceName) { + return this.$store.state.users.profile.source.value !== sourceName + }, + isDisabled(sourceField) { + return this.isBind(sourceField) && this.isUserFromSource('local') }, updateUserReceiveBackends(val) { this.$axios.patch( From ce08fd57c67b0f4ea5e8abe7911fbf03586532b0 Mon Sep 17 00:00:00 2001 From: jiangweidong Date: Tue, 16 May 2023 18:00:48 +0800 Subject: [PATCH 32/47] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E5=8F=98?= =?UTF-8?q?=E9=87=8F=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/profile/ProfileInfo.vue | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/views/profile/ProfileInfo.vue b/src/views/profile/ProfileInfo.vue index 94e009907..f67e71370 100644 --- a/src/views/profile/ProfileInfo.vue +++ b/src/views/profile/ProfileInfo.vue @@ -63,9 +63,9 @@ export default { title: this.$t('users.setWeCom'), attrs: { type: 'primary', - label: this.getBindLabel('wecom_id'), - disabled: this.isDisabled('wecom_id'), - showTip: this.isDisabled('wecom_id'), + label: this.getBindLabel('wecom'), + disabled: this.isDisabled('wecom'), + showTip: this.isDisabled('wecom'), tip: this.$t('users.UnbindHelpText') }, has: this.$store.getters.publicSettings.AUTH_WECOM, @@ -80,9 +80,9 @@ export default { title: this.$t('users.setDingTalk'), attrs: { type: 'primary', - label: this.getBindLabel('dingtalk_id'), - disabled: this.isDisabled('dingtalk_id'), - showTip: this.isDisabled('dingtalk_id'), + label: this.getBindLabel('dingtalk'), + disabled: this.isDisabled('dingtalk'), + showTip: this.isDisabled('dingtalk'), tip: this.$t('users.UnbindHelpText') }, has: this.$store.getters.publicSettings.AUTH_DINGTALK, @@ -97,9 +97,9 @@ export default { title: this.$t('users.setFeiShu'), attrs: { type: 'primary', - label: this.getBindLabel('feishu_id'), - disabled: this.isDisabled('feishu_id'), - showTip: this.isDisabled('feishu_id'), + label: this.getBindLabel('feishu'), + disabled: this.isDisabled('feishu'), + showTip: this.isDisabled('feishu'), tip: this.$t('users.UnbindHelpText') }, has: this.$store.getters.publicSettings.AUTH_FEISHU, @@ -309,17 +309,17 @@ export default { } }, methods: { - isBind(sourceField) { - return !!this.$store.state.users.profile[sourceField] + isBind(sourceName) { + return !!this.$store.state.users.profile[`${sourceName}_id`] }, - getBindLabel(sourceField) { - return this.isBind(sourceField) ? this.$t('common.unbind') : this.$t('common.bind') + getBindLabel(sourceName) { + return this.isBind(sourceName) ? this.$t('common.unbind') : this.$t('common.bind') }, isUserFromSource(sourceName) { return this.$store.state.users.profile.source.value !== sourceName }, - isDisabled(sourceField) { - return this.isBind(sourceField) && this.isUserFromSource('local') + isDisabled(sourceName) { + return this.isBind(sourceName) && this.isUserFromSource('local') }, updateUserReceiveBackends(val) { this.$axios.patch( From 80eb072c1b17ffafdb4e1907e73b77cc83010a4d Mon Sep 17 00:00:00 2001 From: jiangweidong Date: Tue, 16 May 2023 18:02:01 +0800 Subject: [PATCH 33/47] =?UTF-8?q?perf:=20=E4=BF=AE=E6=94=B9=E5=8F=98?= =?UTF-8?q?=E9=87=8F=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/profile/ProfileInfo.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/views/profile/ProfileInfo.vue b/src/views/profile/ProfileInfo.vue index f67e71370..9942550f0 100644 --- a/src/views/profile/ProfileInfo.vue +++ b/src/views/profile/ProfileInfo.vue @@ -63,7 +63,7 @@ export default { title: this.$t('users.setWeCom'), attrs: { type: 'primary', - label: this.getBindLabel('wecom'), + label: this.getLabel('wecom'), disabled: this.isDisabled('wecom'), showTip: this.isDisabled('wecom'), tip: this.$t('users.UnbindHelpText') @@ -80,7 +80,7 @@ export default { title: this.$t('users.setDingTalk'), attrs: { type: 'primary', - label: this.getBindLabel('dingtalk'), + label: this.getLabel('dingtalk'), disabled: this.isDisabled('dingtalk'), showTip: this.isDisabled('dingtalk'), tip: this.$t('users.UnbindHelpText') @@ -97,7 +97,7 @@ export default { title: this.$t('users.setFeiShu'), attrs: { type: 'primary', - label: this.getBindLabel('feishu'), + label: this.getLabel('feishu'), disabled: this.isDisabled('feishu'), showTip: this.isDisabled('feishu'), tip: this.$t('users.UnbindHelpText') @@ -312,7 +312,7 @@ export default { isBind(sourceName) { return !!this.$store.state.users.profile[`${sourceName}_id`] }, - getBindLabel(sourceName) { + getLabel(sourceName) { return this.isBind(sourceName) ? this.$t('common.unbind') : this.$t('common.bind') }, isUserFromSource(sourceName) { From ec51b243b163a2a4103c9226ff0925bcfa7df28f Mon Sep 17 00:00:00 2001 From: jiangweidong Date: Tue, 16 May 2023 18:04:01 +0800 Subject: [PATCH 34/47] =?UTF-8?q?perf:=20=E4=BF=AE=E6=94=B9=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=9D=A5=E6=BA=90=E5=88=A4=E6=96=AD=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E5=92=8C=E5=87=BD=E6=95=B0=E5=90=8D=E5=AF=B9=E5=BA=94=E4=B8=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/profile/ProfileInfo.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/views/profile/ProfileInfo.vue b/src/views/profile/ProfileInfo.vue index 9942550f0..ad612c74c 100644 --- a/src/views/profile/ProfileInfo.vue +++ b/src/views/profile/ProfileInfo.vue @@ -127,7 +127,7 @@ export default { attrs: { type: 'primary', label: this.$t('common.Update'), - disabled: this.isUserFromSource('local') + disabled: !this.isUserFromSource('local') }, callbacks: { click: function() { @@ -316,10 +316,10 @@ export default { return this.isBind(sourceName) ? this.$t('common.unbind') : this.$t('common.bind') }, isUserFromSource(sourceName) { - return this.$store.state.users.profile.source.value !== sourceName + return this.$store.state.users.profile.source.value === sourceName }, isDisabled(sourceName) { - return this.isBind(sourceName) && this.isUserFromSource('local') + return this.isBind(sourceName) && !this.isUserFromSource('local') }, updateUserReceiveBackends(val) { this.$axios.patch( From 211933349e549cf8bd53debac1caa659469cefa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com> Date: Tue, 16 May 2023 10:41:46 +0800 Subject: [PATCH 35/47] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E5=91=BD=E4=BB=A4=E5=AD=98=E5=82=A8=E4=B8=8D=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../settings/Terminal/Storage/CommandStorageCreateUpdate.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/views/settings/Terminal/Storage/CommandStorageCreateUpdate.vue b/src/views/settings/Terminal/Storage/CommandStorageCreateUpdate.vue index 72acee91c..5c5469c86 100644 --- a/src/views/settings/Terminal/Storage/CommandStorageCreateUpdate.vue +++ b/src/views/settings/Terminal/Storage/CommandStorageCreateUpdate.vue @@ -65,7 +65,6 @@ export default { if (!validValues?.meta?.HOSTS) { return validValues } - validValues.meta.HOSTS = validValues.meta.HOSTS.toString() return validValues }, cleanFormValue(value) { From 83a116c094d26eb34b5e22bebfcdbd018cee5af6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com> Date: Tue, 16 May 2023 11:01:29 +0800 Subject: [PATCH 36/47] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E5=B9=B3=E5=8F=B0=E6=97=B6=E5=8D=8F=E8=AE=AE=E5=A6=82?= =?UTF-8?q?=E6=9E=9C=E6=98=AFhttp=E6=98=BE=E7=A4=BA=E4=B8=BAhttp(s)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/assets/Platform/PlatformCreateUpdate.vue | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/views/assets/Platform/PlatformCreateUpdate.vue b/src/views/assets/Platform/PlatformCreateUpdate.vue index 271a7d21e..99ce94264 100644 --- a/src/views/assets/Platform/PlatformCreateUpdate.vue +++ b/src/views/assets/Platform/PlatformCreateUpdate.vue @@ -82,6 +82,12 @@ export default { if (obj['category'] && obj['type']) { obj['category_type'] = [obj['category'].value, obj['type'].value] } + obj.protocols = obj.protocols.map(i => { + if (i.name === 'http') { + i.display_name = 'http(s)' + } + return i + }) return obj }, defaultOptions: {} From 667514e90ba762e350b6d4ddc2b6c7c8d98134a8 Mon Sep 17 00:00:00 2001 From: feng <1304903146@qq.com> Date: Wed, 17 May 2023 18:36:33 +0800 Subject: [PATCH 37/47] =?UTF-8?q?fix:=20=E5=B7=A5=E5=8D=95=E5=91=BD?= =?UTF-8?q?=E4=BB=A4=E5=A4=8D=E6=A0=B8=20session=20404?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/tickets/CommandConfirm/Detail/TicketDetail.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/tickets/CommandConfirm/Detail/TicketDetail.vue b/src/views/tickets/CommandConfirm/Detail/TicketDetail.vue index 5250fce44..8cec60371 100644 --- a/src/views/tickets/CommandConfirm/Detail/TicketDetail.vue +++ b/src/views/tickets/CommandConfirm/Detail/TicketDetail.vue @@ -51,7 +51,7 @@ export default { key: this.$t('tickets.ApplyFromSession'), value: object.apply_from_session, formatter: function(item, value) { - const to = { name: 'SessionDetail', params: { id: value }, query: { oid: object.org_id }} + const to = { name: 'SessionDetail', params: { id: value?.id }, query: { oid: object.org_id }} if (!this.$hasPerm('terminal.view_session')) { return {this.$t('sessions.session')} } From bdfc608534ee66fa7a159880b799a6e13fbff9eb Mon Sep 17 00:00:00 2001 From: Aaron3S Date: Wed, 17 May 2023 14:57:23 +0800 Subject: [PATCH 38/47] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=BF=AB?= =?UTF-8?q?=E6=8D=B7=E5=91=BD=E4=BB=A4=E9=80=89=E4=B8=ADsearch=E8=8A=82?= =?UTF-8?q?=E7=82=B9=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ops/Job/QuickJob.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/ops/Job/QuickJob.vue b/src/views/ops/Job/QuickJob.vue index d6e1058e1..03ee5b37f 100644 --- a/src/views/ops/Job/QuickJob.vue +++ b/src/views/ops/Job/QuickJob.vue @@ -333,7 +333,7 @@ export default { getSelectedNodes() { return this.ztree.getCheckedNodes().filter(node => { const status = node.getCheckStatus() - return status.half === false + return node.id !== 'search' && status.half === false }) }, From 89b3ea51f5215d72f73717e73f0f935284f8d866 Mon Sep 17 00:00:00 2001 From: Aaron3S Date: Wed, 17 May 2023 16:18:08 +0800 Subject: [PATCH 39/47] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=20ops=20?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/FormFields/CodeEditor.vue | 1 + src/i18n/langs/en.json | 1 + src/i18n/langs/ja.json | 1 + src/i18n/langs/zh.json | 1 + src/views/ops/Job/QuickJob.vue | 8 +++++--- 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/FormFields/CodeEditor.vue b/src/components/FormFields/CodeEditor.vue index cc9e05aec..fa8119e5e 100644 --- a/src/components/FormFields/CodeEditor.vue +++ b/src/components/FormFields/CodeEditor.vue @@ -20,6 +20,7 @@ { const ns = data.map(item => { return { value: item.username } From 05e7e6dd06416e9a63d680109aa87bd37b071099 Mon Sep 17 00:00:00 2001 From: ibuler Date: Wed, 17 May 2023 20:01:13 +0800 Subject: [PATCH 40/47] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E7=BB=84?= =?UTF-8?q?=E7=BB=87=E5=88=87=E6=8D=A2=E5=8F=AF=E8=83=BD=E5=BC=95=E8=B5=B7?= =?UTF-8?q?=E7=9A=84=E8=B7=AF=E7=94=B1=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/NavHeader/Organization.vue | 2 +- src/router/console/xpack.js | 7 +++-- src/utils/org.js | 31 +++++++++++-------- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/src/layout/components/NavHeader/Organization.vue b/src/layout/components/NavHeader/Organization.vue index 42aade135..3fbc4d64f 100644 --- a/src/layout/components/NavHeader/Organization.vue +++ b/src/layout/components/NavHeader/Organization.vue @@ -115,7 +115,7 @@ export default { this.$router.push({ name: 'OrganizationList' }) break default: - orgUtil.changeOrg(org) + orgUtil.changeOrg(org, true, this) } } } diff --git a/src/router/console/xpack.js b/src/router/console/xpack.js index 14fe9191d..cefdbdd39 100644 --- a/src/router/console/xpack.js +++ b/src/router/console/xpack.js @@ -36,12 +36,13 @@ export default [ children: [ { path: '', - component: () => import('@/views/assets/Cloud/Account/AccountList'), + component: () => import('@/views/assets/Cloud/'), name: 'AccountList', hidden: true, meta: { title: i18n.t('xpack.Cloud.AccountList'), - permissions: ['xpack.view_account'] + permissions: ['xpack.view_account'], + hidden: true } }, { @@ -90,7 +91,7 @@ export default [ children: [ { path: '', - component: () => import('@/views/assets/Cloud/SyncInstanceTask/SyncInstanceTaskList'), + component: () => import('@/views/assets/Cloud/'), name: 'SyncInstanceTaskList', hidden: true, meta: { diff --git a/src/utils/org.js b/src/utils/org.js index 48d176a23..d9f406e52 100644 --- a/src/utils/org.js +++ b/src/utils/org.js @@ -1,5 +1,4 @@ import store from '@/store' -import { hasUUID, replaceUUID } from '@/utils/common' export const DEFAULT_ORG_ID = '00000000-0000-0000-0000-000000000002' export const SYSTEM_ORG_ID = '00000000-0000-0000-0000-000000000004' @@ -18,21 +17,27 @@ async function change2PropOrg() { await changeOrg(org) } -async function changeOrg(org, reload = true) { +async function changeOrg(org, reload = true, vm = null) { await store.dispatch('users/setCurrentOrg', org) await store.dispatch('app/reset') - let path = location.href - if (hasUUID(path)) { - path = replaceUUID(path, '') - path = _.trimEnd(path, '/') - location.href = path - } else { - const index = path.indexOf('?') - if (index !== -1) { - location.href = path.substring(0, index) - } - setTimeout(() => location.reload(), 400) + let path = location.hash.slice(1) + const index = path.indexOf('?') + if (index !== -1) { + path = path.slice(0, index) } + const idRegex = /\/(-?\d+(\.\d+)?|[a-fA-F0-9]{8}-(?:[a-fA-F0-9]{4}-){3}[a-fA-F0-9]{12})\// + const i = path.search(idRegex) + if (i !== -1) { + path = path.slice(0, i + 1) + } + if (vm) { + const result = vm.$router.resolve({ path }) + if (result.resolved.name === '404') { + path = '/' + } + } + location.hash = '#' + path + setTimeout(() => location.reload(), 400) } function hasCurrentOrgPermission() { From 3294495577b3a8272ea87e201a03767357446383 Mon Sep 17 00:00:00 2001 From: feng <1304903146@qq.com> Date: Thu, 18 May 2023 16:29:30 +0800 Subject: [PATCH 41/47] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E8=B5=84=E4=BA=A7=E6=97=B6=E5=88=9B=E5=BB=BA=E8=B4=A6?= =?UTF-8?q?=E5=8F=B7=E7=9A=84=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../assets/Asset/AssetCreateUpdate/BaseAssetCreateUpdate.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/views/assets/Asset/AssetCreateUpdate/BaseAssetCreateUpdate.vue b/src/views/assets/Asset/AssetCreateUpdate/BaseAssetCreateUpdate.vue index 046925627..81832ec15 100644 --- a/src/views/assets/Asset/AssetCreateUpdate/BaseAssetCreateUpdate.vue +++ b/src/views/assets/Asset/AssetCreateUpdate/BaseAssetCreateUpdate.vue @@ -74,6 +74,7 @@ export default { delete values['accounts'] } else { const accounts = values?.accounts || [] + accounts.reverse() values.accounts = accounts.map((item) => { item['secret'] = encryptPassword(item['secret']) return item From 2434e434b786756c1ae0c0dc1a432d848f7dec8b Mon Sep 17 00:00:00 2001 From: Bai Date: Thu, 18 May 2023 19:01:55 +0800 Subject: [PATCH 42/47] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E7=BB=84?= =?UTF-8?q?=E7=BB=87=E7=AE=A1=E7=90=86=E5=91=98=E4=B8=8D=E8=83=BD=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E7=B3=BB=E7=BB=9F=E7=AE=A1=E7=90=86=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/users/User/UserDetail/UserInfo.vue | 2 +- src/views/users/User/UserDetail/index.vue | 11 ++++++++++- src/views/users/User/UserList.vue | 5 ++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/views/users/User/UserDetail/UserInfo.vue b/src/views/users/User/UserDetail/UserInfo.vue index f69a3aecf..1e8ae8b06 100644 --- a/src/views/users/User/UserDetail/UserInfo.vue +++ b/src/views/users/User/UserDetail/UserInfo.vue @@ -188,7 +188,7 @@ export default { { key: this.$t('users.Role'), formatter: (item, val) => { - const rolesDisplay = this.object.org_roles.concat(this.object.system_roles) + const rolesDisplay = this.object.org_roles.concat(this.object.system_roles || []) const dom = rolesDisplay.map(item => { return {item.display_name} }) diff --git a/src/views/users/User/UserDetail/index.vue b/src/views/users/User/UserDetail/index.vue index 86111d6c3..0f576137f 100644 --- a/src/views/users/User/UserDetail/index.vue +++ b/src/views/users/User/UserDetail/index.vue @@ -12,6 +12,7 @@ import UserAssetPermissionRules from './UserAssetPermissionRules' import UserGrantedAssets from './UserGrantedAssets' import UserLoginACLList from '@/views/acl/UserLoginACL/UserLoginACLList' import UserInfo from './UserInfo' +import { mapGetters } from 'vuex' export default { components: { @@ -28,7 +29,10 @@ export default { config: { activeMenu: 'UserInfo', actions: { - canUpdate: this.$hasPerm('users.change_user') + canUpdate: () => { + return this.$hasPerm('users.change_user') && + !(!this.currentUserIsSuperAdmin && this.user['is_superuser']) + } }, submenu: [ { @@ -54,6 +58,11 @@ export default { } } }, + computed: { + ...mapGetters([ + 'currentUserIsSuperAdmin' + ]) + }, methods: { handleTabClick(tab) { this.$log.debug('Current nav is: ', this.config.activeMenu) diff --git a/src/views/users/User/UserList.vue b/src/views/users/User/UserList.vue index c7a2223c1..ca6440af9 100644 --- a/src/views/users/User/UserList.vue +++ b/src/views/users/User/UserList.vue @@ -117,7 +117,10 @@ export default { formatterArgs: { fixed: 'right', hasDelete: hasDelete, - canUpdate: this.$hasPerm('users.change_user'), + canUpdate: ({ row }) => { + return this.$hasPerm('users.change_user') && + !(!this.currentUserIsSuperAdmin && row['is_superuser']) + }, extraActions: [ { title: this.$t('users.Remove'), From 021eb1fd5b7c5b732f6926b74567a9c3f62a835f Mon Sep 17 00:00:00 2001 From: Bai Date: Fri, 19 May 2023 15:37:02 +0800 Subject: [PATCH 43/47] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E8=B5=84?= =?UTF-8?q?=E4=BA=A7=E5=B9=B3=E5=8F=B0=E8=AF=A6=E6=83=85=E6=98=BE=E7=A4=BA?= =?UTF-8?q?ID=E5=AD=97=E6=AE=B5=EF=BC=9B=E4=BC=98=E5=8C=96=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E7=9B=91=E6=8E=A7=E6=98=BE=E7=A4=BAVideo-Worker?= =?UTF-8?q?=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/assets/Platform/PlatformDetail/Detail.vue | 6 +++--- .../settings/Terminal/Monitor/component/MonitorCard.vue | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/views/assets/Platform/PlatformDetail/Detail.vue b/src/views/assets/Platform/PlatformDetail/Detail.vue index c6685ca02..78507dde8 100644 --- a/src/views/assets/Platform/PlatformDetail/Detail.vue +++ b/src/views/assets/Platform/PlatformDetail/Detail.vue @@ -61,14 +61,14 @@ export default { quickActions: [], url: `/api/v1/assets/platforms/${this.object.id}`, detailFields: [ - 'name', 'charset', 'internal', + 'id', 'name', 'charset', 'internal', { key: this.$t('assets.Type'), value: `${this.object.category?.label}/${this.object.type?.label}` }, - 'su_method', - 'comment' + 'su_method', 'comment' ], + protocolChoices: null, constraints: {} } diff --git a/src/views/settings/Terminal/Monitor/component/MonitorCard.vue b/src/views/settings/Terminal/Monitor/component/MonitorCard.vue index 261aac59a..fb7a8a07c 100644 --- a/src/views/settings/Terminal/Monitor/component/MonitorCard.vue +++ b/src/views/settings/Terminal/Monitor/component/MonitorCard.vue @@ -93,7 +93,8 @@ export default { core: 'Core', celery: 'Celery', magnus: 'Magnus', - tinker: 'Tinker' + tinker: 'Tinker', + video_worker: 'Video-Worker' } return nameMapper[this.componentMetric.type] } From 170dde2ba5781e32ea75d2202e59de17245c7318 Mon Sep 17 00:00:00 2001 From: jiangweidong Date: Fri, 19 May 2023 15:04:24 +0800 Subject: [PATCH 44/47] =?UTF-8?q?fix:=20=E5=8E=BB=E6=8E=89=E6=89=8B?= =?UTF-8?q?=E6=9C=BA=E5=8C=BA=E5=8F=B7=E5=92=8C=E6=89=8B=E6=9C=BA=E5=8F=B7?= =?UTF-8?q?=E4=B9=8B=E9=97=B4=E7=9A=84=E7=A9=BA=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/FormFields/PhoneInput.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/FormFields/PhoneInput.vue b/src/components/FormFields/PhoneInput.vue index 8ff756bc7..cf61cec63 100644 --- a/src/components/FormFields/PhoneInput.vue +++ b/src/components/FormFields/PhoneInput.vue @@ -57,7 +57,7 @@ export default { if (!this.rawValue.phone) { return '' } - return `${this.rawValue.code} ${this.rawValue.phone}` + return `${this.rawValue.code}${this.rawValue.phone}` } }, mounted() { From d3cbb48e05f2574b6027e86ecc67bc6930f7268d Mon Sep 17 00:00:00 2001 From: jiangweidong Date: Fri, 19 May 2023 15:14:56 +0800 Subject: [PATCH 45/47] =?UTF-8?q?fix:=20=E5=B1=95=E7=A4=BA=E6=89=8B?= =?UTF-8?q?=E6=9C=BA=E5=8F=B7=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/users/User/UserDetail/UserInfo.vue | 2 +- src/views/users/User/UserList.vue | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/views/users/User/UserDetail/UserInfo.vue b/src/views/users/User/UserDetail/UserInfo.vue index 1e8ae8b06..a53cd54ad 100644 --- a/src/views/users/User/UserDetail/UserInfo.vue +++ b/src/views/users/User/UserDetail/UserInfo.vue @@ -181,7 +181,7 @@ export default { key: this.$t('users.Phone'), formatter: () => { const phoneObj = this.object.phone - return
{phoneObj?.code} {phoneObj?.phone}
+ return
{phoneObj?.code}{phoneObj?.phone}
} }, 'wecom_id', 'dingtalk_id', 'feishu_id', diff --git a/src/views/users/User/UserList.vue b/src/views/users/User/UserList.vue index ca6440af9..e948238a1 100644 --- a/src/views/users/User/UserList.vue +++ b/src/views/users/User/UserList.vue @@ -82,6 +82,12 @@ export default { return this.$store.getters.hasValidLicense && !this.currentOrgIsRoot } }, + phone: { + formatter: (row) => { + const phoneObj = row.phone + return
{phoneObj?.code}{phoneObj?.phone}
+ } + }, login_blocked: { width: '90px', formatterArgs: { From 9ab2acfa5bec805bc89a130cf5b2ad17a45dc120 Mon Sep 17 00:00:00 2001 From: Bai Date: Fri, 19 May 2023 17:38:41 +0800 Subject: [PATCH 46/47] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E7=AE=A1=E7=90=86=E5=91=98=E4=B8=8D=E8=83=BD=E4=BA=92?= =?UTF-8?q?=E7=9B=B8=E6=9B=B4=E6=96=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/users.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/store/modules/users.js b/src/store/modules/users.js index 584fea915..2be1086a1 100644 --- a/src/store/modules/users.js +++ b/src/store/modules/users.js @@ -43,6 +43,7 @@ const mutations = { state.profile = profile state.username = profile.username state.perms = profile.perms + state.isSuperAdmin = profile['is_superuser'] state.consoleOrgs = profile['console_orgs'] state.workbenchOrgs = profile['workbench_orgs'] state.noRootWorkbenchOrgs = profile['workbench_orgs'].filter(item => { From e8dbd99f747c500d83605f1da23fb86aa0069f81 Mon Sep 17 00:00:00 2001 From: feng <1304903146@qq.com> Date: Mon, 22 May 2023 15:49:15 +0800 Subject: [PATCH 47/47] =?UTF-8?q?perf:=20=E8=B5=84=E4=BA=A7=E6=A0=91?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E8=8A=82=E7=82=B9=E8=AF=A6=E6=83=85=E7=9A=84?= =?UTF-8?q?key?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/assets/Asset/AssetList/components/TreeMenu.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/views/assets/Asset/AssetList/components/TreeMenu.vue b/src/views/assets/Asset/AssetList/components/TreeMenu.vue index 8c86c5ae5..509ca75bf 100644 --- a/src/views/assets/Asset/AssetList/components/TreeMenu.vue +++ b/src/views/assets/Asset/AssetList/components/TreeMenu.vue @@ -198,6 +198,7 @@ export default { this.nodeInfoDialogSetting.dialogVisible = true this.nodeInfoDialogSetting.items = [ { key: 'id', label: 'ID', value: res.id }, + { key: 'key', label: 'KEY', value: res.key }, { key: 'name', label: this.$t('assets.Name'), value: res.name }, { key: 'fullName', label: this.$t('assets.FullName'), value: res.full_value } ]