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...
This commit is contained in:
virmaior 2023-09-14 14:30:43 +09:00 committed by GitHub
parent 3e7a24f68e
commit a8b70cf19d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 62 additions and 0 deletions

View File

@ -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 '<a class="server_LINK" href="/cam.cgi" >Wyze Camera Core Config</a>' >> $target ;;
config) echo '<a class="server_LINK" href="/config.cgi" >Wz Mini Configuration</a>' >> $target ;;
car) echo '<a class="server_LINK" href="/car.html" >Car Tool</a>' >> $target ;;
current) echo '<a class="server_LINK" href="/jpeg.cgi" >Current Screen</a>' >> $target ;;
diag) echo '<a class="server_LINK" href="/diagnostics.cgi" >Diagnostics</a>' >> $target ;;
esac
done
echo '<a class="server_LINK" href="/mulitcam.html" >Multi-Cam</a>' >> $target
fi
if [[ "$GO2RTC_SERVER_ENABLED" == "true" ]]; then
echo '<a class="server_LINK" href="#Go2RTC" onclick="javascript:event.target.port=1984">Go2RTC Server</a>' >> $target
fi
echo '<div id="display_BAR"><div class="github_link"><a target="_new" href="https://github.com/gtxaspec/wz_mini_hacks">GitHub: wz_mini_hack</a></div></div>' >> $target
echo '</body></html>' >> $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
;;
*)

View File

@ -0,0 +1 @@
GO2RTC_SERVER provide an alternative way to do RTSP and streaming to web!

View File

@ -0,0 +1,25 @@
<html>
<head>
<title>WZ Mini Web Tools</title>
<style type="text/css">
.server_LINK {
display:block;
}
#display_BAR {
position: fixed;
bottom: 0;
background-color: blue;
border-top: 1px solid lightblue;
color: #fff;
display: flex;
width: 100%;
height: var(--display_bar_height);
}
#display_BAR A , #display_BAR A:visited {
color:white;
}
</style>
</head>
<body>
<h1>Wyze Mini Web Sever Menu</h1>