mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 07:49:41 +02:00
feat(edge/jobs): migrate create view to react [EE-2221] (#11867)
This commit is contained in:
parent
94c91035a7
commit
02fbdfec36
27 changed files with 777 additions and 163 deletions
|
@ -9,8 +9,8 @@ export class EdgeJobFormController {
|
|||
this.$scope = $scope;
|
||||
this.$async = $async;
|
||||
|
||||
this.cronMethods = cronMethodOptions;
|
||||
this.buildMethods = [editor, upload];
|
||||
this.cronMethods = cronMethodOptions.map((o) => ({ ...o, id: o.id + '-old' }));
|
||||
this.buildMethods = [editor, upload].map((o) => ({ ...o, id: o.id + '-old' }));
|
||||
|
||||
this.state = {
|
||||
formValidationError: '',
|
||||
|
@ -70,10 +70,12 @@ export class EdgeJobFormController {
|
|||
|
||||
onChangeModel(model) {
|
||||
const defaultTime = moment().add('hours', 1);
|
||||
const scheduled = this.scheduleValues.find((v) => v.cron === model.CronExpression);
|
||||
|
||||
this.formValues = {
|
||||
datetime: model.CronExpression ? cronToDatetime(model.CronExpression, defaultTime) : defaultTime,
|
||||
scheduleValue: this.formValues.scheduleValue,
|
||||
cronMethod: model.Recurring ? 'advanced' : 'basic',
|
||||
scheduleValue: scheduled || this.scheduleValues[0],
|
||||
cronMethod: model.Recurring && !scheduled ? 'advanced' : 'basic',
|
||||
method: this.formValues.method,
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue