1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-10 20:26:48 +00:00
webvirtcloud/networks/templates/add_network_qos.html
catborise a8f445d580 feat(instances): a VM's network devices as cards, each with its QoS limits
Settings > Network was a table whose fields were read-only inputs cut
off at phone width, an unlabelled "+", three icon buttons per NIC and
a separate QoS table keyed by MAC. The owner chose card layout from
three rendered options, with the QoS limits folding out like the
device details:

- A card per NIC: a VM's only NIC spans the row, two or more sit side
  by side from md. Each has its name and target, the link state as a
  switch, its source and IPv4 addresses, and "Device details"
  (type, MAC, model, NWFilter, IPv6) in a <details>.
- "QoS limits" in a second <details>, its summary naming the limited
  directions: a form per inbound or outbound limit, with Save and
  Delete limit, and the units.
- Labelled Edit, Add QoS and Delete in the card footer; "Add network
  device" by the heading. The edit and add-QoS dialogs are titled and
  labelled, and the edit dialog's fields have labels.

The limits come from each NIC of the persistent definition, so the QoS
table, Instance.config_qos and wvmInstance.get_all_qos are removed.
2026-10-30 14:55:57 +03:00

52 lines
No EOL
2.7 KiB
HTML

{% load i18n %}
{% if request.user.is_superuser %}
<!-- Modal pool -->
<div class="modal fade" id="AddQos{{ id }}" tabindex="-1" role="dialog" aria-labelledby="AddQosLabel{{ id }}"
aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="AddQosLabel{{ id }}">{% trans "Add QoS for Network" %}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="row">
<label class="col-sm-4 col-form-label">{% trans "Direction" %}:</label>
<div class="col-sm-6">
<select class="form-select" name="qos_direction">
<option value="inbound">{% trans 'Inbound' %}</option>
<option value="outbound">{% trans 'Outbound' %}</option>
</select>
</div>
</div>
<div class="row">
<label class="col-sm-4 col-form-label">{% trans "Average" %}:</label>
<div class="col-sm-6">
<input class="form-control" name="qos_average" placeholder="{% trans "kilobytes" %}"
required pattern="[0-9]+"/>
</div>
</div>
<div class="row">
<label class="col-sm-4 col-form-label">{% trans "Peak" %}:</label>
<div class="col-sm-6">
<input class="form-control" name="qos_peak" placeholder="{% trans "kilobytes" %}"
pattern="[0-9]+"/>
</div>
</div>
<div class="row">
<label class="col-sm-4 col-form-label">{% trans "Burst" %}:</label>
<div class="col-sm-6">
<input class="form-control" name="qos_burst" placeholder="{% trans "kilobytes" %}"
pattern="[0-9]+"/>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{% trans 'Close' %}</button>
<button type="submit" class="btn btn-primary" name="set_qos">{% trans 'Save' %}</button>
</div>
</div>
</div> <!-- /.modal-dialog -->
</div> <!-- /.modal -->
{% endif %}