fix: node metrics

This commit is contained in:
Fine 2024-04-12 12:11:58 +08:00
parent 03f321b62a
commit 9b268813f5
2 changed files with 12 additions and 9 deletions

View File

@ -485,7 +485,7 @@ export const topologyStore = defineStore({
} }
const { getExpressionQuery, handleExpressionValues } = useQueryTopologyExpressionsProcessor( const { getExpressionQuery, handleExpressionValues } = useQueryTopologyExpressionsProcessor(
expressions, expressions,
this.nodes, this.nodes.filter((d: Node) => d.isReal),
); );
const param = getExpressionQuery(); const param = getExpressionQuery();
const res = await this.getNodeExpressionValue(param); const res = await this.getNodeExpressionValue(param);

View File

@ -318,13 +318,12 @@ limitations under the License. -->
opt.unit || "unknown" opt.unit || "unknown"
}</div>`; }</div>`;
}); });
const tipHtml = [ let tipHtml = `<div class="mb-5"><span class="grey">name: </span>${
`<div class="mb-5"><span class="grey">name: </span>${
data.name data.name
}</div><div class="mb-5"><span class="grey">type: </span>${data.type || "UNKNOWN"}</div>`, }</div><div class="mb-5"><span class="grey">type: </span>${data.type || "UNKNOWN"}</div>`;
...html, if (data.isReal) {
].join(" "); tipHtml = [tipHtml, ...html].join(" ");
}
tooltip.value tooltip.value
.style("top", event.offsetY + 10 + "px") .style("top", event.offsetY + 10 + "px")
.style("left", event.offsetX + 10 + "px") .style("left", event.offsetX + 10 + "px")
@ -520,7 +519,11 @@ limitations under the License. -->
} }
function initNodeMenus() { function initNodeMenus() {
items.value = [ items.value = [
{ id: "hierarchyServices", title: "Hierarchy Services", func: handleHierarchyRelatedServices }, {
id: "hierarchyServices",
title: "Hierarchy Services",
func: handleHierarchyRelatedServices,
},
{ id: "inspect", title: "Inspect", func: handleInspect }, { id: "inspect", title: "Inspect", func: handleInspect },
{ id: "alerting", title: "Alerting", func: handleGoAlerting }, { id: "alerting", title: "Alerting", func: handleGoAlerting },
]; ];