Add windows client mode updates

This commit is contained in:
Cole Deck
2024-05-14 21:51:36 -05:00
parent 927f61e124
commit 02ab16a566
5 changed files with 54 additions and 10 deletions

28
run.py
View File

@@ -937,13 +937,17 @@ def run_loading_app():
app.run(debug=True, use_reloader=False, port=7000)
def setup_client(pool):
# Windows client setup
fprint("Opening browser...")
firefox = webdriver.Firefox()
firefox.fullscreen_window()
global config
global vm_ready
global serverproc
if config["core"]["server"] == "Hyper-V":
run_cmd("Start-VM -Name Jukebox*") # any and all VMs starting with "Jukebox"
# Windows client setup
fprint("Opening browser...")
firefox = webdriver.Firefox()
firefox.fullscreen_window()
# Open loading wepage
p = Process(target=run_loading_app)
p.start()
@@ -952,12 +956,22 @@ def setup_client(pool):
firefox.get('http://localhost:7000')
# start Linux server VM
if config["core"]["server"] == "Hyper-V":
run_cmd("Start-VM -Name Jukebox*") # any and all VMs starting with "Jukebox"
sleep(20)
sleep(35)
p.terminate()
firefox.get('http://192.168.1.25:3000')
# import time
# while True:
# time.sleep(2) # Wait for a given interval
# logs = firefox.get_log('browser')
# for entry in logs:
# if "WebSocket connection" in entry['message'] or "ERR_" in entry['message'] or "Failed to connect" in entry['message'] or "failed to connect" in entry['message']:
# print(f"Error detected in console: {entry['message']}")
# firefox.refresh() # Refresh the page on error
# # else:
# # break # Exit the loop or continue depending on your logic
return True