mirror of https://github.com/rancher/ui.git
32 lines
975 B
JavaScript
32 lines
975 B
JavaScript
import Resource from '@rancher/ember-api-store/models/resource';
|
|
import { reference } from '@rancher/ember-api-store/utils/denormalize';
|
|
import { inject as service } from '@ember/service';
|
|
import { computed } from '@ember/object';
|
|
|
|
export default Resource.extend({
|
|
clusterStore: service(),
|
|
router: service(),
|
|
|
|
canHaveLabels: true,
|
|
namespace: reference('namespaceId', 'namespace', 'clusterStore'),
|
|
|
|
displaySubsetsString: computed('displaySubsets.[]', function() {
|
|
return (this.displaySubsets || []).join(', ');
|
|
}),
|
|
|
|
displaySubsets: computed('subsets.[]', function() {
|
|
return (this.subsets || []).map((s) => s.name);
|
|
}),
|
|
|
|
actions: {
|
|
edit() {
|
|
this.router.transitionTo('authenticated.project.istio.destination-rule.detail.edit', this.id);
|
|
},
|
|
|
|
clone() {
|
|
this.router.transitionTo('authenticated.project.istio.destination-rule.new', this.projectId, { queryParams: { id: this.id } });
|
|
},
|
|
},
|
|
|
|
});
|