mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2024-11-22 08:16:25 -06:00
Hotfix: handle node "type" entry
Adding "type" to `network.json` is awesome, but it broke a bit of Rust. This patch adds support for the `type` field, and fixes a rare "none" issue that mostly seems to affect my UISP setup.
This commit is contained in:
parent
125ef55e35
commit
629ebb0293
@ -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)
|
||||
|
@ -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: String::new(),
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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: String,
|
||||
}
|
||||
|
||||
/// Holder for the network.json representation.
|
||||
|
@ -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: String::new(),
|
||||
},
|
||||
));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user