Merge pull request #345 from LibreQoE/node_types_hotfix

Hotfix: handle node "type" entry
This commit is contained in:
Robert Chacón 2023-04-24 09:49:47 -06:00 committed by GitHub
commit b4feb920b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 523 additions and 431 deletions

View File

@ -285,7 +285,7 @@ def handleMultipleInternetNodes(sites, dataLinks, uispSite):
internetConnectedSites = []
for link in dataLinks:
if link['canDelete'] == False:
if link['from']['device']['identification']['id'] == link['to']['device']['identification']['id']:
if link['from']['device'] is not None and link['to']['device'] is not None and link['from']['device']['identification']['id'] == link['to']['device']['identification']['id']:
siteID = link['from']['site']['identification']['id']
# Found internet link
internetConnectedSites.append(siteID)

947
src/rust/Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -48,6 +48,7 @@ impl NetworkJsonNode {
rtts: self.rtts.iter().map(|n| *n as f32 / 100.0).collect(),
parents: self.parents.clone(),
immediate_parent: self.immediate_parent,
node_type: None,
}
}
}
@ -69,6 +70,9 @@ pub struct NetworkJsonTransport {
pub parents: Vec<usize>,
/// The immediate parent node in the tree
pub immediate_parent: Option<usize>,
/// The type of node (site, ap, etc.)
#[serde(rename = "type")]
pub node_type: Option<String>,
}
/// Holder for the network.json representation.

View File

@ -96,6 +96,7 @@ pub fn get_top_n_root_queues(n_queues: usize) -> BusResponse {
rtts: Vec::new(),
parents: Vec::new(),
immediate_parent: None,
node_type: None,
},
));
}