59 lines
1.5 KiB
HTML
59 lines
1.5 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>DIUN Updates</title>
|
|
<style>
|
|
body { font-family: sans-serif; background: #111; color: #eee; }
|
|
table { border-collapse: collapse; width: 100%; }
|
|
th, td { padding: 8px; border-bottom: 1px solid #333; }
|
|
th { text-align: left; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h2>Available Image Updates</h2>
|
|
<table id="updates">
|
|
<thead>
|
|
<tr>
|
|
<th>Image</th>
|
|
<th>Status</th>
|
|
<th>Hostname</th>
|
|
<th>Provider</th>
|
|
<th>Digest</th>
|
|
<th>Created</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody></tbody>
|
|
</table>
|
|
|
|
<script>
|
|
async function load() {
|
|
const res = await fetch('/api/updates');
|
|
const data = await res.json();
|
|
const tbody = document.querySelector('tbody');
|
|
tbody.textContent = '';
|
|
|
|
Object.values(data).forEach(update => {
|
|
const row = document.createElement('tr');
|
|
const fields = [
|
|
update.image,
|
|
update.status,
|
|
update.hostname,
|
|
update.provider,
|
|
update.digest,
|
|
update.created ? new Date(update.created).toLocaleString() : '',
|
|
];
|
|
fields.forEach(value => {
|
|
const td = document.createElement('td');
|
|
td.textContent = value || '';
|
|
row.appendChild(td);
|
|
});
|
|
tbody.appendChild(row);
|
|
});
|
|
}
|
|
|
|
setInterval(load, 5000);
|
|
load();
|
|
</script>
|
|
</body>
|
|
</html>
|