mirror of https://gitee.com/bigwinds/arangodb
faster detailgraph switching, changed checkbox img
This commit is contained in:
parent
e0e4760abc
commit
fef0d543aa
Binary file not shown.
After Width: | Height: | Size: 4.2 KiB |
|
@ -7,6 +7,7 @@ var dashboardView = Backbone.View.extend({
|
||||||
seriesData: {},
|
seriesData: {},
|
||||||
charts: {},
|
charts: {},
|
||||||
units: [],
|
units: [],
|
||||||
|
updateNOW: false,
|
||||||
detailGraph: "userTime",
|
detailGraph: "userTime",
|
||||||
|
|
||||||
initialize: function () {
|
initialize: function () {
|
||||||
|
@ -22,6 +23,12 @@ var dashboardView = Backbone.View.extend({
|
||||||
window.setInterval(function() {
|
window.setInterval(function() {
|
||||||
self.updateCounter++;
|
self.updateCounter++;
|
||||||
|
|
||||||
|
if (self.updateNOW === true) {
|
||||||
|
self.calculateSeries();
|
||||||
|
self.renderCharts();
|
||||||
|
self.updateNOW = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (self.updateCounter < self.updateFrequency) {
|
if (self.updateCounter < self.updateFrequency) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -74,7 +81,6 @@ var dashboardView = Backbone.View.extend({
|
||||||
|
|
||||||
var counter = 1;
|
var counter = 1;
|
||||||
$.each(this.options.description.models[0].attributes.groups, function () {
|
$.each(this.options.description.models[0].attributes.groups, function () {
|
||||||
console.log(this);
|
|
||||||
$('.thumbnails').append(
|
$('.thumbnails').append(
|
||||||
'<ul class="statGroups" id="' + this.group + '">' +
|
'<ul class="statGroups" id="' + this.group + '">' +
|
||||||
'<i class="group-close icon-minus icon-white"></i>' +
|
'<i class="group-close icon-minus icon-white"></i>' +
|
||||||
|
@ -151,6 +157,7 @@ var dashboardView = Backbone.View.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
checkInterval: function (a) {
|
checkInterval: function (a) {
|
||||||
|
var self = this;
|
||||||
this.updateFrequency = a.target.value;
|
this.updateFrequency = a.target.value;
|
||||||
self.calculateSeries();
|
self.calculateSeries();
|
||||||
self.renderCharts();
|
self.renderCharts();
|
||||||
|
@ -243,13 +250,14 @@ var dashboardView = Backbone.View.extend({
|
||||||
$.each(this.options.description.models[0].attributes.figures, function () {
|
$.each(this.options.description.models[0].attributes.figures, function () {
|
||||||
if(this.identifier === self.detailGraph) {
|
if(this.identifier === self.detailGraph) {
|
||||||
$('#detailGraphHeader').text(this.name);
|
$('#detailGraphHeader').text(this.name);
|
||||||
self.calculateSeries();
|
|
||||||
self.renderCharts();
|
|
||||||
$("html, body").animate({ scrollTop: 0 }, "slow");
|
$("html, body").animate({ scrollTop: 0 }, "slow");
|
||||||
$('#detailGraphChart').show();
|
$('#detailGraphChart').show();
|
||||||
$('#detailGraph').height(300);
|
$('#detailGraph').height(300);
|
||||||
$('#dbHideSwitch').addClass('icon-minus');
|
$('#dbHideSwitch').addClass('icon-minus');
|
||||||
$('#dbHideSwitch').removeClass('icon-plus');
|
$('#dbHideSwitch').removeClass('icon-plus');
|
||||||
|
self.calculateSeries();
|
||||||
|
self.renderCharts();
|
||||||
|
self.updateNOW = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue