52a7a48177
When the error is actually a 403, an ACL error is appropriate, but when it isn't, fallback on what the API returns.
28 lines
666 B
JavaScript
28 lines
666 B
JavaScript
import AbstractJobPage from './abstract';
|
|
import { inject as service } from '@ember/service';
|
|
import { action } from '@ember/object';
|
|
import classic from 'ember-classic-decorator';
|
|
import messageForError from 'nomad-ui/utils/message-from-adapter-error';
|
|
|
|
@classic
|
|
export default class Periodic extends AbstractJobPage {
|
|
@service store;
|
|
|
|
errorMessage = null;
|
|
|
|
@action
|
|
forceLaunch() {
|
|
this.job.forcePeriodic().catch(err => {
|
|
this.set('errorMessage', {
|
|
title: 'Could Not Force Launch',
|
|
description: messageForError(err, 'submit jobs'),
|
|
});
|
|
});
|
|
}
|
|
|
|
@action
|
|
clearErrorMessage() {
|
|
this.set('errorMessage', null);
|
|
}
|
|
}
|