From f7ff3f7db00075f720ae11b2d9e132c50659a9ca Mon Sep 17 00:00:00 2001 From: zhangyu Date: Fri, 25 Mar 2022 09:50:54 +0800 Subject: [PATCH 1/5] =?UTF-8?q?NEZ-1724=20fix:Stat=E5=9B=BE=E8=A1=A8?= =?UTF-8?q?=E5=90=8E=E9=83=A8=E5=88=86=E5=86=85=E5=AE=B9=E6=B8=B2=E6=9F=93?= =?UTF-8?q?=E4=B8=8D=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/assets/css/components/chart/chart.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nezha-fronted/src/assets/css/components/chart/chart.scss b/nezha-fronted/src/assets/css/components/chart/chart.scss index ffdfcd502..8b058daea 100644 --- a/nezha-fronted/src/assets/css/components/chart/chart.scss +++ b/nezha-fronted/src/assets/css/components/chart/chart.scss @@ -430,6 +430,9 @@ flex-wrap: wrap; padding: 5px; box-sizing: border-box; + flex-direction: row; + align-items: center; + align-content: center; .chart-stat-item{ display: flex; justify-content: center; @@ -441,6 +444,7 @@ padding: 2px; overflow: hidden; color: $--color-text-regular; + flex-grow: 1 } } .chart-gauge-box{ From 72cca3e3c6cb4ab8f8c020491e0cdb916820eeb8 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Fri, 25 Mar 2022 09:52:05 +0800 Subject: [PATCH 2/5] =?UTF-8?q?fix=EF=BC=9A=20opearationLog=20=20=20termin?= =?UTF-8?q?alLog=20=20=E9=BB=98=E8=AE=A4=20id=20=E5=80=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/page/config/operationLog.vue | 1 + nezha-fronted/src/components/page/config/terminalLog.vue | 1 + 2 files changed, 2 insertions(+) diff --git a/nezha-fronted/src/components/page/config/operationLog.vue b/nezha-fronted/src/components/page/config/operationLog.vue index b7c91a0b9..fae710055 100644 --- a/nezha-fronted/src/components/page/config/operationLog.vue +++ b/nezha-fronted/src/components/page/config/operationLog.vue @@ -48,6 +48,7 @@ export default { return { url: 'sys/log', tableId: 'operationLogTable', // 需要分页的table的id,用于记录每页数量 + orderBy: '-id', searchMsg: { // 给搜索框子组件传递的信息 searchLabelList: [ { diff --git a/nezha-fronted/src/components/page/config/terminalLog.vue b/nezha-fronted/src/components/page/config/terminalLog.vue index 778e1c782..7a3bf39b2 100644 --- a/nezha-fronted/src/components/page/config/terminalLog.vue +++ b/nezha-fronted/src/components/page/config/terminalLog.vue @@ -115,6 +115,7 @@ export default { return { url: 'terminal/session', tableId: 'terminalLogTable', // 需要分页的table的id,用于记录每页数量 + orderBy: '-id', searchMsg: { // 给搜索框子组件传递的信息 searchLabelList: [ { From fda7713cda5e899dbe6bb86431ef0dc572f82c0e Mon Sep 17 00:00:00 2001 From: zhangyu Date: Fri, 25 Mar 2022 11:43:43 +0800 Subject: [PATCH 3/5] =?UTF-8?q?NEZ-1737=20fix:=E4=BF=AE=E6=94=B9=E7=A7=91?= =?UTF-8?q?=E5=AD=A6=E8=AE=A1=E6=95=B0=E6=B3=95=E6=9C=AA=E6=AD=A3=E5=B8=B8?= =?UTF-8?q?=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/components/charts/chartDataFormat.js | 48 ++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/nezha-fronted/src/components/charts/chartDataFormat.js b/nezha-fronted/src/components/charts/chartDataFormat.js index 40968ce24..9d307364b 100644 --- a/nezha-fronted/src/components/charts/chartDataFormat.js +++ b/nezha-fronted/src/components/charts/chartDataFormat.js @@ -4,8 +4,12 @@ * type:自定义参数,用于区分是y轴调用还是tooltip调用,以设置不同精度 type =1 y轴调用 type=2 tooltip调用 * */ import bus from '../../libs/bus' - +import { formatScientificNotation } from '@/components/common/js/tools' function none (value, index) { + const scientificNotationValue = formatScientificNotation(num, dot) + if (!numberWithEConvent(scientificNotationValue)) { + return scientificNotationValue + } return keepDoubleNumber(value) } function short (value, index, type = 1, dot) { @@ -18,14 +22,26 @@ function short (value, index, type = 1, dot) { } } function percent01 (value, index) { + const scientificNotationValue = formatScientificNotation(value, 2) + if (!numberWithEConvent(scientificNotationValue)) { + return `${scientificNotationValue} %` + } value = parseFloat(keepDoubleNumber(Number(value))) return `${value} %` } function percent02 (value, index) { + const scientificNotationValue = formatScientificNotation(value, 2) + if (!numberWithEConvent(scientificNotationValue)) { + return `${scientificNotationValue} %` + } value = parseFloat(keepDoubleNumber(Number(value) * 100)) return `${value} %` } function localFormat (value, index) { + const scientificNotationValue = formatScientificNotation(value, 2) + if (!numberWithEConvent(scientificNotationValue)) { + return `${scientificNotationValue} %` + } let num = (value || 0).toString() let result = '' while (num.length > 3) { @@ -287,6 +303,32 @@ function days (value, index, type = 1, dot) { return timeCompute(value, 'day', 3) } } +function numberWithEConvent (num) { + if (num) { + if ((('' + num).indexOf('E') !== -1) || (('' + num).indexOf('e') !== -1)) { + const regExp = /'^((\\d+.?\\d+)[Ee]{1}(\\d+))$', 'ig'/ + let result = regExp.exec(num) + let resultValue = '' + let power + if (result != null) { + resultValue = result[2] + power = result[3] + result = regExp.exec(num) + } + + if (resultValue) { + if (power) { + const powVer = Math.pow(10, power) + resultValue = resultValue * powVer + return resultValue + } + } + } else { + return num + } + } + return 0 +} /* * 一般数值格式化方法 * num: 需要格式化的值 @@ -295,6 +337,10 @@ function days (value, index, type = 1, dot) { * dot:保留的小数位, * */ function asciiCompute (num, ascii, units, dot = 2) { + const scientificNotationValue = formatScientificNotation(num, dot) + if (!numberWithEConvent(scientificNotationValue)) { + return scientificNotationValue + } if (!num && num !== 0 && num !== '0') { return '' } From 5b276cf84535aa031bc7311a25feba210ffc8aab Mon Sep 17 00:00:00 2001 From: zhangyu Date: Fri, 25 Mar 2022 14:12:03 +0800 Subject: [PATCH 4/5] =?UTF-8?q?NEZ-1735=20fix=EF=BC=9A=20=E9=83=A8?= =?UTF-8?q?=E5=88=86=E5=86=85=E5=AE=B9=E6=9C=AA=E8=BF=9B=E8=A1=8C=E5=9B=BD?= =?UTF-8?q?=E9=99=85=E5=8C=96=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/chart/chartDetail.vue | 4 ++-- .../common/detailView/detailViewTopSearch.vue | 4 ++-- .../detailView/view/detailViewRight.vue | 24 +++++++++---------- .../common/globalSearch/globalSearch.vue | 2 +- .../common/globalSearch/searchItemInfo.vue | 12 +++++----- .../common/rightBox/chart/chartRightBox.vue | 4 ++-- .../common/rightBox/chart/publicConfig.js | 14 +++++------ .../src/components/page/asset/asset.vue | 2 +- 8 files changed, 33 insertions(+), 33 deletions(-) diff --git a/nezha-fronted/src/components/chart/chartDetail.vue b/nezha-fronted/src/components/chart/chartDetail.vue index 4fac06def..913d12668 100644 --- a/nezha-fronted/src/components/chart/chartDetail.vue +++ b/nezha-fronted/src/components/chart/chartDetail.vue @@ -3,7 +3,7 @@
- Basic info + {{$t('overall.basicInfo')}}
@@ -78,7 +78,7 @@
-
Endpoint
+
{{$t('asset.endpoint')}}
  {{chartDetail ? chartDetail.endpointNum : 0}} diff --git a/nezha-fronted/src/components/common/detailView/detailViewTopSearch.vue b/nezha-fronted/src/components/common/detailView/detailViewTopSearch.vue index 6f4714f24..b400b73db 100644 --- a/nezha-fronted/src/components/common/detailView/detailViewTopSearch.vue +++ b/nezha-fronted/src/components/common/detailView/detailViewTopSearch.vue @@ -18,7 +18,7 @@
@@ -50,7 +50,7 @@ diff --git a/nezha-fronted/src/components/common/detailView/view/detailViewRight.vue b/nezha-fronted/src/components/common/detailView/view/detailViewRight.vue index b73a182f5..85df004a8 100644 --- a/nezha-fronted/src/components/common/detailView/view/detailViewRight.vue +++ b/nezha-fronted/src/components/common/detailView/view/detailViewRight.vue @@ -160,32 +160,32 @@ export default { panel: [ { prop: 'panelTab', name: this.$t('overall.detail'), active: true }, { prop: 'alertMessageTab', name: this.$t('overall.alert'), active: false }, - { prop: 'endpointTab', name: 'Endpoint', active: false }, - { prop: 'log', name: 'Log', active: false } + { prop: 'endpointTab', name: this.$t('asset.endpoint'), active: false }, + { prop: 'log', name: this.$t('overall.logs'), active: false } ], alertMessage: [ { prop: 'panelTab', name: this.$t('overall.detail'), active: false }, { prop: 'alertMessageTab', name: this.$t('overall.alert'), active: true }, - { prop: 'endpointTab', name: 'Endpoint', active: false }, - { prop: 'log', name: 'Log', active: false } + { prop: 'endpointTab', name: this.$t('asset.endpoint'), active: false }, + { prop: 'log', name: this.$t('overall.logs'), active: false } ], endpoint: [ { prop: 'panelTab', name: this.$t('overall.detail'), active: false }, { prop: 'alertMessageTab', name: this.$t('overall.alert'), active: false }, - { prop: 'endpointTab', name: 'Endpoint', active: true }, - { prop: 'log', name: 'Log', active: false } + { prop: 'endpointTab', name: this.$t('asset.endpoint'), active: true }, + { prop: 'log', name: this.$t('overall.logs'), active: false } ], log: [ { prop: 'panelTab', name: this.$t('overall.detail'), active: false }, { prop: 'alertMessageTab', name: this.$t('overall.alert'), active: false }, - { prop: 'endpointTab', name: 'Endpoint', active: false }, - { prop: 'log', name: 'Log', active: true } + { prop: 'endpointTab', name: this.$t('asset.endpoint'), active: false }, + { prop: 'log', name: this.$t('overall.logs'), active: true } ], alertMessageSub: [ { prop: 'panelTab', name: this.$t('overall.detail'), active: false }, { prop: 'alertMessageTab', name: this.$t('overall.alert'), active: false }, - { prop: 'endpointTab', name: 'Endpoint', active: false }, - { prop: 'log', name: 'Log', active: false }, + { prop: 'endpointTab', name: this.$t('asset.endpoint'), active: false }, + { prop: 'log', name: this.$t('overall.logs'), active: false }, { prop: 'assetSubTab', name: this.$t('overall.assetSubTab'), active: true } ] }, @@ -200,8 +200,8 @@ export default { endpointTabTitle: [ { prop: 'panelTab', name: this.$t('overall.detail') }, { prop: 'endpointAlertMessage', name: this.$t('overall.alert') }, - { prop: 'endpointQuery', name: 'Metrics' }, - { prop: 'log', name: 'Log' } + { prop: 'endpointQuery', name: this.$t('project.metrics.metrics') }, + { prop: 'log', name: this.$t('overall.logs') } ] }, chartTemp: { diff --git a/nezha-fronted/src/components/common/globalSearch/globalSearch.vue b/nezha-fronted/src/components/common/globalSearch/globalSearch.vue index 6372b0a8f..7e72e7f66 100644 --- a/nezha-fronted/src/components/common/globalSearch/globalSearch.vue +++ b/nezha-fronted/src/components/common/globalSearch/globalSearch.vue @@ -93,7 +93,7 @@ {{$t('globalSearch.toEsc')}}