mirror of
https://github.com/open-webui/computer.git
synced 2026-11-27 07:39:21 -05:00
refac
This commit is contained in:
1 parent
ca91fe5efd
commit
b015269e52
2 files changed
+24
-22
No files matched your search
@@ -34,19 +34,21 @@
|
||||
</script>
|
||||
|
||||
<div
|
||||
class="fixed z-50 w-64 max-h-40 overflow-y-auto rounded-xl bg-white dark:bg-[#1a1a1a] border border-gray-150 dark:border-white/6 shadow-xl p-0.5"
|
||||
class="fixed z-50 w-60 max-h-40 overflow-y-auto rounded-xl bg-white dark:bg-[#1a1a1a] border border-gray-150 dark:border-white/6 shadow-xl p-0.5"
|
||||
>
|
||||
{#if items.length === 0}
|
||||
<div class="px-3 py-2 text-xs text-gray-400 dark:text-gray-600">No files found</div>
|
||||
<div class="flex items-center h-6 px-2 text-xs text-gray-400 dark:text-gray-600">
|
||||
No files found
|
||||
</div>
|
||||
{:else}
|
||||
<div class="text-[10px] text-gray-400 dark:text-gray-600 px-2.5 pt-1.5 pb-0.5">
|
||||
<div class="px-2 pt-1 pb-0.5 text-[10px] leading-none text-gray-400 dark:text-gray-600">
|
||||
Files
|
||||
</div>
|
||||
<div bind:this={listEl}>
|
||||
{#each items as item, i (item.id)}
|
||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
||||
<button
|
||||
class="flex items-center gap-2 w-full h-7 px-2 rounded-xl text-xs text-left transition-colors duration-75
|
||||
class="flex items-center gap-2 w-full h-6 px-2 rounded-xl text-xs text-left transition-colors duration-75
|
||||
{i === selectedIndex
|
||||
? 'bg-gray-50 dark:bg-white/5 text-gray-900 dark:text-white'
|
||||
: 'text-gray-500 dark:text-gray-400 hover:bg-gray-50 dark:hover:bg-white/5 hover:text-gray-900 dark:hover:text-white'}"
|
||||
@@ -61,7 +63,7 @@
|
||||
? 'text-gray-500 dark:text-gray-400'
|
||||
: 'text-gray-400 dark:text-gray-500'}"
|
||||
>
|
||||
<Icon name={fileIconName(item.label, item.type)} size={12} />
|
||||
<Icon name={fileIconName(item.label, item.type)} size={14} />
|
||||
</span>
|
||||
<span class="flex-1 min-w-0 flex items-baseline gap-1.5 overflow-hidden">
|
||||
<span class="truncate">{item.label}</span>
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
<script lang="ts">
|
||||
import Icon from '../Icon.svelte';
|
||||
|
||||
interface SuggestionItem {
|
||||
id: string;
|
||||
label: string;
|
||||
@@ -27,19 +25,21 @@
|
||||
</script>
|
||||
|
||||
<div
|
||||
class="fixed z-50 w-64 max-h-48 overflow-y-auto rounded-xl bg-white dark:bg-[#1a1a1a] border border-gray-150 dark:border-white/6 shadow-xl p-0.5"
|
||||
class="fixed z-50 w-60 max-h-40 overflow-y-auto rounded-xl bg-white dark:bg-[#1a1a1a] border border-gray-150 dark:border-white/6 shadow-xl p-0.5"
|
||||
>
|
||||
{#if items.length === 0}
|
||||
<div class="px-3 py-2 text-xs text-gray-400 dark:text-gray-600">No skills found</div>
|
||||
<div class="flex items-center h-6 px-2 text-xs text-gray-400 dark:text-gray-600">
|
||||
No skills found
|
||||
</div>
|
||||
{:else}
|
||||
<div class="text-[10px] text-gray-400 dark:text-gray-600 px-2.5 pt-1.5 pb-0.5">
|
||||
<div class="px-2 pt-1 pb-0.5 text-[10px] leading-none text-gray-400 dark:text-gray-600">
|
||||
Skills
|
||||
</div>
|
||||
<div bind:this={listEl}>
|
||||
{#each items as item, i (item.id)}
|
||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
||||
<button
|
||||
class="flex items-start gap-2 w-full px-2 py-1.5 rounded-xl text-xs text-left transition-colors duration-75
|
||||
class="flex items-center gap-2 w-full h-6 px-2 rounded-xl text-xs text-left transition-colors duration-75
|
||||
{i === selectedIndex
|
||||
? 'bg-gray-50 dark:bg-white/5 text-gray-900 dark:text-white'
|
||||
: 'text-gray-500 dark:text-gray-400 hover:bg-gray-50 dark:hover:bg-white/5 hover:text-gray-900 dark:hover:text-white'}"
|
||||
@@ -48,23 +48,23 @@
|
||||
onselect(i);
|
||||
}}
|
||||
onmouseenter={() => (selectedIndex = i)}
|
||||
title={item.description}
|
||||
>
|
||||
<span
|
||||
class="flex items-center justify-center w-4 shrink-0 mt-0.5 text-purple-400 dark:text-purple-400"
|
||||
class="flex items-center justify-center w-4 shrink-0 text-gray-400 dark:text-gray-500"
|
||||
>
|
||||
<svg viewBox="0 0 16 16" fill="currentColor" class="size-3.5">
|
||||
<path d="M8.75 1a.75.75 0 0 0-1.5 0v1.249c-1.373.158-2.476.682-3.33 1.536C3.066 4.639 2.5 5.77 2.5 7.25c0 1.296-.266 2.193-.613 2.852-.35.663-.83 1.132-1.268 1.507a.75.75 0 0 0 .494 1.315h3.137a3.75 3.75 0 0 0 7.5 0h3.137a.75.75 0 0 0 .494-1.315c-.438-.375-.919-.844-1.268-1.507-.347-.659-.613-1.556-.613-2.852 0-1.48-.566-2.611-1.42-3.465-.854-.854-1.957-1.378-3.33-1.536V1ZM6.5 12.924a2.25 2.25 0 0 0 3 0h-3Z" />
|
||||
<path
|
||||
d="M8.75 1a.75.75 0 0 0-1.5 0v1.249c-1.373.158-2.476.682-3.33 1.536C3.066 4.639 2.5 5.77 2.5 7.25c0 1.296-.266 2.193-.613 2.852-.35.663-.83 1.132-1.268 1.507a.75.75 0 0 0 .494 1.315h3.137a3.75 3.75 0 0 0 7.5 0h3.137a.75.75 0 0 0 .494-1.315c-.438-.375-.919-.844-1.268-1.507-.347-.659-.613-1.556-.613-2.852 0-1.48-.566-2.611-1.42-3.465-.854-.854-1.957-1.378-3.33-1.536V1ZM6.5 12.924a2.25 2.25 0 0 0 3 0h-3Z"
|
||||
/>
|
||||
</svg>
|
||||
</span>
|
||||
<span class="flex-1 min-w-0 flex flex-col overflow-hidden">
|
||||
<span class="flex items-center gap-1.5">
|
||||
<span class="truncate font-medium">{item.label}</span>
|
||||
{#if item.source && item.source !== 'workspace'}
|
||||
<span class="text-[9px] text-gray-400 dark:text-gray-600 bg-gray-100 dark:bg-white/5 rounded px-1 shrink-0">{item.source}</span>
|
||||
{/if}
|
||||
</span>
|
||||
{#if item.description}
|
||||
<span class="text-[10px] text-gray-400 dark:text-gray-600 truncate">{item.description}</span>
|
||||
<span class="flex-1 min-w-0 flex items-baseline gap-1.5 overflow-hidden">
|
||||
<span class="truncate">{item.label}</span>
|
||||
{#if item.source && item.source !== 'workspace'}
|
||||
<span class="text-[10px] text-gray-400 dark:text-gray-600 truncate shrink-0"
|
||||
>{item.source}</span
|
||||
>
|
||||
{/if}
|
||||
</span>
|
||||
</button>
|
||||
|
||||
Reference in new issue
Block a user