From a91b20a959f8dbf51f602b8711afdb1cdde421c2 Mon Sep 17 00:00:00 2001
From: virmaior <70625876+virmaior@users.noreply.github.com>
Date: Mon, 25 Sep 2023 11:36:42 +0900
Subject: [PATCH] make clearer why base page is not populating / add check
recording (#624)
* add ability to check if last minute recorded to SD
* improve composition of web root
* add multicam to list of options in s10httpd
* make cgi-bin and sh functional / improve logic
---
SD_ROOT/wz_mini/etc/network.d/s10httpd | 117 +++++++++++++++++++++++++
SD_ROOT/wz_mini/www/cgi-bin/status.cgi | 111 +++++++++++++++++++++++
2 files changed, 228 insertions(+)
create mode 100644 SD_ROOT/wz_mini/etc/network.d/s10httpd
create mode 100644 SD_ROOT/wz_mini/www/cgi-bin/status.cgi
diff --git a/SD_ROOT/wz_mini/etc/network.d/s10httpd b/SD_ROOT/wz_mini/etc/network.d/s10httpd
new file mode 100644
index 0000000..d745a7b
--- /dev/null
+++ b/SD_ROOT/wz_mini/etc/network.d/s10httpd
@@ -0,0 +1,117 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:
+# Short-Description: Basic Web Server
+# Description: If enabled, start the httpd web server
+### END INIT INFO
+
+. /opt/wz_mini/wz_mini.conf
+
+
+compose_home()
+{
+ target=/opt/wz_mini/www/index.html
+ rm $target
+ cp /opt/wz_mini/www/index.top.html $target
+
+
+ if [[ "$WEB_SERVER_OPTIONS" ]]; then
+ for part in $WEB_SERVER_OPTIONS
+ do
+ case "$part" in
+ cam) echo 'Wyze Camera Core Config' >> $target ;;
+ config) echo 'Wz Mini Configuration' >> $target ;;
+ car) echo 'Car Tool' >> $target ;;
+ current) echo 'Current Screen' >> $target ;;
+ multicam) echo 'Multi-Cam Viewer' >> $target ;;
+ diag) echo 'Diagnostics' >> $target ;;
+ status) echo 'Check Recording' >> $target ;;
+ esac
+ done
+
+ echo 'Multi-Cam' >> $target
+ else
+ echo 'wz_mini.conf is missing the line WEB_SERVER_OPTIONS
';
+ echo 'to populate it with full capabilities:
WEB_SERVER_OPTIONS="cam config car jpeg multicam diag status"'; + + fi + + if [[ "$GO2RTC_SERVER_ENABLED" == "true" ]]; then + echo 'Go2RTC Server' >> $target + + fi + + echo '' >> $target + echo '