mirror of
https://github.com/gchq/CyberChef
synced 2025-01-24 02:05:02 +00:00
Turn input tabs into progress bars
This commit is contained in:
parent
9d60ef5f72
commit
713f10e63a
2 changed files with 7 additions and 1 deletions
|
@ -212,6 +212,12 @@ class InputWaiter {
|
||||||
handleLoaderMessage(e) {
|
handleLoaderMessage(e) {
|
||||||
const r = e.data;
|
const r = e.data;
|
||||||
|
|
||||||
|
if (r.hasOwnProperty("progress") && r.hasOwnProperty("inputNum")) {
|
||||||
|
this.manager.tabs.updateInputTabProgress(r.inputNum, r.progress, 100);
|
||||||
|
} else if (r.hasOwnProperty("fileBuffer")) {
|
||||||
|
this.manager.tabs.updateInputTabProgress(r.inputNum, 100, 100);
|
||||||
|
}
|
||||||
|
|
||||||
if (r.hasOwnProperty("fileBuffer")) {
|
if (r.hasOwnProperty("fileBuffer")) {
|
||||||
this.inputWorker.postMessage({
|
this.inputWorker.postMessage({
|
||||||
action: "loaderWorkerMessage",
|
action: "loaderWorkerMessage",
|
||||||
|
|
|
@ -413,7 +413,7 @@ class TabWaiter {
|
||||||
if (tabItem === null) return;
|
if (tabItem === null) return;
|
||||||
|
|
||||||
const percentComplete = (progress / total) * 100;
|
const percentComplete = (progress / total) * 100;
|
||||||
if (percentComplete === 100 || progress === false) {
|
if (percentComplete >= 100 || progress === false) {
|
||||||
tabItem.style.background = "";
|
tabItem.style.background = "";
|
||||||
} else {
|
} else {
|
||||||
tabItem.style.background = `linear-gradient(to right, var(--title-background-colour) ${percentComplete}%, var(--primary-background-colour) ${percentComplete}%)`;
|
tabItem.style.background = `linear-gradient(to right, var(--title-background-colour) ${percentComplete}%, var(--primary-background-colour) ${percentComplete}%)`;
|
||||||
|
|
Loading…
Reference in a new issue