mirror of https://github.com/rancher/ui.git
This commit is contained in:
parent
406a0b72c8
commit
d679373d16
|
|
@ -30,8 +30,11 @@ export default Component.extend({
|
||||||
var triggerCronExpression = this.get('pipeline.triggerCronExpression');
|
var triggerCronExpression = this.get('pipeline.triggerCronExpression');
|
||||||
if (triggerCronExpression) {
|
if (triggerCronExpression) {
|
||||||
this.set('state.setCustomCron', true);
|
this.set('state.setCustomCron', true);
|
||||||
|
this.set('customCron', triggerCronExpression);
|
||||||
|
this.set('cronType', 'custom');
|
||||||
}else{
|
}else{
|
||||||
this.set('state.setCustomCron', false);
|
this.set('state.setCustomCron', false);
|
||||||
|
this.set('cronType', 'everyday');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
customCronOberve: function(){
|
customCronOberve: function(){
|
||||||
|
|
@ -41,14 +44,14 @@ export default Component.extend({
|
||||||
this.set('pipeline.triggerCronExpression', customCron);
|
this.set('pipeline.triggerCronExpression', customCron);
|
||||||
}
|
}
|
||||||
}.observes('customCron'),
|
}.observes('customCron'),
|
||||||
cronObserve: on('init', observer('cron.{hour,min}','cronType',function(){
|
cronObserve: observer('cron.{hour,min}','cronType',function(){
|
||||||
let cron = this.get('cron');
|
let cron = this.get('cron');
|
||||||
let cronType = this.get('cronType');
|
let cronType = this.get('cronType');
|
||||||
if(cronType === 'everyday'){
|
if(cronType === 'everyday'){
|
||||||
let cronSyntax = `${cron.min} ${cron.hour} * * *`;
|
let cronSyntax = `${cron.min} ${cron.hour} * * *`;
|
||||||
this.set('customCron', cronSyntax);
|
this.set('customCron', cronSyntax);
|
||||||
}
|
}
|
||||||
})),
|
}),
|
||||||
setCustomCronObeseve: function(){
|
setCustomCronObeseve: function(){
|
||||||
let state = this.get('state');
|
let state = this.get('state');
|
||||||
var triggerCronExpression = this.get('pipeline.triggerCronExpression');
|
var triggerCronExpression = this.get('pipeline.triggerCronExpression');
|
||||||
|
|
@ -68,7 +71,15 @@ export default Component.extend({
|
||||||
this.set('pipeline.triggerCronExpression', '');
|
this.set('pipeline.triggerCronExpression', '');
|
||||||
}
|
}
|
||||||
}.observes('state.setCustomCron'),
|
}.observes('state.setCustomCron'),
|
||||||
|
observeOptionsChange: function(){
|
||||||
|
let trigger={
|
||||||
|
webhook: this.get('pipeline.triggerWebhook'),
|
||||||
|
cron: !!this.get('state.setCustomCron')
|
||||||
|
}
|
||||||
|
this.sendAction('triggerOptionsChange', trigger);
|
||||||
|
}.observes('pipeline.triggerWebhook', 'state.setCustomCron'),
|
||||||
didInsertElement(){
|
didInsertElement(){
|
||||||
this.initTimeZone();
|
this.initTimeZone();
|
||||||
|
this.cronObserve();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue