add webserver

This commit is contained in:
2025-01-15 23:38:39 +01:00
parent 7224111a0b
commit f9c4d3e2db
8 changed files with 3957 additions and 0 deletions

30
chatbug/ui/ui.py Normal file
View File

@@ -0,0 +1,30 @@
import webview
from threading import Thread
def start_ui(threaded=False):
if threaded:
_start_threaded()
else:
_start_normal()
def _start_threaded():
t = Thread(target=start_ui, args=[False])
t.run()
def _start_normal():
webview.create_window('Geargenerator', 'http://localhost:8080', min_size=(1200, 900), zoomable=True)
webview.start()
def _start_sandboxed():
webview.create_window('Geargenerator', 'web_v2/geargenerator.html', min_size=(1200, 900), zoomable=True)
webview.start(ssl=True)
if __name__ == "__main__":
_start_sandboxed()
# start_ui(threaded=False)