feat(web): show datetime

This commit is contained in:
arkohut 2024-07-29 16:39:48 +08:00
parent 7029ebc5b8
commit 367b818992
2 changed files with 14 additions and 1 deletions

View File

@ -11,6 +11,10 @@
* @type {number}
*/
export let library_id;
/**
* @type {number}
*/
export let created_at;
/**
* @type {number}
*/
@ -101,7 +105,9 @@
<div class="flex flex-col md:flex-row h-full">
<!-- Image container -->
<div class="flex-none w-full md:w-1/2 h-full">
<img class="w-full h-full object-contain" src={image} alt={title} />
<a href={image} target="_blank" rel="noopener noreferrer">
<img class="w-full h-full object-contain" src={image} alt={title} />
</a>
</div>
<!-- Description container -->
<div class="mt-4 md:mt-0 md:ml-6 overflow-y-auto max-h-full">
@ -122,6 +128,12 @@
<span class="mt-1 text-sm leading-tight font-medium text-gray-500 font-mono">
{folder_id}
</span>
<span class="uppercase tracking-wide text-sm text-indigo-600 font-bold ml-4"
>DATETIME</span
>
<span class="mt-1 text-xs leading-tight font-xs text-gray-500 font-mono">
{new Date(created_at * 1000).toLocaleString()}
</span>
<div>
<span class="mt-1 text-xs leading-tight font-xs text-gray-500 font-mono">
{filepath}

View File

@ -146,6 +146,7 @@
library_id={searchResults[selectedImage].library_id}
folder_id={searchResults[selectedImage].folder_id}
image={`${apiEndpoint}/files/${searchResults[selectedImage].filepath}`}
created_at={searchResults[selectedImage].file_created_at}
filepath={searchResults[selectedImage].filepath}
title={filename(searchResults[selectedImage].filepath)}
tags={searchResults[selectedImage].tags}