diff --git a/ui/app.py b/ui/app.py index 5957813..045d5bf 100644 --- a/ui/app.py +++ b/ui/app.py @@ -1,11 +1,25 @@ -from flask import Flask, render_template -from cloudflare import get_dns_status +from flask import Flask, render_template_string +from cloudflare import get_dns_records app = Flask(__name__) +# ---------------------------- +# Template HTML giĆ  esistente +# ---------------------------- +TEMPLATE = open("template.html").read() # Se preferisci usare file separato + +# ---------------------------- +# Endpoint principale +# ---------------------------- @app.route("/") def index(): - return render_template("index.html", records=get_dns_status()) + records = get_dns_records() + + # Passiamo i dati al template + return render_template_string(TEMPLATE, records=records) +# ---------------------------- +# Avvio Flask +# ---------------------------- if __name__ == "__main__": - app.run(host="0.0.0.0", port=8080) + app.run(host="0.0.0.0", port=5000)