Aggiunta web ui base

This commit is contained in:
2026-02-26 13:28:35 +01:00
parent ae74d84983
commit 11e4e393e8

17
app.py
View File

@@ -48,4 +48,21 @@ def delete_compito(id):
return jsonify(ciscomerda), 200 return jsonify(ciscomerda), 200
return jsonify([]), 404 return jsonify([]), 404
@app.route("/ui")
def web_ui():
# Tabella compiti
html = "<table border>"
for ciscomerda in compiti:
html += "<tr>"
html += f"<td>{ciscomerda["descrizione"]}</td>"
html += "</tr>"
html += "</table>"
html += "<form action=\"/form_add\">"
html += "<input type=\"text\" name=\"descrizione\" placeholder=\"Descrizione compito\">"
html += "<input type=\"submit\" value=\"Aggiungi compito\">"
html += "</form>"
return html, 200
app.run("0.0.0.0") app.run("0.0.0.0")