From 5dc9b7571c8cabaaf8f21dc21412b1c5b8a6d265 Mon Sep 17 00:00:00 2001 From: "@changcode" Date: Thu, 22 Jul 2021 10:00:29 +0800 Subject: [PATCH] =?UTF-8?q?NEZ-771=20fix:=20=E4=BF=AE=E5=A4=8D=E5=9B=BE?= =?UTF-8?q?=E8=A1=A8=E9=94=99=E4=BD=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/assets/css/common/tableCommon.scss | 3 +++ .../src/components/common/mixin/rightBox.js | 17 ----------------- .../common/table/alert/alertRuleTable.vue | 8 ++++++++ .../common/table/alert/alertSilenceTable.vue | 1 + .../common/table/asset/assetMetaTable.vue | 4 +++- .../common/table/settings/agentTable.vue | 2 ++ .../common/table/settings/chartTmplTable.vue | 6 +++++- .../common/table/settings/credentialsTable.vue | 8 +++++--- .../common/table/settings/dcTable.vue | 4 ++++ .../common/table/settings/endpointTable.vue | 4 ++++ .../common/table/settings/modelTable.vue | 1 + .../common/table/settings/terminalLogTable.vue | 4 ++++ .../page/config/system/apiKeyTable.vue | 1 + 13 files changed, 41 insertions(+), 22 deletions(-) delete mode 100644 nezha-fronted/src/components/common/mixin/rightBox.js diff --git a/nezha-fronted/src/assets/css/common/tableCommon.scss b/nezha-fronted/src/assets/css/common/tableCommon.scss index e6987fc12..30a9333fd 100644 --- a/nezha-fronted/src/assets/css/common/tableCommon.scss +++ b/nezha-fronted/src/assets/css/common/tableCommon.scss @@ -301,6 +301,9 @@ .el-table__body-wrapper { overflow: auto; } + .el-table__fixed-body-wrapper { + top: 42px !important; + } .el-table__body-wrapper, .el-table__fixed-body-wrapper { box-shadow: 1px 0 $--right-box-border-color; diff --git a/nezha-fronted/src/components/common/mixin/rightBox.js b/nezha-fronted/src/components/common/mixin/rightBox.js deleted file mode 100644 index 6b2ff3d2d..000000000 --- a/nezha-fronted/src/components/common/mixin/rightBox.js +++ /dev/null @@ -1,17 +0,0 @@ -export default { - data () { - return { - isEdit: false - } - }, - mounted () { - if (this.isEdit) { - window.onbeforeunload = function () { - return window.confirm('还没有完成,确认退出吗?') - } - } - }, - beforeDestroy () { - window.onbeforeunload = null - } -} diff --git a/nezha-fronted/src/components/common/table/alert/alertRuleTable.vue b/nezha-fronted/src/components/common/table/alert/alertRuleTable.vue index 65d43f48e..0db1ccaa5 100644 --- a/nezha-fronted/src/components/common/table/alert/alertRuleTable.vue +++ b/nezha-fronted/src/components/common/table/alert/alertRuleTable.vue @@ -99,36 +99,44 @@ export default { label: this.$t('alert.alertName'), prop: 'name', show: true, + minWidth: 200, sortable: 'custom' }, { label: this.$t('alert.config.expr'), prop: 'expr', + minWidth: 200, show: true }, { label: this.$t('alert.config.operator'), prop: 'operator', + minWidth: 100, show: true }, { label: this.$t('alert.config.threshold'), prop: 'threshold', + minWidth: 100, show: true }, { label: this.$t('alert.config.for'), prop: 'last', + minWidth: 100, show: true }, { label: this.$t('alert.severity'), prop: 'severity', show: true, + minWidth: 100, sortable: 'custom' }, { label: this.$t('alert.summary'), prop: 'summary', + minWidth: 200, show: true }, { label: this.$t('overall.remark'), prop: 'description', + minWidth: 200, show: true }, { label: this.$t('alert.alert'), diff --git a/nezha-fronted/src/components/common/table/alert/alertSilenceTable.vue b/nezha-fronted/src/components/common/table/alert/alertSilenceTable.vue index d687b11c5..e13cf906c 100644 --- a/nezha-fronted/src/components/common/table/alert/alertSilenceTable.vue +++ b/nezha-fronted/src/components/common/table/alert/alertSilenceTable.vue @@ -135,6 +135,7 @@ export default { label: this.$t('alert.silence.matchers'), prop: 'matchers', show: true, + minWidth: 200, sortable: 'custom' }, { label: this.$t('alert.silence.startTime'), diff --git a/nezha-fronted/src/components/common/table/asset/assetMetaTable.vue b/nezha-fronted/src/components/common/table/asset/assetMetaTable.vue index df93d3f23..999ad9ec8 100644 --- a/nezha-fronted/src/components/common/table/asset/assetMetaTable.vue +++ b/nezha-fronted/src/components/common/table/asset/assetMetaTable.vue @@ -101,6 +101,7 @@ export default { label: this.$t('config.assetLabel.name'), prop: 'name', show: true, + minWidth: 250, sortable: 'custom' }, { label: this.$t('config.assetLabel.key'), @@ -132,7 +133,8 @@ export default { }, { label: this.$t('config.assetLabel.params'), prop: 'param', - show: false + show: false, + minWidth: 200 } ] } diff --git a/nezha-fronted/src/components/common/table/settings/agentTable.vue b/nezha-fronted/src/components/common/table/settings/agentTable.vue index c23eeb620..ba3253802 100644 --- a/nezha-fronted/src/components/common/table/settings/agentTable.vue +++ b/nezha-fronted/src/components/common/table/settings/agentTable.vue @@ -91,6 +91,7 @@ export default { label: this.$t('config.agent.dataCenter'), prop: 'dc', show: true, + minWidth: 200, sortable: 'custom' }, { label: this.$t('config.agent.host'), @@ -109,6 +110,7 @@ export default { label: this.$t('asset.state'), prop: 'status', show: true, + minWidth: 100, sortable: 'custom' }, { label: this.$t('config.agent.checkTime'), diff --git a/nezha-fronted/src/components/common/table/settings/chartTmplTable.vue b/nezha-fronted/src/components/common/table/settings/chartTmplTable.vue index a3810aa78..6483e8af0 100644 --- a/nezha-fronted/src/components/common/table/settings/chartTmplTable.vue +++ b/nezha-fronted/src/components/common/table/settings/chartTmplTable.vue @@ -86,21 +86,25 @@ export default { label: this.$t('config.exprTemp.name'), prop: 'name', show: true, + minWidth: 200, sortable: 'custom' }, { label: this.$t('config.exprTemp.type'), prop: 'type', show: true, + minWidth: 200, sortable: 'custom' }, { label: this.$t('config.exprTemp.varType'), prop: 'varType', show: true, + minWidth: 200, sortable: 'custom' }, { label: this.$t('overall.remark'), prop: 'remark', - show: true + show: true, + minWidth: 200, } ] } diff --git a/nezha-fronted/src/components/common/table/settings/credentialsTable.vue b/nezha-fronted/src/components/common/table/settings/credentialsTable.vue index 33a18b1df..de3730cc9 100644 --- a/nezha-fronted/src/components/common/table/settings/credentialsTable.vue +++ b/nezha-fronted/src/components/common/table/settings/credentialsTable.vue @@ -98,17 +98,18 @@ export default { prop: 'id', show: true, width: 80, - sortable:'custom' + sortable: 'custom' }, { label: this.$t('overall.name'), prop: 'name', show: true, - sortable:'custom' + sortable: 'custom' }, { label: this.$t('config.mib.credential.type'), prop: 'type', show: true, - sortable:'custom' + minWidth: 200, + sortable: 'custom' }, { label: this.$t('config.mib.credential.port'), prop: 'port', @@ -116,6 +117,7 @@ export default { }, { label: this.$t('overall.remark'), prop: 'remark', + minWidth: 200, show: true }] } diff --git a/nezha-fronted/src/components/common/table/settings/dcTable.vue b/nezha-fronted/src/components/common/table/settings/dcTable.vue index 913b00839..6387a7edc 100644 --- a/nezha-fronted/src/components/common/table/settings/dcTable.vue +++ b/nezha-fronted/src/components/common/table/settings/dcTable.vue @@ -119,6 +119,7 @@ export default { label: this.$t('overall.name'), prop: 'name', show: true, + minWidth: 200, sortable: 'custom' }, { label: this.$t('asset.location'), @@ -128,11 +129,13 @@ export default { label: this.$t('config.dc.cabinetNum'), prop: 'cabinetNum', show: true, + minWidth: 200, sortable: 'custom' }, { label: this.$t('config.dc.assets'), prop: 'assetNum', show: true, + minWidth: 200, sortable: 'custom' }, { label: this.$t('config.dc.alert'), @@ -158,6 +161,7 @@ export default { label: this.$t('config.dc.state'), prop: 'state', show: true, + minWidth: 200, sortable: 'custom' } ] diff --git a/nezha-fronted/src/components/common/table/settings/endpointTable.vue b/nezha-fronted/src/components/common/table/settings/endpointTable.vue index 7745f85b2..3895ece7c 100644 --- a/nezha-fronted/src/components/common/table/settings/endpointTable.vue +++ b/nezha-fronted/src/components/common/table/settings/endpointTable.vue @@ -143,6 +143,7 @@ export default { label: this.$t('project.endpoint.name'), prop: 'name', show: true, + minWidth: 200, sortable: 'custom' }, { label: this.$t('project.module.type'), @@ -152,12 +153,14 @@ export default { label: this.$t('project.project.projectName'), prop: 'project', show: true, + minWidth: 200, sortable: 'custom' }, { label: this.$t('project.endpoint.asset'), prop: 'asset', show: true, + minWidth: 200, sortable: 'custom' }, { @@ -180,6 +183,7 @@ export default { label: this.$t('project.endpoint.state'), prop: 'state', show: true, + minWidth: 200, sortable: 'custom' } // { diff --git a/nezha-fronted/src/components/common/table/settings/modelTable.vue b/nezha-fronted/src/components/common/table/settings/modelTable.vue index 2559cee13..7fbcf1c05 100644 --- a/nezha-fronted/src/components/common/table/settings/modelTable.vue +++ b/nezha-fronted/src/components/common/table/settings/modelTable.vue @@ -113,6 +113,7 @@ export default { }, { label: this.$t('overall.remark'), prop: 'remark', + minWidth: 200, show: true } ] diff --git a/nezha-fronted/src/components/common/table/settings/terminalLogTable.vue b/nezha-fronted/src/components/common/table/settings/terminalLogTable.vue index 5509fb7ea..18b005234 100644 --- a/nezha-fronted/src/components/common/table/settings/terminalLogTable.vue +++ b/nezha-fronted/src/components/common/table/settings/terminalLogTable.vue @@ -127,15 +127,18 @@ export default { }, { label: this.$t('config.terminallog.SessionID'), prop: 'uuid', + minWidth: 200, show: true }, { label: this.$t('config.terminallog.username'), prop: 'username', + minWidth: 200, show: true }, { label: this.$t('config.terminallog.source'), prop: 'remoteAddr', + minWidth: 200, show: true }, { @@ -151,6 +154,7 @@ export default { { label: this.$t('config.terminallog.startTime'), prop: 'startTime', + minWidth: 200, show: true }, { diff --git a/nezha-fronted/src/components/page/config/system/apiKeyTable.vue b/nezha-fronted/src/components/page/config/system/apiKeyTable.vue index 4dec0db2d..645c3b219 100644 --- a/nezha-fronted/src/components/page/config/system/apiKeyTable.vue +++ b/nezha-fronted/src/components/page/config/system/apiKeyTable.vue @@ -137,6 +137,7 @@ export default { }, { label: this.$t('config.system.apiKey.creatAt'), prop: 'createAt', + minWidth: 80, show: true } ],