mirror of
https://github.com/retspen/webvirtcloud
synced 2024-12-23 22:55:23 +00:00
instance/network: select actually configured net-source
This commit is contained in:
parent
b4da655644
commit
d5d56a2b50
1 changed files with 5 additions and 12 deletions
|
@ -845,22 +845,19 @@
|
|||
<div class="col-sm-3">
|
||||
<select name="net-source-{{ forloop.counter0 }}" class="form-control" id="network_select" onchange="network_select_enable()">
|
||||
{% for c_nets in compute_networks %}
|
||||
{% if forloop.counter0 == 0 %}
|
||||
<option value="iface:{{ network.nic }}" selected hidden>{% trans "to Change" %}</option>
|
||||
{% endif %}
|
||||
<option value="net:{{ c_nets }}">Network {{ c_nets }}</option>
|
||||
<option value="net:{{ c_nets }}" {% if c_nets == network.nic %}selected{% endif %}>Network {{ c_nets }}</option>
|
||||
{% endfor %}
|
||||
{% for c_iface in compute_interfaces %}
|
||||
<option value="iface:{{ c_iface }}">Interface {{ c_iface }}</option>
|
||||
<option value="iface:{{ c_iface }}" {% if c_iface == network.nic %}selected{% endif %}>Interface {{ c_iface }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% ifequal status 5 %}
|
||||
<button type="submit" class="btn btn-lg btn-success pull-right" id="ali" name="change_network" disabled>{% trans "Change" %}</button>
|
||||
<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="ali" name="change_network" disabled>{% trans "Change" %}</button>
|
||||
<button type="submit" class="btn btn-lg btn-success pull-right" id="btn_change_network" name="change_network" disabled>{% trans "Change" %}</button>
|
||||
{% endifequal %}
|
||||
</form>
|
||||
<div class="clearfix"></div>
|
||||
|
@ -1371,11 +1368,7 @@
|
|||
<script>
|
||||
function network_select_enable(){
|
||||
// set network button enabled
|
||||
var selected = $('network_select').val();
|
||||
if (selected != "to Change") {
|
||||
$('button[name="change_network"]').removeAttr('disabled');
|
||||
|
||||
}
|
||||
$('button[name="change_network"]').removeAttr('disabled');
|
||||
}
|
||||
</script>
|
||||
<script src="{% static "js/Chart.min.js" %}"></script>
|
||||
|
|
Loading…
Reference in a new issue