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

FHEMWEB: fix problem for identical attribute/reading (Forum #82586)

git-svn-id: https://svn.fhem.de/fhem/trunk@15850 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2018-01-11 22:04:01 +00:00
parent 27da034704
commit 86c7248925
2 changed files with 9 additions and 6 deletions

View File

@ -1203,6 +1203,7 @@ FW_makeTable($$$@)
my $si = AttrVal("global", "showInternalValues", 0); my $si = AttrVal("global", "showInternalValues", 0);
my $row = 1; my $row = 1;
my $prefix = ($title eq "Attributes" ? "a-" : "");
foreach my $n (sort keys %{$hash}) { foreach my $n (sort keys %{$hash}) {
next if(!$si && $n =~ m/^\./); # Skip "hidden" Values next if(!$si && $n =~ m/^\./); # Skip "hidden" Values
my $val = $hash->{$n}; my $val = $hash->{$n};
@ -1236,12 +1237,12 @@ FW_makeTable($$$@)
FW_pO "<td><div class=\"dval\">$v$t</div></td>"; FW_pO "<td><div class=\"dval\">$v$t</div></td>";
} else { } else {
$t = "" if(!$t); $t = "" if(!$t);
FW_pO "<td><div class=\"dval\" informId=\"$name-$n\">$v</div></td>"; FW_pO "<td><div class=\"dval\" informId=\"$name-$prefix$n\">$v</div></td>";
FW_pO "<td><div informId=\"$name-$n-ts\">$t</div></td>"; FW_pO "<td><div informId=\"$name-$prefix$n-ts\">$t</div></td>";
} }
} else { } else {
$val = FW_htmlEscape($val); $val = FW_htmlEscape($val);
my $tattr = "informId=\"$name-$n\" class=\"dval\""; my $tattr = "informId=\"$name-$prefix$n\" class=\"dval\"";
# if possible provide some links # if possible provide some links
if ($n eq "room"){ if ($n eq "room"){
@ -2824,7 +2825,7 @@ FW_Notify($$)
$dn = $1 if($dev->{CHANGED}->[0] =~ m/^MODIFIED (.*)$/); $dn = $1 if($dev->{CHANGED}->[0] =~ m/^MODIFIED (.*)$/);
if($dev->{CHANGED}->[0] =~ m/^ATTR ([^ ]+) ([^ ]+) (.*)$/s) { if($dev->{CHANGED}->[0] =~ m/^ATTR ([^ ]+) ([^ ]+) (.*)$/s) {
$dn = $1; $dn = $1;
my @a = ("$2: $3"); my @a = ("a-$2: $3");
$events = \@a; $events = \@a;
} }
} }

View File

@ -1232,8 +1232,10 @@ FW_replaceWidget(oldEl,devName,vArr,currVal,reading,set,params,cmd,readyFn)
$(newEl).addClass(wn+"_widget"); $(newEl).addClass(wn+"_widget");
if( $(newEl).find("[informId]").length==0 && !$(newEl).attr("informId") ) { if( $(newEl).find("[informId]").length==0 && !$(newEl).attr("informId") ) {
if(reading) if(reading) {
$(newEl).attr("informId", devName+"-"+reading); var a = $(oldEl).closest("form").find("input[type=submit][value=attr]");
$(newEl).attr("informId", devName+(a.length?"-a-":"-")+reading);
}
var addTitle = $("body").attr("data-addHtmlTitle"); var addTitle = $("body").attr("data-addHtmlTitle");
if(reading != "state" && addTitle==1) if(reading != "state" && addTitle==1)
$(newEl).attr("title", reading); $(newEl).attr("title", reading);