mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 09:16:53 +00:00
95_Dashboard: fix deleting links
git-svn-id: https://svn.fhem.de/fhem/trunk@20214 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
47fc62ec28
commit
2ebcd80986
@ -55,6 +55,7 @@ use vars qw($FW_ss); # is smallscreen, needed by 97_GROUP/95_VIEW
|
|||||||
|
|
||||||
# Versions History intern
|
# Versions History intern
|
||||||
our %Dashboard_vNotesIntern = (
|
our %Dashboard_vNotesIntern = (
|
||||||
|
"3.13.1" => "21.09.2019 don't eliminate links for PageEnd-Devices ",
|
||||||
"3.13.0" => "20.09.2019 change attribute noLinks to dashboard_noLinks, eliminate links for PageEnd-Devices ",
|
"3.13.0" => "20.09.2019 change attribute noLinks to dashboard_noLinks, eliminate links for PageEnd-Devices ",
|
||||||
"3.12.0" => "16.09.2019 new attribute noLinks, review comref and get-options ",
|
"3.12.0" => "16.09.2019 new attribute noLinks, review comref and get-options ",
|
||||||
"3.11.0" => "16.09.2019 attr dashboard_activetab is now working properly, commandref revised, calculate attribute ".
|
"3.11.0" => "16.09.2019 attr dashboard_activetab is now working properly, commandref revised, calculate attribute ".
|
||||||
@ -828,9 +829,6 @@ sub Dashboard_BuildGroup ($$$$$$) {
|
|||||||
if ($devret !~ /informId/i) {
|
if ($devret !~ /informId/i) {
|
||||||
$ret .= " informId=\"$d\"";
|
$ret .= " informId=\"$d\"";
|
||||||
}
|
}
|
||||||
if(AttrVal($name, "dashboard_noLinks", 0)) {
|
|
||||||
$devret =~ s/.*(<a\s+href="\/fhem\?detail=.*>(.*)<\/a>).*/$2/mg; # keine Links zur Detailansicht des Devices für PageEnd Devices (bringen Link inkludiert mit)
|
|
||||||
}
|
|
||||||
$ret .= ">$devret</td>";
|
$ret .= ">$devret</td>";
|
||||||
use strict "refs";
|
use strict "refs";
|
||||||
|
|
||||||
@ -890,7 +888,7 @@ return $ret;
|
|||||||
#############################################################################################
|
#############################################################################################
|
||||||
sub Dashboard_GetMaxColumnId ($$) {
|
sub Dashboard_GetMaxColumnId ($$) {
|
||||||
my ($row, $colcount) = @_;
|
my ($row, $colcount) = @_;
|
||||||
my $maxcolid = "0";
|
my $maxcolid = "0";
|
||||||
|
|
||||||
if (index($row,"bottom") > 0) { $maxcolid = "200"; }
|
if (index($row,"bottom") > 0) { $maxcolid = "200"; }
|
||||||
elsif (index($row,"center") > 0) { $maxcolid = $colcount-1; }
|
elsif (index($row,"center") > 0) { $maxcolid = $colcount-1; }
|
||||||
@ -903,8 +901,8 @@ return $maxcolid;
|
|||||||
#
|
#
|
||||||
#############################################################################################
|
#############################################################################################
|
||||||
sub Dashboard_CheckDashboardEntry ($) {
|
sub Dashboard_CheckDashboardEntry ($) {
|
||||||
my ($hash) = @_;
|
my ($hash) = @_;
|
||||||
my $now = time();
|
my $now = time();
|
||||||
my $timeToExec = $now + 5;
|
my $timeToExec = $now + 5;
|
||||||
|
|
||||||
RemoveInternalTimer($hash);
|
RemoveInternalTimer($hash);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# $Id: 95_Dashboard.pm 20185 2019-09-17 22:13:48Z DS_Starter $
|
# $Id: 95_Dashboard.pm 20211 2019-09-20 22:02:11Z DS_Starter $
|
||||||
########################################################################################
|
########################################################################################
|
||||||
# 95_Dashboard.pm
|
# 95_Dashboard.pm
|
||||||
#
|
#
|
||||||
@ -55,7 +55,9 @@ use vars qw($FW_ss); # is smallscreen, needed by 97_GROUP/95_VIEW
|
|||||||
|
|
||||||
# Versions History intern
|
# Versions History intern
|
||||||
our %Dashboard_vNotesIntern = (
|
our %Dashboard_vNotesIntern = (
|
||||||
"3.11.1" => "16.09.2019 new attribute noLinks ",
|
"3.13.1" => "21.09.2019 don't eliminate links for PageEnd-Devices ",
|
||||||
|
"3.13.0" => "20.09.2019 change attribute noLinks to dashboard_noLinks, eliminate links for PageEnd-Devices ",
|
||||||
|
"3.12.0" => "16.09.2019 new attribute noLinks, review comref and get-options ",
|
||||||
"3.11.0" => "16.09.2019 attr dashboard_activetab is now working properly, commandref revised, calculate attribute ".
|
"3.11.0" => "16.09.2019 attr dashboard_activetab is now working properly, commandref revised, calculate attribute ".
|
||||||
"dashboard_activetab (is now a userattr) ",
|
"dashboard_activetab (is now a userattr) ",
|
||||||
"3.10.1" => "29.06.2018 added FW_hideDisplayName, Forum #88727 ",
|
"3.10.1" => "29.06.2018 added FW_hideDisplayName, Forum #88727 ",
|
||||||
@ -115,7 +117,7 @@ sub Dashboard_Initialize ($) {
|
|||||||
"dashboard_tab[0-9]+rowcentercolwidth " .
|
"dashboard_tab[0-9]+rowcentercolwidth " .
|
||||||
"dashboard_tab[0-9]+backgroundimage " .
|
"dashboard_tab[0-9]+backgroundimage " .
|
||||||
"dashboard_width ".
|
"dashboard_width ".
|
||||||
"noLinks:1,0 ";
|
"dashboard_noLinks:1,0 ";
|
||||||
|
|
||||||
$data{FWEXT}{jquery}{SCRIPT} = "/pgm2/".$fwjquery if (!$data{FWEXT}{jquery}{SCRIPT});
|
$data{FWEXT}{jquery}{SCRIPT} = "/pgm2/".$fwjquery if (!$data{FWEXT}{jquery}{SCRIPT});
|
||||||
$data{FWEXT}{jqueryui}{SCRIPT} = "/pgm2/".$fwjqueryui if (!$data{FWEXT}{jqueryui}{SCRIPT});
|
$data{FWEXT}{jqueryui}{SCRIPT} = "/pgm2/".$fwjqueryui if (!$data{FWEXT}{jqueryui}{SCRIPT});
|
||||||
@ -184,7 +186,7 @@ sub Dashboard_Get($@) {
|
|||||||
my $arg2 = (defined($a[2]) ? $a[2] : "");
|
my $arg2 = (defined($a[2]) ? $a[2] : "");
|
||||||
|
|
||||||
if ($arg eq "config") {
|
if ($arg eq "config") {
|
||||||
my $name = $hash->{NAME};
|
my $name = $hash->{NAME};
|
||||||
my $attrdata = $attr{$name};
|
my $attrdata = $attr{$name};
|
||||||
if ($attrdata) {
|
if ($attrdata) {
|
||||||
my $x = keys %$attrdata;
|
my $x = keys %$attrdata;
|
||||||
@ -201,7 +203,7 @@ sub Dashboard_Get($@) {
|
|||||||
foreach my $idir (@iconFolders) {$iconDirs .= "$attr{global}{modpath}/www/images/".$idir.",";}
|
foreach my $idir (@iconFolders) {$iconDirs .= "$attr{global}{modpath}/www/images/".$idir.",";}
|
||||||
|
|
||||||
$res .= " \"icondirs\": \"$iconDirs\", \"dashboard_tabcount\": " . Dashboard_GetTabCount($hash, 0). ", \"dashboard_activetab\": " . Dashboard_GetActiveTab($hash->{NAME});
|
$res .= " \"icondirs\": \"$iconDirs\", \"dashboard_tabcount\": " . Dashboard_GetTabCount($hash, 0). ", \"dashboard_activetab\": " . Dashboard_GetActiveTab($hash->{NAME});
|
||||||
$res .= ($i != $x) ? ",\n" : "\n";
|
$res .= ($i != $x) ? ",\n" : "\n";
|
||||||
|
|
||||||
foreach my $attr (sort keys %$attrdata) {
|
foreach my $attr (sort keys %$attrdata) {
|
||||||
$i++;
|
$i++;
|
||||||
@ -214,7 +216,7 @@ sub Dashboard_Get($@) {
|
|||||||
} else {
|
} else {
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
$res .= ($i != $x) ? ",\n" : "\n";
|
$res .= ($i != $x) ? ",\n" : "\n";
|
||||||
}
|
}
|
||||||
$res .= " }\n";
|
$res .= " }\n";
|
||||||
$res .= "}\n";
|
$res .= "}\n";
|
||||||
@ -240,11 +242,12 @@ sub Dashboard_Get($@) {
|
|||||||
} elsif ($arg eq "icon") {
|
} elsif ($arg eq "icon") {
|
||||||
shift @a;
|
shift @a;
|
||||||
shift @a;
|
shift @a;
|
||||||
|
return "Please provide only one icon whose path and full name is to show." if(!@a || $a[1]);
|
||||||
my $icon = join (' ', @a);
|
my $icon = join (' ', @a);
|
||||||
return FW_iconPath($icon);
|
return FW_iconPath($icon);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return "Unknown argument $arg choose one of config:noArg groupWidget tab icon";
|
return "Unknown argument $arg choose one of config:noArg icon";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -804,7 +807,7 @@ sub Dashboard_BuildGroup ($$$$$$) {
|
|||||||
$devName = "" if($modules{$defs{$d}{TYPE}}{FW_hideDisplayName}); # Forum 88667
|
$devName = "" if($modules{$defs{$d}{TYPE}}{FW_hideDisplayName}); # Forum 88667
|
||||||
|
|
||||||
if (!$modules{$defs{$d}{TYPE}}{FW_atPageEnd}) { # Don't show Link for "atEnd"-devices
|
if (!$modules{$defs{$d}{TYPE}}{FW_atPageEnd}) { # Don't show Link for "atEnd"-devices
|
||||||
if(AttrVal($name, "noLinks", 0)) {
|
if(AttrVal($name, "dashboard_noLinks", 0)) {
|
||||||
$ret .= "<td>$icon$devName</td>"; # keine Links zur Detailansicht des Devices
|
$ret .= "<td>$icon$devName</td>"; # keine Links zur Detailansicht des Devices
|
||||||
} else {
|
} else {
|
||||||
$ret .= FW_pH ("detail=$d", "$icon$devName", 1, "col1", 1); # FW_pH = add href (<link>, <Text>, <?>, <class>, <Wert zurückgeben>, <?>)
|
$ret .= FW_pH ("detail=$d", "$icon$devName", 1, "col1", 1); # FW_pH = add href (<link>, <Text>, <?>, <class>, <Wert zurückgeben>, <?>)
|
||||||
@ -885,7 +888,7 @@ return $ret;
|
|||||||
#############################################################################################
|
#############################################################################################
|
||||||
sub Dashboard_GetMaxColumnId ($$) {
|
sub Dashboard_GetMaxColumnId ($$) {
|
||||||
my ($row, $colcount) = @_;
|
my ($row, $colcount) = @_;
|
||||||
my $maxcolid = "0";
|
my $maxcolid = "0";
|
||||||
|
|
||||||
if (index($row,"bottom") > 0) { $maxcolid = "200"; }
|
if (index($row,"bottom") > 0) { $maxcolid = "200"; }
|
||||||
elsif (index($row,"center") > 0) { $maxcolid = $colcount-1; }
|
elsif (index($row,"center") > 0) { $maxcolid = $colcount-1; }
|
||||||
@ -898,8 +901,8 @@ return $maxcolid;
|
|||||||
#
|
#
|
||||||
#############################################################################################
|
#############################################################################################
|
||||||
sub Dashboard_CheckDashboardEntry ($) {
|
sub Dashboard_CheckDashboardEntry ($) {
|
||||||
my ($hash) = @_;
|
my ($hash) = @_;
|
||||||
my $now = time();
|
my $now = time();
|
||||||
my $timeToExec = $now + 5;
|
my $timeToExec = $now + 5;
|
||||||
|
|
||||||
RemoveInternalTimer($hash);
|
RemoveInternalTimer($hash);
|
||||||
@ -1027,12 +1030,12 @@ sub Dashboard_setVersionInfo($) {
|
|||||||
|
|
||||||
if($modules{$type}{META}{x_prereqs_src} && !$hash->{HELPER}{MODMETAABSENT}) { # META-Daten sind vorhanden
|
if($modules{$type}{META}{x_prereqs_src} && !$hash->{HELPER}{MODMETAABSENT}) { # META-Daten sind vorhanden
|
||||||
$modules{$type}{META}{version} = "v".$v; # Version aus META.json überschreiben, Anzeige mit {Dumper $modules{SMAPortal}{META}}
|
$modules{$type}{META}{version} = "v".$v; # Version aus META.json überschreiben, Anzeige mit {Dumper $modules{SMAPortal}{META}}
|
||||||
if($modules{$type}{META}{x_version}) { # {x_version} ( nur gesetzt wenn $Id: 95_Dashboard.pm 20185 2019-09-17 22:13:48Z DS_Starter $ im Kopf komplett! vorhanden )
|
if($modules{$type}{META}{x_version}) { # {x_version} ( nur gesetzt wenn $Id: 95_Dashboard.pm 20211 2019-09-20 22:02:11Z DS_Starter $ im Kopf komplett! vorhanden )
|
||||||
$modules{$type}{META}{x_version} =~ s/1.1.1/$v/g;
|
$modules{$type}{META}{x_version} =~ s/1.1.1/$v/g;
|
||||||
} else {
|
} else {
|
||||||
$modules{$type}{META}{x_version} = $v;
|
$modules{$type}{META}{x_version} = $v;
|
||||||
}
|
}
|
||||||
return $@ unless (FHEM::Meta::SetInternals($hash)); # FVERSION wird gesetzt ( nur gesetzt wenn $Id: 95_Dashboard.pm 20185 2019-09-17 22:13:48Z DS_Starter $ im Kopf komplett! vorhanden )
|
return $@ unless (FHEM::Meta::SetInternals($hash)); # FVERSION wird gesetzt ( nur gesetzt wenn $Id: 95_Dashboard.pm 20211 2019-09-20 22:02:11Z DS_Starter $ im Kopf komplett! vorhanden )
|
||||||
if(__PACKAGE__ eq "FHEM::$type" || __PACKAGE__ eq $type) { # es wird mit Packages gearbeitet -> Perl übliche Modulversion setzen
|
if(__PACKAGE__ eq "FHEM::$type" || __PACKAGE__ eq $type) { # es wird mit Packages gearbeitet -> Perl übliche Modulversion setzen
|
||||||
use version 0.77; our $VERSION = FHEM::Meta::Get( $hash, 'version' ); # mit {<Modul>->VERSION()} im FHEMWEB kann Modulversion abgefragt werden
|
use version 0.77; our $VERSION = FHEM::Meta::Get( $hash, 'version' ); # mit {<Modul>->VERSION()} im FHEMWEB kann Modulversion abgefragt werden
|
||||||
}
|
}
|
||||||
@ -1103,7 +1106,22 @@ return;
|
|||||||
<b>Get</b>
|
<b>Get</b>
|
||||||
<ul>
|
<ul>
|
||||||
<ul>
|
<ul>
|
||||||
N/A
|
|
||||||
|
<a name="config"></a>
|
||||||
|
<li><b>get <name> config </b><br>
|
||||||
|
Delivers the configuration of the dashboard back. <br>
|
||||||
|
<br>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<a name="icon"></a>
|
||||||
|
<li><b>get <name> icon <icon name> </b><br>
|
||||||
|
Delivers the path and full name of the denoted icon back. <br><br>
|
||||||
|
|
||||||
|
<b>Example: </b><br>
|
||||||
|
get <name> icon measure_power_meter
|
||||||
|
<br>
|
||||||
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</ul>
|
</ul>
|
||||||
<br>
|
<br>
|
||||||
@ -1267,14 +1285,14 @@ return;
|
|||||||
</li>
|
</li>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<a name="noLinks"></a>
|
<a name="dashboard_noLinks"></a>
|
||||||
<li><b>noLinks</b><br>
|
<li><b>dashboard_noLinks</b><br>
|
||||||
No link generation to the detail view of the devices takes place. <br><br>
|
No link generation to the detail view of the devices takes place. <br><br>
|
||||||
|
|
||||||
<b>Note: </b><br>
|
<b>Note: </b><br>
|
||||||
Some device types deliver the links to their detail view integrated in the devices name or alias.
|
Some device types deliver the links to their detail view integrated in the devices name or alias.
|
||||||
In such cases you have to deactivate the link generation inside of the device (for example in devices of type readingsGroup,
|
In such cases you have to deactivate the link generation inside of the device (for example in devices of type readingsGroup,
|
||||||
SSCamSTRM or SMAPortal).
|
SSCamSTRM, SVG or SMAPortal).
|
||||||
</li>
|
</li>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
@ -1337,7 +1355,22 @@ return;
|
|||||||
<b>Get</b>
|
<b>Get</b>
|
||||||
<ul>
|
<ul>
|
||||||
<ul>
|
<ul>
|
||||||
N/A
|
|
||||||
|
<a name="config"></a>
|
||||||
|
<li><b>get <name> config </b><br>
|
||||||
|
Liefert die Konfiguration des Dashboards zurück. <br>
|
||||||
|
<br>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<a name="icon"></a>
|
||||||
|
<li><b>get <name> icon <icon name> </b><br>
|
||||||
|
Liefert den Pfad und vollen Namen des angegebenen Icons zurück. <br><br>
|
||||||
|
|
||||||
|
<b>Beispiel: </b><br>
|
||||||
|
get <name> icon measure_power_meter
|
||||||
|
<br>
|
||||||
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</ul>
|
</ul>
|
||||||
<br>
|
<br>
|
||||||
@ -1513,14 +1546,14 @@ return;
|
|||||||
</li>
|
</li>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<a name="noLinks"></a>
|
<a name="dashboard_noLinks"></a>
|
||||||
<li><b>noLinks</b><br>
|
<li><b>dashboard_noLinks</b><br>
|
||||||
Es erfolgt keine Linkerstellung zur Detailansicht von Devices. <br><br>
|
Es erfolgt keine Linkerstellung zur Detailansicht von Devices. <br><br>
|
||||||
|
|
||||||
<b>Hinweis: </b><br>
|
<b>Hinweis: </b><br>
|
||||||
Bei manchen Devicetypen wird der Link zur Detailansicht integriert im Namen bzw. Alias des Device mitgeliefert.
|
Bei manchen Devicetypen wird der Link zur Detailansicht integriert im Namen bzw. Alias des Device mitgeliefert.
|
||||||
In diesen Fällen muß die Linkgenerierung direkt im Device abgestellt werden (z.B. bei Devices der Typen readingsGroup,
|
In diesen Fällen muß die Linkgenerierung direkt im Device abgestellt werden (z.B. bei Devices der Typen readingsGroup,
|
||||||
SSCamSTRM oder SMAPortal).
|
SSCamSTRM, SVG oder SMAPortal).
|
||||||
</li>
|
</li>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user