forked from coolaj86/telebit.js
		
	update grant message
This commit is contained in:
		
							parent
							
								
									af9a7c5812
								
							
						
					
					
						commit
						0aab6c8739
					
				
							
								
								
									
										16
									
								
								remote.js
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								remote.js
									
									
									
									
									
								
							| @ -206,6 +206,17 @@ function run(state) { | |||||||
|     }); |     }); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  |   function displayGrants(grants) { | ||||||
|  |     // TODO sortingHat.print();
 | ||||||
|  |     console.log(""); | ||||||
|  |     console.log("Connect to your device by any of the following means:"); | ||||||
|  |     console.log(""); | ||||||
|  |     grants.forEach(function (arr) { | ||||||
|  |       console.log('\t' + arr[0] + '://' + arr[1] + (arr[2] ? (':' + arr[2]) : '')); | ||||||
|  |     }); | ||||||
|  |     console.log(""); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|   var connCallback; |   var connCallback; | ||||||
| 
 | 
 | ||||||
|   var packerHandlers = { |   var packerHandlers = { | ||||||
| @ -252,6 +263,11 @@ function run(state) { | |||||||
|         err = { message: 'unknown command "'+cmd[1]+'"', code: 'E_UNKNOWN_COMMAND' }; |         err = { message: 'unknown command "'+cmd[1]+'"', code: 'E_UNKNOWN_COMMAND' }; | ||||||
|       } |       } | ||||||
| 
 | 
 | ||||||
|  |       if (cmd[1] === 'grant') { | ||||||
|  |         displayGrants(cmd[2]); | ||||||
|  |         return; | ||||||
|  |       } | ||||||
|  | 
 | ||||||
|       wsHandlers.sendMessage(Packer.pack(null, [-cmd[0], err], 'control')); |       wsHandlers.sendMessage(Packer.pack(null, [-cmd[0], err], 'control')); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user