Skip to content

Commit

Permalink
Worker percentages
Browse files Browse the repository at this point in the history
  • Loading branch information
HaveAGitGat committed Feb 16, 2019
1 parent b2861b7 commit d52a66f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 10 deletions.
4 changes: 2 additions & 2 deletions HBBatchBeast/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const { app, BrowserWindow, Menu, ipcMain ,Tray} = electron;
let mainWindow;

//SET ENV
//process.env.NODE_ENV = "production";
process.env.NODE_ENV = "production";



Expand All @@ -43,7 +43,7 @@ app.on('ready', function () {
mainWindow = new BrowserWindow({
width: 1400,
height: 1000,
frame: false,
// frame: false,
title: 'HBBatchBeast'


Expand Down
27 changes: 20 additions & 7 deletions HBBatchBeast/mainWindow.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


//SET ENV
// process.env.NODE_ENV = "production";
process.env.NODE_ENV = "production";

var home = require("os").homedir();

Expand Down Expand Up @@ -53,11 +53,11 @@
}


// process.on('uncaughtException', function (err) {
// console.error(err.stack);
// fs.appendFileSync(homePath + '/HBBatchBeast/Logs/SystemErrorLog.txt', "Main thread error: " + err.stack + "\r\n", 'utf8');
// process.exit();
// });
process.on('uncaughtException', function (err) {
console.error(err.stack);
fs.appendFileSync(homePath + '/HBBatchBeast/Logs/SystemErrorLog.txt', "Main thread error: " + err.stack + "\r\n", 'utf8');
process.exit();
});



Expand Down Expand Up @@ -1554,6 +1554,8 @@

for (var i = 1; i <= document.getElementById("instanceNumber").value; i++) {



document.getElementById("workerStatusDiv").innerHTML += "<div id=\"worker" + i + "Status\"> </div>";

}
Expand Down Expand Up @@ -1780,7 +1782,7 @@
}


document.getElementById("worker" + message[0] + "Status").innerHTML = "<div class=\"grid-itemleft\"><p>Worker " + message[0] + " processing file:</p></div><div class=\"grid-itemright\"><p>" + sourceQueueArray[message[2]] + "</p></div>";
document.getElementById("worker" + message[0] + "Status").innerHTML = "<div class=\"grid-itemleft\"><p>Worker " + message[0] + " processing file:</p><div id=\"worker" + message[0] + "Percentage\"></div></div><div class=\"grid-itemright\"><p>" + sourceQueueArray[message[2]] + "</p></div>";


// workerStatusDiv
Expand All @@ -1790,6 +1792,11 @@
if (message[1] == "percentage") {


// document.getElementById("workerStatusDiv").innerHTML += "<div id=\"worker" + i + "Status\"> </div>";

document.getElementById("worker" + message[0] + "Percentage").innerHTML = "<p>" + message[3] + "</p>";


var currentRow = parseInt(message[2]) + 1

if (queueView == "enabled") {
Expand Down Expand Up @@ -1821,6 +1828,8 @@
queueTable.rows[currentRow].style.backgroundColor = "#ff2d2d";
}

document.getElementById("worker" + message[0] + "Percentage").innerHTML = "<p>Error</p>";


fullErrorLogArray[message[2]] =message[4];

Expand All @@ -1845,6 +1854,8 @@
queueTable.rows[currentRow].style.backgroundColor = "#59ff74";
}

document.getElementById("worker" + message[0] + "Percentage").innerHTML = "<p>Completed</p>";

fullErrorLogArray[message[2]] =message[4];

successfulCount++;
Expand Down Expand Up @@ -2830,6 +2841,8 @@
document.getElementById("pauseButtonDiv").style.display = 'none';
document.getElementById("continueButtonDiv").style.display = 'block';

alert("Queue will be paused once current items have finished processing. Please do not press 'Continue queue' until all workers have paused.")

}

function continueQueue(){
Expand Down
2 changes: 1 addition & 1 deletion HBBatchBeast/worker1.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//SET ENV
//process.env.NODE_ENV = "production";
process.env.NODE_ENV = "production";

var shell = require('shelljs');

Expand Down

0 comments on commit d52a66f

Please # to comment.