A live bird collage card for your Home Assistant dashboard.
adding the old toolset back to the newif
mcguirepr8999018f712839
diff --git a/homepage/images/version.svg b/homepage/images/version.svgindex 1d17fee0..3cc111f0 100644--- a/homepage/images/version.svg+++ b/homepage/images/version.svg@@ -1 +1 @@-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="82" height="20" role="img" aria-label="SQLite: 0.12"><title>SQLite: 0.12</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="82" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="47" height="20" fill="#555"/><rect x="47" width="35" height="20" fill="pink"/><rect width="82" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="245" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="370">SQLite</text><text x="245" y="140" transform="scale(.1)" fill="#fff" textLength="370">SQLite</text><text aria-hidden="true" x="635" y="150" fill="#ccc" fill-opacity=".3" transform="scale(.1)" textLength="250">0.12</text><text x="635" y="140" transform="scale(.1)" fill="#333" textLength="250">0.12</text></g></svg>\ No newline at end of file+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="35" height="20" role="img" aria-label="0.13"><title>0.13</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="35" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="0" height="20" fill="pink"/><rect x="0" width="35" height="20" fill="pink"/><rect width="35" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="175" y="150" fill="#ccc" fill-opacity=".3" transform="scale(.1)" textLength="250">0.13</text><text x="175" y="140" transform="scale(.1)" fill="#333" textLength="250">0.13</text></g></svg>\ No newline at end of filediff --git a/homepage/index.php b/homepage/index.phpindex caccab9d..221e6a11 100644--- a/homepage/index.php+++ b/homepage/index.php@@ -36,7 +36,7 @@ if (!isset($_SERVER['PHP_AUTH_USER'])) {<form action=\"\" method=\"GET\"><button type=\"submit\" name=\"stream\" value=\"play\">Live Audio</button></form>- <h1><a href=\"\">BirdNET-Pi</a></h1>+ <h1><a href=\"\">BirdNET-Pi</a><img src=\"images/version.svg\">🍀</h1<></div>";}if(isset($_GET['log'])) {diff --git a/homepage/style.css b/homepage/style.cssindex bdf9f1b7..27238797 100644--- a/homepage/style.css+++ b/homepage/style.css@@ -23,7 +23,7 @@margin-right: auto;}-.banner img {+.logo img {position: absolute;top: 0;left: 0;@@ -90,6 +90,8 @@vertical-align: middle;}++.history table,.history img {width: auto;margin-left: auto;@@ -204,6 +206,11 @@ body::-webkit-scrollbar {}@media screen and (max-width: 600px) {+ .stats img {+ width: 100%;+ margin-left:auto;+ margin-rigth:auto;+ }.viewdb table,.overview img {width: 100%}diff --git a/homepage/views.php b/homepage/views.phpindex 38f6b22a..ac6469f2 100644--- a/homepage/views.php+++ b/homepage/views.php@@ -47,6 +47,8 @@ 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>+ <button type=\"submit\" name=\"view\" value=\"File\">File Manager</button>+ <button type=\"submit\" name=\"view\" value=\"Webterm\">Web Terminal</button><button type=\"submit\" name=\"view\" value=\"Included\">Custom Species List</button><button type=\"submit\" name=\"view\" value=\"Excluded\">Excluded Species List</button></form>";@@ -113,6 +115,42 @@ if(isset($_POST['view'])){}include('scripts/exclude_list.php');}+ if($_POST['view'] == "File"){+ header('Location: scripts/filemanager/filemanager.php');+ }+ if($_POST['view'] == "Webterm"){+ 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');+ }+ $caddypwd = $config['CADDY_PWD'];+ if (!isset($_SERVER['PHP_AUTH_USER'])) {+ header('WWW-Authenticate: Basic realm="My Realm"');+ header('HTTP/1.0 401 Unauthorized');+ echo 'You cannot access the web terminal';+ exit;+ } else {+ $submittedpwd = $_SERVER['PHP_AUTH_PW'];+ $submitteduser = $_SERVER['PHP_AUTH_USER'];+ if($submittedpwd == $caddypwd && $submitteduser == 'birdnet'){+ #ACCESS THE WEB TERMINAL+ if(empty($config['BIRDNETLOG_URL']) == false) {+ $webterm = $config['WEBTERMINAL_URL'];+ } elseif(empty($config['BIRDNETPI_URL'] == false)) {+ $webterm = $config['BIRDNETPI_URL'].":8888";+ } else {+ $webterm = "http://birdnetpi.local:8888";+ }+ header("Location: $webterm");+ } else {+ header('WWW-Authenticate: Basic realm="My Realm"');+ header('HTTP/1.0 401 Unauthorized');+ echo 'You cannot access the web terminal';+ exit;+ }+ }+ }}else{include('overview.php');}?>diff --git a/scripts/filemanager/filemanager.php b/scripts/filemanager/filemanager.phpindex 1db4bb8c..9450f33d 100644--- a/scripts/filemanager/filemanager.php+++ b/scripts/filemanager/filemanager.php@@ -3342,9 +3342,9 @@ 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>+ <form action="../../views.php" method="POST">+ <button style="margin-left:80px;" class="navbar-brand" type="submit" name="view" value="Overview">BirdNET-Pi Homepage</button>+ <button class="navbar-brand" type="submit" name="view" value="Tools"><?php echo lng('Tools'); ?></button></form><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>diff --git a/scripts/stats.php b/scripts/stats.phpindex 64d2f715..d8f147de 100644--- a/scripts/stats.php+++ b/scripts/stats.php@@ -106,7 +106,6 @@ $filename = "/By_Date/".$results['Date']."/".$comname."/".$results['File_Name'];</table></form></div>-</div></body></html>