From b56ee743bcd708ca560ebc205b1c3308b5eab6d6 Mon Sep 17 00:00:00 2001 From: Jon duSaint Date: Mon, 2 Oct 2023 11:27:17 -0700 Subject: reolink: Revamp web page The generated web page now supports multiple cameras and is usable on idevices. --- reolink/reolink | 375 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 196 insertions(+), 179 deletions(-) (limited to 'reolink') diff --git a/reolink/reolink b/reolink/reolink index b932af9..e38eb55 100755 --- a/reolink/reolink +++ b/reolink/reolink @@ -425,7 +425,14 @@ sub timelapse { } sub respool_and_generate_slideshow { - my $camera = 'camera1'; ### XXX: + my @cameras; + foreach my $a (0..$#_) { + if (defined $cameras{$_[$a]}) { + push @cameras, $_[$a]; + delete $_[$a]; + } + } + @cameras = (sort { $cameras{$a}->{display} cmp $cameras{$b}->{display} } keys (%cameras)) unless @cameras; # Retain only past 24 hours of stills my $t = time - $server_params{spooltime} * 60 * 60; @@ -438,7 +445,6 @@ sub respool_and_generate_slideshow { my $generated = localtime; - ### XXX: Figure out how to get iDevice page size correct if ($fh) { print $fh <<"SLIDESHOW"; @@ -446,30 +452,110 @@ sub respool_and_generate_slideshow { Slideshow [$generated] + + + - - -
-
- Slideshow - Video -
- -
-
- -
SLIDESHOW - if (@videos) { - my ($video, $keyframe) = ("$videos[-1]->[0]$videos[-1]->[1]$videos[-1]->[2].$videos[-1]->[3]", - "$videos[-1]->[0]$videos[-1]->[1]$videos[-1]->[2]_kf.jpg"); - + foreach my $camera (@cameras) { print $fh <<"SLIDESHOW"; - -SLIDESHOW - } - - print $fh <<"SLIDESHOW"; -
+ +
+
$cameras{$camera}->{display}
+
+
+ Slideshow + Video +
-
-
- +
+
+ +
+
-
-
+ +
+
+ +
+
+
+
+
-
- << - < -SLIDESHOW +
+
- foreach (0..100) { - my $class = ($_ % 10) ? 'tick' : 'bigtick'; - print $fh <<"SLIDESHOW"; - | SLIDESHOW } print $fh <<"SLIDESHOW"; - > - >> -
-
- SLIDESHOW -- cgit v1.2.3