mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2024-11-25 17:50:16 -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 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
|
||||
// once the design work is complete.
|
||||
#[get("/config")]
|
||||
|
@ -89,6 +89,7 @@ fn rocket() -> _ {
|
||||
config_control::update_network_and_devices,
|
||||
config_control::update_lqos_tuning,
|
||||
config_control::update_lqosd_config,
|
||||
config_control::get_node_name,
|
||||
auth_guard::create_first_user,
|
||||
auth_guard::login,
|
||||
auth_guard::admin_check,
|
||||
|
@ -949,6 +949,7 @@
|
||||
}
|
||||
|
||||
function start() {
|
||||
setTitle();
|
||||
wireUpTabEvents();
|
||||
$("#btnPause").on('click', () => {
|
||||
paused = !paused;
|
||||
|
@ -1007,6 +1007,7 @@
|
||||
}
|
||||
|
||||
function start() {
|
||||
setTitle();
|
||||
display();
|
||||
colorReloadButton();
|
||||
updateHostCounts();
|
||||
|
@ -497,3 +497,10 @@ function ipToHostname(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() {
|
||||
setTitle();
|
||||
if (isRedacted()) {
|
||||
//console.log("Redacting");
|
||||
//css_getclass(".redact").style.filter = "blur(4px)";
|
||||
|
@ -135,6 +135,7 @@
|
||||
}
|
||||
|
||||
function start() {
|
||||
setTitle();
|
||||
colorReloadButton();
|
||||
updateHostCounts();
|
||||
$.get("/api/shaped_devices_count", (count) => {
|
||||
|
@ -270,6 +270,7 @@
|
||||
}
|
||||
|
||||
function start() {
|
||||
setTitle();
|
||||
for (let i = 0; i < 20; ++i) rtt_histo.push(0);
|
||||
colorReloadButton();
|
||||
updateHostCounts();
|
||||
|
Loading…
Reference in New Issue
Block a user