feat(web): show folder library and filepath

This commit is contained in:
arkohut 2024-07-14 23:43:05 +08:00
parent 409e5c245f
commit b1993720e1
2 changed files with 38 additions and 6 deletions

View File

@ -7,10 +7,22 @@
* @type {string} * @type {string}
*/ */
export let id; export let id;
/**
* @type {number}
*/
export let library_id;
/**
* @type {number}
*/
export let folder_id;
/** /**
* @type {any} * @type {any}
*/ */
export let image; export let image;
/**
* @type {string}
*/
export let filepath;
/** /**
* @type {string} * @type {string}
*/ */
@ -98,6 +110,23 @@
<span class="mt-1 text-sm leading-tight font-medium text-gray-500 font-mono"> <span class="mt-1 text-sm leading-tight font-medium text-gray-500 font-mono">
{id} {id}
</span> </span>
<span class="uppercase tracking-wide text-sm text-indigo-600 font-bold ml-4"
>Library ID</span
>
<span class="mt-1 text-sm leading-tight font-medium text-gray-500 font-mono">
{library_id}
</span>
<span class="uppercase tracking-wide text-sm text-indigo-600 font-bold ml-4"
>Folder ID</span
>
<span class="mt-1 text-sm leading-tight font-medium text-gray-500 font-mono">
{folder_id}
</span>
<div>
<span class="mt-1 text-xs leading-tight font-xs text-gray-500 font-mono">
{filepath}
</span>
</div>
</div> </div>
<div class="uppercase tracking-wide text-sm text-indigo-600 font-bold">Image Title</div> <div class="uppercase tracking-wide text-sm text-indigo-600 font-bold">Image Title</div>
<p class="block mt-1 text-lg leading-tight font-medium text-black hover:underline"> <p class="block mt-1 text-lg leading-tight font-medium text-black hover:underline">
@ -119,10 +148,10 @@
<OCRTable ocrData={entry.value} /> <OCRTable ocrData={entry.value} />
{:else} {:else}
<pre class="bg-gray-100 p-2 rounded overflow-y-auto max-h-96">{JSON.stringify( <pre class="bg-gray-100 p-2 rounded overflow-y-auto max-h-96">{JSON.stringify(
entry.value, entry.value,
null, null,
2 2
)}</pre> )}</pre>
{/if} {/if}
{:else} {:else}
<!-- Render markdown content --> <!-- Render markdown content -->

View File

@ -143,7 +143,10 @@
{#if searchResults.length && showModal} {#if searchResults.length && showModal}
<Figure <Figure
id={searchResults[selectedImage].id} id={searchResults[selectedImage].id}
library_id={searchResults[selectedImage].library_id}
folder_id={searchResults[selectedImage].folder_id}
image={`${apiEndpoint}/files/${searchResults[selectedImage].filepath}`} image={`${apiEndpoint}/files/${searchResults[selectedImage].filepath}`}
filepath={searchResults[selectedImage].filepath}
title={filename(searchResults[selectedImage].filepath)} title={filename(searchResults[selectedImage].filepath)}
tags={searchResults[selectedImage].tags} tags={searchResults[selectedImage].tags}
metadata_entries={searchResults[selectedImage].metadata_entries} metadata_entries={searchResults[selectedImage].metadata_entries}