aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorVincent Brillault2013-12-16 21:44:16 +0100
committerPim van den Berg2014-01-12 14:35:01 +0100
commit266ed19efca221b91cb7cb77261258e32f0e4153 (patch)
tree87b819ffcf547859b4b73e8f3f3f57628542968c
parentMerge pull request #41 from oohlaf/nginx (diff)
downloadapt-panopticon_cgp-266ed19efca221b91cb7cb77261258e32f0e4153.zip
apt-panopticon_cgp-266ed19efca221b91cb7cb77261258e32f0e4153.tar.gz
apt-panopticon_cgp-266ed19efca221b91cb7cb77261258e32f0e4153.tar.bz2
apt-panopticon_cgp-266ed19efca221b91cb7cb77261258e32f0e4153.tar.xz
jsrrdgraph: RrdDataFile.js: fix space/tabulation
-rw-r--r--js/RrdDataFile.js42
1 files changed, 21 insertions, 21 deletions
diff --git a/js/RrdDataFile.js b/js/RrdDataFile.js
index ae4dcff..ebe0857 100644
--- a/js/RrdDataFile.js
+++ b/js/RrdDataFile.js
@@ -25,7 +25,7 @@
25 * @constructor 25 * @constructor
26 */ 26 */
27var RrdDataFile = function() { 27var RrdDataFile = function() {
28 this.init.apply(this, arguments); 28 this.init.apply(this, arguments);
29}; 29};
30 30
31RrdDataFile.prototype = { 31RrdDataFile.prototype = {
@@ -37,15 +37,15 @@ RrdDataFile.prototype = {
37 }, 37 },
38 fetch: function(gdp, ft_step) 38 fetch: function(gdp, ft_step)
39 { 39 {
40 var cal_start, cal_end; 40 var cal_start, cal_end;
41 var best_full_rra = 0, best_part_rra = 0, chosen_rra = 0; 41 var best_full_rra = 0, best_part_rra = 0, chosen_rra = 0;
42 var best_full_step_diff = 0, best_part_step_diff = 0, tmp_step_diff = 0, tmp_match = 0, best_match = 0; 42 var best_full_step_diff = 0, best_part_step_diff = 0, tmp_step_diff = 0, tmp_match = 0, best_match = 0;
43 var full_match, rra_base; 43 var full_match, rra_base;
44 var first_full = 1; 44 var first_full = 1;
45 var first_part = 1; 45 var first_part = 1;
46 var rrd; 46 var rrd;
47 var data_ptr; 47 var data_ptr;
48 var rows; 48 var rows;
49 49
50 if (gdp.rrd in this.rrdfiles) { 50 if (gdp.rrd in this.rrdfiles) {
51 rrd = this.rrdfiles[gdp.rrd]; 51 rrd = this.rrdfiles[gdp.rrd];
@@ -59,7 +59,7 @@ RrdDataFile.prototype = {
59 var ds_cnt = rrd.getNrDSs(); 59 var ds_cnt = rrd.getNrDSs();
60 var rra_cnt = rrd.getNrRRAs(); 60 var rra_cnt = rrd.getNrRRAs();
61 61
62 for (var i = 0; i < ds_cnt; i++) 62 for (var i = 0; i < ds_cnt; i++)
63 gdp.ds_namv[i] = rrd.rrd_header.getDSbyIdx(i).getName(); 63 gdp.ds_namv[i] = rrd.rrd_header.getDSbyIdx(i).getName();
64 64
65 for (var i = 0; i < rra_cnt; i++) { 65 for (var i = 0; i < rra_cnt; i++) {
@@ -97,18 +97,18 @@ RrdDataFile.prototype = {
97 var rra = rrd.getRRA(chosen_rra); 97 var rra = rrd.getRRA(chosen_rra);
98 98
99 ft_step = rrd.rrd_header.pdp_step * rra_info.getPdpPerRow(); 99 ft_step = rrd.rrd_header.pdp_step * rra_info.getPdpPerRow();
100 gdp.start -= (gdp.start % ft_step); 100 gdp.start -= (gdp.start % ft_step);
101 gdp.end += (ft_step - gdp.end % ft_step); 101 gdp.end += (ft_step - gdp.end % ft_step);
102 rows = (gdp.end - gdp.start) / ft_step + 1; 102 rows = (gdp.end - gdp.start) / ft_step + 1;
103 103
104 gdp.ds_cnt = ds_cnt; 104 gdp.ds_cnt = ds_cnt;
105 data_ptr = 0; 105 data_ptr = 0;
106 106
107 var rra_end_time = (rrd.getLastUpdate() - (rrd.getLastUpdate() % ft_step)); 107 var rra_end_time = (rrd.getLastUpdate() - (rrd.getLastUpdate() % ft_step));
108 var rra_start_time = (rra_end_time - (ft_step * (rra_info.row_cnt - 1))); 108 var rra_start_time = (rra_end_time - (ft_step * (rra_info.row_cnt - 1)));
109 /* here's an error by one if we don't be careful */ 109 /* here's an error by one if we don't be careful */
110 var start_offset = (gdp.start + ft_step - rra_start_time) / ft_step; 110 var start_offset = (gdp.start + ft_step - rra_start_time) / ft_step;
111 var end_offset = (rra_end_time - gdp.end) / ft_step; 111 var end_offset = (rra_end_time - gdp.end) / ft_step;
112 112
113 gdp.data = []; 113 gdp.data = [];
114 114
@@ -117,7 +117,7 @@ RrdDataFile.prototype = {
117 for (var ii = 0; ii < ds_cnt; ii++) 117 for (var ii = 0; ii < ds_cnt; ii++)
118 gdp.data[data_ptr++] = Number.NaN; 118 gdp.data[data_ptr++] = Number.NaN;
119 } else if (i >= rra.row_cnt) { 119 } else if (i >= rra.row_cnt) {
120 for (var ii = 0; ii < ds_cnt; ii++) 120 for (var ii = 0; ii < ds_cnt; ii++)
121 gdp.data[data_ptr++] = Number.NaN; 121 gdp.data[data_ptr++] = Number.NaN;
122 } else { 122 } else {
123 for (var ii = 0; ii < ds_cnt; ii++) 123 for (var ii = 0; ii < ds_cnt; ii++)