diff --git a/fhem/webfrontend/pgm2/01_FHEMWEB.pm b/fhem/webfrontend/pgm2/01_FHEMWEB.pm index 8beb9dcc3..6a99e88b2 100755 --- a/fhem/webfrontend/pgm2/01_FHEMWEB.pm +++ b/fhem/webfrontend/pgm2/01_FHEMWEB.pm @@ -1043,8 +1043,9 @@ FW_logWrapper($) FW_zoomLink("cmd=$cmd;off=1", "Next.png", "next"); FW_pO "
"; FW_pO ""; + my $logtype = $defs{$d}{TYPE}; my $wl = "&pos=" . join(";", map {"$_=$FW_pos{$_}"} keys %FW_pos); - my $arg = "$FW_ME?cmd=showlog undef $d $type $file$wl"; + my $arg = "$FW_ME?cmd=showlog $logtype $d $type $file$wl"; if(AttrVal($d,"plotmode",$FW_plotmode) eq "SVG") { my ($w, $h) = split(",", AttrVal($d,"plotsize",$FW_plotsize)); FW_pO ") { $l =~ s/\r//g; - if($l =~ m/^#FileLog (.*)$/) { +# if($l =~ m/^#FileLog (.*)$/) { + if($l =~ m/^#FileLog (.*)$/ && ($wltype eq "fileplot" || $wl eq "FileLog")) { + push(@filelog, $1); + } elsif ($l =~ m/^#DbLog (.*)$/ && ($wltype eq "dbplot" || $wl eq "DbLog")) { push(@filelog, $1); } elsif($l =~ "^plot" || $plot) { $plot .= $l; @@ -1260,6 +1268,7 @@ FW_showLog($) $ret = CommandReload(undef, "98_SVG"); Log 0, $ret if($ret); } + Log 5, "plotcommand: get $d $file INT $f $t " . join(" ", @{$flog}); $ret = FW_fC("get $d $file INT $f $t " . join(" ", @{$flog})); ($cfg, $plot) = FW_substcfg(1, $wl, $cfg, $plot, $file, ""); FW_pO SVG_render($wl, $f, $t, $cfg, $internal_data, $plot, $FW_wname, $FW_dir); @@ -1775,11 +1784,11 @@ FW_showWeblink($$$$) FW_pO "
"; - } elsif($t eq "fileplot") { + } elsif($t eq "fileplot" || $t eq "dbplot" ) { # plots navigation buttons - if($buttons && - $defs{$d}{WLTYPE} eq "fileplot" && + if($buttons && + ($defs{$d}{WLTYPE} eq "fileplot" || $defs{$d}{WLTYPE} eq "dbplot")&& !AttrVal($d, "fixedrange", undef)) { FW_zoomLink("zoom=-1", "Zoom-in.png", "zoom in"); @@ -1791,15 +1800,20 @@ FW_showWeblink($$$$) } my @va = split(":", $v, 3); - if(@va != 3 || !$defs{$va[0]} || !$defs{$va[0]}{currentlogfile}) { - FW_pO "Broken definition for $d: $v
"; - + if($defs{$d}{WLTYPE} eq "fileplot" && (@va != 3 || !$defs{$va[0]} || !$defs{$va[0]}{currentlogfile})) { + FW_pO "Broken definition for fileplot $d: $v
"; + } elsif ($defs{$d}{WLTYPE} eq "dbplot" && (@va != 2 || !$defs{$va[0]})) { + FW_pO "Broken definition for dbplot $d: $v
"; } else { - if($va[2] eq "CURRENT") { + if(defined($va[2]) && $va[2] eq "CURRENT") { $defs{$va[0]}{currentlogfile} =~ m,([^/]*)$,; $va[2] = $1; } + if ($defs{$d}{WLTYPE} eq "dbplot") { + $va[2] = "-"; + } + my $wl = "&pos=" . join(";", map {"$_=$FW_pos{$_}"} keys %FW_pos); my $arg="$FW_ME?cmd=showlog $d $va[0] $va[1] $va[2]$wl"; diff --git a/fhem/webfrontend/pgm2/98_weblink.pm b/fhem/webfrontend/pgm2/98_weblink.pm index 5dfde1009..666bfaa47 100755 --- a/fhem/webfrontend/pgm2/98_weblink.pm +++ b/fhem/webfrontend/pgm2/98_weblink.pm @@ -22,7 +22,7 @@ weblink_Define($$) { my ($hash, $def) = @_; my ($type, $name, $wltype, $link) = split("[ \t]+", $def, 4); - my %thash = ( link=>1, fileplot=>1, image=>1, iframe=>1, htmlCode=>1 ); + my %thash = ( link=>1, fileplot=>1, dbplot=>1, image=>1, iframe=>1, htmlCode=>1 ); if(!$link || !$thash{$wltype}) { return "Usage: define weblink [" .