Skip to content

Commit a4cdc66

Browse files
committed
show server stat, but now not through web socket
1 parent 1cbbdb3 commit a4cdc66

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

bin/sparky-web.raku

+8-1
Original file line numberDiff line numberDiff line change
@@ -351,12 +351,19 @@ sub create-cro-app ($pool) {
351351

352352
$dbh.dispose;
353353

354-
template 'templates/projects.crotmp', {
354+
my @q = find-triggers($root);
355+
my $st = qx[uptime].chomp.subst(/.* "load"/,"load");
356+
my $core = qx[nproc --all].chomp;
355357

358+
template 'templates/projects.crotmp', {
359+
state => $st,
360+
core => $core,
361+
queue => @q.elems,
356362
http-root => sparky-http-root(),
357363
css => css($theme),
358364
navbar => navbar(),
359365
projects => @projects.sort(*.<project>),
366+
theme => "$theme",
360367

361368
}
362369

templates/projects.crotmp

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
<&HTML-AND-JAVASCRIPT(.navbar)>
66
<nav class="panel is-primary">
77
<p class="panel-heading">Projects</p>
8-
<!-- <div class="panel-block" id="notification"></div> -->
8+
<div class="panel-block" id="notification">
9+
<.state> | <.core> cpu cores | <.queue> builds in queue | theme: <.theme>
10+
</div>
911
<table class="table panel-block is-fullwidth">
1012
<tr>
1113
<td>Project</td>

0 commit comments

Comments
 (0)