mirror of
https://github.com/openziti/zrok.git
synced 2025-06-22 02:31:54 +02:00
tweaks; better 'VisualOverview' building (#799)
This commit is contained in:
parent
3df2924b72
commit
af5becb52e
@ -51,7 +51,7 @@ const Visualizer = ({ overview }: VisualizerProps) => {
|
|||||||
nodesDraggable={false}
|
nodesDraggable={false}
|
||||||
>
|
>
|
||||||
<Background/>
|
<Background/>
|
||||||
<Controls />
|
<Controls position="bottom-right" orientation="horizontal" />
|
||||||
</ReactFlow>
|
</ReactFlow>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -9,21 +9,24 @@ export class VisualOverview {
|
|||||||
const buildVisualizerGraph = (overview: Overview): VisualOverview => {
|
const buildVisualizerGraph = (overview: Overview): VisualOverview => {
|
||||||
let out = new VisualOverview();
|
let out = new VisualOverview();
|
||||||
out.nodes = [
|
out.nodes = [
|
||||||
{ id: "1", position: { x: 0, y: 0 }, data: { label: "michael@quigley.com" } }
|
{ id: "0", position: { x: 0, y: 0 }, data: { label: "michael@quigley.com" } }
|
||||||
];
|
];
|
||||||
out.edges = [];
|
out.edges = [];
|
||||||
|
|
||||||
overview.environments?.forEach((env, i) => {
|
overview.environments?.forEach((env, i) => {
|
||||||
|
if(env.environment && env.environment.zId) {
|
||||||
out.nodes.push({
|
out.nodes.push({
|
||||||
id: (i+2).toString(),
|
id: env.environment.zId,
|
||||||
position: { x: 0, y: 0 },
|
position: { x: 0, y: 0 },
|
||||||
data: { label: env.environment?.description! },
|
data: { label: env.environment?.description! },
|
||||||
});
|
});
|
||||||
out.edges.push({
|
out.edges.push({
|
||||||
id: "e" + (i+2) + "-1",
|
id: env.environment.zId + "-0",
|
||||||
source: "1",
|
source: "0",
|
||||||
target: (i+2).toString()
|
target: env.environment.zId
|
||||||
});
|
});
|
||||||
|
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
console.log(out);
|
console.log(out);
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
font-size: 0.6em;
|
font-size: 0.6em;
|
||||||
color: white;
|
color: white;
|
||||||
border: 1px solid #241775;
|
border: 1px solid #241775;
|
||||||
|
border-radius: 10px;
|
||||||
background-color: #241775;
|
background-color: #241775;
|
||||||
text-color: white;
|
text-color: white;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user