diff --git a/bin/dhcp_lease.pl b/bin/dhcp_utility.pl
similarity index 99%
rename from bin/dhcp_lease.pl
rename to bin/dhcp_utility.pl
index 54c8f34..15f1a60 100644
--- a/bin/dhcp_lease.pl
+++ b/bin/dhcp_utility.pl
@@ -1,5 +1,7 @@
#!/usr/bin/perl
+#::: Chris Miles - Utility script
+
use POSIX qw(strftime);
my $output_format = 'human';
diff --git a/public/templates/dhcp_leases.html b/public/templates/dhcp_leases.html
index e31e58f..2056320 100644
--- a/public/templates/dhcp_leases.html
+++ b/public/templates/dhcp_leases.html
@@ -14,7 +14,7 @@
Hostname |
Start |
End |
- Options |
+ Option Data |
@@ -33,4 +33,17 @@
"pageLength": 100,
"aaSorting": []
});
-
\ No newline at end of file
+
+ $('.option_data').click(function(){
+ var lease = $(this).attr("lease");
+ if ( $("#" + lease).is(":visible") ) {
+ $("#" + lease).hide();
+ $(this).text('Show');
+ } else if ( $("#" + lease).is(":hidden") ) {
+ $("#" + lease).show();
+ $(this).text('Hide');
+ }
+ })
+
+
+
diff --git a/routes/dhcp_leases.js b/routes/dhcp_leases.js
index 39f38fa..99076eb 100644
--- a/routes/dhcp_leases.js
+++ b/routes/dhcp_leases.js
@@ -20,6 +20,7 @@ router.get('/', function(req, res, next) {
table_data = '';
+ var count = 0;
for (var key in dhcp_lease_data) {
table_row = '';
@@ -28,9 +29,18 @@ router.get('/', function(req, res, next) {
table_row = table_row + '' + (dhcp_lease_data[key].host ? dhcp_lease_data[key].host : '') + ' | ';
table_row = table_row + '' + human_time(dhcp_lease_data[key].start * 1000) + ' | ';
table_row = table_row + '' + human_time(dhcp_lease_data[key].end * 1000) + ' | ';
- table_row = table_row + '' + | ';
+ table_row = table_row + '' +
+ '' +
+ '' + JSON.stringify(dhcp_lease_data[key].options, null, 2) + ' ' +
+ ' | ';
table_data = table_data + '' + table_row + '
';
+
+ count++;
+
+ if(count > 30){
+ break;
+ }
}
table_data = template_render.set_template_variable(dhcp_leases, "table_data", table_data);