Add support for INI debug

In order to troubleshoot spice connection issues, add ini debug option
This commit is contained in:
jpattWPC 2022-03-10 16:58:24 -06:00
parent d3df0c4df6
commit fc60d99a65
4 changed files with 23 additions and 3 deletions

2
dist/vdiclient.json vendored
View File

@ -1,6 +1,6 @@
{
"upgrade_guid" : "46cbad92-353e-4b28-9bee-83950991dad8",
"version" : "1.0.0",
"version" : "1.0.1",
"product_name" : "VDI Client",
"manufacturer" : "Josh Patten",
"name" : "VDI Client",

View File

@ -1,4 +1,5 @@
@echo off
pip install pyinstaller
pip install proxmoxer
pip install PySimpleGUIQt
pip install PySimpleGUIQt
pip install requests

View File

@ -9,6 +9,8 @@ icon = vdiicon.ico
logo = vdiclient.png
# Enable Kiosk mode, which does not allow the user to close anything
kiosk = False
# Enable displaying SPICE ini file before opening virt-viewer
inidebug = False
[Authentication]
# This is the authentication backend that will be used to authenticate

View File

@ -27,6 +27,7 @@ class G:
kiosk = False
verify_ssl = True
icon = None
inidebug = False
theme = 'LightBlue'
sg.theme(G.theme)
@ -78,6 +79,8 @@ def loadconfig(config_location = None):
G.imagefile = config['General']['logo']
if 'kiosk' in config['General']:
G.kiosk = config['General'].getboolean('kiosk')
if 'inidebug' in config['General']:
G.inidebug = config['General'].getboolean('inidebug')
if not 'Authentication' in config:
win_popup_button(f'Unable to read supplied configuration:\nNo `Authentication` section defined!', 'OK')
return False
@ -170,6 +173,18 @@ def setvmlayout(vms):
layout.append([sg.Button('Logout', font=["Helvetica", 14])])
return layout
def iniwin(inistring):
inilayout = [
[sg.Multiline(default_text=inistring, size=(800, 600))]
]
iniwindow = sg.Window('INI debug', inilayout)
while True:
event, values = iniwindow.read()
if event == None:
break
iniwindow.close()
return True
def vmaction(vmnode, vmid, vmtype):
status = False
if vmtype == 'qemu':
@ -206,7 +221,6 @@ def vmaction(vmnode, vmid, vmtype):
if startpop:
startpop.close()
return status
connpop = win_popup(f'Connecting to {vmstatus["name"]}...')
if vmtype == 'qemu':
spiceconfig = G.proxmox.nodes(vmnode).qemu(str(vmid)).spiceproxy.post()
else: # Not sure this is even a thing, but here it is...
@ -226,6 +240,9 @@ def vmaction(vmnode, vmid, vmtype):
confignode.write(inifile)
inifile.seek(0)
inistring = inifile.read()
if G.inidebug:
closed = iniwin(inistring)
connpop = win_popup(f'Connecting to {vmstatus["name"]}...')
pcmd = [G.vvcmd]
if G.kiosk:
pcmd.append('--kiosk')