2018-08-28 08:55:27 +00:00
|
|
|
{% load i18n %}
|
2019-07-17 10:52:14 +00:00
|
|
|
{% if request.user.is_superuser %}
|
2021-07-07 11:12:38 +00:00
|
|
|
<button type="button" class="btn btn-success float-end" data-bs-toggle="modal" data-bs-target="#addInstanceNetwork">
|
2020-05-19 16:53:54 +00:00
|
|
|
<span class="fa fa-plus" aria-hidden="true"></span>
|
2021-07-07 11:12:38 +00:00
|
|
|
</button>
|
2018-08-28 08:55:27 +00:00
|
|
|
|
|
|
|
<!-- Modal pool -->
|
|
|
|
<div class="modal fade" id="addInstanceNetwork" tabindex="-1" role="dialog" aria-labelledby="addInstanceNetworkLabel" aria-hidden="true">
|
|
|
|
<div class="modal-dialog">
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-header">
|
2020-05-19 16:53:54 +00:00
|
|
|
<h5 class="modal-title">{% trans "Add Instance Network" %}</h5>
|
2021-07-07 11:12:38 +00:00
|
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
2018-08-28 08:55:27 +00:00
|
|
|
</div>
|
|
|
|
<div class="modal-body">
|
2020-07-13 09:33:09 +00:00
|
|
|
<form action="{% url 'instances:add_network' instance.id %}" method="post" action="" role="form" aria-label="Add instance network form">{% csrf_token %}
|
2021-07-07 11:12:38 +00:00
|
|
|
<div class="row">
|
2020-05-21 22:13:39 +00:00
|
|
|
<label class="col-sm-4 col-form-label">{% trans "MAC" %}</label>
|
2018-08-28 08:55:27 +00:00
|
|
|
<div class="col-sm-6">
|
|
|
|
<input type="text" class="form-control" name="add-net-mac">
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-07-07 11:12:38 +00:00
|
|
|
<div class="row">
|
2020-05-19 16:53:54 +00:00
|
|
|
<label class="col-sm-4 col-form-label">{% trans "Network" %}</label>
|
2018-08-28 08:55:27 +00:00
|
|
|
<div class="col-sm-6">
|
|
|
|
<select class="form-control" name="add-net-network">
|
2019-09-10 13:05:23 +00:00
|
|
|
{% for c_net in networks_host %}
|
2018-08-28 10:18:35 +00:00
|
|
|
<option value="net:{{ c_net }}">Network {{ c_net }}</option>
|
|
|
|
{% endfor %}
|
2021-02-12 13:05:16 +00:00
|
|
|
{% for c_iface in interfaces_host %}
|
2018-08-28 10:18:35 +00:00
|
|
|
<option value="iface:{{ c_iface }}">Interface {{ c_iface }}</option>
|
2018-08-28 08:55:27 +00:00
|
|
|
{% endfor %}
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-07-07 11:12:38 +00:00
|
|
|
<div class="row">
|
2020-05-19 16:53:54 +00:00
|
|
|
<label class="col-sm-4 col-form-label">{% trans "NWFilter" %}</label>
|
2018-09-24 11:41:13 +00:00
|
|
|
<div class="col-sm-6">
|
2018-09-26 14:20:46 +00:00
|
|
|
<select class="form-control" name="add-net-nwfilter">
|
2018-09-24 11:41:13 +00:00
|
|
|
<option value="">{% trans "None" %}</option>
|
2019-09-10 13:05:23 +00:00
|
|
|
{% for nwfilter in nwfilters_host %}
|
2018-09-24 11:41:13 +00:00
|
|
|
<option value="{{ nwfilter }}">{{ nwfilter }}</option>
|
|
|
|
{% endfor %}
|
|
|
|
</select>
|
|
|
|
</div>
|
2018-08-28 08:55:27 +00:00
|
|
|
</div>
|
2018-09-24 11:41:13 +00:00
|
|
|
</div>
|
2020-05-19 16:53:54 +00:00
|
|
|
<div class="modal-footer">
|
2021-07-07 11:12:38 +00:00
|
|
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{% trans "Close" %}</button>
|
2020-05-19 16:53:54 +00:00
|
|
|
<button type="submit" class="btn btn-primary" name="add_network">{% trans "Add" %}</button>
|
|
|
|
</div>
|
|
|
|
</form>
|
2018-08-28 08:55:27 +00:00
|
|
|
</div> <!-- /.modal-content -->
|
|
|
|
</div> <!-- /.modal-dialog -->
|
|
|
|
</div> <!-- /.modal -->
|
|
|
|
{% endif %}
|