2018-01-25 22:18:53 +00:00
|
|
|
import AbstractJobPage from './abstract';
|
2018-01-26 22:32:11 +00:00
|
|
|
import { inject as service } from '@ember/service';
|
2020-06-10 13:49:16 +00:00
|
|
|
import { action } from '@ember/object';
|
|
|
|
import classic from 'ember-classic-decorator';
|
2021-01-28 00:40:51 +00:00
|
|
|
import messageForError from 'nomad-ui/utils/message-from-adapter-error';
|
2018-01-25 22:18:53 +00:00
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
@classic
|
|
|
|
export default class Periodic extends AbstractJobPage {
|
|
|
|
@service store;
|
2018-03-21 00:44:16 +00:00
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
errorMessage = null;
|
2018-03-21 00:44:16 +00:00
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
@action
|
|
|
|
forceLaunch() {
|
2021-12-28 14:45:20 +00:00
|
|
|
this.job.forcePeriodic().catch((err) => {
|
2020-06-10 13:49:16 +00:00
|
|
|
this.set('errorMessage', {
|
|
|
|
title: 'Could Not Force Launch',
|
2021-01-28 00:40:51 +00:00
|
|
|
description: messageForError(err, 'submit jobs'),
|
2020-06-10 13:49:16 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
@action
|
|
|
|
clearErrorMessage() {
|
|
|
|
this.set('errorMessage', null);
|
|
|
|
}
|
|
|
|
}
|