mirror of
				https://github.com/retspen/webvirtcloud
				synced 2025-07-31 12:41:08 +00:00 
			
		
		
		
	make console password optional for users with permissions
This commit is contained in:
		
							parent
							
								
									74a4a1a3ef
								
							
						
					
					
						commit
						44aa746f4b
					
				
					 8 changed files with 57 additions and 5 deletions
				
			
		|  | @ -199,7 +199,11 @@ | |||
|     <label for="port">{% trans 'Port' %}:</label> | ||||
|     <input type='text' id='port' value='{{ ws_port }}'> | ||||
|     <label for="password">{% trans 'Password' %}:</label> | ||||
|     <input type='password' id='password'> | ||||
|     {% if perms.instances.passwordless_console %} | ||||
|         <input type='password' id='password' value='{{ console_passwd }}'> | ||||
|     {% else %} | ||||
|         <input type='password' id='password'> | ||||
|     {% endif %} | ||||
|     <label for="show_console">{% trans 'Show console' %}</label> | ||||
|     <input type="checkbox" id="show_console" value="1" onchange="toggle_console()" checked> | ||||
|     <button id="connectButton">{% trans 'Start' %}</button> | ||||
|  |  | |||
|  | @ -93,7 +93,11 @@ | |||
|         } | ||||
| 
 | ||||
|         if (password === undefined) { | ||||
|             password = spice_query_var('password', ''); | ||||
|             {% if perms.instances.passwordless_console %} | ||||
|                 password = '{{ console_passwd }}'; | ||||
|             {% else %} | ||||
|                 password = prompt('{% trans "Password" %}'); | ||||
|             {% endif %} | ||||
|             //password = '{{ console_passwd | safe }}'; | ||||
|         } | ||||
|         if (password === 'None') password = ''; | ||||
|  |  | |||
|  | @ -297,7 +297,11 @@ | |||
|             <ul> | ||||
|                 <li> | ||||
|                     <label>Password:</label> | ||||
|                     <input id="noVNC_password_input" type="password" /> | ||||
|                     {% if perms.instances.passwordless_console %} | ||||
|                         <input id="noVNC_password_input" type="password" value='{{ console_passwd }}' /> | ||||
|                     {% else %} | ||||
|                         <input id="noVNC_password_input" type="password" /> | ||||
|                     {% endif %} | ||||
|                 </li> | ||||
|                 <li> | ||||
|                     <input id="noVNC_password_button" type="submit" value="Send Password" class="noVNC_submit" /> | ||||
|  |  | |||
|  | @ -167,7 +167,13 @@ | |||
|     // By default, use the host and port of server that served this file | ||||
|     const host = readQueryVariable('host', '{{ ws_host }}'); | ||||
|     let port = readQueryVariable('port', '{{ ws_port }}'); | ||||
|     const password = readQueryVariable('password'); | ||||
| 
 | ||||
|     {% if perms.instances.passwordless_console %} | ||||
|         const password = '{{ console_passwd }}'; | ||||
|     {% else %} | ||||
|         const password = readQueryVariable('password'); | ||||
|     {% endif %} | ||||
| 
 | ||||
|     //const path = readQueryVariable('path', 'websockify'); | ||||
|     const path = readQueryVariable('path', '{{ ws_path }}'); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue