mirror of
				https://github.com/optim-enterprises-bv/OptimCloud-gw-ui.git
				synced 2025-11-04 04:07:49 +00:00 
			
		
		
		
	Merge pull request #101 from stephb9959/main
[WIFI-10548] Network diagram now showing all associations
This commit is contained in:
		
							
								
								
									
										4
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										4
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							@@ -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",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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',
 | 
				
			||||||
      });
 | 
					      });
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user