reference to error function of state, fixed
Costa Tsaousis (ktsaou) committed
Dec 30, 2015 at 03:38 UTC
ff5b264904f21e2d070445be103dc93bf65b5660
2 files changed
+28
-25
web/dashboard.js
+27
-24
@@ -281,7 +281,7 @@
281
if(typeof value === 'undefined' || value === 'undefined') {
282
console.log('localStorage: ATTEMPT TO SET UNDEFINED "' + key.toString() + '" as value ' + value + ' of type ' + typeof(value));
283
}
284
-
284
+
285
if(typeof NETDATA.localStorage.default[key.toString()] === 'undefined') {
286
NETDATA.localStorage.default[key.toString()] = value;
287
NETDATA.localStorage.current[key.toString()] = value;
@@ -590,7 +590,7 @@
590
this.name_div = null;
591
this.value_div = null;
592
this.color = '#000';
593
-
593
+
594
if(parent.selected === parent.unselected)
595
this.selected = true;
596
else
@@ -676,7 +676,7 @@
676
ds.parent.state.redrawChart();
677
}
678
}
679
-
679
+
680
dimensionStatus.prototype.select = function() {
681
if(this.enabled === false) return;
682
@@ -684,7 +684,7 @@
684
this.value_div.className = 'netdata-legend-value selected';
685
this.selected = true;
686
}
687
-
687
+
688
dimensionStatus.prototype.unselect = function() {
689
if(this.enabled === false) return;
690
@@ -692,11 +692,11 @@
692
this.value_div.className = 'netdata-legend-value hidden';
693
this.selected = false;
694
}
695
-
695
+
696
dimensionStatus.prototype.isSelected = function() {
697
return(this.enabled === true && this.selected === true);
698
}
699
-
699
+
700
// ----------------------------------------------------------------------------------------------------------------
701
702
dimensionsVisibility = function(state) {
@@ -1152,7 +1152,7 @@
1152
that.___chartIsHidden___ = true;
1153
}
1154
}
1155
-
1155
+
1156
// unhide the chart, when it is visible - called from isVisible()
1157
var unhideChart = function() {
1158
if(typeof that.___chartIsHidden___ !== 'undefined') {
@@ -1317,6 +1317,10 @@
1317
// ============================================================================================================
1318
// PUBLIC FUNCTIONS
1319
1320
+ this.error = function(msg) {
1321
+ error(msg);
1322
+ }
1323
+
1324
this.setMode = function(m) {
1325
if(this.current !== null && this.current.name === m) return;
1326
@@ -1512,10 +1516,10 @@
1516
this.selected = true;
1517
}
1518
else this.selected = false;
1515
-
1519
+
1520
if(this.selected === false && this.debug === true)
1521
this.log('selection cleared');
1518
-
1522
+
1523
this.legendReset();
1524
}
1525
@@ -2318,7 +2322,7 @@
2322
2323
hideChart();
2324
this.___isVisible___ = false;
2321
-
2325
+
2326
if(this.debug === true)
2327
this.log('isVisible: ' + this.___isVisible___);
2328
@@ -2329,7 +2333,7 @@
2333
2334
unhideChart();
2335
this.___isVisible___ = true;
2332
-
2336
+
2337
if(this.debug === true)
2338
this.log('isVisible: ' + this.___isVisible___);
2339
@@ -2365,7 +2369,7 @@
2369
2370
return false;
2371
}
2368
-
2372
+
2373
if(this.current.force_update_at !== 0 && this.current.force_update_at < now) {
2374
if(this.debug === true)
2375
this.log('timed force update detected - allowing this update');
@@ -2533,7 +2537,7 @@
2537
// don't use jQuery here
2538
// styles are loaded before jQuery
2539
// to eliminate showing an unstyled page to the user
2536
-
2540
+
2541
var fileref = document.createElement("link");
2542
fileref.setAttribute("rel", "stylesheet");
2543
fileref.setAttribute("type", "text/css");
@@ -2673,7 +2677,7 @@
2677
NETDATA.parseDom(NETDATA.chartRefresher);
2678
return;
2679
}
2676
-
2680
+
2681
if(NETDATA.options.sequencial.length === 0)
2682
NETDATA.chartRefresher();
2683
else {
@@ -2738,7 +2742,6 @@
2742
}
2743
else {
2744
state.error('chart library "' + state.library_name + '" is not enabled.');
2741
- state.enabled = false;
2745
}
2746
}
2747
@@ -2752,7 +2755,7 @@
2755
$(parallel).each(function() {
2756
this.autoRefresh(function() {
2757
parallel_jobs--;
2755
-
2758
+
2759
if(parallel_jobs === 0) {
2760
setTimeout(NETDATA.chartRefresher,
2761
NETDATA.chartRefresherWaitTime());
@@ -3094,7 +3097,7 @@
3097
3098
NETDATA.dygraphChartUpdate = function(state, data) {
3099
var dygraph = state.dygraph_instance;
3097
-
3100
+
3101
if(typeof dygraph === 'undefined')
3102
NETDATA.dygraphChartCreate(state, data);
3103
@@ -3121,7 +3124,7 @@
3124
else {
3125
if(NETDATA.options.debug.dygraph === true || state.debug === true)
3126
state.log('dygraphChartUpdate() strict update');
3124
-
3127
+
3128
options.dateWindow = null;
3129
options.valueRange = null;
3130
}
@@ -3159,7 +3162,7 @@
3162
3163
state.dygraph_options = {
3164
colors: self.data('dygraph-colors') || state.chartColors(),
3162
-
3165
+
3166
// leave a few pixels empty on the right of the chart
3167
rightGap: self.data('dygraph-rightgap') || 5,
3168
showRangeSelector: self.data('dygraph-showrangeselector') || false,
@@ -3193,7 +3196,7 @@
3196
// The size of the dot to draw on each point in pixels (see drawPoints). A dot is always drawn when a point is "isolated",
3197
// i.e. there is a missing point on either side of it. This also controls the size of those dots.
3198
drawPoints: self.data('dygraph-drawpoints') || false,
3196
-
3199
+
3200
// Draw points at the edges of gaps in the data. This improves visibility of small data segments or other data irregularities.
3201
drawGapEdgePoints: self.data('dygraph-drawgapedgepoints') || true,
3202
@@ -3202,7 +3205,7 @@
3205
3206
// enabling this makes the chart with little square lines
3207
stepPlot: self.data('dygraph-stepplot') || false,
3205
-
3208
+
3209
// Draw a border around graph lines to make crossing lines more easily distinguishable. Useful for graphs with many lines.
3210
strokeBorderColor: self.data('dygraph-strokebordercolor') || 'white',
3211
strokeBorderWidth: self.data('dygraph-strokeborderwidth') || (chart_type === 'stacked')?0.0:0.0,
@@ -3211,7 +3214,7 @@
3214
fillAlpha: self.data('dygraph-fillalpha') || (chart_type === 'stacked')?NETDATA.options.current.color_fill_opacity_stacked:NETDATA.options.current.color_fill_opacity_area,
3215
stackedGraph: self.data('dygraph-stackedgraph') || (chart_type === 'stacked')?true:false,
3216
stackedGraphNaNFill: self.data('dygraph-stackedgraphnanfill') || 'none',
3214
-
3217
+
3218
drawAxis: self.data('dygraph-drawaxis') || true,
3219
axisLabelFontSize: self.data('dygraph-axislabelfontsize') || 10,
3220
axisLineColor: self.data('dygraph-axislinecolor') || '#CCC',
@@ -3354,7 +3357,7 @@
3357
if(event.button && event.button === 2) return;
3358
3359
context.initializeMouseDown(event, dygraph, context);
3357
-
3360
+
3361
if(event.button && event.button === 1) {
3362
if (event.altKey || event.shiftKey) {
3363
state.setMode('pan');
@@ -3602,7 +3605,7 @@
3605
state.dygraph_options.labelsSeparateLines = true;
3606
state.dygraph_options.rightGap = 0;
3607
}
3605
-
3608
+
3609
if(smooth === true) {
3610
state.dygraph_smooth_eligible = true;
3611
web/index.html
+1
-1
@@ -253,7 +253,7 @@
253
<!-- <script> netdataServer = "http://box:19999"; </script> -->
254
255
<!-- load the dashboard manager - it will do the rest -->
256
- <script type="text/javascript" src="dashboard.js?v11"></script>
256
+ <script type="text/javascript" src="dashboard.js?v12"></script>
257
</head>
258
259
<body data-spy="scroll" data-target="#sidebar">