Add reclaim assigned tasks button

This commit is contained in:
simon987
2019-03-27 19:35:06 -04:00
parent 470b1b162b
commit ae32cb43d1
9 changed files with 85 additions and 2 deletions

View File

@@ -122,4 +122,8 @@ export class ApiService {
return this.http.post(this.url + `/project/hard_reset/${pid}`, null, this.options);
}
reclaimAssignedTasks(pid: number) {
return this.http.post(this.url + `/project/reclaim_assigned_tasks/${pid}`, null, this.options);
}
}

View File

@@ -85,6 +85,10 @@
<mat-icon>warning</mat-icon>
{{"dashboard.hard_reset"|translate}}
</button>
<button mat-raised-button color="accent" (click)="reclaimAssignedTasks()">
<mat-icon>replay</mat-icon>
{{"dashboard.reclaim"|translate}}
</button>
</mat-expansion-panel>
</mat-card-content>

View File

@@ -442,4 +442,20 @@ export class ProjectDashboardComponent implements OnInit {
}
});
}
reclaimAssignedTasks() {
this.dialog.open(AreYouSureComponent, {
width: '250px',
}).afterClosed().subscribe(result => {
if (result) {
this.apiService.reclaimAssignedTasks(this.project.id).subscribe(data => {
this.translate.get('project.reclaim_response').subscribe(t =>
this.messenger.show(t + data['content']['affected_tasks']));
}, error => {
this.translate.get('messenger.unauthorized').subscribe(t =>
this.messenger.show(t));
});
}
});
}
}

View File

@@ -72,6 +72,7 @@
"secret": "Secret",
"reset_response": "Reset failed tasks: ",
"hard_reset_response": "Deleted tasks: ",
"reclaim_response": "Reclaimed tasks: ",
"assign_rate": "Task assign rate limit",
"submit_rate": "Task submit rate limit",
"rate": "per second",
@@ -87,7 +88,8 @@
"reset_failed": "Reset failed tasks",
"pause": "Pause",
"resume": "Resume",
"hard_reset": "Hard_reset"
"hard_reset": "Hard reset",
"reclaim": "Reclaim assigned tasks"
},
"login": {
"title": "Login",

View File

@@ -72,6 +72,7 @@
"version": "Version git (hash du commit)",
"reset_response": "Réinitialisé les tâches en échec: ",
"hard_reset_response": "Supprimé toutes les tâches: ",
"reclaim_response": "Désaffecté les tâches: ",
"assign_rate": "Taux d'assignation de tâches",
"submit_rate": "Taux de soumission de tâches",
"rate": "par seconde",
@@ -83,7 +84,8 @@
"metadata": "Métadonnés du projet",
"empty": "Aucune tâche",
"refresh": "Rafraîchir",
"actions": "Actions"
"actions": "Actions",
"reclaim": "Déaffecter les tâches"
},
"login": {
"title": "Ouvrir un session",