mirror of
https://github.com/kemko/nomad.git
synced 2026-01-08 11:25:41 +03:00
31 lines
745 B
JavaScript
31 lines
745 B
JavaScript
import Controller from '@ember/controller';
|
|
import { computed as overridable } from 'ember-overridable-computed';
|
|
import { task } from 'ember-concurrency';
|
|
import classic from 'ember-classic-decorator';
|
|
import messageForError from 'nomad-ui/utils/message-from-adapter-error';
|
|
|
|
@classic
|
|
export default class IndexController extends Controller {
|
|
@overridable(() => {
|
|
// { title, description }
|
|
return null;
|
|
})
|
|
error;
|
|
|
|
onDismiss() {
|
|
this.set('error', null);
|
|
}
|
|
|
|
@task(function* () {
|
|
try {
|
|
yield this.model.restart();
|
|
} catch (err) {
|
|
this.set('error', {
|
|
title: 'Could Not Restart Task',
|
|
description: messageForError(err, 'manage allocation lifecycle'),
|
|
});
|
|
}
|
|
})
|
|
restartTask;
|
|
}
|