Skip to content

Commit

Permalink
Show the trace if any, if failed
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthieuBarba committed May 1, 2024
1 parent 623f2ff commit df578c9
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
13 changes: 13 additions & 0 deletions css/upload.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,19 @@
background: #71FF71;
}

#trace_content {
text-align: left;
font-family: monospace;
border: 1px solid white;
background-color: #333;
color: white;
padding: 1em;
}

.boxtitle {
cursor: pointer;
}

.warning {
color: #C22;
}
21 changes: 21 additions & 0 deletions js/createdb.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,19 @@ function continuous_check(id) {
console.log("Error encountered: " + config.details);
}
// Don't continue!
} else if (config.status == "failed") {
if (config.details) {
console.log("Error encountered: " + config.details);
}
if (config.trace) {
trace_str = config.trace.replaceAll("\n", "<br />");
trace_box = $("<div />").attr("class", "subbox");
trace_title = $("<div />").attr("class", "boxtitle").text("Log trace...");
trace_content = $("<div />").attr("class", "boxcontent").attr("id", "trace_content").html(trace_str);
trace_box.append(trace_title).append(trace_content);
$('#building').append(trace_box);
hide_boxes();
}
} else {
window.setTimeout(function() {
continuous_check(id);
Expand All @@ -130,6 +143,14 @@ function finish(id) {
console.log("Check over");
}


function hide_boxes() {
$(".boxcontent").hide();
$(".boxtitle").on('click', function() {
$(this).parent().find(".boxcontent").toggle();
});
}

jQuery(function() {
var pars = get_url_parameters();
var id = pars.id;
Expand Down

0 comments on commit df578c9

Please sign in to comment.