gitlab-jobs/runners.html

59 lines
1.1 KiB
HTML
Raw Permalink Normal View History

2022-06-20 04:17:48 +00:00
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.css">
<style>
table tbody tr:hover {
cursor: pointer;
}
</style>
</head>
<body>
<h1>Pick a runner</h1>
<table>
<thead>
<tr class="heading">
<th>ID</th>
<th>Description</th>
</tr>
</thead>
<tbody></tbody>
</table>
<a href="runner.html">Show all runners</a>
<div class="template">
<table>
<tr>
<td class="id"></td>
<td class="desc"></td>
</tr>
</table>
</div>
2022-06-20 04:17:48 +00:00
<script src="common.js"></script>
<script>
const template = $('.template')
2022-06-20 04:17:48 +00:00
const table = $('tbody')
listRunners()
.then(runners => {
runners.forEach(runner => {
const fragment = initTemplate(template, {
id: runner.id,
desc: runner.description
})
const row = $(fragment, 'tr')
row.addEventListener('click', ev => {
2022-06-20 04:17:48 +00:00
document.location.href = 'runner.html?id=' + runner.id
})
table.appendChild(row)
2022-06-20 04:17:48 +00:00
})
})
2022-06-20 12:45:59 +00:00
.catch(err => {
console.error(err)
alert(err.toString())
})
2022-06-20 04:17:48 +00:00
</script>
</body>
</html>