2020-05-20 21:34:16 +00:00
|
|
|
import Route from '@ember/routing/route';
|
|
|
|
import { collect } from '@ember/object/computed';
|
|
|
|
import { watchRecord } from 'nomad-ui/utils/properties/watch';
|
|
|
|
import WithWatchers from 'nomad-ui/mixins/with-watchers';
|
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
export default class AllocationsRoute extends Route.extend(WithWatchers) {
|
2020-05-20 21:34:16 +00:00
|
|
|
startWatchers(controller, model) {
|
|
|
|
if (!model) return;
|
|
|
|
|
|
|
|
controller.set('watchers', {
|
|
|
|
model: this.watch.perform(model),
|
|
|
|
});
|
2020-06-10 13:49:16 +00:00
|
|
|
}
|
2020-05-20 21:34:16 +00:00
|
|
|
|
|
|
|
resetController(controller, isExiting) {
|
|
|
|
if (isExiting) {
|
|
|
|
controller.setProperties({
|
|
|
|
currentPage: 1,
|
|
|
|
qpType: '',
|
|
|
|
qpHealth: '',
|
|
|
|
});
|
|
|
|
}
|
2020-06-10 13:49:16 +00:00
|
|
|
}
|
2020-05-20 21:34:16 +00:00
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
@watchRecord('plugin') watch;
|
|
|
|
@collect('watch') watchers;
|
|
|
|
}
|