mirror of
https://github.com/openziti/zrok.git
synced 2025-01-20 12:58:59 +01:00
iterating on visual overview differencing (#803)
This commit is contained in:
parent
348e86e71b
commit
d020851515
@ -1,6 +1,6 @@
|
||||
import {useEffect, useState} from "react";
|
||||
import {Configuration, MetadataApi} from "./api";
|
||||
import buildVisualizerGraph, {VisualOverview} from "./model/visualizer.ts";
|
||||
import {buildVisualOverview, VisualOverview, visualOverviewsEqual} from "./model/visualizer.ts";
|
||||
import {Box} from "@mui/material";
|
||||
import NavBar from "./NavBar.tsx";
|
||||
import {User} from "./model/user.ts";
|
||||
@ -36,7 +36,10 @@ const ApiConsole = ({ user, logout }: ApiConsoleProps) => {
|
||||
let api = new MetadataApi(cfg);
|
||||
api.overview()
|
||||
.then(d => {
|
||||
setOverview(buildVisualizerGraph(d));
|
||||
let vo = buildVisualOverview(d);
|
||||
if(!visualOverviewsEqual(vo, overview)) {
|
||||
setOverview(vo);
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
console.log(e);
|
||||
|
@ -6,7 +6,7 @@ export class VisualOverview {
|
||||
edges: Edge[];
|
||||
}
|
||||
|
||||
const buildVisualizerGraph = (overview: Overview): VisualOverview => {
|
||||
export const buildVisualOverview = (overview: Overview): VisualOverview => {
|
||||
let out = new VisualOverview();
|
||||
out.nodes = [
|
||||
{ id: "0", position: { x: 0, y: 0 }, data: { label: "michael@quigley.com" }, type: "account" }
|
||||
@ -90,4 +90,6 @@ const buildVisualizerGraph = (overview: Overview): VisualOverview => {
|
||||
return out;
|
||||
}
|
||||
|
||||
export default buildVisualizerGraph;
|
||||
export const visualOverviewsEqual = (a: VisualOverview, b: VisualOverview): boolean => {
|
||||
return false;
|
||||
}
|
Loading…
Reference in New Issue
Block a user