mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-12 16:46:35 +00:00
Erase Lock/Unlock Button
git-svn-id: https://svn.fhem.de/fhem/trunk@5544 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
2f1c193fee
commit
efa5fce8a7
@ -43,11 +43,12 @@
|
||||
# 2.07: Fix GroupWidget-Error with readingGroups in hiddenroom
|
||||
# 2.08: Fix dashboard_webfrontendfilter Error-Message. Internal changes. Attribute dashboard_colwidth and dashboard_sorting removed.
|
||||
# 2.09: dashboard_showfullsize not applied in room "all" resp. "Everything". First small implementation over Dashboard_DetailFN.
|
||||
# 2.10: Internal Changes. Dashboard now not visible in room "all" resp. "Everything". Bugfix for Codemirror.
|
||||
# 2.10: Internal Changes. Lock/Unlock now only in Detail view. Attribut dashboard_lockstate are obsolet.
|
||||
#
|
||||
# Known Bugs/Todos:
|
||||
# BUG: Nicht alle Inhalte aller Tabs laden, bei Plots dauert die bedienung des Dashboards zu lange. -> elemente hidden?
|
||||
# BUG: Variabler abstand wird nicht gesichert
|
||||
# BUG: dashboard_webfrontendfilter doesn't Work Antwort #469
|
||||
# BUG: Überlappen Gruppen andere?
|
||||
#
|
||||
# Log 1, "[DASHBOARD simple debug] '".$g."' ";
|
||||
@ -103,14 +104,14 @@ sub Dashboard_Initialize ($) {
|
||||
my ($hash) = @_;
|
||||
|
||||
$hash->{DefFn} = "Dashboard_define";
|
||||
$hash->{SetFn} = "Dashboard_Set";
|
||||
$hash->{UndefFn} = "Dashboard_undef";
|
||||
$hash->{FW_detailFn} = "Dashboard_DetailFN";
|
||||
$hash->{FW_summaryFn} = "Dashboard_SummaryFN";
|
||||
$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_lockstate:unlock,lock ".
|
||||
"dashboard_lockstate:dont-use-this-attribut ".
|
||||
"dashboard_rowtopheight ".
|
||||
"dashboard_rowbottomheight ".
|
||||
"dashboard_row:top,center,bottom,top-center,center-bottom,top-center-bottom ".
|
||||
@ -119,9 +120,21 @@ sub Dashboard_Initialize ($) {
|
||||
#new attribute vers. 2.00
|
||||
"dashboard_tabcount:1,2,3,4,5,6,7 ".
|
||||
"dashboard_activetab:1,2,3,4,5,6,7 ".
|
||||
"dashboard_tab1name dashboard_tab2name dashboard_tab3name dashboard_tab4name dashboard_tab5name ".
|
||||
"dashboard_tab1groups dashboard_tab2groups dashboard_tab3groups dashboard_tab4groups dashboard_tab5groups ".
|
||||
"dashboard_tab1sorting dashboard_tab2sorting dashboard_tab3sorting dashboard_tab4sorting dashboard_tab5sorting ".
|
||||
"dashboard_tab1name ".
|
||||
"dashboard_tab2name ".
|
||||
"dashboard_tab3name ".
|
||||
"dashboard_tab4name ".
|
||||
"dashboard_tab5name ".
|
||||
"dashboard_tab1groups ".
|
||||
"dashboard_tab2groups ".
|
||||
"dashboard_tab3groups ".
|
||||
"dashboard_tab4groups ".
|
||||
"dashboard_tab5groups ".
|
||||
"dashboard_tab1sorting ".
|
||||
"dashboard_tab2sorting ".
|
||||
"dashboard_tab3sorting ".
|
||||
"dashboard_tab4sorting ".
|
||||
"dashboard_tab5sorting ".
|
||||
"dashboard_width ".
|
||||
"dashboard_rowcenterheight ".
|
||||
#new attribute vers. 2.01
|
||||
@ -130,17 +143,28 @@ sub Dashboard_Initialize ($) {
|
||||
#new attribute vers. 2.02
|
||||
"dashboard_showtabs:tabs-and-buttonbar-at-the-top,tabs-at-the-top-buttonbar-hidden,tabs-and-buttonbar-on-the-bottom,tabs-on-the-bottom-buttonbar-hidden,tabs-and-buttonbar-hidden ".
|
||||
#new attribute vers. 2.03
|
||||
"dashboard_tab1icon dashboard_tab2icon dashboard_tab3icon dashboard_tab4icon dashboard_tab5icon ".
|
||||
"dashboard_tab1icon ".
|
||||
"dashboard_tab2icon ".
|
||||
"dashboard_tab3icon ".
|
||||
"dashboard_tab4icon ".
|
||||
"dashboard_tab5icon ".
|
||||
#new attribute vers. 2.04
|
||||
"dashboard_webfrontendfilter ".
|
||||
#new attribute vers. 2.06
|
||||
"dashboard_customcss ".
|
||||
"dashboard_tab6name dashboard_tab7name ".
|
||||
"dashboard_tab6groups dashboard_tab7groups ".
|
||||
"dashboard_tab6sorting dashboard_tab7sorting ".
|
||||
"dashboard_tab6icon dashboard_tab7icon ".
|
||||
$readingFnAttributes;
|
||||
|
||||
"dashboard_tab6name ".
|
||||
"dashboard_tab7name ".
|
||||
"dashboard_tab6groups ".
|
||||
"dashboard_tab7groups ".
|
||||
"dashboard_tab6sorting ".
|
||||
"dashboard_tab7sorting ".
|
||||
"dashboard_tab6icon ".
|
||||
"dashboard_tab7icon";
|
||||
|
||||
$data{FWEXT}{jquery}{SCRIPT} = "/pgm2/".$fwjquery if (!$data{FWEXT}{jquery}{SCRIPT});
|
||||
$data{FWEXT}{jqueryui}{SCRIPT} = "/pgm2/".$fwjqueryui if (!$data{FWEXT}{jqueryui}{SCRIPT});
|
||||
$data{FWEXT}{z_dashboard}{SCRIPT} = "/pgm2/dashboard.js" if (!$data{FWEXT}{z_dashboard});
|
||||
|
||||
$data{FWEXT}{Dashboardx}{LINK} = "?room=".$dashboardhiddenroom;
|
||||
$data{FWEXT}{Dashboardx}{NAME} = $dashboardname;
|
||||
|
||||
@ -155,7 +179,6 @@ sub Dashboard_DetailFN() {
|
||||
$ret .= "<table class=\"block wide\" id=\"dashboardtoolbar\" style=\"width:100%\">\n";
|
||||
$ret .= "<tr><td><div>\n";
|
||||
$ret .= " <div> <a href=\"javascript:dashboard_setposition()\"><button id=\"dashboard_setpositionbutton\" type=\"button\" title=\"Set the Positions\" disabled>Set Positions</button></a>\n";
|
||||
$ret .= " <a href=\"javascript:dashboard_tooglelock()\"><button id=\"dashboard_tooglelockbutton\" type=\"button\" title=\"Lock Dashboard\" disabled>Lock Dashboard</button></a>\n";
|
||||
$ret .= " <a href=\"$FW_ME?room=$dashboardhiddenroom\"><button type=\"button\">Return to Dashboard</button></a>\n";
|
||||
$ret .= " <div id=\"resultText\" style=\"padding-top: 8px;\"></div>\n";
|
||||
$ret .= " </div>\n";
|
||||
@ -164,23 +187,48 @@ sub Dashboard_DetailFN() {
|
||||
return $ret;
|
||||
}
|
||||
|
||||
sub Dashboard_Set($@) {
|
||||
my ( $hash, $name, $cmd, @args ) = @_;
|
||||
|
||||
if ( $cmd eq "lock" ) {
|
||||
#$attr{$name}{dashboard_lockstate} = "lock";
|
||||
readingsSingleUpdate( $hash, "lockstate", "lock", 0 );
|
||||
#$hash->{LOCKSTATE} = "lock";
|
||||
return;
|
||||
} elsif ( $cmd eq "unlock" ) {
|
||||
#$attr{$name}{dashboard_lockstate} = "unlock";
|
||||
readingsSingleUpdate( $hash, "lockstate", "unlock", 0 );
|
||||
#$hash->{LOCKSTATE} = "unlock";
|
||||
return;
|
||||
}else {
|
||||
return "Unknown argument " . $cmd . ", choose one of lock:noArg unlock:noArg";
|
||||
}
|
||||
}
|
||||
|
||||
sub Dashboard_define ($$) {
|
||||
my ($hash, $def) = @_;
|
||||
readingsSingleUpdate( $hash, "state", "Initialized", 0 );
|
||||
#CheckInstallation($hash);
|
||||
CheckDashboardEntry($hash);
|
||||
return;
|
||||
my ($hash, $def) = @_;
|
||||
my $now = time();
|
||||
my $name = $hash->{NAME};
|
||||
$hash->{VERSION} = $dashboardversion;
|
||||
readingsSingleUpdate( $hash, "state", "Initialized", 0 );
|
||||
|
||||
RemoveInternalTimer($hash);
|
||||
InternalTimer ($now + 5, 'CreateDashboardEntry', $hash, 0);
|
||||
InternalTimer ($now + 5, 'CheckDashboardAttributUssage', $hash, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
sub Dashboard_undef ($$) {
|
||||
my ($hash,$arg) = @_;
|
||||
RemoveInternalTimer($hash);
|
||||
return undef;
|
||||
my ($hash,$arg) = @_;
|
||||
|
||||
RemoveInternalTimer($hash);
|
||||
|
||||
return undef;
|
||||
}
|
||||
|
||||
sub Dashboard_attr($$$) {
|
||||
#my ($cmd, $name, $attrName, $attrVal) = @_;
|
||||
return;
|
||||
my ($cmd, $name, $attrName, $attrVal) = @_;
|
||||
return;
|
||||
}
|
||||
|
||||
#############################################################################################
|
||||
@ -194,93 +242,93 @@ sub DashboardAsHtml($)
|
||||
|
||||
sub Dashboard_SummaryFN($$$$)
|
||||
{
|
||||
my ($FW_wname, $d, $room, $pageHash) = @_;
|
||||
my ($FW_wname, $d, $room, $pageHash) = @_;
|
||||
|
||||
my $ret = "";
|
||||
my $showbuttonbar = "hidden";
|
||||
my $debugfield = "hidden";
|
||||
|
||||
my $h = $defs{$d};
|
||||
my $name = $defs{$d}{NAME};
|
||||
my $id = $defs{$d}{NR};
|
||||
my $ret = "";
|
||||
my $showbuttonbar = "hidden";
|
||||
my $debugfield = "hidden";
|
||||
|
||||
######################### Read Dashboard Attributes and set Default-Values ####################################
|
||||
my $disable = AttrVal($defs{$d}{NAME}, "disable", 0);
|
||||
my $colcount = AttrVal($defs{$d}{NAME}, "dashboard_colcount", 1);
|
||||
my $colwidth = AttrVal($defs{$d}{NAME}, "dashboard_rowcentercolwidth", 100);
|
||||
my $colheight = AttrVal($defs{$d}{NAME}, "dashboard_rowcenterheight", 400);
|
||||
my $rowtopheight = AttrVal($defs{$d}{NAME}, "dashboard_rowtopheight", 250);
|
||||
my $rowbottomheight = AttrVal($defs{$d}{NAME}, "dashboard_rowbottomheight", 250);
|
||||
my $showhelper = AttrVal($defs{$d}{NAME}, "dashboard_showhelper", 1);
|
||||
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 $customcss = AttrVal($defs{$d}{NAME}, "dashboard_customcss", "none");
|
||||
my $h = $defs{$d};
|
||||
my $name = $defs{$d}{NAME};
|
||||
my $id = $defs{$d}{NR};
|
||||
|
||||
my $row = AttrVal($defs{$d}{NAME}, "dashboard_row", "center");
|
||||
my $debug = AttrVal($defs{$d}{NAME}, "dashboard_debug", "0");
|
||||
my $lockstate = AttrVal($defs{$d}{NAME}, "dashboard_lockstate", "unlock");
|
||||
######################### Read Dashboard Attributes and set Default-Values ####################################
|
||||
my $disable = AttrVal($defs{$d}{NAME}, "disable", 0);
|
||||
my $colcount = AttrVal($defs{$d}{NAME}, "dashboard_colcount", 1);
|
||||
my $colwidth = AttrVal($defs{$d}{NAME}, "dashboard_rowcentercolwidth", 100);
|
||||
my $colheight = AttrVal($defs{$d}{NAME}, "dashboard_rowcenterheight", 400);
|
||||
my $rowtopheight = AttrVal($defs{$d}{NAME}, "dashboard_rowtopheight", 250);
|
||||
my $rowbottomheight = AttrVal($defs{$d}{NAME}, "dashboard_rowbottomheight", 250);
|
||||
my $showhelper = AttrVal($defs{$d}{NAME}, "dashboard_showhelper", 1);
|
||||
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 $customcss = AttrVal($defs{$d}{NAME}, "dashboard_customcss", "none");
|
||||
|
||||
my $activetab = AttrVal($defs{$d}{NAME}, "dashboard_activetab", 1);
|
||||
my $tabcount = AttrVal($defs{$d}{NAME}, "dashboard_tabcount", 1);
|
||||
my $dbwidth = AttrVal($defs{$d}{NAME}, "dashboard_width", "100%");
|
||||
my @tabnames = (AttrVal($defs{$d}{NAME}, "dashboard_tab1name", "Dashboard-Tab 1"),
|
||||
my $row = AttrVal($defs{$d}{NAME}, "dashboard_row", "center");
|
||||
my $debug = AttrVal($defs{$d}{NAME}, "dashboard_debug", "0");
|
||||
|
||||
my $lockstate = ($defs{$d}->{READINGS}{lockstate}{VAL}) ? $defs{$d}->{READINGS}{lockstate}{VAL} : "unlock";
|
||||
Log 1, "[DASHBOARD simple debug] ".$defs{$d}->{READINGS}{lockstate}{VAL};
|
||||
#my $lockstate = AttrVal($defs{$d}{NAME}, "dashboard_lockstate", "unlock");
|
||||
|
||||
my $activetab = AttrVal($defs{$d}{NAME}, "dashboard_activetab", 1);
|
||||
my $tabcount = AttrVal($defs{$d}{NAME}, "dashboard_tabcount", 1);
|
||||
my $dbwidth = AttrVal($defs{$d}{NAME}, "dashboard_width", "100%");
|
||||
my @tabnames = (AttrVal($defs{$d}{NAME}, "dashboard_tab1name", "Dashboard-Tab 1"),
|
||||
AttrVal($defs{$d}{NAME}, "dashboard_tab2name", "Dashboard-Tab 2"),
|
||||
AttrVal($defs{$d}{NAME}, "dashboard_tab3name", "Dashboard-Tab 3"),
|
||||
AttrVal($defs{$d}{NAME}, "dashboard_tab4name", "Dashboard-Tab 4"),
|
||||
AttrVal($defs{$d}{NAME}, "dashboard_tab5name", "Dashboard-Tab 5"),
|
||||
AttrVal($defs{$d}{NAME}, "dashboard_tab6name", "Dashboard-Tab 6"),
|
||||
AttrVal($defs{$d}{NAME}, "dashboard_tab7name", "Dashboard-Tab 7"));
|
||||
my @tabgroups = (AttrVal($defs{$d}{NAME}, "dashboard_tab1groups", ""),
|
||||
my @tabgroups = (AttrVal($defs{$d}{NAME}, "dashboard_tab1groups", ""),
|
||||
AttrVal($defs{$d}{NAME}, "dashboard_tab2groups", ""),
|
||||
AttrVal($defs{$d}{NAME}, "dashboard_tab3groups", ""),
|
||||
AttrVal($defs{$d}{NAME}, "dashboard_tab4groups", ""),
|
||||
AttrVal($defs{$d}{NAME}, "dashboard_tab5groups", ""),
|
||||
AttrVal($defs{$d}{NAME}, "dashboard_tab6groups", ""),
|
||||
AttrVal($defs{$d}{NAME}, "dashboard_tab7groups", ""));
|
||||
my @tabsortings = (AttrVal($defs{$d}{NAME}, "dashboard_tab1sorting", ""),
|
||||
my @tabsortings = (AttrVal($defs{$d}{NAME}, "dashboard_tab1sorting", ""),
|
||||
AttrVal($defs{$d}{NAME}, "dashboard_tab2sorting", ""),
|
||||
AttrVal($defs{$d}{NAME}, "dashboard_tab3sorting", ""),
|
||||
AttrVal($defs{$d}{NAME}, "dashboard_tab4sorting", ""),
|
||||
AttrVal($defs{$d}{NAME}, "dashboard_tab5sorting", ""),
|
||||
AttrVal($defs{$d}{NAME}, "dashboard_tab6sorting", ""),
|
||||
AttrVal($defs{$d}{NAME}, "dashboard_tab7sorting", ""));
|
||||
my @tabicons = (AttrVal($defs{$d}{NAME}, "dashboard_tab1icon", ""),
|
||||
AttrVal($defs{$d}{NAME}, "dashboard_tab2icon", ""),
|
||||
AttrVal($defs{$d}{NAME}, "dashboard_tab3icon", ""),
|
||||
AttrVal($defs{$d}{NAME}, "dashboard_tab4icon", ""),
|
||||
AttrVal($defs{$d}{NAME}, "dashboard_tab5icon", ""),
|
||||
AttrVal($defs{$d}{NAME}, "dashboard_tab6icon", ""),
|
||||
AttrVal($defs{$d}{NAME}, "dashboard_tab7icon", ""));
|
||||
#############################################################################################
|
||||
###################### Build Device View for Room "all" and for Wrong Configurations #################################
|
||||
$ret .= "<table>";
|
||||
$ret .= "<tr><td><div class=\"devType\">".$defs{$d}{TYPE}."</div></td></tr>";
|
||||
$ret .= "<tr><td><table id=\"TYPE_".$defs{$d}{TYPE}."\" class=\"block wide\">";
|
||||
$ret .= "<tbody><tr>";
|
||||
$ret .= "<td><div><a href=\"$FW_ME?detail=$d\">$d</a></div></td>";
|
||||
$ret .= "<td><div>".$defs{$d}{STATE}."</div></td>";
|
||||
$ret .= "</tr></tbody>";
|
||||
$ret .= "</table></td></tr>";
|
||||
$ret .= "</table>";
|
||||
my @tabicons = (AttrVal($defs{$d}{NAME}, "dashboard_tab1icon", ""),
|
||||
AttrVal($defs{$d}{NAME}, "dashboard_tab2icon", ""),
|
||||
AttrVal($defs{$d}{NAME}, "dashboard_tab3icon", ""),
|
||||
AttrVal($defs{$d}{NAME}, "dashboard_tab4icon", ""),
|
||||
AttrVal($defs{$d}{NAME}, "dashboard_tab5icon", ""),
|
||||
AttrVal($defs{$d}{NAME}, "dashboard_tab6icon", ""),
|
||||
AttrVal($defs{$d}{NAME}, "dashboard_tab7icon", ""));
|
||||
|
||||
#############################################################################################
|
||||
|
||||
|
||||
if ($disable == 1) {
|
||||
readingsSingleUpdate( $defs{$d}, "state", "Disabled", 0 );
|
||||
return $ret;
|
||||
return "";
|
||||
}
|
||||
unless (@tabgroups) {
|
||||
readingsSingleUpdate( $defs{$d}, "state", "No Groups set", 0 );
|
||||
return $ret;
|
||||
return "";
|
||||
}
|
||||
|
||||
############# 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) { return $ret; }
|
||||
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."<br>";
|
||||
# $ret .= "Set Attribute dashboard_webfrontendfilter, see <a href=\"/fhem?detail=$d\" title=\"".$name."\">Details</a>";
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
##################################################################################
|
||||
|
||||
@ -304,68 +352,69 @@ sub Dashboard_SummaryFN($$$$)
|
||||
}
|
||||
#-------------------------------------------------------------------------------------------------
|
||||
|
||||
if ($room && $room ne "all") {
|
||||
$ret = "";
|
||||
|
||||
$ret .= "<script>\n";
|
||||
$ret .= " loadScript(\"pgm2/$fwjquery\");\n";
|
||||
$ret .= " loadScript(\"pgm2/$fwjqueryui\");\n";
|
||||
$ret .= " loadScript(\"pgm2/dashboard.js\");\n";
|
||||
$ret .= "</script>\n";
|
||||
|
||||
$ret .= "<table class=\"roomoverview dashboard\" id=\"dashboard\">\n";
|
||||
|
||||
$ret .= "<tr><td><div class=\"dashboardhidden\">\n";
|
||||
$ret .= "<input type=\"$debugfield\" size=\"100%\" id=\"dashboard_attr\" value=\"$name,$dbwidth,$showhelper,$lockstate,$showbuttonbar,$colheight,$showtooglebuttons,$colcount,$rowtopheight,$rowbottomheight,$tabcount,$activetab,$colwidth,$showfullsize,$customcss\">\n";
|
||||
$ret .= "<input type=\"$debugfield\" size=\"100%\" id=\"dashboard_jsdebug\" value=\"\">\n";
|
||||
$ret .= "</div></td></tr>\n";
|
||||
$ret .= "<tr><td><div id=\"tabs\" class=\"dashboard_tabs\">\n";
|
||||
|
||||
########################### Dashboard Tab-Liste ##############################################
|
||||
my $tabshow = "hidden";
|
||||
my $tabicon = "";
|
||||
if ($showtabs eq "tabs-and-buttonbar-at-the-top" || $showtabs eq "tabs-at-the-top-buttonbar-hidden") { $tabshow = "top";}
|
||||
if ($showtabs eq "tabs-and-buttonbar-on-the-bottom" || $showtabs eq "tabs-on-the-bottom-buttonbar-hidden") { $tabshow = "bottom";}
|
||||
if ($room ne "all") {
|
||||
$ret .= "<table class=\"roomoverview dashboard\" id=\"dashboard\">\n";
|
||||
|
||||
$ret .= "<tr><td><div class=\"dashboardhidden\">\n";
|
||||
$ret .= "<input type=\"$debugfield\" size=\"100%\" id=\"dashboard_attr\" value=\"$name,$dbwidth,$showhelper,$lockstate,$showbuttonbar,$colheight,$showtooglebuttons,$colcount,$rowtopheight,$rowbottomheight,$tabcount,$activetab,$colwidth,$showfullsize,$customcss\">\n";
|
||||
$ret .= "<input type=\"$debugfield\" size=\"100%\" id=\"dashboard_jsdebug\" value=\"\">\n";
|
||||
$ret .= "</div></td></tr>\n";
|
||||
$ret .= "<tr><td><div id=\"tabs\" class=\"dashboard_tabs\">\n";
|
||||
|
||||
########################### Dashboard Tab-Liste ##############################################
|
||||
my $tabshow = "hidden";
|
||||
my $tabicon = "";
|
||||
if ($showtabs eq "tabs-and-buttonbar-at-the-top" || $showtabs eq "tabs-at-the-top-buttonbar-hidden") { $tabshow = "top";}
|
||||
if ($showtabs eq "tabs-and-buttonbar-on-the-bottom" || $showtabs eq "tabs-on-the-bottom-buttonbar-hidden") { $tabshow = "bottom";}
|
||||
|
||||
$ret .= " <ul id=\"dashboard_tabnav\" class=\"dashboard_tabnav dashboard_tabnav_".$tabshow."\">\n";
|
||||
if ($showtabs ne "tabs-at-the-top-buttonbar-hidden" && $showtabs ne "tabs-on-the-bottom-buttonbar-hidden" && $showtabs ne "tabs-and-buttonbar-hidden") { $ret .= BuildButtonBar($d,$showtabs,$showfullsize); }
|
||||
|
||||
for (my $i=0;$i<$tabcount;$i++){
|
||||
$tabicon = "";
|
||||
if ($tabicons[$i] ne "") { $tabicon = FW_makeImage($tabicons[$i],$tabicons[$i],"dashboard_tabicon") . " "; }
|
||||
$ret .= " <li class=\"dashboard_tab dashboard_tab_".$tabshow."\">".$tabicon."<a href=\"#dashboard_tab".$i."\">".trim($tabnames[$i])."</a></li>";
|
||||
}
|
||||
$ret .= " </ul>\n";
|
||||
##############################################################################################
|
||||
|
||||
for (my $t=0;$t<$tabcount;$t++){
|
||||
my @tabgroup = split(",", $tabgroups[$t]); #Set temp. position for groups without an stored position
|
||||
for (my $i=0;$i<@tabgroup;$i++){
|
||||
my @stabgroup = split(":", trim($tabgroup[$i]));
|
||||
if (index($tabsortings[$t],trim($stabgroup[0])) < 0) { $tabsortings[$t] = $tabsortings[$t]."t".$t."c".GetMaxColumnId($row,$colcount).",".trim($stabgroup[0]).",true,0,0:"; }
|
||||
}
|
||||
|
||||
$ret .= " <ul id=\"dashboard_tabnav\" class=\"dashboard_tabnav dashboard_tabnav_".$tabshow."\">\n";
|
||||
if ($showtabs ne "tabs-at-the-top-buttonbar-hidden" && $showtabs ne "tabs-on-the-bottom-buttonbar-hidden" && $showtabs ne "tabs-and-buttonbar-hidden") { $ret .= BuildButtonBar($d,$showtabs,$showfullsize); }
|
||||
|
||||
for (my $i=0;$i<$tabcount;$i++){
|
||||
$tabicon = "";
|
||||
if ($tabicons[$i] ne "") { $tabicon = FW_makeImage($tabicons[$i],$tabicons[$i],"dashboard_tabicon") . " "; }
|
||||
$ret .= " <li class=\"dashboard_tab dashboard_tab_".$tabshow."\">".$tabicon."<a href=\"#dashboard_tab".$i."\">".trim($tabnames[$i])."</a></li>";
|
||||
}
|
||||
$ret .= " </ul>\n";
|
||||
##############################################################################################
|
||||
|
||||
for (my $t=0;$t<$tabcount;$t++){
|
||||
my @tabgroup = split(",", $tabgroups[$t]); #Set temp. position for groups without an stored position
|
||||
for (my $i=0;$i<@tabgroup;$i++){
|
||||
my @stabgroup = split(":", trim($tabgroup[$i]));
|
||||
if (index($tabsortings[$t],trim($stabgroup[0])) < 0) { $tabsortings[$t] = $tabsortings[$t]."t".$t."c".GetMaxColumnId($row,$colcount).",".trim($stabgroup[0]).",true,0,0:"; }
|
||||
}
|
||||
|
||||
%group = BuildGroupList($tabgroups[$t]);
|
||||
$ret .= " <div id=\"dashboard_tab".$t."\" data-tabwidgets=\"".$tabsortings[$t]."\" class=\"dashboard_tabpanel\">\n";
|
||||
$ret .= " <ul class=\"dashboard_tabcontent\">\n";
|
||||
$ret .= " <table class=\"dashboard_tabcontent\">\n";
|
||||
##################### Top Row (only one Column) #############################################
|
||||
if ($row eq "top-center-bottom" || $row eq "top-center" || $row eq "top"){ $ret .= BuildDashboardTopRow($t,$id,$tabgroups[$t],$tabsortings[$t]); }
|
||||
##################### Center Row (max. 5 Column) ############################################
|
||||
if ($row eq "top-center-bottom" || $row eq "top-center" || $row eq "center-bottom" || $row eq "center"){ $ret .= BuildDashboardCenterRow($t,$id,$tabgroups[$t],$tabsortings[$t],$colcount);}
|
||||
############################# Bottom Row (only one Column) ############################################
|
||||
if ($row eq "top-center-bottom" || $row eq "center-bottom" || $row eq "bottom"){ $ret .= BuildDashboardBottomRow($t,$id,$tabgroups[$t],$tabsortings[$t]); }
|
||||
#############################################################################################
|
||||
$ret .= " </table>\n";
|
||||
$ret .= " </ul>\n";
|
||||
$ret .= " </div>\n";
|
||||
}
|
||||
$ret .= "</div></td></tr>\n";
|
||||
$ret .= "</table>\n";
|
||||
%group = BuildGroupList($tabgroups[$t]);
|
||||
$ret .= " <div id=\"dashboard_tab".$t."\" data-tabwidgets=\"".$tabsortings[$t]."\" class=\"dashboard_tabpanel\">\n";
|
||||
$ret .= " <ul class=\"dashboard_tabcontent\">\n";
|
||||
$ret .= " <table class=\"dashboard_tabcontent\">\n";
|
||||
##################### Top Row (only one Column) #############################################
|
||||
if ($row eq "top-center-bottom" || $row eq "top-center" || $row eq "top"){ $ret .= BuildDashboardTopRow($t,$id,$tabgroups[$t],$tabsortings[$t]); }
|
||||
##################### Center Row (max. 5 Column) ############################################
|
||||
if ($row eq "top-center-bottom" || $row eq "top-center" || $row eq "center-bottom" || $row eq "center"){ $ret .= BuildDashboardCenterRow($t,$id,$tabgroups[$t],$tabsortings[$t],$colcount);}
|
||||
############################# Bottom Row (only one Column) ############################################
|
||||
if ($row eq "top-center-bottom" || $row eq "center-bottom" || $row eq "bottom"){ $ret .= BuildDashboardBottomRow($t,$id,$tabgroups[$t],$tabsortings[$t]); }
|
||||
#############################################################################################
|
||||
$ret .= " </table>\n";
|
||||
$ret .= " </ul>\n";
|
||||
$ret .= " </div>\n";
|
||||
}
|
||||
$ret .= "</div></td></tr>\n";
|
||||
$ret .= "</table>\n";
|
||||
} else {
|
||||
$ret .= "<table>";
|
||||
$ret .= "<tr><td><div class=\"devType\">".$defs{$d}{TYPE}."</div></td></tr>";
|
||||
$ret .= "<tr><td><table id=\"TYPE_".$defs{$d}{TYPE}."\" class=\"block wide\">";
|
||||
$ret .= "<tbody><tr>";
|
||||
$ret .= "<td><div><a href=\"$FW_ME?detail=$d\">$d</a></div></td>";
|
||||
$ret .= "<td><div>".$defs{$d}{STATE}."</div></td>";
|
||||
$ret .= "</tr></tbody>";
|
||||
$ret .= "</table></td></tr>";
|
||||
$ret .= "</table>";
|
||||
}
|
||||
|
||||
return $ret;
|
||||
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
sub BuildDashboardTopRow($$$$){
|
||||
@ -427,7 +476,6 @@ sub BuildButtonBar($$$){
|
||||
if ($pos ne "hidden") {
|
||||
$ret .= "<div class=\"dashboard_buttonbar dashboard_buttonbar_".$cssclass."\">\n";
|
||||
$ret .= " <div class=\"dashboard_button\"> <a id=\"dashboard_button_set\" href=\"javascript:dashboard_setposition()\" title=\"Set the Position\"><span class=\"dashboard_button_icon dashboard_button_iconset\"></span>Set</a> </div>\n";
|
||||
$ret .= " <div class=\"dashboard_button\"> <a id=\"dashboard_button_lock\" href=\"javascript:dashboard_tooglelock()\" title=\"Lock Dashboard\">Lock</a> </div>\n";
|
||||
$ret .= " <div class=\"dashboard_button\"> <a id=\"dashboard_button_detail\" href=\"/fhem?detail=$d\" title=\"Dashboard Details\"><span class=\"dashboard_button_icon dashboard_button_icondetail\"></span>Detail</a> </div>\n";
|
||||
$ret .= "</div>\n";
|
||||
}
|
||||
@ -589,27 +637,6 @@ sub GetMaxColumnId($$) {
|
||||
return $maxcolid;
|
||||
}
|
||||
|
||||
sub CheckInstallation($) {
|
||||
my ($hash) = @_;
|
||||
|
||||
unless (-e $FW_dir."/pgm2/".$fwjquery) {
|
||||
Log3 $hash, 3, "[".$hash->{NAME}. " V".$dashboardversion."] Missing File ".$FW_dir."/pgm2/".$fwjquery;
|
||||
readingsSingleUpdate( $hash, "state", "Missing File, see LogFile for Details", 0 );
|
||||
}
|
||||
unless (-e $FW_dir."/pgm2/".$fwjqueryui) {
|
||||
Log3 $hash, 3, "[".$hash->{NAME}. " V".$dashboardversion."] Missing File ".$FW_dir."/pgm2/".$fwjqueryui;
|
||||
readingsSingleUpdate( $hash, "state", "Missing File, see LogFile for Details", 0 );
|
||||
}
|
||||
unless (-e $FW_dir."/pgm2/dashboard.js") {
|
||||
Log3 $hash, 3, "[".$hash->{NAME}. " V".$dashboardversion."] Missing File ".$FW_dir."/pgm2/dashboard.js";
|
||||
readingsSingleUpdate( $hash, "state", "Missing File, see LogFile for Details", 0 );
|
||||
}
|
||||
unless (-e $FW_icondir."/default/dashboardicons.png") {
|
||||
Log3 $hash, 3, "[".$hash->{NAME}. " V".$dashboardversion."] Missing File ".$FW_icondir."/default/dashboardicons.png";
|
||||
readingsSingleUpdate( $hash, "state", "Missing File, see LogFile for Details", 0 );
|
||||
}
|
||||
}
|
||||
|
||||
sub CheckDashboardEntry($) {
|
||||
my ($hash) = @_;
|
||||
my $now = time();
|
||||
@ -643,6 +670,12 @@ sub CheckDashboardAttributUssage($) { # replaces old disused attributes and thei
|
||||
$tabgroups = AttrVal($defs{$d}{NAME}, "dashboard_tab5groups", "999");
|
||||
if ($tabgroups eq "1" ) { FW_fC("deleteattr ".$d." dashboard_tab5groups"); }
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
my $lockstate = AttrVal($defs{$d}{NAME}, "dashboard_lockstate", ""); # outdates 04.2014
|
||||
if ($lockstate ne "") {
|
||||
{ FW_fC("deleteattr ".$d." dashboard_lockstate"); }
|
||||
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. [dashboard_lockstate]";
|
||||
}
|
||||
}
|
||||
|
||||
sub CreateDashboardEntry($) {
|
||||
@ -657,16 +690,7 @@ sub CreateDashboardEntry($) {
|
||||
|
||||
foreach my $dn (sort keys %defs) {
|
||||
if ($defs{$dn}{TYPE} eq "FHEMWEB" && $defs{$dn}{NAME} !~ /FHEMWEB:/) {
|
||||
my $hr = AttrVal($defs{$dn}{NAME}, "hiddenroom", "");
|
||||
|
||||
#---------- Delete older Hiddenroom for Dashboard due changes in 01_FHEMWEB.pm (01.2014) ---------
|
||||
if (index($hr,$dashboardname) != -1 && index($hr,$dashboardhiddenroom) == -1) {
|
||||
$hr =~ s/$dashboardname/$dashboardhiddenroom/g;
|
||||
FW_fC("attr ".$defs{$dn}{NAME}." hiddenroom ".$hr);
|
||||
Log3 $hash, 3, "[".$hash->{NAME}. " V".$dashboardversion."]"." Corrected hiddenroom '".$dashboardname."' -> '".$dashboardhiddenroom."' in ".$defs{$dn}{NAME}.". Don't forget to save config.";
|
||||
}
|
||||
#-------------------------------------------------------------------------------------------------
|
||||
|
||||
my $hr = AttrVal($defs{$dn}{NAME}, "hiddenroom", "");
|
||||
if (index($hr,$dashboardhiddenroom) == -1){
|
||||
if ($hr eq "") {FW_fC("attr ".$defs{$dn}{NAME}." hiddenroom ".$dashboardhiddenroom);}
|
||||
else {FW_fC("attr ".$defs{$dn}{NAME}." hiddenroom ".$hr.",".$dashboardhiddenroom);}
|
||||
@ -675,9 +699,10 @@ sub CreateDashboardEntry($) {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
#dashboard_lockstate
|
||||
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
// 2.03: 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.
|
||||
// 2.04: Dashboard position near Top in showfullsize-mode. Restore ActiveTab funktion
|
||||
// 2.04: dashboard_showfullsize not applied in room "all" resp. "Everything"
|
||||
// 2.05: Delete function for set lockstate
|
||||
//
|
||||
// Known Bugs/Todo's
|
||||
// See 95_Dashboard.pm
|
||||
@ -142,21 +142,6 @@ function showdebugMessage(msg){
|
||||
document.getElementById("dashboard_jsdebug").value = msg;
|
||||
}
|
||||
|
||||
function dashboard_tooglelock(){
|
||||
var params = (document.getElementById("dashboard_attr").value).split(","); //get current Configuration
|
||||
if (params[3] == "lock"){ //current state lock, do unlock
|
||||
params[3] = "unlock";
|
||||
$("#dashboard_button_lock").button( "option", "label", "Lock" );
|
||||
dashboard_unsetlock();
|
||||
} else { //current state unlock, set lock
|
||||
params[3] = "lock";
|
||||
$("#dashboard_button_lock").button( "option", "label", "Unlock" );
|
||||
dashboard_setlock();
|
||||
}
|
||||
document.getElementById("dashboard_attr").value = params;
|
||||
FW_cmd(document.location.pathname+'?XHR=1&cmd.'+params[0]+'=attr '+params[0]+' dashboard_lockstate '+params[3]);
|
||||
}
|
||||
|
||||
function dashboard_setlock(){
|
||||
$("#dashboard_button_lock").prepend('<span class="dashboard_button_icon dashboard_button_iconlock"></span>');
|
||||
//############################################################
|
||||
@ -235,14 +220,12 @@ $(document).ready( function () {
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------
|
||||
$("body").attr("longpollfilter", ".*") //need for longpoll
|
||||
|
||||
if (params[13] == 1){ //disable roomlist and header, but not in room Everything
|
||||
if ($('#content').attr("room") != "all") {
|
||||
$("#menuScrollArea").remove();
|
||||
$("#hdr").remove();
|
||||
$(".roomoverview:first").remove();
|
||||
$("br:first").remove();
|
||||
$("#content").css({position: 'inherit'});
|
||||
}
|
||||
if (params[13] == 1){ //disable roomlist and header
|
||||
$("#menuScrollArea").remove();
|
||||
$("#hdr").remove();
|
||||
$(".roomoverview:first").remove();
|
||||
$("br:first").remove();
|
||||
$("#content").css({position: 'inherit'});
|
||||
}
|
||||
|
||||
$(".dashboard_column").sortable({
|
||||
@ -305,7 +288,7 @@ $(document).ready( function () {
|
||||
restoreOrder();
|
||||
},
|
||||
activate: function (event, ui) {
|
||||
restoreOrder();
|
||||
restoreOrder();
|
||||
}
|
||||
});
|
||||
if ($("#dashboard_tabnav").hasClass("dashboard_tabnav_bottom")) { $(".dashboard_tabnav").appendTo(".dashboard_tabs"); } //set Tabs on the Bottom
|
||||
@ -325,21 +308,8 @@ $(document).ready( function () {
|
||||
}
|
||||
});
|
||||
|
||||
$("#dashboard_button_lock").button({
|
||||
create: function( event, ui ) {
|
||||
dashboard_modifyWidget();
|
||||
if (params[3] == "lock") {
|
||||
$(this).button( "option", "label", "Unlock" );
|
||||
dashboard_setlock();
|
||||
} else {
|
||||
$(this).button( "option", "label", "Lock" );
|
||||
dashboard_unsetlock();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
dashboard_modifyWidget();
|
||||
if (params[3] == "lock") {dashboard_setlock();} else {dashboard_unsetlock();}
|
||||
if (params[14] != "none" ) {$('<style type="text/css">'+params[14]+'</style>').appendTo($('head')); }
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user