mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-22 08:11:44 +00:00
cmdList patch by justme1968
git-svn-id: https://svn.fhem.de/fhem/trunk@3157 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
dcc7508e7d
commit
5d0c138dfe
@ -38,7 +38,7 @@ weblink_Define($$)
|
||||
{
|
||||
my ($hash, $def) = @_;
|
||||
my ($type, $name, $wltype, $link) = split("[ \t]+", $def, 4);
|
||||
my %thash = ( link=>1, fileplot=>1, dbplot=>1, image=>1, iframe=>1, htmlCode=>1 );
|
||||
my %thash = ( link=>1, fileplot=>1, dbplot=>1, image=>1, iframe=>1, htmlCode=>1, cmdList=>1 );
|
||||
|
||||
if(!$link || !$thash{$wltype}) {
|
||||
return "Usage: define <name> weblink [" .
|
||||
@ -138,6 +138,25 @@ weblink_FwFn($$$$)
|
||||
$ret = "<iframe src=\"$link\" $attr>Iframes disabled</iframe>" .
|
||||
weblink_FwDetail($d);
|
||||
|
||||
} elsif($wltype eq "cmdList") {
|
||||
|
||||
my @lines = split(" ", $link);
|
||||
my $row = 0;
|
||||
my $ret = "<table>";
|
||||
$ret .= "<tr><td><div class=\"devType\"><a href=\"/fhem?detail=$d\">".AttrVal($d, "alias", $d)."</div></td></tr>";
|
||||
$ret .= "<tr><td><table class=\"block wide\">";
|
||||
foreach my $line (@lines) {
|
||||
my @args = split(":", $line, 3);
|
||||
|
||||
$ret .= "<tr class=\"".(($row++&1)?"odd":"even")."\">";
|
||||
$ret .= "<td><a href=\"/fhem?cmd=$args[2]\"><div class=\col1\"><img src=\"/fhem/icons/$args[0]\" width=19 height=19 align=\"center\" alt=\"$args[0]\" title=\"$args[0]\"> $args[1]</div></a></td></td>";
|
||||
$ret .= "</tr>";
|
||||
}
|
||||
$ret .= "</table></td></tr>";
|
||||
$ret .= "</table><br>";
|
||||
|
||||
return $ret;
|
||||
|
||||
} elsif($wltype eq "fileplot" || $wltype eq "dbplot" ) {
|
||||
|
||||
# plots navigation buttons
|
||||
@ -419,7 +438,7 @@ weblink_WriteGplot($)
|
||||
<a name="weblinkdefine"></a>
|
||||
<b>Define</b>
|
||||
<ul>
|
||||
<code>define <name> weblink [link|fileplot|dbplot|image|iframe|htmlCode]
|
||||
<code>define <name> weblink [link|fileplot|dbplot|image|iframe|htmlCode|cmdList]
|
||||
<argument></code>
|
||||
<br><br>
|
||||
This is a placeholder used with webpgm2 to be able to integrate links
|
||||
@ -435,6 +454,7 @@ weblink_WriteGplot($)
|
||||
<code>define w_Frlink weblink htmlCode { WeatherAsHtml("w_Frankfurt") }</code><br>
|
||||
<code>define MyPlot weblink fileplot <logdevice>:<gnuplot-file>:<logfile></code><br>
|
||||
<code>define MyPlot weblink dbplot <logdevice>:<gnuplot-file></code><br>
|
||||
<code>define systemCommands weblink cmdList pair:Pair:set+cul2+hmPairForSec+60 restart:Restart:shutdown+restart update:UpdateCheck:update+check</code><br>
|
||||
</ul>
|
||||
<br>
|
||||
|
||||
@ -447,6 +467,7 @@ weblink_WriteGplot($)
|
||||
the current logfile to a weblink, it will always refer to the current
|
||||
file, even if its name changes regularly (and not the one you
|
||||
originally specified).</li>
|
||||
<li>For cmdList <argument> consist of a list of space separated icon:label:cmd triples.</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user