1
Fork 0
mirror of https://github.com/Steffo99/estus.git synced 2024-11-21 15:14:19 +00:00

Implement #29. And some quick bugfixes.

This commit is contained in:
Steffo 2017-09-22 11:20:31 +02:00
parent df7c6ff317
commit f6a15158fd
11 changed files with 19 additions and 10 deletions

View file

@ -10,6 +10,9 @@ import subprocess
app = Flask(__name__) app = Flask(__name__)
app.secret_key = os.environ["flask_secret_key"] app.secret_key = os.environ["flask_secret_key"]
app.jinja_env.trim_blocks = True
app.jinja_env.lstrip_blocks = True
# SQL # SQL
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///db.sqlite' app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///db.sqlite'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False

5
static/delet.js Normal file
View file

@ -0,0 +1,5 @@
function delet(base_url, id, name)
{
if(confirm("Sei sicuro di voler eliminare " + name + "? Non potrai annullare l'operazione una volta eseguita!"))
window.location.href = base_url.replace("12341234", id);
}

View file

@ -8,6 +8,7 @@
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}"> <link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
<link rel="icon" href="http://www.terredicastelli.mo.it/favicon.ico"> <link rel="icon" href="http://www.terredicastelli.mo.it/favicon.ico">
<script src="{{ url_for("static", filename="delet.js") }}"></script>
{% block extrahead %}{% endblock %} {% block extrahead %}{% endblock %}
</head> </head>
<body> <body>

View file

@ -54,7 +54,7 @@
<a href="{{ url_for("page_disp_details", did=d[0].did) }}" title="Dettagli"><span class="glyphicon glyphicon-zoom-in"></span></a> <a href="{{ url_for("page_disp_details", did=d[0].did) }}" title="Dettagli"><span class="glyphicon glyphicon-zoom-in"></span></a>
<a href="{{ url_for("page_disp_show", did=d[0].did) }}" title="Modifica"><span class="glyphicon glyphicon-pencil"></span></a> <a href="{{ url_for("page_disp_show", did=d[0].did) }}" title="Modifica"><span class="glyphicon glyphicon-pencil"></span></a>
<a href="{{ url_for("page_disp_clone", did=d[0].did) }}" title="Clona"><span class="glyphicon glyphicon-duplicate"></span></a> <a href="{{ url_for("page_disp_clone", did=d[0].did) }}" title="Clona"><span class="glyphicon glyphicon-duplicate"></span></a>
<a href="{{ url_for("page_disp_del", did=d[0].did) }}" title="Elimina"><span class="glyphicon glyphicon-remove"></span></a> <a href="javascript:void(0)" onclick="delet(&quot;{{ url_for("page_disp_del", did=12341234) }}&quot;, {{ d[0].did }}, &quot;il dispositivo&quot;);" title="Elimina"><span class="glyphicon glyphicon-remove"></span></a>
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}

View file

@ -22,7 +22,7 @@
<tr> <tr>
<td>{{ ente.nomeente }}</td> <td>{{ ente.nomeente }}</td>
<td>{{ ente.nomebreveente }}</td> <td>{{ ente.nomebreveente }}</td>
<td><a href="{{ url_for("page_serv_list_plus", eid=ente.eid) }}"><span class="glyphicon glyphicon-list-alt"></span></a> <a href="{{ url_for("page_ente_show", eid=ente.eid) }}"><span class="glyphicon glyphicon-pencil"></span></a> <a href="{{ url_for("page_ente_del", eid=ente.eid) }}"><span class="glyphicon glyphicon-remove"></span></a></td> <td><a href="{{ url_for("page_serv_list_plus", eid=ente.eid) }}"><span class="glyphicon glyphicon-list-alt"></span></a> <a href="{{ url_for("page_ente_show", eid=ente.eid) }}"><span class="glyphicon glyphicon-pencil"></span></a> <a href="javascript:void(0)" onclick="delet(&quot;{{ url_for("page_ente_del", eid=12341234) }}&quot;, {{ ente.eid }}, &quot;{{ ente }}&quot;);"><span class="glyphicon glyphicon-remove"></span></a></td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>

View file

