diff --git a/groups-lists.lp b/groups-lists.lp
index 7671a5db..8aee83ba 100644
--- a/groups-lists.lp
+++ b/groups-lists.lp
@@ -73,6 +73,7 @@ mg.include('scripts/pi-hole/lua/header_authenticated.lp','r')
+
+ | Type of this list: | ${setTypeIcon(data.type)}${data.type}list |
+
+
+ | Health status of this list: | ${statusText} |
+
+
+ | This list was added to Pi-hole |
+ ${utils.datetimeRelative(data.date_added)} (${dateAddedISO}) |
+
+
+ | Database entry was last modified |
+ ${utils.datetimeRelative(data.date_modified)} (${dateModifiedISO}) |
+
+
+ | The list contents were last updated | ${dateUpdated} |
+
+
+ | Number of entries on this list: | ${numberOfEntries} |
+
+
+ | Number of non-domains on this list: | ${nonDomains} |
+
+
+ | Database ID of this list: | ${data.id} |
+
+
`;
+}
+
+// Define the status icon element
+function setStatusIcon(data) {
+ var statusCode = parseInt(data.status, 10),
+ statusTitle = setStatusText(data) + "\nClick for details about this list",
+ statusIcon;
+
+ switch (statusCode) {
+ case 1:
+ statusIcon = "fa-check-circle";
+ break;
+ case 2:
+ statusIcon = "fa-history";
+ break;
+ case 3:
+ statusIcon = "fa-exclamation-circle";
+ break;
+ case 4:
+ statusIcon = "fa-times-circle";
+ break;
+ default:
+ statusIcon = "fa-question-circle";
+ break;
+ }
+
+ return "" +
- '| Type of this list: | ' +
- data.type +
- 'list |
| Health status of this list: | ' +
- statusText +
- ' |
| This list was added to Pi-hole | ' +
- utils.datetimeRelative(data.date_added) +
- " (" +
- utils.datetime(data.date_added, false) +
- ') |
| Database entry was last modified | ' +
- utils.datetimeRelative(data.date_modified) +
- " (" +
- utils.datetime(data.date_modified, false) +
- ') |
| The list contents were last updated | ' +
- (data.date_updated > 0
- ? utils.datetimeRelative(data.date_updated) +
- " (" +
- utils.datetime(data.date_updated, false) +
- ")"
- : "N/A") +
- ' |
| Number of entries on this list: | ' +
- (data.number !== null && numbers === true
- ? parseInt(data.number, 10).toLocaleString()
- : "N/A") +
- (data.abp_entries !== null && parseInt(data.abp_entries, 10) > 0 && numbers === true
- ? " (out of which " + parseInt(data.abp_entries, 10).toLocaleString() + " are in ABP-style)"
- : "") +
- ' |
| Number of non-domains on this list: | " +
- "" +
- (data.invalid_domains !== null && numbers === true
- ? parseInt(data.invalid_domains, 10).toLocaleString()
- : "N/A") +
- ' |
| Database ID of this list: | ' +
- data.id +
- " |
"
- );
+ return statusText + (showdetails === true ? statusDetails : "");
+}
+
+// Define the type icon element
+function setTypeIcon(type) {
+ //Add red ban icon if data["type"] is "block"
+ //Add green check icon if data["type"] is "allow"
+ let iconClass = "fa-question text-orange",
+ title = "This list is of unknown type";
+ if (type === "block") {
+ iconClass = "fa-ban text-red";
+ title = "This is a blocklist";
+ } else if (type === "allow") {
+ iconClass = "fa-check text-green";
+ title = "This is an allowlist";
+ }
+
+ return `