5 Commits

Author SHA1 Message Date
joshpatten
7bc5966cd6 Merge pull request #47 from bekema/main
Prevent exceptions when a node is offline
2023-02-15 08:50:14 -06:00
Hessel Bekema
9942361877 only list vms for nodes that are online; prevents KeyError crashes 2023-02-15 23:12:51 +11:00
Hessel Bekema
7148fc85ed bind enter to the log in button 2023-02-15 23:10:09 +11:00
jpattWPC
c2221da4c2 Fix typo 2023-02-03 15:57:12 -06:00
jpattWPC
de4088773b Update install instructions 2023-02-03 15:54:49 -06:00
3 changed files with 13 additions and 4 deletions

View File

@@ -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 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 virt-viewer git
git clone https://github.com/joshpatten/PVE-VDIClient.git
cd ./PVE-VDIClient/
chmod +x requirements.sh chmod +x requirements.sh
./requirements.sh ./requirements.sh
cp vdiclient.py /usr/local/bin cp vdiclient.py /usr/local/bin

View File

@@ -1,7 +1,7 @@
[General] [General]
# This is the title that is diplayed to the user # This is the title that is diplayed to the user
title = VDI Login 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 theme = LightBlue
# Program Icon # Program Icon
icon = vdiicon.ico icon = vdiicon.ico

View File

@@ -164,15 +164,22 @@ def setmainlayout():
if G.totp: if G.totp:
layout.append([sg.Text("OTP Key", size =(12*G.scaling, 1), font=["Helvetica", 12]), sg.InputText(key='-totp-', font=["Helvetica", 12])]) layout.append([sg.Text("OTP Key", size =(12*G.scaling, 1), font=["Helvetica", 12]), sg.InputText(key='-totp-', font=["Helvetica", 12])])
if G.kiosk: 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: 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 return layout
def getvms(listonly = False): def getvms(listonly = False):
vms = [] vms = []
try: 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'): for vm in G.proxmox.cluster.resources.get(type='vm'):
if vm['node'] not in nodes:
continue
if 'template' in vm and vm['template']: if 'template' in vm and vm['template']:
continue continue
if G.guest_type == 'both' or G.guest_type == vm['type']: if G.guest_type == 'both' or G.guest_type == vm['type']: