mirror of https://github.com/EdgeVPNio/portal.git
TypeError fix on get connectedlinkdetails, added Shared.js
parent
0b4f8925f8
commit
555ffdf1a4
|
@ -4,9 +4,8 @@ import { setSelectedView } from "../features/view/viewSlice";
|
||||||
import {
|
import {
|
||||||
setSelectedOverlayId,
|
setSelectedOverlayId,
|
||||||
setRedrawGraph,
|
setRedrawGraph,
|
||||||
elementTypes,
|
|
||||||
} from "../features/evio/evioSlice";
|
} from "../features/evio/evioSlice";
|
||||||
|
import {elementTypes} from "./Shared";
|
||||||
class Breadcrumb extends React.Component {
|
class Breadcrumb extends React.Component {
|
||||||
componentDidMount() {}
|
componentDidMount() {}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { SiGraphql } from "react-icons/si";
|
||||||
import { BiNetworkChart } from "react-icons/bi";
|
import { BiNetworkChart } from "react-icons/bi";
|
||||||
import { GrMapLocation } from "react-icons/gr";
|
import { GrMapLocation } from "react-icons/gr";
|
||||||
import { setSelectedView } from "../features/view/viewSlice";
|
import { setSelectedView } from "../features/view/viewSlice";
|
||||||
import { appViews } from "../features/evio/evioSlice";
|
import { appViews } from "./Shared";
|
||||||
|
|
||||||
class Navbar extends React.Component {
|
class Navbar extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
|
|
|
@ -12,8 +12,8 @@ import { connect } from "react-redux";
|
||||||
import {
|
import {
|
||||||
setSelectedOverlayId,
|
setSelectedOverlayId,
|
||||||
clearSelectedElement,
|
clearSelectedElement,
|
||||||
appViews,
|
|
||||||
} from "../features/evio/evioSlice";
|
} from "../features/evio/evioSlice";
|
||||||
|
import {appViews} from "./Shared";
|
||||||
import { setCurrentView } from "../features/view/viewSlice";
|
import { setCurrentView } from "../features/view/viewSlice";
|
||||||
|
|
||||||
class OverlaysView extends React.Component {
|
class OverlaysView extends React.Component {
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
export const elementTypes = {
|
||||||
|
eleNode: "ElementTypeNode",
|
||||||
|
eleTunnel: "ElementTypeTunnel",
|
||||||
|
eleNone: "ElementTypeNone",
|
||||||
|
};
|
||||||
|
export const appViews = {
|
||||||
|
TopologyView: "TopologyView",
|
||||||
|
SubgraphView: "SubgraphView",
|
||||||
|
MapView: "MapView",
|
||||||
|
OverlaysView: "OverlaysView",
|
||||||
|
};
|
||||||
|
export const nodeStates = {
|
||||||
|
connected: "Connected",
|
||||||
|
noTunnels: "No Tunnels",
|
||||||
|
notReporting: "Not Reporting",
|
||||||
|
};
|
|
@ -4,7 +4,7 @@ import { slide as Slidebar } from "react-burger-menu";
|
||||||
import evio_logo from "../images/icons/evio.svg";
|
import evio_logo from "../images/icons/evio.svg";
|
||||||
import Navbar from "./Navbar";
|
import Navbar from "./Navbar";
|
||||||
import { Typeahead } from "react-bootstrap-typeahead";
|
import { Typeahead } from "react-bootstrap-typeahead";
|
||||||
import { appViews } from "../features/evio/evioSlice";
|
import { appViews } from "./Shared";
|
||||||
import ReactDOM from "react-dom";
|
import ReactDOM from "react-dom";
|
||||||
|
|
||||||
class Sidebar extends React.Component {
|
class Sidebar extends React.Component {
|
||||||
|
|
|
@ -10,19 +10,15 @@ import {
|
||||||
setRedrawGraph,
|
setRedrawGraph,
|
||||||
setSelectedElement,
|
setSelectedElement,
|
||||||
clearSelectedElement,
|
clearSelectedElement,
|
||||||
|
} from "../features/evio/evioSlice";
|
||||||
|
import {
|
||||||
elementTypes,
|
elementTypes,
|
||||||
appViews,
|
appViews,
|
||||||
} from "../features/evio/evioSlice";
|
nodeStates,} from "./Shared";
|
||||||
import { setCurrentView } from "../features/view/viewSlice";
|
import { setCurrentView } from "../features/view/viewSlice";
|
||||||
import { setZoomValue } from "../features/tools/toolsSlice";
|
import { setZoomValue } from "../features/tools/toolsSlice";
|
||||||
import CytoscapeComponent from "react-cytoscapejs";
|
import CytoscapeComponent from "react-cytoscapejs";
|
||||||
|
|
||||||
const nodeStates = {
|
|
||||||
connected: "Connected",
|
|
||||||
noTunnels: "No Tunnels",
|
|
||||||
notReporting: "Not Reporting",
|
|
||||||
};
|
|
||||||
|
|
||||||
class TopologyView extends React.Component {
|
class TopologyView extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
|
@ -260,6 +256,8 @@ class TopologyView extends React.Component {
|
||||||
<label id="valueLabel">{cyNode.data().id}</label>
|
<label id="valueLabel">{cyNode.data().id}</label>
|
||||||
<div className="DetailsLabel">State</div>
|
<div className="DetailsLabel">State</div>
|
||||||
<label id="valueLabel">{cyNode.data().state}</label>
|
<label id="valueLabel">{cyNode.data().state}</label>
|
||||||
|
<div className="DetailsLabel">Version</div>
|
||||||
|
<label id="valueLabel">{cyNode.data().version}</label>
|
||||||
<div className="DetailsLabel">Location</div>
|
<div className="DetailsLabel">Location</div>
|
||||||
<label id="valueLabel">{cyNode.data().location}</label>
|
<label id="valueLabel">{cyNode.data().location}</label>
|
||||||
<hr style={{ backgroundColor: "#486186" }} />
|
<hr style={{ backgroundColor: "#486186" }} />
|
||||||
|
@ -286,6 +284,8 @@ class TopologyView extends React.Component {
|
||||||
<label id="valueLabel">{cyNode.data().id}</label>
|
<label id="valueLabel">{cyNode.data().id}</label>
|
||||||
<div className="DetailsLabel">State</div>
|
<div className="DetailsLabel">State</div>
|
||||||
<label id="valueLabel">{cyNode.data().state}</label>
|
<label id="valueLabel">{cyNode.data().state}</label>
|
||||||
|
<div className="DetailsLabel">Version</div>
|
||||||
|
<label id="valueLabel">{cyNode.data().version}</label>
|
||||||
<div className="DetailsLabel">Location</div>
|
<div className="DetailsLabel">Location</div>
|
||||||
<label id="valueLabel">{cyNode.data().location}</label>
|
<label id="valueLabel">{cyNode.data().location}</label>
|
||||||
<hr style={{ backgroundColor: "#486186" }} />
|
<hr style={{ backgroundColor: "#486186" }} />
|
||||||
|
@ -295,7 +295,7 @@ class TopologyView extends React.Component {
|
||||||
>
|
>
|
||||||
{sidebarNodeslist.map((connectedNode) => {
|
{sidebarNodeslist.map((connectedNode) => {
|
||||||
try {
|
try {
|
||||||
var [connectedlinkDetail, tunnelId] = this.getConnectedLinkDetails(
|
var {connectedlinkDetail, tunnelId} = this.getConnectedLinkDetails(
|
||||||
cyNode,
|
cyNode,
|
||||||
connectedNode,
|
connectedNode,
|
||||||
connectedEdges
|
connectedEdges
|
||||||
|
@ -348,6 +348,8 @@ class TopologyView extends React.Component {
|
||||||
<label id="valueLabel">{cyNode.data().id}</label>
|
<label id="valueLabel">{cyNode.data().id}</label>
|
||||||
<div className="DetailsLabel">State</div>
|
<div className="DetailsLabel">State</div>
|
||||||
<label id="valueLabel">{cyNode.data().state}</label>
|
<label id="valueLabel">{cyNode.data().state}</label>
|
||||||
|
<div className="DetailsLabel">Version</div>
|
||||||
|
<label id="valueLabel">{cyNode.data().version}</label>
|
||||||
<div className="DetailsLabel">Location</div>
|
<div className="DetailsLabel">Location</div>
|
||||||
<label id="valueLabel">{cyNode.data().location}</label>
|
<label id="valueLabel">{cyNode.data().location}</label>
|
||||||
<hr style={{ backgroundColor: "#486186" }} />
|
<hr style={{ backgroundColor: "#486186" }} />
|
||||||
|
@ -421,7 +423,9 @@ class TopologyView extends React.Component {
|
||||||
source.data().id === descriptorItem.Source &&
|
source.data().id === descriptorItem.Source &&
|
||||||
tgt.id === descriptorItem.Target
|
tgt.id === descriptorItem.Target
|
||||||
) {
|
) {
|
||||||
return [descriptorItem, edge._private.data.id];
|
let connectedlinkDetail = descriptorItem;
|
||||||
|
let tunnelId = edge._private.data.id;
|
||||||
|
return { connectedlinkDetail, tunnelId };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -814,9 +818,9 @@ class TopologyView extends React.Component {
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
this.autoRefresh = false;
|
this.autoRefresh = false;
|
||||||
//clearTimeout(this.timeoutId);
|
clearTimeout(this.timeoutId);
|
||||||
//this.props.clearSelectedElement();
|
//this.props.clearSelectedElement();
|
||||||
//this.props.setCyElements([]);
|
this.props.setCyElements([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderTopologyContent() {
|
renderTopologyContent() {
|
||||||
|
|
|
@ -1,16 +1,8 @@
|
||||||
import { createSlice } from "@reduxjs/toolkit";
|
import { createSlice } from "@reduxjs/toolkit";
|
||||||
|
import {
|
||||||
export const elementTypes = {
|
elementTypes,
|
||||||
eleNode: "ElementTypeNode",
|
appViews,
|
||||||
eleTunnel: "ElementTypeTunnel",
|
nodeStates,} from "../../app/Shared";
|
||||||
eleNone: "ElementTypeNone",
|
|
||||||
};
|
|
||||||
export const appViews = {
|
|
||||||
TopologyView: "TopologyView",
|
|
||||||
SubgraphView: "SubgraphView",
|
|
||||||
MapView: "MapView",
|
|
||||||
OverlaysView: "OverlaysView",
|
|
||||||
};
|
|
||||||
|
|
||||||
const evioSlice = createSlice({
|
const evioSlice = createSlice({
|
||||||
name: "evio",
|
name: "evio",
|
||||||
|
|
Loading…
Reference in New Issue