From a8b70cf19d6473a81663761b5d26fc10740fba33 Mon Sep 17 00:00:00 2001 From: virmaior <70625876+virmaior@users.noreply.github.com> Date: Thu, 14 Sep 2023 14:30:43 +0900 Subject: [PATCH] pull request to display go2rtc when it is active in the webserver (#606) * improve index.html for wz_mini webserver * shared top for dynamically generated base index * base documentation for go2rtc in webserver It seems like there should be more but I didn't immediately see any... --- SD_ROOT/wz_mini/etc/network.d/S10httpd | 36 +++++++++++++++++++ .../www/cgi-bin/GO2RTC_SERVER_ENABLED.md | 1 + SD_ROOT/wz_mini/www/index.top.html | 25 +++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 SD_ROOT/wz_mini/www/cgi-bin/GO2RTC_SERVER_ENABLED.md create mode 100644 SD_ROOT/wz_mini/www/index.top.html diff --git a/SD_ROOT/wz_mini/etc/network.d/S10httpd b/SD_ROOT/wz_mini/etc/network.d/S10httpd index 4dd3613..31cedbf 100644 --- a/SD_ROOT/wz_mini/etc/network.d/S10httpd +++ b/SD_ROOT/wz_mini/etc/network.d/S10httpd @@ -7,6 +7,39 @@ . /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 ;; + diag) echo 'Diagnostics' >> $target ;; + esac + done + + echo 'Multi-Cam' >> $target + fi + + if [[ "$GO2RTC_SERVER_ENABLED" == "true" ]]; then + echo 'Go2RTC Server' >> $target + + fi + + echo '
' >> $target + echo '' >> $target +} + + create_httpdconf() { conffile="/opt/wz_mini/etc/httpd.conf" @@ -28,6 +61,7 @@ EOF } + do_start() { create_httpdconf @@ -57,6 +91,7 @@ if [[ "$WEB_SERVER_ENABLED" == "true" ]]; then case "$1" in start) echo "#####$(basename "$0")#####" + compose_home do_start ;; stop) @@ -64,6 +99,7 @@ case "$1" in ;; restart) do_stop + compose_home do_start ;; *) diff --git a/SD_ROOT/wz_mini/www/cgi-bin/GO2RTC_SERVER_ENABLED.md b/SD_ROOT/wz_mini/www/cgi-bin/GO2RTC_SERVER_ENABLED.md new file mode 100644 index 0000000..4b6e9dc --- /dev/null +++ b/SD_ROOT/wz_mini/www/cgi-bin/GO2RTC_SERVER_ENABLED.md @@ -0,0 +1 @@ +GO2RTC_SERVER provide an alternative way to do RTSP and streaming to web! diff --git a/SD_ROOT/wz_mini/www/index.top.html b/SD_ROOT/wz_mini/www/index.top.html new file mode 100644 index 0000000..c42f12a --- /dev/null +++ b/SD_ROOT/wz_mini/www/index.top.html @@ -0,0 +1,25 @@ + + +WZ Mini Web Tools + + + +

Wyze Mini Web Sever Menu