diff --git a/server.py b/server.py index b25c94a..4e5336f 100644 --- a/server.py +++ b/server.py @@ -99,10 +99,11 @@ class Dispositivo(db.Model): inv_ente = db.Column(db.String) fornitore = db.Column(db.String) seriale = db.Column(db.String) + ip = db.Column(db.String) nid = db.Column(db.Integer, db.ForeignKey('reti.nid')) rete = db.relationship("Rete", backref='dispositivi') - def __init__(self, tipo, marca, modello, inv_ced, inv_ente, fornitore, nid, seriale): + def __init__(self, tipo, marca, modello, inv_ced, inv_ente, fornitore, nid, seriale, ip): self.tipo = tipo self.marca = marca self.modello = modello @@ -111,6 +112,7 @@ class Dispositivo(db.Model): self.fornitore = fornitore self.nid = nid self.seriale = seriale + self.ip=ip def __repr__(self): return "".format(self.inv_ced) @@ -457,7 +459,7 @@ def page_disp_add(): return render_template("error.htm", error="Il campo Inventario ente deve contenere un numero.") nuovodisp = Dispositivo(request.form['tipo'], request.form['marca'], request.form['modello'], request.form['inv_ced'], request.form['inv_ente'], request.form['fornitore'], - request.form['rete'], request.form['seriale']) + request.form['rete'], request.form['seriale'], request.form['ip']) db.session.add(nuovodisp) db.session.commit() # Trova tutti gli utenti, edizione sporco hack in html @@ -551,6 +553,7 @@ def page_disp_show(did): disp.inv_ente = request.form['inv_ente'] disp.fornitore = request.form['fornitore'] disp.nid = int(request.form['rete']) + disp.ip = request.form['ip'] # Trova tutti gli utenti, edizione sporco hack in html users = list() while True: diff --git a/static/style.css b/static/style.css index 7d4c927..eb93fbb 100644 --- a/static/style.css +++ b/static/style.css @@ -26,6 +26,11 @@ padding-right: 10px; } +.container-lower +{ + margin-top: 10px; +} + body { padding-top: 70px; /*Per la navbar*/ diff --git a/templates/base.htm b/templates/base.htm index 1e6c996..b6c722e 100644 --- a/templates/base.htm +++ b/templates/base.htm @@ -11,7 +11,7 @@
{% block content %}{% endblock %}
-
+
diff --git a/templates/dispositivo/add.htm b/templates/dispositivo/add.htm index 03699bc..1f730bf 100644 --- a/templates/dispositivo/add.htm +++ b/templates/dispositivo/add.htm @@ -94,6 +94,12 @@
+
+ +
+ +
+
diff --git a/templates/dispositivo/details.htm b/templates/dispositivo/details.htm index bd4d7e4..1f5d80a 100644 --- a/templates/dispositivo/details.htm +++ b/templates/dispositivo/details.htm @@ -79,5 +79,18 @@ {{ disp.rete.nome }} - {{ disp.rete.network_ip }}/{{ disp.rete.subnet }}
+
  • +

    + Indirizzo IP +

    +
    + {{ disp.ip }} +
    +
  • + + + {% endblock %} \ No newline at end of file diff --git a/templates/dispositivo/show.htm b/templates/dispositivo/show.htm index b2b8a42..bcb69a9 100644 --- a/templates/dispositivo/show.htm +++ b/templates/dispositivo/show.htm @@ -108,5 +108,11 @@
    +
    + +
    + +
    +
    {% endblock %} \ No newline at end of file diff --git a/templates/impiegato/details.htm b/templates/impiegato/details.htm index 0fd3dc2..c2c0827 100644 --- a/templates/impiegato/details.htm +++ b/templates/impiegato/details.htm @@ -31,7 +31,7 @@ - diff --git a/templates/net/details.htm b/templates/net/details.htm index ad5ac81..ea18637 100644 --- a/templates/net/details.htm +++ b/templates/net/details.htm @@ -39,5 +39,10 @@ {% endfor %}
    + + + {% endblock %} \ No newline at end of file