A live bird collage card for your Home Assistant dashboard.
convert to standard html
frederik464b2240d88b
diff --git a/homepage/index.php b/homepage/index.phpindex 0fa008a8..3f9b3947 100644--- a/homepage/index.php+++ b/homepage/index.php@@ -9,6 +9,7 @@ $site_name = get_sitename();set_timezone();?>+<!DOCTYPE html><title><?php echo $site_name; ?></title><meta name="viewport" content="width=device-width, initial-scale=1"><style>diff --git a/homepage/style.css b/homepage/style.cssindex d3a7c4ad..af7f8c31 100644--- a/homepage/style.css+++ b/homepage/style.css@@ -23,11 +23,10 @@ h3 {}iframe {- padding: 0;- margin: 0;border: none;- height: 85%;+ height: 88%;width: 100%;+ position: fixed;}body {@@ -169,7 +168,6 @@ button:hover {text-align: center;padding: 14px 16px;width: auto;- height: 100%;vertical-align: middle;}@@ -283,6 +281,14 @@ button:hover {padding: 12px;}+.settings h2 {+ margin-top: 0px;+}++.settings p {+ margin-bottom: 0px;+}+.settings h3 {text-align: left;}@@ -297,6 +303,11 @@ button:hover {color: black;}+.float button {+ margin-top: 6px;+ margin-bottom: 6px;+}+.customlabels,.customlabels2 {float:left;}@@ -365,20 +376,35 @@ button:hover {}.systemcontrols form,.servicecontrols form {- text-align: center;+ /*text-align: center;*/}-.systemcontrols button,.servicecontrols button {-+.servicecontrols button {background-color: rgb(219, 255, 235);padding: 12px;width: 50%;}+.systemcontrols button {+ background-color: rgb(219, 255, 235);+ display: block;+ padding: 12px;+ width: 50%;+ margin: 16px auto;+}+.servicecontrols button {width: 20%;}+.btn-group-center {+ text-align:center;+ /*align-content: center;*/+ margin: 16px auto;+ position:relative;+ /*display:inline-block;*/+}+.slider {-webkit-appearance: none;width: 33%;diff --git a/homepage/views.php b/homepage/views.phpindex 8f865110..979184b1 100644--- a/homepage/views.php+++ b/homepage/views.php@@ -46,37 +46,39 @@ elseif ($config["LONGITUDE"] == "0.000") {echo "<center style='color:red'><b>WARNING: Your longitude is not set properly. Please do so now in Tools -> Settings.</center></b>";}?>+<!DOCTYPE html><link rel="stylesheet" href="style.css?v=<?php echo date ('n.d.y', filemtime('style.css')); ?>"><style></style><meta name="viewport" content="width=device-width, initial-scale=1">+<body><div class="topnav" id="myTopnav">-<form action="" method="GET" id="views">+<form action="views.php" method="GET" id="views"><button type="submit" name="view" value="Overview" form="views">Overview</button></form>-<form action="" method="GET" id="views">+<form action="views.php" method="GET" id="views"><button type="submit" name="view" value="Todays Detections" form="views">Today's Detections</button></form>-<form action="" method="GET" id="views">+<form action="views.php" method="GET" id="views"><button type="submit" name="view" value="Spectrogram" form="views">Spectrogram</button></form>-<form action="" method="GET" id="views">+<form action="views.php" method="GET" id="views"><button type="submit" name="view" value="Species Stats" form="views">Best Recordings</button></form>-<form action="" method="GET" id="views">+<form action="views.php" method="GET" id="views"><button type="submit" name="view" value="Streamlit" form="views">Species Stats</button></form>-<form action="" method="GET" id="views">+<form action="views.php" method="GET" id="views"><button type="submit" name="view" value="Daily Charts" form="views">Daily Charts</button></form>-<form action="" method="GET" id="views">+<form action="views.php" method="GET" id="views"><button type="submit" name="view" value="Recordings" form="views">Recordings</button></form>-<form action="" method="GET" id="views">+<form action="views.php" method="GET" id="views"><button type="submit" name="view" value="View Log" form="views">View Log</button></form>-<form action="" id="toolsbtn" method="GET" id="views">+<form action="views.php" method="GET" id="views"><button type="submit" name="view" value="Tools" form="views">Tools<?php if(isset($_SESSION['behind']) && intval($_SESSION['behind']) >= 50 && ($config['SILENCE_UPDATE_INDICATOR'] != 1)){ $updatediv = ' <div class="updatenumber">'.$_SESSION["behind"].'</div>'; } else { $updatediv = ""; } echo $updatediv; ?></button></form><button href="javascript:void(0);" class="icon" onclick="myFunction()"><img src="images/menu.png"></button>@@ -142,7 +144,7 @@ if(isset($_GET['view'])){ensure_authenticated();$url = $_SERVER['SERVER_NAME']."/scripts/adminer.php";echo "<div class=\"centered\">- <form action=\"\" method=\"GET\" id=\"views\">+ <form action=\"views.php\" method=\"GET\" id=\"views\"><button type=\"submit\" name=\"view\" value=\"Settings\" form=\"views\">Settings</button><button type=\"submit\" name=\"view\" value=\"System Info\" form=\"views\">System Info</button><button type=\"submit\" name=\"view\" value=\"System Controls\" form=\"views\">System Controls".$updatediv."</button>diff --git a/scripts/advanced.php b/scripts/advanced.phpindex 809d516a..aba3eac8 100644--- a/scripts/advanced.php+++ b/scripts/advanced.php@@ -576,6 +576,7 @@ foreach($formats as $format){</table><br><br><input type="hidden" name="view" value="Advanced">+<div class="float"><button onclick="if(<?php print($newconfig['PRIVACY_THRESHOLD']);?> != document.getElementById('privacy_threshold').value){return confirm('This will take about 90 seconds.')} collectrtspUrls();" type="submit" name="submit" value="advanced"><?phpif(isset($_GET['submit'])){@@ -584,10 +585,11 @@ if(isset($_GET['submit'])){echo "Update Settings";}?>- </button>- <br>+ </button></div></form><form action="" method="GET">+<div class="float"><button type="submit" name="view" value="Settings">Basic Settings</button>+</div></form></div>diff --git a/scripts/config.php b/scripts/config.phpindex c9952119..6e81ca5a 100644--- a/scripts/config.php+++ b/scripts/config.php@@ -645,6 +645,7 @@ https://discordapp.com/api/webhooks/{WebhookID}/{WebhookToken}<input type="hidden" name="status" value="success"><input type="hidden" name="submit" value="settings">+<div class="float"><button type="submit" id="basicformsubmit" onclick="if(document.getElementById('basicform').checkValidity()){this.innerHTML = 'Updating... please wait.';this.classList.add('disabled')}" name="view" value="Settings"><?phpif(isset($_GET['status'])){@@ -653,10 +654,10 @@ if(isset($_GET['status'])){echo "Update Settings";}?>- </button>+ </button></div></form><form action="" method="GET">+ <div class="float"><button type="submit" name="view" value="Advanced">Advanced Settings</button>- </form>+ </div></form></div>-diff --git a/scripts/exclude_list.php b/scripts/exclude_list.phpindex d8d90f47..4b67a79d 100644--- a/scripts/exclude_list.php+++ b/scripts/exclude_list.php@@ -9,8 +9,8 @@<input autocomplete="off" size="18" type="text" placeholder="Search Species..." id="exclude_species_searchterm" name="exclude_species_searchterm"><br><span>Once the desired species has been highlighted, click it and then click ADD to have it excluded.</span>- <select name="species[]" id="species" multiple size="auto">- <option>Choose a species below to add to the Excluded Species List</option>+ <select name="species[]" id="species" multiple size="25">+ <option selected value="base">Please Select</option><?phperror_reporting(E_ALL);ini_set('display_errors',1);@@ -40,8 +40,9 @@<div class="customlabels column3"><form action="" method="GET" id="del"><h3>Excluded Species List</h3>- <br><br>- <select name="species[]" id="value2" multiple size="auto">+ <br><br><br>+ <select name="species[]" id="value2" multiple size="25">+ <option selected value="base">Please Select</option><?php$filename = './scripts/exclude_species_list.txt';$eachline = file($filename, FILE_IGNORE_NEW_LINES);diff --git a/scripts/service_controls.php b/scripts/service_controls.phpindex 410db177..97a3d6ec 100644--- a/scripts/service_controls.php+++ b/scripts/service_controls.php@@ -26,71 +26,73 @@ function service_status($name) {<meta name="viewport" content="width=device-width, initial-scale=1"><br><div class="servicecontrols">- <form action="" method="GET">+<form action="views.php" method="GET"><h3>Live Audio Stream <?php echo service_status("livestream.service");?></h3>+ <div role="group" class="btn-group-center"><button type="submit" name="submit" value="sudo systemctl stop livestream.service && sudo systemctl stop icecast2.service">Stop</button><button type="submit" name="submit" value="sudo systemctl restart livestream.service && sudo systemctl restart icecast2.service">Restart </button><button type="submit" name="submit" value="sudo systemctl disable --now livestream.service && sudo systemctl disable icecast2 && sudo systemctl stop icecast2.service">Disable</button><button type="submit" name="submit" value="sudo systemctl enable icecast2 && sudo systemctl start icecast2.service && sudo systemctl enable --now livestream.service">Enable</button>- </form>- <form action="" method="GET">+ </div><h3>Web Terminal <?php echo service_status("web_terminal.service");?></h3>+ <div role="group" class="btn-group-center"><button type="submit" name="submit" value="sudo systemctl stop web_terminal.service">Stop</button><button type="submit" name="submit" value="sudo systemctl restart web_terminal.service">Restart </button><button type="submit" name="submit" value="sudo systemctl disable --now web_terminal.service">Disable</button><button type="submit" name="submit" value="sudo systemctl enable --now web_terminal.service">Enable</button>- </form>- <form action="" method="GET">+ </div><h3>BirdNET Log <?php echo service_status("birdnet_log.service");?></h3>+ <div role="group" class="btn-group-center"><button type="submit" name="submit" value="sudo systemctl stop birdnet_log.service">Stop</button><button type="submit" name="submit" value="sudo systemctl restart birdnet_log.service">Restart </button><button type="submit" name="submit" value="sudo systemctl disable --now birdnet_log.service">Disable</button><button type="submit" name="submit" value="sudo systemctl enable --now birdnet_log.service">Enable</button>- </form>- <form action="" method="GET">+ </div><h3>BirdNET Analysis <?php echo service_status("birdnet_analysis.service");?></h3>+ <div role="group" class="btn-group-center"><button type="submit" name="submit" value="sudo systemctl stop birdnet_analysis.service">Stop</button><button type="submit" name="submit" value="sudo systemctl restart birdnet_analysis.service">Restart</button><button type="submit" name="submit" value="sudo systemctl disable --now birdnet_analysis.service">Disable</button><button type="submit" name="submit" value="sudo systemctl enable --now birdnet_analysis.service">Enable</button>- </form>- <form action="" method="GET">+ </div><h3>Streamlit Statistics <?php echo service_status("birdnet_stats.service");?></h3>+ <div role="group" class="btn-group-center"><button type="submit" name="submit" value="sudo systemctl stop birdnet_stats.service">Stop</button><button type="submit" name="submit" value="sudo systemctl restart birdnet_stats.service">Restart</button><button type="submit" name="submit" value="sudo systemctl disable --now birdnet_stats.service">Disable</button><button type="submit" name="submit" value="sudo systemctl enable --now birdnet_stats.service">Enable</button>- </form>- <form action="" method="GET">+ </div><h3>Recording Service <?php echo service_status("birdnet_recording.service");?></h3>+ <div role="group" class="btn-group-center"><button type="submit" name="submit" value="sudo systemctl stop birdnet_recording.service">Stop</button><button type="submit" name="submit" value="sudo systemctl restart birdnet_recording.service">Restart</button><button type="submit" name="submit" value="sudo systemctl disable --now birdnet_recording.service">Disable</button><button type="submit" name="submit" value="sudo systemctl enable --now birdnet_recording.service">Enable</button>- </form>- <form action="" method="GET">+ </div><h3>Chart Viewer <?php echo service_status("chart_viewer.service");?></h3>+ <div role="group" class="btn-group-center"><button type="submit" name="submit" value="sudo systemctl stop chart_viewer.service">Stop</button><button type="submit" name="submit" value="sudo systemctl restart chart_viewer.service">Restart</button><button type="submit" name="submit" value="sudo systemctl disable --now chart_viewer.service">Disable</button><button type="submit" name="submit" value="sudo systemctl enable --now chart_viewer.service">Enable</button>- </form>- <form action="" method="GET">+ </div><h3>Spectrogram Viewer <?php echo service_status("spectrogram_viewer.service");?></h3>+ <div role="group" class="btn-group-center"><button type="submit" name="submit" value="sudo systemctl stop spectrogram_viewer.service">Stop</button><button type="submit" name="submit" value="sudo systemctl restart spectrogram_viewer.service">Restart</button><button type="submit" name="submit" value="sudo systemctl disable --now spectrogram_viewer.service">Disable</button><button type="submit" name="submit" value="sudo systemctl enable --now spectrogram_viewer.service">Enable</button>- </form>- <form action="" method="GET">+ </div><h3>Ram drive (!experimental!) <?php echo service_status(get_service_mount_name());?></h3>+ <div role="group" class="btn-group-center"><button type="submit" name="submit" <?php do_service_mount("disable");?> onclick="return confirm('This will reboot, are you sure?')">Disable</button><button type="submit" name="submit" <?php do_service_mount("enable");?> onclick="return confirm('This will reboot, are you sure?')">Enable</button>- </form>- <form action="" method="GET">+ </div>+ <div role="group" class="btn-group-center"><button type="submit" name="submit" value="stop_core_services.sh">Stop Core Services</button>- </form>- <form action="" method="GET">+ </div>+ <div role="group" class="btn-group-center"><button type="submit" name="submit" value="restart_services.sh">Restart Core Services</button>- </form>+ </div>+</form></div>diff --git a/scripts/system_controls.php b/scripts/system_controls.phpindex 8be71356..08b629d1 100644--- a/scripts/system_controls.php+++ b/scripts/system_controls.php@@ -35,18 +35,21 @@ function update() {}</script><div class="systemcontrols">- <form action="" method="GET">+<form action="views.php" method="GET">+ <div><button type="submit" name="submit" value="sudo reboot" onclick="return confirm('Are you sure you want to reboot?')">Reboot</button>- </form>- <form action="" method="GET">+ </div>+ <div><button type="submit" name="submit" id="updatebtn" value="update_birdnet.sh" onclick="update();">Update <?php if(isset($_SESSION['behind']) && $_SESSION['behind'] != "0" && $_SESSION['behind'] != "with"){?><div class="updatenumber"><?php echo $_SESSION['behind']; ?></div><?php } ?></button>- </form>- <form action="" method="GET">+ </div>+ <div><button type="submit" name="submit" value="sudo shutdown now" onclick="return confirm('Are you sure you want to shutdown?')">Shutdown</button>- </form>- <form action="" method="GET">+ </div>+ <div><button type="submit" name="submit" value="sudo clear_all_data.sh" onclick="return confirm('Clear ALL Data? Note that this cannot be undone and will take up to 90 seconds.')">Clear ALL data</button>- </form>+ </div>+</form>+</div><?php$cmd="cd ".$home."/BirdNET-Pi && sudo -u ".$user." git rev-list --max-count=1 HEAD";$curr_hash = shell_exec($cmd);