mirror of
				https://github.com/optim-enterprises-bv/OptimCloud-gw-ui.git
				synced 2025-11-03 19:57:46 +00:00 
			
		
		
		
	2.5.29: fixes for statistics graphs
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.5.28",
 | 
					  "version": "2.5.29",
 | 
				
			||||||
  "lockfileVersion": 2,
 | 
					  "lockfileVersion": 2,
 | 
				
			||||||
  "requires": true,
 | 
					  "requires": true,
 | 
				
			||||||
  "packages": {
 | 
					  "packages": {
 | 
				
			||||||
    "": {
 | 
					    "": {
 | 
				
			||||||
      "name": "ucentral-client",
 | 
					      "name": "ucentral-client",
 | 
				
			||||||
      "version": "2.5.28",
 | 
					      "version": "2.5.29",
 | 
				
			||||||
      "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.5.28",
 | 
					  "version": "2.5.29",
 | 
				
			||||||
  "dependencies": {
 | 
					  "dependencies": {
 | 
				
			||||||
    "@coreui/coreui": "^3.4.0",
 | 
					    "@coreui/coreui": "^3.4.0",
 | 
				
			||||||
    "@coreui/icons": "^2.0.1",
 | 
					    "@coreui/icons": "^2.0.1",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -117,35 +117,31 @@ const StatisticsChartList = ({ setOptions, section, setStart, setEnd, time }) =>
 | 
				
			|||||||
    for (const log of sortedData) {
 | 
					    for (const log of sortedData) {
 | 
				
			||||||
      // Looping through the interfaces of the log
 | 
					      // Looping through the interfaces of the log
 | 
				
			||||||
      for (const inter of log.data.interfaces) {
 | 
					      for (const inter of log.data.interfaces) {
 | 
				
			||||||
        if (inter.counters) {
 | 
					        if (inter.ssids?.length > 0) {
 | 
				
			||||||
          interfaceList[interfaceTypes[inter.name]][0].data.push(
 | 
					 | 
				
			||||||
            inter.counters?.tx_bytes ? Math.floor(inter.counters.tx_bytes / 1024) : 0,
 | 
					 | 
				
			||||||
          );
 | 
					 | 
				
			||||||
          interfaceList[interfaceTypes[inter.name]][1].data.push(
 | 
					 | 
				
			||||||
            inter.counters?.rx_bytes ? Math.floor(inter.counters.rx_bytes / 1024) : 0,
 | 
					 | 
				
			||||||
          );
 | 
					 | 
				
			||||||
        } else if (
 | 
					 | 
				
			||||||
          inter.ssids.length > 0 &&
 | 
					 | 
				
			||||||
          inter.ssids[0].associations.length > 0 &&
 | 
					 | 
				
			||||||
          inter.ssids[0].associations[0].deltas
 | 
					 | 
				
			||||||
        ) {
 | 
					 | 
				
			||||||
          let totalTx = 0;
 | 
					          let totalTx = 0;
 | 
				
			||||||
          let totalRx = 0;
 | 
					          let totalRx = 0;
 | 
				
			||||||
 | 
					 | 
				
			||||||
          for (const ssid of inter.ssids) {
 | 
					          for (const ssid of inter.ssids) {
 | 
				
			||||||
            for (const assoc of ssid.associations) {
 | 
					            if (ssid.associations) {
 | 
				
			||||||
              totalTx += assoc.deltas?.tx_bytes ?? 0;
 | 
					              for (const assoc of ssid.associations) {
 | 
				
			||||||
              totalRx += assoc.deltas?.rx_bytes ?? 0;
 | 
					                if (assoc.deltas) {
 | 
				
			||||||
 | 
					                  totalTx += assoc.deltas?.tx_bytes ?? 0;
 | 
				
			||||||
 | 
					                  totalRx += assoc.deltas?.rx_bytes ?? 0;
 | 
				
			||||||
 | 
					                } else {
 | 
				
			||||||
 | 
					                  totalTx += assoc.counters?.tx_bytes ?? 0;
 | 
				
			||||||
 | 
					                  totalRx += assoc.counters?.rx_bytes ?? 0;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					              }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
          totalTx = Math.floor(totalTx / 1024);
 | 
					          interfaceList[interfaceTypes[inter.name]][0].data.push(Math.floor(totalTx / 1024));
 | 
				
			||||||
          totalRx = Math.floor(totalRx / 1024);
 | 
					          interfaceList[interfaceTypes[inter.name]][1].data.push(Math.floor(totalRx / 1024));
 | 
				
			||||||
 | 
					 | 
				
			||||||
          interfaceList[interfaceTypes[inter.name]][0].data.push(totalTx);
 | 
					 | 
				
			||||||
          interfaceList[interfaceTypes[inter.name]][1].data.push(totalRx);
 | 
					 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
          interfaceList[interfaceTypes[inter.name]][0].data.push(0);
 | 
					          interfaceList[interfaceTypes[inter.name]][0].data.push(
 | 
				
			||||||
          interfaceList[interfaceTypes[inter.name]][1].data.push(0);
 | 
					            inter.counters ? Math.floor(inter.counters.tx_bytes) : 0,
 | 
				
			||||||
 | 
					          );
 | 
				
			||||||
 | 
					          interfaceList[interfaceTypes[inter.name]][1].data.push(
 | 
				
			||||||
 | 
					            inter.counters ? Math.floor(inter.counters.rx_bytes) : 0,
 | 
				
			||||||
 | 
					          );
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user