mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2024-11-22 08:16:25 -06:00
Handle cases where the field isn't present in network.json for backwards compatibility.
This commit is contained in:
parent
629ebb0293
commit
36440bdd9c
@ -48,7 +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(),
|
||||
node_type: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -72,7 +72,7 @@ pub struct NetworkJsonTransport {
|
||||
pub immediate_parent: Option<usize>,
|
||||
/// The type of node (site, ap, etc.)
|
||||
#[serde(rename = "type")]
|
||||
pub node_type: String,
|
||||
pub node_type: Option<String>,
|
||||
}
|
||||
|
||||
/// Holder for the network.json representation.
|
||||
|
@ -96,7 +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(),
|
||||
node_type: None,
|
||||
},
|
||||
));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user