1
Fork 0
mirror of https://github.com/Steffo99/estus.git synced 2024-11-21 23:24:18 +00:00

Complete net and device interaction

This commit is contained in:
Lorenzo 2017-09-11 17:31:20 +02:00
parent 039bd85ea1
commit 6f92e8e37c
4 changed files with 17 additions and 5 deletions

View file

@ -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/<int:nid>')
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"

View file

@ -76,7 +76,7 @@
Network
</h4>
<div class="list-group-item-text">
<a href="/net_details/{{ disp.rete.nid }}>"<code>{{ disp.rete.nome }} - {{ disp.rete.ip }}</code></a>
<a href="/net_details/{{ disp.rete.nid }}"><code>{{ disp.rete.nome }} - {{ disp.rete.ip }}</code></a>
</div>
</li>
</ul>

View file

@ -10,7 +10,7 @@
Nome Rete
</h4>
<div class="list-group-item-text">
{{ imp.nomeimpiegato }}
{{ net.nome }}
</div>
</li>
<li class="list-group-item">
@ -18,7 +18,7 @@
IP
</h4>
<div class="list-group-item-text">
{{ imp.username }}
{{ net.ip }}
</div>
</li>
<li class="list-group-item">
@ -26,7 +26,9 @@
Dispositivi
</h4>
<div class="list-group-item-text">
{% for dispositivo in dispositivi %}
<a href="/disp_details/{{ dispositivo.did }}">Seriale: {{ dispositivo.seriale }} - ID Ente: {{ dispositivo.inv_ente }}</a>
{% endfor %}
</div>
</li>
</ul>

View file

@ -16,7 +16,7 @@
{% for rete in reti %}
<td>{{ rete.nome }}</td>
<td>{{ rete.ip }}</td>
<td><a href="/disp_details/{{ rete.nid }}"><span class="glyphicon glyphicon-list-alt"></span></a></td>
<td><a href="/net_details/{{ rete.nid }}"><span class="glyphicon glyphicon-list-alt"></span></a></td>
<td><a href="/net_del/{{ rete.nid }}"><span class="glyphicon glyphicon-remove"></span></a></td>
</tr>
{% endfor %}