diff --git a/src/applets/disks/__init__.py b/src/applets/disks/__init__.py new file mode 100644 index 0000000..060d3aa --- /dev/null +++ b/src/applets/disks/__init__.py @@ -0,0 +1,7 @@ +from flask import Blueprint + +bp = Blueprint('disks', __name__, + template_folder='') + +from applets.disks import routes + diff --git a/src/applets/disks/disks.html b/src/applets/disks/disks.html new file mode 100644 index 0000000..0f8f601 --- /dev/null +++ b/src/applets/disks/disks.html @@ -0,0 +1,108 @@ +{% extends "layout.html" %} +{% block body %} + +

Disks and Partitions

+ +
+ +
+ +
+ +
+ +

How would you like to install Debian?

+ +
+ +
+ + + +
+ +
+ +

Proposed layout:

+
+ +
+

Physical disk: TOSHIBA HDWD120 (2000 GB)Healthy

+
+
+
+

/dev/sda1

+

/boot/efi + 200 MB + vfat +

+
+
+ + +
+
+ +

+ +
+

Physical disk: TOSHIBA HDWD120 (2000 GB)Healthy

+
+
+
+

/dev/sda1

+

/boot/efi + 200 MB + vfat +

+
+
+ + +
+
+ +

+ +
+
+
+
+ + + + + +

+ + + + +{% endblock %} diff --git a/src/templates/disks_partition.html b/src/applets/disks/disks_partition.html similarity index 76% rename from src/templates/disks_partition.html rename to src/applets/disks/disks_partition.html index 7bfe09a..77f9683 100644 --- a/src/templates/disks_partition.html +++ b/src/applets/disks/disks_partition.html @@ -10,11 +10,13 @@

Select usage:

@@ -73,10 +78,10 @@
- +
-
+
diff --git a/src/applets/disks/routes.py b/src/applets/disks/routes.py new file mode 100644 index 0000000..29288c2 --- /dev/null +++ b/src/applets/disks/routes.py @@ -0,0 +1,21 @@ +from applets.disks import bp +from flask import Flask, request, session, redirect, \ + url_for, render_template, flash, Blueprint +import dmm.lsblk as lsblk + +@bp.route('/disks/') +def disks(): + """ + Disks screen for the webui. + """ + return render_template('disks.html') + + +@bp.route('/disks/partition/') +def disks_partition(part): + """ + Partition modal for the webui partition screen. + """ + return render_template('disks_partition.html') + + diff --git a/src/applets/main/__init__.py b/src/applets/main/__init__.py index 90d17c0..febc0ae 100644 --- a/src/applets/main/__init__.py +++ b/src/applets/main/__init__.py @@ -1,6 +1,7 @@ from flask import Blueprint -bp = Blueprint('main', __name__) +bp = Blueprint('main', __name__, + template_folder='') from applets.main import routes diff --git a/src/applets/main/__pycache__/__init__.cpython-311.pyc b/src/applets/main/__pycache__/__init__.cpython-311.pyc deleted file mode 100644 index ed1a5d5..0000000 Binary files a/src/applets/main/__pycache__/__init__.cpython-311.pyc and /dev/null differ diff --git a/src/applets/main/__pycache__/routes.cpython-311.pyc b/src/applets/main/__pycache__/routes.cpython-311.pyc deleted file mode 100644 index 8fa8c20..0000000 Binary files a/src/applets/main/__pycache__/routes.cpython-311.pyc and /dev/null differ diff --git a/src/applets/software/__init__.py b/src/applets/software/__init__.py new file mode 100644 index 0000000..d09ae64 --- /dev/null +++ b/src/applets/software/__init__.py @@ -0,0 +1,7 @@ +from flask import Blueprint + +bp = Blueprint('software', __name__, + template_folder='') + +from applets.software import routes + diff --git a/src/applets/software/routes.py b/src/applets/software/routes.py new file mode 100644 index 0000000..61cfef9 --- /dev/null +++ b/src/applets/software/routes.py @@ -0,0 +1,11 @@ +from applets.software import bp +from flask import Flask, request, session, redirect, \ + url_for, render_template, flash, Blueprint + + +@bp.route('/software') +def webui_software(): + """ + Software screen for the webui. + """ + return render_template('software.html') diff --git a/src/applets/software/software.html b/src/applets/software/software.html new file mode 100644 index 0000000..980d834 --- /dev/null +++ b/src/applets/software/software.html @@ -0,0 +1,39 @@ +{% extends "layout.html" %} +{% block body %} + +

