add restore to views and system_controls

This commit is contained in:
frederik
2024-11-15 19:17:25 +01:00
committed by Nachtzuster
parent 0cdde2fd93
commit 1c43dfc6cd
2 changed files with 71 additions and 3 deletions
+7 -2
View File
@@ -13,6 +13,8 @@ $config = get_config();
$color_scheme = get_color_scheme();
set_timezone();
$restore = "cat $home/BirdSongs/restore.log";
if(is_authenticated() && (!isset($_SESSION['behind']) || !isset($_SESSION['behind_time']) || time() > $_SESSION['behind_time'] + 86400)) {
shell_exec("sudo -u".$user." git -C ".$home."/BirdNET-Pi fetch > /dev/null 2>/dev/null &");
$str = trim(shell_exec("sudo -u".$user." git -C ".$home."/BirdNET-Pi status"));
@@ -71,7 +73,9 @@ elseif ($config["LONGITUDE"] == "0.000") {
<button type="button" href="javascript:void(0);" class="icon" onclick="myFunction()"><img src="images/menu.png"></button>
</div>
</form>
<script type="text/javascript" src="static/plupload.full.min.js"></script>
<!--<script type="text/javascript" src="static/moxie.js"></script>
<script type="text/javascript" src="static/plupload.dev.js"></script>-->
<script>
window.onload = function() {
var elements = document.querySelectorAll("button[name=view]");
@@ -283,7 +287,8 @@ if(isset($_GET['view'])){
'sudo reboot',
'update_birdnet.sh',
'sudo shutdown now',
'sudo clear_all_data.sh');
'sudo clear_all_data.sh',
"$restore");
$command = $_GET['submit'];
if(in_array($command,$allowedCommands)){
if(isset($command)){