diff --git a/src/sunstone/public/js/plugins/hosts-tab.js b/src/sunstone/public/js/plugins/hosts-tab.js index 016dc76fc8..1eb0b0fcd7 100644 --- a/src/sunstone/public/js/plugins/hosts-tab.js +++ b/src/sunstone/public/js/plugins/hosts-tab.js @@ -802,12 +802,76 @@ function updateHostInfo(request,host){ ' } + var vms_info_tab = { + title: tr("VMs"), + icon: "fa-cloud", + content : '
\ +
\ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ +
'+tr("ID")+''+tr("Owner")+''+tr("Group")+''+tr("Name")+''+tr("Status")+''+tr("Used CPU")+''+tr("Used Memory")+''+tr("Host")+''+tr("IPs")+''+tr("Start Time")+''+tr("VNC")+'
\ +
\ +
' + } + //Sunstone.updateInfoPanelTab(info_panel_name,tab_name, new tab object); Sunstone.updateInfoPanelTab("host_info_panel","host_info_tab",info_tab); Sunstone.updateInfoPanelTab("host_info_panel","host_monitoring_tab",monitor_tab); + Sunstone.updateInfoPanelTab("host_info_panel","host_vms_tab",vms_info_tab); Sunstone.popUpInfoPanel("host_info_panel", "hosts-tab"); + var dataTable_vMachines = $("#datatable_host_vms", $("#host_info_panel")).dataTable({ + "aoColumnDefs": [ + { "bSortable": false, "aTargets": ["check",6,7,11] }, + { "sWidth": "35px", "aTargets": [0] }, + { "bVisible": false, "aTargets": [0]}, + { "bVisible": true, "aTargets": Config.tabTableColumns("vms-tab")}, + { "bVisible": false, "aTargets": ['_all']}, + ] + }); + + if (host_info.VMS) { + OpenNebula.VM.list({ + timeout: true, + success: function (request, vm_list){ + var vm_list_array = []; + + $.each(vm_list,function(){ + //Grab table data from the vm_list + vm_list_array.push(vMachineElementArray(this)); + }); + + updateView(vm_list_array, dataTable_vMachines); + }, + error: onError + }); + + var vm_ids = host_info.VMS.ID; + if (vm_ids instanceof Array) { + dataTable_vMachines.fnFilter(vm_ids.join('|'), 1, true) + } else { + dataTable_vMachines.fnFilter(vm_ids, 1) + } + } + // TODO: re-use Host.pool_monitor data? //pop up panel while we retrieve the graphs