21 changed files with 395 additions and 57 deletions
-
6abonapp/forms.py
-
11abonapp/models.py
-
18abonapp/templates/abonapp/editAbon.html
-
25abonapp/templates/abonapp/modal_add_lease.html
-
26abonapp/templates/abonapp/modal_current_networks.html
-
4abonapp/urls.py
-
53abonapp/views.py
-
15agent/commands/dhcp.py
-
3devapp/forms.py
-
6devapp/views.py
-
6djing/lib/__init__.py
-
2ip_pool/fields.py
-
32ip_pool/forms.py
-
119ip_pool/models.py
-
2ip_pool/templates/ip_pool/ip_leases_list.html
-
8ip_pool/templates/ip_pool/net_edit.html
-
33ip_pool/templates/ip_pool/network_groups_available.html
-
23ip_pool/templates/ip_pool/network_list.html
-
19ip_pool/templates/ip_pool/networkmodel_confirm_delete.html
-
4ip_pool/urls.py
-
37ip_pool/views.py
@ -0,0 +1,25 @@ |
|||||
|
{% extends request.is_ajax|yesno:'nullcont.htm,abonapp/ext.htm' %} |
||||
|
{% load i18n %} |
||||
|
{% load bootstrap3 %} |
||||
|
{% block content %} |
||||
|
<form role="form" action="{% url 'abonapp:lease_add' group.id uname %}" method="post"> {% csrf_token %} |
||||
|
<div class="modal-header primary"> |
||||
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> |
||||
|
<h4 class="modal-title"><span class="glyphicon glyphicon-compressed"></span>{% trans 'Add ip lease' %}</h4> |
||||
|
</div> |
||||
|
|
||||
|
<div class="modal-body"> |
||||
|
{% bootstrap_form form %} |
||||
|
|
||||
|
<div class="btn-group"> |
||||
|
<button type="submit" class="btn btn-success"> |
||||
|
<span class="glyphicon glyphicon-plus"></span> {% trans 'Add' %} |
||||
|
</button> |
||||
|
<button type="reset" class="btn btn-default"> |
||||
|
<span class="glyphicon glyphicon-remove-circle"></span> {% trans 'Reset' %} |
||||
|
</button> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
</form> |
||||
|
{% endblock %} |
||||
@ -0,0 +1,26 @@ |
|||||
|
{% load i18n %} |
||||
|
<div class="modal-header primary"> |
||||
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> |
||||
|
<h4 class="modal-title"><span class="glyphicon glyphicon-globe"></span>{% trans 'Available networks' %}</h4> |
||||
|
</div> |
||||
|
|
||||
|
<table class="table table-striped table-bordered"> |
||||
|
<thead> |
||||
|
<tr> |
||||
|
<th>{% trans 'Network' %}</th> |
||||
|
<th>{% trans 'Scope' %}</th> |
||||
|
</tr> |
||||
|
</thead> |
||||
|
<tbody> |
||||
|
{% for net_item in networks %} |
||||
|
<tr> |
||||
|
<td><a href="#" class="btn btn-link">{{ net_item }}</a></td> |
||||
|
<td>{{ net_item.get_scope }}</td> |
||||
|
</tr> |
||||
|
{% empty %} |
||||
|
<tr> |
||||
|
<td colspan="2">{% trans 'Available networks not found' %}</td> |
||||
|
</tr> |
||||
|
{% endfor %} |
||||
|
</tbody> |
||||
|
</table> |
||||
@ -0,0 +1,33 @@ |
|||||
|
{% extends request.is_ajax|yesno:'bajax.html,base.html' %} |
||||
|
{% load i18n %} |
||||
|
|
||||
|
{% block breadcrumb %} |
||||
|
<ol class="breadcrumb"> |
||||
|
<li><span class="glyphicon glyphicon-home"></span></li> |
||||
|
<li><a href="{% url 'ip_pool:networks' %}">{% trans 'Ip pool' %}</a></li> |
||||
|
<li><a href="{% url 'ip_pool:net_edit' object.id %}">{{ object }}</a></li> |
||||
|
<li class="active">{% trans 'Belonging networks for groups' %}</li> |
||||
|
</ol> |
||||
|
{% endblock %} |
||||
|
|
||||
|
{% block page-header %} |
||||
|
<h3>{% trans 'Make that pool available in specified groups' %}</h3> |
||||
|
{% endblock %} |
||||
|
|
||||
|
{% block main %} |
||||
|
<form action="{% url 'ip_pool:net_groups' object.pk %}" method="post">{% csrf_token %} |
||||
|
{% for group in groups %} |
||||
|
<div class="checkbox"> |
||||
|
<label> |
||||
|
{% if group.pk in selected_grps %} |
||||
|
<input name="gr" type="checkbox" value="{{ group.pk }}" checked/> |
||||
|
{% else %} |
||||
|
<input name="gr" type="checkbox" value="{{ group.pk }}"/> |
||||
|
{% endif %} |
||||
|
{{ group }} |
||||
|
</label> |
||||
|
</div> |
||||
|
{% endfor %} |
||||
|
<input type="submit" class="btn btn-primary" value="{% trans 'Save' %}"> |
||||
|
</form> |
||||
|
{% endblock %} |
||||
@ -0,0 +1,19 @@ |
|||||
|
{% extends 'base_delete_modal.html' %} |
||||
|
{% load i18n %} |
||||
|
|
||||
|
{% block modal_form_url %} |
||||
|
{% url 'ip_pool:net_delete' object.pk %} |
||||
|
{% endblock %} |
||||
|
|
||||
|
{% block modal_form_title %} |
||||
|
{% trans 'Remove network' %} |
||||
|
{% endblock %} |
||||
|
|
||||
|
{% block modal_form_text %} |
||||
|
<h4>{% blocktrans trimmed with network_name=object %} |
||||
|
To delete network '{{ network_name }}'? |
||||
|
{% endblocktrans %}</h4> |
||||
|
<p>{% blocktrans trimmed %} |
||||
|
Attention! All leases in that network will be removed and services finished. |
||||
|
{% endblocktrans %}</p> |
||||
|
{% endblock %} |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue