mirror of
https://github.com/simon987/task_tracker.git
synced 2025-12-10 13:44:30 +00:00
Implement hard reset button
This commit is contained in:
@@ -118,4 +118,8 @@ export class ApiService {
|
||||
return this.http.post(this.url + `/project/reset_failed_tasks/${pid}`, null, this.options);
|
||||
}
|
||||
|
||||
hardReset(pid: number) {
|
||||
return this.http.post(this.url + `/project/hard_reset/${pid}`, null, this.options);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -414,18 +414,32 @@ export class ProjectDashboardComponent implements OnInit {
|
||||
this.dialog.open(AreYouSureComponent, {
|
||||
width: '250px',
|
||||
}).afterClosed().subscribe(result => {
|
||||
this.project.paused = paused;
|
||||
this.apiService.updateProject(this.project).subscribe(() => {
|
||||
this.translate.get('messenger.acknowledged').subscribe(t =>
|
||||
this.messenger.show(t));
|
||||
}, error => {
|
||||
this.translate.get('messenger.unauthorized').subscribe(t =>
|
||||
this.messenger.show(t));
|
||||
});
|
||||
if (result) {
|
||||
this.project.paused = paused;
|
||||
this.apiService.updateProject(this.project).subscribe(() => {
|
||||
this.translate.get('messenger.acknowledged').subscribe(t =>
|
||||
this.messenger.show(t));
|
||||
}, error => {
|
||||
this.translate.get('messenger.unauthorized').subscribe(t =>
|
||||
this.messenger.show(t));
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
hardReset() {
|
||||
|
||||
this.dialog.open(AreYouSureComponent, {
|
||||
width: '250px',
|
||||
}).afterClosed().subscribe(result => {
|
||||
if (result) {
|
||||
this.apiService.hardReset(this.project.id).subscribe(data => {
|
||||
this.translate.get('project.hard_reset_response').subscribe(t =>
|
||||
this.messenger.show(t + data['content']['affected_tasks']));
|
||||
}, error => {
|
||||
this.translate.get('messenger.unauthorized').subscribe(t =>
|
||||
this.messenger.show(t));
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,6 +71,7 @@
|
||||
"version": "Git version (commit hash)",
|
||||
"secret": "Secret",
|
||||
"reset_response": "Reset failed tasks: ",
|
||||
"hard_reset_response": "Deleted tasks: ",
|
||||
"assign_rate": "Task assign rate limit",
|
||||
"submit_rate": "Task submit rate limit",
|
||||
"rate": "per second",
|
||||
|
||||
@@ -71,6 +71,7 @@
|
||||
"manager_select": "Donner accès à",
|
||||
"version": "Version git (hash du commit)",
|
||||
"reset_response": "Réinitialisé les tâches en échec: ",
|
||||
"hard_reset_response": "Supprimé toutes les tâches: ",
|
||||
"assign_rate": "Taux d'assignation de tâches",
|
||||
"submit_rate": "Taux de soumission de tâches",
|
||||
"rate": "par seconde",
|
||||
|
||||
Reference in New Issue
Block a user