mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2025-02-16 14:34:45 -06:00
Start building signal charts for APs. A few cleanup items.
This commit is contained in:
parent
60e45b7a24
commit
f0f11d30d0
@ -314,6 +314,12 @@ async fn handle_socket(mut socket: WebSocket, cnn: Pool<Postgres>) {
|
||||
InfluxTimePeriod::new(period),
|
||||
)
|
||||
.await;
|
||||
}
|
||||
(WasmRequest::ApSignalExt { period, site_name }, Some(credentials)) => {
|
||||
|
||||
}
|
||||
(WasmRequest::ApCapacityExt { period, site_name }, Some(credentials)) => {
|
||||
|
||||
}
|
||||
(_, None) => {
|
||||
tracing::error!("No credentials");
|
||||
|
@ -3,9 +3,7 @@ use axum::extract::ws::WebSocket;
|
||||
use chrono::{DateTime, FixedOffset};
|
||||
use influxdb2::{FromDataPoint, models::Query, Client};
|
||||
use pgdb::{sqlx::{Pool, Postgres}, organization_cache::get_org_details};
|
||||
|
||||
use crate::web::wss::send_response;
|
||||
|
||||
use super::time_period::InfluxTimePeriod;
|
||||
|
||||
pub async fn send_extended_device_info(
|
||||
@ -108,6 +106,21 @@ pub async fn send_extended_device_snr_graph(
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn send_ap_snr(
|
||||
cnn: &Pool<Postgres>,
|
||||
socket: &mut WebSocket,
|
||||
key: &str,
|
||||
site_name: &str,
|
||||
period: InfluxTimePeriod,
|
||||
|
||||
) -> anyhow::Result<()> {
|
||||
// Get list of child devices
|
||||
let hosts = pgdb::get_host_list_for_site(cnn, key, site_name).await?;
|
||||
let host_filter = pgdb::device_list_to_influx_filter(&hosts);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[derive(Debug, FromDataPoint, Default)]
|
||||
pub struct SnrRow {
|
||||
pub device_id: String,
|
||||
|
@ -125,4 +125,8 @@ pub fn circuit_list_to_influx_filter(hosts: &[(String, String)]) -> String {
|
||||
|
||||
pub fn host_list_to_influx_filter(hosts: &[(String, String)]) -> String {
|
||||
hosts.iter().map(|(id, _name)| format!("r[\"host_id\"] == \"{id}\"", id=id)).join(" or ")
|
||||
}
|
||||
|
||||
pub fn device_list_to_influx_filter(hosts: &[(String, String)]) -> String {
|
||||
hosts.iter().map(|(id, _name)| format!("r[\"device_id\"] == \"{id}\"", id=id)).join(" or ")
|
||||
}
|
@ -25,7 +25,7 @@ export class SitePage implements Page {
|
||||
new SiteInfo(siteId),
|
||||
new SiteBreadcrumbs(siteId),
|
||||
new ThroughputSiteChart(siteId),
|
||||
new RttChartSite(siteId),
|
||||
new RttChartSite(siteId, 1.0),
|
||||
new SiteHeat(siteId),
|
||||
new SiteStackChart(siteId),
|
||||
];
|
||||
|
@ -172,4 +172,14 @@ pub fn request_ext_snr_graph(period: String, device_id: String) {
|
||||
#[wasm_bindgen]
|
||||
pub fn request_ext_capacity_graph(period: String, device_id: String) {
|
||||
send_message(WasmRequest::DeviceCapacityChartExt { period, device_id });
|
||||
}
|
||||
|
||||
#[wasm_bindgen]
|
||||
pub fn request_ext_capacity_ap(period: String, site_name: String) {
|
||||
send_message(WasmRequest::ApCapacityExt { period, site_name });
|
||||
}
|
||||
|
||||
#[wasm_bindgen]
|
||||
pub fn request_ext_signal_ap(period: String, site_name: String) {
|
||||
send_message(WasmRequest::ApSignalExt { period, site_name });
|
||||
}
|
@ -32,6 +32,8 @@ pub enum WasmRequest {
|
||||
ExtendedDeviceInfo { circuit_id: String },
|
||||
SignalNoiseChartExt { period: String, device_id: String },
|
||||
DeviceCapacityChartExt { period: String, device_id: String },
|
||||
ApSignalExt { period: String, site_name: String },
|
||||
ApCapacityExt { period: String, site_name: String },
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
|
Loading…
Reference in New Issue
Block a user