open-consul/ui-v2/app/routes/dc/acls/tokens/edit.js

25 lines
697 B
JavaScript

import SingleRoute from 'consul-ui/routing/single';
import { inject as service } from '@ember/service';
import { hash } from 'rsvp';
import { get } from '@ember/object';
import WithTokenActions from 'consul-ui/mixins/token/with-actions';
export default SingleRoute.extend(WithTokenActions, {
repo: service('repository/token'),
settings: service('settings'),
model: function(params, transition) {
return this._super(...arguments).then(model => {
return hash({
...model,
...{
token: get(this, 'settings').findBySlug('token'),
},
});
});
},
setupController: function(controller, model) {
controller.setProperties(model);
},
});