1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-11-01 03:54:15 +00:00

network.html Add Qos Details

This commit is contained in:
catborise 2019-11-15 11:44:48 +03:00
parent d7b350a591
commit f93fed9437
3 changed files with 118 additions and 48 deletions

View file

@ -1,38 +1,46 @@
{% load i18n %}
{% if request.user.is_superuser %}
<a href="#AddInboundQos" type="button" class="btn btn-success pull-right" data-toggle="modal">
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
<a href="#AddInboundQos" type="button" class="btn btn-success pull-right" data-toggle="modal" title="add inbound qos">
<span class="glyphicon glyphicon-arrow-down" aria-hidden="true"></span>
</a>
<!-- Modal pool -->
<div class="modal fade" id="AddInboundQos" tabindex="-1" role="dialog" aria-labelledby="AddInboundQosLabel" aria-hidden="true">
<div class="modal fade" id="AddInboundQos" tabindex="-1" role="dialog" aria-labelledby="AddInboundQosLabel"
aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title">{% trans "Add Inbound Qos for Network" %}</h4>
</div>
<form class="form-horizontal" method="post" action="" role="form" novalidate>{% csrf_token %}
<div class="modal-body">
<div class="form-group col-sm-4 ">
<label for="qos_inbound_av">{% trans "Average" %}:</label>
<input id="qos_inbound_av" class="form-control" name="qos_inbound_average" value="{{ att.average }}"/>
<form class="form-horizontal" method="post" name="set_qos" role="form">{% csrf_token %}
<div class="form-group">
<label class="col-sm-4 control-label">{% trans "Average" %}:</label>
<div class="col-sm-6">
<input class="form-control" name="qos_inbound_average" required pattern="[0-9]+"/>
</div>
<div class="form-group col-sm-4">
<label for="qos_inbound_peak">{% trans "Peak" %}:</label>
<input id="qos_inbound_peak" class="form-control" name="qos_inbound_peak" value="{{ att.peak }}"/>
</div>
<div class="form-group col-sm-4">
<label for="qos_inbound_burst">{% trans "Burst" %}:</label>
<input id="qos_inbound_burst" class="form-control" name="qos_inbound_burst" value="{{ att.burst }}"/></p>
<div class="form-group">
<label class="col-sm-4 control-label">{% trans "Peak" %}:</label>
<div class="col-sm-6">
<input class="form-control" name="qos_inbound_peak"
required pattern="[0-9]+"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">{% trans "Burst" %}:</label>
<div class="col-sm-6">
<input class="form-control" name="qos_inbound_burst" required pattern="[0-9]+"/>
</div>
</div>
<input name="qos_direction" value="inbound" hidden/>
</div>
</div> <!-- /.modal-content -->
<div class="modal-footer">
<input name="qos_direction" value="inbound" hidden/>
<div class="col-sm-6">
<button class="btn btn-primary btn-block" name="set_qos">{% trans 'Save' %}</button>
</div>
<button type="button" class="btn btn-default" data-dismiss="modal">{% trans 'Close' %}</button>
<button type="submit" class="btn btn-primary" name="set_qos">{% trans 'Save' %}</button>
</div>
</form>
</div>

View file

