diff --git a/scripts/pi-hole/js/groups-adlists.js b/scripts/pi-hole/js/groups-adlists.js index 3d958833..d73eb4fc 100644 --- a/scripts/pi-hole/js/groups-adlists.js +++ b/scripts/pi-hole/js/groups-adlists.js @@ -33,44 +33,63 @@ $(function () { function format(data) { // Generate human-friendly status string var statusText = "Unknown"; + var PrintNumbers = true; if (data.status !== null) { switch (parseInt(data.status, 10)) { + case 0: + if(data.enabled === 0) { + statusText = 'List is disabled and not checked'; + } else { + statusText = 'List was not downloaded so far'; + } + PrintNumbers = false; + break; case 1: - statusText = "List download was successful (OK)"; + statusText = 'List download was successful (OK)'; break; case 2: - statusText = "List unchanged upstream, Pi-hole used a local copy (OK)"; + statusText = 'List unchanged upstream, Pi-hole used a local copy (OK)'; break; case 3: - statusText = "List unavailable, Pi-hole used a local copy"; + statusText = 'List unavailable, Pi-hole used a local copy (check list)'; break; case 4: statusText = - "List unavailable, there is no local copy of this list available on your Pi-hole"; + 'List unavailable, there is no local copy of this list available on your Pi-hole (replace list)'; + PrintNumbers = false; break; default: - statusText = "Unknown (" + parseInt(data.status, 10) + ")"; + statusText = 'Unknown (' + parseInt(data.status, 10) + ')'; break; } } // Compile extra info for displaying return ( - '
| Health status of this list: | " +
+ '
]HH:mm:ss z"; - return moment.unix(Math.floor(date)).format(format); + return moment.unix(Math.floor(date)).format(format).trim(); +} + +function datetimeRelative(date) { + return moment.unix(Math.floor(date)).fromNow(); } function disableAll() { @@ -331,6 +335,7 @@ window.utils = (function () { padNumber: padNumber, showAlert: showAlert, datetime: datetime, + datetimeRelative: datetimeRelative, disableAll: disableAll, enableAll: enableAll, validateIPv4CIDR: validateIPv4CIDR, diff --git a/style/pi-hole.css b/style/pi-hole.css index d60da7fb..df4b95d7 100644 --- a/style/pi-hole.css +++ b/style/pi-hole.css @@ -354,3 +354,7 @@ td.details-control { cursor: pointer; } + +.dataTables-child td { + padding: 2px 5px; +} |