mirror of
https://github.com/status-im/consul.git
synced 2025-01-26 05:29:55 +00:00
5c0ec13fb9
* ui: Apply native class codemod to all services * ui: Apply native class codemod to routes * ui: Apply native class codemod to controllers * Fix up ember proxy `content` issue * Add a CreateTime on policy creation * Minor formatting * Convert child based saving to use ec instead of custom approach * Remove custom event source repo wrapping initializer * Repos here are no longer proxy objects revert to using them normally * Remove areas of code that were used to set up source backed repos
29 lines
763 B
JavaScript
29 lines
763 B
JavaScript
import { inject as service } from '@ember/service';
|
|
import Route from 'consul-ui/routing/route';
|
|
import { hash } from 'rsvp';
|
|
|
|
export default class ServicesRoute extends Route {
|
|
@service('data-source/service')
|
|
data;
|
|
|
|
model() {
|
|
const dc = this.modelFor('dc').dc.Name;
|
|
const nspace = this.modelFor('nspace').nspace.substr(1);
|
|
const parent = this.routeName
|
|
.split('.')
|
|
.slice(0, -1)
|
|
.join('.');
|
|
const name = this.modelFor(parent).slug;
|
|
return hash({
|
|
dc: dc,
|
|
nspace: nspace,
|
|
gatewayServices: this.data.source(uri => uri`/${nspace}/${dc}/gateways/for-service/${name}`),
|
|
});
|
|
}
|
|
|
|
setupController(controller, model) {
|
|
super.setupController(...arguments);
|
|
controller.setProperties(model);
|
|
}
|
|
}
|