mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 23:06:16 -04:00
Fix more tab weirdness.
Move tab buttons onto tab bar. Calculate size of maxTabs automatically on page load. Display total execution time when a bake finishes.
This commit is contained in:
parent
1eadc08098
commit
b90cca77a9
4 changed files with 88 additions and 131 deletions
|
@ -275,7 +275,22 @@ class WorkerWaiter {
|
|||
*/
|
||||
bakingComplete() {
|
||||
this.setBakingStatus(false);
|
||||
let duration = new Date().getTime() - this.bakeStartTime;
|
||||
duration = duration.toString() + "ms";
|
||||
const progress = this.getBakeProgress();
|
||||
|
||||
let width = progress.total.toString().length;
|
||||
if (duration.length > width) {
|
||||
width = duration.length;
|
||||
}
|
||||
width = width < 2 ? 2 : width;
|
||||
|
||||
const totalStr = progress.total.toString().padStart(width, " ").replace(/ /g, " ");
|
||||
const durationStr = duration.padStart(width, " ").replace(/ /g, " ");
|
||||
|
||||
const msg = `Total: ${totalStr}<br>Time: ${durationStr}`;
|
||||
|
||||
document.getElementById("bake-info").innerHTML = msg;
|
||||
// look into changing this to something better
|
||||
// for (let i = 0; i < this.outputs.length; i++) {
|
||||
// if (this.outputs[i].data.error) {
|
||||
|
@ -308,6 +323,7 @@ class WorkerWaiter {
|
|||
*/
|
||||
bake(input, recipeConfig, options, progress, step) {
|
||||
this.setBakingStatus(true);
|
||||
this.bakeStartTime = new Date().getTime();
|
||||
|
||||
if (typeof input === "string") {
|
||||
input = [{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue