vault/ui/app/controllers/vault.js
Hamid Ghaf e55c18ed12
adding copyright header (#19555)
* adding copyright header

* fix fmt and a test
2023-03-15 09:00:52 -07:00

32 lines
852 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
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({
queryParams: [
{
wrappedToken: 'wrapped_token',
redirectTo: 'redirect_to',
},
],
wrappedToken: '',
redirectTo: '',
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;
}),
});