Menu: fix broken 'logs' link + add 'detections' shortcut

The 'logs' menu item pointed at /views.php?view=Log+Out which doesn't
exist in BirdNET-Pi's view router - hitting that link returned a
blank page. Renamed to 'log' and pointed at the correct view='View+Log'.

Added a 'detections' item pointing at view='Todays+Detections' (the
most useful BirdNET-Pi page for a casual user, faster to reach than
clicking through /index.php).

Valid view= values pulled from homepage/views.php:142-161.

Also added .DS_Store to .gitignore.
This commit is contained in:
Twarner491
2026-05-28 12:39:05 -07:00
parent 35eed2a885
commit 4fea750146
2 changed files with 9 additions and 8 deletions
+8 -8
View File
@@ -23,15 +23,15 @@ if (getenv('AV_REQUIRE_AUTH') === '1' && empty($_SERVER['HTTP_AUTHORIZATION']))
exit;
}
// All hrefs are the canonical paths BirdNET-Pi's views.php recognises
// (lifted from homepage/views.php). AvianVisitors took over `/`, so
// the stock home is at /index.php.
echo json_encode([
'items' => [
// Stock BirdNET-Pi UI (AvianVisitors took over `/`, so the stock
// UI is reachable at /index.php directly)
['label' => 'birdnet-pi', 'href' => '/index.php', 'native' => false],
// BirdNET-Pi log view (php served at /views.php)
['label' => 'logs', 'href' => '/views.php?view=Log+Out', 'native' => false],
['label' => 'system', 'href' => '/views.php?view=Services', 'native' => false],
// AvianVisitors source
['label' => 'github', 'href' => 'https://github.com/Twarner491/AvianVisitors', 'native' => false],
['label' => 'birdnet-pi', 'href' => '/index.php', 'native' => false],
['label' => 'detections', 'href' => '/views.php?view=Todays+Detections', 'native' => false],
['label' => 'log', 'href' => '/views.php?view=View+Log', 'native' => false],
['label' => 'system', 'href' => '/views.php?view=Services', 'native' => false],
['label' => 'github', 'href' => 'https://github.com/Twarner491/AvianVisitors', 'native' => false],
],
]);