Add README and commit previous changes
This commit is contained in:
0
src/applets/webui/NOTES.highvoltage
Normal file
0
src/applets/webui/NOTES.highvoltage
Normal file
6
src/applets/webui/__init__.py
Normal file
6
src/applets/webui/__init__.py
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
from flask import Blueprint
|
||||||
|
|
||||||
|
bp = Blueprint('webui', __name__)
|
||||||
|
|
||||||
|
from applets.webui import routes
|
||||||
|
|
||||||
BIN
src/applets/webui/__pycache__/__init__.cpython-311.pyc
Normal file
BIN
src/applets/webui/__pycache__/__init__.cpython-311.pyc
Normal file
Binary file not shown.
BIN
src/applets/webui/__pycache__/routes.cpython-311.pyc
Normal file
BIN
src/applets/webui/__pycache__/routes.cpython-311.pyc
Normal file
Binary file not shown.
33
src/applets/webui/routes.py
Normal file
33
src/applets/webui/routes.py
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
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
|
||||||
|
""")
|
||||||
Binary file not shown.
@@ -1,7 +1,7 @@
|
|||||||
from applets.welcome import bp
|
from applets.welcome import bp
|
||||||
|
|
||||||
|
|
||||||
@bp.route('/welcome')
|
@bp.route('/welcome',methods=['GET', 'POST', 'PUT'])
|
||||||
def welcome_index():
|
def welcome_index():
|
||||||
"""
|
"""
|
||||||
The page you'd get if you access the root of
|
The page you'd get if you access the root of
|
||||||
@@ -11,6 +11,12 @@ def welcome_index():
|
|||||||
"This is the Welcome Index")
|
"This is the Welcome Index")
|
||||||
|
|
||||||
|
|
||||||
|
@bp.route('/welcome2')
|
||||||
|
def welcome2_index():
|
||||||
|
return ("Changins some text in our htmx front-end")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@bp.route('/api/')
|
@bp.route('/api/')
|
||||||
def api_home():
|
def api_home():
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ SECRET_KEY = "exampls"
|
|||||||
DEV_MODE = 1
|
DEV_MODE = 1
|
||||||
APPS = "main welcome"
|
APPS = "main welcome"
|
||||||
|
|
||||||
|
|
||||||
if DEV_MODE == 1:
|
if DEV_MODE == 1:
|
||||||
print("Note: Starting in devmode!")
|
print("Note: Starting in devmode!")
|
||||||
DEBUG = True
|
DEBUG = True
|
||||||
@@ -34,11 +33,8 @@ from applets.main import bp as main_bp
|
|||||||
app.register_blueprint(main_bp)
|
app.register_blueprint(main_bp)
|
||||||
from applets.welcome import bp as welcome_bp
|
from applets.welcome import bp as welcome_bp
|
||||||
app.register_blueprint(welcome_bp)
|
app.register_blueprint(welcome_bp)
|
||||||
|
from applets.webui import bp as webui_bp
|
||||||
|
app.register_blueprint(webui_bp)
|
||||||
@app.errorhandler(404)
|
|
||||||
def not_found(error):
|
|
||||||
return '404 Not Found', 404
|
|
||||||
|
|
||||||
|
|
||||||
# configure logs
|
# configure logs
|
||||||
|
|||||||
Reference in New Issue
Block a user