Files
alhp-web/status.html
2023-12-14 16:48:04 +01:00

179 lines
7.8 KiB
HTML

<!DOCTYPE html>
<html lang="en" data-bs-theme="dark">
<head>
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1" name="viewport">
<title>ALHP Status</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<link crossorigin="anonymous" href="https://cdn.jsdelivr.net/npm/fork-awesome@1.2.0/css/fork-awesome.min.css"
integrity="sha256-XoaMnoYC5TH6/+ihMEnospgm0J1PM/nioxbOUdnM8HY=" rel="stylesheet">
</head>
<body>
<nav class="navbar navbar-expand-lg sticky-top navbar-light bg-info">
<div class="container">
<div class="d-flex justify-content-start">
<span class="navbar-brand align-middle">ALHP Status</span>
<span class="navbar-text">
<a class="align-middle" href="https://somegit.dev/ALHP/ALHP.GO"><i
class="fa fa-gitea fs-4"></i></a>
</span>
</div>
<div class="d-flex justify-content-end">
<input type="search" placeholder="Search for packages.." class="form-control" id="table-sort-input"
title="Search for package"/>
</div>
</div>
</nav>
<div class="container">
<div class="pt-4 pb-4">
<h4>Buildserver Stats</h4>
<iframe allowtransparency="true" class="container-fluid rounded-1 overflow-hidden" height="420px"
src="https://stats.itsh.dev/public-dashboards/0fb04abb0c5e4b7390cf26a98e6dead1"></iframe>
</div>
<h3 class="mt-5">Packages</h3>
<table class="table table-sorted">
<thead>
<tr>
<th scope="col">Pkgbase</th>
<th scope="col">Status</th>
<th scope="col">Reason</th>
<th class="text-center" scope="col"
title="link time optimization&#10;does not guarantee that package is actually build with LTO">
LTO
</th>
<th class="text-center" scope="col" title="Debug-symbols available via debuginfod">DS
</th>
<th scope="col">Archlinux Version</th>
<th scope="col">ALHP Version</th>
<th class="text-end" scope="col">Info</th>
</tr>
</thead>
<tbody id="main-tbody">
{{range $pkg := $repo.Packages}}
<tr class="table-{{$pkg.Class}}"
id="{{$repo.Name}}-{{$march.Name}}-{{$pkg.Pkgbase}}">
<td>{{$pkg.Pkgbase}}</td>
<td>{{$pkg.Status}}</td>
<td>{{$pkg.Skip}}</td>
<td class="text-center fs-6">
{{if $pkg.LTO}}<i class="fa fa-check fa-lg" style="color: var(--bs-success)"
title="build with LTO"></i>{{end}}
{{if $pkg.LTODisabled}}<i class="fa fa-times fa-lg" style="color: var(--bs-danger)"
title="LTO explicitly disabled"></i>{{end}}
{{if $pkg.LTOAutoDisabled}}<i class="fa fa-times-circle-o fa-lg"
style="color: var(--bs-danger)"
title="LTO automatically disabled"></i>{{end}}
{{if $pkg.LTOUnknown}}<i class="fa fa-hourglass-o fa-lg"
title="not build with LTO yet"></i>{{end}}
</td>
<td class="text-center fs-6">
{{if $pkg.DebugSym}}<i class="fa fa-check fa-lg" style="color: var(--bs-success)"
title="Debug symbols available"></i>{{end}}
{{if $pkg.DebugSymNotAvailable}}<i class="fa fa-times fa-lg"
style="color: var(--bs-danger)"
title="Not build with debug symbols"></i>{{end}}
{{if $pkg.DebugSymUnknown}}<i class="fa fa-hourglass-o fa-lg"
title="Not build yet"></i>{{end}}
</td>
<td>{{$pkg.Svn2GitVersion}}</td>
<td>{{$pkg.Version}}</td>
<td class="text-end info-box">
{{with $pkg.Log}}<a href="{{.}}" title="build log"
><i class="fa fa-file-text fa-lg"></i></a
>{{end}}
<a class="text-decoration-none fw-bold"
href="https://archlinux.org/packages/?q={{$pkg.Pkgbase}}" title="ArchWeb">AW</a>
<a data-bs-html="true" data-bs-placement="bottom" data-bs-toggle="tooltip"
href="#{{$repo.Name}}-{{$march.Name}}-{{$pkg.Pkgbase}}"
title="{{if $pkg.BuildDate}}Build on {{$pkg.BuildDate}}&#10;{{end}}{{if $pkg.BuildDuration}}CPU-Time: {{$pkg.BuildDuration}}&#10;{{end}}{{if $pkg.BuildMemory}}Peak-Memory: {{$pkg.BuildMemory}}&#10;{{end}}Last checked on {{$pkg.Checked}}">
<i class="fa fa-info-circle fa-lg"></i></a>
</td>
</tr>
{{end}}
</tbody>
</table>
</div>
<footer class="text-center text-lg-start bg-dark mt-3 fixed-bottom">
<div class="p-2 text-center">
{{.Latest}} <span class="text-primary">build</span>
{{.Queued}} <span class="text-warning">queued</span>
{{.Skipped}} <span class="text-secondary">skipped</span>
{{.Failed}} <span class="text-danger">failed</span>
||
LTO: {{.LTOEnabled}} <span class="text-success">enabled</span>
{{.LTODisabled}} <span class="text-danger">disabled</span>
{{.LTOUnknown}} <span class="text-secondary">unknown</span>
||
<span class="text-muted">{{.Generated}}</span>
</div>
</footer>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"
integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
<script>
let input = document.getElementById('table-sort-input');
let timeout = null;
function searchPackages() {
let new_tbody = document.createElement('tbody');
axios.get('https://api.alhp.dev/packages', {
params: {
pkgbase: (input.value.toLowerCase() ? input.value.toLowerCase() : undefined),
page: 1,
limit: 50,
}
})
.then(function (response) {
console.log(response)
let jResp = JSON.parse(response)
for (const pkg of jResp.packages) {
let ntr = document.createElement('tr')
ntr.classList.add("")
}
})
.catch(function (error) {
console.log(error);
})
.finally(function () {
// always executed
});
let input, filter, tr, td, i, txtValue;
input = document.getElementById('table-sort-input')
filter = input.value.toLowerCase()
const tables = document.getElementsByClassName('table-sorted');
for (let j = 0; j < tables.length; j++) {
tr = tables[j].getElementsByTagName('tr')
for (i = 0; i < tr.length; i++) {
td = tr[i].getElementsByTagName('td')[0]
if (td) {
txtValue = td.textContent || td.innerText
if (txtValue.toUpperCase().indexOf(filter) > -1) {
tr[i].style.display = ''
} else {
tr[i].style.display = 'none'
}
}
}
}
}
input.addEventListener('input', function (e) {
clearTimeout(timeout);
timeout = setTimeout(searchPackages, 200);
});
</script>
</body>
</html>