mirror of
https://github.com/pi-hole/web.git
synced 2025-12-24 12:48:29 +00:00
Move code used to format icons to a dedicated function
also surround the icons with a SPAN tag. Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
This commit is contained in:
@@ -24,6 +24,22 @@ function addAllowedValues(allowed) {
|
||||
}
|
||||
}
|
||||
|
||||
function boxIcons(value) {
|
||||
return (
|
||||
'<span class="box-icons">' +
|
||||
(value.modified
|
||||
? ' <i class="far fa-edit text-light-blue" title="Modified from default"></i>'
|
||||
: "") +
|
||||
(value.flags.restart_dnsmasq
|
||||
? ' <i class="fas fa-redo text-orange" title="Setting requires FTL restart on change"></i>'
|
||||
: "") +
|
||||
(value.flags.env_var
|
||||
? ' <i class="fas fa-lock text-orange" title="Settings overwritten by an environmental variable are read-only"></i>'
|
||||
: "") +
|
||||
"</span>"
|
||||
);
|
||||
}
|
||||
|
||||
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
|
||||
? ' <i class="far fa-edit text-light-blue" title="Modified from default"></i>'
|
||||
: "") +
|
||||
(value.flags.restart_dnsmasq
|
||||
? ' <i class="fas fa-redo text-orange" title="Setting requires FTL restart on change"></i>'
|
||||
: "") +
|
||||
(value.flags.env_var
|
||||
? ' <i class="fas fa-lock text-orange" title="Settings overwritten by an environmental variable are read-only"></i>'
|
||||
: "") +
|
||||
boxIcons(value) +
|
||||
"</h3>" +
|
||||
"<p>" +
|
||||
utils.escapeHtml(value.description).replaceAll("\n", "<br>") +
|
||||
|
||||
Reference in New Issue
Block a user