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');
|
||||
if (triggerCronExpression) {
|
||||
this.set('state.setCustomCron', true);
|
||||
this.set('customCron', triggerCronExpression);
|
||||
this.set('cronType', 'custom');
|
||||
}else{
|
||||
this.set('state.setCustomCron', false);
|
||||
this.set('cronType', 'everyday');
|
||||
}
|
||||
},
|
||||
customCronOberve: function(){
|
||||
|
|
@ -41,14 +44,14 @@ export default Component.extend({
|
|||
this.set('pipeline.triggerCronExpression', 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 cronType = this.get('cronType');
|
||||
if(cronType === 'everyday'){
|
||||
let cronSyntax = `${cron.min} ${cron.hour} * * *`;
|
||||
this.set('customCron', cronSyntax);
|
||||
}
|
||||
})),
|
||||
}),
|
||||
setCustomCronObeseve: function(){
|
||||
let state = this.get('state');
|
||||
var triggerCronExpression = this.get('pipeline.triggerCronExpression');
|
||||
|
|
@ -68,7 +71,15 @@ export default Component.extend({
|
|||
this.set('pipeline.triggerCronExpression', '');
|
||||
}
|
||||
}.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(){
|
||||
this.initTimeZone();
|
||||
this.cronObserve();
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue