|
@@ -21,7 +21,7 @@ var misc = require('utils/misc');
|
|
require('views/main/service/service');
|
|
require('views/main/service/service');
|
|
require('data/service_graph_config');
|
|
require('data/service_graph_config');
|
|
|
|
|
|
-App.MainServiceInfoSummaryView = Em.View.extend(App.UserPref, {
|
|
|
|
|
|
+App.MainServiceInfoSummaryView = Em.View.extend(App.UserPref, App.TimeRangeMixin, {
|
|
templateName: require('templates/main/service/info/summary'),
|
|
templateName: require('templates/main/service/info/summary'),
|
|
/**
|
|
/**
|
|
* @property {Number} chunkSize - number of columns in Metrics section
|
|
* @property {Number} chunkSize - number of columns in Metrics section
|
|
@@ -498,32 +498,12 @@ App.MainServiceInfoSummaryView = Em.View.extend(App.UserPref, {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
- /**
|
|
|
|
- * time range options for service metrics, a dropdown will list all options
|
|
|
|
- * value set in hours
|
|
|
|
- */
|
|
|
|
- timeRangeOptions: [
|
|
|
|
- {index: 0, name: Em.I18n.t('graphs.timeRange.hour'), value: '1'},
|
|
|
|
- {index: 1, name: Em.I18n.t('graphs.timeRange.twoHours'), value: '2'},
|
|
|
|
- {index: 2, name: Em.I18n.t('graphs.timeRange.fourHours'), value: '4'},
|
|
|
|
- {index: 3, name: Em.I18n.t('graphs.timeRange.twelveHours'), value: '12'},
|
|
|
|
- {index: 4, name: Em.I18n.t('graphs.timeRange.day'), value: '24'},
|
|
|
|
- {index: 5, name: Em.I18n.t('graphs.timeRange.week'), value: '168'},
|
|
|
|
- {index: 6, name: Em.I18n.t('graphs.timeRange.month'), value: '720'},
|
|
|
|
- {index: 7, name: Em.I18n.t('graphs.timeRange.year'), value: '8760'}
|
|
|
|
- ],
|
|
|
|
-
|
|
|
|
- currentTimeRangeIndex: 0,
|
|
|
|
- currentTimeRange: function() {
|
|
|
|
- return this.get('timeRangeOptions').objectAt(this.get('currentTimeRangeIndex'));
|
|
|
|
- }.property('currentTimeRangeIndex'),
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* onclick handler for a time range option
|
|
* onclick handler for a time range option
|
|
* @param {object} event
|
|
* @param {object} event
|
|
*/
|
|
*/
|
|
setTimeRange: function (event) {
|
|
setTimeRange: function (event) {
|
|
- this.set('currentTimeRangeIndex', event.context.index);
|
|
|
|
|
|
+ this._super(event);
|
|
|
|
|
|
this.get('controller.widgets').filterProperty('widgetType', 'GRAPH').forEach(function (widget) {
|
|
this.get('controller.widgets').filterProperty('widgetType', 'GRAPH').forEach(function (widget) {
|
|
widget.set('properties.time_range', event.context.value);
|
|
widget.set('properties.time_range', event.context.value);
|