diff --git a/scripts/pi-hole/js/groups-adlists.js b/scripts/pi-hole/js/groups-adlists.js index f7a5a206..4b6bec03 100644 --- a/scripts/pi-hole/js/groups-adlists.js +++ b/scripts/pi-hole/js/groups-adlists.js @@ -35,6 +35,11 @@ $.fn.redraw = function(){ }); }; +function datetime(date) +{ + return moment.unix(Math.floor(date)).format("Y-MM-DD HH:mm:ss z"); +} + $(document).ready(function() { $('#btnAdd').on('click', addAdlist); @@ -61,8 +66,8 @@ $(document).ready(function() { $('.deleteAdlist').on('click', deleteAdlist); }, "rowCallback": function( row, data ) { - $('td:eq(0)', row).html( ''+data["address"]+'' ); - + const tooltip = 'Added: '+datetime(data["date_added"])+'\nLast modified: '+datetime(data["date_modified"]); + $('td:eq(0)', row).html( ''+data["address"]+'' ); const disabled = data["enabled"] === 0; $('td:eq(1)', row).html( ''); diff --git a/scripts/pi-hole/js/groups-domains.js b/scripts/pi-hole/js/groups-domains.js index b05cf59c..ac611e82 100644 --- a/scripts/pi-hole/js/groups-domains.js +++ b/scripts/pi-hole/js/groups-domains.js @@ -35,9 +35,15 @@ $.fn.redraw = function(){ }); }; +function datetime(date) +{ + return moment.unix(Math.floor(date)).format("Y-MM-DD HH:mm:ss z"); +} + $(document).ready(function() { $('#btnAdd').on('click', addDomain); + $( function() { $( document ).tooltip(); } ); get_groups(); @@ -62,7 +68,8 @@ $(document).ready(function() { $('.deleteDomain').on('click', deleteDomain); }, "rowCallback": function( row, data ) { - $('td:eq(0)', row).html( ''+data["domain"]+'' ); + const tooltip = 'Added: '+datetime(data["date_added"])+'\nLast modified: '+datetime(data["date_modified"]); + $('td:eq(0)', row).html( ''+data["domain"]+'' ); $('td:eq(1)', row).html( '