@ -1,37 +1,46 @@
{% load i18n %}
{% if request.user.is_superuser %}
<a href="#AddInboundQos" type="button" class="btn btn-success pull-right" data-toggle="modal">
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
<a href="#AddOutboundQos" type="button" class="btn btn-success pull-right" data-toggle="modal" title="add outbound qos">
<span class="glyphicon glyphicon-arrow-up" aria-hidden="true"></span>
</a>
<!-- Modal pool -->
<div class="modal fade" id="AddInboundQos" tabindex="-1" role="dialog" aria-labelledby="AddInboundQosLabel" aria-hidden="true">
<div class="modal fade" id="AddOutboundQos" tabindex="-1" role="dialog" aria-labelledby="AddOutboundQosLabel"
aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title">{% trans "Add Inbound Qos for Network" %}</h4>
<h4 class="modal-title">{% trans "Add Outbound Qos for Network" %}</h4>
</div>
<form class="form-horizontal" method="post" action="" role="form" novalidate>{% csrf_token %}
<div class="modal-body">
<div class="form-group col-sm-4 ">
<label for="qos_inbound_av">{% trans "Average" %}:</label>
<input id="qos_inbound_av" class="form-control" name="qos_inbound_average" value="{{ att.average }}"/>
</div>
<div class="form-group col-sm-4">
<label for="qos_inbound_peak">{% trans "Peak" %}:</label>
<input id="qos_inbound_peak" class="form-control" name="qos_inbound_peak" value="{{ att.peak }}"/>
</div>
<div class="form-group col-sm-4">
<label for="qos_inbound_burst">{% trans "Burst" %}:</label>
<input id="qos_inbound_burst" class="form-control" name="qos_inbound_burst" value="{{ att.burst }}"/></p>
</div>
</div> <!-- /.modal-content -->
<div class="modal-footer">
<input name="qos_direction" value="inbound" hidden/>
<form class="form-horizontal" method="post" name="set_qos" role="form">{% csrf_token %}
<div class="form-group">
<label class="col-sm-4 control-label">{% trans "Average" %}:</label>
<div class="col-sm-6">
<button class="btn btn-primary btn-block" name="set_qos">{% trans 'Save' %}</button>
<input class="form-control" name="qos_outbound_average" required pattern="[0-9]+"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">{% trans "Peak" %}:</label>
<div class="col-sm-6">
<input class="form-control" name="qos_outbound_peak"
required pattern="[0-9]+"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">{% trans "Burst" %}:</label>
<div class="col-sm-6">
<input class="form-control" name="qos_outbound_burst" required pattern="[0-9]+"/>
</div>
</div>
<input name="qos_direction" value="outbound" hidden/>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">{% trans 'Close' %}</button>
<button type="submit" class="btn btn-primary" name="set_qos">{% trans 'Save' %}</button>
</div>
</form>
</div>

View file

@ -172,7 +172,6 @@
</div>
<div id="collapseTwo" class="panel-collapse collapse">
<div class="panel-body">
<div class="input-append form-inline pull-right">
<div class="form-group">
<input type="text" class="form-control" id="filter_input">
@ -339,6 +338,60 @@
</div>
</div>
{% endif %}
{% ifequal state 0 %}
{% include 'add_outbound_qos.html' %}
{% include 'add_inbound_qos.html' %}
{% endifequal %}
<div class="row">
<h3 class="page-header">{% trans "Qos Configuration" %}
</h3>
</div>
<div class="row">
<div class="col-sm-12">
<table class="table table-hover">
<thead>
<tr>
<th style="text-align: center">{% trans "Direction" %}</th>
<th style="text-align: center">{% trans "Average" %}</th>
<th style="text-align: center">{% trans "Peak" %}</th>
<th style="text-align: center">{% trans "Burst" %}</th>
<th style="text-align: center">{% trans "Actions" %}</th>
</tr>
</thead>
<tbody>
{% for q, att in qos.items %}
<form method="post" role="form">{% csrf_token %}
<tr>
<td><label class="control-label">{{ q | capfirst }}</label></td>
<td><input id="qos_{{ q }}_av" class="form-control" name="qos_{{ q }}_average"
value="{{ att.average }}"/></td>
<td><input id="qos_{{ q }}_peak" class="form-control" name="qos_{{ q }}_peak"
value="{{ att.peak }}"/></td>
<td><input id="qos_{{ q }}_burst" class="form-control" name="qos_{{ q }}_burst"
value="{{ att.burst }}"/></td>
<td>
<input name="qos_direction" value="{{ q }}" hidden/>
<button type="submit" class="btn btn-sm btn-primary"
name="set_qos"
title="Edit Qos" onclick="return confirm('{% trans "Are you sure?" %}')">
<i class="glyphicon glyphicon-save"></i>
</button>
<button type="submit" class="btn btn-sm btn-danger"
name="unset_qos"
title="Delete Qos" onclick="return confirm('{% trans "Are you sure?" %}')">
<i class="glyphicon glyphicon-trash"></i>
</button>
</td>
</tr>
</form>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endblock %}
{% block script %}
<script>