Compare commits

...

3 Commits

Author SHA1 Message Date
f199800040 sort leases by expires 2023-01-03 21:29:32 +01:00
ca96ae08a7 sort origins by hostname 2023-01-03 21:29:24 +01:00
49279b6b66 fixed origin table 2023-01-03 21:23:57 +01:00

View File

@ -31,13 +31,13 @@ async function fetchOriginsWithLeases(element) {
</tr>` </tr>`
table.appendChild(thead) table.appendChild(thead)
let tbody = document.createElement('thead'); let tbody = document.createElement('thead');
x.forEach((o) => { x.sort((a, b) => a.hostname.localeCompare(b.hostname)).forEach((o) => {
let row = document.createElement('tr'); let row = document.createElement('tr');
row.innerHTML = ` row.innerHTML = `
<td><code>${o.origin_ref}</code></td> <td><code>${o.origin_ref}</code></td>
<td>${o.hostname}</td> <td>${o.hostname}</td>
<td>${o.os_platform}</td> <td>${o.os_platform} (${o.os_version})</td>
<td>${o.os_version}</td> <td>${o.guest_driver_version}</td>
<td>${o.leases.map(x => `<code title="expires: ${x.lease_expires}">${x.lease_ref}</code>`).join(', ')}</td>` <td>${o.leases.map(x => `<code title="expires: ${x.lease_expires}">${x.lease_ref}</code>`).join(', ')}</td>`
tbody.appendChild(row); tbody.appendChild(row);
}) })
@ -70,7 +70,7 @@ async function fetchLeases(element) {
</tr>` </tr>`
table.appendChild(thead) table.appendChild(thead)
let tbody = document.createElement('thead'); let tbody = document.createElement('thead');
x.forEach((o) => { x.sort((a, b) => new Date(a.lease_expires) - new Date(b.lease_expires)).forEach((o) => {
let row = document.createElement('tr'); let row = document.createElement('tr');
row.innerHTML = ` row.innerHTML = `
<td><code>${o.lease_ref}</code></td> <td><code>${o.lease_ref}</code></td>