open-vault/ui/app/components/status-menu.js
Matthew Irish 0ccc8467ec
UI ember engines (#6718)
Adds replication engine and core in-repo addon
2019-05-13 14:05:25 -05:00

32 lines
959 B
JavaScript

import { inject as service } from '@ember/service';
import { alias } from '@ember/object/computed';
import Component from '@ember/component';
import { computed } from '@ember/object';
export default Component.extend({
currentCluster: service('current-cluster'),
cluster: alias('currentCluster.cluster'),
auth: service(),
store: service(),
media: service(),
version: service(),
type: 'cluster',
itemTag: null,
partialName: computed('type', function() {
return `partials/status/${this.type}`;
}),
glyphName: computed('type', function() {
const glyphs = {
cluster: 'status-indicator',
user: 'user-square-outline',
};
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');
}),
});