Compare commits
No commits in common. "87ea4186d189e9612b2e4b9c868e3ca4fbe8dcbd" and "3cc2460a9e108c74114842d41d920fc848a928df" have entirely different histories.
87ea4186d1
...
3cc2460a9e
56
index.php
56
index.php
@ -79,10 +79,9 @@
|
||||
return "❗";
|
||||
}
|
||||
|
||||
function micobu_get_build_icon($build, $verbose = false) {
|
||||
$verb = ($verbose ? ($build->result > 0 ? " Build failed with return code " . $build->result : " Build succeeded") : "");
|
||||
function micobu_get_build_icon($build) {
|
||||
if ($build->result > 0)
|
||||
return "<span title='Build failed with return code $build->result'>❌</span>$verb";
|
||||
return "<span title='Build failed with return code $build->result'>❌</span>";
|
||||
else
|
||||
return "<span title='Build succeeded'>✅</span>";
|
||||
}
|
||||
@ -95,10 +94,6 @@
|
||||
return MICOBU_BASE_LINK . "/" . $build->project->name . "/" . $build->hash . "/" . $filename;
|
||||
}
|
||||
|
||||
function micobu_get_dl_buttons($build) {
|
||||
return "<a title='Show log file' href='" . micobu_get_weblink($build, "log.txt") . "'>📰</a> <a title='Show meta info' href='" . micobu_get_weblink($build, "meta.json") . "'>🛈</a> <a title='Show artefacts' href='" . micobu_get_weblink($build, "") . "'>📂</a>";
|
||||
}
|
||||
|
||||
$projects = micobu_scan();
|
||||
|
||||
if (isset($_GET['p'])) {
|
||||
@ -127,7 +122,7 @@
|
||||
|
||||
This is the source code of Micobu's web dashboard.
|
||||
You can find more information on this system on:
|
||||
https://git.notsyncing.net/markus/micobu
|
||||
<link TBD>
|
||||
-->
|
||||
<head>
|
||||
<style>
|
||||
@ -158,33 +153,7 @@
|
||||
color: #666;
|
||||
text-align: right;
|
||||
}
|
||||
.logframe {
|
||||
width: 98vw;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
.log {
|
||||
font-size: 14pt;
|
||||
font-family: monospace;
|
||||
white-space: pre;
|
||||
overflow-x: scroll;
|
||||
}
|
||||
.tdnohighlight:hover {
|
||||
background-color: #222;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
function escapeHtml(text) {
|
||||
var map = {
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
'>': '>',
|
||||
'"': '"',
|
||||
"'": '''
|
||||
};
|
||||
return text.replace(/[&<>"']/g, function(m) { return map[m]; });
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
@ -198,28 +167,13 @@
|
||||
//var_dump($projects[$selected_project]->builds[$selected_hash]);
|
||||
$build = $projects[$selected_project]->builds[$selected_hash];
|
||||
echo "<table>";
|
||||
echo "<tr><td>Build status</td><td>" . micobu_get_build_icon($build, true). "</td></tr>";
|
||||
echo "<tr><td>Build status</td><td>" . micobu_get_build_icon($build). "</td></tr>";
|
||||
echo "<tr><td>Build time</td><td>" . micobu_get_build_time($build) . "</td></tr>";
|
||||
echo "<tr><td>Commit info</td><td>" . $build->hash . " (" . $build->description . ")</td></tr>";
|
||||
echo "<tr><td>Download</td><td>" . micobu_get_dl_buttons($build) . "</td></tr>";
|
||||
?>
|
||||
<tr><td class="tdnohighlight" colspan=2><hr></td></tr>
|
||||
<tr><td class="tdnohighlight" colspan=2><div class='logframe'><div class='log' id='buildlog'>Loading log...</div></div></td></tr>
|
||||
<script>
|
||||
var xhttp_ps = new XMLHttpRequest();
|
||||
xhttp_ps.onreadystatechange = function() {
|
||||
if (this.readyState == 4)
|
||||
document.getElementById("buildlog").innerHTML = (this.status == 200 ? escapeHtml(xhttp_ps.responseText) : "Error loading log.");
|
||||
};
|
||||
xhttp_ps.open("GET", "<?php echo MICOBU_BASE_LINK . "/$selected_project/$selected_hash/log.txt"; ?>", true);
|
||||
xhttp_ps.send();
|
||||
</script>
|
||||
<?php
|
||||
echo "</table>";
|
||||
} else if (isset($selected_project)) {
|
||||
echo "<table>";
|
||||
foreach ($projects[$selected_project]->builds as $hash => $build) {
|
||||
echo "<tr><td><a href='?p=$selected_project&h=$hash'>" . date(DATE_RFC2822, $build->time_start) . "</a></td><td>" . micobu_get_build_icon($build) . "</td><td><a title='$build->hash'href='?p=$selected_project&h=$hash'>" . $build->description . "</a></td><td>" . micobu_get_dl_buttons($build) . "</td></tr>";
|
||||
echo "<tr><td><a href='?p=$selected_project&h=$hash'>" . date(DATE_RFC2822, $build->time_start) . "</a></td><td>" . micobu_get_build_icon($build) . "</td><td><a title='$build->hash'href='?p=$selected_project&h=$hash'>" . $build->description . "</a></td><td><a title='Show log file' href='" . micobu_get_weblink($build, "log.txt") . "'>📰</a> <a title='Show meta info' href='" . micobu_get_weblink($build, "meta.json") . "'>🛈</a> <a title='Show artefacts' href='" . micobu_get_weblink($build, "") . "'>📂</a></td></tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user