[ui] LAST_VISITED into BrowseColumn, store in seconds

feat/vaults
Tomáš Mládek 2022-02-09 23:50:54 +01:00
parent a9e60d4722
commit 52b18a4916
No known key found for this signature in database
GPG Key ID: ED21612889E75EC5
3 changed files with 9 additions and 7 deletions

View File

@ -15,6 +15,12 @@
function visit() {
window.open(normUrl(`/browse/${address}`), "_blank");
}
$: fetch(`api/obj/${address}/LAST_VISITED`, {
method: "PUT",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ t: "Number", c: new Date().getTime() / 1000 }),
});
</script>
<div class="view" class:editable>

View File

@ -160,12 +160,6 @@
await fetch(`api/obj/${address}`, { method: "DELETE" });
revalidate();
}
$: fetch(`api/obj/${address}/LAST_VISITED`, {
method: "PUT",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ t: "Number", c: new Date().getTime() }),
});
</script>
<div class="inspect">

View File

@ -68,7 +68,9 @@
<table>
{#each lastVisited as [address, visited]}
<tr>
<td class="timestamp">{formatRelative(visited, new Date())}</td>
<td class="timestamp"
>{formatRelative(visited * 1000, new Date())}</td
>
<td class="object"><UpObject link {address} /></td>
</tr>
{/each}