Select Software

+ +
+ + +
+ +
+ +
+ +

Would you like fries with that?

+ +
+ + +

+ +
+
+
+
+ + + + +{% endblock %} diff --git a/src/applets/summary/__init__.py b/src/applets/summary/__init__.py new file mode 100644 index 0000000..29a4944 --- /dev/null +++ b/src/applets/summary/__init__.py @@ -0,0 +1,7 @@ +from flask import Blueprint + +bp = Blueprint('summary', __name__, + template_folder='') + +from applets.summary import routes + diff --git a/src/applets/summary/routes.py b/src/applets/summary/routes.py new file mode 100644 index 0000000..1c2a0a4 --- /dev/null +++ b/src/applets/summary/routes.py @@ -0,0 +1,13 @@ +from applets.summary import bp +from flask import Flask, request, session, redirect, \ + url_for, render_template, flash, Blueprint + +@bp.route('/summary',methods=['GET', 'POST', 'PUT']) +def summary_index(): + """ + The page you'd get if you access the root of + this app in a browser. + """ + return render_template('summary.html') + + diff --git a/src/templates/summary.html b/src/applets/summary/summary.html similarity index 87% rename from src/templates/summary.html rename to src/applets/summary/summary.html index 3ab4c02..ead12cf 100644 --- a/src/templates/summary.html +++ b/src/applets/summary/summary.html @@ -10,8 +10,7 @@
- -
+

Summary

diff --git a/src/applets/users/__init__.py b/src/applets/users/__init__.py new file mode 100644 index 0000000..a655a07 --- /dev/null +++ b/src/applets/users/__init__.py @@ -0,0 +1,7 @@ +from flask import Blueprint + +bp = Blueprint('users', __name__, + template_folder='') + +from applets.users import routes + diff --git a/src/applets/users/routes.py b/src/applets/users/routes.py new file mode 100644 index 0000000..1126a58 --- /dev/null +++ b/src/applets/users/routes.py @@ -0,0 +1,11 @@ +from applets.software import bp +from flask import Flask, request, session, redirect, \ + url_for, render_template, flash, Blueprint + + +@bp.route('/users') +def users_root(): + """ + Users screen for the webui. + """ + return render_template('users.html') diff --git a/src/templates/users.html b/src/applets/users/users.html similarity index 74% rename from src/templates/users.html rename to src/applets/users/users.html index e2c155d..312b47d 100644 --- a/src/templates/users.html +++ b/src/applets/users/users.html @@ -10,8 +10,7 @@
- -
+

Configure User

@@ -36,14 +35,14 @@
- +
- +
@@ -56,6 +55,20 @@

This username is available

+
+ +
+ +
+
+ +
+ +
+ +
+
+

