mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
20 lines
541 B
JavaScript
20 lines
541 B
JavaScript
import Controller from '@ember/controller';
|
|
import { inject as service } from '@ember/service';
|
|
import { action } from '@ember/object';
|
|
|
|
export default class PoliciesIndexController extends Controller {
|
|
@service router;
|
|
get policies() {
|
|
return this.model.policies.map((policy) => {
|
|
policy.tokens = this.model.tokens.filter((token) => {
|
|
return token.policies.includes(policy);
|
|
});
|
|
return policy;
|
|
});
|
|
}
|
|
|
|
@action openPolicy(policy) {
|
|
this.router.transitionTo('policies.policy', policy.name);
|
|
}
|
|
}
|