github.com/hernad/nomad@v1.6.112/ui/app/routes/jobs/job/services.js (about)

     1  /**
     2   * Copyright (c) HashiCorp, Inc.
     3   * SPDX-License-Identifier: MPL-2.0
     4   */
     5  
     6  import Route from '@ember/routing/route';
     7  import WithWatchers from 'nomad-ui/mixins/with-watchers';
     8  import { collect } from '@ember/object/computed';
     9  import {
    10    watchRecord,
    11    watchRelationship,
    12  } from 'nomad-ui/utils/properties/watch';
    13  
    14  export default class JobsJobServicesRoute extends Route.extend(WithWatchers) {
    15    model() {
    16      const job = this.modelFor('jobs.job');
    17      return job && job.get('services').then(() => job);
    18    }
    19  
    20    startWatchers(controller, model) {
    21      if (model) {
    22        controller.set('watchServices', this.watchServices.perform(model));
    23        controller.set('watchJob', this.watchJob.perform(model));
    24      }
    25    }
    26  
    27    @watchRelationship('services', true) watchServices;
    28    @watchRecord('job') watchJob;
    29  
    30    @collect('watchServices', 'watchJob') watchers;
    31  }