consul/ui/packages/consul-ui/app/routes/dc/nodes/show/rtt.js

28 lines
615 B
JavaScript

import Route from 'consul-ui/routing/route';
import { get } from '@ember/object';
export default class RttRoute extends Route {
model() {
const parent = this.routeName
.split('.')
.slice(0, -1)
.join('.');
return this.modelFor(parent);
}
afterModel(model, transition) {
if (!get(model, 'tomography.distances')) {
const parent = this.routeName
.split('.')
.slice(0, -1)
.join('.');
this.replaceWith(parent);
}
}
setupController(controller, model) {
super.setupController(...arguments);
controller.setProperties(model);
}
}