From 457a105644e3bda479b597ccf9d9f2a7740d976b Mon Sep 17 00:00:00 2001 From: Qiuxia Fan Date: Tue, 22 Mar 2022 10:32:38 +0800 Subject: [PATCH] update config --- src/store/modules/topology.ts | 14 ++--- .../related/topology/components/Graph.vue | 2 +- .../topology/components/PodTopology.vue | 4 +- .../related/topology/components/Sankey.vue | 4 +- .../related/topology/components/Settings.vue | 51 +++++++++---------- 5 files changed, 35 insertions(+), 40 deletions(-) diff --git a/src/store/modules/topology.ts b/src/store/modules/topology.ts index 69ced307..acdc7503 100644 --- a/src/store/modules/topology.ts +++ b/src/store/modules/topology.ts @@ -34,7 +34,7 @@ interface TopologyState { call: Nullable; calls: Call[]; nodes: Node[]; - nodeMetrics: MetricVal; + nodeMetricValue: MetricVal; linkServerMetrics: MetricVal; linkClientMetrics: MetricVal; } @@ -46,7 +46,7 @@ export const topologyStore = defineStore({ nodes: [], node: null, call: null, - nodeMetrics: {}, + nodeMetricValue: {}, linkServerMetrics: {}, linkClientMetrics: {}, }), @@ -105,8 +105,8 @@ export const topologyStore = defineStore({ this.calls = calls; this.nodes = nodes; }, - setNodeMetrics(m: { id: string; value: unknown }[]) { - this.nodeMetrics = m; + setNodeMetricValue(m: { id: string; value: unknown }[]) { + this.nodeMetricValue = m; }, setLinkServerMetrics(m: { id: string; value: unknown }[]) { this.linkServerMetrics = m; @@ -390,7 +390,7 @@ export const topologyStore = defineStore({ return { calls, nodes }; }, - async getNodeMetrics(param: { + async getNodeMetricValue(param: { queryStr: string; conditions: { [key: string]: unknown }; }) { @@ -399,7 +399,7 @@ export const topologyStore = defineStore({ if (res.data.errors) { return res.data; } - this.setNodeMetrics(res.data.data); + this.setNodeMetricValue(res.data.data); return res.data; }, async getLinkClientMetrics(linkClientMetrics: string[]) { @@ -427,7 +427,7 @@ export const topologyStore = defineStore({ async queryNodeMetrics(nodeMetrics: string[]) { const ids = this.nodes.map((d: Node) => d.id); const param = await useQueryTopologyMetrics(nodeMetrics, ids); - const res = await this.getNodeMetrics(param); + const res = await this.getNodeMetricValue(param); if (res.errors) { ElMessage.error(res.errors); diff --git a/src/views/dashboard/related/topology/components/Graph.vue b/src/views/dashboard/related/topology/components/Graph.vue index 3d95ad55..5460c426 100644 --- a/src/views/dashboard/related/topology/components/Graph.vue +++ b/src/views/dashboard/related/topology/components/Graph.vue @@ -280,7 +280,7 @@ function update() { const nodeMetrics: string[] = settings.value.nodeMetrics || []; const html = nodeMetrics.map((m) => { const metric = - topologyStore.nodeMetrics[m].values.filter( + topologyStore.nodeMetricValue[m].values.filter( (val: { id: string; value: unknown }) => val.id === data.id )[0] || {}; const val = m.includes("_sla") ? metric.value / 100 : metric.value; diff --git a/src/views/dashboard/related/topology/components/PodTopology.vue b/src/views/dashboard/related/topology/components/PodTopology.vue index f61d621e..b3eb4839 100644 --- a/src/views/dashboard/related/topology/components/PodTopology.vue +++ b/src/views/dashboard/related/topology/components/PodTopology.vue @@ -272,10 +272,10 @@ watch( top: 60px; right: 10px; width: 400px; - height: 500px; + height: 600px; background-color: #2b3037; overflow: auto; - padding: 0 15px; + padding: 10px 15px; border-radius: 3px; color: #ccc; transition: all 0.5ms linear; diff --git a/src/views/dashboard/related/topology/components/Sankey.vue b/src/views/dashboard/related/topology/components/Sankey.vue index 4aa6a656..47b3ccab 100644 --- a/src/views/dashboard/related/topology/components/Sankey.vue +++ b/src/views/dashboard/related/topology/components/Sankey.vue @@ -105,10 +105,10 @@ function linkTooltip(data: Call) { } function nodeTooltip(data: Node) { - const nodeMetrics: string[] = Object.keys(topologyStore.nodeMetrics); + const nodeMetrics: string[] = Object.keys(topologyStore.nodeMetricValue); const html = nodeMetrics.map((m) => { const metric = - topologyStore.nodeMetrics[m].values.filter( + topologyStore.nodeMetricValue[m].values.filter( (val: { id: string; value: unknown }) => val.id === data.id )[0] || {}; const val = m.includes("_sla") ? metric.value / 100 : metric.value; diff --git a/src/views/dashboard/related/topology/components/Settings.vue b/src/views/dashboard/related/topology/components/Settings.vue index b3563131..f1d9e35f 100644 --- a/src/views/dashboard/related/topology/components/Settings.vue +++ b/src/views/dashboard/related/topology/components/Settings.vue @@ -176,11 +176,6 @@ limitations under the License. --> {{ t("setLegend") }} -
- - {{ t("apply") }} - -