@ -27,7 +27,7 @@
<td>{{ imp.nomeimpiegato }}</td> <td>{{ imp.nomeimpiegato }}</td>
<td>{% if imp.username %}<code>{{ imp.username }}</code>{% endif %}</td> <td>{% if imp.username %}<code>{{ imp.username }}</code>{% endif %}</td>
<td>{% if imp.passwd %}<code>{{ imp.passwd }}</code>{% endif %}</td> <td>{% if imp.passwd %}<code>{{ imp.passwd }}</code>{% endif %}</td>
<td><a href="{{ url_for("page_imp_details", iid=imp.iid) }}" title="Dettagli"><span class="glyphicon glyphicon-zoom-in"></span></a> <a href="{{ url_for("page_imp_show", iid=imp.iid) }}"><span class="glyphicon glyphicon-pencil"></span></a> <a href="{{ url_for("page_imp_del", iid=imp.iid) }}"><span class="glyphicon glyphicon-remove"></span></a></td> <td><a href="{{ url_for("page_imp_details", iid=imp.iid) }}" title="Dettagli"><span class="glyphicon glyphicon-zoom-in"></span></a> <a href="{{ url_for("page_imp_show", iid=imp.iid) }}"><span class="glyphicon glyphicon-pencil"></span></a> <a href="javascript:void(0)" onclick="delet(&quot;{{ url_for("page_imp_del", iid=12341234) }}&quot;, {{ imp.iid }}, &quot;{{ imp }}&quot;);"><span class="glyphicon glyphicon-remove"></span></a></td>
</tr> </tr>
{% endfor %} {% endfor %}
</table> </table>

View file

@ -9,11 +9,11 @@
</div> </div>
{% for rete in reti if rete.network_ip == "0.0.0.0" %} {% for rete in reti if rete.network_ip == "0.0.0.0" %}
<div class="alert alert-info"> <div class="alert alert-info">
La rete con IP 0.0.0.0 sarà usata come rete di default durante l'eliminazione di altre reti con dispositivi assegnati. Cancellarla potrebbe avere effetti indesiderati. La rete con IP 0.0.0.0 sarà usata come rete di default durante l'eliminazione di altre reti con dispositivi assegnati. Cancellarla o modificare il suo ip potrebbe avere effetti indesiderati.
</div> </div>
{% else %} {% else %}
<div class="alert alert-danger"> <div class="alert alert-danger">
Non è presente nessuna rete con IP 0.0.0.0! Non sarà possibile eliminare altre reti finchè non sarà ricreata. Non è presente nessuna rete con IP 0.0.0.0! Non sarà possibile eliminare altre reti finchè non sarà ricreata, e potrebbero comparire altri bug strani.
</div> </div>
{% endfor %} {% endfor %}
<table class="table table-hover"> <table class="table table-hover">
@ -28,7 +28,7 @@
<tr> <tr>
<td>{{ rete.nome }}</td> <td>{{ rete.nome }}</td>
<td>{{ rete.network_ip }}/{{ rete.subnet }}</td> <td>{{ rete.network_ip }}/{{ rete.subnet }}</td>
<td><a href="{{ url_for("page_net_details", nid=rete.nid) }}"><span class="glyphicon glyphicon-zoom-in"></span></a> <a href="{{ url_for("page_net_show", nid=rete.nid) }}"><span class="glyphicon glyphicon-pencil"></span></a> {% if reti|length > 1 %}<a href="{{ url_for("page_net_del", nid=rete.nid) }}"><span class="glyphicon glyphicon-remove"></span></a>{% endif %}</td> <td><a href="{{ url_for("page_net_details", nid=rete.nid) }}"><span class="glyphicon glyphicon-zoom-in"></span></a> <a href="{{ url_for("page_net_show", nid=rete.nid) }}"><span class="glyphicon glyphicon-pencil"></span></a> {% if rete.network_ip != "0.0.0.0" %}<a href="javascript:void(0)" onclick="delet(&quot;{{ url_for("page_net_del", nid=12341234) }}&quot;, {{ rete.nid }}, &quot;{{ rete }}&quot;);"><span class="glyphicon glyphicon-remove"></span></a>{% endif %}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</table> </table>

View file

