mirror of
https://github.com/pi-hole/web.git
synced 2024-12-06 19:36:21 +01:00
Adjust enbaled checkboxes on advanced settings tab
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -142,7 +142,8 @@ function initCheckboxRadioStyle() {
|
||||
}
|
||||
|
||||
var boxsheet = $('<link href="' + getCheckboxURL(chkboxStyle) + '" rel="stylesheet" />');
|
||||
boxsheet.appendTo("head");
|
||||
// Only add the stylesheet if it's not already present
|
||||
if ($("link[href='" + boxsheet.attr("href") + "']").length === 0) boxsheet.appendTo("head");
|
||||
|
||||
iCheckStyle = chkboxStyle;
|
||||
applyCheckboxRadioStyle();
|
||||
@@ -303,8 +304,13 @@ function updateSensorsInfo() {
|
||||
.done(function (data) {
|
||||
if (data.sensors.cpu_temp !== null) {
|
||||
var temp = data.sensors.cpu_temp.toFixed(1) + " °C";
|
||||
var color = data.sensors.cpu_temp > data.sensors.hot_limit ? "text-red fa-temperature-high" : "text-green-light fa-temperature-low";
|
||||
$("#temperature").html('<i class="fa fa-fw fas ' + color + '"></i> Temp: ' + temp);
|
||||
var color =
|
||||
data.sensors.cpu_temp > data.sensors.hot_limit
|
||||
? "text-red fa-temperature-high"
|
||||
: "text-green-light fa-temperature-low";
|
||||
$("#temperature").html(
|
||||
'<i class="fa fa-fw fas ' + color + '"></i> Temp: ' + temp
|
||||
);
|
||||
} else $("#temperature").html('<i class="fa fa-fw fas fa-temperature-low"></i> Temp: N/A');
|
||||
// Update every 20 seconds
|
||||
clearTimeout(sensorsTimer);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* This file is copyright under the latest version of the EUPL.
|
||||
* Please see LICENSE file for your rights under this license. */
|
||||
|
||||
/* global utils:false, apiFailure:false, initCheckboxRadioStyle:false */
|
||||
/* global utils:false, apiFailure:false, applyCheckboxRadioStyle:false */
|
||||
|
||||
var hostinfoTimer = null;
|
||||
function updateHostInfo() {
|
||||
@@ -262,13 +262,16 @@ function generateRow(topic, key, value) {
|
||||
|
||||
case "boolean": {
|
||||
row +=
|
||||
'<label class="col-sm-4 control-label">Enabled</label>' +
|
||||
'<div class="col-sm-8">' +
|
||||
'<div><input type="checkbox" ' +
|
||||
(value.value ? " checked" : "") +
|
||||
"> " +
|
||||
' id="' +
|
||||
key +
|
||||
'-checkbox"><label for="' +
|
||||
key +
|
||||
'-checkbox">Enabled ' +
|
||||
defaultValueHint +
|
||||
" </div></div>";
|
||||
"</label>" +
|
||||
" </div>";
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -391,7 +394,7 @@ function createDynamicConfigTabs() {
|
||||
});
|
||||
$("#advanced-overlay").hide();
|
||||
|
||||
initCheckboxRadioStyle();
|
||||
applyCheckboxRadioStyle();
|
||||
})
|
||||
.fail(function (data) {
|
||||
apiFailure(data);
|
||||
|
||||
Reference in New Issue
Block a user