1
0
mirror of https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks.git synced 2025-09-09 07:30:57 +02:00

Adding reboot redirection on control page

This commit is contained in:
gysmo38
2020-05-28 08:47:09 +02:00
committed by Julian Tatsch
parent 0518e44c6c
commit 1470b6ca6c
2 changed files with 14 additions and 24 deletions

View File

@@ -49,27 +49,16 @@
</div>
<p></p>
</div>
<div id="confirm_box" class="w3-modal">
<!-- modal windows-->
<div id="modal_box" class="w3-modal">
<div class="w3-modal-content">
<header class="w3-container w3-theme">
<span onclick="document.getElementById('confirm_box').style.display='none'"
<span onclick="document.getElementById('modal_box').style.display='none'"
class="w3-button w3-display-topright">&times;</span>
<h2 id="confirm_title"></h2>
<h2 id="modal_title"></h2>
</header>
<div class="w3-container">
<p id="confirm_content">Waiting ...</p>
</div>
</div>
</div>
<div id="configure_box" class="w3-modal">
<div class="w3-modal-content">
<header class="w3-container w3-theme">
<span onclick="document.getElementById('configure_box').style.display='none'"
class="w3-button w3-display-topright">&times;</span>
<h2 id="configure_title"></h2>
</header>
<div class="w3-container">
<p id="configure_content">Waiting ...</p>
<p id="modal_content">Waiting ...</p>
</div>
</div>
</div>

View File

@@ -114,9 +114,9 @@ function start(branch,mode) {
// login = "login=" + $('#login').val() + ":" + $('#password').val();
// }
//Open modal window
document.getElementById('confirm_box').style.display='block'
$('#confirm_title').html('Update in progress');
$('#confirm_content').html('<h4>Please note: at the end of this process the camera will reboot without notice</h4> \
document.getElementById('modal_box').style.display='block'
$('#modal_title').html('Update in progress');
$('#modal_content').html('<h4>Please note: at the end of this process the camera will reboot without notice</h4> \
<div class="w3-light-grey"><div id="progress" class="w3-container w3-theme" style="width:0%"><span id="progressValue">0%</span></div></div><br><h4 id=message></h4>');
var url = 'cgi-bin/action.cgi?cmd=update&release='+branch+'&mode='+mode;
@@ -129,7 +129,7 @@ function start(branch,mode) {
if (result.length > 0) {
update(false);
} else {
$('#confrim_content').text("Error starting update progress");
$('#modal_content').text("Error starting update progress");
}
});
}
@@ -197,14 +197,15 @@ function getServices() {
function system(command) {
//Open modal window
document.getElementById('confirm_box').style.display='block'
$('#confirm_title').html(command);
document.getElementById('modal_box').style.display='block'
$('#modal_title').html(command);
if (command == "reboot") {
$('#confirm_content').html("Waiting for camera to reboot...");
$('#modal_content').html("<h4 id=message></h4>");
timedRefresh(45);
$.get("cgi-bin/action.cgi?cmd=reboot");
}
else {
$('#confirm_content').html("Camera shutting down...");
$('#modal_content').html("Camera shutting down...");
$.get("cgi-bin/action.cgi?cmd=shutdown");
}
}