|  | @ -1,6 +1,7 @@ | 
			
		
	
		
		
			
				
					|  |  | <div id="app"> |  |  | <div id="app"> | 
			
		
	
		
		
			
				
					|  |  | 	<div v-for="message in messages" :class="{'error': !message.success}" class="messages">{{message.message}}</div> |  |  | 	<div v-for="message in messages" :class="{'error': !message.success}" class="messages">{{message.message}}</div> | 
			
		
	
		
		
			
				
					|  |  | 	<p v-show="sending" style="position:absolute;top: 10px; right: 10px;">Parancs küldése, kérem várjon.</p> |  |  | 	<p v-show="sending" style="position:absolute;top: 10px; right: 10px;">Parancs küldése, kérem várjon.</p> | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 	<p><?= date('Y.m.d H:i') ?></p> | 
			
		
	
		
		
			
				
					|  |  | 	<p v-if="loading">No equipments, please add one.</p> |  |  | 	<p v-if="loading">No equipments, please add one.</p> | 
			
		
	
		
		
			
				
					|  |  | 	<div class="buttons" v-else> |  |  | 	<div class="buttons" v-else> | 
			
		
	
		
		
			
				
					|  |  | 		<div class="button" v-for="item in items"> |  |  | 		<div class="button" v-for="item in items"> | 
			
		
	
	
		
		
			
				
					|  | @ -8,8 +9,8 @@ | 
			
		
	
		
		
			
				
					|  |  | 						<p>{{item.name}}</p> |  |  | 						<p>{{item.name}}</p> | 
			
		
	
		
		
			
				
					|  |  | 					</div> |  |  | 					</div> | 
			
		
	
		
		
			
				
					|  |  | 					<div> |  |  | 					<div> | 
			
		
	
		
		
			
				
					
					|  |  | 						<a v-on:click="sendsignal(item, item.oncommand)" href="javascript:void(0)" class="addbtn darker"><i class="fa fa-play" aria-hidden="true"></i></a> |  |  | 						<a v-on:click="sendsignal(item, item.oncommand, 'on')" href="javascript:void(0)" class="addbtn darker"><i class="fa fa-play" aria-hidden="true"></i></a> | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  | 						<a v-on:click="sendsignal(item, item.offcommand)" href="javascript:void(0)" class="addbtn darker"><i class="fa fa-stop" aria-hidden="true"></i></a> |  |  | 						<a v-on:click="sendsignal(item, item.offcommand, 'off')" href="javascript:void(0)" class="addbtn darker"><i class="fa fa-stop" aria-hidden="true"></i></a> | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  | 					</div> |  |  | 					</div> | 
			
		
	
		
		
			
				
					|  |  | 					<div v-show="admin"> |  |  | 					<div v-show="admin"> | 
			
		
	
		
		
			
				
					|  |  | 						<a v-on:click="delitem(item)" href="javascript:void(0)" class="addbtn darker"><i class="fa fa-trash" aria-hidden="true"></i></a> |  |  | 						<a v-on:click="delitem(item)" href="javascript:void(0)" class="addbtn darker"><i class="fa fa-trash" aria-hidden="true"></i></a> | 
			
		
	
	
		
		
			
				
					|  | @ -30,7 +31,7 @@ | 
			
		
	
		
		
			
				
					|  |  | 							Channel<br> |  |  | 							Channel<br> | 
			
		
	
		
		
			
				
					|  |  | 							<label>UDP<br><input type="radio" name="channel" value="udp" v-model="newitem.channel"></label>	 |  |  | 							<label>UDP<br><input type="radio" name="channel" value="udp" v-model="newitem.channel"></label>	 | 
			
		
	
		
		
			
				
					|  |  | 							<label>TELNET<br><input type="radio" name="channel" value="telnet" v-model="newitem.channel">	</label> |  |  | 							<label>TELNET<br><input type="radio" name="channel" value="telnet" v-model="newitem.channel">	</label> | 
			
		
	
		
		
			
				
					
					|  |  | 							<label>WOL<br><input type="radio" name="channel" value="wol" v-model="newitem.channel">	</label> |  |  | 							<label>ON/OFF<br><input type="radio" name="channel" value="wol" v-model="newitem.channel">	</label> | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  | 						</label> |  |  | 						</label> | 
			
		
	
		
		
			
				
					|  |  | 					</div> |  |  | 					</div> | 
			
		
	
		
		
			
				
					|  |  | 					<label for="name" v-show="newitem.channel != ''"> |  |  | 					<label for="name" v-show="newitem.channel != ''"> | 
			
		
	
	
		
		
			
				
					|  | @ -41,7 +42,7 @@ | 
			
		
	
		
		
			
				
					|  |  | 						What is the on command?<br> |  |  | 						What is the on command?<br> | 
			
		
	
		
		
			
				
					|  |  | 						<input type="text" name="oncommand" v-model="newitem.oncommand">	<br> |  |  | 						<input type="text" name="oncommand" v-model="newitem.oncommand">	<br> | 
			
		
	
		
		
			
				
					|  |  | 					</label>			 |  |  | 					</label>			 | 
			
		
	
		
		
			
				
					
					|  |  | 					<label for="ontime" v-show="newitem.channel != ''"> |  |  | 					<label for="ontime" v-show="['udp', 'telnet', 'wol'].indexOf(newitem.channel) >= 0"> | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  | 						When to send the on command?<br> |  |  | 						When to send the on command?<br> | 
			
		
	
		
		
			
				
					|  |  | 						<input type="time" name="ontime" v-model="newitem.ontime">	<br> |  |  | 						<input type="time" name="ontime" v-model="newitem.ontime">	<br> | 
			
		
	
		
		
			
				
					|  |  | 					</label>			 |  |  | 					</label>			 | 
			
		
	
	
		
		
			
				
					|  | @ -49,7 +50,7 @@ | 
			
		
	
		
		
			
				
					|  |  | 						What is the off command?<br> |  |  | 						What is the off command?<br> | 
			
		
	
		
		
			
				
					|  |  | 						<input type="text" name="offcommand" v-model="newitem.offcommand">	<br> |  |  | 						<input type="text" name="offcommand" v-model="newitem.offcommand">	<br> | 
			
		
	
		
		
			
				
					|  |  | 					</label>			 |  |  | 					</label>			 | 
			
		
	
		
		
			
				
					
					|  |  | 					<label for="offtime" v-show="['udp', 'telnet'].indexOf(newitem.channel) >= 0"> |  |  | 					<label for="offtime" v-show="['udp', 'telnet','shutdown', 'wol'].indexOf(newitem.channel) >= 0"> | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  | 						When to send the off command?<br> |  |  | 						When to send the off command?<br> | 
			
		
	
		
		
			
				
					|  |  | 						<input type="time" name="offtime" v-model="newitem.offtime">	<br> |  |  | 						<input type="time" name="offtime" v-model="newitem.offtime">	<br> | 
			
		
	
		
		
			
				
					|  |  | 					</label> |  |  | 					</label> | 
			
		
	
	
		
		
			
				
					|  | @ -66,12 +67,14 @@ | 
			
		
	
		
		
			
				
					|  |  | 							<label>sunday<br><input type="checkbox" v-model="newitem.days" value="Sunday"></label>	 |  |  | 							<label>sunday<br><input type="checkbox" v-model="newitem.days" value="Sunday"></label>	 | 
			
		
	
		
		
			
				
					|  |  | 						</label> |  |  | 						</label> | 
			
		
	
		
		
			
				
					|  |  | 					</div> |  |  | 					</div> | 
			
		
	
		
		
			
				
					
					|  |  | 					<div v-show="['udp', 'telnet'].indexOf(newitem.channel) >= 0"> |  |  | 					<div v-show="['udp', 'telnet','shutdown', 'wol'].indexOf(newitem.channel) >= 0"> | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  | 						<label for="ip"> |  |  | 						<label for="ip"> | 
			
		
	
		
		
			
				
					|  |  | 							What ip-s to send the signal to? (Each IP: new line!)<br> |  |  | 							What ip-s to send the signal to? (Each IP: new line!)<br> | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 							<small v-show="newitem.channel === 'wol'">Enter <strong>username:password@IP.AD.RESS</strong><br></small> | 
			
		
	
		
		
			
				
					|  |  | 							<textarea name="ip" v-model="newitem.ip" rows="10"> |  |  | 							<textarea name="ip" v-model="newitem.ip" rows="10"> | 
			
		
	
		
		
			
				
					|  |  | 								 |  |  | 								 | 
			
		
	
		
		
			
				
					|  |  | 							</textarea> |  |  | 							</textarea> | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | 						</label> |  |  | 						</label> | 
			
		
	
		
		
			
				
					|  |  | 						<label for="port" v-show="newitem.channel != ''"> |  |  | 						<label for="port" v-show="newitem.channel != ''"> | 
			
		
	
		
		
			
				
					|  |  | 							What is the network port?<br> |  |  | 							What is the network port?<br> | 
			
		
	
	
		
		
			
				
					|  | @ -80,7 +83,7 @@ | 
			
		
	
		
		
			
				
					|  |  | 					</div> |  |  | 					</div> | 
			
		
	
		
		
			
				
					|  |  | 					<div v-show="newitem.channel === 'wol'"> |  |  | 					<div v-show="newitem.channel === 'wol'"> | 
			
		
	
		
		
			
				
					|  |  | 						<label for="macAdress"> |  |  | 						<label for="macAdress"> | 
			
		
	
		
		
			
				
					
					|  |  | 							What MAC Addresses to send the signal to? (Each MAC Address: new line!)<br> |  |  | 							What MAC:Add:ress:es to send the signal to? (Each MAC Address: new line!)<br> | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  | 							<textarea name="macAdress" v-model="newitem.macAddress" rows="10"> |  |  | 							<textarea name="macAdress" v-model="newitem.macAddress" rows="10"> | 
			
		
	
		
		
			
				
					|  |  | 								 |  |  | 								 | 
			
		
	
		
		
			
				
					|  |  | 							</textarea> |  |  | 							</textarea> | 
			
		
	
	
		
		
			
				
					|  | @ -145,13 +148,13 @@ var app = new Vue({ | 
			
		
	
		
		
			
				
					|  |  |   	add: function() { |  |  |   	add: function() { | 
			
		
	
		
		
			
				
					|  |  |   		this.adding = !this.adding  |  |  |   		this.adding = !this.adding  | 
			
		
	
		
		
			
				
					|  |  |   	}, |  |  |   	}, | 
			
		
	
		
		
			
				
					
					|  |  |   	sendsignal: function(item, action) { |  |  |   	sendsignal: function(item, action, label) { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |   		if (this.sending) { return alert('Please wait, the signal is sending')} |  |  |   		if (this.sending) { return alert('Please wait, the signal is sending')} | 
			
		
	
		
		
			
				
					|  |  |   		this.sending = true |  |  |   		this.sending = true | 
			
		
	
		
		
			
				
					|  |  |   		console.log(`sending signal ${action} to ${item.name}`) |  |  |   		console.log(`sending signal ${action} to ${item.name}`) | 
			
		
	
		
		
			
				
					|  |  |   		 |  |  |   		 | 
			
		
	
		
		
			
				
					|  |  |   		axios |  |  |   		axios | 
			
		
	
		
		
			
				
					
					|  |  |   		  .post('sendsignal', {'item': item, 'action': action}).then(response => { |  |  |   		  .post('sendsignal', {'item': item, 'action': action, 'label': label}).then(response => { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |   		  	this.messages = response.data |  |  |   		  	this.messages = response.data | 
			
		
	
		
		
			
				
					|  |  |   		  	this.sending = false |  |  |   		  	this.sending = false | 
			
		
	
		
		
			
				
					|  |  |   		  }, error => { |  |  |   		  }, error => { | 
			
		
	
	
		
		
			
				
					|  | @ -168,7 +171,9 @@ var app = new Vue({ | 
			
		
	
		
		
			
				
					|  |  | 	  		} |  |  | 	  		} | 
			
		
	
		
		
			
				
					|  |  |   	}, |  |  |   	}, | 
			
		
	
		
		
			
				
					|  |  |   	showinfo: function(item) { |  |  |   	showinfo: function(item) { | 
			
		
	
		
		
			
				
					
					|  |  |   		alert(this.dump(item,2)) |  |  |   		this.newitem = item; | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |  |  |  |   		this.adding = true; | 
			
		
	
		
		
			
				
					|  |  |  |  |  |   		// alert(this.dump(item,2)) | 
			
		
	
		
		
			
				
					|  |  |   	}, |  |  |   	}, | 
			
		
	
		
		
			
				
					|  |  |   	dump: function(arr,level) { |  |  |   	dump: function(arr,level) { | 
			
		
	
		
		
			
				
					|  |  | 		var dumped_text = ""; |  |  | 		var dumped_text = ""; | 
			
		
	
	
		
		
			
				
					|  | 
 |