1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-12-24 15:15:22 +00:00

instance/network: select actually configured net-source

This commit is contained in:
Ing. Jan KRCMAR 2018-08-28 12:35:40 +02:00
parent b4da655644
commit d5d56a2b50

View file

@ -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(); $('button[name="change_network"]').removeAttr('disabled');
if (selected != "to Change") {
$('button[name="change_network"]').removeAttr('disabled');
}
} }
</script> </script>
<script src="{% static "js/Chart.min.js" %}"></script> <script src="{% static "js/Chart.min.js" %}"></script>