2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 06:39:11 +00:00

FileLog.pm: add patch from Boris (Forum #32706) and fix wizard.

git-svn-id: https://svn.fhem.de/fhem/trunk@7690 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2015-01-24 13:49:08 +00:00
parent 5356c644fb
commit e64166a0e0
2 changed files with 33 additions and 31 deletions

View File

@ -996,9 +996,9 @@ FW_makeTable($$$@)
##############################
# Used only for set or attr lists.
sub
FW_detailSelect($$$$)
FW_detailSelect(@)
{
my ($d, $cmd, $list,$class) = @_;
my ($d, $cmd, $list, $param) = @_;
return if(!$list || $FW_hiddenroom{input});
my @al = sort map { s/:.*//;$_ } split(" ", $list);
@ -1007,17 +1007,20 @@ FW_detailSelect($$$$)
$selEl = "room" if($list =~ m/room:/);
$list =~ s/"/"/g;
FW_pO "<div class='makeSelect' dev=\"$d\" cmd=\"$cmd\" list=\"$list\">";
FW_pO "<form method=\"$FW_formmethod\" ".
"action=\"$FW_ME$FW_subdir\" autocomplete=\"off\">";
FW_pO FW_hidden("detail", $d);
FW_pO FW_hidden("fwcsrf", $defs{$FW_wname}{CSRFTOKEN}) if($FW_CSRF);
FW_pO FW_hidden("dev.$cmd$d", $d);
FW_pO FW_submit("cmd.$cmd$d", $cmd, $class);
FW_pO "<div class=\"$class downText\">&nbsp;$d&nbsp;</div>";
FW_pO FW_select("sel_$cmd$d","arg.$cmd$d",\@al, $selEl, $class);
FW_pO FW_textfield("val.$cmd$d", 30, $class);
FW_pO "</form></div>";
my $ret ="";
$ret .= "<div class='makeSelect' dev=\"$d\" cmd=\"$cmd\" list=\"$list\">";
$ret .= "<form method=\"$FW_formmethod\" ".
"action=\"$FW_ME$FW_subdir\" autocomplete=\"off\">";
$ret .= FW_hidden("detail", $d);
$ret .= FW_hidden("fwcsrf", $defs{$FW_wname}{CSRFTOKEN}) if($FW_CSRF);
$ret .= FW_hidden("dev.$cmd$d", $d.($param ? " $param":""));
$ret .= FW_submit("cmd.$cmd$d", $cmd, $cmd);
$ret .= "<div class=\"$cmd downText\">&nbsp;$d&nbsp;".
($param ? "&nbsp;$param":"")."</div>";
$ret .= FW_select("sel_$cmd$d","arg.$cmd$d",\@al, $selEl, $cmd);
$ret .= FW_textfield("val.$cmd$d", 30, $cmd);
$ret .= "</form></div>";
return $ret;
}
##############################
@ -1053,8 +1056,8 @@ FW_doDetail($)
use strict "refs";
}
FW_detailSelect($d, "set", FW_widgetOverride($d, getAllSets($d)), "set");
FW_detailSelect($d, "get", FW_widgetOverride($d, getAllGets($d)), "get");
FW_pO FW_detailSelect($d, "set", FW_widgetOverride($d, getAllSets($d)));
FW_pO FW_detailSelect($d, "get", FW_widgetOverride($d, getAllGets($d)));
FW_makeTable("Internals", $d, $h);
FW_makeTable("Readings", $d, $h->{READINGS});
@ -1069,7 +1072,7 @@ FW_doDetail($)
$attrList = FW_widgetOverride($d, $attrList);
$attrList =~ s/\\/\\\\/g;
$attrList =~ s/'/\\'/g;
FW_detailSelect($d, "attr", $attrList,"attr");
FW_pO FW_detailSelect($d, "attr", $attrList);
FW_makeTable("Attributes", $d, $attr{$d}, "deleteattr");
## dependent objects

View File

@ -325,8 +325,15 @@ FileLog_fhemwebFn($$$$)
$ret .= "<br>Regexp parts";
$ret .= "<br><table class=\"block wide\">";
my @ra = split(/\|/, $hash->{REGEXP});
if(@ra > 1) {
my $regexp= $hash->{REGEXP};
my @ra= ();
while($regexp =~ /^(.+?:.+?)\|(.+?:.+)$/) {
push @ra, $1;
$regexp= $2;
}
push @ra, $regexp;
if(@ra > 0) {
foreach my $r (@ra) {
$ret .= "<tr class=\"".(($row++&1)?"odd":"even")."\">";
my $cmd = "cmd.X= set $d removeRegexpPart&val.X=$r"; # =.set: avoid JS
@ -359,20 +366,12 @@ FileLog_fhemwebFn($$$$)
$list .= " $dev:" . join(",", sort keys %{$dh{$dev}});
push @al, $dev;
}
$ret .= "<tr class=\"".(($row++&1)?"odd":"even")."\">";
$ret .= "<td colspan=\"2\"><form autocomplete=\"off\">";
$ret .= FW_hidden("detail", $d);
$ret .= FW_hidden("dev.$d", "$d addRegexpPart");
$ret .= FW_submit("cmd.$d", "set", "set");
$ret .= "<div class=\"set downText\">&nbsp;$d addRegexpPart&nbsp;</div>";
$list =~ s/(['"])/./g;
$ret .= FW_select("","arg.$d",\@al, undef, "set",
"FW_selChange(this.options[selectedIndex].text,'$list','val.$d')");
$ret .= FW_textfield("val.$d", 30, "set");
my $al0 = (@al ? $al[0] : "");
$ret .= "<script type=\"text/javascript\">" .
"FW_selChange('$al0','$list','val.$d')</script>";
$ret .= "</form></td></tr>";
$ret .= "<tr class=\"".(($row++&1)?"odd":"even")."\">";
$ret .= '<td colspan="2">';
$ret .= FW_detailSelect($d, "set", $list, "addRegexpPart");
$ret .= "</td></tr>";
}
$ret .= "</table>";