github.com/emate/nomad@v0.8.2-wo-binpacking/ui/app/components/job-page/abstract.js (about)

     1  import Component from '@ember/component';
     2  import { computed } from '@ember/object';
     3  import { inject as service } from '@ember/service';
     4  import { qpBuilder } from 'nomad-ui/utils/classes/query-params';
     5  
     6  export default Component.extend({
     7    system: service(),
     8  
     9    job: null,
    10  
    11    // Provide a value that is bound to a query param
    12    sortProperty: null,
    13    sortDescending: null,
    14  
    15    // Provide actions that require routing
    16    onNamespaceChange() {},
    17    gotoTaskGroup() {},
    18    gotoJob() {},
    19  
    20    // Set to a { title, description } to surface an error
    21    errorMessage: null,
    22  
    23    breadcrumbs: computed('job.{name,id}', function() {
    24      const job = this.get('job');
    25      return [
    26        { label: 'Jobs', args: ['jobs'] },
    27        {
    28          label: job.get('name'),
    29          args: [
    30            'jobs.job',
    31            job,
    32            qpBuilder({
    33              jobNamespace: job.get('namespace.name') || 'default',
    34            }),
    35          ],
    36        },
    37      ];
    38    }),
    39  
    40    actions: {
    41      clearErrorMessage() {
    42        this.set('errorMessage', null);
    43      },
    44      handleError(errorObject) {
    45        this.set('errorMessage', errorObject);
    46      },
    47    },
    48  });