mirror of
				https://github.com/node-red/node-red-nodes.git
				synced 2025-03-01 10:37:43 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			45 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			45 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
 | 
						|
<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">
 | 
						|
    </div>
 | 
						|
    <div class="form-row">
 | 
						|
        <label for="node-input-host"><i class="fa fa-globe"></i> Host Address</label>
 | 
						|
        <input type="text" id="node-input-host" placeholder="e.g. 255.255.255.255">
 | 
						|
    </div>
 | 
						|
    <div class="form-row">
 | 
						|
        <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
 | 
						|
        <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>
 | 
						|
</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>
 | 
						|
    <p>You may instead set <code>msg.mac</code> to dynamically set the target device mac to wake up.</p>
 | 
						|
    <p>The target host address can optionally be set using <code>msg.host</code></p>
 | 
						|
</script>
 | 
						|
 | 
						|
<script type="text/javascript">
 | 
						|
    RED.nodes.registerType('wake on lan',{
 | 
						|
        category: 'network-output',
 | 
						|
        color:"#999966",
 | 
						|
        defaults: {
 | 
						|
            mac: {value:""},
 | 
						|
            host: {value:""},
 | 
						|
            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") ;
 | 
						|
        },
 | 
						|
        labelStyle: function() {
 | 
						|
            return this.name?"node_label_italic":"";
 | 
						|
        }
 | 
						|
    });
 | 
						|
</script>
 |