1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-23 22:50:09 +03:00

Merge branch 'sunstone' of opennebula.org:one-ui into sunstone

This commit is contained in:
Jaime Melis 2011-02-24 14:04:16 +01:00
commit 2ec18b6be6

View File

@ -2423,10 +2423,16 @@ function vNetworkInfoListener(){
function userElementArray(user_json){
user = user_json.USER;
if (!user.NAME || user.NAME == {}){
name = "";
} else {
name = user.NAME;
}
return [
'<input type="checkbox" id="user_'+user.ID+'" name="selected_items" value="'+user.ID+'"/>',
user.ID,
user.NAME
name
]
}
@ -2501,7 +2507,9 @@ function updateImageSelect(image_list){
images_select="";
images_select += "<option value=\"\">Select an image</option>";
$.each(image_list, function(){
images_select += "<option value=\""+this.IMAGE.NAME+"\">"+this.IMAGE.NAME+"</option>";
if ((this.IMAGE.STATE < 3) && (this.IMAGE.STATE > 0)){
images_select += '<option id="img_sel_'+this.IMAGE.ID+'" value="'+this.IMAGE.NAME+'">'+this.IMAGE.NAME+'</option>';
}
});
//update static selectors
@ -2830,18 +2838,32 @@ function updateImageElement(request, image_json){
id = image_json.IMAGE.ID;
element = imageElementArray(image_json);
updateSingleElement(element,dataTable_images,'#image_'+id);
if ((image_json.IMAGE.STATE < 3) &&
(image_json.IMAGE.STATE > 0) &&
($('#img_sel_'+id,images_select).length == 0)){
images_select += '<option id="img_sel_'+id+'" value="'+image_json.IMAGE.NAME+'">'+image_json.IMAGE.NAME+'</option>';
}
else {
tag = 'option#img_sel_'+id;
select = $('<select>'+images_select+'</select>');
$(tag,select).remove();
images_select = $(select).html();
}
$('div.vm_section#disks select#IMAGE').html(images_select);
}
function deleteImageElement(req){
deleteElement(dataTable_images,'#image_'+req.request.data);
//how to update the image select here?
tag = 'option#img_sel_'+req.request.data;
select = $('<select>'+images_select+'</select>');
$(tag,select).remove();
images_select = $(select).html();
$('div.vm_section#disks select#IMAGE').html(images_select);
}
function addImageElement(request, image_json){
element = imageElementArray(image_json);
addElement(element,dataTable_images);
images_select += "<option value=\""+image_json.IMAGE.NAME+"\">"+image_json.IMAGE.NAME+"</option>";
$('div.vm_section#disks select#IMAGE').html(images_select);
}
function updateImagesView(request, images_list){