2020-10-05 17:07:35 +00:00
|
|
|
import Route from '@ember/routing/route';
|
2020-12-08 15:47:55 +00:00
|
|
|
import { inject as service } from '@ember/service';
|
2020-10-05 17:07:35 +00:00
|
|
|
|
2020-11-09 09:25:35 +00:00
|
|
|
export default class TopologyRoute extends Route {
|
2020-12-08 15:47:55 +00:00
|
|
|
@service('ui-config') config;
|
|
|
|
@service('env') env;
|
|
|
|
|
2020-11-09 09:25:35 +00:00
|
|
|
model() {
|
2020-10-05 17:07:35 +00:00
|
|
|
const parent = this.routeName
|
|
|
|
.split('.')
|
|
|
|
.slice(0, -1)
|
|
|
|
.join('.');
|
2020-12-08 15:47:55 +00:00
|
|
|
|
|
|
|
return {
|
|
|
|
...this.modelFor(parent),
|
|
|
|
hasMetricsProvider: !!this.config.get().metrics_provider,
|
|
|
|
isRemoteDC: this.env.var('CONSUL_DATACENTER_LOCAL') !== this.modelFor('dc').dc.Name,
|
|
|
|
};
|
2020-11-09 09:25:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
setupController(controller, model) {
|
|
|
|
super.setupController(...arguments);
|
2020-10-05 17:07:35 +00:00
|
|
|
controller.setProperties(model);
|
2020-11-09 09:25:35 +00:00
|
|
|
}
|
|
|
|
}
|