diff --git a/src/sunstone/public/js/sunstone.js b/src/sunstone/public/js/sunstone.js
index 1ee7926d6a..85a14cef1e 100644
--- a/src/sunstone/public/js/sunstone.js
+++ b/src/sunstone/public/js/sunstone.js
@@ -3986,6 +3986,34 @@ function accountingGraphs(div, opt){
\
+ \
+
\
+ \
+
\
+
\
+ \
+ \
+ '+tr("Date")+' | \
+
\
+ \
+ \
+ \
+
\
+
\
+ \
+
\
+ \
+
\
+
\
+ \
+ \
+ '+tr("Date")+' | \
+
\
+ \
+ \
+ \
+
\
');
if (opt == undefined){
@@ -4133,6 +4161,8 @@ Filter by: user, group, vm, [flow]
Download csv
*/
+ // TODO: Uniform time format (yy/mm/dd?) and define the time zone (utc, local?)
+
var options = req.request.data[0];
//--------------------------------------------------------------------------
@@ -4372,7 +4402,7 @@ Download csv
});
});
- $.plot($("#acct_cpu_graph", div), plot_series, options);
+ var cpu_plot = $.plot($("#acct_cpu_graph", div), plot_series, options);
// --- mem ---
@@ -4485,4 +4515,99 @@ Download csv
}
$.plot($("#acct_activity_graph", div), plot_series, options);
+
+ //--------------------------------------------------------------------------
+ // Init dataTables
+ //--------------------------------------------------------------------------
+
+ $("#acct_cpu_datatable",div).dataTable().fnClearTable();
+ $("#acct_cpu_datatable",div).dataTable().fnDestroy();
+
+ $("#acct_cpu_datatable thead",div).remove();
+
+
+ $("#acct_mem_datatable",div).dataTable().fnClearTable();
+ $("#acct_mem_datatable",div).dataTable().fnDestroy();
+
+ $("#acct_mem_datatable thead",div).remove();
+
+
+ cpu_plot_data = cpu_plot.getData();
+ mem_plot_data = mem_plot.getData();
+
+ var thead = ''+tr("Date")+' | ';
+
+ $.each(series.CPU_HOURS, function(key, val){
+ thead += ''+group_by_prefix+key+' | ';
+ });
+
+ thead += '
';
+
+ $("#acct_cpu_datatable",div).append(thead);
+
+ thead = ''+tr("Date")+' | ';
+
+ $.each(series.MEM_HOURS, function(key, val){
+ thead += ''+group_by_prefix+key+' | ';
+ });
+
+ thead += '
';
+
+ $("#acct_mem_datatable",div).append(thead);
+
+
+ var cpu_dataTable_data = [];
+ var mem_dataTable_data = [];
+
+ for (var i = 0; i