mirror of
https://github.com/status-im/consul.git
synced 2025-03-01 05:40:40 +00:00
* Add some less fake API data * Rename the models class so as to not be confused with JS Proxies * Rearrange routlets slightly and add some initial outletFor tests * Move away from a MeshChecks computed property and just use a helper * Just use ServiceChecks for healthiness filtering for the moment * Make TProxy cookie configurable * Amend exposed paths and upstreams so they know about meta AND proxy * Slight bit of TaggedAddresses refactor while I was checking for `meta` etc * Document CONSUL_TPROXY_ENABLE
37 lines
794 B
JavaScript
37 lines
794 B
JavaScript
import Component from '@glimmer/component';
|
|
import { inject as service } from '@ember/service';
|
|
import { action } from '@ember/object';
|
|
import { tracked } from '@glimmer/tracking';
|
|
|
|
export default class RouteComponent extends Component {
|
|
@service('routlet') routlet;
|
|
@service('router') router;
|
|
|
|
@tracked _model;
|
|
|
|
get params() {
|
|
return this.routlet.paramsFor(this.args.name);
|
|
}
|
|
|
|
get model() {
|
|
if(this._model) {
|
|
return this._model;
|
|
}
|
|
if (this.args.name) {
|
|
const outlet = this.routlet.outletFor(this.args.name);
|
|
return this.routlet.modelFor(outlet.name);
|
|
}
|
|
return undefined;
|
|
}
|
|
|
|
@action
|
|
connect() {
|
|
this.routlet.addRoute(this.args.name, this);
|
|
}
|
|
|
|
@action
|
|
disconnect() {
|
|
this.routlet.removeRoute(this.args.name, this);
|
|
}
|
|
}
|