Merge pull request #101 from stephb9959/main

[WIFI-10548] Network diagram now showing all associations
This commit is contained in:
Charles Bourque
2022-08-11 11:21:56 +01:00
committed by GitHub
4 changed files with 8 additions and 8 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "ucentral-client", "name": "ucentral-client",
"version": "2.7.0(1)", "version": "2.7.0(2)",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "ucentral-client", "name": "ucentral-client",
"version": "2.7.0(1)", "version": "2.7.0(2)",
"dependencies": { "dependencies": {
"@coreui/coreui": "^3.4.0", "@coreui/coreui": "^3.4.0",
"@coreui/icons": "^2.0.1", "@coreui/icons": "^2.0.1",

View File

@@ -1,6 +1,6 @@
{ {
"name": "ucentral-client", "name": "ucentral-client",
"version": "2.7.0(1)", "version": "2.7.0(2)",
"dependencies": { "dependencies": {
"@coreui/coreui": "^3.4.0", "@coreui/coreui": "^3.4.0",
"@coreui/icons": "^2.0.1", "@coreui/icons": "^2.0.1",

View File

@@ -25,6 +25,7 @@ const NetworkDiagram = ({ show, elements, setElements }) => {
onElementsRemove={onElementsRemove} onElementsRemove={onElementsRemove}
onLoad={onLoad} onLoad={onLoad}
snapToGrid snapToGrid
minZoom={0.1}
snapGrid={[20, 20]} snapGrid={[20, 20]}
> >
<MiniMap <MiniMap

View File

@@ -47,7 +47,7 @@ const associationNode = (associationInfo) => (
<div> <div>
<CRow> <CRow>
<CCol className="text-center"> <CCol className="text-center">
<h6>{associationInfo.bssid}</h6> <h6>{associationInfo.station}</h6>
</CCol> </CCol>
</CRow> </CRow>
<CRow> <CRow>
@@ -92,7 +92,6 @@ const NetworkDiagram = ({ show, radios, associations }) => {
// Creating the association nodes and their edges // Creating the association nodes and their edges
for (let i = 0; i < associations.length; i += 1) { for (let i = 0; i < associations.length; i += 1) {
const assoc = associations[i]; const assoc = associations[i];
// If the radio has not been added, we create a new unknown radio based on its index // If the radio has not been added, we create a new unknown radio based on its index
if (radiosAdded[assoc.radio.radioIndex] === undefined) { if (radiosAdded[assoc.radio.radioIndex] === undefined) {
newElements.push({ newElements.push({
@@ -107,7 +106,7 @@ const NetworkDiagram = ({ show, radios, associations }) => {
// Adding the association // Adding the association
newElements.push({ newElements.push({
id: `a-${assoc.bssid}`, id: `a-${assoc.station}`,
data: { label: associationNode(assoc) }, data: { label: associationNode(assoc) },
position: { position: {
x: getX(radiosAdded[assoc.radio.radioIndex]), x: getX(radiosAdded[assoc.radio.radioIndex]),
@@ -120,9 +119,9 @@ const NetworkDiagram = ({ show, radios, associations }) => {
// Creating the edge // Creating the edge
newElements.push({ newElements.push({
id: `e-${assoc.radio.radioIndex}-${assoc.bssid}`, id: `e-${assoc.radio.radioIndex}-${assoc.station}`,
source: `r-${assoc.radio.radioIndex}`, source: `r-${assoc.radio.radioIndex}`,
target: `a-${assoc.bssid}`, target: `a-${assoc.station}`,
arrowHeadType: 'arrowclosed', arrowHeadType: 'arrowclosed',
}); });
} }