diff --git a/web/src/components/PGTopo.vue b/web/src/components/PGTopo.vue index eed932ae14128dc97f6e0cf5965edfa0a049d3d9..69505042251ac2a688d24f6067e67919c66b8ce9 100644 --- a/web/src/components/PGTopo.vue +++ b/web/src/components/PGTopo.vue @@ -57,7 +57,6 @@ onMounted(() => { topoH.value = topo_container.clientHeight; document.getElementById('topo-container')!.addEventListener('click', function (_event: any) { // 点击画布时,关闭日志弹窗和tab页面 - console.log(_event) emit('clickTopoCanvas', _event) }); }) diff --git a/web/src/stores/charts.ts b/web/src/stores/charts.ts index ba3e0df31e61a025dddd3bdbe3ebbfce9a590e61..0860b7a9cf1768d34cb23794de012f095a419629 100644 --- a/web/src/stores/charts.ts +++ b/web/src/stores/charts.ts @@ -33,7 +33,7 @@ export const useLayoutStore = defineStore('layoutOption', { } }, - { + /* { x: 6, y: 0, w: 2, h: 1, i: '3', static: true, display: true, title: '当前打开的文件描述符', query: { @@ -42,7 +42,7 @@ export const useLayoutStore = defineStore('layoutOption', { target: 'num_series', unit: 'K', float: 2, min: 0, max: 9, color: [] } - }, + }, */ { x: 0, y: 1, w: 2, h: 2, i: '4', static: true, display: true, title: 'CPU总使用率', @@ -85,7 +85,7 @@ export const useLayoutStore = defineStore('layoutOption', { }] } }, - { + /* { x: 6, y: 1, w: 2, h: 2, i: '7', static: true, display: true, title: '根分区使用率', query: { @@ -98,7 +98,7 @@ export const useLayoutStore = defineStore('layoutOption', { offset: 1, color: '#1de3cf' }] } - }, + }, */ { x: 0, y: 3, w: 8, h: 3, i: '8', static: false, display: true, title: '系统平均负载', @@ -128,7 +128,7 @@ export const useLayoutStore = defineStore('layoutOption', { } }, { - x: 0, y: 3, w: 4, h: 3, i: '9', + x: 0, y: 3, w: 8, h: 3, i: '9', static: false, display: true, title: '内存信息', query: { type: 'line', range: true, isChart: true, @@ -160,7 +160,7 @@ export const useLayoutStore = defineStore('layoutOption', { } }, { - x: 4, y: 6, w: 4, h: 3, i: '10', + x: 0, y: 6, w: 8, h: 3, i: '10', static: false, display: true, title: 'cpu使用率', query: { type: 'line', range: true, isChart: true, @@ -205,7 +205,7 @@ export const useLayoutStore = defineStore('layoutOption', { } }, { - x: 0, y: 9, w: 4, h: 3, i: '11', + x: 0, y: 9, w: 8, h: 3, i: '11', static: false, display: true, title: '磁盘总空间', query: { type: 'table', range: false, isChart: false, interval: 5, @@ -226,7 +226,7 @@ export const useLayoutStore = defineStore('layoutOption', { } }, { - x: 4, y: 9, w: 4, h: 3, i: '12', + x: 0, y: 9, w: 8, h: 3, i: '12', static: false, display: true, title: '各分区可用空间', query: { type: 'table', range: false, isChart: false, interval: 5, @@ -256,7 +256,7 @@ export const useLayoutStore = defineStore('layoutOption', { } }, { - x: 0, y: 12, w: 4, h: 3, i: '13', + x: 0, y: 12, w: 8, h: 3, i: '13', static: false, display: true, title: '磁盘读取容量', query: { type: 'line', range: true, isChart: true, @@ -275,7 +275,7 @@ export const useLayoutStore = defineStore('layoutOption', { } }, { - x: 4, y: 12, w: 4, h: 3, i: '14', + x: 0, y: 12, w: 8, h: 3, i: '14', static: false, display: true, title: '磁盘写入容量', query: { type: 'line', range: true, isChart: true, diff --git a/web/src/stores/config.ts b/web/src/stores/config.ts index 6598eecbaea313b7a8ae2b08a0e305273cfb91aa..8f036967deb3c8913bab7e9d401d6a1952c55fdd 100644 --- a/web/src/stores/config.ts +++ b/web/src/stores/config.ts @@ -1,7 +1,8 @@ import { ref, computed, reactive } from 'vue' import { defineStore } from 'pinia' interface TopoRequest { - type: string; + type: string; + batch_id: number; id: string | number; } export const useConfigStore = defineStore('config', { @@ -9,6 +10,7 @@ export const useConfigStore = defineStore('config', { topo_config: {} as any, topo_request:{ type: '', + batch_id: 0, id:'' } as TopoRequest }), diff --git a/web/src/types/index.ts b/web/src/types/index.ts index 0e33292c342c28f442ff3a244dad592e5976ba93..590cce85292018e73e39fcf1a1d6f614430f25ce 100644 --- a/web/src/types/index.ts +++ b/web/src/types/index.ts @@ -63,6 +63,7 @@ type GraphData = { } export interface Config { + batchId: number; id: number; conf_name: string; create_time: string; diff --git a/web/src/views/nodeDetail.vue b/web/src/views/nodeDetail.vue index 45cd7329fd290bdc16a289251e7d46a31896c42d..2a2b1c307091fbd9da537b1a8e99d02b59cd9b5a 100644 --- a/web/src/views/nodeDetail.vue +++ b/web/src/views/nodeDetail.vue @@ -1,7 +1,7 @@ - @@ -29,8 +29,8 @@ start-placeholder="开始日期" end-placeholder="结束日期" @change="changeDate"> - + {{ item.title }} - + @@ -64,7 +64,7 @@ diff --git a/web/src/views/topoLogs/index.vue b/web/src/views/topoLogs/index.vue index 5dad472555087fe7f00abdd67a6deb38d9521b15..95c7aad3d43f5b5339d774448cef95cf78d50750 100644 --- a/web/src/views/topoLogs/index.vue +++ b/web/src/views/topoLogs/index.vue @@ -62,6 +62,7 @@ import type { logData } from '@/types/index'; import { getELKLogData, getELKProcessLogData, getELKProcessLogStream } from '@/request/elk'; import { calculate_interval } from './utils'; import { ElMessage } from 'element-plus'; +import { useConfigStore } from '@/stores/config'; // import result, { host_result, log_query } from './test'; const activeName = ref('log'); @@ -111,6 +112,7 @@ const ChangeEventTimeRange = (value: any) => { const handleParams = (_params?: any) => { let log_query = { id: 'log_clusterhost_timeaxis', + batchId: useConfigStore().topo_request.batch_id, params: { queryfield_datastream_dataset: "system.syslog", queryfield_range_gte: 1719226716185, @@ -152,7 +154,6 @@ const getLogData = (_params?: any) => { case 'log': if (_params || clickChange.value === 'first') { // 第一次点击,请求进程信息 - console.log('请求进程图表') getELKProcessLogData(handleParams(_params)).then(res => { if (res.data.code === 200) { if (res.data.data.length > 0) {