diff --git a/app.js b/app.js index 66ba6be..fbe3ff3 100644 --- a/app.js +++ b/app.js @@ -81,6 +81,8 @@ listening_to_log_file = 0; options = {}; options.interval = 1000; +host_name = execSync("cat /etc/hostname").toString(); + /** * Ingest Current Lease File */ @@ -187,7 +189,7 @@ leases_per_minute_counter_timer = setInterval(function(){ */ cpu_utilization_poll = setInterval(function(){ - cpu_utilization = parseFloat(execSync("top -bn 1 | awk 'NR>7{s+=$9} END {print s/4}'")) + cpu_utilization = parseFloat(execSync("top -bn 1 | awk 'NR>7{s+=$9} END {print s/4}'").toString()) }, (15 * 1000)); /** @@ -207,13 +209,13 @@ function get_socket_clients_connected_count() { } /** - * Websocker Server + * Websocket Server */ const WebSocket = require('ws'); const wss = new WebSocket.Server({ port: 8080 }); -options.interval = 100; +options.interval = 300; var tail_dhcp_log = new tail_module( glass_config.log_file, "\n", diff --git a/lib/render_template.js b/lib/render_template.js index b9d1792..955e848 100644 --- a/lib/render_template.js +++ b/lib/render_template.js @@ -11,7 +11,7 @@ module.exports = { } else { core = fs.readFileSync('./public/templates/index.html', 'utf8'); - core = core.replace(/\[application_name\]/, 'Glass - isc dhcp server utility'); + core = core.replace(/\[application_name\]/, 'Glass | ISC DHCP server utility'); core = core.replace(/\[body_content\]/, body_content); // core = core.replace(/\[(.*?)\]/, ""); return core; diff --git a/public/assets/js/glass-core.js b/public/assets/js/glass-core.js index 4ad0d3b..91c49da 100644 --- a/public/assets/js/glass-core.js +++ b/public/assets/js/glass-core.js @@ -106,4 +106,18 @@ function notification(text){ '' + '' }); -} \ No newline at end of file +} + +function change_favicon(img) { + var favicon = document.querySelector('link[rel="shortcut icon"]'); + + if (!favicon) { + favicon = document.createElement('link'); + favicon.setAttribute('rel', 'shortcut icon'); + var head = document.querySelector('head'); + head.appendChild(favicon); + } + + favicon.setAttribute('type', 'image/png'); + favicon.setAttribute('href', img); +} diff --git a/public/images/glass_logo.png b/public/images/glass_logo.png new file mode 100644 index 0000000..56f7f44 Binary files /dev/null and b/public/images/glass_logo.png differ diff --git a/public/images/user-img-background.jpg b/public/images/user-img-background.jpg new file mode 100644 index 0000000..3870108 Binary files /dev/null and b/public/images/user-img-background.jpg differ diff --git a/public/templates/index.html b/public/templates/index.html index f4bf9aa..a407c30 100644 --- a/public/templates/index.html +++ b/public/templates/index.html @@ -4,7 +4,7 @@
-