mirror of
https://github.com/retspen/webvirtcloud
synced 2025-07-31 12:41:08 +00:00
selection added to domain creation for nwfilters. Add nwfilter option while adding network card. NWfilters minor fixes
This commit is contained in:
parent
f45666d88b
commit
4d14fdceea
10 changed files with 65 additions and 15 deletions
|
@ -33,12 +33,24 @@
|
|||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">{% trans "NWFilter" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control" name="nwfilter">
|
||||
<option value="">{% trans "None" %}</option>
|
||||
{% for nwfilter in nwfilters %}
|
||||
<option value="{{ nwfilter }}">{{ nwfilter }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</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="add_network">{% trans "Add" %}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div> <!-- /.modal-content -->
|
||||
</div> <!-- /.modal-dialog -->
|
||||
</div> <!-- /.modal -->
|
||||
|
|
|
@ -859,11 +859,8 @@
|
|||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% ifequal status 5 %}
|
||||
<button type="submit" class="btn btn-lg btn-success pull-right" id="btn_change_network" name="change_network" disabled>{% trans "Change" %}</button>
|
||||
{% else %}
|
||||
<button type="submit" class="btn btn-lg btn-success pull-right" id="btn_change_network" name="change_network" disabled>{% trans "Change" %}</button>
|
||||
{% endifequal %}
|
||||
<button type="submit" class="btn btn-lg btn-success pull-right" id="btn_change_network" name="change_network" disabled>{% trans "Change" %}</button>
|
||||
|
||||
</form>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
|
|
|
@ -364,6 +364,7 @@ def instance(request, compute_id, vname):
|
|||
else:
|
||||
media_iso = []
|
||||
networks = conn.get_net_device()
|
||||
nwfilters = conn.get_nwfilters()
|
||||
vcpu_range = conn.get_max_cpus()
|
||||
memory_range = [256, 512, 768, 1024, 2048, 4096, 6144, 8192, 16384]
|
||||
if memory not in memory_range:
|
||||
|
@ -708,9 +709,10 @@ def instance(request, compute_id, vname):
|
|||
|
||||
if 'add_network' in request.POST:
|
||||
mac = request.POST.get('add-net-mac')
|
||||
nwfilter = request.POST.get('nwfilter')
|
||||
(source, source_type) = get_network_tuple(request.POST.get('add-net-network'))
|
||||
|
||||
conn.add_network(mac, source, source_type)
|
||||
conn.add_network(mac, source, source_type, nwfilter=nwfilter)
|
||||
msg = _("Edit network")
|
||||
addlogmsg(request.user.username, instance.name, msg)
|
||||
msg = _("Network Devices are changed. Please reboot instance to activate.")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue