status
This commit is contained in:
@@ -1156,6 +1156,9 @@
|
|||||||
<button class="btn btn-danger" (click)="stopJob()" *ngIf="schedulerJob.status !== 'STOPPED'">
|
<button class="btn btn-danger" (click)="stopJob()" *ngIf="schedulerJob.status !== 'STOPPED'">
|
||||||
<clr-icon shape="stop"></clr-icon> Stop Job
|
<clr-icon shape="stop"></clr-icon> Stop Job
|
||||||
</button>
|
</button>
|
||||||
|
<button class="btn btn-primary" (click)="restartJob()" *ngIf="schedulerJob.status === 'STOPPED'">
|
||||||
|
<clr-icon shape="play"></clr-icon> Restart Job
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1603,7 +1603,7 @@ export class Data_lakeComponent implements OnInit {
|
|||||||
name: this.selectedSchedulerItem.name,
|
name: this.selectedSchedulerItem.name,
|
||||||
status: 'RUNNING',
|
status: 'RUNNING',
|
||||||
description: `Scheduled job for ${this.selectedSchedulerItem.name}`,
|
description: `Scheduled job for ${this.selectedSchedulerItem.name}`,
|
||||||
jobType: 'SYNC',
|
jobType: 'DATALAKE',
|
||||||
lakeid: this.selectedSchedulerItem.id
|
lakeid: this.selectedSchedulerItem.id
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1676,6 +1676,34 @@ export class Data_lakeComponent implements OnInit {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Method to restart a stopped job
|
||||||
|
restartJob() {
|
||||||
|
if (!this.schedulerJob || !this.schedulerJob.id) {
|
||||||
|
this.toastr.error('No job selected');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// To restart a job, we need to create a new job with the same parameters
|
||||||
|
const jobData = {
|
||||||
|
name: this.schedulerJob.name,
|
||||||
|
status: 'RUNNING',
|
||||||
|
description: this.schedulerJob.description,
|
||||||
|
jobType: this.schedulerJob.jobType,
|
||||||
|
lakeid: this.schedulerJob.lakeid
|
||||||
|
};
|
||||||
|
|
||||||
|
this.schedulerService.createJob(jobData).subscribe(
|
||||||
|
(job: any) => {
|
||||||
|
this.schedulerJob = job;
|
||||||
|
this.toastr.success('Job restarted successfully');
|
||||||
|
},
|
||||||
|
(error) => {
|
||||||
|
console.error('Error restarting job:', error);
|
||||||
|
this.toastr.error('Failed to restart job');
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Method to close scheduler modal
|
// Method to close scheduler modal
|
||||||
closeSchedulerModal() {
|
closeSchedulerModal() {
|
||||||
this.showSchedulerModal = false;
|
this.showSchedulerModal = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user