From 5fd98d6ad0cd5bd8c1358f0139cd3854661138a2 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Wed, 13 Sep 2017 23:17:52 -0500 Subject: [PATCH] Dashboard visual adjustments --- public/templates/display_subnets.html | 1 - public/templates/shared_networks.html | 1 - routes/get_stats.js | 19 +++++++++---------- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/public/templates/display_subnets.html b/public/templates/display_subnets.html index 064b3ff..6a34822 100644 --- a/public/templates/display_subnets.html +++ b/public/templates/display_subnets.html @@ -15,7 +15,6 @@ Used Size Free - % Utilization diff --git a/public/templates/shared_networks.html b/public/templates/shared_networks.html index ec48bdb..4f362dd 100644 --- a/public/templates/shared_networks.html +++ b/public/templates/shared_networks.html @@ -14,7 +14,6 @@ Used Size Free - % Utilization diff --git a/routes/get_stats.js b/routes/get_stats.js index 7bb3b39..bf75d86 100644 --- a/routes/get_stats.js +++ b/routes/get_stats.js @@ -28,14 +28,14 @@ router.get('/', function(req, res, next) { shared_networks = ''; for ( var i = 0; i < dhcp_data['shared-networks'].length; i++) { - table_row = ''; - table_row = table_row + '' + dhcp_data['shared-networks'][i].location + ''; - table_row = table_row + '' + dhcp_data['shared-networks'][i].used.toLocaleString('en') + ''; - table_row = table_row + '' + dhcp_data['shared-networks'][i].defined.toLocaleString('en') + ''; - table_row = table_row + '' + dhcp_data['shared-networks'][i].free.toLocaleString('en') + ''; + utilization = dhcp_data['shared-networks'][i].utilization; - table_row = table_row + '' + utilization + ''; + table_row = ''; + table_row = table_row + '' + dhcp_data['shared-networks'][i].location + ''; + table_row = table_row + '' + dhcp_data['shared-networks'][i].used.toLocaleString('en') + ' (' + utilization + '%)'; + table_row = table_row + '' + dhcp_data['shared-networks'][i].defined.toLocaleString('en') + ''; + table_row = table_row + '' + dhcp_data['shared-networks'][i].free.toLocaleString('en') + ''; utilization_color = 'green'; @@ -67,16 +67,15 @@ router.get('/', function(req, res, next) { display_subnets = ''; for ( var i = 0; i < dhcp_data.subnets.length; i++) { + utilization = dhcp_data.subnets[i].utilization; + table_row = ''; table_row = table_row + '' + dhcp_data.subnets[i].location + ''; table_row = table_row + '' + dhcp_data.subnets[i].range + ''; - table_row = table_row + '' + dhcp_data.subnets[i].used.toLocaleString('en') + ''; + table_row = table_row + '' + dhcp_data.subnets[i].used.toLocaleString('en') + ' (' + utilization + '%)'; table_row = table_row + '' + dhcp_data.subnets[i].defined.toLocaleString('en') + ''; table_row = table_row + '' + dhcp_data.subnets[i].free.toLocaleString('en') + ''; - utilization = dhcp_data.subnets[i].utilization; - table_row = table_row + '' + utilization + ''; - utilization_color = 'green'; if(utilization >= 80)