mirror of
https://github.com/Steffo99/estus.git
synced 2024-11-25 17:14:19 +00:00
Remove net_add page
This commit is contained in:
parent
4ece310bc0
commit
4f0354b94e
3 changed files with 14 additions and 25 deletions
|
@ -662,7 +662,7 @@ def page_net_add():
|
||||||
if 'username' not in session:
|
if 'username' not in session:
|
||||||
return abort(403)
|
return abort(403)
|
||||||
if request.method == 'GET':
|
if request.method == 'GET':
|
||||||
return render_template("net/add.htm", pagetype="net", user=session.get("username"))
|
return render_template("net/show.htm", action="add", pagetype="net", user=session.get("username"))
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
int(request.form["subnet"])
|
int(request.form["subnet"])
|
||||||
|
@ -719,7 +719,7 @@ def page_net_show(nid):
|
||||||
return abort(403)
|
return abort(403)
|
||||||
if request.method == 'GET':
|
if request.method == 'GET':
|
||||||
net = Rete.query.filter_by(nid=nid).first_or_404()
|
net = Rete.query.filter_by(nid=nid).first_or_404()
|
||||||
return render_template("net/show.htm", net=net, pagetype="net", user=session.get("username"))
|
return render_template("net/show.htm", action="show", net=net, pagetype="net", user=session.get("username"))
|
||||||
else:
|
else:
|
||||||
net = Rete.query.filter_by(nid=nid).first_or_404()
|
net = Rete.query.filter_by(nid=nid).first_or_404()
|
||||||
net.nome = request.form['nome']
|
net.nome = request.form['nome']
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
{% extends "base.htm" %}
|
|
||||||
{% block title %}Aggiungi rete • estus{% endblock %}
|
|
||||||
{% block content %}
|
|
||||||
<h1>
|
|
||||||
Aggiungi nuova rete
|
|
||||||
</h1>
|
|
||||||
<form class="form-inline" action="/net_add" method="post">
|
|
||||||
<input class="form-control" type="text" placeholder="Nome rete" name="nome">
|
|
||||||
<input class="form-control" type="text" placeholder="Network IP" name="network_ip">
|
|
||||||
<input class="form-control" type="text" placeholder="Subnet mask" name="subnet">
|
|
||||||
<input class="form-control" type="text" placeholder="DNS primario" name="primary_dns">
|
|
||||||
<input class="form-control" type="text" placeholder="DNS secondario" name="secondary_dns">
|
|
||||||
<input class="btn btn-primary" type="submit">
|
|
||||||
</form>
|
|
||||||
{% endblock %}
|
|
|
@ -1,15 +1,19 @@
|
||||||
{% extends "base.htm" %}
|
{% extends "base.htm" %}
|
||||||
{% block title %}Aggiungi rete • estus{% endblock %}
|
{% block title %}Modifica rete • estus{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>
|
<h1>
|
||||||
Aggiungi nuova rete
|
{% if action == "add" %}
|
||||||
|
Aggiungi rete
|
||||||
|
{% elif action == "show" %}
|
||||||
|
Modifica rete
|
||||||
|
{% endif %}
|
||||||
</h1>
|
</h1>
|
||||||
<form class="form-inline" action="/net_show/{{ net.nid }}" method="post">
|
<form class="form-inline" {% if net %}action="/net_show/{{ net.nid }}"{% endif %} method="post">
|
||||||
<input class="form-control" type="text" placeholder="Nome rete" name="nome" value="{{ net.nome }}">
|
<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" value="{{ net.network_ip }}">
|
<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" name="subnet" value="{{ net.subnet }}">
|
<input class="form-control" type="text" placeholder="Subnet mask" name="subnet" {% if net %}value="{{ net.subnet }}"{% endif %}>
|
||||||
<input class="form-control" type="text" placeholder="DNS primario" name="primary_dns" value="{{ net.primary_dns }}">
|
<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" value="{{ net.secondary_dns }}">
|
<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">
|
||||||
</form>
|
</form>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
Loading…
Reference in a new issue