|
|
@@ -182,6 +182,10 @@ export default defineComponent({
|
|
|
displayLength: 20000,
|
|
|
classes: "warn",
|
|
|
});
|
|
|
+ } else if (content.method === "optiStart") {
|
|
|
+ this.optimisationInProgress = true;
|
|
|
+ } else if (content.method === "optiStop") {
|
|
|
+ this.optimisationInProgress = false;
|
|
|
} else {
|
|
|
this.$store.dispatch(ActionTypes.commitRemote, content);
|
|
|
}
|
|
|
@@ -337,6 +341,13 @@ export default defineComponent({
|
|
|
headers: { "Content-Type": "application/json" },
|
|
|
};
|
|
|
this.optimisationInProgress = true;
|
|
|
+ const msg: PlanningUpdateMessage = {
|
|
|
+ uuid: this.uuid,
|
|
|
+ user: this.username,
|
|
|
+ method: "optiStart",
|
|
|
+ payload: "",
|
|
|
+ };
|
|
|
+ this.stompClient?.send("/app/notify", {}, JSON.stringify(msg));
|
|
|
fetch(`${API_URL}planning/solve`, options)
|
|
|
.then((response) => {
|
|
|
if (response.status == 200) {
|
|
|
@@ -349,10 +360,14 @@ export default defineComponent({
|
|
|
.catch((error) => {
|
|
|
toast({ html: "Pas de réponse du serveur<br>" + error.toString(), classes: "error" });
|
|
|
this.optimisationInProgress = false;
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ msg.method = "optiStop";
|
|
|
+ this.stompClient?.send("/app/notify", {}, JSON.stringify(msg));
|
|
|
+ this.optimisationInProgress = false;
|
|
|
});
|
|
|
},
|
|
|
updatePlanningWithNewPairing(data: SolverOutput): void {
|
|
|
- this.optimisationInProgress = false;
|
|
|
// Display message from the solver
|
|
|
toast({
|
|
|
html: "Le planning a été mis à jour <br>Score : " + data.score,
|