mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-26 06:50:09 +03:00
feature #1279: fix individual plots in sunstone
disable dashboards plots. set minimum graph value to 0. (cherry picked from commit dc418e50973cc15dc84724bdc42f15a65d18bc56)
This commit is contained in:
parent
13ad8d14b6
commit
0dcbe6ba1b
@ -20,13 +20,13 @@ var GRAPH_AUTOREFRESH_INTERVAL=60000; //60 secs
|
||||
|
||||
var graph1 = {
|
||||
title : "graph1",
|
||||
monitor_resources : "CPU_USAGE,USED_CPU,MAX_CPU",
|
||||
monitor_resources : "HOST_SHARE/CPU_USAGE,HOST_SHARE/USED_CPU,HOST_SHARE/MAX_CPU",
|
||||
history_length : HISTORY_LENGTH
|
||||
};
|
||||
|
||||
var graph2 = {
|
||||
title : "graph2",
|
||||
monitor_resources : "MEM_USAGE,USED_MEM,MAX_MEM",
|
||||
monitor_resources : "HOST_SHARE/MEM_USAGE,HOST_SHARE/USED_MEM,HOST_SHARE/MAX_MEM",
|
||||
history_length : HISTORY_LENGTH
|
||||
};
|
||||
|
||||
@ -134,6 +134,7 @@ var dashboard_tab_content =
|
||||
<div class="panel">\
|
||||
<h3>' + tr("Historical monitoring information") + '</h3>\
|
||||
<div class="panel_info">\
|
||||
<!--\
|
||||
<table class="info_table">\
|
||||
<tr><td class="key_td graph_td">' + tr("Hosts CPU") + '</td>\
|
||||
<td class="graph_td" id="graph1_legend"></td></tr>\
|
||||
@ -148,6 +149,7 @@ var dashboard_tab_content =
|
||||
<td class="graph_td" id="graph4_legend"></td></tr>\
|
||||
<tr><td id="graph4" colspan="2">'+spinner+'</td></tr>\
|
||||
</table>\
|
||||
-->\
|
||||
</div>\
|
||||
</div>\
|
||||
</td>\
|
||||
@ -218,17 +220,17 @@ function graph_autorefresh(){
|
||||
}
|
||||
|
||||
function refresh_graphs(){
|
||||
// Sunstone.runAction("Host.monitor_all", graph1);
|
||||
// Sunstone.runAction("Host.monitor_all", graph2);
|
||||
// Sunstone.runAction("VM.monitor_all", graph3);
|
||||
// Sunstone.runAction("VM.monitor_all", graph4);
|
||||
Sunstone.runAction("Host.monitor_all", graph1);
|
||||
Sunstone.runAction("Host.monitor_all", graph2);
|
||||
Sunstone.runAction("VM.monitor_all", graph3);
|
||||
Sunstone.runAction("VM.monitor_all", graph4);
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
emptyDashboard();
|
||||
|
||||
refresh_graphs();
|
||||
graph_autorefresh();
|
||||
// refresh_graphs();
|
||||
// graph_autorefresh();
|
||||
|
||||
});
|
||||
|
||||
|
@ -107,6 +107,7 @@ var dashboard_tab_content =
|
||||
<div class="panel">\
|
||||
<h3>'+tr("Historical monitoring information")+'</h3>\
|
||||
<div class="panel_info">\
|
||||
<!--\
|
||||
<table class="info_table">\
|
||||
<tr><td class="key_td graph_td">'+tr("Total VM count")+'</td>\
|
||||
<td class="graph_td" id="graph1_legend"></td></tr>\
|
||||
@ -121,6 +122,7 @@ var dashboard_tab_content =
|
||||
<td class="graph_td" id="graph4_legend"></td></tr>\
|
||||
<tr><td id="graph4" colspan="2">'+spinner+'</td></tr>\
|
||||
</table>\
|
||||
-->\
|
||||
</div>\
|
||||
</div>\
|
||||
</td>\
|
||||
|
@ -27,7 +27,7 @@ var host_graphs = [
|
||||
{
|
||||
title: tr("Memory monitoring information"),
|
||||
monitor_resources : "HOST_SHARE/MEM_USAGE,HOST_SHARE/USED_MEM,HOST_SHARE/MAX_MEM",
|
||||
humanize_figures : false,
|
||||
humanize_figures : true,
|
||||
history_length : HOST_HISTORY_LENGTH
|
||||
}
|
||||
]
|
||||
@ -531,7 +531,7 @@ function updateHostInfo(request,host){
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">' + tr("Used Mem (allocated)") + '</td>\
|
||||
<td class="value_td">'+humanize_size(host_info.HOST_SHARE.MAX_USAGE)+'</td>\
|
||||
<td class="value_td">'+humanize_size(host_info.HOST_SHARE.MEM_USAGE)+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">' + tr("Max CPU") + '</td>\
|
||||
|
@ -26,22 +26,22 @@ loadVNC();
|
||||
|
||||
var vm_graphs = [
|
||||
{ title : tr("CPU"),
|
||||
monitor_resources : "cpu_usage",
|
||||
monitor_resources : "CPU",
|
||||
humanize_figures : false,
|
||||
history_length : VM_HISTORY_LENGTH
|
||||
},
|
||||
{ title : tr("Memory"),
|
||||
monitor_resources : "mem_usage",
|
||||
monitor_resources : "MEMORY",
|
||||
humanize_figures : true,
|
||||
history_length : VM_HISTORY_LENGTH
|
||||
},
|
||||
{ title : tr("Network transmission"),
|
||||
monitor_resources : "net_tx",
|
||||
monitor_resources : "NET_TX",
|
||||
humanize_figures : true,
|
||||
history_length : VM_HISTORY_LENGTH
|
||||
},
|
||||
{ title : tr("Network reception"),
|
||||
monitor_resources : "net_rx",
|
||||
monitor_resources : "NET_RX",
|
||||
humanize_figures : true,
|
||||
history_length : VM_HISTORY_LENGTH
|
||||
}
|
||||
|
@ -605,6 +605,7 @@ function generateMonitoringDivs(graphs, id_prefix){
|
||||
$.each(graphs,function(){
|
||||
label = this.monitor_resources;
|
||||
id_suffix=label.replace(/,/g,'_');
|
||||
id_suffix=id_suffix.replace(/\//g,'_');
|
||||
id = id_prefix+id_suffix;
|
||||
str+='<table class="info_table">\
|
||||
<thead><tr><th colspan="1">'+this.title+'</th></tr></thead>\
|
||||
@ -628,6 +629,7 @@ function plot_graph(data,context,id_prefix,info){
|
||||
var humanize = info.humanize_figures ?
|
||||
humanize_size : function(val){ return val };
|
||||
var id_suffix = labels.replace(/,/g,'_');
|
||||
id_suffix = id_suffix.replace(/\//g,'_');
|
||||
var labels_array = labels.split(',');
|
||||
var monitoring = data.monitoring
|
||||
var series = [];
|
||||
@ -661,7 +663,8 @@ function plot_graph(data,context,id_prefix,info){
|
||||
yaxis : { labelWidth: 40,
|
||||
tickFormatter: function(val, axis) {
|
||||
return humanize(val);
|
||||
}
|
||||
},
|
||||
min: 0
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user