mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 23:06:16 -04:00
Added status message mechanism for the Worker to report to the app
This commit is contained in:
parent
6af82680f1
commit
d68523a54e
6 changed files with 73 additions and 23 deletions
|
@ -118,24 +118,7 @@ App.prototype.handleError = function(err) {
|
|||
App.prototype.setBakingStatus = function(bakingStatus) {
|
||||
this.baking = bakingStatus;
|
||||
|
||||
let outputLoader = document.getElementById("output-loader"),
|
||||
outputElement = document.getElementById("output-text");
|
||||
|
||||
if (bakingStatus) {
|
||||
this.manager.controls.hideStaleIndicator();
|
||||
this.bakingStatusTimeout = setTimeout(function() {
|
||||
outputElement.disabled = true;
|
||||
outputLoader.style.visibility = "visible";
|
||||
outputLoader.style.opacity = 1;
|
||||
this.manager.controls.toggleBakeButtonFunction(true);
|
||||
}.bind(this), 200);
|
||||
} else {
|
||||
clearTimeout(this.bakingStatusTimeout);
|
||||
outputElement.disabled = false;
|
||||
outputLoader.style.opacity = 0;
|
||||
outputLoader.style.visibility = "hidden";
|
||||
this.manager.controls.toggleBakeButtonFunction(false);
|
||||
}
|
||||
this.manager.output.toggleLoader(bakingStatus);
|
||||
};
|
||||
|
||||
|
||||
|
@ -194,6 +177,9 @@ App.prototype.handleChefMessage = function(e) {
|
|||
this.workerLoaded = true;
|
||||
this.loaded();
|
||||
break;
|
||||
case "statusMessage":
|
||||
this.manager.output.setStatusMsg(e.data.data);
|
||||
break;
|
||||
default:
|
||||
console.error("Unrecognised message from ChefWorker", e);
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue