Some more initial changes
This commit is contained in:
14
README.md
14
README.md
@@ -1,6 +1,20 @@
|
|||||||
Dependencies
|
Dependencies
|
||||||
- flask
|
- flask
|
||||||
|
- flask-babel
|
||||||
- pytest
|
- pytest
|
||||||
- coverage
|
- coverage
|
||||||
- libjs-htmx
|
- libjs-htmx
|
||||||
- libjs-material-design-lite
|
- libjs-material-design-lite
|
||||||
|
- xapp-gtk3-module
|
||||||
|
|
||||||
|
|
||||||
|
## Development
|
||||||
|
|
||||||
|
### Translations
|
||||||
|
|
||||||
|
Upstream PyBabel documentation:
|
||||||
|
https://python-babel.github.io/flask-babel/index.html#translating-applications
|
||||||
|
|
||||||
|
in the ./daemon directory, run the following to regenerate the translations file:
|
||||||
|
|
||||||
|
```pybabel extract -F babel.cfg -o messages.pot .```
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,22 +1,15 @@
|
|||||||
{% extends "layout.html" %}
|
{% extends "layout.html" %}
|
||||||
{% block body %}
|
{% block body %}
|
||||||
|
|
||||||
<div style="width: 1000px; font-family: Noto Sans;">
|
|
||||||
|
|
||||||
<p> <b> Would you like fries with that? </b></p>
|
<p> <b> Would you like fries with that? </b></p>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
|
<li>Would you like to participate in popcon?</li>
|
||||||
<li>Desktop environment</li>
|
<li>Desktop environment</li>
|
||||||
<li>Server software</li>
|
<li>Server software</li>
|
||||||
</ul>
|
</ul>
|
||||||
<br><br>
|
|
||||||
|
|
||||||
<div class="columns">
|
|
||||||
<div class="column"><button class="button is-light">Back</button></div>
|
|
||||||
<a href="./summary"><div class="column"><button class="button is-link">Next</button></div></a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -1,19 +1,8 @@
|
|||||||
{% extends "layout.html" %}
|
{% extends "layout.html" %}
|
||||||
{% block body %}
|
{% block body %}
|
||||||
|
|
||||||
<div style="width: 1000px; height: 100%;">
|
|
||||||
|
|
||||||
<p><b> Ready to install! Please review all changes.</b></p>
|
<p><b> Ready to install! Please review all changes.</b></p>
|
||||||
|
|
||||||
<br>
|
|
||||||
|
|
||||||
<br><br>
|
|
||||||
|
|
||||||
<div class="columns">
|
|
||||||
<div class="column"><button class="button is-light">Back</button></div>
|
|
||||||
<a href="./install"><div class="column"><button class="button is-link">Start Install</button></div></a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -1,8 +1,6 @@
|
|||||||
{% extends "layout.html" %}
|
{% extends "layout.html" %}
|
||||||
{% block body %}
|
{% block body %}
|
||||||
|
|
||||||
<div style="width: 1000px; font-family: Noto Sans;">
|
|
||||||
|
|
||||||
<p><b> Let's set up an initial user. </b></p>
|
<p><b> Let's set up an initial user. </b></p>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
@@ -46,16 +44,7 @@
|
|||||||
|
|
||||||
</div> <!-- style 180 -->
|
</div> <!-- style 180 -->
|
||||||
|
|
||||||
<br><br>
|
|
||||||
|
|
||||||
<div class="columns">
|
|
||||||
<div class="column"><button class="button is-light">Back</button> <button class="button is-light">Connect Active Directory</button> <button class="button is-light">Connect LDAP</button></div>
|
|
||||||
<a href="./disks"><div class="column"><button class="button is-link">Next</button></div></a>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -1,8 +1,12 @@
|
|||||||
from applets.welcome import bp
|
from applets.welcome import bp
|
||||||
from flask import Flask, request, session, redirect, \
|
from flask import Flask, request, session, redirect, \
|
||||||
url_for, render_template, flash, Blueprint
|
url_for, render_template, flash, Blueprint
|
||||||
|
import gettext
|
||||||
import dmm.lsblk as lsblk
|
import dmm.lsblk as lsblk
|
||||||
|
|
||||||
|
# Set up Gettext
|
||||||
|
en_i18n = gettext.translation("welcome", './locales', fallback=True, languages=['af', 'en'])
|
||||||
|
en_i18n.install()
|
||||||
|
|
||||||
@bp.route('/welcome',methods=['GET', 'POST', 'PUT'])
|
@bp.route('/welcome',methods=['GET', 'POST', 'PUT'])
|
||||||
def welcome_index():
|
def welcome_index():
|
||||||
@@ -11,13 +15,19 @@ def welcome_index():
|
|||||||
this app in a browser.
|
this app in a browser.
|
||||||
"""
|
"""
|
||||||
blkid = lsblk.list_scsi_devices()
|
blkid = lsblk.list_scsi_devices()
|
||||||
return render_template('welcome.html', blkid=blkid)
|
string_dict = build_stringlist()
|
||||||
#return ("Welcome to System Installer Daemon POC <br />"
|
return render_template('welcome.html', string_dict=string_dict)
|
||||||
# "This is the Welcome Index")
|
|
||||||
|
|
||||||
|
|
||||||
@bp.route('/welcome2')
|
def build_stringlist():
|
||||||
def welcome2_index():
|
"""
|
||||||
return ("Changins some text in our htmx front-end")
|
Return all the strings that is used in this applet."
|
||||||
|
"""
|
||||||
|
string_dict = {}
|
||||||
|
string_dict['welcome_text'] = _("Welcome! This setup program will install Debian on to your system.")
|
||||||
|
string_dict['confirm_text'] = _("Please confirm the following details:")
|
||||||
|
string_dict['language_text'] = _("Language:")
|
||||||
|
string_dict['keylayout_text'] = _("Keyboard Layout:")
|
||||||
|
string_dict['timezone_text'] = _("Time Zone:")
|
||||||
|
return string_dict
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,11 @@
|
|||||||
{% extends "layout.html" %}
|
{% extends "layout.html" %}
|
||||||
{% block body %}
|
{% block body %}
|
||||||
|
|
||||||
<div style="width: 1000px; height: 100%; font-family: Noto Sans;">
|
<img style="top: 10px; width: 100%;" src="/static/applets/welcome/img/banner.png" alt="Debian Image banner" />
|
||||||
|
<p><b> {{ string_dict['welcome_text'] }} </b></p>
|
||||||
|
<p>{{ string_dict['confirm_text'] }} </p>
|
||||||
|
|
||||||
<p><b>Welcome! This setup program will install Debian on to your system.</b></p>
|
<img src="/static/icons/keyboard.svg" /> {{ string_dict['language_text'] }}
|
||||||
|
|
||||||
<br>
|
|
||||||
|
|
||||||
<div class="columns" style="text-align: center;">
|
|
||||||
|
|
||||||
<div class="column">
|
|
||||||
<img src="/static/icons/keyboard.svg" style="fill: white;" width="180px" />
|
|
||||||
<div class="control is-link" width="180px">
|
<div class="control is-link" width="180px">
|
||||||
<div class="select">
|
<div class="select">
|
||||||
<select style="width: 180px">
|
<select style="width: 180px">
|
||||||
@@ -19,12 +14,10 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div
|
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<div class="column">
|
<img src="/static/icons/keyboard.svg" /> {{ string_dict['keylayout_text'] }}
|
||||||
<img src="/static/icons/keyboard.svg" width="180px" />
|
|
||||||
<div class="control is-link">
|
<div class="control is-link">
|
||||||
<div class="select">
|
<div class="select">
|
||||||
<select style="width: 180px">
|
<select style="width: 180px">
|
||||||
@@ -33,12 +26,10 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<br>
|
<br />
|
||||||
|
|
||||||
<div class="column">
|
<img src="/static/icons/keyboard.svg" /> {{ string_dict['timezone_text'] }}
|
||||||
<img src="/static/icons/keyboard.svg" width="180px" />
|
|
||||||
<div class="control is-link">
|
<div class="control is-link">
|
||||||
<div class="select">
|
<div class="select">
|
||||||
<select style="width: 180px">
|
<select style="width: 180px">
|
||||||
@@ -47,16 +38,8 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
</div> <!-- end columns -->
|
|
||||||
|
|
||||||
<br><br><br><br><br><br<br><br>
|
|
||||||
|
|
||||||
<div class="columns">
|
|
||||||
<div class="column"><button class="button is-light">Quit</button></div>
|
|
||||||
<a href="./users"><div class="column"><button class="button is-link">Next</button></div></a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ import importlib
|
|||||||
|
|
||||||
# configuration
|
# configuration
|
||||||
VERSION = "0.00"
|
VERSION = "0.00"
|
||||||
|
BABEL_TRANSLATION_DIRECTORIES="translations"
|
||||||
|
BABEL_DOMAIN="translations"
|
||||||
SECRET_KEY = "exampls"
|
SECRET_KEY = "exampls"
|
||||||
DEV_MODE = True
|
DEV_MODE = True
|
||||||
APPS = "main welcome users disks software summary"
|
APPS = "main welcome users disks software summary"
|
||||||
@@ -25,6 +27,7 @@ if DEV_MODE:
|
|||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
app.config.from_object(__name__)
|
app.config.from_object(__name__)
|
||||||
|
|
||||||
|
|
||||||
# Register blueprints here
|
# Register blueprints here
|
||||||
for APP in APPS.split(" "):
|
for APP in APPS.split(" "):
|
||||||
print(f"Loading applet: {APP} ")
|
print(f"Loading applet: {APP} ")
|
||||||
@@ -48,3 +51,4 @@ if __name__ == '__main__':
|
|||||||
port=8080,
|
port=8080,
|
||||||
url_scheme='http',
|
url_scheme='http',
|
||||||
expose_tracebacks=DEV_MODE)
|
expose_tracebacks=DEV_MODE)
|
||||||
|
|
||||||
|
|||||||
@@ -1,50 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
"""
|
|
||||||
Welcome to SID - The System Installer Daemon!
|
|
||||||
"""
|
|
||||||
|
|
||||||
from flask import Flask, request, session, redirect, \
|
|
||||||
url_for, render_template, flash, Blueprint
|
|
||||||
from waitress import serve
|
|
||||||
import logging
|
|
||||||
import dmm.lsblk as lsblk
|
|
||||||
import importlib
|
|
||||||
|
|
||||||
# configuration
|
|
||||||
VERSION = "0.00"
|
|
||||||
SECRET_KEY = "exampls"
|
|
||||||
DEV_MODE = True
|
|
||||||
APPS = "main welcome users disks software summary"
|
|
||||||
|
|
||||||
if DEV_MODE:
|
|
||||||
print("Note: Starting in devmode!")
|
|
||||||
DEBUG = True
|
|
||||||
tracebacks = True
|
|
||||||
|
|
||||||
# create our application in flask
|
|
||||||
app = Flask(__name__)
|
|
||||||
app.config.from_object(__name__)
|
|
||||||
|
|
||||||
# Register blueprints here
|
|
||||||
for APP in APPS.split(" "):
|
|
||||||
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
|
|
||||||
# logging.basicConfig()
|
|
||||||
logger = logging.getLogger('waitress')
|
|
||||||
if DEV_MODE == "1":
|
|
||||||
logger.setLevel(logging.DEBUG)
|
|
||||||
logger.debug("logger set to DEBUG")
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
serve(app,
|
|
||||||
host='0.0.0.0',
|
|
||||||
port=8080,
|
|
||||||
url_scheme='http',
|
|
||||||
expose_tracebacks=DEV_MODE)
|
|
||||||
@@ -13,7 +13,7 @@ def on_closed():
|
|||||||
|
|
||||||
window = webview.create_window('System Installer', LOCATION,
|
window = webview.create_window('System Installer', LOCATION,
|
||||||
transparent=True, easy_drag=False, frameless=True,
|
transparent=True, easy_drag=False, frameless=True,
|
||||||
width=1030, focus=True, zoomable=True,
|
width=1050, focus=True, zoomable=True,
|
||||||
confirm_close=True)
|
confirm_close=True)
|
||||||
|
|
||||||
window.events.closed += on_closed
|
window.events.closed += on_closed
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<!-- Header -->
|
<!-- Header -->
|
||||||
<div id="titlebar" class="pywebview-drag-region">
|
<div id="titlebar" class="pywebview-drag-region" style="padding-bottom: 10px;">
|
||||||
<span>
|
<span>
|
||||||
<button class="button is-link"> ☰ </button>
|
<button class="button is-link"> ☰ </button>
|
||||||
<a href="/welcome"><button class="button is-{% if request.path == "/welcome" %}info{% else %}dark{% endif %}">Welcome</button></a>
|
<a href="/welcome"><button class="button is-{% if request.path == "/welcome" %}info{% else %}dark{% endif %}">Welcome</button></a>
|
||||||
@@ -11,5 +11,4 @@
|
|||||||
<a href="/help"> <button class="button is-light" style="float: right; margin-right: 5px;"> <b> ? </b> </button></a>
|
<a href="/help"> <button class="button is-light" style="float: right; margin-right: 5px;"> <b> ? </b> </button></a>
|
||||||
</span>
|
</span>
|
||||||
</div> <!-- end pywebview-drag-region -->
|
</div> <!-- end pywebview-drag-region -->
|
||||||
<br>
|
|
||||||
<!-- End Header -->
|
<!-- End Header -->
|
||||||
|
|||||||
@@ -4,16 +4,21 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<link href="/static/bulma.css" rel="stylesheet">
|
<link href="/static/bulma.css" rel="stylesheet">
|
||||||
<link href="/static/welcome.css" rel="stylesheet">
|
<link href="/static/system-installer.css" rel="stylesheet">
|
||||||
<script src="/static/htmx.min.js" crossorigin="anonymous"></script>
|
<script src="/static/htmx.min.js" crossorigin="anonymous"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body style="overflow: hidden; max-height: 450px;">
|
||||||
|
|
||||||
<div style="border-radius: 10px; padding: 13px;" class="notification is-dark">
|
<div style="width: 1050px; height: 600px; border-radius: 10px; padding: 13px; overflow: hidden;" class="notification is-dark">
|
||||||
|
|
||||||
{% include "header.html" %}
|
{% include "header.html" %}
|
||||||
|
|
||||||
|
<div style="height: 450px; overflow-y: scroll">
|
||||||
{% block body %}
|
{% block body %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% include "footer.html" %}
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user