@ -13,7 +13,7 @@
<form class="form-inline" method="post"> <form class="form-inline" method="post">
<input class="form-control" type="text" placeholder="Nome rete" name="nome" {% if net %}value="{{ net.nome }}"{% endif %}> <input class="form-control" type="text" placeholder="Nome rete" name="nome" {% if net %}value="{{ net.nome }}"{% endif %}>
<input class="form-control" type="text" placeholder="Network IP" name="network_ip" {% if net %}value="{{ net.network_ip }}"{% endif %}> <input class="form-control" type="text" placeholder="Network IP" name="network_ip" {% if net %}value="{{ net.network_ip }}"{% endif %}>
<input class="form-control" type="text" placeholder="Subnet mask (/XX)" pattern="/?[0-9]{2}" name="subnet" {% if net %}value="{{ net.subnet }}"{% endif %}> <input class="form-control" type="text" placeholder="Subnet mask (/XX)" pattern="/?[0-9][0-9]?" name="subnet" {% if net %}value="{{ net.subnet }}"{% endif %}>
<input class="form-control" type="text" placeholder="DNS primario" name="primary_dns" {% if net %}value="{{ net.primary_dns }}"{% endif %}> <input class="form-control" type="text" placeholder="DNS primario" name="primary_dns" {% if net %}value="{{ net.primary_dns }}"{% endif %}>
<input class="form-control" type="text" placeholder="DNS secondario" name="secondary_dns" {% if net %}value="{{ net.secondary_dns }}"{% endif %}> <input class="form-control" type="text" placeholder="DNS secondario" name="secondary_dns" {% if net %}value="{{ net.secondary_dns }}"{% endif %}>
<input class="btn btn-primary" type="submit"> <input class="btn btn-primary" type="submit">

View file

@ -35,7 +35,7 @@
{{ order.garanzia }} {{ order.garanzia }}
{% endif %} {% endif %}
</td> </td>
<td><a href="{{ url_for("page_order_details", oid=order.oid) }}" title="Dettagli"><span class="glyphicon glyphicon-zoom-in"></span></a> <a href="{{ url_for("page_order_show", oid=order.oid) }}"><span class="glyphicon glyphicon-pencil"></span></a> <a href="{{ url_for("page_order_del", oid=order.oid) }}"><span class="glyphicon glyphicon-remove"></span></a></td> <td><a href="{{ url_for("page_order_details", oid=order.oid) }}" title="Dettagli"><span class="glyphicon glyphicon-zoom-in"></span></a> <a href="{{ url_for("page_order_show", oid=order.oid) }}"><span class="glyphicon glyphicon-pencil"></span></a> <a href="javascript:void(0)" onclick="delet(&quot;{{ url_for("page_order_del", oid=12341234) }}&quot;, {{ order.oid }}, &quot;{{ order }}&quot;);"><span class="glyphicon glyphicon-remove"></span></a></td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>

View file

@ -21,7 +21,7 @@
<td>{{ servizio.ente.nomeente }}</td> <td>{{ servizio.ente.nomeente }}</td>
<td>{{ servizio.nomeservizio }}</td> <td>{{ servizio.nomeservizio }}</td>
<td>{{ servizio.locazione }}</td> <td>{{ servizio.locazione }}</td>
<td><a href="{{ url_for("page_imp_list_plus", sid=servizio.sid) }}"><span class="glyphicon glyphicon-list-alt"></span></a> <a href="{{ url_for("page_serv_show", sid=servizio.sid) }}"><span class="glyphicon glyphicon-pencil"></span></a> <a href="{{ url_for("page_serv_del", sid=servizio.sid) }}"><span class="glyphicon glyphicon-remove"></span></a></td> <td><a href="{{ url_for("page_imp_list_plus", sid=servizio.sid) }}"><span class="glyphicon glyphicon-list-alt"></span></a> <a href="{{ url_for("page_serv_show", sid=servizio.sid) }}"><span class="glyphicon glyphicon-pencil"></span></a> <a href="javascript:void(0)" onclick="delet(&quot;{{ url_for("page_serv_del", sid=12341234) }}&quot;, {{ servizio.sid }}, &quot;{{ servizio }}&quot;);"><span class="glyphicon glyphicon-remove"></span></a></td>
</tr> </tr>
{% endfor %} {% endfor %}
</table> </table>

View file

@ -19,7 +19,7 @@
{% for utente in utenti %} {% for utente in utenti %}
<tr> <tr>
<td>{{ utente.username }}</td> <td>{{ utente.username }}</td>
<td>{% if utenti|length >= 2 and utente.username != user %}<a href="/user_del/{{ utente.uid }}"><span class="glyphicon glyphicon-remove"></span></a>{% endif %}</td> <td>{% if utenti|length >= 2 and utente.username != user %}<a href="javascript:void(0)" onclick="delet(&quot;{{ url_for("page_user_del", uid=12341234) }}&quot;, {{ utente.uid }}, &quot;{{ utente }}&quot;);"><span class="glyphicon glyphicon-remove"></span></a>{% endif %}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</table> </table>