fix: data

This commit is contained in:
Fine 2024-04-12 12:41:53 +08:00
parent 9b268813f5
commit c2c6938368
2 changed files with 9 additions and 3 deletions

View File

@ -243,7 +243,10 @@ limitations under the License. -->
async function setLegend() { async function setLegend() {
updateSettings(); updateSettings();
const expression = dashboardStore.selectedGrid.legendMQE && dashboardStore.selectedGrid.legendMQE.expression; const expression = dashboardStore.selectedGrid.legendMQE && dashboardStore.selectedGrid.legendMQE.expression;
const { getExpressionQuery } = useQueryTopologyExpressionsProcessor([expression], topologyStore.nodes); const { getExpressionQuery } = useQueryTopologyExpressionsProcessor(
[expression],
topologyStore.nodes.filter((d: Node) => d.isReal),
);
const param = getExpressionQuery(); const param = getExpressionQuery();
const res = await topologyStore.getNodeExpressionValue(param); const res = await topologyStore.getNodeExpressionValue(param);
if (res.errors) { if (res.errors) {

View File

@ -314,7 +314,7 @@ limitations under the License. -->
topologyStore.nodeMetricValue[m].values.find((val: { id: string; value: unknown }) => val.id === data.id)) || topologyStore.nodeMetricValue[m].values.find((val: { id: string; value: unknown }) => val.id === data.id)) ||
{}; {};
const opt: MetricConfigOpt = nodeMetricConfig[index] || {}; const opt: MetricConfigOpt = nodeMetricConfig[index] || {};
return ` <div class="mb-5"><span class="grey">${opt.label || m}: </span>${metric.value} ${ return ` <div class="mb-5"><span class="grey">${opt.label || m}: </span>${metric.value || NaN} ${
opt.unit || "unknown" opt.unit || "unknown"
}</div>`; }</div>`;
}); });
@ -530,7 +530,10 @@ limitations under the License. -->
if (!currentNode.value) { if (!currentNode.value) {
return; return;
} }
const diffLayers = currentNode.value.layers.filter((l: string) => l !== dashboardStore.layerId); const diffLayers = currentNode.value.layers.filter(
(l: string) => l !== dashboardStore.layerId && l !== "UNDEFINED",
);
for (const l of diffLayers) { for (const l of diffLayers) {
items.value.push({ items.value.push({
id: l, id: l,