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

attach volume dropdown menu rearranged to show selected pool

This commit is contained in:
catborise 2018-10-25 09:57:41 +03:00
parent 1196fb38c9
commit 07984a2a9a
2 changed files with 9 additions and 4 deletions

View file

@ -103,14 +103,14 @@
<label class="col-sm-3 control-label" style="font-weight:normal;">{% trans "Storage" %}</label> <label class="col-sm-3 control-label" style="font-weight:normal;">{% trans "Storage" %}</label>
<div class="col-sm-4"> <div class="col-sm-4">
<div class="dropdown"> <div class="dropdown">
<button class="btn dropdown-toggle" type="button" data-toggle="dropdown">{% trans 'Select Pool...' %} <button id="select_storage" class="btn dropdown-toggle" type="button" data-toggle="dropdown">{% trans 'Select Pool...' %}
<span class="caret"></span></button> <span class="caret"></span></button>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
{% for storage in storages %} {% for storage in storages %}
<li><a href="#" onclick="get_volumes({{ compute_id }}, '{{ storage }}')">{{ storage }}</a></li> <li><a href="#" onclick="get_volumes({{ compute_id }}, '{{ storage }}')">{{ storage }}</a></li>
{% endfor %} {% endfor %}
</ul> </ul>
<input id="selected_storage" name="selected_storage" type="hidden" value=""/> <input id="selected_storage" name="selected_storage" hidden/>
</div> </div>
</div> </div>
</div> </div>

View file

@ -1253,8 +1253,13 @@
select.removeChild(select.options[0]); select.removeChild(select.options[0]);
} }
var input_sto = document.getElementById('selected_storage'); var sto_drop = document.getElementById('select_storage');
input_sto.value = pool; sto_drop.value = pool;
sto_drop.innerHTML = pool + "<span class=\"caret\"></span>";
var sto_input = document.getElementById('selected_storage');
sto_input.value = pool;
sto_input.innerHTML = pool;
$.getJSON(vol_url, function(data) { $.getJSON(vol_url, function(data) {
if (data.length > 0) { if (data.length > 0) {