Working on the DHCP table

This commit is contained in:
Andy Teijelo Pérez 2015-11-04 15:31:57 -05:00
parent 2a1a8d9e94
commit 11311dfe8a
4 changed files with 10 additions and 31 deletions

View file

@ -19,6 +19,7 @@ app.secret_key = "6ab77f3c45447429c2ae163c260a626029519a66450e474c"
debug = True debug = True
users_file = "/etc/freeradius/users.dpto2" users_file = "/etc/freeradius/users.dpto2"
dhcp_hosts_file = "/etc/dnsmasq.d/dpto2/dhcp_hosts"
def reload_freeradius(): def reload_freeradius():
call("./reload_freeradius") call("./reload_freeradius")
@ -161,14 +162,18 @@ def list_users():
lines = render_users_tree(tree) lines = render_users_tree(tree)
return render_template("users.html", users=lines) return render_template("users.html", users=lines)
@app.route("/dhcp")
def dhcp():
return render_template("dhcp.html")
@app.route("/logout") @app.route("/logout")
def logout(): def logout():
session.pop("logged_in",None) session.pop("logged_in",None)
return redirect(url_for("index")) return redirect(url_for("index"))
if __name__ == '__main__': if __name__ == '__main__':
if "debug" in sys.argv: if "debug" in sys.argv:
users_file = "users.dpto2" users_file = "users.dpto2"
dhcp_hosts_file = "dhcp_hosts.dpto2"
app.debug = True app.debug = True
app.run(host="0.0.0.0") app.run(host="0.0.0.0")

View file

@ -1,28 +0,0 @@
.container {
width: 960px;
}
.tests-table-header {
border-top: 0px;
}
.cpi-average {
text-align: right;
}
#tests-table {
margin-top: 60px;
}
#selected-tests span {
margin-left: 0.5em;
}
div.users-tree {
line-height: initial;
}
.edges {
font-family: monospace;
line-height: initial;
}

View file

@ -75,7 +75,9 @@
</div> </div>
</form> </form>
</div> </div>
<div class="row"><a href="{{ url_for('list_users') }}">Lista de usuarios</a></div> <div class="row"><a href="{{ url_for('list_users') }}">Lista de usuarios</a></div>
<div class="row"><a href="{{ url_for('logout') }}">Cerrar sesión</a></div> <div class="row"><a href="{{ url_for('logout') }}">Cerrar sesión</a></div>
<div class="row"><a href="{{ url_for('dhcp') }}">Reservas de DHCP</a></div>
{% endblock %} {% endblock %}

View file

@ -9,7 +9,7 @@
<!-- Bootstrap --> <!-- Bootstrap -->
<link href="{{ static('css/bootstrap.min.css') }}" rel="stylesheet"> <link href="{{ static('css/bootstrap.min.css') }}" rel="stylesheet">
<link href="{{ static('css/font-awesome.min.css') }}" rel="stylesheet"> <link href="{{ static('css/font-awesome.min.css') }}" rel="stylesheet">
<link href="{{ static('css/isabel.css') }}" rel="stylesheet"> <link href="{{ static('css/dpto2.css') }}" rel="stylesheet">
<link href="{{ static('img/icon.png') }}" rel="icon"/> <link href="{{ static('img/icon.png') }}" rel="icon"/>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) --> <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
@ -28,7 +28,7 @@
</head> </head>
<body> <body>
<div class="container" style="width: 600px;"> <div class="container main-container">
{% block content %} {% block content %}
{% endblock %} {% endblock %}
</div> </div>