UI: Agregar botones de copiar en paneles de debug de ChatItem y MessageBubble
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m2s
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m2s
This commit is contained in:
@@ -43,6 +43,16 @@
|
|||||||
v-if="showDebug"
|
v-if="showDebug"
|
||||||
class="mx-2 mb-2 p-2 rounded bg-gray-900 border border-gray-700 text-xs font-mono overflow-x-auto"
|
class="mx-2 mb-2 p-2 rounded bg-gray-900 border border-gray-700 text-xs font-mono overflow-x-auto"
|
||||||
>
|
>
|
||||||
|
<div class="flex items-center justify-between mb-1">
|
||||||
|
<span class="text-gray-400">Chat:</span>
|
||||||
|
<button
|
||||||
|
@click.stop="copyToClipboard(JSON.stringify(chat, null, 2))"
|
||||||
|
class="px-2 py-1 rounded bg-gray-700 hover:bg-gray-600 text-gray-300"
|
||||||
|
title="Copiar al portapapeles"
|
||||||
|
>
|
||||||
|
<UIcon name="i-lucide-copy" class="w-3 h-3" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
<pre class="text-green-400 whitespace-pre-wrap">{{ JSON.stringify(chat, null, 2) }}</pre>
|
<pre class="text-green-400 whitespace-pre-wrap">{{ JSON.stringify(chat, null, 2) }}</pre>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -71,6 +81,14 @@ defineEmits<{
|
|||||||
|
|
||||||
const showDebug = ref(false)
|
const showDebug = ref(false)
|
||||||
|
|
||||||
|
const copyToClipboard = async (text: string) => {
|
||||||
|
try {
|
||||||
|
await navigator.clipboard.writeText(text)
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Failed to copy:', err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const formatTime = (date: Date) => {
|
const formatTime = (date: Date) => {
|
||||||
const d = new Date(date)
|
const d = new Date(date)
|
||||||
const now = new Date()
|
const now = new Date()
|
||||||
|
|||||||
@@ -52,6 +52,16 @@
|
|||||||
v-if="showDebug"
|
v-if="showDebug"
|
||||||
class="max-w-[90%] mt-1 p-2 rounded bg-gray-900 border border-gray-700 text-xs font-mono overflow-x-auto"
|
class="max-w-[90%] mt-1 p-2 rounded bg-gray-900 border border-gray-700 text-xs font-mono overflow-x-auto"
|
||||||
>
|
>
|
||||||
|
<div class="flex items-center justify-between mb-1">
|
||||||
|
<span class="text-gray-400">Message:</span>
|
||||||
|
<button
|
||||||
|
@click="copyToClipboard(JSON.stringify(message, null, 2))"
|
||||||
|
class="px-2 py-1 rounded bg-gray-700 hover:bg-gray-600 text-gray-300"
|
||||||
|
title="Copiar al portapapeles"
|
||||||
|
>
|
||||||
|
<UIcon name="i-lucide-copy" class="w-3 h-3" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
<pre class="text-green-400 whitespace-pre-wrap">{{ JSON.stringify(message, null, 2) }}</pre>
|
<pre class="text-green-400 whitespace-pre-wrap">{{ JSON.stringify(message, null, 2) }}</pre>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -77,6 +87,14 @@ const props = defineProps<Props>()
|
|||||||
|
|
||||||
const showDebug = ref(false)
|
const showDebug = ref(false)
|
||||||
|
|
||||||
|
const copyToClipboard = async (text: string) => {
|
||||||
|
try {
|
||||||
|
await navigator.clipboard.writeText(text)
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Failed to copy:', err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const formatTime = (date: Date) => {
|
const formatTime = (date: Date) => {
|
||||||
return new Date(date).toLocaleTimeString('es-AR', {
|
return new Date(date).toLocaleTimeString('es-AR', {
|
||||||
hour: '2-digit',
|
hour: '2-digit',
|
||||||
|
|||||||
Reference in New Issue
Block a user