mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
Tweak WOL node to display name correctly if set. Closes PR #63
This commit is contained in:
parent
7545515b4d
commit
3a8e86d962
@ -17,7 +17,7 @@
|
|||||||
<script type="text/x-red" data-template-name="wake on lan">
|
<script type="text/x-red" data-template-name="wake on lan">
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label for="node-input-mac"><i class="fa fa-globe"></i> MAC Address</label>
|
<label for="node-input-mac"><i class="fa fa-globe"></i> MAC Address</label>
|
||||||
<input type="text" id="node-input-mac" placeholder="DE:AD:BE:EF:FE:ED">
|
<input type="text" id="node-input-mac" placeholder="e.g. DE:AD:BE:EF:FE:ED">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
||||||
@ -44,8 +44,7 @@
|
|||||||
icon: "light.png",
|
icon: "light.png",
|
||||||
align: "right",
|
align: "right",
|
||||||
label: function() {
|
label: function() {
|
||||||
if (this.mac != "") { return "WOL: "+this.mac; }
|
return this.name ? this.name : (this.mac ? "WOL: "+this.mac : "Wake on Lan") ;
|
||||||
else { return this.name||"wake on lan"; }
|
|
||||||
},
|
},
|
||||||
labelStyle: function() {
|
labelStyle: function() {
|
||||||
return this.name?"node_label_italic":"";
|
return this.name?"node_label_italic":"";
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name" : "node-red-node-wol",
|
"name" : "node-red-node-wol",
|
||||||
"version" : "0.0.1",
|
"version" : "0.0.2",
|
||||||
"description" : "A Node-RED node to send Wake-On-LAN (WOL) magic packets",
|
"description" : "A Node-RED node to send Wake-On-LAN (WOL) magic packets",
|
||||||
"dependencies" : {
|
"dependencies" : {
|
||||||
"wake_on_lan" : "0.0.3"
|
"wake_on_lan" : "0.0.3"
|
||||||
|
Loading…
Reference in New Issue
Block a user