mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-15 11:07:00 +02:00
19 lines
631 B
JavaScript
19 lines
631 B
JavaScript
import { inject as service } from '@ember/service';
|
|
import Controller from '@ember/controller';
|
|
import { computed } from '@ember/object';
|
|
import config from '../config/environment';
|
|
|
|
export default Controller.extend({
|
|
env: config.environment,
|
|
auth: service(),
|
|
store: service(),
|
|
activeCluster: computed('auth.activeCluster', function () {
|
|
const id = this.auth.activeCluster;
|
|
return id ? this.store.peekRecord('cluster', id) : null;
|
|
}),
|
|
activeClusterName: computed('activeCluster', function () {
|
|
const activeCluster = this.activeCluster;
|
|
return activeCluster ? activeCluster.get('name') : null;
|
|
}),
|
|
});
|