Remove needless console.log call

This commit is contained in:
Herbert Wolverson 2023-05-15 15:27:23 +00:00
parent ba82f3c97f
commit 570bcfbe72
8 changed files with 53 additions and 3 deletions

View File

@ -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_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,
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::{
extract::{
@ -129,6 +129,20 @@ async fn handle_socket(mut socket: WebSocket, cnn: Pool<Postgres>) {
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" => {
if let Some(credentials) = &credentials {
let _ = send_throughput_for_node(

View File

@ -23,4 +23,5 @@ pub use site_parents::send_site_parents;
pub use throughput::{
send_throughput_for_all_nodes, send_throughput_for_all_nodes_by_circuit,
send_throughput_for_all_nodes_by_site, send_throughput_for_node,
send_site_stack_map,
};

View File

@ -1,15 +1,15 @@
use std::collections::HashMap;
mod site_stack;
use axum::extract::ws::{WebSocket, Message};
use futures::future::join_all;
use influxdb2::{Client, models::Query};
use pgdb::sqlx::{Pool, Postgres};
use crate::submissions::get_org_details;
use self::{throughput_host::{ThroughputHost, Throughput, ThroughputChart}, throughput_row::{ThroughputRow, ThroughputRowBySite, ThroughputRowByCircuit}};
use super::time_period::InfluxTimePeriod;
mod throughput_host;
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<()> {
let nodes = get_throughput_for_all_nodes(cnn, key, period).await?;

View File

@ -8,6 +8,7 @@ import { RttChartSite } from '../components/rtt_site';
import { RttHistoSite } from '../components/rtt_histo_site';
import { SiteBreadcrumbs } from '../components/site_breadcrumbs';
import { SiteHeat } from '../components/site_heat';
import { SiteStackChart } from '../components/site_stack';
export class AccessPointPage implements Page {
menu: MenuPage;
@ -28,6 +29,7 @@ export class AccessPointPage implements Page {
new RttHistoSite(),
new SiteBreadcrumbs(siteId),
new SiteHeat(siteId),
new SiteStackChart(siteId),
];
}

View File

@ -38,6 +38,16 @@
</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="col-12">
<div class="card">

View File

@ -113,6 +113,16 @@ export class Bus {
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() {
this.ws.send("{ \"msg\": \"rttChart\", \"period\": \"" + window.graphPeriod + "\" }");
}

View File

@ -8,6 +8,7 @@ import { RttChartSite } from '../components/rtt_site';
import { RttHistoSite } from '../components/rtt_histo_site';
import { SiteBreadcrumbs } from '../components/site_breadcrumbs';
import { SiteHeat } from '../components/site_heat';
import { SiteStackChart } from '../components/site_stack';
export class SitePage implements Page {
menu: MenuPage;
@ -28,6 +29,7 @@ export class SitePage implements Page {
new RttHistoSite(),
new SiteBreadcrumbs(siteId),
new SiteHeat(siteId),
new SiteStackChart(siteId),
];
}
@ -35,6 +37,7 @@ export class SitePage implements Page {
this.components.forEach(component => {
component.wireup();
});
window.bus.requestThroughputStackSite(this.siteId);
}
ontick(): void {

View File

@ -38,6 +38,16 @@
</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="col-12">
<div class="card">