diff --git a/fhem/CHANGED b/fhem/CHANGED index 6b18c9559..f73a50141 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,6 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - feature: 95_Dashboard: new attribute "noLinks" - no links to devices detail - feature: 49_SSCamSTRM: new attribute "noLink" - suppress link to detail view - bugfix: 49_SSCam: fix warnings, Forum: 45671#msg975610 - change: 70_ZoneMinder: improved contents of state (thx Florian_GT) diff --git a/fhem/FHEM/95_Dashboard.pm b/fhem/FHEM/95_Dashboard.pm index ad3440b87..a0d17b482 100644 --- a/fhem/FHEM/95_Dashboard.pm +++ b/fhem/FHEM/95_Dashboard.pm @@ -55,6 +55,7 @@ use vars qw($FW_ss); # is smallscreen, needed by 97_GROUP/95_VIEW # Versions History intern our %Dashboard_vNotesIntern = ( + "3.11.1" => "16.09.2019 new attribute noLinks ", "3.11.0" => "16.09.2019 attr dashboard_activetab is now working properly, commandref revised, calculate attribute ". "dashboard_activetab (is now a userattr) ", "3.10.1" => "29.06.2018 added FW_hideDisplayName, Forum #88727 ", @@ -84,19 +85,19 @@ sub Dashboard_Initialize ($) { $hash->{FW_detailFn} = "Dashboard_DetailFN"; $hash->{AttrFn} = "Dashboard_attr"; $hash->{AttrList} = "disable:0,1 ". - "dashboard_colcount:1,2,3,4,5 ". - "dashboard_debug:0,1 ". + "dashboard_backgroundimage ". + "dashboard_colcount:1,2,3,4,5 ". + "dashboard_customcss " . + "dashboard_debug:0,1 ". + "dashboard_flexible " . "dashboard_rowtopheight ". "dashboard_rowbottomheight ". - "dashboard_row:top,center,bottom,top-center,center-bottom,top-center-bottom ". - "dashboard_showtogglebuttons:0,1 ". - "dashboard_width ". + "dashboard_row:top,center,bottom,top-center,center-bottom,top-center-bottom ". "dashboard_rowcenterheight ". "dashboard_rowcentercolwidth ". "dashboard_showfullsize:0,1 ". "dashboard_showtabs:tabs-and-buttonbar-at-the-top,tabs-and-buttonbar-on-the-bottom,tabs-and-buttonbar-hidden ". - "dashboard_customcss " . - "dashboard_flexible " . + "dashboard_showtogglebuttons:0,1 ". "dashboard_tab1name " . "dashboard_tab1groups " . "dashboard_tab1devices " . @@ -113,7 +114,8 @@ sub Dashboard_Initialize ($) { "dashboard_tab[0-9]+colcount " . "dashboard_tab[0-9]+rowcentercolwidth " . "dashboard_tab[0-9]+backgroundimage " . - "dashboard_backgroundimage"; + "dashboard_width ". + "noLinks:1,0 "; $data{FWEXT}{jquery}{SCRIPT} = "/pgm2/".$fwjquery if (!$data{FWEXT}{jquery}{SCRIPT}); $data{FWEXT}{jqueryui}{SCRIPT} = "/pgm2/".$fwjqueryui if (!$data{FWEXT}{jqueryui}{SCRIPT}); @@ -147,8 +149,8 @@ sub Dashboard_define ($$) { my $url = '/dashboard/' . $name; - $data{FWEXT}{$url}{CONTENTFUNC} = 'Dashboard_CGI'; - $data{FWEXT}{$url}{LINK} = 'dashboard/' . $name; + $data{FWEXT}{$url}{CONTENTFUNC} = 'Dashboard_CGI'; # $data{FWEXT} = FHEMWEB Extension, siehe 01_FHEMWEB.pm + $data{FWEXT}{$url}{LINK} = 'dashboard/'.$name; $data{FWEXT}{$url}{NAME} = $name; return; @@ -180,6 +182,7 @@ sub Dashboard_Get($@) { my $arg = (defined($a[1]) ? $a[1] : ""); my $arg2 = (defined($a[2]) ? $a[2] : ""); + if ($arg eq "config") { my $name = $hash->{NAME}; my $attrdata = $attr{$name}; @@ -217,9 +220,10 @@ sub Dashboard_Get($@) { $res .= "}\n"; return $res; } + } elsif ($arg eq "groupWidget") { -#### Comming Soon ###### -# For dynamic load of GroupWidgets from JavaScript + #### Comming Soon ###### + # For dynamic load of GroupWidgets from JavaScript #my $dbgroup = ""; #for (my $p=2;$p<@a;$p++){$dbgroup .= @a[$p]." ";} #For Groupnames with Space #for (my $p=2;$p<@a;$p++){$dbgroup .= $a[$p]." ";} #For Groupnames with Space @@ -228,17 +232,17 @@ sub Dashboard_Get($@) { #%group = Dashboard_BuildGroupList($dashboard_groupListfhem); #$res .= Dashboard_BuildGroupWidgets(1,1,1212,trim($dbgroup),"t1c1,".trim($dbgroup).",true,0,0:"); #return $res; - #For dynamic loading of tabs + #For dynamic loading of tabs } elsif ($arg eq "tab" && $arg2 =~ /^\d+$/) { return Dashboard_BuildDashboardTab($arg2, $hash->{NAME}); + } elsif ($arg eq "icon") { shift @a; shift @a; - my $icon = join (' ', @a); - return FW_iconPath($icon); + } else { return "Unknown argument $arg choose one of config:noArg groupWidget tab icon"; } @@ -248,8 +252,9 @@ sub Dashboard_Escape($) { my $a = shift; return "null" if(!defined($a)); my %esc = ("\n" => '\n', "\r" => '\r', "\t" => '\t', "\f" => '\f', "\b" => '\b', "\"" => '\"', "\\" => '\\\\', "\'" => '\\\'', ); - $a =~ s/([\x22\x5c\n\r\t\f\b])/$esc{$1}/eg; - return $a; + $a =~ s/([\x22\x5c\n\r\t\f\b])/$esc{$1}/eg; + +return $a; } ################################################################ @@ -288,7 +293,7 @@ sub Dashboard_attr($$$) { if ($attrName =~ m/alias/) { # if an alias is set to the dashboard, replace the name shown in the left navigation by this alias - my $url = '/dashboard/' . $name; + my $url = '/dashboard/'.$name; $data{FWEXT}{$url}{NAME} = $attrVal; } } @@ -296,7 +301,7 @@ sub Dashboard_attr($$$) { # die Argumente für das Attribut dashboard_activetab dynamisch ermitteln und setzen my $f = Dashboard_calcAttrActiveTab ($name); delFromDevAttrList($name, "dashboard_activetab"); - addToDevAttrList($name, "dashboard_activetab:$f"); + addToDevAttrList ($name, "dashboard_activetab:$f"); return; } @@ -311,10 +316,10 @@ sub Dashboard_DetailFN() { my $ret = ""; $ret .= "\n"; $ret .= "\n"; $ret .= "
Helper:\n
\n"; - $ret .= " \n"; - $ret .= " \n"; - $ret .= " \n"; - $ret .= "
\n"; + $ret .= "\n"; + $ret .= "\n"; + $ret .= "\n"; + $ret .= "\n"; $ret .= "
\n"; @@ -327,15 +332,15 @@ return $ret; sub Dashboard_CGI($) { my ($htmlarg) = @_; - $htmlarg =~ s/^\///; # eliminate leading / + $htmlarg =~ s/^\///; # eliminate leading / my @params = split(/\//,$htmlarg); # split URL by / - my $ret = ''; - my $name = $params[1]; + my $ret = ''; + my $name = $params[1]; $ret = '
'; if ($name && defined($defs{$name})) { - my $showfullsize = AttrVal($defs{$name}{NAME}, "dashboard_showfullsize", 0); + my $showfullsize = AttrVal($name, "dashboard_showfullsize", 0); if ($showfullsize) { if ($FW_RET =~ m/]*class="([^"]+)"[^>]*>/) { @@ -346,7 +351,7 @@ sub Dashboard_CGI($) { } $ret .= Dashboard_SummaryFN($FW_wname,$name,$FW_room,undef); } else { - $ret .= 'Dashboard "' . $name . '" not found'; + $ret .= 'Dashboard "'.$name.'" not found'; } $ret .= '
'; @@ -367,7 +372,8 @@ sub DashboardAsHtml($) { } ############################################################################################# -# SummaryFn +# zentrale Dashboard Generierung +# (beachte $data{FWEXT} bzw. $data{FWEXT}{CONTENTFUNC} in 01_FHEMWEB.pm) ############################################################################################# sub Dashboard_SummaryFN ($$$$) { my ($FW_wname, $d, $room, $pageHash) = @_; @@ -413,11 +419,11 @@ sub Dashboard_SummaryFN ($$$$) { return ""; } - if ($debug == 1) { $debugfield = "edit"; } + if ($debug == 1) { $debugfield = "edit"; } if ($showtabs eq "tabs-and-buttonbar-at-the-top") { $showbuttonbar = "top"; } if ($showtabs eq "tabs-and-buttonbar-on-the-bottom") { $showbuttonbar = "bottom"; } - if ($showbuttonbar eq "hidden") { $lockstate = "lock"; } - if ($activetab > $tabcount) { $activetab = $tabcount; } + if ($showbuttonbar eq "hidden") { $lockstate = "lock"; } + if ($activetab > $tabcount) { $activetab = $tabcount; } $colwidth =~ tr/,/:/; if (not ($colheight =~ /^\d+$/)) { $colheight = 400; } @@ -434,29 +440,29 @@ sub Dashboard_SummaryFN ($$$$) { if ($room ne "all") { ############################ Set FHEM url to avoid hardcoding it in javascript ############################ - $ret .= ""; + $ret .= ""; $ret .= "
\n"; - $ret .= "
\n"; - $ret .= " \n"; - $ret .= "
\n"; - $ret .= " \n"; - $ret .= " \n"; - $ret .= " "; - $ret .= " "; + $ret .= "
\n"; + $ret .= "\n"; + $ret .= "
\n"; + $ret .= "
Tabtitle:
Tabicon:
\n"; + $ret .= "\n"; + $ret .= ""; + $ret .= ""; # the method FW_multipleSelect seems not to be available any more in fhem - #$ret .= " "; - $ret .= " "; - $ret .= " "; - $ret .= "
Tabtitle:
Tabicon:
Groups:
Groups:
\n"; - $ret .= "
\n"; - $ret .= "
\n"; + #$ret .= "Groups:"; + $ret .= "Groups:"; + $ret .= ""; + $ret .= "\n"; + $ret .= "
\n"; + $ret .= "
\n"; $ret .= "Comming soon"; - $ret .= "
\n"; - $ret .= "
\n"; + $ret .= "
\n"; + $ret .= "\n"; $ret .= "\n"; $ret .= "
$name
\n"; @@ -466,7 +472,7 @@ sub Dashboard_SummaryFN ($$$$) { $ret .= "\n"; $ret .= "\n"; $ret .= "\n"; - $ret .= "
\n"; + $ret .= "
\n"; ########################### Dashboard Tab-Liste ############################################## $ret .= "