mirror of
https://github.com/fabioformosa/quartz-manager.git
synced 2026-05-14 22:00:30 +09:00
#14 fixed the trigger rescheduling
This commit is contained in:
@@ -4,14 +4,14 @@
|
||||
</mat-card-header>
|
||||
|
||||
<!-- ADD BUTTON -->
|
||||
<mat-card-content *ngIf="!shouldShowTriggerConfig() && !enabledTriggerForm">
|
||||
<mat-card-content *ngIf="!existsATriggerInProgress() && !enabledTriggerForm">
|
||||
<button mat-fab color="primary">
|
||||
<mat-icon (click)="enableTriggerForm()">add</mat-icon>
|
||||
</button>
|
||||
</mat-card-content>
|
||||
|
||||
<!-- TRIGGER DETAILS -->
|
||||
<mat-card-content *ngIf="shouldShowTriggerConfig() || enabledTriggerForm">
|
||||
<mat-card-content *ngIf="existsATriggerInProgress() || enabledTriggerForm">
|
||||
<div fxLayout="column">
|
||||
<form name="configForm" fxFlex="1 1 100%" #configForm="ngForm">
|
||||
<mat-form-field >
|
||||
|
||||
@@ -47,10 +47,12 @@ export class SchedulerConfigComponent implements OnInit {
|
||||
})
|
||||
}
|
||||
|
||||
shouldShowTriggerConfig = (): boolean => this.fetchedTriggers && this.triggerInProgress;
|
||||
existsATriggerInProgress = (): boolean => this.fetchedTriggers && this.triggerInProgress;
|
||||
|
||||
submitConfig = () => {
|
||||
this.schedulerService.updateConfig(this.config)
|
||||
const schedulerServiceCall = this.existsATriggerInProgress() ? this.schedulerService.updateConfig : this.schedulerService.saveConfig;
|
||||
|
||||
schedulerServiceCall(this.config)
|
||||
.subscribe(res => {
|
||||
this.configBackup = this.config;
|
||||
this.enabledTriggerForm = false;
|
||||
@@ -61,5 +63,5 @@ export class SchedulerConfigComponent implements OnInit {
|
||||
});
|
||||
};
|
||||
|
||||
enableTriggerForm = () => this.enabledTriggerForm = true;
|
||||
enableTriggerForm = () => this.enabledTriggerForm = true;
|
||||
}
|
||||
|
||||
@@ -37,9 +37,13 @@ export class SchedulerService {
|
||||
return this.apiService.get(getBaseUrl() + '/quartz-manager/scheduler/config')
|
||||
}
|
||||
|
||||
updateConfig = (config: Object) => {
|
||||
saveConfig = (config: Object) => {
|
||||
return this.apiService.post(getBaseUrl() + '/quartz-manager/triggers/mytrigger', config)
|
||||
}
|
||||
|
||||
updateConfig = (config: Object) => {
|
||||
return this.apiService.put(getBaseUrl() + '/quartz-manager/triggers/mytrigger', config)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user