mirror of
https://github.com/retspen/webvirtcloud
synced 2024-12-24 23:25:24 +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">
|
<div class="col-sm-3">
|
||||||
<select name="net-source-{{ forloop.counter0 }}" class="form-control" id="network_select" onchange="network_select_enable()">
|
<select name="net-source-{{ forloop.counter0 }}" class="form-control" id="network_select" onchange="network_select_enable()">
|
||||||
{% for c_nets in compute_networks %}
|
{% for c_nets in compute_networks %}
|
||||||
{% if forloop.counter0 == 0 %}
|
<option value="net:{{ c_nets }}" {% if c_nets == network.nic %}selected{% endif %}>Network {{ c_nets }}</option>
|
||||||
<option value="iface:{{ network.nic }}" selected hidden>{% trans "to Change" %}</option>
|
|
||||||
{% endif %}
|
|
||||||
<option value="net:{{ c_nets }}">Network {{ c_nets }}</option>
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% for c_iface in compute_interfaces %}
|
{% 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 %}
|
{% endfor %}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% ifequal status 5 %}
|
{% 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 %}
|
{% 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 %}
|
{% endifequal %}
|
||||||
</form>
|
</form>
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
|
@ -1371,11 +1368,7 @@
|
||||||
<script>
|
<script>
|
||||||
function network_select_enable(){
|
function network_select_enable(){
|
||||||
// set network button enabled
|
// 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>
|
||||||
<script src="{% static "js/Chart.min.js" %}"></script>
|
<script src="{% static "js/Chart.min.js" %}"></script>
|
||||||
|
|
Loading…
Reference in a new issue