Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b382d69126 | ||
|
|
715dfef72d | ||
|
|
fbe00ec782 | ||
|
|
7bc5966cd6 | ||
|
|
9942361877 | ||
|
|
7148fc85ed | ||
|
|
c2221da4c2 | ||
|
|
de4088773b |
@@ -24,7 +24,9 @@ you will need to download the latest 3.10 python release, and run the following
|
||||
|
||||
Run the following commands on a Debian/Ubuntu Linux system to install the appropriate prerequisites
|
||||
|
||||
apt install python3-pip virt-viewer
|
||||
apt install python3-pip python3-tk virt-viewer git
|
||||
git clone https://github.com/joshpatten/PVE-VDIClient.git
|
||||
cd ./PVE-VDIClient/
|
||||
chmod +x requirements.sh
|
||||
./requirements.sh
|
||||
cp vdiclient.py /usr/local/bin
|
||||
|
||||
2
dist/vdiclient.json
vendored
2
dist/vdiclient.json
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"upgrade_guid" : "46cbad92-353e-4b28-9bee-83950991dad8",
|
||||
"version" : "1.1.01",
|
||||
"version" : "1.1.03",
|
||||
"product_name" : "VDI Client",
|
||||
"manufacturer" : "Josh Patten",
|
||||
"name" : "VDI Client",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[General]
|
||||
# This is the title that is diplayed to the user
|
||||
title = VDI Login
|
||||
# This is the PySimpleGui Theme that is used. Run pvevdi.py with flag `--list_themes` for a list of themes
|
||||
# This is the PySimpleGui Theme that is used. Run vdiclient.py with flag `--list_themes` for a list of themes
|
||||
theme = LightBlue
|
||||
# Program Icon
|
||||
icon = vdiicon.ico
|
||||
|
||||
23
vdiclient.py
23
vdiclient.py
@@ -164,15 +164,22 @@ def setmainlayout():
|
||||
if G.totp:
|
||||
layout.append([sg.Text("OTP Key", size =(12*G.scaling, 1), font=["Helvetica", 12]), sg.InputText(key='-totp-', font=["Helvetica", 12])])
|
||||
if G.kiosk:
|
||||
layout.append([sg.Button("Log In", font=["Helvetica", 14])])
|
||||
layout.append([sg.Button("Log In", font=["Helvetica", 14], bind_return_key=True)])
|
||||
else:
|
||||
layout.append([sg.Button("Log In", font=["Helvetica", 14]), sg.Button("Cancel", font=["Helvetica", 14])])
|
||||
layout.append([sg.Button("Log In", font=["Helvetica", 14], bind_return_key=True), sg.Button("Cancel", font=["Helvetica", 14])])
|
||||
return layout
|
||||
|
||||
def getvms(listonly = False):
|
||||
vms = []
|
||||
try:
|
||||
nodes = []
|
||||
for node in G.proxmox.cluster.resources.get(type='node'):
|
||||
if node['status'] == 'online':
|
||||
nodes.append(node['node'])
|
||||
|
||||
for vm in G.proxmox.cluster.resources.get(type='vm'):
|
||||
if vm['node'] not in nodes:
|
||||
continue
|
||||
if 'template' in vm and vm['template']:
|
||||
continue
|
||||
if G.guest_type == 'both' or G.guest_type == vm['type']:
|
||||
@@ -264,10 +271,14 @@ def vmaction(vmnode, vmid, vmtype):
|
||||
if startpop:
|
||||
startpop.close()
|
||||
return status
|
||||
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...
|
||||
spiceconfig = G.proxmox.nodes(vmnode).lxc(str(vmid)).spiceproxy.post()
|
||||
try:
|
||||
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...
|
||||
spiceconfig = G.proxmox.nodes(vmnode).lxc(str(vmid)).spiceproxy.post()
|
||||
except proxmoxer.core.ResourceException as e:
|
||||
win_popup_button(f"Unable to connect to VM {vmid}:\n{e!r}\nIs SPICE display configured for your VM?", 'OK')
|
||||
return False
|
||||
confignode = ConfigParser()
|
||||
confignode['virt-viewer'] = {}
|
||||
for key, value in spiceconfig.items():
|
||||
|
||||
Reference in New Issue
Block a user