mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-11 14:07:00 +03:00
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:
@@ -79,6 +79,18 @@
|
|||||||
transform: translate(-50%,-50%);
|
transform: translate(-50%,-50%);
|
||||||
-ms-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>
|
</style>
|
||||||
|
|
||||||
<link href="firework.css?v=$COMMIT_HASH" rel="stylesheet">
|
<link href="firework.css?v=$COMMIT_HASH" rel="stylesheet">
|
||||||
@@ -188,14 +200,12 @@
|
|||||||
param;
|
param;
|
||||||
|
|
||||||
function doReboot() {
|
function doReboot() {
|
||||||
if (confirm("Are you sure you want to reboot? Did you save your changes?")) {
|
|
||||||
var stringota = domainname + "/reboot";
|
var stringota = domainname + "/reboot";
|
||||||
window.location = stringota;
|
window.location = stringota;
|
||||||
window.location.href = stringota;
|
window.location.href = stringota;
|
||||||
window.location.assign(stringota);
|
window.location.assign(stringota);
|
||||||
window.location.replace(stringota);
|
window.location.replace(stringota);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function ChangeSelection(){
|
function ChangeSelection(){
|
||||||
aktindex = parseInt(document.getElementById("index").value);
|
aktindex = parseInt(document.getElementById("index").value);
|
||||||
@@ -215,7 +225,6 @@
|
|||||||
document.getElementById("overlay").style.display = "block";
|
document.getElementById("overlay").style.display = "block";
|
||||||
document.getElementById("overlaytext").innerHTML = "Save Alignment Marker...";
|
document.getElementById("overlaytext").innerHTML = "Save Alignment Marker...";
|
||||||
|
|
||||||
if (confirm("Are you sure you want to save the new alignment marker configuration?")) {
|
|
||||||
function sleep(ms) {
|
function sleep(ms) {
|
||||||
return new Promise(resolve => setTimeout(resolve, ms));
|
return new Promise(resolve => setTimeout(resolve, ms));
|
||||||
}
|
}
|
||||||
@@ -246,7 +255,7 @@
|
|||||||
EnDisableItem(false, "enhancecontrast", true);
|
EnDisableItem(false, "enhancecontrast", true);
|
||||||
|
|
||||||
document.getElementById("overlay").style.display = "none";
|
document.getElementById("overlay").style.display = "none";
|
||||||
firework.launch('Alignment marker saved. They will get applied after next reboot', 'success', 5000);
|
firework.launch('Alignment marker saved. They will get applied after the next reboot!<br><br>\n<a id="reboot_button" onclick="doReboot()">reboot now</a>', 'success', 5000);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -256,10 +265,6 @@
|
|||||||
task();
|
task();
|
||||||
}, 1);
|
}, 1);
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
document.getElementById("overlay").style.display = "none";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function EnhanceContrast() {
|
function EnhanceContrast() {
|
||||||
document.getElementById("overlay").style.display = "block";
|
document.getElementById("overlay").style.display = "block";
|
||||||
|
|||||||
@@ -5,6 +5,20 @@
|
|||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<title>Analog ROI</title>
|
<title>Analog ROI</title>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
#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 href="edit_style.css" rel="stylesheet">
|
<link href="edit_style.css" rel="stylesheet">
|
||||||
<link href="firework.css?v=$COMMIT_HASH" rel="stylesheet">
|
<link href="firework.css?v=$COMMIT_HASH" rel="stylesheet">
|
||||||
|
|
||||||
@@ -185,14 +199,12 @@ The following settings are only used for easier setup, they are <b>not</b> persi
|
|||||||
domainname = getDomainname();
|
domainname = getDomainname();
|
||||||
|
|
||||||
function doReboot() {
|
function doReboot() {
|
||||||
if (confirm("Are you sure you want to reboot? Did you save your changes?")) {
|
|
||||||
var stringota = getDomainname() + "/reboot";
|
var stringota = getDomainname() + "/reboot";
|
||||||
window.location = stringota;
|
window.location = stringota;
|
||||||
window.location.href = stringota;
|
window.location.href = stringota;
|
||||||
window.location.assign(stringota);
|
window.location.assign(stringota);
|
||||||
window.location.replace(stringota);
|
window.location.replace(stringota);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function EnDisableAnalog() {
|
function EnDisableAnalog() {
|
||||||
isEnabled = document.getElementById("Category_Analog_enabled").checked;
|
isEnabled = document.getElementById("Category_Analog_enabled").checked;
|
||||||
@@ -331,7 +343,6 @@ The following settings are only used for easier setup, they are <b>not</b> persi
|
|||||||
}
|
}
|
||||||
|
|
||||||
function SaveToConfig() {
|
function SaveToConfig() {
|
||||||
if (confirm("Are you sure you want to save the new analog ROI configuration?")) {
|
|
||||||
//_zwcat = getConfigCategory();
|
//_zwcat = getConfigCategory();
|
||||||
cofcat["Analog"]["enabled"] = document.getElementById("Category_Analog_enabled").checked;
|
cofcat["Analog"]["enabled"] = document.getElementById("Category_Analog_enabled").checked;
|
||||||
WriteConfigININew();
|
WriteConfigININew();
|
||||||
@@ -339,8 +350,7 @@ The following settings are only used for easier setup, they are <b>not</b> persi
|
|||||||
UpdateROIs();
|
UpdateROIs();
|
||||||
document.getElementById("saveroi").disabled = true;
|
document.getElementById("saveroi").disabled = true;
|
||||||
|
|
||||||
firework.launch('Configuration saved. It will get applied after 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);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function ShowMultiplier() {
|
function ShowMultiplier() {
|
||||||
|
|||||||
@@ -20,6 +20,18 @@
|
|||||||
textarea {
|
textarea {
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#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>
|
</style>
|
||||||
|
|
||||||
<link href="firework.css?v=$COMMIT_HASH" rel="stylesheet">
|
<link href="firework.css?v=$COMMIT_HASH" rel="stylesheet">
|
||||||
@@ -38,15 +50,8 @@
|
|||||||
</td>
|
</td>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<table>
|
<hr>
|
||||||
<td>
|
|
||||||
<button class="button" onclick="saveTextAsFile()">Save Config</button>
|
<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>
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript" src="readconfigparam.js?v=$COMMIT_HASH"></script>
|
<script type="text/javascript" src="readconfigparam.js?v=$COMMIT_HASH"></script>
|
||||||
<script type="text/javascript" src="readconfigcommon.js?v=$COMMIT_HASH"></script>
|
<script type="text/javascript" src="readconfigcommon.js?v=$COMMIT_HASH"></script>
|
||||||
@@ -64,24 +69,20 @@
|
|||||||
|
|
||||||
function saveTextAsFile()
|
function saveTextAsFile()
|
||||||
{
|
{
|
||||||
if (confirm("Are you sure you want to save the configuration?")) {
|
|
||||||
FileDeleteOnServer("/config/config.ini", domainname);
|
FileDeleteOnServer("/config/config.ini", domainname);
|
||||||
var textToSave = document.getElementById("inputTextToSave").value;
|
var textToSave = document.getElementById("inputTextToSave").value;
|
||||||
FileSendContent(textToSave, "/config/config.ini", domainname);
|
FileSendContent(textToSave, "/config/config.ini", domainname);
|
||||||
|
|
||||||
firework.launch('Configuration saved. It will get applied after 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);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function doReboot() {
|
function doReboot() {
|
||||||
if (confirm("Are you sure you want to reboot?")) {
|
|
||||||
var stringota = "/reboot";
|
var stringota = "/reboot";
|
||||||
window.location = stringota;
|
window.location = stringota;
|
||||||
window.location.href = stringota;
|
window.location.href = stringota;
|
||||||
window.location.assign(stringota);
|
window.location.assign(stringota);
|
||||||
window.location.replace(stringota);
|
window.location.replace(stringota);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
LoadConfigNeu();
|
LoadConfigNeu();
|
||||||
|
|
||||||
|
|||||||
@@ -184,6 +184,18 @@
|
|||||||
transform: translate(-50%,-50%);
|
transform: translate(-50%,-50%);
|
||||||
-ms-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>
|
</style>
|
||||||
|
|
||||||
<link rel="stylesheet" href="mkdocs_theme.css?v=$COMMIT_HASH" />
|
<link rel="stylesheet" href="mkdocs_theme.css?v=$COMMIT_HASH" />
|
||||||
@@ -2110,14 +2122,9 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<table style="padding-top:10px">
|
<hr>
|
||||||
<td>
|
|
||||||
<button class="button" onclick="saveTextAsFile()">Save Config</button>
|
<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>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@@ -2673,17 +2680,15 @@ function saveTextAsFile() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (confirm("Are you sure you want to save the configuration?")) {
|
|
||||||
ReadParameterAll();
|
ReadParameterAll();
|
||||||
WriteConfigININew();
|
WriteConfigININew();
|
||||||
SaveConfigToServer(domainname);
|
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) {
|
if (changeCamValue == 1) {
|
||||||
camSettingsSet();
|
camSettingsSet();
|
||||||
firework.launch('You have changed the camera settings, so creating a new reference image and updating the alignment marks is mandatory!', 'success', 10000);
|
firework.launch('You have changed the camera settings, creating a new reference image and updating the alignment marks is mandatory!', 'success', 5000);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2875,7 +2880,7 @@ function camSettingsSet(){
|
|||||||
|
|
||||||
if (xhttp.responseText == "CamSettingsSet") {
|
if (xhttp.responseText == "CamSettingsSet") {
|
||||||
document.getElementById("overlay").style.display = "none";
|
document.getElementById("overlay").style.display = "none";
|
||||||
firework.launch('Cam Settings saved', 'success', 2000);
|
firework.launch('Cam Settings saved', 'success', 5000);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -2903,13 +2908,11 @@ function camSettingsSet(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
function doReboot() {
|
function doReboot() {
|
||||||
if (confirm("Are you sure you want to reboot?")) {
|
|
||||||
var stringota = domainname + "/reboot";
|
var stringota = domainname + "/reboot";
|
||||||
window.location = stringota;
|
window.location = stringota;
|
||||||
window.location.href = stringota;
|
window.location.href = stringota;
|
||||||
window.location.assign(stringota);
|
window.location.assign(stringota);
|
||||||
window.location.replace(stringota);
|
window.location.replace(stringota);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function FormatDecimalValue(_param, _cat, _name) {
|
function FormatDecimalValue(_param, _cat, _name) {
|
||||||
|
|||||||
@@ -4,6 +4,19 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<title>Digit ROI</title>
|
<title>Digit ROI</title>
|
||||||
|
<style>
|
||||||
|
#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 href="edit_style.css" rel="stylesheet">
|
<link href="edit_style.css" rel="stylesheet">
|
||||||
<link href="firework.css?v=$COMMIT_HASH" rel="stylesheet">
|
<link href="firework.css?v=$COMMIT_HASH" rel="stylesheet">
|
||||||
@@ -204,14 +217,12 @@
|
|||||||
domainname = getDomainname();
|
domainname = getDomainname();
|
||||||
|
|
||||||
function doReboot() {
|
function doReboot() {
|
||||||
if (confirm("Are you sure you want to reboot? Did you save your changes?")) {
|
|
||||||
var stringota = getDomainname() + "/reboot";
|
var stringota = getDomainname() + "/reboot";
|
||||||
window.location = stringota;
|
window.location = stringota;
|
||||||
window.location.href = stringota;
|
window.location.href = stringota;
|
||||||
window.location.assign(stringota);
|
window.location.assign(stringota);
|
||||||
window.location.replace(stringota);
|
window.location.replace(stringota);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function EnDisableDigits() {
|
function EnDisableDigits() {
|
||||||
isEnabled = document.getElementById("Category_Digits_enabled").checked;
|
isEnabled = document.getElementById("Category_Digits_enabled").checked;
|
||||||
@@ -359,7 +370,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function SaveToConfig() {
|
function SaveToConfig() {
|
||||||
if (confirm("Are you sure you want to save the new digit ROI configuration?")) {
|
|
||||||
// _zwcat = getConfigCategory();
|
// _zwcat = getConfigCategory();
|
||||||
cofcat["Digits"]["enabled"] = document.getElementById("Category_Digits_enabled").checked;
|
cofcat["Digits"]["enabled"] = document.getElementById("Category_Digits_enabled").checked;
|
||||||
WriteConfigININew();
|
WriteConfigININew();
|
||||||
@@ -367,8 +377,7 @@
|
|||||||
UpdateROIs();
|
UpdateROIs();
|
||||||
document.getElementById("saveroi").disabled = true;
|
document.getElementById("saveroi").disabled = true;
|
||||||
|
|
||||||
firework.launch('Configuration saved. It will get applied after 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);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function ShowMultiplier() {
|
function ShowMultiplier() {
|
||||||
|
|||||||
@@ -402,16 +402,6 @@
|
|||||||
param,
|
param,
|
||||||
category;
|
category;
|
||||||
|
|
||||||
function doReboot() {
|
|
||||||
if (confirm("Are you sure you want to reboot? Did you save the config?")) {
|
|
||||||
var stringota = domainname + "/reboot";
|
|
||||||
window.location = stringota;
|
|
||||||
window.location.href = stringota;
|
|
||||||
window.location.assign(stringota);
|
|
||||||
window.location.replace(stringota);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function cameraParameterChanged() {
|
function cameraParameterChanged() {
|
||||||
document.getElementById("savereferenceimage").disabled = true;
|
document.getElementById("savereferenceimage").disabled = true;
|
||||||
|
|
||||||
@@ -738,7 +728,7 @@
|
|||||||
|
|
||||||
if (xhttp.responseText == "CamSettingsSet") {
|
if (xhttp.responseText == "CamSettingsSet") {
|
||||||
document.getElementById("overlay").style.display = "none";
|
document.getElementById("overlay").style.display = "none";
|
||||||
firework.launch('Cam Settings saved', 'success', 2000);
|
firework.launch('Cam Settings saved', 'success', 5000);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -34,13 +34,11 @@ p {font-size: 1em;}
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
function doReboot() {
|
function doReboot() {
|
||||||
// if (confirm("Are you sure you want to reboot the ESP32?")) {
|
|
||||||
var stringota = getDomainname() + "/reboot";
|
var stringota = getDomainname() + "/reboot";
|
||||||
window.location = stringota;
|
window.location = stringota;
|
||||||
window.location.href = stringota;
|
window.location.href = stringota;
|
||||||
window.location.assign(stringota);
|
window.location.assign(stringota);
|
||||||
window.location.replace(stringota);
|
window.location.replace(stringota);
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
// var xhttp = new XMLHttpRequest();
|
// var xhttp = new XMLHttpRequest();
|
||||||
// xhttp.onreadystatechange = function() {if (xhttp.readyState == 4) {if (xhttp.status == 200) {document.reload();}}};
|
// xhttp.onreadystatechange = function() {if (xhttp.readyState == 4) {if (xhttp.status == 200) {document.reload();}}};
|
||||||
if (!file.name.includes("remote-setup")){
|
if (!file.name.includes("remote-setup")){
|
||||||
if (!confirm("The zip file name should contain \"...remote-setup...\". Are you sure that you have downloaded the correct file?"))
|
if (!confirm("The zip file name should contain \"...remote-setup...\". Are you sure you have downloaded the correct file?"))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@ if (!file.name.includes("remote-setup")){
|
|||||||
var file = document.getElementById("newfile").files[0];
|
var file = document.getElementById("newfile").files[0];
|
||||||
if (!file.name.includes("remote-setup"))
|
if (!file.name.includes("remote-setup"))
|
||||||
{
|
{
|
||||||
if (!confirm("The zip file name should contain \"...remote-setup...\". Are you sure that you have downloaded the correct file?"))
|
if (!confirm("The zip file name should contain \"...remote-setup...\". Are you sure you have downloaded the correct file?"))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user