diff --git a/fhem/CHANGED b/fhem/CHANGED index 9cdd0f1b4..fd11a1578 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,6 +1,9 @@ # 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. - SVN + - feature: DASHBOARD: Use longpoll to update content. + rowcentercolwidth can now be defined per column. + Dashboard can hide FHEMWEB Roomliste and Header => Fullsizemode. - bugfix: SYSMON: null reading for absent mount points - feature: DbLog: jokers "%" in device/reading definition are now possible - feature: SYSMON: new CPU Statistics and Plots diff --git a/fhem/FHEM/95_Dashboard.pm b/fhem/FHEM/95_Dashboard.pm index ae2b06114..8899e648a 100644 --- a/fhem/FHEM/95_Dashboard.pm +++ b/fhem/FHEM/95_Dashboard.pm @@ -29,13 +29,17 @@ # Many changes in Dasboard.js. Replaced the attributes dashboard_groups, dashboard_colheight and dashboard_sorting # Many new Attributes vor Tabs, Dashboard sizing. Set of mimimal attributes (helpful for beginners). # Provisionally the columns widths are dependent on the total width of the Dashboard. +# 2.01: attibute dashboard_colwidth replace with dashboard_rowcentercolwidth. rowcentercolwidth can now be defined per +# column. Delete Groups Attribut with Value 1. Dashboard can hide FHEMWEB Roomliste and Header => Fullscreenmode # # Known Bugs/Todos: -# TODO: demo.fhem.cfg -# TODO: sorting attribut with value 1 -> erase attribute? -# TODO: dashboard_colwidth -> <1.col, 2.col, 3.col ...> only <1.col>, first col = value, split rest on colcount. +# x TODO: groups attribut with value 1 -> erase attribute? +# x TODO: dashboard_colwidth -> <1.col, 2.col, 3.col ...> only <1.col>, first col = value, split rest on colcount. # TODO: Tab top, bottom, hidden # BUG: Longpoll dosen't work on Dashboard +# 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. +# TODO: Icon on Tabs +# x NICETOHAVE: Ich würde mir jetzt noch wünschen, das ich den linken und oberen Bereich in einem Style ausblenden kann # Log 1, "[DASHBOARD simple debug] '".$g."' "; ######################################################################################## # @@ -76,24 +80,22 @@ use vars qw(%FW_types); # device types # --------------------------- Global Variable ----------------------------------------------- my %group; -#my %dashboarddata; my $fwjquery = "jquery.min.js"; my $fwjqueryui = "jquery-ui.min.js"; my $dashboardname = "Dashboard"; # Link Text my $dashboardhiddenroom = "DashboardRoom"; # Hiddenroom -my $dashboardversion = "2.00"; +my $dashboardversion = "2.01"; # ------------------------------------------------------------------------------------------- sub Dashboard_Initialize ($) { my ($hash) = @_; $hash->{DefFn} = "Dashboard_define"; - $hash->{UndefFn} = "Dashboard_Undef"; - $hash->{FW_detailFn} = "Dashboard_detailFn"; - $hash->{AttrFn} = "Dashboard_Attr"; + $hash->{UndefFn} = "Dashboard_undef"; + #$hash->{FW_detailFn} = "Dashboard_detailFn"; + $hash->{AttrFn} = "Dashboard_attr"; $hash->{AttrList} = "disable:0,1 ". - "dashboard_colcount:1,2,3,4,5 ". - "dashboard_colwidth ". # obsolet -> always calculated to 100%. future uses for separate columns wide + "dashboard_colcount:1,2,3,4,5 ". "dashboard_debug:0,1 ". "dashboard_lockstate:unlock,lock ". "dashboard_rowtopheight ". @@ -103,7 +105,7 @@ sub Dashboard_Initialize ($) { "dashboard_showhelper:0,1 ". "dashboard_showtooglebuttons:0,1 ". - #new attribute + #new attribute vers. 2.00 "dashboard_tabcount:1,2,3,4,5 ". "dashboard_activetab:1,2,3,4,5 ". "dashboard_tab1name ". @@ -123,20 +125,40 @@ sub Dashboard_Initialize ($) { "dashboard_tab5sorting ". "dashboard_width ". "dashboard_rowcenterheight ". + #new attribute vers. 2.01 + "dashboard_rowcentercolwidth ". + "dashboard_showfullsize:0,1 ". #obsolete - erase in future releases "dashboard_groups ". # obsolet -> erase in future releases "dashboard_colheight ". # obsolet -> erase in future releases - "dashboard_sorting ". # obsolet -> komplett ersetzen + "dashboard_sorting ". # obsolet -> erase in future releases + "dashboard_colwidth ". # obsolet -> erase in future releases $readingFnAttributes; + $data{FWEXT}{Dashboardx}{LINK} = "?room=".$dashboardhiddenroom; - $data{FWEXT}{Dashboardx}{NAME} = $dashboardname; + $data{FWEXT}{Dashboardx}{NAME} = $dashboardname; + + #$hash->{FW_detailFn} = "Dashboard_detailFn"; + #$hash->{FW_summaryFn} = "Dashboard_detailFn"; return undef; } +#sub Dashboard_detailFn() +#{ +# my ($FW_wname, $d, $room, $pageHash) = @_; # pageHash is set for summaryFn. +# return NewDashboardAsHtml($d); +#} +#sub NewDashboardAsHtml($) +#{ +# my $ret = ""; +# $ret .= "
";
- $ret .= "";
- $ret .= "";
- $ret .= " | |
\n";
+ $ret .= "\n";
+ $ret .= "\n";
+ $ret .= " | |
";
+ $ret .= " \n";
########################### Dashboard Tab-Liste ##############################################
- $ret .= " \n";
##############################################################################################
for (my $t=0;$t<$tabcount;$t++){
@@ -244,9 +269,9 @@ sub DashboardAsHtml($)
if (index($tabsortings[$t],trim($tabgroup[$i])) < 0) { $tabsortings[$t] = $tabsortings[$t]."t".$t."c".GetMaxColumnId($row,$colcount).",".trim($tabgroup[$i]).",true,0,0:"; }
}
%group = BuildGroupList($tabgroups[$t]);
- $ret .= " ";
- $ret .= " \n";
}
if ($showbuttonbar eq "bottom") { $ret .= BuildButtonBar($d,$showbuttonbar); }
- $ret .= "
|
define anyViews Dashboard
attr anyViews dashboard_colcount 2
- attr anyViews dashboard_colwidth 400
+ attr anyViews dashboard_rowcentercolwidth 30,70
attr anyViews dashboard_tab1groups <Group1>,<Group2>,<Group3>
attr anyViews dashboard_lockstate unlock
attr anyViews dashboard_showhelper 1
@@ -730,7 +772,8 @@ sub Dashboard_Attr($$$) {
dashboard_colwidth
- Width of each column in which the groups may be positioned.
+ This attribute is no longer used and will be removed at a later date. It was replaced with
+ dashboard_rowcentercolwidth
Default: 320
@@ -742,7 +785,16 @@ sub Dashboard_Attr($$$) {
dashboard_rowcenterheight
Height of the center row in which the groups may be positioned.
Default: 400
-
+
+
+ dashboard_rowcentercolwidth
+ About this attribute, the width of each column of the middle Dashboardrow can be set. It can be stored for each column a separate value.
+ The values must be separated by a comma (no spaces). Each value determines the column width in%! The first value specifies the width of the first column,
+ the second value of the width of the second column, etc. Is the sum of the width greater than 100 it is reduced.
+ If more columns defined as widths the missing widths are determined by the difference to 100. However, are less columns are defined as the values of
+ ignores the excess values.
+ Default: 100
+
dashboard_rowtopheight
Height of the top row in which the groups may be positioned.
@@ -789,7 +841,12 @@ sub Dashboard_Attr($$$) {
Number of columns in which the groups can be displayed. Nevertheless, it is possible to have multiple groups
to be positioned in a column next to each other. This is dependent on the width of columns and groups.
Default: 1
-
+
+
+ dashboard_showfullsize
+ Hide FHEMWEB Roomliste (complete left side) and Page Header if Value is 1.
+ Default: 0
+
dashboard_showbuttonbar
Displayed a buttonbar panel. Can set on Top or on Bottom of the Dashboard If the bar is hidden dashboard_lockstate the "lock" is used.
@@ -838,7 +895,7 @@ sub Dashboard_Attr($$$) {
define anyViews Dashboard
attr anyViews dashboard_colcount 2
- attr anyViews dashboard_colwidth 400
+ attr anyViews dashboard_rowcentercolwidth 30,70
attr anyViews dashboard_tab1groups <Group1>,<Group2>,<Group3>
attr anyViews dashboard_lockstate unlock
attr anyViews dashboard_showhelper 1
@@ -930,8 +987,8 @@ sub Dashboard_Attr($$$) {
dashboard_colwidth
- Breite der Spalte, in der die Gruppen angeordnet werden. Gilt für "dashboard_row center, top-center-bottom, center-bottom".
- Nur die Zeile in der Mitte kann mehrere Spalten enthalten!
+ Dieses Attribut ist nicht mehr zu verwenden und wird zu einem späteren Zeitpunkt entfernt. Es wurde ersetzt durch.
+ dashboard_rowcentercolwidth
Standard: 320
@@ -943,7 +1000,16 @@ sub Dashboard_Attr($$$) {
dashboard_rowcenterheight
Höhe der mittleren Zeile, in der die Gruppen angeordnet werden.
Standard: 400
-
+
+
+ dashboard_rowcentercolwidth
+ Über dieses Attribut wird die Breite der einzelnen Spalten der mittleren Dashboardreihe festgelegt. Dabei kann je Spalte ein separater Wert hinterlegt werden.
+ Die Werte sind durch ein Komma (ohne Leerzeichen) zu trennen. Jeder Wert bestimmt die Spaltenbreite in %! Der erste Wert gibt die Breite der ersten Spalte an,
+ der zweite Wert die Breite der zweiten Spalte usw. Ist die Summe der Breite größer als 100 werden die Spaltenbreiten reduziert.
+ Sind mehr Spalten als Breiten definiert werden die fehlenden Breiten um die Differenz zu 100 festgelegt. Sind hingegen weniger Spalten als Werte definiert werden
+ die überschüssigen Werte ignoriert.
+ Standard: 100
+
dashboard_rowtopheight
Höhe der oberen Zeile, in der die Gruppen angeordnet werden.
@@ -991,7 +1057,12 @@ sub Dashboard_Attr($$$) {
in einer Spalte nebeneinander zu positionieren. Dies ist abhängig von der Breite der Spalten und Gruppen.
Gilt nur für die mittlere Spalte!
Standard: 1
-
+
+
+ dashboard_showfullsize
+ Blendet die FHEMWEB Raumliste (kompleter linker Bereich der Seite) und den oberen Bereich von FHEMWEB aus wenn der Wert auf 1 gesetzt ist.
+ Default: 0
+
dashboard_showbuttonbar
Eine Buttonbar kann über oder unter dem Dashboard angezeigt werden. Wenn die Leiste ausgeblendet wird ist das Dashboard gespert.
diff --git a/fhem/www/pgm2/dashboard.js b/fhem/www/pgm2/dashboard.js
index 339b08f96..cf84bbad0 100644
--- a/fhem/www/pgm2/dashboard.js
+++ b/fhem/www/pgm2/dashboard.js
@@ -2,13 +2,13 @@
// dashboard.js
//########################################################################################
// Released : 14.11.2013 @svenson08
-// Version : 1.00
-// Revisions:
+// Version :
// 1.01: Released to testers
// 1.02: Add DebugMsg. Fix independent Groupsize adjustment after set & siterefresh. Fix
// wrong set of +Toogle Icon on Siderefresh
// 2.00: First Changes vor Dashboard Tabs. Change method store Positiondata. optimization restore Positiondata. Clear poor routines.
// Change max/min Values for Groupresize. Top- and Bottom-Row always 100%
+// 2.01: Add Longpoll function. Dashboard can hide FHEMWEB Roomliste and Header.
// Known Bugs/Todo's
// See 95_Dashboard.pm
//########################################################################################
@@ -55,8 +55,8 @@ function restoreOrder() {
var params = (document.getElementById("dashboard_attr").value).split(","); //get current Configuration
var ActiveTab = $("#tabs .ui-tabs-panel:visible");
var ActiveTabId = ActiveTab.attr("id").substring(14,13);
- var colwidth = ((100/params[7])-(0.5/params[7]))+"%"; //current
- //var aColWidth = GetColWidth(params[7],params[12]); //future
+ //var colwidth = ((100/params[7])-(0.5/params[7]))+"%"; //current
+ var aColWidth = GetColWidth(params[7],params[12]); //future
//--------------------------------------------- Set Row and Column Settings --------------------------------------------------------------------------------------------
$("#dashboard").width(params[1]);
@@ -65,8 +65,8 @@ function restoreOrder() {
if (ActiveTab.has("#dashboard_rowbottom_tab"+ActiveTabId).length){ $("#dashboard_rowbottom_tab"+ActiveTabId).height(params[9]); }
for (var i = 0, n = params[7]; i <= n; i++) {
- if (ActiveTab.has("#dashboard_tab"+ActiveTabId+"column"+i).length) { $("#dashboard_tab"+ActiveTabId+"column"+i).width(colwidth); } //current
- //if (ActiveTab.has("#dashboard_tab"+ActiveTabId+"column"+i).length) { $("#dashboard_tab"+ActiveTabId+"column"+i).width(aColWidth[i]+"%"); } //future
+ //if (ActiveTab.has("#dashboard_tab"+ActiveTabId+"column"+i).length) { $("#dashboard_tab"+ActiveTabId+"column"+i).width(colwidth); } //current
+ if (ActiveTab.has("#dashboard_tab"+ActiveTabId+"column"+i).length) { $("#dashboard_tab"+ActiveTabId+"column"+i).width(aColWidth[i]+"%"); } //future
}
if (params[2] == 1) { $(".ui-row").addClass("dashboard_columnhelper"); } else { $(".ui-row").removeClass("dashboard_columnhelper"); }//set showhelper
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -226,7 +226,14 @@ $(document).ready( function () {
//--------------------------------- Attribute des Dashboards ------------------------------------------------------------------
var params = (document.getElementById("dashboard_attr").value).split(","); //get current Configuration
//-------------------------------------------------------------------------------------------------------------------------------------
+ $("body").attr("longpollfilter", ".*") //need for longpoll
+ if (params[13] == 1){ //disable roomlist and header
+ $("#menuScrollArea").remove();
+ $("#hdr").remove();
+ $("#content").css({position: 'inherit'});
+ }
+
$(".dashboard_column").sortable({
connectWith: ['.dashboard_column', '.ui-row'],
cursor: 'move',