Skip to content

Commit

Permalink
Merge pull request #109 from kodaline/i_103
Browse files Browse the repository at this point in the history
add: display doc metadata
  • Loading branch information
zAlweNy26 authored Oct 22, 2024
2 parents 62964c4 + f7d55a6 commit 5e8838a
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/components/MemorySelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ defineProps<{
}>()
const selectedCollection = ref('episodic')
const showMeta = ref(false)
const selectedItem = ref('')
const showMetadata = (id: string) => {
selectedItem.value = selectedItem.value === id ? '' : id;
}
</script>

<template>
Expand Down Expand Up @@ -41,6 +46,23 @@ const selectedCollection = ref('episodic')
<p class="truncate">{{ item.metadata.source }} {{ item.metadata.name ? `(${item.metadata.name})` : '' }}</p>
<p class="whitespace-nowrap">{{ new Date(item.metadata.when * 1000).toLocaleString() }}</p>
</div>
<div
class="indicator-item indicator-center tooltip before:rounded-lg pt-8 before:font-medium before:text-base-100"
>
<span class="badge badge-neutral cursor-pointer font-medium text-base-100" @click="showMetadata(item.id)">
{{ selectedItem === item.id ? 'Hide Metadata' : 'View Metadata' }}
</span>
</div>
<div v-if="selectedItem === item.id" class="font-medium text-base-100 shadow-lg">
<ul class="list-disc">
<li v-for="(el, value) in item.metadata" :key="value" class="flex justify-between items-center py-2">
<div class="flex flex-col text-left">
<div class="text-sm font-semibold text-neutral/90">{{ value }}</div>
</div>
<div class="text-sm text-right text-neutral/70">{{ el }}</div>
</li>
</ul>
</div>
</div>
</template>
<p v-else class="text-center text-sm font-medium">
Expand Down

0 comments on commit 5e8838a

Please sign in to comment.