ba5ae14b6c
* Added to subnav and basic table implemented * Existing services become service fragments, and services tab aggregated beneath job route * Index page within jobs/job/services * Watchable services * Lintfixes * Links to clients and individual services set up * Child service route * Keyboard shortcuts on service page * Model that shows consul services as well, plus level and provider cols * lintfix * Level as query param * Watch job for service name changes too * Lintfix * Testfixes * Placeholder mirage route
27 lines
774 B
JavaScript
27 lines
774 B
JavaScript
import Route from '@ember/routing/route';
|
|
import WithWatchers from 'nomad-ui/mixins/with-watchers';
|
|
import { collect } from '@ember/object/computed';
|
|
import {
|
|
watchRecord,
|
|
watchRelationship,
|
|
} from 'nomad-ui/utils/properties/watch';
|
|
|
|
export default class JobsJobServicesRoute extends Route.extend(WithWatchers) {
|
|
model() {
|
|
const job = this.modelFor('jobs.job');
|
|
return job && job.get('services').then(() => job);
|
|
}
|
|
|
|
startWatchers(controller, model) {
|
|
if (model) {
|
|
controller.set('watchServices', this.watchServices.perform(model));
|
|
controller.set('watchJob', this.watchJob.perform(model));
|
|
}
|
|
}
|
|
|
|
@watchRelationship('services', true) watchServices;
|
|
@watchRecord('job') watchJob;
|
|
|
|
@collect('watchServices', 'watchJob') watchers;
|
|
}
|