2026-04-13 19:38:34 +02:00
|
|
|
from flask import Flask, render_template, request, redirect, url_for
|
2026-04-13 19:44:29 +02:00
|
|
|
from drives import list_scored_devices
|
2026-04-13 19:38:34 +02:00
|
|
|
|
|
|
|
|
app = Flask(__name__)
|
|
|
|
|
|
|
|
|
|
settings = {
|
|
|
|
|
# Step 1
|
|
|
|
|
"hostname": "furtka",
|
|
|
|
|
"username": "",
|
|
|
|
|
"password": "",
|
|
|
|
|
"password2": "",
|
|
|
|
|
"backend": False,
|
|
|
|
|
"backend_adress": "127.0.0.1",
|
2026-04-13 19:44:29 +02:00
|
|
|
"language": "en",
|
2026-04-13 19:38:34 +02:00
|
|
|
# devices
|
2026-04-13 19:44:29 +02:00
|
|
|
"boot_drive_uuid": "",
|
2026-04-13 19:38:34 +02:00
|
|
|
}
|
|
|
|
|
|
2026-04-13 19:44:29 +02:00
|
|
|
|
2026-04-13 19:38:34 +02:00
|
|
|
@app.route("/")
|
|
|
|
|
def home():
|
|
|
|
|
return "Hello World"
|
|
|
|
|
|
2026-04-13 19:44:29 +02:00
|
|
|
|
2026-04-13 19:38:34 +02:00
|
|
|
@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"))
|
2026-04-13 19:44:29 +02:00
|
|
|
return render_template("install/step2.html", drives=list_scored_devices())
|
2026-04-13 19:38:34 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
@app.route("/install/overview")
|
|
|
|
|
def install_overview():
|
|
|
|
|
return render_template("install/overview.html", settings=settings)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
|
app.run(debug=True, port=5000)
|