2 Commits

Author SHA1 Message Date
jpattWPC
9d7540248b Add ability to disable remote-viewer kiosk mode 2023-10-13 16:04:19 -05:00
jpattWPC
cd83be7680 Add ability to auto-connect VMID 2023-10-13 14:22:08 -05:00
3 changed files with 19 additions and 2 deletions

2
dist/vdiclient.json vendored
View File

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

View File

@@ -11,6 +11,8 @@ logo = vdiclient.png
kiosk = False
# Enable/Disable Fullscreen mode (not applicable in Kiosk mode)
fullscreen = True
# Disable viewer_kiosk mode if kiosk is set to true, this allows overriding remote_viewer kiosk mode
#viewer_kiosk = False
# Enable displaying SPICE ini file before opening virt-viewer
inidebug = False
# Select which guest types to display. Acceptable values: both, lxc, qemu
@@ -36,6 +38,8 @@ tls_verify = false
#token_value = xxx-x-x-x-xxx
# Password Reset Command Launch. Has to be full executable Command
#pwresetcmd = start chrome --app=http://pwreset.example.com
# Automatically connect to a VMID upon authentication
#auto_vmid = 100
[Hosts]
# Hosts are entered as `IP/FQDN = Port`

View File

@@ -30,6 +30,7 @@ class G:
totp = False
imagefile = None
kiosk = False
viewer_kiosk = True
fullscreen = True
verify_ssl = True
icon = None
@@ -42,6 +43,7 @@ class G:
width = None
height = None
pwresetcmd = None
auto_vmid = None
def loadconfig(config_location = None):
if config_location:
@@ -95,6 +97,8 @@ def loadconfig(config_location = None):
G.imagefile = config['General']['logo']
if 'kiosk' in config['General']:
G.kiosk = config['General'].getboolean('kiosk')
if 'viewer_kiosk' in config['General']:
G.viewer_kiosk = config['General'].getboolean('viewer_kiosk')
if 'fullscreen' in config['General']:
G.fullscreen = config['General'].getboolean('fullscreen')
if 'inidebug' in config['General']:
@@ -125,6 +129,8 @@ def loadconfig(config_location = None):
G.token_value = config['Authentication']['token_value']
if 'pwresetcmd' in config['Authentication']:
G.pwresetcmd = config['Authentication']['pwresetcmd']
if 'auto_vmid' in config['Authentication']:
G.auto_vmid = config['Authentication'].getint('auto_vmid')
if not 'Hosts' in config:
win_popup_button(f'Unable to read supplied configuration:\nNo `Hosts` section defined!', 'OK')
return False
@@ -393,7 +399,7 @@ def vmaction(vmnode, vmid, vmtype, action='connect'):
closed = iniwin(inistring)
connpop = win_popup(f'Connecting to {vmstatus["name"]}...')
pcmd = [G.vvcmd]
if G.kiosk:
if G.kiosk and G.viewer_kiosk:
pcmd.append('--kiosk')
pcmd.append('--kiosk-quit')
pcmd.append('on-disconnect')
@@ -617,6 +623,13 @@ def main():
return 1
break
else:
if G.auto_vmid:
vms = getvms()
for row in vms:
if row['vmid'] == G.auto_vmid:
vmaction(row['node'], row['vmid'], row['type'], action='connect')
return 0
win_popup_button(f'No VDI instance with ID {G.auto_vmid} found!', 'OK')
vmstat = showvms()
if not vmstat:
G.proxmox = None