From 4a29d93a2fc963d35c49bd42b05bce465ade7082 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Mon, 11 May 2020 01:11:24 +0200 Subject: [PATCH] Add support for SUBNET messages. Signed-off-by: DL6ER --- scripts/pi-hole/js/messages.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/pi-hole/js/messages.js b/scripts/pi-hole/js/messages.js index ce0674b5..5c935ea9 100644 --- a/scripts/pi-hole/js/messages.js +++ b/scripts/pi-hole/js/messages.js @@ -19,12 +19,19 @@ function render_timestamp(data, type) { return data; } +function multline(input) { + return input.split(",").join("\n"); +} + function render_message(data, type, row) { // Display and search content switch (row["type"]) { case "REGEX": return "Encountered an error when processing " + row["blob1"] + " regex filter with ID " + row["blob3"] + ":
"+row["blob2"]+"
Error message:
"+row["message"]+"
"; - + + case "SUBNET": + return "Client "+row["message"]+" is managed by "+row["blob1"]+" groups (database IDs ["+row["blob3"]+"]):
"+multline(row["blob2"])+"
" + + "FTL chose the most recent entry
"+row["blob4"]+"
to get the group configuration for this client."; default: return "Unknown message type
" + JSON.stringify(row) + "
"; }