diff --git a/src/applets/webui/NOTES.highvoltage b/src/applets/webui/NOTES.highvoltage deleted file mode 100644 index e69de29..0000000 diff --git a/src/applets/welcome/__init__.py b/src/applets/welcome/__init__.py index e8226a2..d53f319 100644 --- a/src/applets/welcome/__init__.py +++ b/src/applets/welcome/__init__.py @@ -1,6 +1,7 @@ from flask import Blueprint -bp = Blueprint('welcome', __name__) +bp = Blueprint('welcome', __name__, + template_folder='') from applets.welcome import routes diff --git a/src/applets/welcome/routes.py b/src/applets/welcome/routes.py index 01587ca..5b96902 100644 --- a/src/applets/welcome/routes.py +++ b/src/applets/welcome/routes.py @@ -21,11 +21,3 @@ def welcome2_index(): return ("Changins some text in our htmx front-end") - -@bp.route('/api/') -def api_home(): - """ - Wel - """ - return ("Welcome to the welcome API") - diff --git a/src/applets/welcome/static/welcome.css b/src/applets/welcome/static/welcome.css deleted file mode 100644 index e901b4d..0000000 --- a/src/applets/welcome/static/welcome.css +++ /dev/null @@ -1 +0,0 @@ -test: diff --git a/src/templates/welcome.html b/src/applets/welcome/welcome.html similarity index 80% rename from src/templates/welcome.html rename to src/applets/welcome/welcome.html index 0f781c8..5c6c0ad 100644 --- a/src/templates/welcome.html +++ b/src/applets/welcome/welcome.html @@ -11,7 +11,7 @@
-
+

Welcome to System Installer

@@ -35,6 +35,10 @@
+
+ +
+ +
+
+ +

+
+ +
+ +






diff --git a/src/static/icons/keyboard.svg b/src/static/icons/keyboard.svg new file mode 100644 index 0000000..8b9da70 --- /dev/null +++ b/src/static/icons/keyboard.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/system-installer-daemon.py b/src/system-installer-daemon.py index 2d0eda5..dd50f3e 100755 --- a/src/system-installer-daemon.py +++ b/src/system-installer-daemon.py @@ -10,12 +10,13 @@ from flask import Flask, request, session, redirect, \ from waitress import serve import logging import dmm.lsblk as lsblk +import importlib # configuration VERSION = "0.00" SECRET_KEY = "exampls" DEV_MODE = 1 -APPS = "main welcome" +APPS = "main welcome users disks software summary" if DEV_MODE == 1: print("Note: Starting in devmode!") @@ -29,13 +30,16 @@ app.config.from_object(__name__) # Register blueprints here for APP in APPS.split(" "): - print("Loading applet: %s " % APP) -from applets.main import bp as main_bp -app.register_blueprint(main_bp) -from applets.welcome import bp as welcome_bp -app.register_blueprint(welcome_bp) -from applets.webui import bp as webui_bp -app.register_blueprint(webui_bp) + print(f"Loading applet: {APP} ") + + # Dynamically import the blueprint module + module = importlib.import_module(f"applets.{APP}") + + # Get the blueprint (bp) from the imported module + bp = getattr(module, "bp") + + # Register the blueprint with the app + app.register_blueprint(bp) # configure logs diff --git a/src/templates/disks.html b/src/templates/disks.html deleted file mode 100644 index 92c5c53..0000000 --- a/src/templates/disks.html +++ /dev/null @@ -1,184 +0,0 @@ - - - - - - - - - - - -
- - -
-
- -

Disks and Partitions

- -
- - - - -
- -

How would you like to install Debian?

- -
- -
- - - -
- -
- -

Proposed layout:

-
-
- - -

Physical disk: TOSHIBA HDWD120 (20 GB) - Healthy -

- -
-
-
-

/dev/sda1

-

/boot/efi - 200 MB - vfat -

-
-
- - - -
-
- - - - - -


- -
-
-
-
- -
-
- - - - diff --git a/src/templates/layout.html b/src/templates/layout.html new file mode 100644 index 0000000..62173bb --- /dev/null +++ b/src/templates/layout.html @@ -0,0 +1,21 @@ + + + + + + + + + + + +
+ +
+
+ +{% block body %} +{% endblock %} + + + diff --git a/src/templates/software.html b/src/templates/software.html deleted file mode 100644 index cd4166a..0000000 --- a/src/templates/software.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - -
- - -
-
- -

Select Software

- -
- - - - -
- -

Would you like fries with that?

- -
- -
    -
  • Desktop environment
  • -
  • Server software
  • -
-

- -
-
-
-
- -
-
- - -