diff --git a/server.py b/server.py index 47daa50..622e7f6 100644 --- a/server.py +++ b/server.py @@ -481,6 +481,16 @@ def page_net_list(): return render_template("net/list.htm", css=css, reti=reti, type="net", user=session["username"]) +@app.route('/net_details/') +def page_details_net(nid): + if 'username' not in session: + return redirect(url_for('page_login')) + dispositivi=Dispositivo.query.join(Network).filter_by(nid=nid).all() + rete = Network.query.filter_by(nid=nid).first() + css = url_for("static", filename="style.css") + return render_template("net/details.htm", css=css, net=rete, dispositivi=dispositivi, type="net", user=session["username"]) + + if __name__ == "__main__": #db.create_all() #p = b"admin" diff --git a/templates/dispositivo/details.htm b/templates/dispositivo/details.htm index a852920..5880fdb 100644 --- a/templates/dispositivo/details.htm +++ b/templates/dispositivo/details.htm @@ -76,7 +76,7 @@ Network
- {{ disp.rete.nome }} - {{ disp.rete.ip }} + {{ disp.rete.nome }} - {{ disp.rete.ip }}
diff --git a/templates/net/details.htm b/templates/net/details.htm index cfe40e2..2a68244 100644 --- a/templates/net/details.htm +++ b/templates/net/details.htm @@ -10,7 +10,7 @@ Nome Rete
- {{ imp.nomeimpiegato }} + {{ net.nome }}
  • @@ -18,7 +18,7 @@ IP
    - {{ imp.username }} + {{ net.ip }}
  • @@ -26,7 +26,9 @@ Dispositivi
    - + {% for dispositivo in dispositivi %} + Seriale: {{ dispositivo.seriale }} - ID Ente: {{ dispositivo.inv_ente }} + {% endfor %}
  • diff --git a/templates/net/list.htm b/templates/net/list.htm index 694f6b9..c90f65a 100644 --- a/templates/net/list.htm +++ b/templates/net/list.htm @@ -16,7 +16,7 @@ {% for rete in reti %} {{ rete.nome }} {{ rete.ip }} - + {% endfor %}