Skip to content

Commit

Permalink
new helper
Browse files Browse the repository at this point in the history
  • Loading branch information
melezhik committed Jan 12, 2024
1 parent 1ec19cd commit 642859d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions .tom/restart.raku
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bash "sparman.raku worker_ui stop && sparman.raku worker_ui start";
4 changes: 2 additions & 2 deletions templates/build.crotmp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@

ws.onmessage = function(e) {
console.log('ws - ', e.data);
log.innerHTML = `<span class="tag is-info">${e.data}</span>`;
log.innerHTML = `<span class="tag is-black">${e.data}</span>`;
// log.innerHTML += "<br>";
};

Expand Down Expand Up @@ -130,7 +130,7 @@
})
.then(function(job_id) {
// document.getElementById('notification').innerHTML += "<br>";
document.getElementById('notification').innerHTML = `<span class="tag is-info">Build queued: ${job_id}</span>`;
document.getElementById('notification').innerHTML = `<span class="tag is-black">Build queued: ${job_id}</span>`;
connect(job_id);
})
}
Expand Down
8 changes: 4 additions & 4 deletions templates/report2.crotmp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

ws2.onmessage = function(e) {
console.log('ws - status - ', e.data);
info.innerHTML = `<span class="tag is-info">${e.data}</span>`;
info.innerHTML = `<span class="tag is-black">${e.data}</span>`;
// log.innerHTML += "<br>";
};

Expand Down Expand Up @@ -77,15 +77,15 @@
})
.then(function(job_id) {
// document.getElementById('notification').innerHTML += "<br>";
document.getElementById('notification').innerHTML = `<span class="tag is-info">Build queued: ${job_id}</span>`;
document.getElementById('notification').innerHTML = `<span class="tag is-black">Build queued: ${job_id}</span>`;
connect2(job_id);
})
}

var log = document.getElementById('log');
var ansi_up = new AnsiUp;

info.innerHTML = '<span class="tag is-info">report loading ...</span>';
info.innerHTML = '<span class="tag is-black">report loading ...</span>';

function connect() {
var ws = new WebSocket(`ws://${ip}/livereport/<.project>/<.build_id>/<.job_id>`);
Expand All @@ -104,7 +104,7 @@ function connect() {

ws.onclose = function(e) {
console.log('ws - socket is closed', e.reason);
info.innerHTML = '<span class="tag is-info">report loaded</span>';
info.innerHTML = '<span class="tag is-black">report loaded</span>';
//setTimeout(function() {
// connect();
//}, 1000);
Expand Down

0 comments on commit 642859d

Please sign in to comment.