mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2025-02-25 18:55:32 -06:00
Fix scale factor on sub-site stack, improve tooltip to be readable by mere humans.
This commit is contained in:
parent
ccb41c5de2
commit
d21d7bc60a
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -12,11 +12,17 @@ pub struct OrganizationDetails {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub async fn get_organization(cnn: &Pool<Postgres>, key: &str) -> Result<OrganizationDetails, StatsHostError> {
|
pub async fn get_organization(cnn: &Pool<Postgres>, key: &str) -> Result<OrganizationDetails, StatsHostError> {
|
||||||
let row = sqlx::query_as::<_, OrganizationDetails>("SELECT * FROM organizations WHERE key=$1")
|
let mut row = sqlx::query_as::<_, OrganizationDetails>("SELECT * FROM organizations WHERE key=$1")
|
||||||
.bind(key)
|
.bind(key)
|
||||||
.fetch_one(cnn)
|
.fetch_one(cnn)
|
||||||
.await
|
.await
|
||||||
.map_err(|e| StatsHostError::DatabaseError(e.to_string()))?;
|
.map_err(|e| StatsHostError::DatabaseError(e.to_string()))?;
|
||||||
|
|
||||||
|
// For local development - comment out
|
||||||
|
if row.influx_host == "127.0.0.1" {
|
||||||
|
row.influx_host = "146.190.156.69".to_string();
|
||||||
|
}
|
||||||
|
|
||||||
Ok(row)
|
Ok(row)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ window.setInterval(() => {
|
|||||||
window.bus.updateConnected();
|
window.bus.updateConnected();
|
||||||
let btn = document.getElementById("graphPeriodBtn") as HTMLButtonElement;
|
let btn = document.getElementById("graphPeriodBtn") as HTMLButtonElement;
|
||||||
btn.innerText = window.graphPeriod;
|
btn.innerText = window.graphPeriod;
|
||||||
}, 1000);
|
}, 10000);
|
||||||
|
|
||||||
function changeGraphPeriod(period: string) {
|
function changeGraphPeriod(period: string) {
|
||||||
window.graphPeriod = period;
|
window.graphPeriod = period;
|
||||||
|
@ -49,9 +49,9 @@ export class SiteStackChart implements Component {
|
|||||||
let l: number[] = [];
|
let l: number[] = [];
|
||||||
for (let j = 0; j < node.down.length; j++) {
|
for (let j = 0; j < node.down.length; j++) {
|
||||||
if (first) x.push(node.down[j].date);
|
if (first) x.push(node.down[j].date);
|
||||||
d.push(node.down[j].value);
|
d.push(node.down[j].value * 8.0);
|
||||||
u.push(node.down[j].u);
|
u.push(node.down[j].u * 8.0);
|
||||||
l.push(node.down[j].l);
|
l.push(node.down[j].l * 8.0);
|
||||||
}
|
}
|
||||||
if (first) first = false;
|
if (first) first = false;
|
||||||
|
|
||||||
@ -71,9 +71,9 @@ export class SiteStackChart implements Component {
|
|||||||
u = [];
|
u = [];
|
||||||
l = [];
|
l = [];
|
||||||
for (let j = 0; j < node.down.length; j++) {
|
for (let j = 0; j < node.down.length; j++) {
|
||||||
d.push(0.0 - node.up[j].value);
|
d.push(0.0 - (node.up[j].value * 8.0));
|
||||||
u.push(0.0 - node.up[j].u);
|
u.push(0.0 - (node.up[j].u * 8.0));
|
||||||
l.push(0.0 - node.up[j].l);
|
l.push(0.0 - (node.up[j].l * 8.0));
|
||||||
}
|
}
|
||||||
|
|
||||||
val = {
|
val = {
|
||||||
@ -96,7 +96,22 @@ export class SiteStackChart implements Component {
|
|||||||
this.myChart.setOption<echarts.EChartsOption>(
|
this.myChart.setOption<echarts.EChartsOption>(
|
||||||
(option = {
|
(option = {
|
||||||
title: { text: "Child Node Throughput (Bits)" },
|
title: { text: "Child Node Throughput (Bits)" },
|
||||||
tooltip: { trigger: "axis" },
|
tooltip: {
|
||||||
|
trigger: "axis",
|
||||||
|
formatter: function (params: any) {
|
||||||
|
console.log(params);
|
||||||
|
let result = "";
|
||||||
|
for (let i = 0; i < params.length; i+=2) {
|
||||||
|
let siteName = params[i].seriesName;
|
||||||
|
siteName += " (⬇️" + scaleNumber(params[i].value) + " / ⬆️" + scaleNumber(0.0 - params[i+1].value) + ")";
|
||||||
|
result += `${siteName}<br />`;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
//return `${params.seriesName}<br />
|
||||||
|
// ${params.name}: ${params.data.value}<br />
|
||||||
|
// ${params.data.name1}: ${params.data.value1}`;
|
||||||
|
}
|
||||||
|
},
|
||||||
legend: {
|
legend: {
|
||||||
orient: "vertical",
|
orient: "vertical",
|
||||||
right: 0,
|
right: 0,
|
||||||
|
Loading…
Reference in New Issue
Block a user