From f364c8fdf9c4fb08ff768010a14ffbe8651edb95 Mon Sep 17 00:00:00 2001 From: Orange Date: Tue, 15 Dec 2020 20:06:30 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=E6=89=B9=E9=87=8F=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?2.6=E7=89=88=E6=9C=AC=E6=B5=8B=E8=AF=95=E4=BA=A7=E7=94=9F?= =?UTF-8?q?=E7=9A=84Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/langs/cn.json | 5 ++++ src/i18n/langs/en.json | 5 ++++ src/userviews/users/UserProfile/SSHUpdate.vue | 6 +++++ .../ApplicationsPermission.vue | 4 +-- src/views/sessions/TerminalList.vue | 25 ++++++++++++++++++- .../SystemMonitor/component/MonitorCard.vue | 4 ++- src/views/xpack/SystemMonitor/index.vue | 10 ++++---- 7 files changed, 50 insertions(+), 9 deletions(-) diff --git a/src/i18n/langs/cn.json b/src/i18n/langs/cn.json index 6ed331dab..65a339f56 100644 --- a/src/i18n/langs/cn.json +++ b/src/i18n/langs/cn.json @@ -423,6 +423,7 @@ "UserGroups": "用户组", "DatabaseAppPermission": "数据库授权", "RemoteAppPermission": "远程应用授权", + "addApplicationToThisPermission": "添加应用", "KubernetesAppPermission": "Kubernetes授权", "addAssetToThisPermission": "添加资产", "addDatabaseAppToThisPermission": "添加数据库应用", @@ -614,6 +615,10 @@ "name": "名称", "protocol": "协议", "region": "地域", + "sessionActiveCount": "在线会话数量", + "systemCpuLoad": "CPU负载", + "systemDiskUsedPercent": "硬盘使用率", + "systemMemoryUsedPercent": "内存使用率", "remoteAddr": "远端地址", "replay": "回放", "replaySession": "回放会话", diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index f5885c8d6..55088ef26 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -425,6 +425,7 @@ "addAssetToThisPermission": "Add asset to this permission", "addDatabaseAppToThisPermission": "Add DatabaseApp to this permission", "addK8sAppToThisPermission": "Add KubernetesApp to this permission", + "addApplicationToThisPermission": "Add Application to this permission", "addNodeToThisPermission": "Add node to this permission", "addRemoteAppToThisPermission": "Add RemoteApp to this permission", "addSystemUserToThisPermission": "System user", @@ -595,6 +596,10 @@ "duration": "Duration", "endPoint": "Endpoint", "endpointSuffix": "Endpoint suffix", + "sessionActiveCount": "session active count", + "systemCpuLoad": "cpu load", + "systemDiskUsedPercent": "disk used percent", + "systemMemoryUsedPercent": "memory used percent", "go": "Go", "goto": "Goto", "hosts": "Hosts", diff --git a/src/userviews/users/UserProfile/SSHUpdate.vue b/src/userviews/users/UserProfile/SSHUpdate.vue index ac3519c05..e238ee257 100644 --- a/src/userviews/users/UserProfile/SSHUpdate.vue +++ b/src/userviews/users/UserProfile/SSHUpdate.vue @@ -1,12 +1,14 @@ @@ -65,6 +67,10 @@ export default { methods: { getMethod() { return 'put' + }, + onPerformSuccess() { + this.$refs.GenericCreateUpdateForm.$refs.form.$refs.dataForm.resetForm('form') + this.$message.success(this.$t('common.updateSuccessMsg')) } } } diff --git a/src/views/perms/ApplicationPermission/ApplicationPermissionDetail/ApplicationsPermission.vue b/src/views/perms/ApplicationPermission/ApplicationPermissionDetail/ApplicationsPermission.vue index 87c2d6588..bc6ba2b25 100644 --- a/src/views/perms/ApplicationPermission/ApplicationPermissionDetail/ApplicationsPermission.vue +++ b/src/views/perms/ApplicationPermission/ApplicationPermissionDetail/ApplicationsPermission.vue @@ -68,14 +68,14 @@ export default { }, remoteAppRelationConfig: { icon: 'fa-edit', - title: this.$t('perms.addRemoteAppToThisPermission'), + title: this.$t('perms.addApplicationToThisPermission'), objectsAjax: { url: `/api/v1/applications/applications/?category=${this.object.category}&type=${this.object.type}`, transformOption: (item) => { return { label: item.name + ' (' + item.type_display + ')', value: item.id } } }, - hasObjectsId: this.object.application, + hasObjectsId: this.object.applications, showHasObjects: false, performAdd: (items) => { const objectId = this.object.id diff --git a/src/views/sessions/TerminalList.vue b/src/views/sessions/TerminalList.vue index 9b0883e98..515dd8349 100644 --- a/src/views/sessions/TerminalList.vue +++ b/src/views/sessions/TerminalList.vue @@ -92,11 +92,34 @@ export default { }, tableConfig: { url: '/api/v1/terminal/terminals/', - columns: ['name', 'remote_addr', 'session_online', 'is_active', 'is_alive', 'actions'], + columns: ['name', 'remote_addr', 'session_online', + 'state.session_active_count', + 'state.system_cpu_load_1', + 'state.system_disk_used_percent', + 'state.system_memory_used_percent', + 'is_active', + 'is_alive', + 'actions'], columnsMeta: { name: { sortable: 'custom' }, + 'state.session_active_count': { + label: this.$t('sessions.sessionActiveCount'), + width: '160px' + }, + 'state.system_cpu_load_1': { + label: this.$t('sessions.systemCpuLoad'), + width: '160px' + }, + 'state.system_disk_used_percent': { + label: this.$t('sessions.systemDiskUsedPercent'), + width: '160px' + }, + 'state.system_memory_used_percent': { + label: this.$t('sessions.systemMemoryUsedPercent'), + width: '160px' + }, remote_addr: { sortable: 'custom' }, diff --git a/src/views/xpack/SystemMonitor/component/MonitorCard.vue b/src/views/xpack/SystemMonitor/component/MonitorCard.vue index d7959ebd4..5fe004345 100644 --- a/src/views/xpack/SystemMonitor/component/MonitorCard.vue +++ b/src/views/xpack/SystemMonitor/component/MonitorCard.vue @@ -1,7 +1,9 @@ lg