'+
- '
' +
- '
' +
+ '
' +
+ ' ' +
'
' +
'
'+
' '+
@@ -918,23 +918,22 @@ function generate_disk_tab_content(str_disk_tab_id, str_datatable_id){
'
'+
'
';
- $("#refresh_template_images_table_div_class"+str_disk_tab_id).die();
+ $("#refresh_template_images_table_button_class"+str_disk_tab_id).die();
- $("#refresh_template_images_table_div_class"+str_disk_tab_id).live('click', function(){
+ $("#refresh_template_images_table_button_class"+str_disk_tab_id).live('click', function(){
// Retrieve the images to fill the datatable
OpenNebula.Image.list({
timeout: true,
success: function (request, images_list){
- var image_list_array = [];
+ var image_list_array = [];
- $.each(images_list,function(){
- image_list_array.push(imageElementArray(this));
- });
-
- var dataTable_template_images = $("#datatable_template_images" + str_disk_tab_id.substring(4,str_disk_tab_id.length)).dataTable();
- updateView(image_list_array, dataTable_template_images);
- dataTable_template_images.fnFilter("OS|DATABLOCK|CDROM", 7, true);
- }
+ $.each(images_list,function(){
+ image_list_array.push(imageElementArray(this));
+ });
+
+ var dataTable_template_images = $('table[id='+str_datatable_id+']').dataTable();
+ updateView(image_list_array, dataTable_template_images);
+ }
});
}
);
@@ -1138,7 +1137,7 @@ function setup_disk_tab_content(disk_section, str_disk_tab_id, str_datatable_id)
function generate_nic_tab_content(str_nic_tab_id, str_datatable_id){
var html = '
'+
'
' +
- ' ' +
+ ' ' +
'
' +
'
'+
' '+
@@ -1269,6 +1268,25 @@ function generate_nic_tab_content(str_nic_tab_id, str_datatable_id){
'
'+
'
';
+ $("#refresh_template_nic_table_button_class"+str_nic_tab_id).die();
+
+ $("#refresh_template_nic_table_button_class"+str_nic_tab_id).live('click', function(){
+ // Retrieve the nics to fill the datatable
+ OpenNebula.Network.list({
+ timeout: true,
+ success: function (request, networks_list){
+ var network_list_array = [];
+
+ $.each(networks_list,function(){
+ network_list_array.push(vNetworkElementArray(this));
+ });
+ var dataTable_template_networks = $('table[id='+str_datatable_id+']').dataTable();
+ updateView(network_list_array, dataTable_template_networks);
+ }
+ });
+ }
+ );
+
return html;
}
@@ -1309,7 +1327,6 @@ function setup_nic_tab_content(nic_section, str_nic_tab_id, str_datatable_id) {
});
-
$('#'+str_nic_tab_id+'_search', nic_section).keyup(function(){
dataTable_template_networks.fnFilter( $(this).val() );
})
@@ -1697,11 +1714,15 @@ function setupCreateTemplateDialog(){
$(html_tab_content).appendTo($("ul#template_create_storage_tabs_content"));
var a = $("
\
- DISK \
+ DISK \
").appendTo($("dl#template_create_storage_tabs"));
$(document).foundationTabs("set_tab", a);
+ $("#disk_tab"+str_disk_tab_id).live('click', function(){
+ $("#refresh_template_images_table_button_class"+str_disk_tab_id).click();
+ });
+
var disk_section = $('li#' +str_disk_tab_id+'Tab', dialog);
setup_disk_tab_content(disk_section, str_disk_tab_id, str_datatable_id)
@@ -1763,38 +1784,21 @@ function setupCreateTemplateDialog(){
''
// Append the new div containing the tab and add the tab to the list
- var a = $("
NIC ").appendTo($("dl#template_create_network_tabs"));
+ var a = $("
NIC ").appendTo($("dl#template_create_network_tabs"));
$(html_tab_content).appendTo($("ul#template_create_network_tabs_content"));
$(document).foundationTabs("set_tab", a);
+ $('#nic_tab'+str_nic_tab_id).live('click', function(){
+ $("#refresh_template_nic_table_button_class"+str_nic_tab_id).click();
+ });
var nic_section = $('li#' + str_nic_tab_id + 'Tab', dialog);
setup_nic_tab_content(nic_section, str_nic_tab_id, str_datatable_id)
number_of_nics++;
nics_index++;
-
- $("refresh_template_nic_table_button_class"+str_nic_tab_id).die();
-
- $("refresh_template_nic_table_button_class"+str_nic_tab_id).live('click', function(){
- // Retrieve the images to fill the datatable
- OpenNebula.Network.list({
- timeout: true,
- success: function (request, images_list){
- var network_list_array = [];
-
- $.each(networks_list,function(){
- network_list_array.push(vNetworkElementArray(this));
- });
-
- var dataTable_template_networks = $("#datatable_template_networks"+str_nic_tab_id.substring(3,str_nic_tab_id.length)).dataTable();
- updateView(network_list_array, dataTable_template_networks);
- }
- });
- }
- );
}
@@ -1896,6 +1900,9 @@ function setupCreateTemplateDialog(){
'
'+
'
'+
'
'+
+ '
' +
+ ' ' +
+ '
' +
'
'+
' '+
'
'+
@@ -1953,6 +1960,9 @@ function setupCreateTemplateDialog(){
'
'+
'
'+
'
'+
+ '
' +
+ ' ' +
+ '
' +
'
'+
' '+
'
'+
@@ -2002,6 +2012,52 @@ function setupCreateTemplateDialog(){
''+
''
+ $("#refresh_kernel_table").die();
+
+ $("#refresh_kernel_table").live('click', function(){
+
+ OpenNebula.Image.list({
+ timeout: true,
+ success: function (request, images_list){
+ var image_list_array = [];
+
+ $.each(images_list,function(){
+ var file = fileElementArray(this);
+ if (file)
+ image_list_array.push(file);
+ });
+
+ var dataTable_template_kernel = $('#datatable_kernel').dataTable();
+ updateView(image_list_array, dataTable_template_kernel);
+ dataTable_template_kernel.fnFilter("KERNEL", 7)
+ },
+ error: onError
+ });
+ });
+
+ $("#refresh_ramdisk_table").die();
+
+ $("#refresh_ramdisk_table").live('click', function(){
+
+ OpenNebula.Image.list({
+ timeout: true,
+ success: function (request, images_list){
+ var image_list_array = [];
+
+ $.each(images_list,function(){
+ var file = fileElementArray(this);
+ if (file)
+ image_list_array.push(file);
+ });
+
+ var datTable_template_initrd = $('#datatable_initrd').dataTable();
+ updateView(image_list_array, datTable_template_initrd);
+ datTable_template_initrd.fnFilter("RAMDISK", 7)
+ },
+ error: onError
+ });
+ });
+
$("
OS Booting ").appendTo($("dl#template_create_tabs"));
$(html_tab_content).appendTo($("ul#template_create_tabs_content"));
@@ -2407,6 +2463,9 @@ function setupCreateTemplateDialog(){
''+
'
'+
''+
+ '
' +
+ ' ' +
+ '
' +
'
'+
' '+
'
'+
@@ -2474,6 +2533,26 @@ function setupCreateTemplateDialog(){
''+
''
+ $("#refresh_context_table").die();
+
+ $("#refresh_context_table").live('click', function(){
+ // Retrieve the nics to fill the datatable
+ OpenNebula.Image.list({
+ timeout: true,
+ success: function (request, files_list){
+ var files_list_array = [];
+
+ $.each(files_list,function(){
+ var image = fileElementArray(this);
+ if (image)
+ files_list_array.push(image);
+ });
+ var datTable_template_context = $('table[id="datatable_context"]').dataTable();
+ updateView(files_list_array, datTable_template_context);
+ },
+ error: onError
+ });
+ });
$("
Context ").appendTo($("dl#template_create_tabs"));
$(html_tab_content).appendTo($("ul#template_create_tabs_content"));
@@ -2657,6 +2736,9 @@ function setupCreateTemplateDialog(){
'
'+
'
'+
'
'+
+ '
' +
+ ' ' +
+ '
' +
'
'+
' '+
'
'+
@@ -2691,6 +2773,9 @@ function setupCreateTemplateDialog(){
'
'+
'
'+
'
'+
+ '
' +
+ ' ' +
+ '
' +
'
'+
' '+
'
'+
@@ -2767,6 +2852,28 @@ function setupCreateTemplateDialog(){
''+
''
+ $("#refresh_hosts_placement").die();
+
+ $("#refresh_hosts_placement").live('click', function(){
+ // Retrieve the hosts to fill the datatable
+ OpenNebula.Host.list({
+ timeout: true,
+ success: function (request, host_list){
+ var host_list_array = [];
+
+ $.each(host_list,function(){
+ //Grab table data from the host_list
+ host_list_array.push(hostElementArray(this));
+ });
+
+ var dataTable_template_hosts = $("#datatable_template_hosts",dialog).dataTable();
+ updateView(host_list_array, dataTable_template_hosts);
+ },
+ error: onError
+ });
+ }
+ );
+
$("
Scheduling ").appendTo($("dl#template_create_tabs"));
$(html_tab_content).appendTo($("ul#template_create_tabs_content"));
@@ -2873,6 +2980,29 @@ function setupCreateTemplateDialog(){
generate_requirements();
});
+ $("#refresh_clusters_placement").die();
+
+ $("#refresh_clusters_placement").live('click', function(){
+ // Retrieve the clusters to fill the datatable
+
+ OpenNebula.Cluster.list({
+ timeout: true,
+ success: function (request, cluster_list){
+ var list_array = [];
+
+ $.each(cluster_list,function(){
+ //Grab table data from the list
+ list_array.push(clusterElementArray(this));
+ });
+
+ var dataTable_template_clusters = $("#datatable_template_clusters",dialog).dataTable();
+ updateView(list_array,dataTable_template_clusters);
+ },
+ error: onError
+ });
+ }
+ );
+
// Clusters TABLE
dataTable_template_clusters = $("#datatable_template_clusters", dialog).dataTable({
"bSortClasses": false,