mirror of
https://github.com/open-webui/computer.git
synced 2026-11-24 22:37:40 -05:00
refac
This commit is contained in:
1 parent
b130c27138
commit
036b28b064
15 files changed
+92
-68
No files matched your search
@@ -2,6 +2,7 @@
|
||||
import { onMount } from 'svelte';
|
||||
import { toast } from 'svelte-sonner';
|
||||
import { getAdminConfig, updateConfig } from '$lib/apis/admin';
|
||||
import { t } from '$lib/i18n';
|
||||
import ToggleSwitch from '$lib/components/common/ToggleSwitch.svelte';
|
||||
import Spinner from '$lib/components/common/Spinner.svelte';
|
||||
|
||||
@@ -23,7 +24,7 @@
|
||||
config['skills.background_review_enabled'] !== 'false';
|
||||
reviewInterval = Number(config['skills.review_interval_turns']) || 10;
|
||||
} catch {
|
||||
toast.error('Failed to load config');
|
||||
toast.error($t('admin.failedToLoadConfig'));
|
||||
}
|
||||
loading = false;
|
||||
});
|
||||
@@ -37,9 +38,9 @@
|
||||
'skills.background_review_enabled': backgroundReview,
|
||||
'skills.review_interval_turns': Math.max(1, Number(reviewInterval) || 10)
|
||||
});
|
||||
toast.success('Saved');
|
||||
toast.success($t('settings.saved'));
|
||||
} catch {
|
||||
toast.error('Failed to save');
|
||||
toast.error($t('admin.failedToSave'));
|
||||
} finally {
|
||||
saving = false;
|
||||
}
|
||||
@@ -51,12 +52,16 @@
|
||||
<div class="flex justify-center py-8"><Spinner size={16} /></div>
|
||||
{:else}
|
||||
<div class="flex-1 min-h-0 overflow-y-auto scrollbar-hover pr-1.5 -mr-1.5">
|
||||
<h2 class="text-sm font-medium text-gray-900 dark:text-white mb-4">Skills</h2>
|
||||
<h2 class="text-sm font-medium text-gray-900 dark:text-white mb-4">
|
||||
{$t('chat.skills')}
|
||||
</h2>
|
||||
|
||||
<h3 class="text-xs text-gray-400 dark:text-gray-600 mb-2">Behavior</h3>
|
||||
<h3 class="text-xs text-gray-400 dark:text-gray-600 mb-2">
|
||||
{$t('admin.skillsBehavior')}
|
||||
</h3>
|
||||
<div class="flex flex-col gap-2.5">
|
||||
<label class="flex items-center justify-between cursor-pointer">
|
||||
<span class="text-xs text-gray-600 dark:text-gray-400">Enable skills</span>
|
||||
<span class="text-xs text-gray-600 dark:text-gray-400">{$t('admin.skillsEnable')}</span>
|
||||
<ToggleSwitch
|
||||
value={enabled}
|
||||
onchange={(v) => {
|
||||
@@ -68,7 +73,7 @@
|
||||
{#if enabled}
|
||||
<label class="flex items-center justify-between cursor-pointer">
|
||||
<span class="text-xs text-gray-600 dark:text-gray-400"
|
||||
>Assistant can manage skills</span
|
||||
>{$t('admin.skillsAssistantCanManage')}</span
|
||||
>
|
||||
<ToggleSwitch
|
||||
value={toolEnabled}
|
||||
@@ -79,7 +84,9 @@
|
||||
</label>
|
||||
|
||||
<label class="flex items-center justify-between cursor-pointer">
|
||||
<span class="text-xs text-gray-600 dark:text-gray-400">Background review</span>
|
||||
<span class="text-xs text-gray-600 dark:text-gray-400"
|
||||
>{$t('admin.skillsBackgroundReview')}</span
|
||||
>
|
||||
<ToggleSwitch
|
||||
value={backgroundReview}
|
||||
onchange={(v) => {
|
||||
@@ -91,11 +98,13 @@
|
||||
</div>
|
||||
|
||||
{#if enabled}
|
||||
<h3 class="text-xs text-gray-400 dark:text-gray-600 mb-2 mt-5">Limits</h3>
|
||||
<h3 class="text-xs text-gray-400 dark:text-gray-600 mb-2 mt-5">
|
||||
{$t('admin.skillsLimits')}
|
||||
</h3>
|
||||
<div class="flex flex-col gap-2.5">
|
||||
<div>
|
||||
<label class="text-xs text-gray-600 dark:text-gray-400" for="skills-review-interval">
|
||||
Review every
|
||||
{$t('admin.skillsReviewEvery')}
|
||||
</label>
|
||||
<input
|
||||
id="skills-review-interval"
|
||||
@@ -115,7 +124,7 @@
|
||||
disabled={saving}
|
||||
onclick={save}
|
||||
>
|
||||
{saving ? 'Saving...' : 'Save'}
|
||||
{saving ? $t('settings.saving') : $t('settings.save')}
|
||||
</button>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@@ -165,7 +165,9 @@
|
||||
step="1000"
|
||||
class="w-20 h-7 px-2 rounded-lg text-xs bg-gray-100 dark:bg-white/6 text-gray-700 dark:text-gray-300 border border-gray-200 dark:border-white/8 outline-none focus:border-blue-400 dark:focus:border-blue-500 transition-colors"
|
||||
/>
|
||||
<span class="text-[0.6875rem] text-gray-400 dark:text-gray-600">chars</span>
|
||||
<span class="text-[0.6875rem] text-gray-400 dark:text-gray-600"
|
||||
>{$t('admin.chars')}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { onDestroy, onMount } from 'svelte';
|
||||
import { t } from '$lib/i18n';
|
||||
|
||||
interface BrowserState {
|
||||
url: string;
|
||||
@@ -652,7 +653,7 @@
|
||||
<textarea
|
||||
bind:this={keyboardAntenna}
|
||||
class="keyboard-antenna"
|
||||
aria-label="Remote browser keyboard"
|
||||
aria-label={$t('browser.remoteKeyboard')}
|
||||
onbeforeinput={beforeInput}
|
||||
oncompositionstart={() => (composition = true)}
|
||||
oncompositionupdate={() => {}}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { diffDisplayMode, hideWhitespaceChanges } from '$lib/stores/gitDiffSettings';
|
||||
import { t } from '$lib/i18n';
|
||||
import DropdownMenu from './DropdownMenu.svelte';
|
||||
import Icon from './Icon.svelte';
|
||||
|
||||
@@ -36,7 +37,7 @@
|
||||
aria-pressed={$hideWhitespaceChanges}
|
||||
>
|
||||
<Icon name="code" size={13} class="app-icon-muted shrink-0" />
|
||||
<span class="min-w-0 flex-1 truncate">Hide whitespace</span>
|
||||
<span class="min-w-0 flex-1 truncate">{$t('diff.hideWhitespace')}</span>
|
||||
<span
|
||||
class="relative h-3.5 w-6 shrink-0 rounded-full transition-colors duration-150 {$hideWhitespaceChanges
|
||||
? 'bg-gray-900 dark:bg-white'
|
||||
@@ -51,7 +52,7 @@
|
||||
</button>
|
||||
|
||||
<div class="app-muted px-2 pb-0.5 pt-1 text-[0.625rem] leading-none uppercase">
|
||||
Diff Display
|
||||
{$t('diff.display')}
|
||||
</div>
|
||||
|
||||
<button
|
||||
@@ -63,7 +64,7 @@
|
||||
onclick={() => diffDisplayMode.set('unified')}
|
||||
>
|
||||
<Icon name="list" size={13} class="app-icon-muted shrink-0" />
|
||||
<span class="min-w-0 flex-1 truncate text-left">Unified</span>
|
||||
<span class="min-w-0 flex-1 truncate text-left">{$t('diff.unified')}</span>
|
||||
{#if $diffDisplayMode === 'unified'}
|
||||
<Icon name="check" size={11} class="app-icon-muted shrink-0" />
|
||||
{/if}
|
||||
@@ -77,7 +78,7 @@
|
||||
onclick={() => diffDisplayMode.set('split')}
|
||||
>
|
||||
<Icon name="split-view" size={13} class="app-icon-muted shrink-0" />
|
||||
<span class="min-w-0 flex-1 truncate">Split</span>
|
||||
<span class="min-w-0 flex-1 truncate">{$t('diff.split')}</span>
|
||||
{#if $diffDisplayMode === 'split'}
|
||||
<Icon name="check" size={11} class="app-icon-muted shrink-0" />
|
||||
{/if}
|
||||
|
||||
@@ -1106,19 +1106,19 @@
|
||||
class="toolbar-btn"
|
||||
class:active={markdownMode === 'preview'}
|
||||
onclick={() => switchMarkdownMode('preview')}
|
||||
use:tooltip={'Preview'}><Icon name="eye" size={12} /></button
|
||||
use:tooltip={$t('port.preview')}><Icon name="eye" size={12} /></button
|
||||
>
|
||||
<button
|
||||
class="toolbar-btn"
|
||||
class:active={markdownMode === 'editor'}
|
||||
onclick={() => switchMarkdownMode('editor')}
|
||||
use:tooltip={'Editor'}><Icon name="pencil" size={11} /></button
|
||||
use:tooltip={$t('preview.editor')}><Icon name="pencil" size={11} /></button
|
||||
>
|
||||
<button
|
||||
class="toolbar-btn"
|
||||
class:active={markdownMode === 'raw'}
|
||||
onclick={() => switchMarkdownMode('raw')}
|
||||
use:tooltip={'Source'}><Icon name="code" size={12} /></button
|
||||
use:tooltip={$t('preview.source')}><Icon name="code" size={12} /></button
|
||||
>
|
||||
{:else if (isHtml || isSvg) && !fileData.binary}
|
||||
<button
|
||||
@@ -1127,7 +1127,7 @@
|
||||
onclick={() => {
|
||||
if (!previewMode) togglePreview();
|
||||
}}
|
||||
use:tooltip={'Preview'}><Icon name="eye" size={12} /></button
|
||||
use:tooltip={$t('port.preview')}><Icon name="eye" size={12} /></button
|
||||
>
|
||||
<button
|
||||
class="toolbar-btn"
|
||||
@@ -1135,7 +1135,7 @@
|
||||
onclick={() => {
|
||||
if (previewMode) togglePreview();
|
||||
}}
|
||||
use:tooltip={'Edit'}><Icon name="pencil" size={11} /></button
|
||||
use:tooltip={$t('common.edit')}><Icon name="pencil" size={11} /></button
|
||||
>
|
||||
{/if}
|
||||
{#if isJson && !fileData.binary && !jsonParseError}
|
||||
@@ -1145,7 +1145,7 @@
|
||||
onclick={() => {
|
||||
if (jsonViewMode !== 'tree') toggleJsonView();
|
||||
}}
|
||||
use:tooltip={'Tree view'}><Icon name="list" size={12} /></button
|
||||
use:tooltip={$t('preview.treeView')}><Icon name="list" size={12} /></button
|
||||
>
|
||||
<button
|
||||
class="toolbar-btn"
|
||||
@@ -1153,7 +1153,7 @@
|
||||
onclick={() => {
|
||||
if (jsonViewMode !== 'source') toggleJsonView();
|
||||
}}
|
||||
use:tooltip={'Source'}><Icon name="code" size={12} /></button
|
||||
use:tooltip={$t('preview.source')}><Icon name="code" size={12} /></button
|
||||
>
|
||||
{/if}
|
||||
{#if isEditing || markdownMode === 'editor' || hasChanges || saving || saved}
|
||||
@@ -1161,7 +1161,7 @@
|
||||
class="toolbar-btn {saved ? 'saved' : ''}"
|
||||
onclick={saveFile}
|
||||
disabled={saving}
|
||||
use:tooltip={saving ? 'Saving...' : saved ? 'Saved' : 'Save'}
|
||||
use:tooltip={saving ? $t('settings.saving') : saved ? $t('settings.saved') : $t('settings.save')}
|
||||
><Icon name={saved ? 'check' : 'save'} size={11} /></button
|
||||
>
|
||||
{/if}
|
||||
@@ -1170,12 +1170,12 @@
|
||||
class="toolbar-btn"
|
||||
class:active={diffMode}
|
||||
onclick={toggleDiff}
|
||||
use:tooltip={diffMode ? 'Hide diff' : 'Show diff'}
|
||||
use:tooltip={diffMode ? $t('preview.hideDiff') : $t('preview.showDiff')}
|
||||
><Icon name="git-diff" size={12} /></button
|
||||
>
|
||||
{/if}
|
||||
{#if !isUntitled}
|
||||
<button class="toolbar-btn" onclick={() => loadFile(filePath)} use:tooltip={'Refresh'}
|
||||
<button class="toolbar-btn" onclick={() => loadFile(filePath)} use:tooltip={$t('files.refresh')}
|
||||
><Icon name="refresh" size={11} /></button
|
||||
>
|
||||
{/if}
|
||||
|
||||
@@ -1221,8 +1221,8 @@
|
||||
bind:this={diffSettingsBtnEl}
|
||||
class="flex items-center justify-center w-6 h-6 rounded-md text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-white/6 transition-colors duration-75"
|
||||
onclick={() => (showDiffSettings = true)}
|
||||
use:tooltip={'Diff settings'}
|
||||
aria-label="Diff settings"
|
||||
use:tooltip={$t('diff.settings')}
|
||||
aria-label={$t('diff.settings')}
|
||||
>
|
||||
<Icon name="settings" size={12} />
|
||||
</button>
|
||||
|
||||
@@ -229,8 +229,8 @@
|
||||
bind:this={diffSettingsButtonEl}
|
||||
class="flex h-6 w-6 items-center justify-center rounded-md text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-white/6 dark:hover:text-gray-300"
|
||||
onclick={() => (showDiffSettings = true)}
|
||||
aria-label="Diff settings"
|
||||
use:tooltip={'Diff settings'}
|
||||
aria-label={$t('diff.settings')}
|
||||
use:tooltip={$t('diff.settings')}
|
||||
>
|
||||
<Icon name="settings" size={13} />
|
||||
</button>
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
{ id: 'subagents', label: $t('admin.subagents'), icon: 'user' },
|
||||
{ id: 'workspace', label: $t('admin.workspace'), icon: 'folder' },
|
||||
{ id: 'memory', label: $t('settings.memory'), icon: 'brain' },
|
||||
{ id: 'skills', label: 'Skills', icon: 'spark' }
|
||||
{ id: 'skills', label: $t('chat.skills'), icon: 'spark' }
|
||||
]);
|
||||
|
||||
onMount(() => {
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { t } from '$lib/i18n';
|
||||
|
||||
interface Props {
|
||||
item: any;
|
||||
pairedOutput: any;
|
||||
@@ -73,14 +75,17 @@
|
||||
<section class="my-1 rounded-2xl bg-gray-100/70 px-3.5 py-3 dark:bg-white/[0.055]">
|
||||
<div class="mb-3 flex items-center justify-between gap-3">
|
||||
<div class="text-[0.6875rem] font-medium tracking-wide text-gray-500 dark:text-gray-400">
|
||||
Planning question
|
||||
{$t('chat.planningQuestion')}
|
||||
</div>
|
||||
{#if pending}
|
||||
<div class="text-[0.6875rem] text-gray-500 dark:text-gray-400">
|
||||
{questionIndex + 1} of {questions.length} · paused while visible
|
||||
{$t('chat.questionProgress', { current: questionIndex + 1, total: questions.length })} ·
|
||||
{$t('chat.pausedWhileVisible')}
|
||||
</div>
|
||||
{:else if item.timed_out || resolved.timed_out}
|
||||
<div class="text-[0.6875rem] text-gray-500 dark:text-gray-400">Recommendations used</div>
|
||||
<div class="text-[0.6875rem] text-gray-500 dark:text-gray-400">
|
||||
{$t('chat.recommendationsUsed')}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -130,7 +135,7 @@
|
||||
<span class="text-gray-800 dark:text-gray-100">{option.label}</span>
|
||||
{#if optionIndex === 0}
|
||||
<span class="ml-1.5 text-[0.625rem] text-gray-400 dark:text-gray-500"
|
||||
>Recommended</span
|
||||
>{$t('chat.recommended')}</span
|
||||
>
|
||||
{/if}
|
||||
<span class="mt-0.5 block leading-relaxed text-gray-500 dark:text-gray-400">
|
||||
@@ -165,12 +170,12 @@
|
||||
<span class="size-1.5 rounded-full bg-gray-900 dark:bg-white"></span>
|
||||
{/if}
|
||||
</span>
|
||||
<span class="text-gray-700 dark:text-gray-200">Other</span>
|
||||
<span class="text-gray-700 dark:text-gray-200">{$t('chat.other')}</span>
|
||||
</label>
|
||||
{#if selections[question.id] === '__other__'}
|
||||
<input
|
||||
class="w-full rounded-xl bg-transparent px-2.5 py-1.5 text-xs text-gray-800 outline-none placeholder:text-gray-400 dark:text-gray-100 dark:placeholder:text-gray-500"
|
||||
placeholder="Type your answer"
|
||||
placeholder={$t('chat.typeYourAnswer')}
|
||||
value={otherAnswers[question.id] || ''}
|
||||
oninput={(event) =>
|
||||
(otherAnswers = { ...otherAnswers, [question.id]: event.currentTarget.value })}
|
||||
@@ -179,7 +184,7 @@
|
||||
</div>
|
||||
{:else}
|
||||
<div class="text-xs leading-relaxed text-gray-600 dark:text-gray-300">
|
||||
{resolved.answers?.[question.id]?.answers?.join(', ') || 'No answer recorded'}
|
||||
{resolved.answers?.[question.id]?.answers?.join(', ') || $t('chat.noAnswerRecorded')}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -193,7 +198,7 @@
|
||||
disabled={questionIndex === 0}
|
||||
onclick={() => (questionIndex -= 1)}
|
||||
>
|
||||
Previous
|
||||
{$t('chat.previous')}
|
||||
</button>
|
||||
{#if questionIndex < questions.length - 1}
|
||||
<button
|
||||
@@ -201,7 +206,7 @@
|
||||
class="rounded-lg bg-gray-900 px-3 py-1.5 text-xs font-medium text-white transition-transform active:scale-[0.98] dark:bg-white dark:text-black"
|
||||
onclick={() => (questionIndex += 1)}
|
||||
>
|
||||
Next
|
||||
{$t('chat.next')}
|
||||
</button>
|
||||
{:else if pending}
|
||||
<button
|
||||
@@ -210,7 +215,7 @@
|
||||
disabled={!canSubmit || submitting}
|
||||
onclick={() => submit()}
|
||||
>
|
||||
Submit answers
|
||||
{$t('chat.submitAnswers')}
|
||||
</button>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -549,7 +549,7 @@
|
||||
if (filePath) openFileTab(filePath);
|
||||
}}
|
||||
aria-label={$t('directory.open', { name: file.name || shortPath(file.path) })}
|
||||
use:tooltip={'Open as tab'}
|
||||
use:tooltip={$t('chat.openAsTab')}
|
||||
>
|
||||
<Icon name="external-link" size={13} />
|
||||
</button>
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
import OfficePreview from '$lib/components/preview/OfficePreview.svelte';
|
||||
import PDFViewer from '$lib/components/preview/PDFViewer.svelte';
|
||||
import SvgPreview from '$lib/components/preview/SvgPreview.svelte';
|
||||
import { t } from '$lib/i18n';
|
||||
|
||||
interface Props {
|
||||
file: any;
|
||||
@@ -59,7 +60,7 @@
|
||||
}
|
||||
}
|
||||
} catch (e: any) {
|
||||
if (!cancelled) error = e.message || 'Failed to load preview';
|
||||
if (!cancelled) error = e.message || $t('preview.failedToLoad');
|
||||
} finally {
|
||||
if (!cancelled) loading = false;
|
||||
}
|
||||
@@ -73,7 +74,7 @@
|
||||
</script>
|
||||
|
||||
{#if loading}
|
||||
<div class="preview-state">Loading...</div>
|
||||
<div class="preview-state">{$t('common.loading')}</div>
|
||||
{:else if error}
|
||||
<div class="preview-state">{error}</div>
|
||||
{:else if kind === 'image'}
|
||||
|
||||
@@ -1177,9 +1177,9 @@
|
||||
{#if slashCommandIds.includes('compact')}
|
||||
<button
|
||||
type="button"
|
||||
aria-label="Compact: shorten older messages so this chat can keep going."
|
||||
aria-label={`${$t('chat.commandCompact')}: ${$t('chat.commandCompactDesc')}`}
|
||||
use:tooltip={{
|
||||
content: 'Shorten older messages so this chat can keep going.',
|
||||
content: $t('chat.commandCompactDesc'),
|
||||
placement: 'top'
|
||||
}}
|
||||
class="slash-command-row flex items-center gap-2 w-full h-6 px-2 rounded-xl text-xs text-left transition-colors duration-75
|
||||
@@ -1226,9 +1226,9 @@
|
||||
{#if slashCommandIds.includes('plan')}
|
||||
<button
|
||||
type="button"
|
||||
aria-label="Plan: work out a plan first, then wait before changing files."
|
||||
aria-label={`${$t('chat.commandPlan')}: ${$t('chat.commandPlanDesc')}`}
|
||||
use:tooltip={{
|
||||
content: 'Work out a plan first, then wait before changing files.',
|
||||
content: $t('chat.commandPlanDesc'),
|
||||
placement: 'top'
|
||||
}}
|
||||
class="slash-command-row flex items-center gap-2 w-full h-6 px-2 rounded-xl text-xs text-left transition-colors duration-75
|
||||
@@ -1267,9 +1267,9 @@
|
||||
{#if slashCommandIds.includes('fork')}
|
||||
<button
|
||||
type="button"
|
||||
aria-label="Fork: clone this chat into a new copy."
|
||||
aria-label={`${$t('chat.commandFork')}: ${$t('chat.commandForkDesc')}`}
|
||||
use:tooltip={{
|
||||
content: 'Clone this chat into a new copy.',
|
||||
content: $t('chat.commandForkDesc'),
|
||||
placement: 'top'
|
||||
}}
|
||||
class="slash-command-row flex items-center gap-2 w-full h-6 px-2 rounded-xl text-xs text-left transition-colors duration-75
|
||||
@@ -1295,9 +1295,9 @@
|
||||
{#if slashCommandIds.includes('status')}
|
||||
<button
|
||||
type="button"
|
||||
aria-label="Status: check what is running in this chat."
|
||||
aria-label={`${$t('chat.commandStatus')}: ${$t('chat.commandStatusDesc')}`}
|
||||
use:tooltip={{
|
||||
content: 'Check what is running in this chat.',
|
||||
content: $t('chat.commandStatusDesc'),
|
||||
placement: 'top'
|
||||
}}
|
||||
class="slash-command-row flex items-center gap-2 w-full h-6 px-2 rounded-xl text-xs text-left transition-colors duration-75
|
||||
@@ -1334,9 +1334,9 @@
|
||||
{#if slashCommandIds.includes('skills:list')}
|
||||
<button
|
||||
type="button"
|
||||
aria-label="List skills: see the skills available in this workspace."
|
||||
aria-label={`${$t('chat.commandListSkills')}: ${$t('chat.commandListSkillsDesc')}`}
|
||||
use:tooltip={{
|
||||
content: 'See the skills available in this workspace.',
|
||||
content: $t('chat.commandListSkillsDesc'),
|
||||
placement: 'top'
|
||||
}}
|
||||
class="slash-command-row flex items-center gap-2 w-full h-6 px-2 rounded-xl text-xs text-left transition-colors duration-75
|
||||
@@ -1351,7 +1351,7 @@
|
||||
<Icon name="list" size={14} />
|
||||
</span>
|
||||
<span class="flex-1 min-w-0 flex items-baseline gap-1.5 overflow-hidden">
|
||||
<span class="truncate">List skills</span>
|
||||
<span class="truncate">{$t('chat.commandListSkills')}</span>
|
||||
<span class="app-muted text-[0.625rem] truncate shrink-0">/skills:list</span>
|
||||
</span>
|
||||
</button>
|
||||
@@ -1359,9 +1359,9 @@
|
||||
{#if slashCommandIds.includes('skills:create')}
|
||||
<button
|
||||
type="button"
|
||||
aria-label="Create skill: teach Computer a reusable workflow."
|
||||
aria-label={`${$t('chat.commandCreateSkill')}: ${$t('chat.commandCreateSkillDesc')}`}
|
||||
use:tooltip={{
|
||||
content: 'Teach Computer a reusable workflow.',
|
||||
content: $t('chat.commandCreateSkillDesc'),
|
||||
placement: 'top'
|
||||
}}
|
||||
class="slash-command-row flex items-center gap-2 w-full h-6 px-2 rounded-xl text-xs text-left transition-colors duration-75
|
||||
@@ -1376,17 +1376,19 @@
|
||||
<Icon name="plus" size={14} />
|
||||
</span>
|
||||
<span class="flex-1 min-w-0 flex items-baseline gap-1.5 overflow-hidden">
|
||||
<span class="truncate">Create skill</span>
|
||||
<span class="truncate">{$t('chat.commandCreateSkill')}</span>
|
||||
<span class="app-muted text-[0.625rem] truncate shrink-0">/skills:create</span>
|
||||
</span>
|
||||
</button>
|
||||
{/if}
|
||||
{#if slashSkillSuggestions.length > 0}
|
||||
<div class="app-muted mb-0.5 px-2 pt-1 pb-0.5 text-[0.625rem] leading-none">Skills</div>
|
||||
<div class="app-muted mb-0.5 px-2 pt-1 pb-0.5 text-[0.625rem] leading-none">
|
||||
{$t('chat.skills')}
|
||||
</div>
|
||||
{#each slashSkillSuggestions as skill (skill.id)}
|
||||
<button
|
||||
type="button"
|
||||
aria-label={`Use skill: ${skill.label}`}
|
||||
aria-label={`${$t('chat.useSkill')}: ${skill.label}`}
|
||||
use:tooltip={{
|
||||
content: skill.label,
|
||||
placement: 'top'
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script lang="ts">
|
||||
import type { SkillInfo } from '$lib/apis/skills';
|
||||
import { t } from '$lib/i18n';
|
||||
import Modal from '../Modal.svelte';
|
||||
import Icon from '../Icon.svelte';
|
||||
|
||||
@@ -22,10 +23,10 @@
|
||||
onclick={onclose}
|
||||
>
|
||||
<Icon name="chevron-left" size={12} />
|
||||
<span>Close</span>
|
||||
<span>{$t('common.close')}</span>
|
||||
</button>
|
||||
<div class="min-w-0 flex-1 truncate text-xs font-medium text-gray-900 dark:text-white">
|
||||
Skills
|
||||
{$t('chat.skills')}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -39,7 +40,7 @@
|
||||
{item.name}
|
||||
</div>
|
||||
<div class="shrink-0 text-[0.625rem] text-gray-400 dark:text-gray-600">
|
||||
{item.managed ? 'managed' : 'read-only'}
|
||||
{item.managed ? $t('chat.skillManaged') : $t('chat.skillReadOnly')}
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-0.5 line-clamp-2 text-[0.6875rem] leading-relaxed text-gray-500 dark:text-gray-400">
|
||||
@@ -49,7 +50,9 @@
|
||||
{/each}
|
||||
</div>
|
||||
{:else}
|
||||
<div class="py-8 text-center text-gray-400 dark:text-gray-600">No skills found</div>
|
||||
<div class="py-8 text-center text-gray-400 dark:text-gray-600">
|
||||
{$t('chat.noSkillsFound')}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</Modal>
|
||||
@@ -235,8 +235,8 @@
|
||||
<div>
|
||||
<div class="text-gray-600 dark:text-gray-300">{question.question}</div>
|
||||
<div class="text-gray-400 dark:text-gray-500">
|
||||
{answer || 'No answer recorded'}{answer === question.options?.[0]?.label
|
||||
? ' (Recommended)'
|
||||
{answer || $t('chat.noAnswerRecorded')}{answer === question.options?.[0]?.label
|
||||
? ` (${$t('chat.recommended')})`
|
||||
: ''}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
aria-expanded={timerExpanded}
|
||||
onclick={() => (timerExpanded = !timerExpanded)}
|
||||
>
|
||||
<span class="text-[0.75rem] font-medium shrink-0">Timer</span>
|
||||
<span class="text-[0.75rem] font-medium shrink-0">{$t('chat.timer')}</span>
|
||||
<span class="text-[0.75rem] truncate min-w-0 flex-1">{content}</span>
|
||||
<Icon
|
||||
name="chevron-down"
|
||||
|
||||
Reference in new issue
Block a user