1
0
mirror of https://github.com/node-red/node-red-nodes.git synced 2023-10-10 13:36:58 +02:00
node-red-nodes/io/wol/39-wol.html

47 lines
2.0 KiB
HTML
Raw Normal View History

2013-10-26 17:44:23 +02:00
<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="e.g. DE:AD:BE:EF:FE:ED">
2013-10-26 17:44:23 +02:00
</div>
<div class="form-row">
<label for="node-input-host"><i class="fa fa-globe"></i> Target Address</label>
<input type="text" id="node-input-host" placeholder="e.g. 192.168.1.255 or 10.255.255.255">
</div>
2013-10-26 17:44:23 +02:00
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
2013-10-26 17:44:23 +02:00
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div class="form-tips">Tip: leave blank if you want to use <code>msg.mac</code> or <code>msg.host</code> to dynamically set target mac address.</div>
2013-10-26 17:44:23 +02:00
</script>
<script type="text/x-red" data-help-name="wake on lan">
<p>Sends a Wake-On-LAN magic packet to the mac address specified.</p>
2016-03-02 14:26:19 +01:00
<p>You may instead set <code>msg.mac</code> to dynamically set the target device mac to wake up.</p>
<p>The address of the target machine can optionally be set using <code>msg.host</code></p>
<p>Setting the target address to the broadcast address of the subnet that the target machine is attached to works best.
For a class C address this is usually just the first three parts of the ip address followed by 255. eg 192.168.1.255.</p>
2013-10-26 17:44:23 +02:00
</script>
<script type="text/javascript">
RED.nodes.registerType('wake on lan',{
category: 'network-output',
2013-10-26 17:44:23 +02:00
color:"#999966",
defaults: {
mac: {value:""},
host: {value:""},
2013-10-26 17:44:23 +02:00
name: {value:""}
},
inputs:1,
outputs:0,
icon: "light.png",
align: "right",
label: function() {
return this.name ? this.name : (this.mac ? "WOL: "+this.mac : "Wake on Lan") ;
2013-10-26 17:44:23 +02:00
},
labelStyle: function() {
return this.name?"node_label_italic":"";
}
});
</script>