mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 12:25:20 +00:00
enh: copy table
This commit is contained in:
parent
b160eef7eb
commit
9df8d5b204
1 changed files with 15 additions and 2 deletions
|
|
@ -8,7 +8,7 @@
|
||||||
const { saveAs } = fileSaver;
|
const { saveAs } = fileSaver;
|
||||||
|
|
||||||
import { marked, type Token } from 'marked';
|
import { marked, type Token } from 'marked';
|
||||||
import { unescapeHtml } from '$lib/utils';
|
import { copyToClipboard, unescapeHtml } from '$lib/utils';
|
||||||
|
|
||||||
import { WEBUI_BASE_URL } from '$lib/constants';
|
import { WEBUI_BASE_URL } from '$lib/constants';
|
||||||
import { settings } from '$lib/stores';
|
import { settings } from '$lib/stores';
|
||||||
|
|
@ -23,6 +23,7 @@
|
||||||
|
|
||||||
import Source from './Source.svelte';
|
import Source from './Source.svelte';
|
||||||
import HtmlToken from './HTMLToken.svelte';
|
import HtmlToken from './HTMLToken.svelte';
|
||||||
|
import Clipboard from '$lib/components/icons/Clipboard.svelte';
|
||||||
|
|
||||||
export let id: string;
|
export let id: string;
|
||||||
export let tokens: Token[];
|
export let tokens: Token[];
|
||||||
|
|
@ -182,7 +183,19 @@
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class=" absolute top-1 right-1.5 z-20 invisible group-hover:visible">
|
<div class=" absolute top-1 right-1.5 z-20 invisible group-hover:visible flex gap-0.5">
|
||||||
|
<Tooltip content={$i18n.t('Copy')}>
|
||||||
|
<button
|
||||||
|
class="p-1 rounded-lg bg-transparent transition"
|
||||||
|
on:click={(e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
copyToClipboard(token.raw.trim());
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Clipboard className=" size-3.5" strokeWidth="1.5" />
|
||||||
|
</button>
|
||||||
|
</Tooltip>
|
||||||
|
|
||||||
<Tooltip content={$i18n.t('Export to CSV')}>
|
<Tooltip content={$i18n.t('Export to CSV')}>
|
||||||
<button
|
<button
|
||||||
class="p-1 rounded-lg bg-transparent transition"
|
class="p-1 rounded-lg bg-transparent transition"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue