mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2025-02-25 18:55:32 -06:00
Merge pull request #488 from LibreQoE/node_manager_show_name
Change the window title for the node manager to include a specified name from the config
This commit is contained in:
commit
36d41911f2
@ -6,6 +6,15 @@ use rocket::{fs::NamedFile, serde::{json::Json, Serialize, Deserialize}};
|
|||||||
use rocket::serde::json::Value;
|
use rocket::serde::json::Value;
|
||||||
use crate::tracker::SHAPED_DEVICES;
|
use crate::tracker::SHAPED_DEVICES;
|
||||||
|
|
||||||
|
#[get("/api/node_name")]
|
||||||
|
pub async fn get_node_name() -> Json<String> {
|
||||||
|
if let Ok(config) = lqos_config::load_config() {
|
||||||
|
Json(config.node_name)
|
||||||
|
} else {
|
||||||
|
Json("No Name Provided".to_string())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Note that NoCache can be replaced with a cache option
|
// Note that NoCache can be replaced with a cache option
|
||||||
// once the design work is complete.
|
// once the design work is complete.
|
||||||
#[get("/config")]
|
#[get("/config")]
|
||||||
|
@ -89,6 +89,7 @@ fn rocket() -> _ {
|
|||||||
config_control::update_network_and_devices,
|
config_control::update_network_and_devices,
|
||||||
config_control::update_lqos_tuning,
|
config_control::update_lqos_tuning,
|
||||||
config_control::update_lqosd_config,
|
config_control::update_lqosd_config,
|
||||||
|
config_control::get_node_name,
|
||||||
auth_guard::create_first_user,
|
auth_guard::create_first_user,
|
||||||
auth_guard::login,
|
auth_guard::login,
|
||||||
auth_guard::admin_check,
|
auth_guard::admin_check,
|
||||||
|
@ -949,6 +949,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function start() {
|
function start() {
|
||||||
|
setTitle();
|
||||||
wireUpTabEvents();
|
wireUpTabEvents();
|
||||||
$("#btnPause").on('click', () => {
|
$("#btnPause").on('click', () => {
|
||||||
paused = !paused;
|
paused = !paused;
|
||||||
|
@ -1007,6 +1007,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function start() {
|
function start() {
|
||||||
|
setTitle();
|
||||||
display();
|
display();
|
||||||
colorReloadButton();
|
colorReloadButton();
|
||||||
updateHostCounts();
|
updateHostCounts();
|
||||||
|
@ -497,3 +497,10 @@ function ipToHostname(ip) {
|
|||||||
})
|
})
|
||||||
return ip;
|
return ip;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setTitle() {
|
||||||
|
$.get("/api/node_name", (name) => {
|
||||||
|
// Set the window title
|
||||||
|
document.title = name + " - LibreQoS Node Manager";
|
||||||
|
})
|
||||||
|
}
|
@ -558,6 +558,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function start() {
|
function start() {
|
||||||
|
setTitle();
|
||||||
if (isRedacted()) {
|
if (isRedacted()) {
|
||||||
//console.log("Redacting");
|
//console.log("Redacting");
|
||||||
//css_getclass(".redact").style.filter = "blur(4px)";
|
//css_getclass(".redact").style.filter = "blur(4px)";
|
||||||
|
@ -135,6 +135,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function start() {
|
function start() {
|
||||||
|
setTitle();
|
||||||
colorReloadButton();
|
colorReloadButton();
|
||||||
updateHostCounts();
|
updateHostCounts();
|
||||||
$.get("/api/shaped_devices_count", (count) => {
|
$.get("/api/shaped_devices_count", (count) => {
|
||||||
|
@ -270,6 +270,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function start() {
|
function start() {
|
||||||
|
setTitle();
|
||||||
for (let i = 0; i < 20; ++i) rtt_histo.push(0);
|
for (let i = 0; i < 20; ++i) rtt_histo.push(0);
|
||||||
colorReloadButton();
|
colorReloadButton();
|
||||||
updateHostCounts();
|
updateHostCounts();
|
||||||
|
Loading…
Reference in New Issue
Block a user