mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +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.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.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.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:
|
# Known Bugs/Todos:
|
||||||
# BUG: Nicht alle Inhalte aller Tabs laden, bei Plots dauert die bedienung des Dashboards zu lange. -> elemente hidden?
|
# 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: Variabler abstand wird nicht gesichert
|
||||||
|
# BUG: dashboard_webfrontendfilter doesn't Work Antwort #469
|
||||||
# BUG: Überlappen Gruppen andere?
|
# BUG: Überlappen Gruppen andere?
|
||||||
#
|
#
|
||||||
# Log 1, "[DASHBOARD simple debug] '".$g."' ";
|
# Log 1, "[DASHBOARD simple debug] '".$g."' ";
|
||||||
@ -103,14 +104,14 @@ sub Dashboard_Initialize ($) {
|
|||||||
my ($hash) = @_;
|
my ($hash) = @_;
|
||||||
|
|
||||||
$hash->{DefFn} = "Dashboard_define";
|
$hash->{DefFn} = "Dashboard_define";
|
||||||
|
$hash->{SetFn} = "Dashboard_Set";
|
||||||
$hash->{UndefFn} = "Dashboard_undef";
|
$hash->{UndefFn} = "Dashboard_undef";
|
||||||
$hash->{FW_detailFn} = "Dashboard_DetailFN";
|
$hash->{FW_detailFn} = "Dashboard_DetailFN";
|
||||||
$hash->{FW_summaryFn} = "Dashboard_SummaryFN";
|
|
||||||
$hash->{AttrFn} = "Dashboard_attr";
|
$hash->{AttrFn} = "Dashboard_attr";
|
||||||
$hash->{AttrList} = "disable:0,1 ".
|
$hash->{AttrList} = "disable:0,1 ".
|
||||||
"dashboard_colcount:1,2,3,4,5 ".
|
"dashboard_colcount:1,2,3,4,5 ".
|
||||||
"dashboard_debug:0,1 ".
|
"dashboard_debug:0,1 ".
|
||||||
"dashboard_lockstate:unlock,lock ".
|
"dashboard_lockstate:dont-use-this-attribut ".
|
||||||
"dashboard_rowtopheight ".
|
"dashboard_rowtopheight ".
|
||||||
"dashboard_rowbottomheight ".
|
"dashboard_rowbottomheight ".
|
||||||
"dashboard_row:top,center,bottom,top-center,center-bottom,top-center-bottom ".
|
"dashboard_row:top,center,bottom,top-center,center-bottom,top-center-bottom ".
|
||||||
@ -119,9 +120,21 @@ sub Dashboard_Initialize ($) {
|
|||||||
#new attribute vers. 2.00
|
#new attribute vers. 2.00
|
||||||
"dashboard_tabcount:1,2,3,4,5,6,7 ".
|
"dashboard_tabcount:1,2,3,4,5,6,7 ".
|
||||||
"dashboard_activetab: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_tab1name ".
|
||||||
"dashboard_tab1groups dashboard_tab2groups dashboard_tab3groups dashboard_tab4groups dashboard_tab5groups ".
|
"dashboard_tab2name ".
|
||||||
"dashboard_tab1sorting dashboard_tab2sorting dashboard_tab3sorting dashboard_tab4sorting dashboard_tab5sorting ".
|
"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_width ".
|
||||||
"dashboard_rowcenterheight ".
|
"dashboard_rowcenterheight ".
|
||||||
#new attribute vers. 2.01
|
#new attribute vers. 2.01
|
||||||
@ -130,16 +143,27 @@ sub Dashboard_Initialize ($) {
|
|||||||
#new attribute vers. 2.02
|
#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 ".
|
"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
|
#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
|
#new attribute vers. 2.04
|
||||||
"dashboard_webfrontendfilter ".
|
"dashboard_webfrontendfilter ".
|
||||||
#new attribute vers. 2.06
|
#new attribute vers. 2.06
|
||||||
"dashboard_customcss ".
|
"dashboard_customcss ".
|
||||||
"dashboard_tab6name dashboard_tab7name ".
|
"dashboard_tab6name ".
|
||||||
"dashboard_tab6groups dashboard_tab7groups ".
|
"dashboard_tab7name ".
|
||||||
"dashboard_tab6sorting dashboard_tab7sorting ".
|
"dashboard_tab6groups ".
|
||||||
"dashboard_tab6icon dashboard_tab7icon ".
|
"dashboard_tab7groups ".
|
||||||
$readingFnAttributes;
|
"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}{LINK} = "?room=".$dashboardhiddenroom;
|
||||||
$data{FWEXT}{Dashboardx}{NAME} = $dashboardname;
|
$data{FWEXT}{Dashboardx}{NAME} = $dashboardname;
|
||||||
@ -155,7 +179,6 @@ sub Dashboard_DetailFN() {
|
|||||||
$ret .= "<table class=\"block wide\" id=\"dashboardtoolbar\" style=\"width:100%\">\n";
|
$ret .= "<table class=\"block wide\" id=\"dashboardtoolbar\" style=\"width:100%\">\n";
|
||||||
$ret .= "<tr><td><div>\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 .= " <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 .= " <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 id=\"resultText\" style=\"padding-top: 8px;\"></div>\n";
|
||||||
$ret .= " </div>\n";
|
$ret .= " </div>\n";
|
||||||
@ -164,22 +187,47 @@ sub Dashboard_DetailFN() {
|
|||||||
return $ret;
|
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 ($$) {
|
sub Dashboard_define ($$) {
|
||||||
my ($hash, $def) = @_;
|
my ($hash, $def) = @_;
|
||||||
|
my $now = time();
|
||||||
|
my $name = $hash->{NAME};
|
||||||
|
$hash->{VERSION} = $dashboardversion;
|
||||||
readingsSingleUpdate( $hash, "state", "Initialized", 0 );
|
readingsSingleUpdate( $hash, "state", "Initialized", 0 );
|
||||||
#CheckInstallation($hash);
|
|
||||||
CheckDashboardEntry($hash);
|
RemoveInternalTimer($hash);
|
||||||
|
InternalTimer ($now + 5, 'CreateDashboardEntry', $hash, 0);
|
||||||
|
InternalTimer ($now + 5, 'CheckDashboardAttributUssage', $hash, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub Dashboard_undef ($$) {
|
sub Dashboard_undef ($$) {
|
||||||
my ($hash,$arg) = @_;
|
my ($hash,$arg) = @_;
|
||||||
|
|
||||||
RemoveInternalTimer($hash);
|
RemoveInternalTimer($hash);
|
||||||
|
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub Dashboard_attr($$$) {
|
sub Dashboard_attr($$$) {
|
||||||
#my ($cmd, $name, $attrName, $attrVal) = @_;
|
my ($cmd, $name, $attrName, $attrVal) = @_;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -220,7 +268,10 @@ sub Dashboard_SummaryFN($$$$)
|
|||||||
|
|
||||||
my $row = AttrVal($defs{$d}{NAME}, "dashboard_row", "center");
|
my $row = AttrVal($defs{$d}{NAME}, "dashboard_row", "center");
|
||||||
my $debug = AttrVal($defs{$d}{NAME}, "dashboard_debug", "0");
|
my $debug = AttrVal($defs{$d}{NAME}, "dashboard_debug", "0");
|
||||||
my $lockstate = AttrVal($defs{$d}{NAME}, "dashboard_lockstate", "unlock");
|
|
||||||
|
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 $activetab = AttrVal($defs{$d}{NAME}, "dashboard_activetab", 1);
|
||||||
my $tabcount = AttrVal($defs{$d}{NAME}, "dashboard_tabcount", 1);
|
my $tabcount = AttrVal($defs{$d}{NAME}, "dashboard_tabcount", 1);
|
||||||
@ -253,34 +304,31 @@ sub Dashboard_SummaryFN($$$$)
|
|||||||
AttrVal($defs{$d}{NAME}, "dashboard_tab5icon", ""),
|
AttrVal($defs{$d}{NAME}, "dashboard_tab5icon", ""),
|
||||||
AttrVal($defs{$d}{NAME}, "dashboard_tab6icon", ""),
|
AttrVal($defs{$d}{NAME}, "dashboard_tab6icon", ""),
|
||||||
AttrVal($defs{$d}{NAME}, "dashboard_tab7icon", ""));
|
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>";
|
|
||||||
#############################################################################################
|
#############################################################################################
|
||||||
|
|
||||||
if ($disable == 1) {
|
if ($disable == 1) {
|
||||||
readingsSingleUpdate( $defs{$d}, "state", "Disabled", 0 );
|
readingsSingleUpdate( $defs{$d}, "state", "Disabled", 0 );
|
||||||
return $ret;
|
return "";
|
||||||
}
|
}
|
||||||
unless (@tabgroups) {
|
unless (@tabgroups) {
|
||||||
readingsSingleUpdate( $defs{$d}, "state", "No Groups set", 0 );
|
readingsSingleUpdate( $defs{$d}, "state", "No Groups set", 0 );
|
||||||
return $ret;
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
############# Filter Dashboard display depending on $FW_wname ###################################
|
############# Filter Dashboard display depending on $FW_wname ###################################
|
||||||
if ($webfrontendfilter ne "*") {
|
if ($webfrontendfilter ne "*") {
|
||||||
my $filterhit = 0;
|
my $filterhit = 0;
|
||||||
my @webfilter = split(",", $webfrontendfilter);
|
my @webfilter = split(",", $webfrontendfilter);
|
||||||
for (my $i=0;$i<@webfilter;$i++){ if (trim($FW_wname) eq trim($webfilter[$i]) ) { $filterhit = 1; } }
|
for (my $i=0;$i<@webfilter;$i++){
|
||||||
if ($filterhit == 0) { return $ret; }
|
|
||||||
|
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,15 +352,7 @@ sub Dashboard_SummaryFN($$$$)
|
|||||||
}
|
}
|
||||||
#-------------------------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
if ($room && $room ne "all") {
|
if ($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 .= "<table class=\"roomoverview dashboard\" id=\"dashboard\">\n";
|
||||||
|
|
||||||
$ret .= "<tr><td><div class=\"dashboardhidden\">\n";
|
$ret .= "<tr><td><div class=\"dashboardhidden\">\n";
|
||||||
@ -362,10 +402,19 @@ sub Dashboard_SummaryFN($$$$)
|
|||||||
}
|
}
|
||||||
$ret .= "</div></td></tr>\n";
|
$ret .= "</div></td></tr>\n";
|
||||||
$ret .= "</table>\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($$$$){
|
sub BuildDashboardTopRow($$$$){
|
||||||
@ -427,7 +476,6 @@ sub BuildButtonBar($$$){
|
|||||||
if ($pos ne "hidden") {
|
if ($pos ne "hidden") {
|
||||||
$ret .= "<div class=\"dashboard_buttonbar dashboard_buttonbar_".$cssclass."\">\n";
|
$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_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 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";
|
$ret .= "</div>\n";
|
||||||
}
|
}
|
||||||
@ -589,27 +637,6 @@ sub GetMaxColumnId($$) {
|
|||||||
return $maxcolid;
|
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($) {
|
sub CheckDashboardEntry($) {
|
||||||
my ($hash) = @_;
|
my ($hash) = @_;
|
||||||
my $now = time();
|
my $now = time();
|
||||||
@ -643,6 +670,12 @@ sub CheckDashboardAttributUssage($) { # replaces old disused attributes and thei
|
|||||||
$tabgroups = AttrVal($defs{$d}{NAME}, "dashboard_tab5groups", "999");
|
$tabgroups = AttrVal($defs{$d}{NAME}, "dashboard_tab5groups", "999");
|
||||||
if ($tabgroups eq "1" ) { FW_fC("deleteattr ".$d." dashboard_tab5groups"); }
|
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($) {
|
sub CreateDashboardEntry($) {
|
||||||
@ -658,15 +691,6 @@ sub CreateDashboardEntry($) {
|
|||||||
foreach my $dn (sort keys %defs) {
|
foreach my $dn (sort keys %defs) {
|
||||||
if ($defs{$dn}{TYPE} eq "FHEMWEB" && $defs{$dn}{NAME} !~ /FHEMWEB:/) {
|
if ($defs{$dn}{TYPE} eq "FHEMWEB" && $defs{$dn}{NAME} !~ /FHEMWEB:/) {
|
||||||
my $hr = AttrVal($defs{$dn}{NAME}, "hiddenroom", "");
|
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.";
|
|
||||||
}
|
|
||||||
#-------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
if (index($hr,$dashboardhiddenroom) == -1){
|
if (index($hr,$dashboardhiddenroom) == -1){
|
||||||
if ($hr eq "") {FW_fC("attr ".$defs{$dn}{NAME}." hiddenroom ".$dashboardhiddenroom);}
|
if ($hr eq "") {FW_fC("attr ".$defs{$dn}{NAME}." hiddenroom ".$dashboardhiddenroom);}
|
||||||
else {FW_fC("attr ".$defs{$dn}{NAME}." hiddenroom ".$hr.",".$dashboardhiddenroom);}
|
else {FW_fC("attr ".$defs{$dn}{NAME}." hiddenroom ".$hr.",".$dashboardhiddenroom);}
|
||||||
@ -675,10 +699,11 @@ sub CreateDashboardEntry($) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#dashboard_lockstate
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
||||||
=pod
|
=pod
|
||||||
|
@ -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
|
// 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.
|
// been fixed.
|
||||||
// 2.04: Dashboard position near Top in showfullsize-mode. Restore ActiveTab funktion
|
// 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
|
// Known Bugs/Todo's
|
||||||
// See 95_Dashboard.pm
|
// See 95_Dashboard.pm
|
||||||
@ -142,21 +142,6 @@ function showdebugMessage(msg){
|
|||||||
document.getElementById("dashboard_jsdebug").value = 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(){
|
function dashboard_setlock(){
|
||||||
$("#dashboard_button_lock").prepend('<span class="dashboard_button_icon dashboard_button_iconlock"></span>');
|
$("#dashboard_button_lock").prepend('<span class="dashboard_button_icon dashboard_button_iconlock"></span>');
|
||||||
//############################################################
|
//############################################################
|
||||||
@ -235,15 +220,13 @@ $(document).ready( function () {
|
|||||||
//-------------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------------
|
||||||
$("body").attr("longpollfilter", ".*") //need for longpoll
|
$("body").attr("longpollfilter", ".*") //need for longpoll
|
||||||
|
|
||||||
if (params[13] == 1){ //disable roomlist and header, but not in room Everything
|
if (params[13] == 1){ //disable roomlist and header
|
||||||
if ($('#content').attr("room") != "all") {
|
|
||||||
$("#menuScrollArea").remove();
|
$("#menuScrollArea").remove();
|
||||||
$("#hdr").remove();
|
$("#hdr").remove();
|
||||||
$(".roomoverview:first").remove();
|
$(".roomoverview:first").remove();
|
||||||
$("br:first").remove();
|
$("br:first").remove();
|
||||||
$("#content").css({position: 'inherit'});
|
$("#content").css({position: 'inherit'});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
$(".dashboard_column").sortable({
|
$(".dashboard_column").sortable({
|
||||||
connectWith: ['.dashboard_column', '.ui-row'],
|
connectWith: ['.dashboard_column', '.ui-row'],
|
||||||
@ -325,21 +308,8 @@ $(document).ready( function () {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#dashboard_button_lock").button({
|
|
||||||
create: function( event, ui ) {
|
|
||||||
dashboard_modifyWidget();
|
dashboard_modifyWidget();
|
||||||
if (params[3] == "lock") {
|
if (params[3] == "lock") {dashboard_setlock();} else {dashboard_unsetlock();}
|
||||||
$(this).button( "option", "label", "Unlock" );
|
|
||||||
dashboard_setlock();
|
|
||||||
} else {
|
|
||||||
$(this).button( "option", "label", "Lock" );
|
|
||||||
dashboard_unsetlock();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (params[14] != "none" ) {$('<style type="text/css">'+params[14]+'</style>').appendTo($('head')); }
|
if (params[14] != "none" ) {$('<style type="text/css">'+params[14]+'</style>').appendTo($('head')); }
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user