consolidated reboot and save buttons (#3581)

* config page: consolidated reboot and save button

* various pages: consolidated reboot and save button

---------

Co-authored-by: CaCO3 <caco@ruinelli.ch>
This commit is contained in:
CaCO3
2025-02-24 23:05:32 +01:00
committed by GitHub
parent 8f5bf209d9
commit 8ddbda16bf
8 changed files with 170 additions and 154 deletions

View File

@@ -183,7 +183,19 @@
color: white;
transform: translate(-50%,-50%);
-ms-transform: translate(-50%,-50%);
}
}
#reboot_button {
float: none;
background-color: #f44336;
color: white;
padding: 5px;
border-radius:
5px; font-weight: bold;
text-align: center;
text-decoration: none;
display: inline-block;
}
</style>
<link rel="stylesheet" href="mkdocs_theme.css?v=$COMMIT_HASH" />
@@ -2110,14 +2122,9 @@
</tr>
</table>
<table style="padding-top:10px">
<td>
<button class="button" onclick="saveTextAsFile()">Save Config</button>
</td>
<td>
<button class="button" id="reboot" type="button" onclick="doReboot()">Reboot to activate changes</button>
</td>
</table>
<hr>
<button class="button" onclick="saveTextAsFile()">Save Config</button>
</div>
@@ -2673,18 +2680,16 @@ function saveTextAsFile() {
return;
}
if (confirm("Are you sure you want to save the configuration?")) {
ReadParameterAll();
WriteConfigININew();
SaveConfigToServer(domainname);
ReadParameterAll();
WriteConfigININew();
SaveConfigToServer(domainname);
firework.launch('Configuration saved. It will get applied after the next reboot!', 'success', 5000);
firework.launch('Configuration saved. It will get applied after the next reboot!<br><br>\n<a id="reboot_button" onclick="doReboot()">reboot now</a>', 'success', 5000);
if (changeCamValue == 1) {
camSettingsSet();
firework.launch('You have changed the camera settings, so creating a new reference image and updating the alignment marks is mandatory!', 'success', 10000);
}
}
if (changeCamValue == 1) {
camSettingsSet();
firework.launch('You have changed the camera settings, creating a new reference image and updating the alignment marks is mandatory!', 'success', 5000);
}
}
function camSettingsSet(){
@@ -2875,7 +2880,7 @@ function camSettingsSet(){
if (xhttp.responseText == "CamSettingsSet") {
document.getElementById("overlay").style.display = "none";
firework.launch('Cam Settings saved', 'success', 2000);
firework.launch('Cam Settings saved', 'success', 5000);
return;
}
else {
@@ -2903,13 +2908,11 @@ function camSettingsSet(){
}
function doReboot() {
if (confirm("Are you sure you want to reboot?")) {
var stringota = domainname + "/reboot";
window.location = stringota;
window.location.href = stringota;
window.location.assign(stringota);
window.location.replace(stringota);
}
var stringota = domainname + "/reboot";
window.location = stringota;
window.location.href = stringota;
window.location.assign(stringota);
window.location.replace(stringota);
}
function FormatDecimalValue(_param, _cat, _name) {