Commit 8146f9bb authored by Nicolas Wavrant's avatar Nicolas Wavrant

runner: correctly displays the "run log" after the build step, even if the...

runner: correctly displays the "run log" after the build step, even if the slapgrid process is very short in time
parent cd195d3b
...@@ -18,6 +18,7 @@ var logReadingPosition = 0; ...@@ -18,6 +18,7 @@ var logReadingPosition = 0;
var speed = 5000; var speed = 5000;
var maxLogSize = 100000; //Define the max limit of log to display ~ 2500 lines var maxLogSize = 100000; //Define the max limit of log to display ~ 2500 lines
var currentLogSize = 0; //Define the size of log actually displayed var currentLogSize = 0; //Define the size of log actually displayed
var last_run = "";
var runInstance = false; var runInstance = false;
$(document).ready(function () { $(document).ready(function () {
...@@ -106,20 +107,27 @@ function getRunningState() { ...@@ -106,20 +107,27 @@ function getRunningState() {
} else if (data.software.state) { } else if (data.software.state) {
currentProcess = processTypes.software; currentProcess = processTypes.software;
} }
if (last_run === "") {
last_run = data.instance.last_build;
}
$("#last_build_software").text("last build: " + data.software.last_build); $("#last_build_software").text("last build: " + data.software.last_build);
if (data.instance.last_build !== last_run) {
currentProcess = processTypes.instance;
last_run = data.instance.last_build;
}
$("#last_build_instance").text("last run: " + data.instance.last_build); $("#last_build_instance").text("last run: " + data.instance.last_build);
//show accurate right panel
writeLogs(data); writeLogs(data);
setRunningState(data); setRunningState(data);
//show accurate right panel
if (running) { if (running) {
$("#slapstate").show(); $("#slapstate").show();
$("#openloglist").hide(); $("#openloglist").hide();
} }
if(data.result) { if(data.result) {
updateStatus(currentProcess, "running"); if (currentProcess === processTypes.software && runInstance) {
if (runInstance) {
updateStatus("instance", "waiting"); updateStatus("instance", "waiting");
} }
updateStatus(currentProcess, "running");
} else { } else {
build_success = (data.software.success === 0)? "terminated":"failed"; build_success = (data.software.success === 0)? "terminated":"failed";
run_success = (data.instance.success === 0)? "terminated":"failed"; run_success = (data.instance.success === 0)? "terminated":"failed";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment