mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-22 07:46:16 -04:00
Turn output tabs into progress bars!
This commit is contained in:
parent
5a52e5e9b3
commit
9d60ef5f72
5 changed files with 101 additions and 8 deletions
|
@ -221,9 +221,11 @@ class WorkerWaiter {
|
|||
}
|
||||
break;
|
||||
case "statusMessage":
|
||||
// Status message should be done per output
|
||||
this.manager.output.updateOutputMessage(r.data.message, r.data.inputNum, true);
|
||||
break;
|
||||
case "progressMessage":
|
||||
this.manager.output.updateOutputProgress(r.data.progress, r.data.total, r.data.inputNum);
|
||||
break;
|
||||
case "optionUpdate":
|
||||
log.debug(`Setting ${r.data.option} to ${r.data.value}`);
|
||||
this.app.options[r.data.option] = r.data.value;
|
||||
|
@ -256,7 +258,12 @@ class WorkerWaiter {
|
|||
}
|
||||
this.manager.output.updateOutputProgress(progress, inputNum);
|
||||
this.manager.output.updateOutputValue(data, inputNum, false);
|
||||
this.manager.output.updateOutputStatus("baked", inputNum);
|
||||
|
||||
if (progress !== false) {
|
||||
this.manager.output.updateOutputStatus("error", inputNum);
|
||||
} else {
|
||||
this.manager.output.updateOutputStatus("baked", inputNum);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -319,6 +326,11 @@ class WorkerWaiter {
|
|||
this.manager.output.updateOutputStatus("inactive", this.inputNums[i]);
|
||||
}
|
||||
|
||||
const tabList = this.manager.tabs.getOutputTabList();
|
||||
for (let i = 0; i < tabList.length; i++) {
|
||||
this.manager.tabs.getOutputTabItem(tabList[i]).style.background = "";
|
||||
}
|
||||
|
||||
this.inputs = [];
|
||||
this.inputNums = [];
|
||||
this.totalOutputs = 0;
|
||||
|
@ -642,7 +654,7 @@ class WorkerWaiter {
|
|||
const bakeButton = document.getElementById("bake");
|
||||
if (this.app.baking) {
|
||||
if (percentComplete < 100) {
|
||||
document.getElementById("bake").style.background = `linear-gradient(to left, #fea79a ${percentComplete}%, #f44336 ${percentComplete}%)`;
|
||||
bakeButton.style.background = `linear-gradient(to left, #fea79a ${percentComplete}%, #f44336 ${percentComplete}%)`;
|
||||
} else {
|
||||
bakeButton.style.background = "";
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue