open-nomad/ui/app/routes/csi/plugins/plugin/allocations.js

28 lines
685 B
JavaScript
Raw Normal View History

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';
export default class AllocationsRoute extends Route.extend(WithWatchers) {
startWatchers(controller, model) {
if (!model) return;
controller.set('watchers', {
model: this.watch.perform(model),
});
}
resetController(controller, isExiting) {
if (isExiting) {
controller.setProperties({
currentPage: 1,
qpType: '',
qpHealth: '',
});
}
}
@watchRecord('plugin') watch;
@collect('watch') watchers;
}