- Untrack archinstall/user_credentials.json; ship .example file and add a root .gitignore so real creds stay out of git - Fix SyntaxError in webinstaller/app.py (malformed "language" entry) - Drop import-time lshw call in hardware.py - Consolidate driveval/ and webinstaller/hardware.py into a single webinstaller/drives.py with a list_scored_devices() API; step 2 now renders a proper <select> with name/size/score - Replace dependancies.txt typo with webinstaller/requirements.txt (Flask only — psutil was imported but unused) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
47 lines
1.2 KiB
Python
47 lines
1.2 KiB
Python
from flask import Flask, render_template, request, redirect, url_for
|
|
from drives import list_scored_devices
|
|
|
|
app = Flask(__name__)
|
|
|
|
settings = {
|
|
# Step 1
|
|
"hostname": "furtka",
|
|
"username": "",
|
|
"password": "",
|
|
"password2": "",
|
|
"backend": False,
|
|
"backend_adress": "127.0.0.1",
|
|
"language": "en",
|
|
# devices
|
|
"boot_drive_uuid": "",
|
|
}
|
|
|
|
|
|
@app.route("/")
|
|
def home():
|
|
return "Hello World"
|
|
|
|
|
|
@app.route("/install/step1", methods=["GET", "POST"])
|
|
def install_step_1():
|
|
if request.method == "POST":
|
|
settings["hostname"] = request.form["hostname"]
|
|
return redirect(url_for("install_step_2"))
|
|
return render_template("install/step1.html")
|
|
|
|
|
|
@app.route("/install/step2", methods=["GET", "POST"])
|
|
def install_step_2():
|
|
if request.method == "POST":
|
|
settings["boot_drive_uuid"] = request.form["boot_drive_uuid"]
|
|
return redirect(url_for("install_overview"))
|
|
return render_template("install/step2.html", drives=list_scored_devices())
|
|
|
|
|
|
@app.route("/install/overview")
|
|
def install_overview():
|
|
return render_template("install/overview.html", settings=settings)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
app.run(debug=True, port=5000)
|