mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-12 07:36:14 +00:00
feat: remove node layer
This commit is contained in:
parent
3c282d021b
commit
3e1a0a7413
@ -87,12 +87,9 @@ export const topologyStore = defineStore({
|
||||
},
|
||||
setTopology(data: { nodes: Node[]; calls: Call[] }) {
|
||||
const obj = {} as Recordable;
|
||||
const services = useSelectorStore().services;
|
||||
const nodes = (data.nodes || []).reduce((prev: Node[], next: Node) => {
|
||||
if (!obj[next.id]) {
|
||||
obj[next.id] = true;
|
||||
const s = services.filter((d: any) => d.id === next.id)[0] || {};
|
||||
next.layer = s.layers ? s.layers[0] : null;
|
||||
prev.push(next);
|
||||
}
|
||||
return prev;
|
||||
@ -658,7 +655,7 @@ export const topologyStore = defineStore({
|
||||
return metrics;
|
||||
},
|
||||
async queryHierarchyNodeExpressions(expressions: string[], layer: string) {
|
||||
const nodes = this.hierarchyServiceNodes.filter((n: Node) => n.layer === layer);
|
||||
const nodes = this.hierarchyServiceNodes.filter((n: HierarchyNode) => n.layer === layer);
|
||||
if (!nodes.length) {
|
||||
this.setHierarchyNodeMetricValue({}, layer);
|
||||
return;
|
||||
@ -671,7 +668,7 @@ export const topologyStore = defineStore({
|
||||
this.setHierarchyNodeMetricValue(metrics, layer);
|
||||
},
|
||||
async queryHierarchyInstanceNodeExpressions(expressions: string[], layer: string) {
|
||||
const nodes = this.hierarchyInstanceNodes.filter((n: Node) => n.layer === layer);
|
||||
const nodes = this.hierarchyInstanceNodes.filter((n: HierarchyNode) => n.layer === layer);
|
||||
|
||||
if (!expressions.length) {
|
||||
this.setHierarchyInstanceNodeMetricValue({}, layer);
|
||||
|
1
src/types/topology.d.ts
vendored
1
src/types/topology.d.ts
vendored
@ -43,7 +43,6 @@ export interface Node {
|
||||
name: string;
|
||||
type: string;
|
||||
isReal: boolean;
|
||||
layer?: string;
|
||||
layers: string[];
|
||||
serviceName?: string;
|
||||
height?: number;
|
||||
|
@ -411,7 +411,7 @@ limitations under the License. -->
|
||||
topologyStore.setLink(null);
|
||||
operationsPos.x = event.offsetX;
|
||||
operationsPos.y = event.offsetY;
|
||||
if (d.layer === String(dashboardStore.layerId)) {
|
||||
if (d.layers.includes(dashboardStore.layerId)) {
|
||||
setNodeTools(settings.value.nodeDashboard);
|
||||
return;
|
||||
}
|
||||
@ -419,7 +419,7 @@ limitations under the License. -->
|
||||
}
|
||||
function handleLinkClick(event: MouseEvent, d: Call) {
|
||||
event.stopPropagation();
|
||||
if (d.sourceObj.layer !== dashboardStore.layerId || d.targetObj.layer !== dashboardStore.layerId) {
|
||||
if (!d.sourceObj.layers.includes(dashboardStore.layerId) || !d.targetObj.layers.includes(dashboardStore.layerId)) {
|
||||
return;
|
||||
}
|
||||
topologyStore.setNode(null);
|
||||
|
Loading…
Reference in New Issue
Block a user