mirror of
https://github.com/openziti/zrok.git
synced 2025-02-04 04:19:45 +01:00
explorer (visualizer) updates to include overlaid icons; updated react-force-graph (#234)
This commit is contained in:
parent
2c1f5b3cd6
commit
2da4f58f81
53
ui/package-lock.json
generated
53
ui/package-lock.json
generated
@ -21,7 +21,7 @@
|
|||||||
"react-bootstrap": "^2.7.0",
|
"react-bootstrap": "^2.7.0",
|
||||||
"react-data-table-component": "^7.5.2",
|
"react-data-table-component": "^7.5.2",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"react-force-graph": "^1.41.20",
|
"react-force-graph": "^1.43.0",
|
||||||
"react-router-dom": "^6.4.0",
|
"react-router-dom": "^6.4.0",
|
||||||
"react-sizeme": "^3.0.2",
|
"react-sizeme": "^3.0.2",
|
||||||
"react-sparklines": "^1.7.0",
|
"react-sparklines": "^1.7.0",
|
||||||
@ -16162,16 +16162,19 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/react-force-graph": {
|
"node_modules/react-force-graph": {
|
||||||
"version": "1.41.20",
|
"version": "1.43.0",
|
||||||
"resolved": "https://registry.npmjs.org/react-force-graph/-/react-force-graph-1.41.20.tgz",
|
"resolved": "https://registry.npmjs.org/react-force-graph/-/react-force-graph-1.43.0.tgz",
|
||||||
"integrity": "sha512-PdhbYTdvciKJLv2tePTHY+fTzrLEhfcji6/lijPc9GVQfJOLofssAYz+HgcWCKCRj1CIT8M/J7FICXX3ALXpbw==",
|
"integrity": "sha512-g59ZWGrR6hkokY8RMO6FQHbltaIZ3+AGf9mrQs+s1+J26Sc2Wc6aro4cLW8PTHMIHgX/zml44yp60gRbzdFSMw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"3d-force-graph": "^1.70",
|
"3d-force-graph": "1",
|
||||||
"3d-force-graph-ar": "^1.7",
|
"3d-force-graph-ar": "1",
|
||||||
"3d-force-graph-vr": "^2.0",
|
"3d-force-graph-vr": "2",
|
||||||
"force-graph": "^1.42",
|
"force-graph": "1",
|
||||||
"prop-types": "^15.8",
|
"prop-types": "15",
|
||||||
"react-kapsule": "^2.2"
|
"react-kapsule": "2"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"react": "*"
|
"react": "*"
|
||||||
@ -18018,9 +18021,9 @@
|
|||||||
"integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw=="
|
"integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw=="
|
||||||
},
|
},
|
||||||
"node_modules/three": {
|
"node_modules/three": {
|
||||||
"version": "0.149.0",
|
"version": "0.152.2",
|
||||||
"resolved": "https://registry.npmjs.org/three/-/three-0.149.0.tgz",
|
"resolved": "https://registry.npmjs.org/three/-/three-0.152.2.tgz",
|
||||||
"integrity": "sha512-tohpUxPDht0qExRLDTM8sjRLc5d9STURNrdnK3w9A+V4pxaTBfKWWT/IqtiLfg23Vfc3Z+ImNfvRw1/0CtxrkQ=="
|
"integrity": "sha512-Ff9zIpSfkkqcBcpdiFo2f35vA9ZucO+N8TNacJOqaEE6DrB0eufItVMib8bK8Pcju/ZNT6a7blE1GhTpkdsILw=="
|
||||||
},
|
},
|
||||||
"node_modules/three-bmfont-text": {
|
"node_modules/three-bmfont-text": {
|
||||||
"version": "2.4.0",
|
"version": "2.4.0",
|
||||||
@ -31290,16 +31293,16 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"react-force-graph": {
|
"react-force-graph": {
|
||||||
"version": "1.41.20",
|
"version": "1.43.0",
|
||||||
"resolved": "https://registry.npmjs.org/react-force-graph/-/react-force-graph-1.41.20.tgz",
|
"resolved": "https://registry.npmjs.org/react-force-graph/-/react-force-graph-1.43.0.tgz",
|
||||||
"integrity": "sha512-PdhbYTdvciKJLv2tePTHY+fTzrLEhfcji6/lijPc9GVQfJOLofssAYz+HgcWCKCRj1CIT8M/J7FICXX3ALXpbw==",
|
"integrity": "sha512-g59ZWGrR6hkokY8RMO6FQHbltaIZ3+AGf9mrQs+s1+J26Sc2Wc6aro4cLW8PTHMIHgX/zml44yp60gRbzdFSMw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"3d-force-graph": "^1.70",
|
"3d-force-graph": "1",
|
||||||
"3d-force-graph-ar": "^1.7",
|
"3d-force-graph-ar": "1",
|
||||||
"3d-force-graph-vr": "^2.0",
|
"3d-force-graph-vr": "2",
|
||||||
"force-graph": "^1.42",
|
"force-graph": "1",
|
||||||
"prop-types": "^15.8",
|
"prop-types": "15",
|
||||||
"react-kapsule": "^2.2"
|
"react-kapsule": "2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"react-is": {
|
"react-is": {
|
||||||
@ -32658,9 +32661,9 @@
|
|||||||
"integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw=="
|
"integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw=="
|
||||||
},
|
},
|
||||||
"three": {
|
"three": {
|
||||||
"version": "0.149.0",
|
"version": "0.152.2",
|
||||||
"resolved": "https://registry.npmjs.org/three/-/three-0.149.0.tgz",
|
"resolved": "https://registry.npmjs.org/three/-/three-0.152.2.tgz",
|
||||||
"integrity": "sha512-tohpUxPDht0qExRLDTM8sjRLc5d9STURNrdnK3w9A+V4pxaTBfKWWT/IqtiLfg23Vfc3Z+ImNfvRw1/0CtxrkQ=="
|
"integrity": "sha512-Ff9zIpSfkkqcBcpdiFo2f35vA9ZucO+N8TNacJOqaEE6DrB0eufItVMib8bK8Pcju/ZNT6a7blE1GhTpkdsILw=="
|
||||||
},
|
},
|
||||||
"three-bmfont-text": {
|
"three-bmfont-text": {
|
||||||
"version": "git+ssh://git@github.com/dmarcos/three-bmfont-text.git#21d017046216e318362c48abd1a48bddfb6e0733",
|
"version": "git+ssh://git@github.com/dmarcos/three-bmfont-text.git#21d017046216e318362c48abd1a48bddfb6e0733",
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
"react-bootstrap": "^2.7.0",
|
"react-bootstrap": "^2.7.0",
|
||||||
"react-data-table-component": "^7.5.2",
|
"react-data-table-component": "^7.5.2",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"react-force-graph": "^1.41.20",
|
"react-force-graph": "^1.43.0",
|
||||||
"react-router-dom": "^6.4.0",
|
"react-router-dom": "^6.4.0",
|
||||||
"react-sizeme": "^3.0.2",
|
"react-sizeme": "^3.0.2",
|
||||||
"react-sparklines": "^1.7.0",
|
"react-sparklines": "^1.7.0",
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import {mdiCardAccountDetails} from "@mdi/js";
|
import {mdiAccountBox} from "@mdi/js";
|
||||||
import Icon from "@mdi/react";
|
import Icon from "@mdi/react";
|
||||||
import PropertyTable from "../../PropertyTable";
|
import PropertyTable from "../../PropertyTable";
|
||||||
import {Tab, Tabs} from "react-bootstrap";
|
import {Tab, Tabs} from "react-bootstrap";
|
||||||
@ -11,7 +11,7 @@ const AccountDetail = (props) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<h2><Icon path={mdiCardAccountDetails} size={2} />{" "}{props.user.email}</h2>
|
<h2><Icon path={mdiAccountBox} size={2} />{" "}{props.user.email}</h2>
|
||||||
<Tabs defaultActiveKey={"detail"}>
|
<Tabs defaultActiveKey={"detail"}>
|
||||||
<Tab eventKey={"detail"} title={"Detail"}>
|
<Tab eventKey={"detail"} title={"Detail"}>
|
||||||
<PropertyTable object={props.user} custom={customProperties}/>
|
<PropertyTable object={props.user} custom={customProperties}/>
|
||||||
|
@ -3,6 +3,11 @@ import {useEffect, useRef} from "react";
|
|||||||
import {ForceGraph2D} from "react-force-graph";
|
import {ForceGraph2D} from "react-force-graph";
|
||||||
import * as d3 from "d3-force-3d";
|
import * as d3 from "d3-force-3d";
|
||||||
import {roundRect} from "./draw";
|
import {roundRect} from "./draw";
|
||||||
|
import {mdiShareVariant, mdiConsoleNetwork, mdiAccountBox} from "@mdi/js";
|
||||||
|
|
||||||
|
const accountIcon = new Path2D(mdiAccountBox);
|
||||||
|
const environmentIcon = new Path2D(mdiConsoleNetwork);
|
||||||
|
const shareIcon = new Path2D(mdiShareVariant);
|
||||||
|
|
||||||
const Network = (props) => {
|
const Network = (props) => {
|
||||||
const targetRef = useRef();
|
const targetRef = useRef();
|
||||||
@ -29,6 +34,27 @@ const Network = (props) => {
|
|||||||
roundRect(ctx, node.x - (nodeWidth / 2), node.y - 7, nodeWidth, 14, 1.25);
|
roundRect(ctx, node.x - (nodeWidth / 2), node.y - 7, nodeWidth, 14, 1.25);
|
||||||
ctx.fill();
|
ctx.fill();
|
||||||
|
|
||||||
|
const nodeIcon = new Path2D();
|
||||||
|
let xform = new DOMMatrix();
|
||||||
|
xform.translateSelf(node.x - (nodeWidth / 2) - 6, node.y - 13);
|
||||||
|
xform.scaleSelf(0.5, 0.5);
|
||||||
|
switch(node.type) {
|
||||||
|
case "share":
|
||||||
|
nodeIcon.addPath(shareIcon, xform);
|
||||||
|
break;
|
||||||
|
case "environment":
|
||||||
|
nodeIcon.addPath(environmentIcon, xform);
|
||||||
|
break;
|
||||||
|
case "account":
|
||||||
|
nodeIcon.addPath(accountIcon, xform);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx.fill(nodeIcon);
|
||||||
|
ctx.strokeStyle = "black";
|
||||||
|
ctx.lineWidth = 0.5;
|
||||||
|
ctx.stroke(nodeIcon);
|
||||||
|
|
||||||
ctx.fillStyle = textColor;
|
ctx.fillStyle = textColor;
|
||||||
ctx.fillText(node.label, node.x, node.y);
|
ctx.fillText(node.label, node.x, node.y);
|
||||||
}
|
}
|
||||||
|
@ -55,6 +55,7 @@ export const mergeGraph = (oldGraph, user, newOverview) => {
|
|||||||
type: "share",
|
type: "share",
|
||||||
val: 50
|
val: 50
|
||||||
};
|
};
|
||||||
|
console.log('share', shrNode.label);
|
||||||
newGraph.nodes.push(shrNode);
|
newGraph.nodes.push(shrNode);
|
||||||
newGraph.links.push({
|
newGraph.links.push({
|
||||||
target: envNode.id,
|
target: envNode.id,
|
||||||
|
Loading…
Reference in New Issue
Block a user