IPs table

This commit is contained in:
Andy Teijelo Pérez 2015-11-05 09:14:38 -05:00
parent a1ff49d802
commit fe205f66b4
4 changed files with 100 additions and 24 deletions

View file

@ -162,9 +162,9 @@ def list_users():
lines = render_users_tree(tree)
return render_template("users.html", users=lines)
@app.route("/dhcp")
def dhcp():
return render_template("dhcp.html")
@app.route("/ips")
def ips():
return render_template("ips.html")
@app.route("/logout")
def logout():

View file

@ -1,23 +1,3 @@
.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;
}
@ -26,3 +6,59 @@ div.users-tree {
font-family: monospace;
line-height: initial;
}
div.main-container {
width: 600px;
}
div.ips-row {
margin-bottom: 0px;
display: flex;
flex-direction: row;
justify-content: center;
/*line-height: 0;*/
}
div.ips-cell {
display: inline-flex;
flex-direction: column;
justify-content: center;
background-color: #faf4fa;
width: 60px;
height: 60px;
margin: 0px;
border-bottom: 1px solid lightgray;
border-right: 1px solid lightgray;
text-align: center;
position: relative;
overflow: hidden;
}
div.ips-cell.ips-top {
border-top: 1px solid #aaa;
}
div.ips-cell.ips-left {
border-left: 1px solid #aaa;
}
div.ips-cell.ips-right,div.ips-ver-half {
border-right: 1px solid #aaa;
}
div.ips-cell.ips-bottom,div.ips-hor-half {
border-bottom: 1px solid #aaa;
}
div.name {
max-height: 70px;
}
span.ip {
position: absolute;
bottom: 2px;
right: 0.5em;
color: #aaa;
font-weight: bold;
font-size: x-small;
}
div.ips-cell.dhcp-pool {
background-color: #bed;
}

View file

@ -77,7 +77,7 @@
</div>
<div class="row"><a href="{{ url_for('list_users') }}">Lista de usuarios</a></div>
<div class="row"><a href="{{ url_for('ips') }}">Asignación de IPs</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 %}

40
templates/ips.html Normal file
View file

@ -0,0 +1,40 @@
{% extends "base.html" %}
{% block title %}Subir Circuito{% endblock %}
{% block head %}
{{ super() }}
{% endblock %}
{% block content %}
<div class="row">
{% for row in range(16) %}
<div class="ips-row">
{% for col in range(16) -%}
{% set ip = row*16 + col %}
<a href="ip/{{ ip }}">
<div class="ips-cell
{%- if row == 0 %} ips-top{% endif %}
{%- if col == 0 %} ips-left{% endif %}
{%- if row == 15 %} ips-bottom{% endif %}
{%- if col == 15 %} ips-right{% endif %}
{%- if col == 7 %} ips-ver-half{% endif %}
{%- if row == 7 %} ips-hor-half{% endif %}
{%- if 216 <= ip <= 239 %} dhcp-pool{% endif -%}
">
<div class="name">
{% if 99 <= ip <= 103 or ip == 96%}
Andy
{% elif 216 <= ip <= 239 %}
DHCP
{% endif %}
</div>
<span class="ip">.{{ row*16 + col }}</span>
</div>
</a>
{%- endfor %}
</div>
{% endfor %}
</div>
{% endblock %}