mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2025-02-25 18:55:32 -06:00
Remove needless console.log call
This commit is contained in:
parent
ba82f3c97f
commit
570bcfbe72
@ -3,7 +3,7 @@ use crate::web::wss::queries::{
|
|||||||
send_packets_for_node, send_perf_for_node, send_rtt_for_all_nodes, send_rtt_for_all_nodes_site,
|
send_packets_for_node, send_perf_for_node, send_rtt_for_all_nodes, send_rtt_for_all_nodes_site,
|
||||||
send_rtt_for_node, send_site_info, send_site_parents, send_throughput_for_all_nodes,
|
send_rtt_for_node, send_site_info, send_site_parents, send_throughput_for_all_nodes,
|
||||||
send_throughput_for_all_nodes_by_site, send_throughput_for_node, site_heat_map,
|
send_throughput_for_all_nodes_by_site, send_throughput_for_node, site_heat_map,
|
||||||
site_tree::send_site_tree, send_throughput_for_all_nodes_by_circuit, send_rtt_for_all_nodes_circuit,
|
site_tree::send_site_tree, send_throughput_for_all_nodes_by_circuit, send_rtt_for_all_nodes_circuit, send_site_stack_map,
|
||||||
};
|
};
|
||||||
use axum::{
|
use axum::{
|
||||||
extract::{
|
extract::{
|
||||||
@ -129,6 +129,20 @@ async fn handle_socket(mut socket: WebSocket, cnn: Pool<Postgres>) {
|
|||||||
log::info!("Throughput requested but no credentials provided");
|
log::info!("Throughput requested but no credentials provided");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
"throughputStackSite" => {
|
||||||
|
if let Some(credentials) = &credentials {
|
||||||
|
let _ = send_site_stack_map(
|
||||||
|
cnn.clone(),
|
||||||
|
&mut socket,
|
||||||
|
&credentials.license_key,
|
||||||
|
period,
|
||||||
|
json.get("site_id").unwrap().as_str().unwrap().to_string(),
|
||||||
|
)
|
||||||
|
.await;
|
||||||
|
} else {
|
||||||
|
log::info!("Throughput requested but no credentials provided");
|
||||||
|
}
|
||||||
|
}
|
||||||
"throughputChartSingle" => {
|
"throughputChartSingle" => {
|
||||||
if let Some(credentials) = &credentials {
|
if let Some(credentials) = &credentials {
|
||||||
let _ = send_throughput_for_node(
|
let _ = send_throughput_for_node(
|
||||||
|
@ -23,4 +23,5 @@ pub use site_parents::send_site_parents;
|
|||||||
pub use throughput::{
|
pub use throughput::{
|
||||||
send_throughput_for_all_nodes, send_throughput_for_all_nodes_by_circuit,
|
send_throughput_for_all_nodes, send_throughput_for_all_nodes_by_circuit,
|
||||||
send_throughput_for_all_nodes_by_site, send_throughput_for_node,
|
send_throughput_for_all_nodes_by_site, send_throughput_for_node,
|
||||||
|
send_site_stack_map,
|
||||||
};
|
};
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
mod site_stack;
|
||||||
use axum::extract::ws::{WebSocket, Message};
|
use axum::extract::ws::{WebSocket, Message};
|
||||||
use futures::future::join_all;
|
use futures::future::join_all;
|
||||||
use influxdb2::{Client, models::Query};
|
use influxdb2::{Client, models::Query};
|
||||||
use pgdb::sqlx::{Pool, Postgres};
|
use pgdb::sqlx::{Pool, Postgres};
|
||||||
use crate::submissions::get_org_details;
|
use crate::submissions::get_org_details;
|
||||||
use self::{throughput_host::{ThroughputHost, Throughput, ThroughputChart}, throughput_row::{ThroughputRow, ThroughputRowBySite, ThroughputRowByCircuit}};
|
use self::{throughput_host::{ThroughputHost, Throughput, ThroughputChart}, throughput_row::{ThroughputRow, ThroughputRowBySite, ThroughputRowByCircuit}};
|
||||||
|
|
||||||
use super::time_period::InfluxTimePeriod;
|
use super::time_period::InfluxTimePeriod;
|
||||||
mod throughput_host;
|
mod throughput_host;
|
||||||
mod throughput_row;
|
mod throughput_row;
|
||||||
|
pub use site_stack::send_site_stack_map;
|
||||||
|
|
||||||
pub async fn send_throughput_for_all_nodes(cnn: Pool<Postgres>, socket: &mut WebSocket, key: &str, period: InfluxTimePeriod) -> anyhow::Result<()> {
|
pub async fn send_throughput_for_all_nodes(cnn: Pool<Postgres>, socket: &mut WebSocket, key: &str, period: InfluxTimePeriod) -> anyhow::Result<()> {
|
||||||
let nodes = get_throughput_for_all_nodes(cnn, key, period).await?;
|
let nodes = get_throughput_for_all_nodes(cnn, key, period).await?;
|
||||||
|
@ -8,6 +8,7 @@ import { RttChartSite } from '../components/rtt_site';
|
|||||||
import { RttHistoSite } from '../components/rtt_histo_site';
|
import { RttHistoSite } from '../components/rtt_histo_site';
|
||||||
import { SiteBreadcrumbs } from '../components/site_breadcrumbs';
|
import { SiteBreadcrumbs } from '../components/site_breadcrumbs';
|
||||||
import { SiteHeat } from '../components/site_heat';
|
import { SiteHeat } from '../components/site_heat';
|
||||||
|
import { SiteStackChart } from '../components/site_stack';
|
||||||
|
|
||||||
export class AccessPointPage implements Page {
|
export class AccessPointPage implements Page {
|
||||||
menu: MenuPage;
|
menu: MenuPage;
|
||||||
@ -28,6 +29,7 @@ export class AccessPointPage implements Page {
|
|||||||
new RttHistoSite(),
|
new RttHistoSite(),
|
||||||
new SiteBreadcrumbs(siteId),
|
new SiteBreadcrumbs(siteId),
|
||||||
new SiteHeat(siteId),
|
new SiteHeat(siteId),
|
||||||
|
new SiteStackChart(siteId),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,6 +38,16 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-body">
|
||||||
|
<div id="siteStack" style="height: 900px"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
|
@ -113,6 +113,16 @@ export class Bus {
|
|||||||
this.ws.send(json);
|
this.ws.send(json);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
requestThroughputStackSite(site_id: string) {
|
||||||
|
let request = {
|
||||||
|
msg: "throughputStackSite",
|
||||||
|
period: window.graphPeriod,
|
||||||
|
site_id: decodeURI(site_id),
|
||||||
|
};
|
||||||
|
let json = JSON.stringify(request);
|
||||||
|
this.ws.send(json);
|
||||||
|
}
|
||||||
|
|
||||||
requestRttChart() {
|
requestRttChart() {
|
||||||
this.ws.send("{ \"msg\": \"rttChart\", \"period\": \"" + window.graphPeriod + "\" }");
|
this.ws.send("{ \"msg\": \"rttChart\", \"period\": \"" + window.graphPeriod + "\" }");
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@ import { RttChartSite } from '../components/rtt_site';
|
|||||||
import { RttHistoSite } from '../components/rtt_histo_site';
|
import { RttHistoSite } from '../components/rtt_histo_site';
|
||||||
import { SiteBreadcrumbs } from '../components/site_breadcrumbs';
|
import { SiteBreadcrumbs } from '../components/site_breadcrumbs';
|
||||||
import { SiteHeat } from '../components/site_heat';
|
import { SiteHeat } from '../components/site_heat';
|
||||||
|
import { SiteStackChart } from '../components/site_stack';
|
||||||
|
|
||||||
export class SitePage implements Page {
|
export class SitePage implements Page {
|
||||||
menu: MenuPage;
|
menu: MenuPage;
|
||||||
@ -28,6 +29,7 @@ export class SitePage implements Page {
|
|||||||
new RttHistoSite(),
|
new RttHistoSite(),
|
||||||
new SiteBreadcrumbs(siteId),
|
new SiteBreadcrumbs(siteId),
|
||||||
new SiteHeat(siteId),
|
new SiteHeat(siteId),
|
||||||
|
new SiteStackChart(siteId),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -35,6 +37,7 @@ export class SitePage implements Page {
|
|||||||
this.components.forEach(component => {
|
this.components.forEach(component => {
|
||||||
component.wireup();
|
component.wireup();
|
||||||
});
|
});
|
||||||
|
window.bus.requestThroughputStackSite(this.siteId);
|
||||||
}
|
}
|
||||||
|
|
||||||
ontick(): void {
|
ontick(): void {
|
||||||
|
@ -38,6 +38,16 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-body">
|
||||||
|
<div id="siteStack" style="height: 900px"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
|
Loading…
Reference in New Issue
Block a user