Skip to content

Commit

Permalink
keep settings checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
okdzhimiev committed Feb 15, 2017
1 parent bc8e369 commit a2ab5a9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/update/update_nand.php
Expand Up @@ -251,12 +251,15 @@ function remove(){
$flash_list = verify(false);
backup();
nandflash($flash_list);
copy_backup();
if (isset($_GET['restore'])) copy_backup();
break;
case "backup":
backup();
send_backup();
break;
case "restore":
copy_backup();
break;
case "remove":
remove();
break;
Expand Down
3 changes: 3 additions & 0 deletions src/update/update_software.html
Expand Up @@ -38,6 +38,9 @@ <h2 id='title' style='padding-left:10px;'>Update software:</h2>
<span id='btn_flash' class="btn btn-danger"><b>Flash</b></span>
<span style='padding-left:10px;'><a href='var/flash.log'>flash.log</a></span>
</div>
<div style='padding-left:10px;'>
<span>Keep old settings:</span> <input type='checkbox' id='chk_restore' style='width:20px;height:20px;position:relative;top:3px;' checked >
</div>
<div style='padding:10px;'>
<div id='status' class='blink'></div>
</div>
Expand Down
6 changes: 5 additions & 1 deletion src/update/update_software.js
Expand Up @@ -67,10 +67,14 @@ function init(){
});

$('#btn_flash').click(function(){

var restore = "";
if ($("#chk_restore").prop("checked")) restore="&restore";

$("#status").html("Flashing...");
blink_intvl = setInterval(blink,1000);
$.ajax({
url: "update_nand.php?cmd=flash",
url: "update_nand.php?cmd=flash"+restore,
success: function(result){
clearInterval(blink_intvl);
$("#status").html(result);
Expand Down

0 comments on commit a2ab5a9

Please sign in to comment.