diff --git a/nezha-fronted/src/components/common/language/cn.js b/nezha-fronted/src/components/common/language/cn.js index 2d5ab4e0f..a078e9f7c 100644 --- a/nezha-fronted/src/components/common/language/cn.js +++ b/nezha-fronted/src/components/common/language/cn.js @@ -15,6 +15,7 @@ const cn = { week: '1 周', folder: '文件夹', key: '键名', + logs: '日志', state: '状态', projectName: '系统名称', startTime: '开始时间', diff --git a/nezha-fronted/src/components/common/language/en.js b/nezha-fronted/src/components/common/language/en.js index aedf07023..5ca80b4f8 100644 --- a/nezha-fronted/src/components/common/language/en.js +++ b/nezha-fronted/src/components/common/language/en.js @@ -21,6 +21,7 @@ const en = { week: '1 week', folder: 'Folder', key: 'Key', + logs: 'Logging', state: 'State', projectName: 'Project name', startTime: 'Start time', diff --git a/nezha-fronted/src/components/page/dashboard/explore/explore.vue b/nezha-fronted/src/components/page/dashboard/explore/explore.vue index 960f03256..e3fbb3497 100644 --- a/nezha-fronted/src/components/page/dashboard/explore/explore.vue +++ b/nezha-fronted/src/components/page/dashboard/explore/explore.vue @@ -4,7 +4,16 @@
-
+
+ + + + +
@@ -25,6 +34,7 @@ :ref="'promql-'+(index-1)" :expression-list="expressions" :index="index-1" + :select-data="searchMetrics.value" :plugins="['metric-selector', 'metric-input', 'add', 'remove', 'copy']" :styleType="1" @addExpression="addExpression" @@ -33,14 +43,49 @@ >
-
-
 graph
+
+
 graph
+
 Logs
+
+
+ + + + +
+
+
-
 table
@@ -83,7 +128,7 @@ :append-to-body="false">
-
+

Query examples

@@ -179,6 +224,61 @@ instance_cpu_time_ns{app="fox", proc="widget", rev="4d3a513", env="prod", job="c
+
+
+
+

Loki Cheat Sheet

+
+
+

See your logs

+ +
+
+

Combine Stream selectors

+ +
+
+

Filtering for search terms

+ +
+
+

Count over time

+ +
+
+

Rate

+ +
+
+

Aggregate,count,and group

+ +
+
+
+
@@ -202,14 +302,30 @@ export default { name: 'explore', components: { 'promql-input': promqlInput, - chart: chart, - 'chart-box': chartBox + 'chart-box': chartBox, + chart: chart }, data () { return { rightBox: { // 面板弹出框相关 show: false }, + value: true, + tabPosition: 'none', + searchMetrics: [ + { + value: 'Metrics', + label: this.$t('project.metrics.metrics') + }, + { + value: 'Logs', + label: this.$t('overall.logs') + } + ], + fromData: { + status: '' + }, + showSearch: true, promqlCount: 1, promqlKeys: [], expressions: [''], @@ -248,8 +364,16 @@ export default { this.getPanelData() this.queryMetrics() this.promqlKeys.push(getUUID()) + this.fromData.status = this.searchMetrics[0].label }, methods: { + screen (value) { + if (value === 'Metrics') { + this.showSearch = true + } else { + this.showSearch = false + } + }, pageNo (val) { this.pageObj.pageNo = val this.tableData = this.filterShowData(this.storedTableData, this.pageObj) @@ -734,6 +858,48 @@ export default { -ms-flex-positive: 1; flex-grow: 1; } + .introduce-view { + .title-heard.info-room { + color: #333333; + h1 { + font-family: Roboto-Medium; + font-size: 22px; + color: #333333; + font-weight: 500; + } + .title-heard__divider { + width: 100%; + height: 1px; + border-bottom: 2px solid #DEDEDE; + margin: 5px 0 28px 0; + } + .introduce-view__content { + line-height: 28px; + margin-top: 18px; + h2 { + font-family: Roboto-Black; + font-size: 22px; + margin-bottom: 5px; + color: #333333; + font-weight: 400; + } + .introduce-view__content-label { + p { + font-family: Roboto-Black; + font-size: 16px; + color: #333333; + font-weight: 400; + } + span { + font-family: Roboto-Black; + font-size: 14px; + color: #666666; + font-weight: 400; + } + } + } + } + } .info-room .cheat-sheet-item__title { font-size: 21px; @@ -911,7 +1077,18 @@ export default { article { margin: 10px 0 60px 0; } - + .explore { + .chart-view__switch { + margin-top: 20px; + border: 1px solid #E4E8EB; + border-radius: 2px; + height: 50px; + line-height: 50px; + .el-switch.is-checked { + margin-left: 35px; + } + } + } /*外部引用 样式end*/