diff --git a/app/authenticated/project/controller.js b/app/authenticated/project/controller.js index d8d4e39f1..36ab9bb6b 100644 --- a/app/authenticated/project/controller.js +++ b/app/authenticated/project/controller.js @@ -1,4 +1,5 @@ import Ember from 'ember'; +import C from 'ui/utils/constants'; import { tagsToArray } from 'ui/models/stack'; //const NONE = 'none'; @@ -22,6 +23,12 @@ export default Ember.Controller.extend({ this.set('stacks', this.get('store').all('stack')); this.set('hosts', this.get('store').all('host')); this.set('expandedInstances',[]); + + Ember.run.scheduleOnce('afterRender', () => { + let key = `prefs.${C.PREFS.CONTAINER_VIEW}`; + const group = this.get(key) || this.get('group'); + this.transitionToRoute({queryParams: {group}}); + }); }, actions: { @@ -97,4 +104,13 @@ export default Ember.Controller.extend({ emptyStacks: function() { return this.get('stacks').filterBy('isEmpty',true).map((x) => { return {ref: x} }); }.property('stacks.@each.isEmpty'), + + groupChanged: function() { + let key = `prefs.${C.PREFS.CONTAINER_VIEW}`; + let cur = this.get(key); + let neu = this.get('group'); + if ( cur !== neu ) { + this.set(key,neu); + } + }.observes('group'), }); diff --git a/app/hosts/index/controller.js b/app/hosts/index/controller.js index 2446f63c3..17bee3635 100644 --- a/app/hosts/index/controller.js +++ b/app/hosts/index/controller.js @@ -18,6 +18,12 @@ export default Ember.Controller.extend({ init() { this._super(...arguments); this.set('expandedHosts',[]); + + Ember.run.scheduleOnce('afterRender', () => { + let key = `prefs.${C.PREFS.HOST_VIEW}`; + let mode = this.get(key) || this.get('mode'); + this.transitionToRoute({queryParams: {mode}}); + }); }, actions: { diff --git a/app/utils/constants.js b/app/utils/constants.js index 9b83a4c71..a0b06bf8f 100644 --- a/app/utils/constants.js +++ b/app/utils/constants.js @@ -191,6 +191,7 @@ var C = { EXPANDED_STACKS : 'expandedStacks', FEEDBACK : 'feedback', HOST_VIEW : 'hostView', + CONTAINER_VIEW : 'containerView', I_HATE_SPINNERS : 'ihatespinners', LANGUAGE : 'language', PROJECT_DEFAULT : 'defaultProjectId',