|
@@ -574,7 +574,12 @@ App.ChartLinearTimeView = Ember.View.extend(App.ExportMetricsMixin, {
|
|
|
//if graph opened as modal popup
|
|
|
var popup_path = $(this.get('_popupSelector'));
|
|
|
var graph_container = $(this.get('_containerSelector'));
|
|
|
+ var seconds = this.get('parentView.graphSeconds');
|
|
|
var container;
|
|
|
+ if (!Em.isNone(seconds)) {
|
|
|
+ this.set('timeUnitSeconds', seconds);
|
|
|
+ this.set('parentView.graphSeconds', null);
|
|
|
+ }
|
|
|
if (popup_path.length) {
|
|
|
popup_path.children().each(function () {
|
|
|
$(this).children().remove();
|
|
@@ -917,6 +922,14 @@ App.ChartLinearTimeView = Ember.View.extend(App.ExportMetricsMixin, {
|
|
|
}
|
|
|
|
|
|
this.set('isPopup', true);
|
|
|
+ if (this.get('inWidget') && !this.get('parentView.isClusterMetricsWidget')) {
|
|
|
+ this.setProperties({
|
|
|
+ currentTimeIndex: this.get('parentView.timeIndex'),
|
|
|
+ customStartTime: this.get('parentView.startTime'),
|
|
|
+ customEndTime: this.get('parentView.endTime'),
|
|
|
+ customDurationFormatted: this.get('parentView.durationFormatted')
|
|
|
+ });
|
|
|
+ }
|
|
|
var self = this;
|
|
|
|
|
|
App.ModalPopup.show({
|
|
@@ -1065,7 +1078,10 @@ App.ChartLinearTimeView = Ember.View.extend(App.ExportMetricsMixin, {
|
|
|
reloadGraphByTime: function (index) {
|
|
|
this.set('childViews.firstObject.currentTimeRangeIndex', index);
|
|
|
this.set('currentTimeIndex', index);
|
|
|
- self.set('currentTimeIndex', index);
|
|
|
+ self.setProperties({
|
|
|
+ currentTimeIndex: index,
|
|
|
+ isPopupReady: false
|
|
|
+ });
|
|
|
App.ajax.abortRequests(this.get('graph.runningPopupRequests'));
|
|
|
},
|
|
|
currentTimeIndex: self.get('currentTimeIndex'),
|
|
@@ -1117,18 +1133,38 @@ App.ChartLinearTimeView = Ember.View.extend(App.ExportMetricsMixin, {
|
|
|
});
|
|
|
if (index !== 8 || targetView.get('customStartTime') && targetView.get('customEndTime')) {
|
|
|
App.ajax.abortRequests(this.get('runningRequests'));
|
|
|
+ if (this.get('inWidget') && !this.get('parentView.isClusterMetricsWidget')) {
|
|
|
+ this.set('parentView.isLoaded', false);
|
|
|
+ } else {
|
|
|
+ this.set('isReady', false);
|
|
|
+ }
|
|
|
}
|
|
|
}.observes('parentView.parentView.currentTimeRangeIndex', 'parentView.currentTimeRangeIndex', 'parentView.parentView.customStartTime', 'parentView.customStartTime', 'parentView.parentView.customEndTime', 'parentView.customEndTime'),
|
|
|
timeUnitSeconds: 3600,
|
|
|
timeUnitSecondsSetter: function () {
|
|
|
- var index = this.get('currentTimeIndex');
|
|
|
+ var index = this.get('currentTimeIndex'),
|
|
|
+ startTime = this.get('customStartTime'),
|
|
|
+ endTime = this.get('customEndTime'),
|
|
|
+ durationFormatted = this.get('customDurationFormatted'),
|
|
|
+ seconds;
|
|
|
if (index !== 8) {
|
|
|
// Preset time range is specified by user
|
|
|
- var seconds = this.get('timeStates').objectAt(this.get('currentTimeIndex')).seconds;
|
|
|
- this.set('timeUnitSeconds', seconds);
|
|
|
- } else if (!Em.isNone(this.get('customStartTime')) && !Em.isNone(this.get('customEndTime'))) {
|
|
|
+ seconds = this.get('timeStates').objectAt(this.get('currentTimeIndex')).seconds;
|
|
|
+ } else if (!Em.isNone(startTime) && !Em.isNone(endTime)) {
|
|
|
// Custom start and end time is specified by user
|
|
|
- this.set('timeUnitSeconds', (this.get('customEndTime') - this.get('customStartTime')) / 1000);
|
|
|
+ seconds = (endTime - startTime) / 1000;
|
|
|
+ }
|
|
|
+ if (!Em.isNone(seconds)) {
|
|
|
+ this.set('timeUnitSeconds', seconds);
|
|
|
+ if (this.get('inWidget') && !this.get('parentView.isClusterMetricsWidget')) {
|
|
|
+ this.get('parentView').setProperties({
|
|
|
+ graphSeconds: seconds,
|
|
|
+ timeIndex: index,
|
|
|
+ startTime: startTime,
|
|
|
+ endTime: endTime,
|
|
|
+ durationFormatted: durationFormatted
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
}.observes('currentTimeIndex', 'customStartTime', 'customEndTime')
|
|
|
|