Adjust enbaled checkboxes on advanced settings tab

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2023-02-09 18:22:45 +01:00
parent eeceea6d10
commit 6d07f9bb2b
2 changed files with 18 additions and 9 deletions
+9 -3
View File
@@ -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) + "&thinsp;&deg;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>&nbsp;Temp:&nbsp;' + 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>&nbsp;Temp:&nbsp;' + temp
);
} else $("#temperature").html('<i class="fa fa-fw fas fa-temperature-low"></i>&nbsp;Temp:&nbsp;N/A');
// Update every 20 seconds
clearTimeout(sensorsTimer);
+9 -6
View File
@@ -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);