2018-09-25 16:28:26 +00:00
|
|
|
import { inject as service } from '@ember/service';
|
|
|
|
import Controller from '@ember/controller';
|
|
|
|
import { computed } from '@ember/object';
|
2018-04-03 14:16:57 +00:00
|
|
|
import config from '../config/environment';
|
|
|
|
|
2018-08-16 17:48:24 +00:00
|
|
|
export default Controller.extend({
|
2018-04-03 14:16:57 +00:00
|
|
|
env: config.environment,
|
2018-09-25 16:28:26 +00:00
|
|
|
auth: service(),
|
|
|
|
store: service(),
|
2018-05-25 20:33:22 +00:00
|
|
|
activeCluster: computed('auth.activeCluster', function() {
|
2018-09-25 16:28:26 +00:00
|
|
|
let id = this.get('auth.activeCluster');
|
|
|
|
return id ? this.get('store').peekRecord('cluster', id) : null;
|
2018-04-03 14:16:57 +00:00
|
|
|
}),
|
2018-08-16 17:48:24 +00:00
|
|
|
activeClusterName: computed('activeCluster', function() {
|
|
|
|
const activeCluster = this.get('activeCluster');
|
2018-04-03 14:16:57 +00:00
|
|
|
return activeCluster ? activeCluster.get('name') : null;
|
|
|
|
}),
|
|
|
|
});
|