2015-11-05 12:15:35 -05:00
|
|
|
{% extends "base.html" %}
|
|
|
|
{% block title %}Subir Circuito{% endblock %}
|
|
|
|
|
|
|
|
{% block head %}
|
2015-11-06 11:58:05 -05:00
|
|
|
{{ super() }}
|
2015-11-05 12:15:35 -05:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
|
|
|
|
<div class="row">
|
2015-11-06 11:58:05 -05:00
|
|
|
<h3>Asignación de {{ addr }}</h3>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{% if meta.locked %}
|
|
|
|
<div class="alert alert-warning"><i class="fa fa-lock"></i> Esta dirección está reservada por <i>Ilúvatar</i></div>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
<div class="row">
|
2015-11-06 12:34:40 -05:00
|
|
|
|
2015-11-06 11:58:05 -05:00
|
|
|
<form class="form-horizontal" method="POST">
|
|
|
|
{% if meta.locked %}
|
|
|
|
<fieldset disabled>
|
|
|
|
{% endif %}
|
2015-11-06 12:34:40 -05:00
|
|
|
|
|
|
|
<div class="form-group">
|
2015-11-07 14:16:48 -05:00
|
|
|
<div class="col-xs-11">
|
2015-11-07 23:19:29 -05:00
|
|
|
<input type="checkbox" id="reserved" name="reserved"
|
2015-11-07 14:16:48 -05:00
|
|
|
{% if meta.reserved_by -%}
|
|
|
|
checked="checked"
|
|
|
|
{%- endif -%}>
|
|
|
|
<label for="reserved">Etiqueta:</label>
|
|
|
|
<div class="row">
|
2015-11-07 23:19:29 -05:00
|
|
|
<fieldset id="label-fieldset" disabled>
|
|
|
|
<div class="col-xs-6">
|
|
|
|
<input type="text" class="form-control"
|
2015-11-07 14:16:48 -05:00
|
|
|
id="reserved-by" name="reserved-by"
|
|
|
|
{% if meta.reserved_by -%}
|
|
|
|
value="{{ meta.reserved_by }}"
|
|
|
|
{%- endif -%}
|
|
|
|
/>
|
2015-11-07 23:19:29 -05:00
|
|
|
</div>
|
|
|
|
<div class="col-xs-6">
|
|
|
|
{% set meta_color = "black" %}
|
|
|
|
{% if meta.color %}{% set meta_color = meta.color %}{% endif %}
|
|
|
|
|
|
|
|
{% for color in valid_colors %}
|
|
|
|
<span class="color-sample c-{{ color }}
|
|
|
|
{%- if color == meta_color %} selected{% endif -%}"
|
|
|
|
{%- if color != 'black' %} data-color="{{ color }}"{% endif %}
|
|
|
|
><i class="fa fa-square"></i></span>
|
|
|
|
{% endfor %}
|
|
|
|
<input type="hidden" id="label-color" name="label-color" value=""/>
|
|
|
|
</div>
|
2015-11-07 14:16:48 -05:00
|
|
|
</div>
|
2015-11-07 23:19:29 -05:00
|
|
|
</fieldset>
|
|
|
|
</div>
|
2015-11-06 12:34:40 -05:00
|
|
|
</div>
|
|
|
|
|
2015-11-06 11:58:05 -05:00
|
|
|
<div class="form-group">
|
|
|
|
<div class="col-xs-11">
|
2015-11-06 12:34:40 -05:00
|
|
|
<input type="checkbox" id="dhcp" name="dhcp"
|
|
|
|
{% if meta.dhcp_pool or meta.macs %}checked="checked"{% endif %}/>
|
2015-11-06 11:58:05 -05:00
|
|
|
<label for="dhcp">Ofrecer por DHCP</label>
|
|
|
|
<fieldset id="dhcp-fieldset" disabled>
|
|
|
|
<div class="form-group">
|
|
|
|
<div class="col-sm-offset-1">
|
2015-11-06 15:34:58 -05:00
|
|
|
<input type="radio" id="dhcp-client-pool" name="dhcp-client" value="pool"
|
2015-11-06 12:34:40 -05:00
|
|
|
{% if meta.dhcp_pool %}checked="checked"{% endif %}/>
|
2015-11-06 15:34:58 -05:00
|
|
|
<label for="dhcp-client-pool">A cualquier dispositivo</label>
|
2015-11-06 11:58:05 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<div class="col-sm-offset-1">
|
2015-11-06 12:34:40 -05:00
|
|
|
<input type="radio" id="dhcp-client-specific" name="dhcp-client" value="mac"
|
|
|
|
{% if meta.macs %}checked="checked"{% endif %}/>
|
2015-11-06 11:58:05 -05:00
|
|
|
<label for="dhcp-client-specific">A un dispositivo específico</label>
|
|
|
|
<div class="form-group">
|
|
|
|
<fieldset id="dhcp-specific-fieldset" disabled>
|
|
|
|
<div>
|
|
|
|
<label for="dhcp-client-mac" class="col-sm-4 control-label">MAC:</label>
|
|
|
|
<div class="col-sm-5">
|
|
|
|
<input type="text" class="form-control" name="dhcp-client-mac"
|
2015-11-06 12:34:40 -05:00
|
|
|
value="{{ meta.macs|join(",") }}"/>
|
2015-11-06 11:58:05 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<label for="dhcp-custom-gw" class="col-sm-4 control-label">
|
|
|
|
Gateway alternativo:
|
|
|
|
</label>
|
|
|
|
<div class="col-sm-5">
|
2015-11-06 14:26:30 -05:00
|
|
|
<input type="text" class="form-control" name="dhcp-gw"
|
2015-11-06 12:34:40 -05:00
|
|
|
value="{{ meta.gw if meta.gw }}"/>
|
2015-11-06 11:58:05 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</fieldset>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</fieldset>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{% if create_error %}
|
|
|
|
<center>
|
|
|
|
<p>Error: {{ errormsg }}</p>
|
|
|
|
</center>
|
|
|
|
{% endif %}
|
|
|
|
<div class="form-group">
|
2015-11-07 14:16:48 -05:00
|
|
|
<div class="col-xs-11">
|
2015-11-06 11:58:05 -05:00
|
|
|
<button type="submit" class="btn btn-default">Guardar</button>
|
2015-11-07 14:16:48 -05:00
|
|
|
</div>
|
2015-11-06 11:58:05 -05:00
|
|
|
</div>
|
|
|
|
{% if meta.locked %}
|
|
|
|
<fieldset disabled>
|
|
|
|
{% endif %}
|
|
|
|
</form>
|
2015-11-05 12:15:35 -05:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="row">
|
2015-11-06 11:58:05 -05:00
|
|
|
<a href="{{ url_for('ips') }}">Regresar</a>
|
2015-11-05 12:15:35 -05:00
|
|
|
</div>
|
|
|
|
|
2015-11-06 11:58:05 -05:00
|
|
|
<script>
|
|
|
|
$(function() {
|
|
|
|
$("#reserved").change(function() {
|
2015-11-07 23:19:29 -05:00
|
|
|
$("#label-fieldset").prop("disabled", !$(this).prop("checked"));
|
2015-11-06 11:58:05 -05:00
|
|
|
})
|
|
|
|
$("#dhcp").change(function() {
|
|
|
|
$("#dhcp-fieldset").prop("disabled", !$(this).prop("checked"));
|
|
|
|
})
|
|
|
|
$("input[type=radio]").change(function() {
|
|
|
|
$("#dhcp-specific-fieldset").prop("disabled", !$("#dhcp-client-specific").prop("checked"));
|
|
|
|
})
|
2015-11-07 23:19:29 -05:00
|
|
|
$(".color-sample").click(function() {
|
|
|
|
if ($("#label-fieldset").prop("disabled"))
|
|
|
|
return;
|
|
|
|
$(".color-sample").removeClass("selected");
|
|
|
|
$(this).addClass("selected");
|
|
|
|
$("#label-color").val($(this).data().color);
|
|
|
|
});
|
2015-11-06 11:58:05 -05:00
|
|
|
$("input").change()
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
2015-11-05 12:15:35 -05:00
|
|
|
{% endblock %}
|