mirror of
https://github.com/diced/zipline.git
synced 2026-01-05 17:28:33 -08:00
add shortens js
This commit is contained in:
@@ -200,6 +200,32 @@ document.getElementById('updateStatistics').addEventListener('click', async () =
|
||||
}
|
||||
});
|
||||
|
||||
document.getElementById('updateShortens').addEventListener('click', async () => {
|
||||
const resp = await fetch('/api/shortens', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
});
|
||||
const json = await resp.json();
|
||||
|
||||
console.log(json);
|
||||
try {
|
||||
document.getElementById('shortensTable').innerHTML = '';
|
||||
for (const shorten of json) {
|
||||
$('#shortensTableShortens').append(`
|
||||
<tr>
|
||||
<th scope="row">${shorten.id}</th>
|
||||
<td><a href="${c.origin}">${c.origin}</a></td>
|
||||
<td><a href="${c.url}">${c.url}</a></td>
|
||||
</tr>
|
||||
`)
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
const deleteImage = (id, url) => {
|
||||
|
||||
Reference in New Issue
Block a user