mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fixed issue with loading spinner
This commit is contained in:
parent
fb084a2443
commit
d446887ed7
@ -300,6 +300,7 @@ function (angular, app, $, _, kbn, moment, timeSeries, graphiteSrv) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$scope.panelMeta.loading = false;
|
$scope.panelMeta.loading = false;
|
||||||
|
$scope.$apply();
|
||||||
|
|
||||||
// Tell the histogram directive to render.
|
// Tell the histogram directive to render.
|
||||||
$scope.$emit('render');
|
$scope.$emit('render');
|
||||||
@ -317,6 +318,7 @@ function (angular, app, $, _, kbn, moment, timeSeries, graphiteSrv) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
console.log('Data from graphite:', results);
|
console.log('Data from graphite:', results);
|
||||||
|
console.log('nr datapoints from graphite: %d', results[0].datapoints.length);
|
||||||
|
|
||||||
var tsOpts = {
|
var tsOpts = {
|
||||||
interval: interval,
|
interval: interval,
|
||||||
@ -325,8 +327,6 @@ function (angular, app, $, _, kbn, moment, timeSeries, graphiteSrv) {
|
|||||||
fill_style: 'connect'
|
fill_style: 'connect'
|
||||||
};
|
};
|
||||||
|
|
||||||
var hits = 0;
|
|
||||||
|
|
||||||
_.each(results, function(targetData) {
|
_.each(results, function(targetData) {
|
||||||
var time_series = new timeSeries.ZeroFilled(tsOpts);
|
var time_series = new timeSeries.ZeroFilled(tsOpts);
|
||||||
|
|
||||||
@ -334,11 +334,8 @@ function (angular, app, $, _, kbn, moment, timeSeries, graphiteSrv) {
|
|||||||
if (valueArray[0]) {
|
if (valueArray[0]) {
|
||||||
time_series.addValue(valueArray[1] * 1000, valueArray[0]);
|
time_series.addValue(valueArray[1] * 1000, valueArray[0]);
|
||||||
}
|
}
|
||||||
hits += +1;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
//console.log('graphite timeseries: ', time_series);
|
|
||||||
|
|
||||||
$scope.data.push({
|
$scope.data.push({
|
||||||
info: {
|
info: {
|
||||||
alias: targetData.target,
|
alias: targetData.target,
|
||||||
@ -346,12 +343,10 @@ function (angular, app, $, _, kbn, moment, timeSeries, graphiteSrv) {
|
|||||||
enable: true
|
enable: true
|
||||||
},
|
},
|
||||||
time_series: time_series,
|
time_series: time_series,
|
||||||
hits: hits
|
hits: 0
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$scope.hits = hits;
|
|
||||||
|
|
||||||
requestion('ok');
|
requestion('ok');
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -572,11 +567,15 @@ function (angular, app, $, _, kbn, moment, timeSeries, graphiteSrv) {
|
|||||||
scope.data[i].data = _d;
|
scope.data[i].data = _d;
|
||||||
}
|
}
|
||||||
|
|
||||||
//console.log('Sent to plot', scope.data);
|
var totalDataPoints = _.reduce(scope.data, function(num, series) { return series.data.length + num; }, 0);
|
||||||
|
console.log('Datapoints[0] count:', scope.data[0].data.length);
|
||||||
|
console.log('Datapoints.Total count:', totalDataPoints);
|
||||||
|
|
||||||
|
|
||||||
scope.plot = $.plot(elem, scope.data, options);
|
scope.plot = $.plot(elem, scope.data, options);
|
||||||
|
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
|
console.log(e);
|
||||||
// Nothing to do here
|
// Nothing to do here
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user