mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
FHEMWEB: Small speedup in room overview if showRoom is not set
git-svn-id: https://svn.fhem.de/fhem/trunk@5967 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
65ba53ed28
commit
57b778d54c
@ -772,31 +772,19 @@ FW_digestCgi($)
|
|||||||
sub
|
sub
|
||||||
FW_updateHashes()
|
FW_updateHashes()
|
||||||
{
|
{
|
||||||
#################
|
%FW_rooms = (); # Make a room hash
|
||||||
# Make a room hash
|
%FW_groups = (); # Make a group hash
|
||||||
%FW_rooms = ();
|
%FW_types = (); # Needed for type sorting
|
||||||
|
|
||||||
foreach my $d (keys %defs ) {
|
foreach my $d (keys %defs ) {
|
||||||
next if(IsIgnored($d));
|
next if(IsIgnored($d));
|
||||||
|
|
||||||
foreach my $r (split(",", AttrVal($d, "room", "Unsorted"))) {
|
foreach my $r (split(",", AttrVal($d, "room", "Unsorted"))) {
|
||||||
$FW_rooms{$r}{$d} = 1;
|
$FW_rooms{$r}{$d} = 1;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#################
|
|
||||||
# Make a group hash
|
|
||||||
%FW_groups = ();
|
|
||||||
foreach my $d (keys %defs ) {
|
|
||||||
next if(IsIgnored($d));
|
|
||||||
foreach my $r (split(",", AttrVal($d, "group", ""))) {
|
foreach my $r (split(",", AttrVal($d, "group", ""))) {
|
||||||
$FW_groups{$r}{$d} = 1;
|
$FW_groups{$r}{$d} = 1;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
###############
|
|
||||||
# Needed for type sorting
|
|
||||||
%FW_types = ();
|
|
||||||
foreach my $d (sort keys %defs ) {
|
|
||||||
next if(IsIgnored($d));
|
|
||||||
my $t = AttrVal($d, "subType", $defs{$d}{TYPE});
|
my $t = AttrVal($d, "subType", $defs{$d}{TYPE});
|
||||||
$t = AttrVal($d, "model", $t) if($t && $t eq "unknown"); # RKO: ???
|
$t = AttrVal($d, "model", $t) if($t && $t eq "unknown"); # RKO: ???
|
||||||
$FW_types{$d} = $t;
|
$FW_types{$d} = $t;
|
||||||
@ -1096,13 +1084,21 @@ FW_roomOverview($)
|
|||||||
}
|
}
|
||||||
$FW_room = "" if(!$FW_room);
|
$FW_room = "" if(!$FW_room);
|
||||||
|
|
||||||
my @sortBy = split( " ", AttrVal( $FW_wname, "sortRooms", "" ) );
|
my @rlist;
|
||||||
@sortBy = sort keys %FW_rooms if( scalar @sortBy == 0 );
|
if(AttrVal($FW_wname, "sortRooms", "")) { # Slow!
|
||||||
|
my @sortBy = split( " ", AttrVal( $FW_wname, "sortRooms", "" ) );
|
||||||
|
@rlist = sort { FW_roomIdx(@sortBy,$a) cmp
|
||||||
|
FW_roomIdx(@sortBy,$b) } keys %FW_rooms;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
@rlist = sort keys %FW_rooms;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
##########################
|
##########################
|
||||||
# Rooms and other links
|
# Rooms and other links
|
||||||
foreach my $r ( sort { FW_roomIdx(@sortBy,$a) cmp
|
foreach my $r (@rlist) {
|
||||||
FW_roomIdx(@sortBy,$b) } keys %FW_rooms ) {
|
|
||||||
next if($r eq "hidden" || $FW_hiddenroom{$r});
|
next if($r eq "hidden" || $FW_hiddenroom{$r});
|
||||||
$FW_room = $r if(!$FW_room && $FW_ss);
|
$FW_room = $r if(!$FW_room && $FW_ss);
|
||||||
$r =~ s/</</g;
|
$r =~ s/</</g;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user