mirror of
https://github.com/open-webui/computer.git
synced 2026-11-23 14:10:45 -05:00
refac
This commit is contained in:
1 parent
ae35beff4d
commit
2aa1630aee
5 files changed
+70
-9
No files matched your search
@@ -0,0 +1,9 @@
|
||||
<script lang="ts">
|
||||
import MarkdownRenderer from '$lib/components/markdown/MarkdownRenderer.svelte';
|
||||
|
||||
let { content }: { content: string } = $props();
|
||||
</script>
|
||||
|
||||
<div class="h-full overflow-y-auto px-6 py-5">
|
||||
<div class="mx-auto max-w-3xl"><MarkdownRenderer {content} /></div>
|
||||
</div>
|
||||
@@ -8,7 +8,7 @@
|
||||
import MessageTimestamp from './MessageTimestamp.svelte';
|
||||
import ReasoningCollapsible from './ReasoningCollapsible.svelte';
|
||||
import ToolCallCollapsible from './ToolCallCollapsible.svelte';
|
||||
import { currentWorkspace, openFileTab } from '$lib/stores';
|
||||
import { currentWorkspace, openArtifactTab, openFileTab } from '$lib/stores';
|
||||
import { ttsConfigured, ttsEnabled } from '$lib/stores/audio';
|
||||
import { tooltip } from '$lib/tooltip';
|
||||
import { fileIconName } from '$lib/utils/fileIcon';
|
||||
@@ -158,6 +158,10 @@
|
||||
collapsedFiles = { ...collapsedFiles, [key]: !collapsedFiles[key] };
|
||||
}
|
||||
|
||||
function openArtifact(artifact: any) {
|
||||
openArtifactTab(artifact.title || 'Artifact', artifact.content || '');
|
||||
}
|
||||
|
||||
/** Human-readable label for a tool call */
|
||||
function toolLabel(name: string, args: any): string {
|
||||
const _t = $t;
|
||||
@@ -464,13 +468,7 @@
|
||||
hover:border-gray-300 dark:hover:border-white/12
|
||||
hover:bg-gray-50/50 dark:hover:bg-white/[0.03]
|
||||
transition-colors duration-150 {preview ? 'h-[4.375rem]' : 'h-[2.375rem]'}"
|
||||
onclick={() => {
|
||||
const ws = get(currentWorkspace);
|
||||
if (ws && artifact.path) {
|
||||
const fullPath = ws.path.replace(/\/$/, '') + '/' + artifact.path;
|
||||
openFileTab(fullPath);
|
||||
}
|
||||
}}
|
||||
onclick={() => openArtifact(artifact)}
|
||||
>
|
||||
<div class="h-full min-w-0 overflow-hidden px-3 py-2.5">
|
||||
<div
|
||||
|
||||
Reference in new issue
Block a user