Merge branch 'newif' of github.com:mcguirepr89/BirdNET-Pi into newif

This commit is contained in:
mcguirepr89
2022-02-25 11:54:00 -05:00
20 changed files with 113 additions and 1205 deletions
-60
View File
@@ -1,60 +0,0 @@
<html>
<head>
<title>HTML Frames Example - Content</title>
<style type="text/css">
body {
font-family:verdana,arial,sans-serif;
font-size:10pt;
margin:30px;
background-color:#ffcc00;
}
</style>
</head>
<body>
tbc....
<h1>Thanks</h1>
stefan kahl
patrick mcguire
<h1>Similar Systems</h1>
<h1>Technical Details</h1>
machine learning
deep learning
<h1>Used Tools</h1>
SoX
ffmpeg
Python
Tensorfflow (Lite)
Rasberian OS
<h1>Disclaimer</h1>
<h1>Other Systems</h1>
links to other systems
<h1>Content</h1>
<h2>Replacing the Contents of the Current Frame</h2>
<p>Clicking on these links will open the new page within the current frame.</p>
<ul>
<li><a href="white.html" target="content">Load white page</a></li>
<li><a href="green.html" target="content">Load green page</a></li>
</ul>
<h2>Replacing the Whole Frameset</h2>
<p>When you click on any of the following links, the whole frameset is replaced with the new website. This is because we're using <code>target="_top"</code> in the anchor links.</p>
<ul>
<li><a href="http://www.quackit.com" target="_top">Quackit</a></li>
<li><a href="http://www.quackit.com/html/templates/frames/" target="_top">HTML Frames Templates</a></li>
<li>Learn more about frames with the <a href="http://www.quackit.com/html/tutorial/html_frames.cfm" target="_top">frames tutorial</a><//li>
</ul>
<h2>Open a New Window</h2>
<p>These links open in a new browser window. This is because we use <code>target="_blank"</code>.</p>
<ul>
<li><a href="http://www.code-generator.net" target="_blank">Code Generator</a></li>
<li><a href="http://www.zappyhost.com" target="_blank">ZappyHost</a></li>
<li><a href="http://www.natural-environment.com" target="_blank">Natural Environment</a></li>
<li><a href="http://www.great-workout.com" target="_blank">Great Workout</a></li>
</ul>
</body>
</html>
-22
View File
@@ -1,22 +0,0 @@
<html>
<head>
<title>HTML Frames Example - Footer</title>
<style type="text/css">
body {
font-family:verdana,arial,sans-serif;
font-size:medium;
padding-top: 15px;
text-align:center;
background-color: rgb(119, 196, 135);
color: black;
}
a {
color:black;
}
</style>
</head>
<body>
<a href="/stream" target="footer"><h4>Play Live Audio</h4></a>
</p>
</body>
</html>
-42
View File
@@ -1,42 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>BirdNET-Pi</title>
<style>
* {
background-color: background-color: rgb(119, 196, 135);
}
</style>
</head>
<!--
Note the following:
1. Each frame has it's own 'frame' tag.
2. Each frame has a name (eg, name="menu"). This is used for when you need to load one frame from another. For example, your left frame might have links that, when clicked on, loads a new page in the right frame. This is acheived by using 'target="content"' within your links/anchor tags.
3. Each 'frame' tag has a 'src' attribute. This is where you specify the name of the file to be loaded into that frame when the page first loads.
4. You can change the size of the frames by changing the value of the 'cols' and/or 'rows' attribute. A value of "200" sets the frame at 200 pixels. An asterisk (*) specifies that the frame should use up whatever space is left over from the other frames. You can also use percentage values if desired (i.e. 20%,80%)
5. To specify a border, set 'frameborder' and 'border' to "1". I included both attributes for maximum browser compatibility.
6. The 'framespacing' attribute doesn't work in all browsers, but you can set any numeric value you like here.
7. To learn more about HTML frames, check out: http://www.quackit.com/html/tutorial/html_frames.cfm
-->
<script type="text/javascript">
if (screen.width <= 699) {
document.location = "/mobile.html";
}
</script>
<frameset rows="100,*" frameborder="0" border="0" framespacing="0">
<frameset style="background-color: rgb(119, 196, 135);" cols="*,150" frameborder="0" border="0" framespacing="0" />
<frame name="topNav" src="top.html" scrolling="off">
<frame name="footer" src="footer.html" scrolling="off">
</frameset>
<frameset cols="150,*" frameborder="0" border="0" framespacing="0">
<frame name="menu" src="menu.html" marginheight="0" marginwidth="0" scrolling="auto" noresize>
<frame name="content" src="/overview.php" marginheight="0" marginwidth="0" scrolling="auto" noresize>
<noframes>
<p>This section (everything between the 'noframes' tags) will only be displayed if the users' browser doesn't support frames. You can provide a link to a non-frames version of the website here. Feel free to use HTML tags within this section.</p>
</noframes>
</frameset>
</html>
+77 -31
View File
@@ -25,13 +25,68 @@ foreach($pages as $page){
echo $response;
}
if(isset($_POST['view'])){
if($_POST['view'] == "System"){header('location:phpsysinfo/index.php');}
if($_POST['view'] == "Spectrogram"){include('spectrogram.php');}
if($_POST['view'] == "Overview"){include('overview.php');}
if($_POST['view'] == "Database"){include('viewdb.php');}
if($_POST['view'] == "Included"){
if(isset($_POST['species']) && isset($_POST['add'])){
$file='/home/pi/BirdNET-Pi/include_species_list.txt';
$str=file_get_contents("$file");
$str = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $str);
file_put_contents("$file", "$str");
if(isset($_POST['species'])){
foreach ($_POST['species'] as $selectedOption)
file_put_contents("/home/pi/BirdNET-Pi/include_species_list.txt", $selectedOption."\n", FILE_APPEND);
}
} elseif(isset($_POST['species']) && isset($_POST['del'])){
$file = '/home/pi/BirdNET-Pi/include_species_list.txt';
$str = file_get_contents("$file");
$str = preg_replace('/^\h*\v+/m', '', $str);
file_put_contents("$file", "$str");
foreach($_POST['species'] as $selectedOption) {
$content = file_get_contents("/home/pi/BirdNET-Pi/include_species_list.txt");
$newcontent = str_replace($selectedOption, "", "$content");
file_put_contents("/home/pi/BirdNET-Pi/include_species_list.txt", "$newcontent");
}
$file = '/home/pi/BirdNET-Pi/include_species_list.txt';
$str = file_get_contents("$file");
$str = preg_replace('/^\h*\v+/m', '', $str);
file_put_contents("$file", "$str");
}
include('scripts/include_list.php');
}
if($_POST['view'] == "Excluded"){
if(isset($_POST['species']) && isset($_POST['add'])){
$file = '/home/pi/BirdNET-Pi/exclude_species_list.txt';
$str = file_get_contents("$file");
$str = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $str);
file_put_contents("$file", "$str");
foreach ($_POST['species'] as $selectedOption)
file_put_contents("/home/pi/BirdNET-Pi/exclude_species_list.txt", $selectedOption."\n", FILE_APPEND);
} elseif (isset($_POST['species']) && isset($_POST['del'])){
$file = '/home/pi/BirdNET-Pi/exclude_species_list.txt';
$str = file_get_contents("$file");
$str = preg_replace('/^\h*\v+/m', '', $str);
file_put_contents("$file", "$str");
foreach($_POST['species'] as $selectedOption) {
$content = file_get_contents("/home/pi/BirdNET-Pi/exclude_species_list.txt");
$newcontent = str_replace($selectedOption, "", "$content");
file_put_contents("/home/pi/BirdNET-Pi/exclude_species_list.txt", "$newcontent");
}
$file = '/home/pi/BirdNET-Pi/exclude_species_list.txt';
$str = file_get_contents("$file");
$str = preg_replace('/^\h*\v+/m', '', $str);
file_put_contents("$file", "$str");
}
include('scripts/exclude_list.php');
}
if($_POST['view'] == "Species Stats"){
include('stats.php');
if(isset($_POST['species'])){
$data = [ 'species' => $_POST['species'] ];
httpPost('/stats.php', $data);}
$data = [ 'species' => $_POST['species'] ];
httpPost('/stats.php', $data);
}
}
if($_POST['view'] == "History"){
include('history.php');
@@ -42,40 +97,32 @@ if(isset($_POST['view'])){
echo "<form action=\"\" method=\"POST\">
<button type=\"submit\" name=\"view\" value=\"Settings\">Settings</button>
<button type=\"submit\" name=\"view\" value=\"System\">System Info</button>
</form>";
<button type=\"submit\" name=\"view\" value=\"Included\">Custom Species List</button>
<button type=\"submit\" name=\"view\" value=\"Excluded\">Excluded Species List</button>
</form>";
}
if($_POST['view'] == "Live Stream"){
echo "<div class=\"stream\"><audio controls autoplay><source src=\"/stream\" type=\"audio/mpeg\"></audio></div>";}
echo "<audio controls autoplay><source src=\"/stream\" type=\"audio/mpeg\"></audio>";}
if($_POST['view'] == "Extractions"){
include('play.php');
$data = [];
httpPost('/play.php', $data);}
while($_POST['view'] == "Spectrogram"){
ob_start();
$time = time();
echo str_pad("<img src=\"/spectrogram.png?nocache=$time\">", '4096');
ob_flush();
flush();
sleep($config['RECORDING_LENGTH']);
ob_clean();
ob_end_clean();
ob_end_flush();}
if($_POST['view'] == "Settings"){
if(isset($_POST['submit'])){
$data = [
'latitude' => $_POST["latitude"],
'longitude' => $_POST["longitude"],
'birdweather_id' => $_POST["birdweather_id"],
'pushed_app_key' => $_POST["pushed_app_key"],
'pushed_app_secret' => $_POST["pushed_app_secret"],
'language' => $_POST["language"],
'submit' => $_POST["submit"],
];
$url = $_SERVER['HTTP_REFERER'];
httpPost("$url/scripts/update_config.php", $data);
}
include('scripts/config.php');
}
if($_POST['view'] == "Settings"){
if(isset($_POST['submit'])){
$data = [
'latitude' => $_POST["latitude"],
'longitude' => $_POST["longitude"],
'birdweather_id' => $_POST["birdweather_id"],
'pushed_app_key' => $_POST["pushed_app_key"],
'pushed_app_secret' => $_POST["pushed_app_secret"],
'language' => $_POST["language"],
'submit' => $_POST["submit"],
];
$url = $_SERVER['HTTP_REFERER'];
httpPost("$url/scripts/update_config.php", $data);
}
include('scripts/config.php');
}
if($_POST['view'] == "Advanced"){
if(isset($_POST['submit'])){
$data = [
@@ -100,7 +147,6 @@ if(isset($_POST['view'])){
}
include('scripts/advanced.php');
}
if($_POST['view'] == "System"){header('location:phpsysinfo/index.php');}
if($_POST['view'] == "Log"){
$url = 'http://birdnetpi.local:8080';
header("location: $url;");}
-92
View File
@@ -1,92 +0,0 @@
<html>
<head>
<title>HTML Frames Example - Menu</title>
<style type="text/css">
a {
text-decoration:none;
margin: 0px 0px 0px 0px;
color:black;
font-size: small;
}
body {
font-family:verdana,arial,sans-serif;
font-size:medium;
margin:10px;
background-color: rgb(119, 196, 135);
text-align: left;
padding-bottom: 30px;
}
form {
padding:0;
margin:0;
}
h3 {
margin: 0px 0px -15px 0px;
text-align: center;
}
h4,h5 {
text-align: left;
margin: 0px 0px 5px 0px;
}
footer {
background: rgb(119, 196, 135);
position: fixed;
padding-top: 10px;
left: 0;
bottom: 0;
width:100%;
}
button {
background-color: transparent;
font-size:small;
border:none;
cursor:pointer;
}
hr {
border-bottom: 1px solid black;
}
body::-webkit-scrollbar {
display:none
}
</style>
</head>
<body>
<h5>Extractions</h5>
<form action="/play.php" method="POST" target="content">
- <button type="submit" name="bydate" value="bydate">By Date</button>
</form>
<form action="/play.php" method="POST" target="content">
- <button type="submit" name="byspecies" value="byspecies">By Species</button>
</form>
- <a href="/Processed/" target="content">Processed</a><br>
<hr class="solid">
<h5>System</h5>
- <a href="/scripts/" target="content">Tools</a><br>
- <a href="/phpsysinfo/" target="content">Info</a><br>
- <a href="http://birdnetpi.local:8080" target="content">Log</a><br>
<hr class="solid">
<h5>External</h5>
- <a href="https://app.birdweather.com" target="_content">BirdWeather</a><br>
- <a href="https://github.com/mcguirepr89/BirdNET-Pi/wiki" target="_content">Wiki Help Page</a><br>
- <a href="https://v2.wttr.in/35.2916,-80.8201" target="content">Wttr.in Report</a><br>
- <a href="https://birdnet.cornell.edu" target="_content">BirdNET</a><br>
<hr class="solid">
<h5>Other<br>BirdNET-Pis</h5>
- <a href="https://birdnetpi.pmcgui.xyz" target="top">United States</a><br>
- <a href="https://birds.naturestation.net" target="top">South Africa</a><br>
- <a href="https://birdnet.svardsten.se" target="top">Sweden</a><br>
- <a href="https://birdnetgv.ddnss.de" target="top">Germany</a>
</body>
<footer style="font-size: small;">
Icon by <a target="_content" style="font-weight: bold" href="https://www.freepik.com" title="Freepik">Freepik</a> from <a target="_content" style="font-weight: bold" href="https://www.flaticon.com/" title="Flaticon">Flaticon.com</a>
</footer>
</html>
-80
View File
@@ -1,80 +0,0 @@
<html>
<head>
<title>Menu</title>
<style type="text/css">
a {
text-decoration:none;
margin: 0px 0px 0px 0px;
color:black;
font-size: small;
}
body {
font-family:verdana,arial,sans-serif;
font-size:medium;
margin:10px;
background-color: rgb(119, 196, 135);
text-align: left;
padding-bottom: 30px;
}
h3 {
margin: 0px 0px -15px 0px;
text-align: center;
}
h4,h5 {
text-align: center;
margin: 0px 0px 5px 0px;
}
footer {
background: rgb(119, 196, 135);
position: fixed;
padding-top: 10px;
left: 0;
bottom: 0;
width:100%;
}
hr {
border-bottom: 1px solid black;
}
body::-webkit-scrollbar {
display:none
}
</style>
</head>
<body>
<h5>Extraktionen</h5>
- <a href="https://birdnetpi.local/By_Date/" target="content">Nach Datum</a><br>
- <a href="https://birdnetpi.local/By_Common_Name/" target="content">Nach Namen</a><br>
- <a href="https://birdnetpi.local/By_Scientific_Name/" target="content">Nach wiss. Namen</a><br>
- <a href="https://birdnetpi.local/Processed/" target="content">Verarbeitet</a><br>
<hr class="solid">
<h5>System-Links</h5>
- <a href="https://birdnetpi.local/scripts/" target="content">Tools</a><br>
- <a href="https://birdnetpi.local/phpsysinfo/" target="content">System Info</a><br>
- <a href="https://birdnetpi.local:8080" target="content">BirdNET-Lite Log</a><br>
- <a href="https://birdnetpi.local:8888" target="content">Extraction Log</a><br>
<hr class="solid">
<h5>Externe Links</h5>
- <a href="https://app.birdweather.com" target="_content">BirdWeather</a><br>
- <a href="https://github.com/mcguirepr89/BirdNET-Pi" target="_content">Repository</a><br>
- <a href="https://github.com/mcguirepr89/BirdNET-Pi/wiki" target="_content">Wiki Hilfe-Seite</a><br>
- <a href="https://v2.wttr.in/" target="content">Wttr.in Report</a><br>
- <a href="https://birdnet.cornell.edu" target="_content">BirdNET @ Cornell</a><br>
<hr class="solid">
<h5>Andere<br>BirdNET-Pis</h5>
- <a href="https://birdnetpi.pmcgui.xyz" target="_content">United States</a><br>
- <a href="https://birds.naturestation.net" target="_content">South Africa</a><br>
- <a href="https://birdnet.svarsten.se" target="_content">Sweden</a>
- <a href="https://birdnetgv.ddnss.de" target="_content">Germany</a>
</body>
<footer style="font-size: small;">
Icon by <a target="_content" style="font-weight: bold" href="https://www.freepik.com" title="Freepik">Freepik</a> from <a target="_content" style="font-weight: bold" href="https://www.flaticon.com/" title="Flaticon">Flaticon.com</a>
</footer>
</html>
-509
View File
@@ -1,509 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>BirdNET-Pi</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
* { padding: 0; margin: 0; }
body {
font-family: sans-serif;
text-rendering: optimizespeed;
background-color: #ffffff;
}
a {
color: #006ed3;
text-decoration: none;
}
a:hover,
h1 a:hover {
color: #319cff;
}
header,
#summary {
padding-left: 5%;
padding-right: 5%;
}
th:first-child,
td:first-child {
width: 5%;
}
th:last-child,
td:last-child {
width: 5%;
}
header {
padding-top: 25px;
padding-bottom: 10px;
background-color: #eef;
font-family: Georgia, serif;
}
h1 {
font-size: 34px;
font-weight: normal;
white-space: nowrap;
overflow-x: hidden;
text-overflow: ellipsis;
color: #999;
}
h2 {
padding-left: 5%;
font-size: 18px;
margin-bottom: 8px;
margin-top: 12px;
font-weight: normal;
white-space: nowrap;
overflow-x: hidden;
text-overflow: ellipsis;
color: #999;
}
h1 a {
color: #005;
margin: 0 4px;
}
h1 a:hover {
text-decoration: underline;
}
h1 a:first-child {
margin: 0;
}
.meta {
font-size: 12px;
font-family: Trebuchet, sans-serif;
border-bottom: 1px solid #9C9C9C;
padding-top: 10px;
padding-bottom: 10px;
}
.meta-item {
margin-right: 1em;
}
#filter {
padding: 4px;
border: 1px solid #CCC;
}
table {
width: 100%;
border-collapse: collapse;
}
tr {
border-bottom: 1px dashed #dadada;
}
tbody tr:hover {
background-color: #ffffec;
}
th,
td {
text-align: left;
padding: 10px 0;
}
th {
padding-top: 15px;
padding-bottom: 15px;
font-size: 16px;
white-space: nowrap;
}
th a {
color: black;
}
th svg {
vertical-align: middle;
}
td {
white-space: nowrap;
font-size: 14px;
}
td:nth-child(2) {
width: 100%;
}
td:nth-child(3),
th:nth-child(3) {
#padding: 0 20px 0 20px;
width: 0px;
}
th:nth-child(4),
td:nth-child(4) {
text-align: right;
}
td:nth-child(2) svg {
position: absolute;
}
td .name,
td .goup {
margin-left: 1.75em;
word-break: break-all;
overflow-wrap: break-word;
white-space: pre-wrap;
}
.icon {
margin-right: 5px;
}
.icon.sort {
display: inline-block;
width: 1em;
height: 1em;
position: relative;
top: .2em;
}
.icon.sort .top {
position: absolute;
left: 0;
top: -1px;
}
.icon.sort .bottom {
position: absolute;
bottom: -1px;
left: 0;
}
footer {
padding: 40px 20px;
font-size: 12px;
text-align: center;
}
@media (max-width: 600px) {
.hideable {
display: none;
}
td:nth-child(2) {
width: auto;
}
th:nth-child(3),
td:nth-child(3) {
padding-right: 5%;
text-align: right;
}
h1 {
color: #000;
}
h1 a {
margin: 0;
}
#filter {
max-width: 100px;
}
}
@media (prefers-color-scheme: dark) {
body {
background-color: #101010;
color: #dddddd;
}
header {
background-color: #151515;
}
tbody tr:hover {
background-color: #252525;
}
header a,
th a {
color: #dddddd;
}
a {
color: #5796d1;
text-decoration: none;
}
a:hover,
h1 a:hover {
color: #62b2fd;
}
tr {
border-bottom: 1px dashed rgba(255, 255, 255, 0.15);
}
#up-arrow,
#down-arrow {
fill: #dddddd;
}
#filter {
background-color: #151515;
color: #ffffff;
border: 1px solid #212121;
}
.meta {
border-bottom: 1px solid #212121
}
}
</style>
</head>
<body onload='initFilter()'>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" height="0" width="0" style="position: absolute;">
<defs>
<!-- Folder -->
<g id="folder" fill-rule="nonzero" fill="none">
<path d="M285.22 37.55h-142.6L110.9 0H31.7C14.25 0 0 16.9 0 37.55v75.1h316.92V75.1c0-20.65-14.26-37.55-31.7-37.55z" fill="#FFA000"/>
<path d="M285.22 36H31.7C14.25 36 0 50.28 0 67.74v158.7c0 17.47 14.26 31.75 31.7 31.75H285.2c17.44 0 31.7-14.3 31.7-31.75V67.75c0-17.47-14.26-31.75-31.7-31.75z" fill="#FFCA28"/>
</g>
<g id="folder" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="folder-group" fill-rule="nonzero">
<g id="folder-shape">
<path d="M285.224876,37.5486902 L142.612438,37.5486902 L110.920785,0 L31.6916529,0 C14.2612438,0 0,16.8969106 0,37.5486902 L0,112.646071 L316.916529,112.646071 L316.916529,75.0973805 C316.916529,54.4456008 302.655285,37.5486902 285.224876,37.5486902 Z" id="Shape" fill="#FFA000"></path>
<path d="M285.224876,36 L31.6916529,36 C14.2612438,36 0,50.2838568 0,67.7419039 L0,226.451424 C0,243.909471 14.2612438,258.193328 31.6916529,258.193328 L285.224876,258.193328 C302.655285,258.193328 316.916529,243.909471 316.916529,226.451424 L316.916529,67.7419039 C316.916529,50.2838568 302.655285,36 285.224876,36 Z" id="Shape" fill="#FFCA28"></path>
</g>
<path d="M126.154134,250.559184 C126.850974,251.883673 127.300549,253.006122 127.772602,254.106122 C128.469442,255.206122 128.919016,256.104082 129.638335,257.002041 C130.559962,258.326531 131.728855,259 133.100057,259 C134.493737,259 135.415364,258.55102 136.112204,257.67551 C136.809044,257.002041 137.258619,255.902041 137.258619,254.577551 C137.258619,253.904082 137.258619,252.804082 137.033832,251.457143 C136.786566,249.908163 136.561779,249.032653 136.561779,248.583673 C136.089726,242.814286 135.864939,237.920408 135.864939,233.273469 C135.864939,225.057143 136.786566,217.514286 138.180246,210.846939 C139.798713,204.202041 141.889234,198.634694 144.429328,193.763265 C147.216689,188.869388 150.678411,184.873469 154.836973,181.326531 C158.995535,177.779592 163.626149,174.883673 168.481552,172.661224 C173.336954,170.438776 179.113983,168.665306 185.587852,167.340816 C192.061722,166.218367 198.760378,165.342857 205.481514,164.669388 C212.18017,164.220408 219.598146,163.995918 228.162535,163.995918 L246.055591,163.995918 L246.055591,195.514286 C246.055591,197.736735 246.752431,199.510204 248.370899,201.059184 C250.214153,202.608163 252.079886,203.506122 254.372715,203.506122 C256.463236,203.506122 258.531277,202.608163 260.172223,201.059184 L326.102289,137.797959 C327.720757,136.24898 328.642384,134.47551 328.642384,132.253061 C328.642384,130.030612 327.720757,128.257143 326.102289,126.708163 L260.172223,63.4469388 C258.553756,61.8979592 256.463236,61 254.395194,61 C252.079886,61 250.236632,61.8979592 248.393377,63.4469388 C246.77491,64.9959184 246.07807,66.7693878 246.07807,68.9918367 L246.07807,100.510204 L228.162535,100.510204 C166.863084,100.510204 129.166282,117.167347 115.274437,150.459184 C110.666301,161.54898 108.350993,175.310204 108.350993,191.742857 C108.350993,205.279592 113.903236,223.912245 124.760454,247.438776 C125.00772,248.112245 125.457294,249.010204 126.154134,250.559184 Z" id="Shape" fill="#FFFFFF" transform="translate(218.496689, 160.000000) scale(-1, 1) translate(-218.496689, -160.000000) "></path>
</g>
</g>
<!-- File -->
<g id="file" stroke="#000" stroke-width="25" fill="#FFF" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round">
<path d="M13 24.12v274.76c0 6.16 5.87 11.12 13.17 11.12H239c7.3 0 13.17-4.96 13.17-11.12V136.15S132.6 13 128.37 13H26.17C18.87 13 13 17.96 13 24.12z"/>
<path d="M129.37 13L129 113.9c0 10.58 7.26 19.1 16.27 19.1H249L129.37 13z"/>
</g>
<g id="file-shortcut" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="file-shortcut-group" transform="translate(13.000000, 13.000000)">
<g id="file-shortcut-shape" stroke="#000000" stroke-width="25" fill="#FFFFFF" stroke-linecap="round" stroke-linejoin="round">
<path d="M0,11.1214886 L0,285.878477 C0,292.039924 5.87498876,296.999983 13.1728373,296.999983 L225.997983,296.999983 C233.295974,296.999983 239.17082,292.039942 239.17082,285.878477 L239.17082,123.145388 C239.17082,123.145388 119.58541,2.84217094e-14 115.369423,2.84217094e-14 L13.1728576,2.84217094e-14 C5.87500907,-1.71479982e-05 0,4.96022995 0,11.1214886 Z" id="rect1171"></path>
<path d="M116.37005,0 L116,100.904964 C116,111.483663 123.258008,120 132.273377,120 L236,120 L116.37005,0 L116.37005,0 Z" id="rect1794"></path>
</g>
<path d="M47.803141,294.093878 C48.4999811,295.177551 48.9495553,296.095918 49.4216083,296.995918 C50.1184484,297.895918 50.5680227,298.630612 51.2873415,299.365306 C52.2089688,300.44898 53.3778619,301 54.7490634,301 C56.1427436,301 57.0643709,300.632653 57.761211,299.916327 C58.4580511,299.365306 58.9076254,298.465306 58.9076254,297.381633 C58.9076254,296.830612 58.9076254,295.930612 58.6828382,294.828571 C58.4355724,293.561224 58.2107852,292.844898 58.2107852,292.477551 C57.7387323,287.757143 57.5139451,283.753061 57.5139451,279.95102 C57.5139451,273.228571 58.4355724,267.057143 59.8292526,261.602041 C61.44772,256.165306 63.5382403,251.610204 66.0783349,247.62449 C68.8656954,243.620408 72.3274172,240.35102 76.4859792,237.44898 C80.6445412,234.546939 85.2751561,232.177551 90.1305582,230.359184 C94.9859603,228.540816 100.76299,227.089796 107.236859,226.006122 C113.710728,225.087755 120.409385,224.371429 127.13052,223.820408 C133.829177,223.453061 141.247152,223.269388 149.811542,223.269388 L167.704598,223.269388 L167.704598,249.057143 C167.704598,250.87551 168.401438,252.326531 170.019905,253.593878 C171.86316,254.861224 173.728893,255.595918 176.021722,255.595918 C178.112242,255.595918 180.180284,254.861224 181.82123,253.593878 L247.751296,201.834694 C249.369763,200.567347 250.291391,199.116327 250.291391,197.297959 C250.291391,195.479592 249.369763,194.028571 247.751296,192.761224 L181.82123,141.002041 C180.202763,139.734694 178.112242,139 176.044201,139 C173.728893,139 171.885639,139.734694 170.042384,141.002041 C168.423917,142.269388 167.727077,143.720408 167.727077,145.538776 L167.727077,171.326531 L149.811542,171.326531 C88.5120908,171.326531 50.8152886,184.955102 36.9234437,212.193878 C32.3153075,221.267347 30,232.526531 30,245.971429 C30,257.046939 35.5522422,272.291837 46.4094607,291.540816 C46.6567266,292.091837 47.1063009,292.826531 47.803141,294.093878 Z" id="Shape-Copy" fill="#000000" fill-rule="nonzero" transform="translate(140.145695, 220.000000) scale(-1, 1) translate(-140.145695, -220.000000) "></path>
</g>
</g>
<!-- Up arrow -->
<g id="up-arrow" transform="translate(-279.22 -208.12)">
<path transform="matrix(.22413 0 0 .12089 335.67 164.35)" stroke-width="0" d="m-194.17 412.01h-28.827-28.827l14.414-24.965 14.414-24.965 14.414 24.965z"/>
</g>
<!-- Down arrow -->
<g id="down-arrow" transform="translate(-279.22 -208.12)">
<path transform="matrix(.22413 0 0 -.12089 335.67 257.93)" stroke-width="0" d="m-194.17 412.01h-28.827-28.827l14.414-24.965 14.414-24.965 14.414 24.965z"/>
</g>
</defs>
</svg>
<header>
<h1>
<a href="https://github.com/mcguirepr89/BirdNET-Lite">🕊 BirdNET-Pi</a>
</h1>
</header>
<hr>
<h2>
<a href="/overview.php">
<span class="name">🐦 Overview</span>
</a>
</h2>
<hr style="border-top: dotted 2px #ccc;">
<h2>
<a href="/viewday.php">
<span class="name">🐦 Today's Top 10</span>
</a>
</h2>
<hr style="border-top: dotted 2px #ccc;">
<h2>
<a href="/viewdb.php">
<span class="name">🐦 View the Database</span>
</a>
</h2>
<hr style="border-top: dotted 2px #ccc;">
<h2>
<a href="./stream">
<span class="name">🔊 Live Audio Stream</span>
</a>
</h2>
<hr style="border-top: dotted 2px #ccc;">
<main>
<div class="listing">
<table aria-describedby="summary">
<thead>
<tr>
<th></th>
<th>
<a href="?sort=name&order=asc"><p style="color:#555">Extractions</p></a>
</th>
</tr>
</thead>
<tbody>
<tr class="file">
<td></td>
<td>
<a href="./By_Common_Name/">
<svg width="1.5em" height="1em" version="1.1" viewBox="0 0 317 259"><use xlink:href="#folder"></use></svg>
<span class="name">By Common Name</span>
</a>
</td>
</tr>
<tr class="file">
<td></td>
<td>
<a href="./By_Date/">
<svg width="1.5em" height="1em" version="1.1" viewBox="0 0 317 259"><use xlink:href="#folder"></use></svg>
<span class="name">By Date</span>
</a>
</td>
</tr>
<tr class="file">
<td></td>
<td>
<a href="./By_Scientific_Name/">
<svg width="1.5em" height="1em" version="1.1" viewBox="0 0 317 259"><use xlink:href="#folder"></use></svg>
<span class="name">By Scientific Name</span>
</a>
</td>
</tr>
<tr class="file">
<td></td>
<td>
<a href="./Processed/">
<svg width="1.5em" height="1em" version="1.1" viewBox="0 0 317 259"><use xlink:href="#folder"></use></svg>
<span class="name">Processed</span>
</a>
</td>
</tr>
</tbody>
<thead>
<tr>
<th></th>
<th>
<a href="?sort=name&order=asc"><p style="color:#555">Tools</p></a>
</th>
</tr>
</thead>
<tr class="file">
<td></td>
<td>
<a href="./scripts/">
<svg width="1.5em" height="1em" version="1.1" viewBox="0 0 317 259"><use xlink:href="#folder"></use></svg>
<span class="name">🗎 Scripts</span>
</a>
</td>
</tr>
<tr class="file">
<td></td>
<td>
<a href="http://birdnetpi.local:8080">
<svg width="1.5em" height="1em" version="1.1" viewBox="0 0 317 259"><use xlink:href="#folder"></use></svg>
<span class="name">⚙ Analysis Log</span>
</a>
</td>
</tr>
<tr class="file">
<td></td>
<td>
<a href="http://birdnetpi.local:8888">
<svg width="1.5em" height="1em" version="1.1" viewBox="0 0 317 259"><use xlink:href="#folder"></use></svg>
<span class="name">⚝ Extraction Log</span>
</a>
</td>
</tr>
<tr>
<td></td>
<td>
<a href="./phpsysinfo">
<span class="name">System Information</span>
</a>
</td>
</tr>
<tr class="file">
<td></td>
<td>
<form action="/spectrogram.php">
<input type="submit" value="Spectrogram View">
</form>
</td>
</tbody>
</table>
</div>
</main>
<footer>
Help:<a rel="noopener noreferrer" href="https://github.com/mcguirepr89/BirdNET-Pi/wiki/">🕊 BirdNET-Pi Wiki</a>
</footer>
<script>
var filterEl = document.getElementById('filter');
filterEl.focus();
function initFilter() {
if (!filterEl.value) {
var filterParam = new URL(window.location.href).searchParams.get('filter');
if (filterParam) {
filterEl.value = filterParam;
}
}
filter();
}
function filter() {
var q = filterEl.value.trim().toLowerCase();
var elems = document.querySelectorAll('tr.file');
elems.forEach(function(el) {
if (!q) {
el.style.display = '';
return;
}
var nameEl = el.querySelector('.name');
var nameVal = nameEl.textContent.trim().toLowerCase();
if (nameVal.indexOf(q) !== -1) {
el.style.display = '';
} else {
el.style.display = 'none';
}
});
}
function localizeDatetime(e, index, ar) {
if (e.textContent === undefined) {
return;
}
var d = new Date(e.getAttribute('datetime'));
if (isNaN(d)) {
d = new Date(e.textContent);
if (isNaN(d)) {
return;
}
}
e.textContent = d.toLocaleString([], {day: "2-digit", month: "2-digit", year: "numeric", hour: "2-digit", minute: "2-digit", second: "2-digit"});
}
var timeList = Array.prototype.slice.call(document.getElementsByTagName("time"));
timeList.forEach(localizeDatetime);
</script>
</body>
</html>
-51
View File
@@ -1,51 +0,0 @@
<html>
<head>
<title>BirdNET-Pi</title>
<style type="text/css">
a {
font-weight:bold;
text-decoration:none;
color:black;
}
body {
text-align:center;
font-family:verdana,arial,sans-serif;
font-size:medium;
margin:10px;
background-color: rgb(119, 196, 135);
}
#content {
position: relative;
}
#content img {
position: absolute;
top: 0px;
left: 0px;
padding-top: 5px;
padding-left: 10px;
}
footer {
position: absolute;
bottom: 0px;
left: 0px;
right: 0px;
width: 100%;
}
</style>
</head>
<body>
<a href="https://github.com/mcguirepr89/BirdNET-Pi" target="_content">
<img alt="BirdNET-Pi" src="images/bird.png" style="position:absolute;left:32.5px;top:15px;">
</a>
<h1 style="padding-left:150px;margin:0;">BirdNET-Pi</h1>
<img style="padding-left: 150px;margin:0;" src="images/version.svg"/>
<p style="margin:0;padding-left:150px;padding-top:5px">
<a href="/overview.php" target="content">Overview</a> |
<a href="/viewdb.php" target="content">Database</a> |
<a href="/stats.php" target="content">Species Stats</a> |
<a href="/history.php" target="content">History</a> |
<a href="/spectrogram.php" target="content">Spectrogram</a>
</p>
</body>
</html>
-51
View File
@@ -1,51 +0,0 @@
<html>
<head>
<title>BirdNET-Pi</title>
<style type="text/css">
a {
font-weight:bold;
text-decoration:none;
color:black;
}
body {
text-align:center;
font-family:verdana,arial,sans-serif;
font-size:medium;
margin:10px;
background-color: rgb(119, 196, 135);
}
#content {
position: relative;
}
#content img {
position: absolute;
top: 0px;
left: 0px;
padding-top: 5px;
padding-left: 10px;
}
footer {
position: absolute;
bottom: 0px;
left: 0px;
right: 0px;
width: 100%;
}
</style>
</head>
<body>
<a href="https://github.com/mcguirepr89/BirdNET-Pi" target="_content">
<img alt="BirdNET-Pi" src="images/bird.png" style="position:absolute;left:32.5px;top:15px;">
</a>
<h1 style="padding-left:150px">BirdNET-Pi<img style="padding-left: 5px" src="images/version.svg" class="ribbon"/></h1>
</div>
<p style="padding-left:150px;">
<a href="/overview.php" target="content">Übersicht</a> |
<a href="/viewdb.php" target="content">Datenbankansicht</a> |
<a href="/viewday.php" target="content">Tagesansicht</a> |
<a href="/spectrogram.php" target="content">Spektrogrammansicht</a>
</p>
</body>
</html>
-14
View File
@@ -1,14 +0,0 @@
<?php
error_reporting(E_ALL);
ini_set('display_errors',1);
$file='/home/pi/BirdNET-Pi/exclude_species_list.txt';
$str=file_get_contents("$file");
$str = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $str);
file_put_contents("$file", "$str");
if (isset($_POST['species']))
foreach ($_POST['species'] as $selectedOption)
file_put_contents("/home/pi/BirdNET-Pi/exclude_species_list.txt", $selectedOption."\n", FILE_APPEND);
header("Location: {$_SERVER['HTTP_REFERER']}");
exit;
?>
-14
View File
@@ -1,14 +0,0 @@
<?php
error_reporting(E_ALL);
ini_set('display_errors',1);
$file='/home/pi/BirdNET-Pi/include_species_list.txt';
$str=file_get_contents("$file");
$str = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $str);
file_put_contents("$file", "$str");
if (isset($_POST['species']))
foreach ($_POST['species'] as $selectedOption)
file_put_contents("/home/pi/BirdNET-Pi/include_species_list.txt", $selectedOption."\n", FILE_APPEND);
header("Location: {$_SERVER['HTTP_REFERER']}");
exit;
?>
-2
View File
@@ -67,8 +67,6 @@ sudo -u ${USER} cp -f $(dirname ${my_dir})/templates/phpsysinfo.ini ${HOME}/phps
sudo -u ${USER} cp -f $(dirname ${my_dir})/templates/green_bootstrap.css ${HOME}/phpsysinfo/templates/
sudo -u ${USER} cp -f $(dirname ${my_dir})/templates/index_bootstrap.html ${HOME}/phpsysinfo/templates/html
echo "Setting Wttr.in URL to "${LATITUDE}", "${LONGITUDE}""
sudo -u${USER} sed -i "s/https:\/\/v2.wttr.in\//https:\/\/v2.wttr.in\/"${LATITUDE},${LONGITUDE}"/g" $(dirname ${my_dir})/homepage/menu.html
sudo chmod -R g+rw $(dirname ${my_dir})
sudo chmod -R g+rw ${RECS_DIR}
-22
View File
@@ -1,22 +0,0 @@
<?php
error_reporting(E_ALL);
ini_set('display_errors',1);
$file='/home/pi/BirdNET-Pi/exclude_species_list.txt';
$str=file_get_contents("$file");
$str = preg_replace('/^\h*\v+/m', '', $str);
file_put_contents("$file", "$str");
if (isset($_POST['species']))
foreach($_POST['species'] as $selectedOption) {
$content = file_get_contents("/home/pi/BirdNET-Pi/exclude_species_list.txt");
$newcontent = str_replace($selectedOption, "", "$content");
file_put_contents("/home/pi/BirdNET-Pi/exclude_species_list.txt", "$newcontent");
}
$file='/home/pi/BirdNET-Pi/exclude_species_list.txt';
$str=file_get_contents("$file");
//$str = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $str);
$str = preg_replace('/^\h*\v+/m', '', $str);
file_put_contents("$file", "$str");
header("Location: {$_SERVER['HTTP_REFERER']}");
exit;
?>
-22
View File
@@ -1,22 +0,0 @@
<?php
error_reporting(E_ALL);
ini_set('display_errors',1);
$file='/home/pi/BirdNET-Pi/include_species_list.txt';
$str=file_get_contents("$file");
$str = preg_replace('/^\h*\v+/m', '', $str);
file_put_contents("$file", "$str");
if (isset($_POST['species']))
foreach($_POST['species'] as $selectedOption) {
$content = file_get_contents("/home/pi/BirdNET-Pi/include_species_list.txt");
$newcontent = str_replace($selectedOption, "", "$content");
file_put_contents("/home/pi/BirdNET-Pi/include_species_list.txt", "$newcontent");
}
$file='/home/pi/BirdNET-Pi/include_species_list.txt';
$str=file_get_contents("$file");
//$str = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $str);
$str = preg_replace('/^\h*\v+/m', '', $str);
file_put_contents("$file", "$str");
header("Location: {$_SERVER['HTTP_REFERER']}");
exit;
?>
+19 -98
View File
@@ -1,121 +1,42 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
* {
font-family: 'Arial', 'Gill Sans', 'Gill Sans MT',
' Calibri', 'Trebuchet MS', 'sans-serif';
box-sizing: border-box;
box-sizing: border-box;
}
/* Create two unequal columns that floats next to each other */
.column {
float: left;
padding: 10px;
}
.first {
width: 45%;
}
.second {
width: 10%;
display: flex;
justify-content: center;
flex-direction: column;
height: 100%;
}
.third {
width: 45%;
}
/* Clear floats after the columns */
.row:after {
content: "";
display: table;
clear: both;
}
body {
background-color: rgb(119, 196, 135);
}
a {
text-decoration: none;
color: white;
}
.block {
display: block;
font-weight: bold;
width:100%;
border: none;
background-color: #04AA6D;
padding: 20px 20px;
color: white;
font-size: medium;
cursor: pointer;
text-align: center;
}
h2 {
text-align: center;
}
select {
width:100%
}
@media screen and (max-width: 800px) {
.column {
float: none;
width: 100%;
}
}
</style>
<?php
//remove <script></script> and add php start and close tag
//comment these two lines when code started working fine
error_reporting(E_ALL);
ini_set('display_errors',1);
$filename = 'labels.txt';
$eachlines = file($filename, FILE_IGNORE_NEW_LINES);
$filename = 'scripts/labels.txt';
$eachline = file($filename, FILE_IGNORE_NEW_LINES);
?>
<body style="background-color: rgb(119, 196, 135);">
<div class="row">
<div class="column first">
<body>
<h2>All Species Labels</h2>
<form action="add_to_exclude.php" method="POST" id="add">
<select name="species[]" id="species" multiple size="30">
<option selected value="base">Please Select</option>
<form action="" method="POST" id="add">
<select name="species[]" id="species" multiple size="30">
<option selected value="base">Please Select</option>
<?php
foreach($eachlines as $lines){
echo "<option value='".$lines."'>$lines</option>";
foreach($eachline as $lines){
echo "<option value='".$lines."'>$lines</option>";
}?>
</select>
<input type="hidden" name="add" value="add">
</form>
</div>
<div class="column second">
<button type="submit" form="add" class="block">Add to list</button><br>
<button type="submit" form="del" class="block">Remove from list</button>
</div>
<button type="submit" name="view" value="Excluded" form="add">Add to list</button><br>
<button type="submit" name="view" value="Excluded" form="del">Remove from list</button>
<div class="column third">
<h2>Excluded Species List</h2>
<form action="del_from_exclude.php" method="POST" id="del">
<select name="species[]" id="value2" multiple size="30">
<option selected value="base">Please Select</option>
<form action="" method="POST" id="del">
<select name="species[]" id="value2" multiple size="30">
<option selected value="base">Please Select</option>
<?php
$filename = '/home/pi/BirdNET-Pi/exclude_species_list.txt';
$eachlines = file($filename, FILE_IGNORE_NEW_LINES);
foreach($eachlines as $lines){
echo "<option value='".$lines."'>$lines</option>";
$filename = '/home/pi/BirdNET-Pi/exclude_species_list.txt';
$eachline = file($filename, FILE_IGNORE_NEW_LINES);
foreach($eachline as $lines){
echo "<option value='".$lines."'>$lines</option>";
}?>
<input type="hidden" name="del" value="del">
</form>
</div>
</div>
</body>
+1 -1
View File
@@ -3344,7 +3344,7 @@ function fm_show_nav_path($path)
<nav class="navbar navbar-expand-lg <?php echo $getTheme; ?> mb-4 main-nav <?php echo $isStickyNavBar ?>">
<a class="navbar-brand" href="../../">BirdNET-Pi Homepage </a>
<a class="navbar-brand" href="../"><?php echo lng('Tools'); ?></a>
<a class="navbar-brand" href="http://birdnetpi.local:8888" target="_"><?php echo lng('WebTerminal'); ?></a>
<a class="navbar-brand" href="http://birdnetpi.local:8080" target="_"><?php echo lng('WebTerminal'); ?></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
+8 -87
View File
@@ -1,94 +1,19 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
* {
font-family: 'Arial', 'Gill Sans', 'Gill Sans MT',
' Calibri', 'Trebuchet MS', 'sans-serif';
box-sizing: border-box;
box-sizing: border-box;
}
/* Create two unequal columns that floats next to each other */
.column {
float: left;
padding: 10px;
}
.first {
width: 45%;
}
.second {
width: 10%;
display: flex;
justify-content: center;
flex-direction: column;
height: 100%;
}
.third {
width: 45%;
}
/* Clear floats after the columns */
.row:after {
content: "";
display: table;
clear: both;
}
body {
background-color: rgb(119, 196, 135);
}
a {
text-decoration: none;
color: white;
}
.block {
display: block;
font-weight: bold;
width:100%;
border: none;
background-color: #04AA6D;
padding: 20px 20px;
color: white;
font-size: medium;
cursor: pointer;
text-align: center;
}
h2 {
text-align: center;
}
select {
width:100%
}
@media screen and (max-width: 800px) {
.column {
float: none;
width: 100%;
}
}
</style>
<?php
//remove <script></script> and add php start and close tag
//comment these two lines when code started working fine
error_reporting(E_ALL);
ini_set('display_errors',1);
$filename = 'labels.txt';
$filename = 'scripts/labels.txt';
$eachlines = file($filename, FILE_IGNORE_NEW_LINES);
?>
<body style="background-color: rgb(119, 196, 135);">
<div class="row">
<div class="column first">
<body>
<h2>All Species Labels</h2>
<form action="add_to_include.php" method="POST" id="add">
<form action="" method="POST" id="add">
<select name="species[]" id="species" multiple size="30">
<option selected value="base">Please Select</option>
<?php
@@ -96,17 +21,14 @@ foreach($eachlines as $lines){
echo "<option value='".$lines."'>$lines</option>";
}?>
</select>
<input type="hidden" name="add" value="add">
</form>
</div>
<div class="column second">
<button type="submit" form="add" class="block">Add to list</button><br>
<button type="submit" form="del" class="block">Remove from list</button>
</div>
<button type="submit" name="view" value="Included" form="add">Add to list</button><br>
<button type="submit" name="view" value="Included" form="del">Remove from list</button>
<div class="column third">
<h2>Included Species List</h2>
<form action="del_from_include.php" method="POST" id="del">
<form action="" method="POST" id="del">
<select name="species[]" id="value2" multiple size="30">
<option selected value="base">Please Select</option>
<?php
@@ -115,7 +37,6 @@ $eachlines = file($filename, FILE_IGNORE_NEW_LINES);
foreach($eachlines as $lines){
echo "<option value='".$lines."'>$lines</option>";
}?>
<input type="hidden" name="del" value="del">
</form>
</div>
</div>
</body>
+1 -1
View File
@@ -73,7 +73,7 @@ a {
</form>
</div>
<div class="column second">
<form action="http://birdnetpi.local:8888" target="top">
<form action="http://birdnetpi.local:8080" target="top">
<button type="submit" class="block">Web Terminal</button>
</form>
<form action="/scripts/service_controls.php">
-2
View File
@@ -158,8 +158,6 @@ create_necessary_dirs() {
sudo -u ${USER} ln -fs $(dirname ${my_dir})/templates/green_bootstrap.css ${HOME}/phpsysinfo/templates/
sudo -u ${USER} ln -fs $(dirname ${my_dir})/templates/index_bootstrap.html ${HOME}/phpsysinfo/templates/html
echo "Setting Wttr.in URL to "${LATITUDE}", "${LONGITUDE}""
sudo -u${USER} sed -i "s/https:\/\/v2.wttr.in\//https:\/\/v2.wttr.in\/"${LATITUDE},${LONGITUDE}"/g" $(dirname ${my_dir})/homepage/menu.html
chmod -R g+rw $(dirname ${my_dir})
chmod -R g+rw ${RECS_DIR}
}
+7 -4
View File
@@ -70,12 +70,13 @@ fi
sudo -u${USER} git -C /home/pi/BirdNET-Pi checkout -f homepage/*
sudo -u${USER} git -C /home/pi/BirdNET-Pi checkout -f scripts/*
sudo -u${USER} git -C /home/pi/BirdNET-Pi checkout -f scripts/*/*
sudo -u${USER} sed -i "s/https:\/\/v2.wttr.in\//https:\/\/v2.wttr.in\/"${LATITUDE},${LONGITUDE}"/g" $(dirname ${my_dir})/homepage/menu.html
if [ ! -z ${BIRDNETLOG_URL} ];then
BIRDNETLOG_URL="$(echo ${BIRDNETLOG_URL} | sed 's/\/\//\\\/\\\//g')"
elif [ -z ${BIRDNETPI_URL} ];then
BIRDNETLOG_URL="http:\/\/$(hostname).local:8080"
else
BIRDNETLOG_URL="$(echo http://$(hostname).local:8080 | sed 's/\/\//\\\/\\\//g')"
BIRDNETLOG_URL="${BIRDNETPI_URL}:8080"
fi
sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8080/${BIRDNETLOG_URL}/g" $(dirname ${my_dir})/homepage/*.html
sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8080/${BIRDNETLOG_URL}/g" $(dirname ${my_dir})/scripts/*.html
@@ -85,8 +86,10 @@ sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8080/${BIRDNETLOG_URL}/g" $(di
if [ ! -z ${WEBTERMINAL_URL} ];then
WEBTERMINAL_URL="$(echo ${WEBTERMINAL_URL} | sed 's/\/\//\\\/\\\//g')"
elif [ -z ${BIRDNETPI_URL} ];then
WEBTERMINAL_URL="http:\/\/$(hostname).local:8888"
else
WEBTERMINAL_URL="$(echo http://$(hostname).local:8888 | sed 's/\/\//\\\/\\\//g')"
WEBTERMINAL_URL="${BIRDNETPI_URL}:8888"
fi
sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8888/${WEBTERMINAL_URL}/g" $(dirname ${my_dir})/homepage/*.html
sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local:8888/${WEBTERMINAL_URL}/g" $(dirname ${my_dir})/scripts/*.html
@@ -110,4 +113,4 @@ else
sudo -u${USER} sed -i "s/http:\/\/birdnetpi.local/${BIRDNETPI_URL}/g" $(dirname ${my_dir})/scripts/*/*.php
fi
systemctl reload caddy
sudo systemctl reload caddy