This commit is contained in:
Kuoi 2022-07-20 08:49:01 +01:00 committed by GitHub
parent b9e5375f72
commit e56a877ff6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,8 +3,9 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Archlinuxcn Packages</title> <title>bioarchlinux Packages</title>
<link rel="stylesheet" href="https://build.archlinuxcn.org/~imlonghao/static/1.10.20-jquery.dataTables.min.css"> <link rel="stylesheet" href="https://cdn.datatables.net/1.10.20/css/jquery.dataTables.min.css"
integrity="sha256-YY1izqyhIj4W3iyJOaGWOpXDSwrHWFL4Nfk+W0LyCHE=" crossorigin="anonymous">
<style> <style>
a { a {
white-space: nowrap; white-space: nowrap;
@ -15,8 +16,10 @@
<body> <body>
<table id="l" class="stripe cell-border" style="text-align:center"> <table id="l" class="stripe cell-border" style="text-align:center">
</table> </table>
<script src="https://build.archlinuxcn.org/~imlonghao/static/3.4.1-jquery.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.min.js"
<script src="https://build.archlinuxcn.org/~imlonghao/static/1.10.20-jquery.dataTables.min.js"></script> integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/datatables.net@1.10.20/js/jquery.dataTables.min.js"
integrity="sha256-LXQzPhL1IRyKkA7HpCOBi8I+OC8HqzHUYkjK8S+LKTs=" crossorigin="anonymous"></script>
<script> <script>
const DATE_FORMATTER = new Intl.DateTimeFormat(undefined, { const DATE_FORMATTER = new Intl.DateTimeFormat(undefined, {
timeStyle: "medium", timeStyle: "medium",
@ -24,7 +27,7 @@
hour12: false, hour12: false,
}); });
$(window).on('hashchange', function () { $(window).on('hashchange', function () {
url = window.location.hash.includes("#") ? "/imlonghao-api/pkg/" + window.location.hash.slice(1) : "/imlonghao-api/logs" url = window.location.hash.includes("#") ? "/api/pkg/" + window.location.hash.slice(1) : "/api/logs"
$.get(url, function (newDataArray) { $.get(url, function (newDataArray) {
let datatable = $('#l').DataTable() let datatable = $('#l').DataTable()
datatable.clear() datatable.clear()
@ -33,7 +36,7 @@
}); });
}); });
$(document).ready(function () { $(document).ready(function () {
url = window.location.hash.includes("#") ? "/imlonghao-api/pkg/" + window.location.hash.slice(1) : "/imlonghao-api/logs" url = window.location.hash.includes("#") ? "/api/pkg/" + window.location.hash.slice(1) : "/api/logs"
$('#l').DataTable({ $('#l').DataTable({
"searchDelay": 100, "searchDelay": 100,
"iDisplayLength": 100, "iDisplayLength": 100,
@ -46,22 +49,22 @@
"columnDefs": [ "columnDefs": [
{ {
targets: 0, targets: 0,
title: "包名", title: "Package Name",
data: "pkgbase" data: "pkgbase"
}, },
{ {
targets: 1, targets: 1,
title: "打包者", title: "Maintainer",
data: "maintainer" data: "maintainer"
}, },
{ {
targets: 2, targets: 2,
title: "版本号", title: "Package Version",
data: "pkg_version" data: "pkg_version"
}, },
{ {
targets: 3, targets: 3,
title: "状态", title: "Status",
data: "result", data: "result",
render: function (data, type, row, meta) { render: function (data, type, row, meta) {
switch (data) { switch (data) {
@ -74,17 +77,17 @@
}, },
{ {
targets: 4, targets: 4,
title: "持续时间(秒)", title: "Last Time (s)",
data: "elapsed" data: "elapsed"
}, },
{ {
targets: 5, targets: 5,
title: "CPU 使用率(%", title: "CPU Usage Percentage (%)",
data: "cpu" data: "cpu"
}, },
{ {
targets: 6, targets: 6,
title: "内存使用GiB", title: "RAM Usage (GiB)",
data: "memory", data: "memory",
render: function (data, type, row, meta) { render: function (data, type, row, meta) {
return data.toFixed(3) return data.toFixed(3)
@ -92,7 +95,7 @@
}, },
{ {
targets: 7, targets: 7,
title: "打包时间", title: "Last Packaging Time",
data: "ts", data: "ts",
render: function (data, type, row, meta) { render: function (data, type, row, meta) {
if (type == 'display') { if (type == 'display') {
@ -107,23 +110,23 @@
title: "GitHub", title: "GitHub",
data: "pkgbase", data: "pkgbase",
render: function (data, type, row, meta) { render: function (data, type, row, meta) {
return `<a href=https://github.com/archlinuxcn/repo/blob/master/archlinuxcn/${data}/ target=_blank rel=noopener>GitHub</a>` return `<a href=https://github.com/BioArchLinux/Packages/blob/master/BioArchLinux/${data}/ target=_blank rel=noopener>GitHub</a>`
} }
}, },
{ {
targets: 9, targets: 9,
title: "日志", title: "Log",
data: "ts", data: "ts",
render: function (data, type, row, meta) { render: function (data, type, row, meta) {
return `<a href=https://build.archlinuxcn.org/imlonghao-api/pkg/${row.pkgbase}/log/${Math.floor(data / 1000)} target=_blank rel=noopener>日志</a>` return `<a href=https://build.bioarchlinux.org/api/pkg/${row.pkgbase}/log/${Math.floor(data / 1000)} target=_blank rel=noopener>Log</a>`
} }
}, },
{ {
targets: 10, targets: 10,
title: "更多", title: "More",
data: "pkgbase", data: "pkgbase",
render: function (data, type, row, meta) { render: function (data, type, row, meta) {
return `<a href=#${data}>更多</a>` return `<a href=#${data}>More</a>`
} }
} }
] ]
@ -132,4 +135,4 @@
</script> </script>
</body> </body>
</html> </html>