From 44e1a9b8cd69358e803a7553e87518289e671f52 Mon Sep 17 00:00:00 2001 From: RD WebDesign Date: Wed, 17 Jan 2024 19:17:41 -0300 Subject: [PATCH] Move code used to format icons to a dedicated function also surround the icons with a SPAN tag. Signed-off-by: RD WebDesign --- scripts/pi-hole/js/settings-advanced.js | 26 ++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/scripts/pi-hole/js/settings-advanced.js b/scripts/pi-hole/js/settings-advanced.js index 9f73bf74..a2dd44f8 100644 --- a/scripts/pi-hole/js/settings-advanced.js +++ b/scripts/pi-hole/js/settings-advanced.js @@ -24,6 +24,22 @@ function addAllowedValues(allowed) { } } +function boxIcons(value) { + return ( + '' + + (value.modified + ? '  ' + : "") + + (value.flags.restart_dnsmasq + ? '  ' + : "") + + (value.flags.env_var + ? '  ' + : "") + + "" + ); +} + function generateRow(topic, key, value) { // If the value is an object, we need to recurse if (!("description" in value)) { @@ -44,15 +60,7 @@ function generateRow(topic, key, value) { (value.modified ? "true" : "false") + '">' + key + - (value.modified - ? '  ' - : "") + - (value.flags.restart_dnsmasq - ? '  ' - : "") + - (value.flags.env_var - ? '  ' - : "") + + boxIcons(value) + "" + "

" + utils.escapeHtml(value.description).replaceAll("\n", "
") +