1
0
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:
Dave C-J 2014-08-19 11:41:29 +01:00
parent 7545515b4d
commit 3a8e86d962
2 changed files with 3 additions and 4 deletions

View File

@ -17,7 +17,7 @@
<script type="text/x-red" data-template-name="wake on lan">
<div class="form-row">
<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 class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
@ -44,8 +44,7 @@
icon: "light.png",
align: "right",
label: function() {
if (this.mac != "") { return "WOL: "+this.mac; }
else { return this.name||"wake on lan"; }
return this.name ? this.name : (this.mac ? "WOL: "+this.mac : "Wake on Lan") ;
},
labelStyle: function() {
return this.name?"node_label_italic":"";

View File

@ -1,6 +1,6 @@
{
"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",
"dependencies" : {
"wake_on_lan" : "0.0.3"