diff --git a/nezha-fronted/src/components/charts/logs.vue b/nezha-fronted/src/components/charts/logs.vue index 36caf2202..70ff5f11d 100644 --- a/nezha-fronted/src/components/charts/logs.vue +++ b/nezha-fronted/src/components/charts/logs.vue @@ -68,7 +68,7 @@
- +
@@ -116,7 +116,7 @@
- +
@@ -144,6 +144,8 @@ import axios from 'axios' import chart from '@/components/page/dashboard/overview/chart' import logTab from '@/components/page/dashboard/explore/logTab' import bus from '@/libs/bus' +import logsTempData from '@/components/charts/logsTempData' +import { fromRoute } from '@/components/common/js/constants' export default { name: 'logs', components: { @@ -329,8 +331,10 @@ export default { if (this.expressions.length > 0) { const requestArr = [] this.expressions.forEach((item, index) => { - if (item != '') { + if (item != '' && this.from.trim() != fromRoute.chartTemp) { requestArr.push(this.$get('/logs/loki/api/v1/query_range?format=1&query=' + item + '&start=' + this.$stringTimeParseToUnix(this.startTime) + '&end=' + this.$stringTimeParseToUnix(this.endTime) + '&limit=' + limit)) + } else if (item != '' && this.from.trim() == fromRoute.chartTemp) { + requestArr.push(logsTempData[index % 2]) } }) if (requestArr.length > 0) { @@ -410,8 +414,10 @@ export default { if (this.expressions.length > 0) { const requestArr = [] this.expressions.forEach((item, index) => { - if (item != '') { + if (item != '' && this.from.trim() != fromRoute.chartTemp) { requestArr.push(this.$get('/logs/loki/api/v1/query_range?format=1&query=' + item + '&start=' + this.$stringTimeParseToUnix(this.searchTime[0]) + '&end=' + this.$stringTimeParseToUnix(this.searchTime[1]) + '&limit=' + limit)) + } else if (item != '' && this.from.trim() == fromRoute.chartTemp) { + requestArr.push(logsTempData[index % 2]) } }) if (requestArr.length > 0) { @@ -740,19 +746,19 @@ export default { position: absolute; top: 0; left: 10px; - display: none; + display: block; z-index: 10; } .show-tab-icon .nz-icon{ cursor: pointer; + padding: 0 5px; } .show-tab-icon .nz-icon.is-active-icon{ /*color: #FA901C;*/ color: #BDE3FD; } .logs-content:hover .show-tab-icon{ - display: block; - z-index: 10; + } /deep/ .chart-no-data{ width: calc(100% - 30px); diff --git a/nezha-fronted/src/components/charts/logsTempData.js b/nezha-fronted/src/components/charts/logsTempData.js new file mode 100644 index 000000000..33d327e5d --- /dev/null +++ b/nezha-fronted/src/components/charts/logsTempData.js @@ -0,0 +1,4 @@ +const logsTempData = [ + { data: { result: [{ metric: { a: 'a', asset: '40.42', b: 'b', datacenter: 'Temp', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, values: [[1630910642, '811'], [1630910656, '811'], [1630910670, '818'], [1630910684, '818'], [1630910698, '839'], [1630910712, '852'], [1630910726, '843'], [1630910740, '831'], [1630910754, '819'], [1630910768, '820'], [1630910782, '808'], [1630910796, '542'], [1630910810, '518'], [1630910824, '517'], [1630910838, '517'], [1630910852, '516'], [1630910866, '516'], [1630910880, '515'], [1630910894, '515'], [1630910908, '515'], [1630910922, '505'], [1630910936, '502'], [1630910950, '503'], [1630910964, '497'], [1630910978, '504'], [1630910992, '502'], [1630911006, '492'], [1630911020, '497'], [1630911034, '499'], [1630911048, '502'], [1630911062, '508'], [1630911076, '508'], [1630911090, '506'], [1630911104, '512'], [1630911118, '516'], [1630911132, '518'], [1630911146, '517'], [1630911160, '519'], [1630911174, '519'], [1630911188, '519'], [1630911202, '519'], [1630911216, '518'], [1630911230, '518'], [1630911244, '518'], [1630911258, '518'], [1630911272, '518'], [1630911286, '509'], [1630911300, '502'], [1630911314, '489'], [1630911328, '487'], [1630911342, '483'], [1630911356, '483'], [1630911370, '481'], [1630911384, '493'], [1630911398, '489'], [1630911412, '492'], [1630911426, '500'], [1630911440, '506'], [1630911454, '504'], [1630911468, '505'], [1630911482, '504'], [1630911496, '505'], [1630911510, '506'], [1630911524, '506'], [1630911538, '506'], [1630911552, '512'], [1630911566, '512'], [1630911580, '521'], [1630911594, '518'], [1630911608, '523'], [1630911622, '524'], [1630911636, '524'], [1630911650, '525'], [1630911664, '525'], [1630911678, '516'], [1630911692, '508'], [1630911706, '508'], [1630911720, '492'], [1630911734, '485'], [1630911748, '485'], [1630911762, '486'], [1630911776, '486'], [1630911790, '486'], [1630911804, '486'], [1630911818, '484'], [1630911832, '488'], [1630911846, '482'], [1630911860, '483'], [1630911874, '474'], [1630911888, '474'], [1630911902, '467'], [1630911916, '467'], [1630911930, '466'], [1630911944, '472'], [1630911958, '478'], [1630911972, '478'], [1630911986, '478'], [1630912000, '489'], [1630912014, '490'], [1630912028, '489'], [1630912042, '490'], [1630912056, '489'], [1630912070, '505'], [1630912084, '512'], [1630912098, '512'], [1630912112, '513'], [1630912126, '510'], [1630912140, '510'], [1630912154, '509'], [1630912168, '509'], [1630912182, '507'], [1630912196, '508'], [1630912210, '508'], [1630912224, '508'], [1630912238, '516'], [1630912252, '504'], [1630912266, '504'], [1630912280, '504'], [1630912294, '492'], [1630912308, '498'], [1630912322, '499'], [1630912336, '504'], [1630912350, '505'], [1630912364, '498'], [1630912378, '483'], [1630912392, '481'], [1630912406, '482'], [1630912420, '481'], [1630912434, '481'], [1630912448, '482'], [1630912462, '482'], [1630912476, '483'], [1630912490, '483'], [1630912504, '483'], [1630912518, '482'], [1630912532, '481'], [1630912546, '477'], [1630912560, '480'], [1630912574, '493'], [1630912588, '514'], [1630912602, '516'], [1630912616, '510'], [1630912630, '504'], [1630912644, '504'], [1630912658, '503'], [1630912672, '503'], [1630912686, '516'], [1630912700, '515'], [1630912714, '517'], [1630912728, '517'], [1630912742, '517'], [1630912756, '517'], [1630912770, '522'], [1630912784, '522'], [1630912798, '522'], [1630912812, '529'], [1630912826, '542'], [1630912840, '543'], [1630912854, '537'], [1630912868, '539'], [1630912882, '516'], [1630912896, '514'], [1630912910, '514'], [1630912924, '514'], [1630912938, '514'], [1630912952, '514'], [1630912966, '514'], [1630912980, '505'], [1630912994, '512'], [1630913008, '511'], [1630913022, '511'], [1630913036, '509'], [1630913050, '510'], [1630913064, '503'], [1630913078, '511'], [1630913092, '511'], [1630913106, '724'], [1630913120, '722'], [1630913134, '716'], [1630913148, '717'], [1630913162, '720'], [1630913176, '715'], [1630913190, '726'], [1630913204, '726'], [1630913218, '726'], [1630913232, '726'], [1630913246, '834'], [1630913260, '988'], [1630913274, '995'], [1630913288, '993'], [1630913302, '1147'], [1630913316, '1155'], [1630913330, '1164'], [1630913344, '1163'], [1630913358, '1166'], [1630913372, '1177'], [1630913386, '1179'], [1630913400, '1179'], [1630913414, '953'], [1630913428, '953'], [1630913442, '954'], [1630913456, '943'], [1630913470, '943'], [1630913484, '943'], [1630913498, '932'], [1630913512, '932'], [1630913526, '931'], [1630913540, '1046'], [1630913554, '897'], [1630913568, '880'], [1630913582, '872'], [1630913596, '870'], [1630913610, '920'], [1630913624, '911'], [1630913638, '1065'], [1630913652, '1068'], [1630913666, '1057'], [1630913680, '1048'], [1630913694, '1048'], [1630913708, '1047'], [1630913722, '1048'], [1630913736, '1047'], [1630913750, '1047'], [1630913764, '1047'], [1630913778, '1047'], [1630913792, '1050'], [1630913806, '1056'], [1630913820, '1056'], [1630913834, '853'], [1630913848, '850'], [1630913862, '848'], [1630913876, '857'], [1630913890, '1253'], [1630913904, '1209'], [1630913918, '1367'], [1630913932, '1206'], [1630913946, '1202'], [1630913960, '1209'], [1630913974, '1213'], [1630913988, '1217'], [1630914002, '1230'], [1630914016, '1237'], [1630914030, '1239'], [1630914044, '1238'], [1630914058, '1239'], [1630914072, '1238'], [1630914086, '1252'], [1630914100, '1256'], [1630914114, '1266'], [1630914128, '1266'], [1630914142, '1261'], [1630914156, '1262'], [1630914170, '1256'], [1630914184, '1253'], [1630914198, '696'], [1630914212, '689'], [1630914226, '534'], [1630914240, '535']] }], resultType: 'matrix', stats: { ingester: { compressedBytes: 0, decompressedBytes: 0, decompressedLines: 0, headChunkBytes: 0, headChunkLines: 0, totalBatches: 0, totalChunksMatched: 0, totalDuplicates: 0, totalLinesSent: 0, totalReached: 1 }, store: { chunksDownloadTime: 0, compressedBytes: 0, decompressedBytes: 0, decompressedLines: 0, headChunkBytes: 0, headChunkLines: 0, totalChunksDownloaded: 0, totalChunksRef: 0, totalDuplicates: 0 }, summary: { bytesProcessedPerSecond: 0, execTime: 0.038768948, linesProcessedPerSecond: 0, totalBytesProcessed: 0, totalLinesProcessed: 0 } } }, status: 'success' }, + { data: { result: [{ labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'Temp', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'info', message: '2021-09-06 07:51:26.906 [http-nio-8080-exec-7] INFO com.nis.common.aspect.ControllerExecTimeAspect - 方法:com.nis.modules.sys.controller.SysLicenseController.getLicenseState(),执行 0.0 秒,执行 2 毫秒', timestamp: '1630914687141252341', uuid: 'c1d610de4e8641ad' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'fatal', message: '2021-09-06 07:51:26.058 [Alert Message Notify Handler] WARN c.n.modules.alert.backend.AlertMessageNotifyThread - Message notify error,AlertRule is null ,messageId : null', timestamp: '1630914686140309993', uuid: '02f7711da17b8f4c' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'info', message: '2021-09-06 07:51:20.005 [quartzScheduler_Worker-6] INFO com.nis.modules.alert.backend.AlertRuleManagerJob - nz alert rule eval enable : 0', timestamp: '1630914680135527546', uuid: 'cfeae7c9698af8a0' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'info', message: '2021-09-06 07:51:20.003 [quartzScheduler_Worker-6] INFO com.nis.modules.alert.backend.AlertRuleManagerJob - update snmp trap rule success,size:1', timestamp: '1630914680135516245', uuid: '9464e94c39c3b2cf' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'info', message: '2021-09-06 07:51:10.004 [quartzScheduler_Worker-5] INFO com.nis.modules.alert.backend.AlertRuleManagerJob - nz alert rule eval enable : 0', timestamp: '1630914670128320735', uuid: '3c3b0e57c83690e5' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'info', message: '2021-09-06 07:51:10.004 [quartzScheduler_Worker-5] INFO com.nis.modules.alert.backend.AlertRuleManagerJob - update snmp trap rule success,size:1', timestamp: '1630914670128312608', uuid: '1acc37e93767941d' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'info', message: '2021-09-06 07:51:07.284 [http-nio-8080-exec-12] INFO com.nis.common.aspect.ControllerExecTimeAspect - 方法:com.nis.modules.panel.controller.ExpreTmplController.queryTmplsByGname(),执行 0.0 秒,执行 1 毫秒', timestamp: '1630914667376718771', uuid: 'd0652a0c6a723a67' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'info', message: '2021-09-06 07:51:07.263 [http-nio-8080-exec-23] INFO com.nis.common.aspect.ControllerExecTimeAspect - 方法:com.nis.modules.promserver.controller.PromProxyController.promProxy(),执行 0.0 秒,执行 5 毫秒', timestamp: '1630914667376706551', uuid: '8c1b19c648b81638' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'info', message: '2021-09-06 07:51:07.261 [http-nio-8080-exec-28] INFO com.nis.common.aspect.ControllerExecTimeAspect - 方法:com.nis.modules.promserver.controller.LokiProxyController.logLokiProxy(),执行 0.0 秒,执行 3 毫秒', timestamp: '1630914667376698830', uuid: '848132e62fa4d8a5' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'info', message: '2021-09-06 07:51:06.758 [quartzScheduler_Worker-2] INFO com.nis.modules.asset.job.AssetTalonStatusJob - asset talon state Run Time: 0:00:06.755', timestamp: '1630914666876597145', uuid: 'ec2ebbef8208b189' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'unknown', message: '\t... 8 common frames omitted', timestamp: '1630914665125804175', uuid: 'e95453b79ef10771' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'unknown', message: '\tat cn.hutool.http.HttpRequest.send(HttpRequest.java:1148)', timestamp: '1630914665125798610', uuid: 'e916117f0eb5bef1' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'unknown', message: '\tat cn.hutool.http.HttpConnection.connect(HttpConnection.java:377)', timestamp: '1630914665125796033', uuid: '36221151498f065c' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'unknown', message: '\tat sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:990)', timestamp: '1630914665125724445', uuid: 'aa2d9b0158f3d862' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'unknown', message: '\tat sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1056)', timestamp: '1630914665125715064', uuid: '58a1940880d3d358' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'unknown', message: '\tat sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1162)', timestamp: '1630914665125711771', uuid: '252d0c43b1ec4fcb' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'unknown', message: '\tat sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1226)', timestamp: '1630914665125692856', uuid: 'dce24f838893daa3' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'unknown', message: '\tat sun.net.www.http.HttpClient.New(HttpClient.java:357)', timestamp: '1630914665125667343', uuid: '63daee34a506856a' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'unknown', message: '\tat sun.net.www.http.HttpClient.New(HttpClient.java:339)', timestamp: '1630914665125660104', uuid: '9cf34708188f302d' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'unknown', message: '\tat sun.net.www.http.HttpClient.(HttpClient.java:242)', timestamp: '1630914665125653679', uuid: 'fb3a0475db46ce6f' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'unknown', message: '\tat sun.net.www.http.HttpClient.openServer(HttpClient.java:558)', timestamp: '1630914665125647714', uuid: 'c79468bdecb3d7ff' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'unknown', message: '\tat sun.net.www.http.HttpClient.openServer(HttpClient.java:463)', timestamp: '1630914665125644512', uuid: '11728a8823ae1558' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'unknown', message: '\tat sun.net.NetworkClient.doConnect(NetworkClient.java:175)', timestamp: '1630914665125538995', uuid: 'a0a154463c8c7454' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'unknown', message: '\tat java.net.Socket.connect(Socket.java:607)', timestamp: '1630914665125521215', uuid: '789fa8fb19160796' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'unknown', message: '\tat java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)', timestamp: '1630914665125510928', uuid: '92a99f8b2a6ee80c' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'unknown', message: '\tat java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)', timestamp: '1630914665125498524', uuid: 'fc40c20624a89b9c' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'unknown', message: '\tat java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)', timestamp: '1630914665125488903', uuid: 'b327acb15e772d4e' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'unknown', message: '\tat java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)', timestamp: '1630914665125468531', uuid: 'a23a0283df63e7ce' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'unknown', message: '\tat java.net.PlainSocketImpl.socketConnect(Native Method)', timestamp: '1630914665125454430', uuid: '8e23c0700ec5194a' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'unknown', message: 'Caused by: java.net.SocketTimeoutException: connect timed out', timestamp: '1630914665125444835', uuid: '3ec06b844d6ff19c' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'unknown', message: '\tat java.lang.Thread.run(Thread.java:748)', timestamp: '1630914665125440492', uuid: '6d2ced1a7d14da58' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'unknown', message: '\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)', timestamp: '1630914665125381837', uuid: '9fdcbc49129ca417' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'unknown', message: '\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)', timestamp: '1630914665125379108', uuid: '22fad35a54d7f23d' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'unknown', message: '\tat java.util.concurrent.FutureTask.run(FutureTask.java:266)', timestamp: '1630914665125357438', uuid: 'f24a297fc6c7766d' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'unknown', message: '\tat com.nis.modules.asset.job.AssetTalonStatusJob$1.call(AssetTalonStatusJob.java:97)', timestamp: '1630914665125354601', uuid: '78df210218d11d02' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'unknown', message: '\tat com.nis.modules.asset.job.AssetTalonStatusJob$1.call(AssetTalonStatusJob.java:103)', timestamp: '1630914665125321495', uuid: '09628ecf55e48bfc' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'unknown', message: '\tat cn.hutool.http.HttpRequest.execute(HttpRequest.java:940)', timestamp: '1630914665125309985', uuid: '3d4fe7cb7ce501e1' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'unknown', message: '\tat cn.hutool.http.HttpRequest.execute(HttpRequest.java:969)', timestamp: '1630914665125301828', uuid: '70d405e2891eccc6' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'unknown', message: '\tat cn.hutool.http.HttpRequest.send(HttpRequest.java:1153)', timestamp: '1630914665125292965', uuid: '710d15a186a429a1' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'unknown', message: 'cn.hutool.core.io.IORuntimeException: SocketTimeoutException: connect timed out', timestamp: '1630914665125286327', uuid: '4dbe5ba1ca72e0a6' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'error', message: '2021-09-06 07:51:05.011 [pool-5-thread-15] ERROR com.nis.modules.asset.job.AssetTalonStatusJob - 请求 http://192.168.169.170:10092/nz-talon/healthy 接口失败', timestamp: '1630914665125279537', uuid: '4aec706b11ef5eec' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'unknown', message: '\t... 8 common frames omitted', timestamp: '1630914665125274899', uuid: '71c901dbd2809073' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'unknown', message: '\tat cn.hutool.http.HttpRequest.send(HttpRequest.java:1148)', timestamp: '1630914665125228589', uuid: '1f2af2da1bb752fc' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'unknown', message: '\tat cn.hutool.http.HttpConnection.connect(HttpConnection.java:377)', timestamp: '1630914665125222217', uuid: 'a9e2bd2988deef77' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'unknown', message: '\tat sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:990)', timestamp: '1630914665125212961', uuid: 'b8219b6f83e2f15e' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'unknown', message: '\tat sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1056)', timestamp: '1630914665125208660', uuid: 'bc3e191c8118a235' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'unknown', message: '\tat sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1162)', timestamp: '1630914665125139313', uuid: 'd3cc00c5d38c6d81' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'unknown', message: '\tat sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1226)', timestamp: '1630914665125136671', uuid: 'bf6c0fa82211aed7' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'unknown', message: '\tat sun.net.www.http.HttpClient.New(HttpClient.java:357)', timestamp: '1630914665125112119', uuid: '1a1dcdaf9fc8551f' }, { labels: { a: 'a', asset: '40.42', b: 'b', datacenter: 'JBXXG', endpoint: 'agentLog-40.42', filename: '/opt/nezha/nz-web/logs/nz-web.log', module: 'agentLog', project: 'Nezha' }, level: 'unknown', message: '\tat sun.net.www.http.HttpClient.New(HttpClient.java:339)', timestamp: '1630914665125109129', uuid: 'effbf4a88e861acc' }], resultType: 'streamsFormat', series: [{ data: [[1630914687125109129, 0], [1630914686125109129, 0], [1630914685125109129, 0], [1630914684125109129, 0], [1630914683125109129, 0], [1630914682125109129, 0], [1630914681125109129, 0], [1630914680125109129, 0], [1630914679125109129, 0], [1630914678125109129, 0], [1630914677125109129, 0], [1630914676125109129, 0], [1630914675125109129, 0], [1630914674125109129, 0], [1630914673125109129, 0], [1630914672125109129, 0], [1630914671125109129, 0], [1630914670125109129, 0], [1630914669125109129, 0], [1630914668125109129, 0], [1630914667125109129, 0], [1630914666125109129, 0], [1630914665125109129, 1]], name: 'error' }, { data: [[1630914687125109129, 0], [1630914686125109129, 0], [1630914685125109129, 0], [1630914684125109129, 0], [1630914683125109129, 0], [1630914682125109129, 0], [1630914681125109129, 0], [1630914680125109129, 0], [1630914679125109129, 0], [1630914678125109129, 0], [1630914677125109129, 0], [1630914676125109129, 0], [1630914675125109129, 0], [1630914674125109129, 0], [1630914673125109129, 0], [1630914672125109129, 0], [1630914671125109129, 0], [1630914670125109129, 0], [1630914669125109129, 0], [1630914668125109129, 0], [1630914667125109129, 0], [1630914666125109129, 0], [1630914665125109129, 39]], name: 'unknown' }, { data: [[1630914687125109129, 0], [1630914686125109129, 1], [1630914685125109129, 0], [1630914684125109129, 0], [1630914683125109129, 0], [1630914682125109129, 0], [1630914681125109129, 0], [1630914680125109129, 0], [1630914679125109129, 0], [1630914678125109129, 0], [1630914677125109129, 0], [1630914676125109129, 0], [1630914675125109129, 0], [1630914674125109129, 0], [1630914673125109129, 0], [1630914672125109129, 0], [1630914671125109129, 0], [1630914670125109129, 0], [1630914669125109129, 0], [1630914668125109129, 0], [1630914667125109129, 0], [1630914666125109129, 0], [1630914665125109129, 0]], name: 'fatal' }, { data: [[1630914687125109129, 1], [1630914686125109129, 0], [1630914685125109129, 0], [1630914684125109129, 0], [1630914683125109129, 0], [1630914682125109129, 0], [1630914681125109129, 0], [1630914680125109129, 2], [1630914679125109129, 0], [1630914678125109129, 0], [1630914677125109129, 0], [1630914676125109129, 0], [1630914675125109129, 0], [1630914674125109129, 0], [1630914673125109129, 0], [1630914672125109129, 0], [1630914671125109129, 0], [1630914670125109129, 2], [1630914669125109129, 0], [1630914668125109129, 0], [1630914667125109129, 3], [1630914666125109129, 1], [1630914665125109129, 0]], name: 'info' }], stats: { ingester: { compressedBytes: 247208, decompressedBytes: 80310, decompressedLines: 578, headChunkBytes: 7723, headChunkLines: 464, totalBatches: 1, totalChunksMatched: 2, totalDuplicates: 0, totalLinesSent: 50, totalReached: 1 }, store: { chunksDownloadTime: 0, compressedBytes: 0, decompressedBytes: 0, decompressedLines: 0, headChunkBytes: 0, headChunkLines: 0, totalChunksDownloaded: 0, totalChunksRef: 0, totalDuplicates: 0 }, summary: { bytesProcessedPerSecond: 3308716, execTime: 0.026606391, linesProcessedPerSecond: 39163, totalBytesProcessed: 88033, totalLinesProcessed: 1042 } } }, status: 'success' }] +export default logsTempData diff --git a/nezha-fronted/src/components/common/js/constants.js b/nezha-fronted/src/components/common/js/constants.js index 8bdca6e8e..f3c1071cf 100644 --- a/nezha-fronted/src/components/common/js/constants.js +++ b/nezha-fronted/src/components/common/js/constants.js @@ -266,6 +266,10 @@ export const chart = { value: 'group', label: i18n.t('dashboard.panel.chartForm.typeVal.group.label') }, + { + value: 'logs', + label: i18n.t('dashboard.panel.chartForm.typeVal.logs.label') + }, { value: 'diagram', label: i18n.t('dashboard.panel.chartForm.typeVal.diagram.label') diff --git a/nezha-fronted/src/components/common/table/settings/chartTmplTable.vue b/nezha-fronted/src/components/common/table/settings/chartTmplTable.vue index f29288a3d..7218cbeb8 100644 --- a/nezha-fronted/src/components/common/table/settings/chartTmplTable.vue +++ b/nezha-fronted/src/components/common/table/settings/chartTmplTable.vue @@ -144,6 +144,9 @@ export default { case 'group': str += 'nz-icon-group' break + case 'logs': + str += 'nz-icon-logs' + break default : str += 'nz-icon-table1' break diff --git a/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue b/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue index 01724d338..29d90dfdf 100644 --- a/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue +++ b/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue @@ -20,7 +20,7 @@ {{item.label}} + :key="item.value">{{item.label}} diff --git a/nezha-fronted/src/components/page/dashboard/explore/logTab.vue b/nezha-fronted/src/components/page/dashboard/explore/logTab.vue index 346e31794..b34e62f70 100644 --- a/nezha-fronted/src/components/page/dashboard/explore/logTab.vue +++ b/nezha-fronted/src/components/page/dashboard/explore/logTab.vue @@ -501,7 +501,9 @@ export default { }, beforeUpdate () { this.$nextTick(() => { - this.$refs.logTable.doLayout() + if (this.$refs.logTable) { + this.$refs.logTable.doLayout() + } }) } }