Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d7540248b | ||
|
|
cd83be7680 |
2
dist/vdiclient.json
vendored
2
dist/vdiclient.json
vendored
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"upgrade_guid" : "46cbad92-353e-4b28-9bee-83950991dad8",
|
"upgrade_guid" : "46cbad92-353e-4b28-9bee-83950991dad8",
|
||||||
"version" : "1.2.05",
|
"version" : "1.2.06",
|
||||||
"product_name" : "VDI Client",
|
"product_name" : "VDI Client",
|
||||||
"manufacturer" : "Josh Patten",
|
"manufacturer" : "Josh Patten",
|
||||||
"name" : "VDI Client",
|
"name" : "VDI Client",
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ logo = vdiclient.png
|
|||||||
kiosk = False
|
kiosk = False
|
||||||
# Enable/Disable Fullscreen mode (not applicable in Kiosk mode)
|
# Enable/Disable Fullscreen mode (not applicable in Kiosk mode)
|
||||||
fullscreen = True
|
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
|
# Enable displaying SPICE ini file before opening virt-viewer
|
||||||
inidebug = False
|
inidebug = False
|
||||||
# Select which guest types to display. Acceptable values: both, lxc, qemu
|
# 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
|
#token_value = xxx-x-x-x-xxx
|
||||||
# Password Reset Command Launch. Has to be full executable Command
|
# Password Reset Command Launch. Has to be full executable Command
|
||||||
#pwresetcmd = start chrome --app=http://pwreset.example.com
|
#pwresetcmd = start chrome --app=http://pwreset.example.com
|
||||||
|
# Automatically connect to a VMID upon authentication
|
||||||
|
#auto_vmid = 100
|
||||||
|
|
||||||
[Hosts]
|
[Hosts]
|
||||||
# Hosts are entered as `IP/FQDN = Port`
|
# Hosts are entered as `IP/FQDN = Port`
|
||||||
|
|||||||
15
vdiclient.py
15
vdiclient.py
@@ -30,6 +30,7 @@ class G:
|
|||||||
totp = False
|
totp = False
|
||||||
imagefile = None
|
imagefile = None
|
||||||
kiosk = False
|
kiosk = False
|
||||||
|
viewer_kiosk = True
|
||||||
fullscreen = True
|
fullscreen = True
|
||||||
verify_ssl = True
|
verify_ssl = True
|
||||||
icon = None
|
icon = None
|
||||||
@@ -42,6 +43,7 @@ class G:
|
|||||||
width = None
|
width = None
|
||||||
height = None
|
height = None
|
||||||
pwresetcmd = None
|
pwresetcmd = None
|
||||||
|
auto_vmid = None
|
||||||
|
|
||||||
def loadconfig(config_location = None):
|
def loadconfig(config_location = None):
|
||||||
if config_location:
|
if config_location:
|
||||||
@@ -95,6 +97,8 @@ def loadconfig(config_location = None):
|
|||||||
G.imagefile = config['General']['logo']
|
G.imagefile = config['General']['logo']
|
||||||
if 'kiosk' in config['General']:
|
if 'kiosk' in config['General']:
|
||||||
G.kiosk = config['General'].getboolean('kiosk')
|
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']:
|
if 'fullscreen' in config['General']:
|
||||||
G.fullscreen = config['General'].getboolean('fullscreen')
|
G.fullscreen = config['General'].getboolean('fullscreen')
|
||||||
if 'inidebug' in config['General']:
|
if 'inidebug' in config['General']:
|
||||||
@@ -125,6 +129,8 @@ def loadconfig(config_location = None):
|
|||||||
G.token_value = config['Authentication']['token_value']
|
G.token_value = config['Authentication']['token_value']
|
||||||
if 'pwresetcmd' in config['Authentication']:
|
if 'pwresetcmd' in config['Authentication']:
|
||||||
G.pwresetcmd = config['Authentication']['pwresetcmd']
|
G.pwresetcmd = config['Authentication']['pwresetcmd']
|
||||||
|
if 'auto_vmid' in config['Authentication']:
|
||||||
|
G.auto_vmid = config['Authentication'].getint('auto_vmid')
|
||||||
if not 'Hosts' in config:
|
if not 'Hosts' in config:
|
||||||
win_popup_button(f'Unable to read supplied configuration:\nNo `Hosts` section defined!', 'OK')
|
win_popup_button(f'Unable to read supplied configuration:\nNo `Hosts` section defined!', 'OK')
|
||||||
return False
|
return False
|
||||||
@@ -393,7 +399,7 @@ def vmaction(vmnode, vmid, vmtype, action='connect'):
|
|||||||
closed = iniwin(inistring)
|
closed = iniwin(inistring)
|
||||||
connpop = win_popup(f'Connecting to {vmstatus["name"]}...')
|
connpop = win_popup(f'Connecting to {vmstatus["name"]}...')
|
||||||
pcmd = [G.vvcmd]
|
pcmd = [G.vvcmd]
|
||||||
if G.kiosk:
|
if G.kiosk and G.viewer_kiosk:
|
||||||
pcmd.append('--kiosk')
|
pcmd.append('--kiosk')
|
||||||
pcmd.append('--kiosk-quit')
|
pcmd.append('--kiosk-quit')
|
||||||
pcmd.append('on-disconnect')
|
pcmd.append('on-disconnect')
|
||||||
@@ -617,6 +623,13 @@ def main():
|
|||||||
return 1
|
return 1
|
||||||
break
|
break
|
||||||
else:
|
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()
|
vmstat = showvms()
|
||||||
if not vmstat:
|
if not vmstat:
|
||||||
G.proxmox = None
|
G.proxmox = None
|
||||||
|
|||||||
Reference in New Issue
Block a user