open-vault/ui/app/components/status-menu.js

32 lines
946 B
JavaScript
Raw Normal View History

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
export default Component.extend({
currentCluster: service('current-cluster'),
cluster: alias('currentCluster.cluster'),
auth: service(),
store: service(),
media: service(),
version: service(),
2018-04-03 14:16:57 +00:00
type: 'cluster',
itemTag: null,
2018-04-03 14:16:57 +00:00
partialName: computed('type', function() {
return `partials/status/${this.type}`;
2018-04-03 14:16:57 +00:00
}),
glyphName: computed('type', function() {
const glyphs = {
cluster: 'status-indicator',
user: 'person',
2018-04-03 14:16:57 +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
}),
});