Aggiunta web ui base
This commit is contained in:
17
app.py
17
app.py
@@ -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")
|
||||||
|
|||||||
Reference in New Issue
Block a user