\
\
\
@@ -26,7 +26,7 @@ var infra_tab_content =
\
\
\
- \
+ \
' + tr("Clusters") + ' \
\
\
@@ -54,7 +54,7 @@ var infra_tab_content =
' + tr("Quickstart") + ' \
\
\
- '+tr("Create new Cluster")+' \
+ '+tr("Create new Cluster")+' \
'+tr("Create new Host")+' \
'+tr("Create new Datastore")+' \
'+tr("Create new Virtual Network")+' \
@@ -72,7 +72,7 @@ var infra_tab_content =
\
' + tr("Infrastructure resources") + ' \
\
-
'+tr("The Infrastructure menu allows management of Hosts, Datastores, Virtual Networks and the Clusters they are placed in. The Clusters node can be expanded, and resources can be managed for each cluster.")+'
\
+
'+tr("The Infrastructure menu allows management of Hosts, Datastores, Virtual Networks. Users in the oneadmin group can manage clusters as well.")+'
\
'+tr("You can find further information on the following links:")+'
\
\
Host subsystem \
@@ -117,5 +117,6 @@ function updateInfraDashboard(what,json_info){
};
$(document).ready(function(){
-
+ if (!mustBeAdmin())
+ $('table#infra_dashboard .cluster_related', main_tabs_context).hide();
});
\ No newline at end of file
diff --git a/src/sunstone/public/js/plugins/templates-tab.js b/src/sunstone/public/js/plugins/templates-tab.js
index f7496b0892..e56070b9c9 100644
--- a/src/sunstone/public/js/plugins/templates-tab.js
+++ b/src/sunstone/public/js/plugins/templates-tab.js
@@ -186,7 +186,7 @@ var create_template_tmpl = '\
'+tr("Add disks/images")+' \
\
'+tr("Disks")+' \
- \
+
\
'+tr("Add disk/image")+' \
'+tr("Disk")+'\
\
@@ -228,6 +228,11 @@ var create_template_tmpl = '
\
\
'+tr("Disk file location path or URL")+'
\
\
+
\
+
'+tr("Transfer Manager")+': \
+
\
+
'+tr("shared,ssh,iscsi,dummy")+'
\
+
\
\
\
'+tr("Size")+': \
@@ -283,7 +288,7 @@ var create_template_tmpl = '
\
'+tr("Setup Networks")+' \
\
'+tr("Network")+' \
- \
+
\
'+tr("Add network")+' \
'+tr("Predefined")+'\
\
@@ -324,7 +329,7 @@ var create_template_tmpl = '
\
\
'+tr("Name of a shell script to be executed after creating the tun device for the VM")+'
\
\
-
\
+
\
'+tr("Model")+': \
\
'+tr("Hardware that will emulate this network interface. With Xen this is the type attribute of the vif.")+'
\
@@ -720,7 +725,7 @@ var template_actions = {
"Template.delete" : {
type: "multiple",
- call: OpenNebula.Template.delete,
+ call: OpenNebula.Template.del,
callback: deleteTemplateElement,
elements: templateElements,
error: onError,
@@ -1406,7 +1411,7 @@ function setupCreateTemplateDialog(){
$('#image_vs_disk input',section_disks).click(function(){
//$('fieldset',section_disks).show();
$('.vm_param', section_disks).show();
- var select = $('#image_vs_disk :checked',section_disks).val();
+ var select = $(this).val();
switch (select)
{
case "disk":
@@ -1540,7 +1545,11 @@ function setupCreateTemplateDialog(){
box_remove_element(section_disks,'#disks_box');
return false;
});
- };
+
+ //preselect now hidden option
+ $('#image_vs_disk input#add_image',section_disks).trigger('click');
+
+ };
// Sets up the network section
var networks_setup = function(){
@@ -1570,7 +1579,7 @@ function setupCreateTemplateDialog(){
$('.firewall_select',section_networks).show();
$('.firewall_select select option',section_networks).removeAttr('selected');
- select = $('#network_vs_niccfg :checked',section_networks).val();
+ select = $(this).val();
switch (select) {
case "network":
$('.niccfg',section_networks).hide();
@@ -1648,6 +1657,8 @@ function setupCreateTemplateDialog(){
return false;
});
+ //preselect now hidden option
+ $('#network_vs_niccfg input#add_network',section_networks).trigger('click');
};
//Sets up the input section - basicly enabling adding and removing from box
diff --git a/src/sunstone/public/js/plugins/users-tab.js b/src/sunstone/public/js/plugins/users-tab.js
index 906004e77d..720c8d3a70 100644
--- a/src/sunstone/public/js/plugins/users-tab.js
+++ b/src/sunstone/public/js/plugins/users-tab.js
@@ -197,7 +197,7 @@ var user_actions = {
"User.delete" : {
type: "multiple",
- call: OpenNebula.User.delete,
+ call: OpenNebula.User.del,
callback: deleteUserElement,
elements: userElements,
error: onError,
diff --git a/src/sunstone/public/js/plugins/vms-tab.js b/src/sunstone/public/js/plugins/vms-tab.js
index ff5815c3fe..0743c1208c 100644
--- a/src/sunstone/public/js/plugins/vms-tab.js
+++ b/src/sunstone/public/js/plugins/vms-tab.js
@@ -63,6 +63,7 @@ var vms_tab_content =
'+tr("CPU")+' \
'+tr("Memory")+' \
'+tr("Hostname")+' \
+
'+tr("IPs")+' \
'+tr("Start Time")+' \
'+tr("VNC Access")+' \
\
@@ -353,7 +354,7 @@ var vm_actions = {
"VM.delete" : {
type: "multiple",
- call: OpenNebula.VM.delete,
+ call: OpenNebula.VM.del,
callback: deleteVMachineElement,
elements: vmElements,
error: onError,
@@ -592,6 +593,10 @@ var vm_info_panel = {
"vm_log_tab" : {
title: tr("VM log"),
content: ""
+ },
+ "vm_history_tab" : {
+ title: tr("History information"),
+ content: "",
}
}
@@ -619,7 +624,21 @@ function vmShow(req) {
// Returns a human readable running time for a VM
function str_start_time(vm){
return pretty_time(vm.STIME);
-}
+};
+
+function ip_str(vm){
+ var nic = vm.TEMPLATE.NIC;
+ var ip = '--';
+ if ($.isArray(nic)) {
+ ip = '';
+ $.each(nic, function(index,value){
+ ip += value.IP+'
';
+ });
+ } else if (nic && nic.IP) {
+ ip = nic.IP;
+ };
+ return ip;
+};
// Returns an array formed by the information contained in the vm_json
// and ready to be introduced in a dataTable
@@ -650,10 +669,11 @@ function vMachineElementArray(vm_json){
vm.CPU,
humanize_size(vm.MEMORY),
hostname,
+ ip_str(vm),
str_start_time(vm),
vncIcon(vm)
];
-}
+};
//Creates a listener for the TDs of the VM table
@@ -703,7 +723,69 @@ function updateVMachinesView(request, vmachine_list){
updateView(vmachine_list_array,dataTable_vMachines);
updateDashboard("vms",vmachine_list);
updateVResDashboard("vms",vmachine_list);
-}
+};
+
+function generateHistoryTable(vm){
+ var html = '
\
+ \
+ \
+ '+tr("Sequence")+' \
+ '+tr("Hostname")+' \
+ '+tr("Reason")+' \
+ '+tr("State change time")+' \
+ '+tr("Total time")+' \
+ '+tr("Prolog time")+' \
+ \
+ \
+ ';
+
+ var history = [];
+
+ if ($.isArray(vm.HISTORY_RECORDS.HISTORY))
+ history = vm.HISTORY_RECORDS.HISTORY;
+ else if (vm.HISTORY_RECORDS.HISTORY.SEQ)
+ history = [vm.HISTORY_RECORDS.HISTORY];
+
+ var now = Math.round(new Date().getTime() / 1000);
+
+ for (var i=0; i < history.length; i++){
+ // :TIME time calculations copied from onevm_helper.rb
+ var stime = parseInt(history[i].STIME, 10);
+
+ var etime = parseInt(history[i].ETIME, 10)
+ etime = etime == 0 ? now : etime;
+
+ var dtime = etime - stime;
+ // end :TIME
+
+ //:PTIME
+ var stime2 = parseInt(history[i].PSTIME, 10);
+ var etime2;
+ var ptime2 = parseInt(history[i].PETIME, 10);
+ if (stime2 == 0)
+ etime2 = 0;
+ else
+ etime2 = ptime2 == 0 ? now : ptime2;
+ var dtime2 = etime2 - stime2;
+
+ //end :PTIME
+
+
+ html += ' \
+ '+history[i].SEQ+' \
+ '+history[i].HOSTNAME+' \
+ '+OpenNebula.Helper.resource_state("VM_MIGRATE_REASON",parseInt(history[i].REASON, 10))+' \
+ '+pretty_time(history[i].STIME)+' \
+ '+pretty_time_runtime(dtime)+' \
+ '+pretty_time_runtime(dtime2)+' \
+ \
+ '
+ };
+ html += ' \
+
';
+ return html;
+
+};
// Refreshes the information panel for a VM
@@ -805,7 +887,7 @@ function updateVMInfo(request,vm){
\
\
'
- }
+ };
var template_tab = {
title: tr("VM Template"),
@@ -814,21 +896,27 @@ function updateVMInfo(request,vm){
'+tr("VM template")+' '+
prettyPrintJSON(vm_info.TEMPLATE)+
'
'
- }
+ };
var log_tab = {
title: tr("VM log"),
content: ''+spinner+'
'
- }
+ };
var monitoring_tab = {
title: tr("Monitoring information"),
content: generateMonitoringDivs(vm_graphs,"vm_monitor_")
- }
+ };
+
+ var history_tab = {
+ title: tr("History information"),
+ content: generateHistoryTable(vm_info),
+ };
Sunstone.updateInfoPanelTab("vm_info_panel","vm_info_tab",info_tab);
Sunstone.updateInfoPanelTab("vm_info_panel","vm_template_tab",template_tab);
Sunstone.updateInfoPanelTab("vm_info_panel","vm_log_tab",log_tab);
+ Sunstone.updateInfoPanelTab("vm_info_panel","vm_history_tab",history_tab);
Sunstone.updateInfoPanelTab("vm_info_panel","vm_monitoring_tab",monitoring_tab);
//Pop up the info panel and asynchronously get vm_log and stats
@@ -1284,9 +1372,9 @@ $(document).ready(function(){
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check"] },
{ "sWidth": "60px", "aTargets": [0,6,7] },
- { "sWidth": "35px", "aTargets": [1,10] },
- { "sWidth": "150px", "aTargets": [5,9] },
- { "sWidth": "100px", "aTargets": [2,3] }
+ { "sWidth": "35px", "aTargets": [1,11] },
+ { "sWidth": "150px", "aTargets": [5,10] },
+ { "sWidth": "100px", "aTargets": [2,3,9] }
],
"oLanguage": (datatable_lang != "") ?
{
@@ -1297,7 +1385,7 @@ $(document).ready(function(){
dataTable_vMachines.fnClearTable();
addElement([
spinner,
- '','','','','','','','','',''],dataTable_vMachines);
+ '','','','','','','','','','',''],dataTable_vMachines);
Sunstone.runAction("VM.list");
setupCreateVMDialog();
diff --git a/src/sunstone/public/js/plugins/vnets-tab.js b/src/sunstone/public/js/plugins/vnets-tab.js
index d65f672ebe..f5047ebd87 100644
--- a/src/sunstone/public/js/plugins/vnets-tab.js
+++ b/src/sunstone/public/js/plugins/vnets-tab.js
@@ -283,7 +283,7 @@ var vnet_actions = {
"Network.delete" : {
type: "multiple",
- call: OpenNebula.Network.delete,
+ call: OpenNebula.Network.del,
callback: deleteVNetworkElement,
elements: vnElements,
error: onError,
@@ -566,7 +566,7 @@ function updateVNetworkInfo(request,vn){
\