diff --git a/nezha-fronted/src/assets/stylus/main.scss b/nezha-fronted/src/assets/stylus/main.scss index 16b8e4982..f4685088c 100644 --- a/nezha-fronted/src/assets/stylus/main.scss +++ b/nezha-fronted/src/assets/stylus/main.scss @@ -1047,6 +1047,9 @@ li{ padding: 0 20px 20px 20px; border-radius: 10px; } +.nz-pop-select-panel { + z-index: 1999 !important; +} .nz-pop-select-area, .nz-pop-select-panel { padding: 0 !important; box-shadow: 0 2px 12px 0 rgba(0,0,0,.1) !important; diff --git a/nezha-fronted/src/components/common/language/cn.js b/nezha-fronted/src/components/common/language/cn.js index 1fb49759b..2c69df328 100644 --- a/nezha-fronted/src/components/common/language/cn.js +++ b/nezha-fronted/src/components/common/language/cn.js @@ -1765,13 +1765,13 @@ const cn = { }, profile: { profile: '个人中心', - close: '关闭', + close: '禁用', clear: '清空', enable: '启用', update: '更新', operationRecord: '操作记录', changePassword: '修改密码', - oldPassword: '旧密码', + oldPassword: '当前密码', newPassword: '新密码', confirmPassword: '确认密码', lastLoginIp: '最后登录IP', diff --git a/nezha-fronted/src/components/common/language/en.js b/nezha-fronted/src/components/common/language/en.js index d4c8f4089..cfb7f8adb 100644 --- a/nezha-fronted/src/components/common/language/en.js +++ b/nezha-fronted/src/components/common/language/en.js @@ -1647,13 +1647,13 @@ const en = { }, profile: { profile: 'Profile', - close: 'Close', + close: 'disable', clear: 'Clear', enable: 'Enable', update: 'Update', operationRecord: 'Operation log', changePassword: 'Change password', - oldPassword: 'Old password', + oldPassword: 'Current password', newPassword: 'New password', confirmPassword: 'Confirm password', lastLoginIp: 'Last login IP', diff --git a/nezha-fronted/src/components/common/popBox/selectPanel.vue b/nezha-fronted/src/components/common/popBox/selectPanel.vue index d449a7cd1..d3993258b 100644 --- a/nezha-fronted/src/components/common/popBox/selectPanel.vue +++ b/nezha-fronted/src/components/common/popBox/selectPanel.vue @@ -22,10 +22,25 @@ ref="panelTree">
{{ node.label }} - - - - + + + + + + + + + + + Edit + + + Delete + + + + +
@@ -34,6 +49,9 @@
+
+ +
@@ -212,3 +230,8 @@ export default { color: #D96D7A; } + diff --git a/nezha-fronted/src/components/common/popBox/topToolMoreOptions.vue b/nezha-fronted/src/components/common/popBox/topToolMoreOptions.vue index e90cefc24..ef4e0323b 100644 --- a/nezha-fronted/src/components/common/popBox/topToolMoreOptions.vue +++ b/nezha-fronted/src/components/common/popBox/topToolMoreOptions.vue @@ -4,7 +4,7 @@ - +
{{panelLock ? $t("overall.locked") : $t("overall.unlocked")}}
@@ -102,7 +102,7 @@ export default { props: { size: { type: String, - default: 'small' + default: 'medium' }, exportUrl: { type: String, default: '' }, params: { type: Object }, diff --git a/nezha-fronted/src/components/page/config/profile.vue b/nezha-fronted/src/components/page/config/profile.vue index cd11d9b96..5c2d6910c 100644 --- a/nezha-fronted/src/components/page/config/profile.vue +++ b/nezha-fronted/src/components/page/config/profile.vue @@ -63,7 +63,7 @@
{{$t('profile.lastLoginTime')}}
-
{{userList.lastLoginTime}}
+
{{utcTimeToTimezoneStr(userList.lastLoginTime)}}
diff --git a/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue b/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue index 4bf433feb..cc5fed4c2 100644 --- a/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue +++ b/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue @@ -8,16 +8,33 @@
-
- - - - -
+ + + + + + + + + + + + + + + + {{selectValue}} + + + + {{item.label}} + + + +
@@ -327,13 +344,17 @@ export default { searchMetrics: [ { value: 'Metrics', - label: this.$t('project.metrics.metrics') + label: this.$t('project.metrics.metrics'), + icon: 'nz-icon nz-icon-Metrics' }, { value: 'Logs', - label: this.$t('overall.logs') + label: this.$t('overall.logs'), + icon: 'nz-icon nz-icon-logs' } ], + selectValue: '', + selectIcon: '', fromData: { status: '' }, @@ -373,89 +394,6 @@ export default { collapseValue: ['1', '2'], showTab: ['1', '2'], logData: [] - /*logData: [JSON.parse(`{ - "result": [{ - "labels": { - "asset": "44.53", - "endpoint": "192.168.44.53", - "filename": "/opt/cn/cn-web/logs/cn-web.log", - "job": "cn-log", - "project": "cn" - }, - "level": "debug", - "message": "2021-07-23 03:39:01.842 [quartzScheduler_QuartzSchedulerThread] DEBUG org.quartz.core.QuartzSchedulerThread - batch acquisition of 0 triggers", - "timestamp": 1627545412000000000, - "uuid": "1jqsjdjdf" - }, { - "labels": { - "asset": "44.53", - "endpoint": "192.168.44.53", - "filename": "/opt/cn/cn-web/logs/cn-web.log", - "job": "cn-log", - "project": "cn" - }, - "level": "debug", - "message": "2021-07-23 03:39:01.842 [quartzScheduler_QuartzSchedulerThread] DEBUG org.quartz.core.QuartzSchedulerThread - batch acquisition of 0 triggers", - "timestamp": 1627545412000000000, - "uuid": "1jqsjdjdf" - }, { - "labels": { - "asset": "44.53", - "endpoint": "192.168.44.53", - "filename": "/opt/cn/cn-web/logs/cn-web.log", - "job": "cn-log", - "project": "cn" - }, - "level": "debug", - "message": "2021-07-22 03:39:01.842 [quartzScheduler_QuartzSchedulerThread] DEBUG org.quartz.core.QuartzSchedulerThread - batch acquisition of 0 triggersDEBUG org.quartz.core.QuartzSchedulerThread - batch acquisition of 0 triggersDEBUG org.quartz.core.QuartzSchedulerThread - batch acquisition of 0 triggersDEBUG org.quartz.core.QuartzSchedulerThread - batch acquisition of 0 triggersDEBUG org.quartz.core.QuartzSchedulerThread - batch acquisition of 0 triggers", - "timestamp": 1627543512000000000, - "uuid": "1jqsjdjdg" - }, { - "labels": { - "asset": "44.53", - "endpoint": "192.168.44.53", - "filename": "/opt/cn/cn-web/logs/cn-web.log", - "job": "cn-log", - "project": "cn" - }, - "level": "debug", - "message": "2021-07-21 03:39:01.842 [quartzScheduler_QuartzSchedulerThread] DEBUG org.quartz.core.QuartzSchedulerThread - batch acquisition of 0 triggers", - "timestamp": 1627542512000000000, - "uuid": "1jqsjdjdh" - }, { - "labels": { - "asset": "44.53", - "endpoint": "192.168.44.53", - "filename": "/opt/cn/cn-web/logs/cn-web.log", - "job": "cn-log", - "project": "cn" - }, - "level": "debug", - "message": "2021-07-20 03:39:01.842 [quartzScheduler_QuartzSchedulerThread] DEBUG org.quartz.core.QuartzSchedulerThread - batch acquisition of 0 triggers", - "timestamp": 1627502512000000000, - "uuid": "1jqsjdjdi" - } - ], - "resultType": "streamsFormat", - "series": [ - { - "name": "debug", - "data": [[1588889221, 123], [1588889222, 10]] - }, { - "name": "info", - "data": [[1588889221, 123], [1588889222, 10]] - }, { - "name": "warn", - "data": [[1588889221, 123], [1588889222, 10]] - }, { - "name": "error", - "data": [[1588889221, 123], [1588889222, 10]] - }, { - "name": "unknown", - "data": [[1588889221, 123], [1588889222, 10]] - } - ] - }`)]*/ // 日志数据 } }, created () { @@ -463,8 +401,30 @@ export default { this.queryMetrics() this.promqlKeys.push(getUUID()) this.fromData.status = this.searchMetrics[0].label + this.selectMetricsLogs() }, methods: { + selectMetricsLogs (val, icon) { + if (this.selectValue === 'Metrics') { + this.selectValue = val + this.selectIcon = icon + this.showMetrics = val === 'Metrics' + this.showIntroduce = true + this.resetExpression() + } else if (this.selectValue === 'Logs') { + this.selectValue = val + this.selectIcon = icon + this.showMetrics = val === 'Metrics' + this.showIntroduce = true + this.resetExpression() + } else { + this.selectValue = 'Metrics' + this.selectIcon = 'nz-icon nz-icon-Metrics' + this.showMetrics = 'Metrics' + this.showIntroduce = true + this.resetExpression() + } + }, changeType (value) { this.showMetrics = value === 'Metrics' this.showIntroduce = true @@ -555,9 +515,9 @@ export default { res = res.filter((r, i) => errorRowIndex.indexOf(i) === -1) } if (res.length > 0) { - this.logData = res.map(r => r.data) - const hasGraph = this.logData.some(d => d.resultType === 'matrix') - const hasLog = this.logData.some(d => d.resultType === 'streamsFormat') + const logData = res.map(r => r.data) + const hasGraph = logData.some(d => d.resultType === 'matrix') + const hasLog = logData.some(d => d.resultType === 'streamsFormat') const graphTabIndex = this.showTab.indexOf('1') if (hasGraph) { if (graphTabIndex === -1) { @@ -571,7 +531,7 @@ export default { const logTabIndex = this.showTab.indexOf('2') if (hasLog) { if (logTabIndex === -1) { - this.showTab.push('1') + this.showTab.push('2') } } else { if (logTabIndex > -1) { @@ -580,6 +540,7 @@ export default { } this.$nextTick(() => { hasGraph && this.loadLogGraph() + this.logData = logData }) } }).catch(e => { @@ -1108,6 +1069,22 @@ export default {