configs are updating

This commit is contained in:
mcguirepr89
2022-02-24 14:11:54 -05:00
parent 10090f9411
commit 9d16d0245c
3 changed files with 21 additions and 27 deletions
+6 -16
View File
@@ -166,9 +166,7 @@ if (file_exists('/home/pi/BirdNET-Pi/thisrun.txt')) {
?>
<h2>Advanced Settings</h2>
<body>
<div class="row">
<div class="column first">
<form action="advanced.php" method="POST">
<form action="" method="POST">
<h3>Defaults</h3>
<label>Full Disk Behavior: </label>
<label for="purge">
@@ -212,8 +210,6 @@ foreach($formats as $format){
<p>This password protects the Live Audio Stream, the Processed extractions, phpSysInfo, your Tools, and WebTerminal. When you update this value, the web server will reload, so wait about 30 seconds and then reload the page.</p>
<label for="ice_pwd">Live Audio Stream: </label>
<input name="ice_pwd" type="text" value="<?php print($newconfig['ICE_PWD']);?>" required/><br>
</div>
<div class="column second">
<h3>Custom URLs</h3>
<p>When you update any of the URL settings below, the web server will reload, so be sure to wait at least 30 seconds and then reload the page.</p>
<label for="birdnetpi_url">BirdNET-Pi URL: </label>
@@ -236,24 +232,18 @@ foreach($formats as $format){
<input name="sensitivity" type="number" min="0.5" max="1.5" step="0.01" value="<?php print($newconfig['SENSITIVITY']);?>" required/><br>
<p>Min=0.5, Max=1.5</p>
<br><br>
<button type="submit" name="submit" class="block"><?php
<button type="submit" name="submit" value="advanced">
<?php
if(isset($_SESSION['success'])){
echo "Success!";
unset($_SESSION['success']);
} else {
echo "Update Settings";
}
?></button>
?> </button>
<br>
</form>
<form action="config.php">
<button type="submit" class="block">Basic Settings</button>
<form action="" method="POST">
<button type="submit" name="view" value="Settings">Basic Settings</button>
</form>
<br>
<form action="index.html">
<button type="submit" class="block">Tools</button>
</form>
</div>
</div>
</body>
+6 -4
View File
@@ -66,13 +66,16 @@ if (file_exists('/home/pi/BirdNET-Pi/thisrun.txt')) {
<option value="labels_uk.txt">Ukrainian</option>
</select>
<br><br>
<button type="submit" name="view" value="Settings"><?php
if(isset($_POST['status'])){
<input type="hidden" name="submit" value="settings">
<button type="submit" name="view" value="Settings">
<?php
if(isset($_POST['submit'])){
echo "Success!";
} else {
echo "Update Settings";
}
?></button>
?>
</button>
</form>
<form action="" method="POST">
<button type="submit" name="view" value="Advanced">Advanced Settings</button>
@@ -80,4 +83,3 @@ if(isset($_POST['status'])){
</div>
</div>
</body>
+2
View File
@@ -2,6 +2,7 @@
error_reporting(E_ALL);
ini_set('display_errors',1);
if(isset($_POST["latitude"])){
$latitude = $_POST["latitude"];
$longitude = $_POST["longitude"];
$birdweather_id = $_POST["birdweather_id"];
@@ -32,5 +33,6 @@ if ($language != "none"){
$command = "sudo -upi mv /home/pi/BirdNET-Pi/model/labels.txt /home/pi/BirdNET-Pi/model/labels.txt.old && sudo -upi unzip /home/pi/BirdNET-Pi/model/labels_l18n.zip $language -d /home/pi/BirdNET-Pi/model && sudo -upi mv /home/pi/BirdNET-Pi/model/$language /home/pi/BirdNET-Pi/model/labels.txt";
$command_output = `$command`;
}
}
?>