2018-09-25 16:28:26 +00:00
|
|
|
import { inject as service } from '@ember/service';
|
|
|
|
import { alias } from '@ember/object/computed';
|
|
|
|
import Component from '@ember/component';
|
|
|
|
import { computed } from '@ember/object';
|
2018-04-03 14:16:57 +00:00
|
|
|
|
2018-09-25 16:28:26 +00:00
|
|
|
export default Component.extend({
|
|
|
|
currentCluster: service('current-cluster'),
|
|
|
|
cluster: alias('currentCluster.cluster'),
|
|
|
|
auth: service(),
|
2018-10-21 19:19:34 +00:00
|
|
|
store: service(),
|
|
|
|
media: service(),
|
2018-11-27 23:05:34 +00:00
|
|
|
version: service(),
|
2018-04-03 14:16:57 +00:00
|
|
|
type: 'cluster',
|
2018-06-26 21:35:47 +00:00
|
|
|
itemTag: null,
|
2018-04-03 14:16:57 +00:00
|
|
|
partialName: computed('type', function() {
|
2018-10-21 19:19:34 +00:00
|
|
|
return `partials/status/${this.type}`;
|
2018-04-03 14:16:57 +00:00
|
|
|
}),
|
|
|
|
glyphName: computed('type', function() {
|
|
|
|
const glyphs = {
|
2018-10-21 19:19:34 +00:00
|
|
|
cluster: 'status-indicator',
|
2019-05-13 19:05:25 +00:00
|
|
|
user: 'user-square-outline',
|
2018-04-03 14:16:57 +00:00
|
|
|
};
|
2018-10-21 19:19:34 +00:00
|
|
|
return glyphs[this.type];
|
|
|
|
}),
|
|
|
|
activeCluster: computed('auth.activeCluster', function() {
|
|
|
|
return this.get('store').peekRecord('cluster', this.get('auth.activeCluster'));
|
|
|
|
}),
|
|
|
|
currentToken: computed('auth.currentToken', function() {
|
|
|
|
return this.get('auth.currentToken');
|
2018-04-03 14:16:57 +00:00
|
|
|
}),
|
|
|
|
});
|