diff --git a/FHEM/95_Dashboard.pm b/FHEM/95_Dashboard.pm index ea0b33590..dc4d9dd0b 100644 --- a/FHEM/95_Dashboard.pm +++ b/FHEM/95_Dashboard.pm @@ -34,14 +34,13 @@ # 2.03: dashboard_showfullsize only in DashboardRoom. Tabs can show Icons (new Attributes). Fix showhelper Bug on lock/unlock. # The error that after a trigger action the curren tab is changed to the "old" activetab tab has been fixed. dashboard_activetab # is stored after tab change -# 2.04: change view of readingroups. Attribute dashboard_groups removed. New Attribute dashboard_webfrontendfilter to define -# separate Dashboards per FHEMWEB Instance. # # Known Bugs/Todos: # BUG: Nicht alle Inhalte aller Tabs laden, bei Plots dauert die bedienung des Dashboards zu lange. -> elemente hidden? -# x TODO: Dashboard Config diverenzieren je auflösung -# x TODO: Darstellung von z.B. readingGroups -# TODO: personalisiertes CSS angeben und bestehende CSS zu überschreiben -> User-config +# x BUG: wenn ich mehrere Tabs habe und zb. im Uten Tab eine Lampe schalte, springt er danach direkt in den ersten Tab. Finde ich etwas unglücklich. +# x BUG: Lock blendet schow helper nicht aus? +# x BUG: dashboard_showfullsize nicht in room everything +# x TODO: Icon on Tabs # Log 1, "[DASHBOARD simple debug] '".$g."' "; ######################################################################################## # @@ -86,7 +85,7 @@ my $fwjquery = "jquery.min.js"; my $fwjqueryui = "jquery-ui.min.js"; my $dashboardname = "Dashboard"; # Link Text my $dashboardhiddenroom = "DashboardRoom"; # Hiddenroom -my $dashboardversion = "2.04"; +my $dashboardversion = "2.03"; # ------------------------------------------------------------------------------------------- sub Dashboard_Initialize ($) { @@ -136,10 +135,9 @@ sub Dashboard_Initialize ($) { "dashboard_tab3icon ". "dashboard_tab4icon ". "dashboard_tab5icon ". - #new attribute vers. 2.04 - "dashboard_webfrontendfilter ". #obsolete - erase in future releases + "dashboard_groups ". # obsolet -> erase in future releases "dashboard_colheight ". # obsolet -> erase in future releases "dashboard_sorting ". # obsolet -> erase in future releases "dashboard_colwidth ". # obsolet -> erase in future releases @@ -177,7 +175,6 @@ sub DashboardAsHtml($) my $showtabs = AttrVal($defs{$d}{NAME}, "dashboard_showtabs", "tabs-and-buttonbar-at-the-top"); my $showtooglebuttons = AttrVal($defs{$d}{NAME}, "dashboard_showtooglebuttons", 1); my $showfullsize = AttrVal($defs{$d}{NAME}, "dashboard_showfullsize", 0); - my $webfrontendfilter = AttrVal($defs{$d}{NAME}, "dashboard_webfrontendfilter", "*"); my $row = AttrVal($defs{$d}{NAME}, "dashboard_row", "center"); my $debug = AttrVal($defs{$d}{NAME}, "dashboard_debug", "0"); @@ -230,21 +227,6 @@ sub DashboardAsHtml($) return $ret; } - ############# Filter Dashboard display depending on $FW_wname ################################### - if ($webfrontendfilter ne "*") { - my $filterhit = 0; - my @webfilter = split(",", $webfrontendfilter); - for (my $i=0;$i<@webfilter;$i++){ - if (trim($FW_wname) eq trim($webfilter[$i])) { $filterhit = 1; } - } - if ($filterhit == 0) { - $ret .= "No Dashboard configured for ".$FW_wname."
"; - $ret .= "Set Attribute dashboard_webfrontendfilter, see Details"; - return $ret; - } - } - ################################################################################## - 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"; } @@ -436,40 +418,18 @@ sub BuildGroup($) my $type = $defs{$d}{TYPE}; my $devName = AttrVal($d, "alias", $d); my $icon = AttrVal($d, "icon", ""); - $icon = FW_makeImage($icon,$icon,"icon dashboard_groupicon") . " " if($icon); - if($FW_hiddenroom{detail}) { - $ret .= "
$icon$devName
"; - } + if($FW_hiddenroom{detail}) { $ret .= "
$icon$devName
"; } else { if ($type ne "weblink" && $type ne "SVG" && $type ne "readingsGroup") { # Don't show Link by weblink, svg and readingsGroup - $ret .= FW_pH "detail=$d", "$icon$devName", 1, "col1", 1; + $ret .=FW_pH "detail=$d", "$icon$devName", 1, "col1", 1; } - } - + } $row++; my ($allSets, $cmdlist, $txt) = FW_devState($d, $rf, \%extPage); - - ################ Edit Result for readingroup etc. ##################### - my @txtarray = split(">", $txt); - if ($type eq "readingsGroup" && $txtarray[0] eq " -1) {$storeinfo = 0; } - if ($storeinfo == 3) { $txtreturn .= $txtarray[$i].">"; } - if ($storeinfo == 2 && index($txtarray[$i]," -1 ) { $storeinfo = $storeinfo+1;} - if ($storeinfo == 1 && index($txtarray[$i]," -1 ) { $linkreturn = $txtarray[$i].">"; } - if (index($txtarray[$i]," -1) {$storeinfo = $storeinfo+1; } - } - ####if ($helper == 1) {$txtreturn .= "";} - $ret .= "$txtreturn"; - } else { $ret .= "$txt"; } - ########################################################### + $ret .= "$txt"; ###### Commands, slider, dropdown if(!$FW_ss && $cmdlist) { @@ -488,7 +448,7 @@ sub BuildGroup($) if($htmlTxt) { $ret .= $htmlTxt; } else { - $ret .= FW_pH "cmd.$d=set $d $cmd$rf", $cmd, 1, "col3", 1; + $ret .=FW_pH "cmd.$d=set $d $cmd$rf", $cmd, 1, "col3", 1; } } } @@ -584,6 +544,12 @@ sub CheckDashboardAttributUssage($) { # replaces old disused attributes and thei { FW_fC("deleteattr ".$d." dashboard_colheight"); } $detailnote = $detailnote." [dashboard_colheight -> dashboard_rowcenterheight]"; } + my $groups = AttrVal($defs{$d}{NAME}, "dashboard_groups", ""); + if ($groups ne "") { + { FW_fC("attr ".$d." dashboard_tab1groups ".$groups); } + { FW_fC("deleteattr ".$d." dashboard_groups"); } + $detailnote = $detailnote." [dashboard_groups -> dashboard_tab1groups]"; + } my $sorting = AttrVal($defs{$d}{NAME}, "dashboard_sorting", ""); if ($sorting ne "") { #convert old sorting in new my @sortings = split(":", $sorting); @@ -627,7 +593,7 @@ sub CheckDashboardAttributUssage($) { # replaces old disused attributes and thei # ------------------------------------------------------------------------------------------------------------------------ # Get out any change to the Logfile - if ($buttonbar ne "" || $sorting ne "") { + if ($buttonbar ne "" || $groups ne "" || $sorting ne "") { Log3 $hash, 3, "[".$hash->{NAME}. " V".$dashboardversion."]"." Using an outdated no longer used Attribute or Value. This has been corrected. Don't forget to save config. ".$detailnote; } } @@ -675,7 +641,7 @@ sub Dashboard_define ($$) { CheckInstallation($hash); CheckDashboardEntry($hash); - + return; } @@ -785,16 +751,6 @@ sub Dashboard_attr($$$) {
  • dashboard_tab5name
    Title of Tab 5. Default: Dashboard-Tab 5 -

  • - -
  • dashboard_webfrontendfilter
    - If this attribute not set, or value is * the dashboard is displayed on all configured FHEMWEB instances.
    - Set the Name of an FHEMWEB instance (eg WEB) to the Dashboard appears only in this.
    - There may be several valid instances are separated by comma eg WEB,WEBtablet.
    - This makes it possible to define an additional dashboard that only Show on Tablet (which of course an own instance FHEMWEB use).
    - Default: * -
    - It should NEVER two ore more activ dashboards in a FHEMWEB instance!

  • dashboard_sorting
    @@ -866,6 +822,11 @@ sub Dashboard_attr($$$) { Height of the bottom row in which the groups may be positioned.
    Default: 250

  • + +
  • dashboard_groups
    + This attribute is no longer used and will be removed at a later date. It was replaced with
    + dashboard_tab1groups, dashboard_tab2groups, dashboard_tab3groups, dashboard_tab4groups, dashboard_tab5groups +

  • dashboard_tab1groups
    Comma-separated list of the names of the groups to be displayed in Tab 1. @@ -994,48 +955,38 @@ sub Dashboard_attr($$$) {
  • dashboard_tabcount
    Gibt die Anzahl der angezeigten Tabs an. - Standard: 1 + Default: 1

  • dashboard_activetab
    Gibt an welches Tab aktiviert ist. Kann manuell gesetzt werden, wird aber auch durch den Schalter "Set" auf das gerade aktive Tab gesetzt. - Standard: 1 + Default: 1

  • dashboard_tab1name
    Titel des 1. Tab. - Standard: Dashboard-Tab 1 + Default: Dashboard-Tab 1

  • dashboard_tab2name
    Titel des 2. Tab. - Standard: Dashboard-Tab 2 + Default: Dashboard-Tab 2

  • dashboard_tab3name
    Titel des 3. Tab. - Standard: Dashboard-Tab 3 + Default: Dashboard-Tab 3

  • dashboard_tab4name
    Titel des 4. Tab. - Standard: Dashboard-Tab 4 + Default: Dashboard-Tab 4

  • dashboard_tab5name
    Titel des 5. Tab. - Standard: Dashboard-Tab 5 -

  • - -
  • dashboard_webfrontendfilter
    - Ist dieses Attribut nicht gesetzt, oder hat den Wert * wird das Dashboard auf allen konfigurierten FHEMWEB Instanzen angezeigt.
    - Wird dem Attribut der Name einer FHEMWEB Instanz (z.B. WEB) zugewiesen so wird das Dashboard nur in dieser Instanz angezeigt.
    - Es können auch mehrere Instanzen durch Komma getrennt angegeben werden, z.B. WEB,WEBtablet. Dadurch ist es möglich ein
    - zusätzliches Dashboard zu definieren und dieses nur z.B. auf Tablet anzeigen zulassen (die natürlich eine eigenen FHEMWEB Instanz verwenden).
    - Standard: *
    -
    - Es dürfen NIE zwei Dashboards in einer FHEMWEB instanz aktiv sein! -

  • + Default: Dashboard-Tab 5 +
  • dashboard_sorting
    Dieses Attribut ist nicht mehr zu verwenden und wird zu einem späteren Zeitpunkt entfernt. Es wurde ersetzt durch
    @@ -1106,6 +1057,11 @@ sub Dashboard_attr($$$) { Höhe der unteren Zeile, in der die Gruppen angeordnet werden.
    Standard: 250

  • + +
  • dashboard_groups
    + Dieses Attribut ist nicht mehr zu verwenden und wird zu einem späteren Zeitpunkt entfernt. Es wurde ersetzt durch
    + dashboard_tab1groups, dashboard_tab2groups, dashboard_tab3groups, dashboard_tab4groups, dashboard_tab5groups. +

  • dashboard_tab1groups
    Durch Komma getrennte Liste mit den Namen der Gruppen, die im Tab 1 angezeigt werden. Falsche Gruppennamen werden hervorgehoben.