only fill if user is defined
This commit is contained in:
		
							parent
							
								
									8ff5002579
								
							
						
					
					
						commit
						cf3f8e2cc2
					
				@ -132,7 +132,10 @@ def setmainlayout():
 | 
				
			|||||||
		layout.append([sg.Image(G.imagefile), sg.Text(G.title, size =(18, 1), justification='c', font=["Helvetica", 18])])
 | 
							layout.append([sg.Image(G.imagefile), sg.Text(G.title, size =(18, 1), justification='c', font=["Helvetica", 18])])
 | 
				
			||||||
	else:
 | 
						else:
 | 
				
			||||||
		layout.append([sg.Text(G.title, size =(30, 1), justification='c', font=["Helvetica", 18])])
 | 
							layout.append([sg.Text(G.title, size =(30, 1), justification='c', font=["Helvetica", 18])])
 | 
				
			||||||
 | 
						if G.user:
 | 
				
			||||||
		layout.append([sg.Text("Username", size =(12, 1), font=["Helvetica", 12]), sg.InputText(default_text=G.user,key='-username-', font=["Helvetica", 12])])
 | 
							layout.append([sg.Text("Username", size =(12, 1), font=["Helvetica", 12]), sg.InputText(default_text=G.user,key='-username-', font=["Helvetica", 12])])
 | 
				
			||||||
 | 
						else:
 | 
				
			||||||
 | 
							layout.append([sg.Text("Username", size =(12, 1), font=["Helvetica", 12]), sg.InputText(key='-username-', font=["Helvetica", 12])])
 | 
				
			||||||
	layout.append([sg.Text("Password", size =(12, 1),font=["Helvetica", 12]), sg.InputText(key='-password-', password_char='*', font=["Helvetica", 12])])
 | 
						layout.append([sg.Text("Password", size =(12, 1),font=["Helvetica", 12]), sg.InputText(key='-password-', password_char='*', font=["Helvetica", 12])])
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	if G.totp:
 | 
						if G.totp:
 | 
				
			||||||
@ -146,6 +149,7 @@ def setmainlayout():
 | 
				
			|||||||
def getvms():
 | 
					def getvms():
 | 
				
			||||||
	vms = []
 | 
						vms = []
 | 
				
			||||||
	for vm in G.proxmox.cluster.resources.get(type='vm'):
 | 
						for vm in G.proxmox.cluster.resources.get(type='vm'):
 | 
				
			||||||
 | 
							if vm['type'] == "qemu":
 | 
				
			||||||
			vms.append(vm)
 | 
								vms.append(vm)
 | 
				
			||||||
	return vms
 | 
						return vms
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user