Files
system-installer-daemon/src/applets/webui/routes.py
2024-06-21 18:58:20 +02:00

34 lines
962 B
Python

from applets.webui import bp
@bp.route('/webui')
def webui_index():
"""
The page you'd get if you access the root of
this app in a browser.
"""
return ("""
<head>
<script src="https://unpkg.com/htmx.org@1.9.11" integrity="sha384-0gxUXCCR8yv9FM2b+U3FDbsKthCI66oH5IA9fHppQq9DDMHuMauqq1ZHBpJxQ0J0" crossorigin="anonymous"></script>
</head>
<button hx-post="/clicked"
hx-trigger="click"
hx-target="#parent-div"
hx-swap="outerHTML" >
Click Me!
</button>
<div style="background-color: black; color: white; height: 200px; width: 200px;" hx-get="/welcome" hx-trigger="every 2s"></div>
<div hx-post="/welcome" hx-trigger="mouseenter">
1
<br><br><br><br>
[Here Mouse, Mouse!]
<br><Br><br><br>
2
</div>
Welcome to System Installer Daemon POC <br />
This is the WebUI Index
""")