refining some forms and chaning FULL_DISK to words settings

This commit is contained in:
mcguirepr89
2022-01-31 16:00:02 -05:00
parent f75cd9afe3
commit 11c09dd9f4
7 changed files with 53 additions and 373 deletions
+29 -2
View File
@@ -1,5 +1,20 @@
<?php
error_reporting(E_ALL);
ini_set('display_errors',1);
?>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
/* Firefox */
input[type=number] {
-moz-appearance: textfield;
}
* {
font-family: 'Arial', 'Gill Sans', 'Gill Sans MT',
' Calibri', 'Trebuchet MS', 'sans-serif';
@@ -84,14 +99,26 @@ input {
<div class="column first">
<form action="write_advanced.php" method="POST">
<?php
if (file_exists('/home/pi/BirdNET-Pi/thisrun.txt')) {
$config = parse_ini_file('/home/pi/BirdNET-Pi/thisrun.txt');
} elseif (file_exists('/home/pi/BirdNET-Pi/firstrun.ini')) {
$config = parse_ini_file('/home/pi/BirdNET-Pi/firstrun.ini');
} ?>
<h3>Defaults</h3>
<label for="full_disk">Full Disk Behavior: </label>
<input name="full_disk" type="text" value="<?php print($config['FULL_DISK']);?>" required/><br>
<label>Full Disk Behavior: </label>
<label style="width:30%;" for="purge">
<input style="width:15%;" name="full_disk" type="radio" id="purge" value="purge"
<?php
if (strcmp($config['FULL_DISK'], "purge") == 0) {
echo "checked";
}?>>Purge</label>
<label style="width:30%;" for="keep">
<input style="width:15%" name="full_disk" type="radio" id="keep" value="keep"
<?php
if (strcmp($config['FULL_DISK'], "keep") == 0) {
echo "checked";
}?>>Keep</label>
<label for="rec_card">Audio Card: </label>
<input name="rec_card" type="text" value="<?php print($config['REC_CARD']);?>" required/><br>
<label for="channels">Audio Channels: </label>
+14 -2
View File
@@ -1,5 +1,16 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
/* Firefox */
input[type=number] {
-moz-appearance: textfield;
}
* {
font-family: 'Arial', 'Gill Sans', 'Gill Sans MT',
' Calibri', 'Trebuchet MS', 'sans-serif';
@@ -104,9 +115,9 @@ if (file_exists('/home/pi/BirdNET-Pi/thisrun.txt')) {
$config = parse_ini_file('/home/pi/BirdNET-Pi/firstrun.ini');
} ?>
<label for="latitude">Latitude: </label>
<input name="latitude" type="text" value="<?php print($config['LATITUDE']);?>" required/><br>
<input name="latitude" type="number" max="90" min="-90" step="0.0001" value="<?php print($config['LATITUDE']);?>" required/><br>
<label for="longitude">Longitude: </label>
<input name="longitude" type="text" value="<?php print($config['LONGITUDE']);?>" required/><br>
<input name="longitude" type="number" max="180" min="-180" step="0.0001" value="<?php print($config['LONGITUDE']);?>" required/><br>
<label for="birdweather_id">BirdWeather ID: </label>
<input name="birdweather_id" type="text" value="<?php print($config['BIRDWEATHER_ID']);?>" /><br>
<label for="pushed_app_key">Pushed App Key: </label>
@@ -167,3 +178,4 @@ if(isset($_SESSION['success'])){
</div>
</div>
</body>
<input type="reset" form=">
+4 -4
View File
@@ -6,19 +6,19 @@ if [ "${used//%}" -ge 95 ]; then
source /etc/birdnet/birdnet.conf
case $FULL_DISK in
0) echo "Removing oldest data"
purge) echo "Removing oldest data"
rm -drfv "$(find ${EXTRACTED}/By_Date/* -maxdepth 1 -type d -prune \
| sort -r | tail -n1)";;
*) echo "Stopping Core Services"
keep) echo "Stopping Core Services"
/usr/local/bin/stop_core_services.sh;;
esac
fi
sleep 1
if [ "${used//%}" -ge 95 ]; then
case $FULL_DISK in
0) echo "Removing more data"
purge) echo "Removing more data"
rm -rfv ${PROCESSED}/*;;
*) echo "Stopping Core Services"
keep) echo "Stopping Core Services"
/usr/local/bin/stop_core_services.sh;;
esac
fi
+3 -3
View File
@@ -344,10 +344,10 @@ SENSITIVITY=${SENSITIVITY}
CHANNELS=${CHANNELS}
## FULL_DISK can be set to configure how the system reacts to a full disk
## 0 = Remove the oldest day's worth of recordings
## 1 = Keep all data and 'stop_core_services.sh'
## purge = Remove the oldest day's worth of recordings
## keep = Keep all data and 'stop_core_services.sh'
FULL_DISK=0
FULL_DISK=purge
## VENV is the virtual environment where the the BirdNET python build is found,
## i.e, VENV is the virtual environment miniforge built for BirdNET.
+3 -3
View File
@@ -11,10 +11,10 @@ if ! grep FULL_DISK ${birdnet_conf};then
cat << EOF >> ${birdnet_conf}
## FULL_DISK can be set to configure how the system reacts to a full disk
## 0 = Remove the oldest day's worth of recordings
## 1 = Keep all data and `stop_core_services.sh`
## purge = Remove the oldest day's worth of recordings
## keep = Keep all data and `stop_core_services.sh`
FULL_DISK=0
FULL_DISK=purge
EOF
fi