Change AdvConfig Warning Banner

Change the Advanced Configuration warning banner: slightly wider to 
distinguish from Alerts banner, add WARNING and make text color pure 
white for contrast.
This commit is contained in:
Steve Lewis AB7PA 2020-08-24 07:07:47 -07:00 committed by Joe AE6XE
parent 8ec57de248
commit b29ecbdbe2
1 changed files with 30 additions and 30 deletions

View File

@ -25,7 +25,7 @@
See AREDNLicense.txt for more info. See AREDNLicense.txt for more info.
Attributions to the AREDN Project must be retained in the source code. Attributions to the AREDN Project must be retained in the source code.
If importing this code into a new or existing project attribution If importing this code into a new or existing project attribution
to the AREDN project must be added to the source code. to the AREDN project must be added to the source code.
You must not misrepresent the origin of the material contained within. You must not misrepresent the origin of the material contained within.
@ -45,27 +45,27 @@ $| = 1;
# ---------------------------------------- ADVANCED CONFIG ALLOWED UCI VALUES ------------------ # ---------------------------------------- ADVANCED CONFIG ALLOWED UCI VALUES ------------------
@setting = (); @setting = ();
push @setting, { push @setting, {
key => "aredn.\@map[0].maptiles", key => "aredn.\@map[0].maptiles",
type => "string", type => "string",
desc => "Specifies the URL of the location to access map tiles", desc => "Specifies the URL of the location to access map tiles",
default => "http://stamen-tiles-{s}.a.ssl.fastly.net/terrain/{z}/{x}/{y}.jpg" default => "http://stamen-tiles-{s}.a.ssl.fastly.net/terrain/{z}/{x}/{y}.jpg"
}; };
push @setting, { push @setting, {
key => "aredn.\@map[0].leafletcss", key => "aredn.\@map[0].leafletcss",
type => "string", type => "string",
desc => "Specifies the URL of the leaflet.css file", desc => "Specifies the URL of the leaflet.css file",
default => "http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css" default => "http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css"
}; };
push @setting, { push @setting, {
key => "aredn.\@map[0].leafletjs", key => "aredn.\@map[0].leafletjs",
type => "string", type => "string",
desc => "Specifies the URL of the leaflet.js file", desc => "Specifies the URL of the leaflet.js file",
default => "http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.js" default => "http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.js"
}; };
push @setting, { push @setting, {
key => "aredn.\@downloads[0].firmwarepath", key => "aredn.\@downloads[0].firmwarepath",
type => "string", type => "string",
desc => "Specifies the URL of the location from which firmware files will be downloaded.", desc => "Specifies the URL of the location from which firmware files will be downloaded.",
default => "http://downloads.arednmesh.org/firmware" default => "http://downloads.arednmesh.org/firmware"
}; };
push @setting, { push @setting, {
@ -119,18 +119,18 @@ push @setting, {
}; };
push @setting, { push @setting, {
key => "aredn.\@poe[0].passthrough", key => "aredn.\@poe[0].passthrough",
type => "boolean", type => "boolean",
desc => "Specifies whether a PoE passthrough port should be on or off. (Not all devices have PoE passthrough ports.", desc => "Specifies whether a PoE passthrough port should be on or off. (Not all devices have PoE passthrough ports.",
default => "0", default => "0",
condition => "hasPOE()", condition => "hasPOE()",
postcallback => "setPOEOutput()" postcallback => "setPOEOutput()"
}; };
push @setting, { push @setting, {
key => "aredn.\@usb[0].passthrough", key => "aredn.\@usb[0].passthrough",
type => "boolean", type => "boolean",
desc => "Specifies whether the USB port should be on or off. (Not all devices have USB powered ports.", desc => "Specifies whether the USB port should be on or off. (Not all devices have USB powered ports.",
default => "1", default => "1",
postcallback => "setUSBOutput()", postcallback => "setUSBOutput()",
condition => "hasUSB()" condition => "hasUSB()"
}; };
@ -147,9 +147,9 @@ push @setting, {
postcallback => "aam_refresh()" postcallback => "aam_refresh()"
}; };
push @setting, { push @setting, {
key => "aredn.\@alerts[0].localpath", key => "aredn.\@alerts[0].localpath",
type => "string", type => "string",
desc => "Specifies the URL of the location from which local AREDN Alerts can be downloaded.", desc => "Specifies the URL of the location from which local AREDN Alerts can be downloaded.",
default => "" default => ""
}; };
@ -234,7 +234,7 @@ for($i=0;$i<$scount;$i++)
$newvalfield=eval "newval_" . $i; $newvalfield=eval "newval_" . $i;
$newval=$parms{$newvalfield}; $newval=$parms{$newvalfield};
$newval=~ s/^\s+|\s+$//; $newval=~ s/^\s+|\s+$//;
if ($setting[$i]->{'type'} eq "boolean") if ($setting[$i]->{'type'} eq "boolean")
{ {
if ($newval) if ($newval)
{ {
@ -255,11 +255,11 @@ for($i=0;$i<$scount;$i++)
# set "live" settings # set "live" settings
system("uci set '$key=$newval'"); system("uci set '$key=$newval'");
system("uci commit '$cfgfile'"); system("uci commit '$cfgfile'");
# set AREDN config settings (used after a "Save Settings" on the Setup page) # set AREDN config settings (used after a "Save Settings" on the Setup page)
system("uci -S -c /etc/config.mesh set '$key=$newval'"); system("uci -S -c /etc/config.mesh set '$key=$newval'");
system("uci -S -c /etc/config.mesh commit '$cfgfile'"); system("uci -S -c /etc/config.mesh commit '$cfgfile'");
push @msg, "Changed $key"; push @msg, "Changed $key";
# run postcallbacks # run postcallbacks
@ -278,7 +278,7 @@ html_header("$node Advanced Configuration", 1);
print "<body><center>\n"; print "<body><center>\n";
alert_banner(); alert_banner();
print "<div style=\"padding:5px;background-color:#FF0000;border:1px solid #ccc;width:600px;\">Changing these advanced settings can be harmful to the stability, security, and performance of this node and potentially the entire mesh network.<br><strong>You should only continue if you are sure of what you are doing.</strong></a></div>\n"; print "<div style=\"padding:5px;background-color:#FF0000;color:#FFFFFF;width:650px;\"><strong>WARNING:</strong> Changing advanced settings can be harmful to the stability, security, and performance of this node and potentially the entire mesh network.<br><strong>You should only continue if you are sure of what you are doing.</strong></div>\n";
print "<form method=post action=advancedconfig enctype='multipart/form-data'>\n"; print "<form method=post action=advancedconfig enctype='multipart/form-data'>\n";
print "<table width=790>\n"; print "<table width=790>\n";
print "<tr><td>\n"; print "<tr><td>\n";
@ -331,7 +331,7 @@ foreach(@setting)
<td>$sconfig</td> <td>$sconfig</td>
<td> <td>
EOF EOF
print "<input type='text' id='field_$scount' name='newval_$scount' size='65' value='$sval'>" if($setting[$scount]->{'type'} eq "string"); print "<input type='text' id='field_$scount' name='newval_$scount' size='65' value='$sval'>" if($setting[$scount]->{'type'} eq "string");
print "<input type='checkbox' id='field_$scount' name='newval_$scount' value='1' checked >" if($setting[$scount]->{'type'} eq "boolean" and $sval == 1 ); print "<input type='checkbox' id='field_$scount' name='newval_$scount' value='1' checked >" if($setting[$scount]->{'type'} eq "boolean" and $sval == 1 );
print "<input type='checkbox' id='field_$scount' name='newval_$scount' value='1'>" if($setting[$scount]->{'type'} eq "boolean" and $sval == 0 ); print "<input type='checkbox' id='field_$scount' name='newval_$scount' value='1'>" if($setting[$scount]->{'type'} eq "boolean" and $sval == 0 );
@ -344,7 +344,7 @@ EOF
<input value="Set to Default" type="button" onclick="document.getElementById('field_$scount').value='$setting[$scount]->{'default'}';"></td> <input value="Set to Default" type="button" onclick="document.getElementById('field_$scount').value='$setting[$scount]->{'default'}';"></td>
</tr> </tr>
EOF EOF
$scount++; $scount++;
} }
print "</table>\n"; print "</table>\n";