mirror of https://github.com/apache/cloudstack.git
new UI - host page - fix a bug that update OS preference after the 1st time was not working.
This commit is contained in:
parent
0c3305282d
commit
8eab360171
|
|
@ -356,12 +356,11 @@
|
|||
<li>
|
||||
<label>
|
||||
<%=t.t("OS.preference")%>:</label>
|
||||
<select class="select" name="host_os" id="host_os">
|
||||
<option value="">
|
||||
<%=t.t("none")%></option>
|
||||
<select class="select" name="host_os" id="host_os">
|
||||
</select>
|
||||
</li>
|
||||
</ol>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -178,7 +178,8 @@ function populateForUpdateOSDialog(oscategoryid) {
|
|||
dataType: "json",
|
||||
success: function(json) {
|
||||
var categories = json.listoscategoriesresponse.oscategory;
|
||||
var select = $("#dialog_update_os #host_os");
|
||||
var select = $("#dialog_update_os #host_os").empty();
|
||||
select.append("<option value=''>None</option>");
|
||||
if (categories != null && categories.length > 0) {
|
||||
for (var i = 0; i < categories.length; i++) {
|
||||
if(categories[i].id == oscategoryid) {
|
||||
|
|
@ -330,16 +331,15 @@ function doUpdateOSPreference($actionLink, $detailsTab, $midmenuItem1){
|
|||
$("#dialog_update_os")
|
||||
.dialog("option", "buttons", {
|
||||
"Update": function() {
|
||||
$(this).dialog("close");
|
||||
var osId = $("#dialog_update_os #host_os").val();
|
||||
var osName = $("#dialog_update_os #host_os option:selected").text();
|
||||
var category = "";
|
||||
if (osId.length > 0) {
|
||||
category = "&osCategoryId="+osId;
|
||||
}
|
||||
var id = jsonObj.id;
|
||||
|
||||
var apiCommand = "command=updateHost&id="+id+category;
|
||||
var $thisDialog = $(this);
|
||||
$thisDialog.dialog("close");
|
||||
var osId = $thisDialog.find("#host_os").val();
|
||||
var osName =$thisDialog.find("#host_os option:selected").text();
|
||||
if (osId == null || osId.length == 0)
|
||||
return;
|
||||
|
||||
var id = jsonObj.id;
|
||||
var apiCommand = "command=updateHost&id="+id+"&osCategoryId="+osId;
|
||||
doActionToDetailsTab(id, $actionLink, apiCommand, $midmenuItem1, $detailsTab);
|
||||
},
|
||||
"Cancel": function() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue