From 291369959793a80c1e04abf13131cea8e1b6f5d3 Mon Sep 17 00:00:00 2001 From: jym503558564 <503558564@qq.com> Date: Mon, 27 Jul 2020 14:59:24 +0800 Subject: [PATCH] =?UTF-8?q?fix(tableList):=20=E4=BC=98=E5=8C=96=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E7=BB=84=E4=BB=B6=E4=B8=80=E4=BA=9B=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E7=9A=84=E5=AE=BD=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/AssetUserTable/index.vue | 4 ++-- .../applications/DatabaseApp/DatabaseAppList.vue | 9 ++++++++- src/views/applications/RemoteApp/RemoteAppList.vue | 3 ++- src/views/assets/AdminUser/AdminUserList.vue | 3 ++- .../CommandFilter/CommandFilterDetail/Rules.vue | 9 +++++++++ src/views/assets/Domain/DomainDetail/GatewayList.vue | 9 ++++++++- src/views/assets/Label/LabelList.vue | 3 ++- src/views/assets/Platform/PlatformList.vue | 3 ++- src/views/assets/SystemUser/SystemUserList.vue | 9 ++++++--- src/views/audits/CommandExecutionList.vue | 1 + src/views/audits/FTPLogList.vue | 2 +- src/views/audits/LoginLogList.vue | 9 ++++++--- src/views/audits/OperateLogList.vue | 5 +++-- src/views/audits/PasswordChangeLogList.vue | 3 ++- .../TaskDetail/AdhocDetail/AdhocExecutionHistory.vue | 7 ++++--- src/views/ops/TaskDetail/TaskAdhoc.vue | 5 ++++- src/views/ops/TaskDetail/TaskHistory.vue | 10 ++++++---- .../perms/AssetPermission/AssetPermissionList.vue | 6 +++--- src/views/sessions/CommandList.vue | 2 +- .../sessions/SessionDetail/SessionCommandList.vue | 1 + src/views/sessions/SessionList/BaseList.vue | 11 ++++++----- src/views/sessions/TerminalList.vue | 3 ++- src/views/tickets/TicketListTable.vue | 8 +++++--- src/views/users/Group/UserGroupList.vue | 3 ++- 24 files changed, 88 insertions(+), 40 deletions(-) diff --git a/src/components/AssetUserTable/index.vue b/src/components/AssetUserTable/index.vue index e88b04f52..4430664fc 100644 --- a/src/components/AssetUserTable/index.vue +++ b/src/components/AssetUserTable/index.vue @@ -120,7 +120,7 @@ export default { { prop: 'ip', label: this.$t('assets.ip'), - width: 140 + width: '120px' }, { prop: 'username', @@ -130,7 +130,7 @@ export default { { prop: 'version', label: this.$t('assets.Version'), - width: '50px' + width: '70px' }, { prop: 'date_created', diff --git a/src/views/applications/DatabaseApp/DatabaseAppList.vue b/src/views/applications/DatabaseApp/DatabaseAppList.vue index a02b49b74..becfb9bac 100644 --- a/src/views/applications/DatabaseApp/DatabaseAppList.vue +++ b/src/views/applications/DatabaseApp/DatabaseAppList.vue @@ -18,7 +18,14 @@ export default { ], columnsMeta: { get_type_display: { - label: this.$t('applications.type') + label: this.$t('applications.type'), + width: '80px' + }, + host: { + width: '140px' + }, + port: { + width: '60px' }, database: { showOverflowTooltip: true diff --git a/src/views/applications/RemoteApp/RemoteAppList.vue b/src/views/applications/RemoteApp/RemoteAppList.vue index 1f01792f3..578f703e1 100644 --- a/src/views/applications/RemoteApp/RemoteAppList.vue +++ b/src/views/applications/RemoteApp/RemoteAppList.vue @@ -21,7 +21,8 @@ export default { ], columnsMeta: { type: { - displayKey: 'get_type_display' + displayKey: 'get_type_display', + width: '140px' }, asset: { showOverflowTooltip: true, diff --git a/src/views/assets/AdminUser/AdminUserList.vue b/src/views/assets/AdminUser/AdminUserList.vue index 6bd5e599f..7cd97151e 100644 --- a/src/views/assets/AdminUser/AdminUserList.vue +++ b/src/views/assets/AdminUser/AdminUserList.vue @@ -33,7 +33,8 @@ export default { }, { prop: 'assets_amount', - label: this.$t('assets.Assets') + label: this.$t('assets.Assets'), + width: '80px' }, { prop: 'comment', diff --git a/src/views/assets/CommandFilter/CommandFilterDetail/Rules.vue b/src/views/assets/CommandFilter/CommandFilterDetail/Rules.vue index 0f314b4e1..a052982ea 100644 --- a/src/views/assets/CommandFilter/CommandFilterDetail/Rules.vue +++ b/src/views/assets/CommandFilter/CommandFilterDetail/Rules.vue @@ -22,6 +22,15 @@ export default { url: `/api/v1/assets/cmd-filters/${this.object.id}/rules/`, columns: ['type', 'content', 'priority', 'action', 'comment', 'actions'], columnsMeta: { + type: { + width: '100px' + }, + priority: { + width: '70px' + }, + action: { + width: '90px' + }, content: { showOverflowTooltip: true }, diff --git a/src/views/assets/Domain/DomainDetail/GatewayList.vue b/src/views/assets/Domain/DomainDetail/GatewayList.vue index f0e1088e0..43b05decc 100644 --- a/src/views/assets/Domain/DomainDetail/GatewayList.vue +++ b/src/views/assets/Domain/DomainDetail/GatewayList.vue @@ -25,8 +25,15 @@ export default { sortable: 'custom', formatter: DisplayFormatter }, + ip: { + width: '140px' + }, + port: { + width: '60px' + }, protocol: { - sortable: 'custom' + sortable: 'custom', + width: '100px' }, actions: { formatterArgs: { diff --git a/src/views/assets/Label/LabelList.vue b/src/views/assets/Label/LabelList.vue index 7d073e950..be9cdf367 100644 --- a/src/views/assets/Label/LabelList.vue +++ b/src/views/assets/Label/LabelList.vue @@ -29,7 +29,8 @@ export default { }, { prop: 'asset_count', - label: this.$t('assets.Assets') + label: this.$t('assets.Assets'), + width: '80px' }, { prop: 'id', diff --git a/src/views/assets/Platform/PlatformList.vue b/src/views/assets/Platform/PlatformList.vue index 0bd849c52..3582392cf 100644 --- a/src/views/assets/Platform/PlatformList.vue +++ b/src/views/assets/Platform/PlatformList.vue @@ -28,7 +28,8 @@ export default { { prop: 'base', label: this.$t('assets.BasePlatform'), - sortable: 'custom' + sortable: 'custom', + width: '140px' }, { prop: 'comment', diff --git a/src/views/assets/SystemUser/SystemUserList.vue b/src/views/assets/SystemUser/SystemUserList.vue index 111d175c7..891872c74 100644 --- a/src/views/assets/SystemUser/SystemUserList.vue +++ b/src/views/assets/SystemUser/SystemUserList.vue @@ -34,15 +34,18 @@ export default { { prop: 'protocol', label: this.$t('assets.Protocol'), - sortable: 'custom' + sortable: 'custom', + width: '100px' }, { prop: 'login_mode_display', - label: this.$t('assets.LoginModel') + label: this.$t('assets.LoginModel'), + width: '120px' }, { prop: 'assets_amount', - label: this.$t('assets.Assets') + label: this.$t('assets.Assets'), + width: '80px' }, { prop: 'comment', diff --git a/src/views/audits/CommandExecutionList.vue b/src/views/audits/CommandExecutionList.vue index b5554dc07..221195114 100644 --- a/src/views/audits/CommandExecutionList.vue +++ b/src/views/audits/CommandExecutionList.vue @@ -32,6 +32,7 @@ export default { ], columnsMeta: { hosts: { + width: '60px', formatter: (row, col, cellValue) => { const onClick = () => { vm.relationDialog.tableConfig.url = setUrlParam(vm.relationDialog.tableConfig.url, 'commandexecution', row.id) diff --git a/src/views/audits/FTPLogList.vue b/src/views/audits/FTPLogList.vue index 2673969c9..fc69882c2 100644 --- a/src/views/audits/FTPLogList.vue +++ b/src/views/audits/FTPLogList.vue @@ -38,7 +38,7 @@ export default { showOverflowTooltip: true }, operate: { - width: '90px' + width: '100px' }, is_success: { width: '80px' diff --git a/src/views/audits/LoginLogList.vue b/src/views/audits/LoginLogList.vue index c6b2ad252..586d76beb 100644 --- a/src/views/audits/LoginLogList.vue +++ b/src/views/audits/LoginLogList.vue @@ -27,17 +27,20 @@ export default { showOverflowTooltip: true }, ip: { - width: '140px' + width: '110px' + }, + city: { + width: '90px' }, status: { - width: '80px' + width: '85px' }, mfa: { label: 'MFA', width: '80px' }, type: { - width: '100px' + width: '110px' }, datetime: { width: '160px' diff --git a/src/views/audits/OperateLogList.vue b/src/views/audits/OperateLogList.vue index 3cd99a2be..b1157ec7a 100644 --- a/src/views/audits/OperateLogList.vue +++ b/src/views/audits/OperateLogList.vue @@ -23,7 +23,8 @@ export default { showOverflowTooltip: true }, resource_type: { - showOverflowTooltip: true + showOverflowTooltip: true, + width: '180px' }, resource: { showOverflowTooltip: true @@ -32,7 +33,7 @@ export default { width: '160px' }, remote_addr: { - width: '140px' + width: '120px' }, action: { width: '90px' diff --git a/src/views/audits/PasswordChangeLogList.vue b/src/views/audits/PasswordChangeLogList.vue index 9558ffd37..3de5a13fe 100644 --- a/src/views/audits/PasswordChangeLogList.vue +++ b/src/views/audits/PasswordChangeLogList.vue @@ -26,7 +26,8 @@ export default { showOverflowTooltip: true }, remote_addr: { - showOverflowTooltip: true + showOverflowTooltip: true, + width: '120px' }, datetime: { width: '180px' diff --git a/src/views/ops/TaskDetail/AdhocDetail/AdhocExecutionHistory.vue b/src/views/ops/TaskDetail/AdhocDetail/AdhocExecutionHistory.vue index 9c26c6efe..44f95389d 100644 --- a/src/views/ops/TaskDetail/AdhocDetail/AdhocExecutionHistory.vue +++ b/src/views/ops/TaskDetail/AdhocDetail/AdhocExecutionHistory.vue @@ -28,7 +28,7 @@ export default { stat: { label: this.$t('ops.stat'), align: 'center', - width: '80px', + width: '100px', formatter: function(row) { const summary =
{row.stat.success}/ @@ -52,16 +52,17 @@ export default { }, is_finished: { align: 'center', - width: '200px', + width: '100px', label: this.$t('ops.isFinished') }, is_success: { align: 'center', - width: '200px', + width: '100px', label: this.$t('ops.isSuccess') }, timedelta: { label: this.$t('ops.time'), + width: '100px', formatter: function(row) { return row.timedelta.toFixed(2) + 's' } diff --git a/src/views/ops/TaskDetail/TaskAdhoc.vue b/src/views/ops/TaskDetail/TaskAdhoc.vue index a8259e3fc..c8c5c1014 100644 --- a/src/views/ops/TaskDetail/TaskAdhoc.vue +++ b/src/views/ops/TaskDetail/TaskAdhoc.vue @@ -34,6 +34,7 @@ export default { }, hosts: { label: this.$t('ops.hosts'), + width: '80px', formatter: (row, column, cellValue) => { if (cellValue instanceof Array) { return cellValue.length @@ -43,7 +44,8 @@ export default { showOverflowTooltip: true }, pattern: { - label: this.$t('ops.pattern') + label: this.$t('ops.pattern'), + width: '80px' }, run_as: { label: this.$t('ops.runAs'), @@ -67,6 +69,7 @@ export default { }, actions: { prop: 'id', + width: '80px', formatterArgs: { hasEdit: false, hasDelete: false, diff --git a/src/views/ops/TaskDetail/TaskHistory.vue b/src/views/ops/TaskDetail/TaskHistory.vue index 96db24c6d..d0e4732d5 100644 --- a/src/views/ops/TaskDetail/TaskHistory.vue +++ b/src/views/ops/TaskDetail/TaskHistory.vue @@ -27,12 +27,13 @@ export default { ], columnsMeta: { date_start: { - formatter: (row) => toSafeLocalDateStr(row.date_start) + formatter: (row) => toSafeLocalDateStr(row.date_start), + width: '160px' }, stat: { label: this.$t('ops.stat'), align: 'center', - width: '80px', + width: '100px', formatter: function(row) { return (
@@ -57,16 +58,17 @@ export default { }, is_finished: { align: 'center', - width: '200px', + width: '100px', label: this.$t('ops.isFinished') }, is_success: { align: 'center', - width: '200px', + width: '100px', label: this.$t('ops.isSuccess') }, timedelta: { label: this.$t('ops.time'), + width: '100px', formatter: function(row) { return row.timedelta.toFixed(2) + 's' } diff --git a/src/views/perms/AssetPermission/AssetPermissionList.vue b/src/views/perms/AssetPermission/AssetPermissionList.vue index 986ce1b71..7d960615c 100644 --- a/src/views/perms/AssetPermission/AssetPermissionList.vue +++ b/src/views/perms/AssetPermission/AssetPermissionList.vue @@ -35,7 +35,7 @@ export default { }, users_amount: { label: this.$t('perms.User'), - width: '100px', + width: '60px', formatter: DetailFormatter, formatterArgs: { routeQuery: { @@ -55,7 +55,7 @@ export default { }, assets_amount: { label: this.$t('perms.Asset'), - width: '100px', + width: '60px', formatter: DetailFormatter, formatterArgs: { routeQuery: { @@ -65,7 +65,7 @@ export default { }, nodes_amount: { label: this.$t('perms.Node'), - width: '100px', + width: '60px', formatter: DetailFormatter, formatterArgs: { routeQuery: { diff --git a/src/views/sessions/CommandList.vue b/src/views/sessions/CommandList.vue index 35c85254b..f1ace032a 100644 --- a/src/views/sessions/CommandList.vue +++ b/src/views/sessions/CommandList.vue @@ -36,7 +36,7 @@ export default { }, risk_level: { label: this.$t('sessions.riskLevel'), - width: '120px', + width: '105px', formatter: (row, col, cellValue) => { const display = row.risk_level_display if (cellValue === 0) { diff --git a/src/views/sessions/SessionDetail/SessionCommandList.vue b/src/views/sessions/SessionDetail/SessionCommandList.vue index d719c706a..5dd3499fd 100644 --- a/src/views/sessions/SessionDetail/SessionCommandList.vue +++ b/src/views/sessions/SessionDetail/SessionCommandList.vue @@ -39,6 +39,7 @@ export default { }, timestamp: { label: this.$t('sessions.date'), + width: '160px', sortable: 'custom', formatter: function(row) { return toSafeLocalDateStr(row.timestamp * 1000) diff --git a/src/views/sessions/SessionList/BaseList.vue b/src/views/sessions/SessionList/BaseList.vue index 9e45081d6..5e3db78a6 100644 --- a/src/views/sessions/SessionList/BaseList.vue +++ b/src/views/sessions/SessionList/BaseList.vue @@ -36,7 +36,7 @@ export default { index: { label: this.$t('sessions.id'), align: 'center', - width: '60px', + width: '40px', formatter: function(row, column, cellValue, index) { const label = index + 1 const route = { to: { name: 'SessionDetail', params: { id: row.id }}} @@ -51,18 +51,19 @@ export default { }, command_amount: { label: this.$t('sessions.command'), - width: '100px' + width: '90px' }, system_user: { - showOverflowTooltip: true + showOverflowTooltip: true, + width: '100px' }, login_from: { label: this.$t('sessions.loginFrom'), - width: '120px', + width: '115px', showOverflowTooltip: true }, remote_addr: { - width: '120px' + width: '105px' }, protocol: { label: this.$t('sessions.protocol'), diff --git a/src/views/sessions/TerminalList.vue b/src/views/sessions/TerminalList.vue index 03a785e4d..bb0e4838d 100644 --- a/src/views/sessions/TerminalList.vue +++ b/src/views/sessions/TerminalList.vue @@ -32,7 +32,8 @@ export default { label: this.$t('sessions.alive') }, session_online: { - label: this.$t('sessions.session') + label: this.$t('sessions.session'), + width: '80px' } } }, diff --git a/src/views/tickets/TicketListTable.vue b/src/views/tickets/TicketListTable.vue index dcb2b1def..c3051f39c 100644 --- a/src/views/tickets/TicketListTable.vue +++ b/src/views/tickets/TicketListTable.vue @@ -39,13 +39,14 @@ export default { { prop: 'type_display', label: this.$t('tickets.type'), - sortable: 'custom' + sortable: 'custom', + width: '110px' }, { prop: 'status', label: this.$t('tickets.status'), align: 'center', - width: '100px', + width: '90px', sortable: 'custom', formatter: row => { if (row.status === 'open') { @@ -58,7 +59,8 @@ export default { prop: 'date_created', label: this.$t('tickets.date'), sortable: 'custom', - formatter: (row) => toSafeLocalDateStr(row.date_created) + formatter: (row) => toSafeLocalDateStr(row.date_created), + width: '160px' } ] }, diff --git a/src/views/users/Group/UserGroupList.vue b/src/views/users/Group/UserGroupList.vue index 51a5d1b3f..5d55beac0 100644 --- a/src/views/users/Group/UserGroupList.vue +++ b/src/views/users/Group/UserGroupList.vue @@ -16,7 +16,8 @@ export default { columns: ['name', 'users_amount', 'comment', 'actions'], columnsMeta: { users_amount: { - label: this.$t('users.Users') + label: this.$t('users.Users'), + width: '120px' } }, detailRoute: 'UserGroupDetail'