github.com/Ilhicas/nomad@v1.0.4-0.20210304152020-e86851182bc3/ui/app/components/job-page/periodic.js (about)

     1  import AbstractJobPage from './abstract';
     2  import { inject as service } from '@ember/service';
     3  import { action } from '@ember/object';
     4  import classic from 'ember-classic-decorator';
     5  import messageForError from 'nomad-ui/utils/message-from-adapter-error';
     6  
     7  @classic
     8  export default class Periodic extends AbstractJobPage {
     9    @service store;
    10  
    11    errorMessage = null;
    12  
    13    @action
    14    forceLaunch() {
    15      this.job.forcePeriodic().catch(err => {
    16        this.set('errorMessage', {
    17          title: 'Could Not Force Launch',
    18          description: messageForError(err, 'submit jobs'),
    19        });
    20      });
    21    }
    22  
    23    @action
    24    clearErrorMessage() {
    25      this.set('errorMessage', null);
    26    }
    27  }