mirror of
https://github.com/open-webui/computer.git
synced 2026-12-03 10:17:44 -05:00
refac
This commit is contained in:
1 parent
577836a086
commit
de7ca987a5
44 files changed
+1905
-713
No files matched your search
@@ -168,7 +168,7 @@
|
||||
id={`${fieldPrefix}-home`}
|
||||
type="text"
|
||||
value={draft.home || ''}
|
||||
placeholder="Optional"
|
||||
placeholder={$t('admin.optional')}
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
oninput={(e) => (draft.home = e.currentTarget.value || null)}
|
||||
@@ -203,7 +203,7 @@
|
||||
id={`${fieldPrefix}-api-endpoint`}
|
||||
type="text"
|
||||
bind:value={draft.api_endpoint}
|
||||
placeholder="Optional"
|
||||
placeholder={$t('admin.optional')}
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
class="block w-full bg-transparent text-[0.8125rem] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5 font-mono"
|
||||
@@ -221,7 +221,7 @@
|
||||
id={`${fieldPrefix}-server-url`}
|
||||
type="text"
|
||||
bind:value={draft.server_url}
|
||||
placeholder="Optional"
|
||||
placeholder={$t('admin.optional')}
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
class="block w-full bg-transparent text-[0.8125rem] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5 font-mono"
|
||||
@@ -237,7 +237,7 @@
|
||||
id={`${fieldPrefix}-server-password`}
|
||||
type="password"
|
||||
bind:value={draft.server_password}
|
||||
placeholder="Optional"
|
||||
placeholder={$t('admin.optional')}
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
class="block w-full bg-transparent text-[0.8125rem] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5 font-mono"
|
||||
|
||||
@@ -310,7 +310,9 @@
|
||||
</div>
|
||||
|
||||
{#if profiles.length === 0}
|
||||
<p class="text-[0.8125rem] text-gray-400 dark:text-gray-600 py-4">No agent profiles</p>
|
||||
<p class="text-[0.8125rem] text-gray-400 dark:text-gray-600 py-4">
|
||||
{$t('admin.agentsNoProfiles')}
|
||||
</p>
|
||||
{/if}
|
||||
|
||||
<div class="mt-auto pt-6 flex items-center justify-between">
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Optional"
|
||||
placeholder={$t('connections.optional')}
|
||||
bind:value={formName}
|
||||
autofocus
|
||||
autocomplete="off"
|
||||
@@ -91,7 +91,9 @@
|
||||
/>
|
||||
</div>
|
||||
<div class="w-28 shrink-0">
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600">Provider</label>
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600">
|
||||
{$t('connections.provider')}
|
||||
</label>
|
||||
<select
|
||||
bind:value={formProvider}
|
||||
class="block w-full bg-transparent text-[0.8125rem] text-gray-700 dark:text-gray-300 outline-none py-0.5 cursor-pointer"
|
||||
@@ -103,13 +105,15 @@
|
||||
</div>
|
||||
|
||||
{#if formProvider === 'openai'}
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600 mt-2">API Type</label>
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600 mt-2">
|
||||
{$t('connections.apiType')}
|
||||
</label>
|
||||
<select
|
||||
bind:value={formApiType}
|
||||
class="block w-full bg-transparent text-[0.8125rem] text-gray-700 dark:text-gray-300 outline-none py-0.5 cursor-pointer"
|
||||
>
|
||||
<option value="chat_completions">Chat Completions</option>
|
||||
<option value="responses">Responses</option>
|
||||
<option value="chat_completions">{$t('connections.chatCompletions')}</option>
|
||||
<option value="responses">{$t('connections.responses')}</option>
|
||||
</select>
|
||||
{/if}
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Optional"
|
||||
placeholder={$t('connections.optional')}
|
||||
bind:value={formName}
|
||||
autofocus
|
||||
autocomplete="off"
|
||||
@@ -127,7 +127,9 @@
|
||||
/>
|
||||
</div>
|
||||
<div class="w-28 shrink-0">
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600">Provider</label>
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600">
|
||||
{$t('connections.provider')}
|
||||
</label>
|
||||
<select
|
||||
bind:value={formProvider}
|
||||
class="block w-full bg-transparent text-[0.8125rem] text-gray-700 dark:text-gray-300 outline-none py-0.5 cursor-pointer"
|
||||
@@ -139,13 +141,15 @@
|
||||
</div>
|
||||
|
||||
{#if formProvider === 'openai'}
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600 mt-2">API Type</label>
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600 mt-2">
|
||||
{$t('connections.apiType')}
|
||||
</label>
|
||||
<select
|
||||
bind:value={formApiType}
|
||||
class="block w-full bg-transparent text-[0.8125rem] text-gray-700 dark:text-gray-300 outline-none py-0.5 cursor-pointer"
|
||||
>
|
||||
<option value="chat_completions">Chat Completions</option>
|
||||
<option value="responses">Responses</option>
|
||||
<option value="chat_completions">{$t('connections.chatCompletions')}</option>
|
||||
<option value="responses">{$t('connections.responses')}</option>
|
||||
</select>
|
||||
{/if}
|
||||
|
||||
|
||||
@@ -310,13 +310,13 @@ Files:
|
||||
)}
|
||||
<div class="mb-2">
|
||||
<span class="text-[0.625rem] text-gray-400 dark:text-gray-600 uppercase tracking-wide"
|
||||
>request params</span
|
||||
>{$t('models.requestParams')}</span
|
||||
>
|
||||
{#each rows as row, i}
|
||||
<div class="group/row flex items-center gap-1.5 h-6">
|
||||
<input
|
||||
type="text"
|
||||
placeholder="key"
|
||||
placeholder={$t('models.paramKey')}
|
||||
bind:value={row.key}
|
||||
oninput={onInput}
|
||||
autocomplete="off"
|
||||
@@ -325,7 +325,7 @@ Files:
|
||||
/>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="value"
|
||||
placeholder={$t('models.paramValue')}
|
||||
bind:value={row.value}
|
||||
oninput={onInput}
|
||||
autocomplete="off"
|
||||
@@ -336,7 +336,7 @@ Files:
|
||||
type="button"
|
||||
onclick={() => onRemove(i)}
|
||||
class="shrink-0 text-gray-300 dark:text-gray-700 opacity-0 group-hover/row:opacity-100 hover:text-gray-500 dark:hover:text-gray-400 transition-colors duration-75"
|
||||
aria-label="Remove"
|
||||
aria-label={$t('common.remove')}
|
||||
>
|
||||
<Icon name="xmark" size={8} />
|
||||
</button>
|
||||
@@ -347,7 +347,7 @@ Files:
|
||||
onclick={onAdd}
|
||||
>
|
||||
<Icon name="plus" size={10} />
|
||||
<span>Add</span>
|
||||
<span>{$t('common.add')}</span>
|
||||
</button>
|
||||
</div>
|
||||
{/snippet}
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
const direction = $activeWorkspace?.splitDirection ?? 'horizontal';
|
||||
return [
|
||||
{
|
||||
label: 'Split Right',
|
||||
label: $t('bar.splitRight'),
|
||||
icon: 'split-horizontal',
|
||||
active: direction === 'horizontal',
|
||||
onclick: () => {
|
||||
@@ -39,7 +39,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
label: 'Split Down',
|
||||
label: $t('bar.splitDown'),
|
||||
icon: 'split-vertical',
|
||||
active: direction === 'vertical',
|
||||
onclick: () => {
|
||||
@@ -100,8 +100,8 @@
|
||||
? 'bg-gray-200 text-gray-900 dark:bg-white/8 dark:text-white'
|
||||
: 'text-gray-400 hover:text-gray-600 dark:hover:text-gray-300'}"
|
||||
onclick={() => (showSplitMenu = !showSplitMenu)}
|
||||
aria-label="Split Editor"
|
||||
use:tooltip={'Split Editor'}
|
||||
aria-label={$t('a11y.splitEditor')}
|
||||
use:tooltip={$t('a11y.splitEditor')}
|
||||
>
|
||||
<Icon
|
||||
name={$activeWorkspace?.splitDirection === 'vertical'
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
<button
|
||||
class="flex h-7 w-7 items-center justify-center rounded-lg text-gray-400 hover:bg-gray-100 hover:text-gray-700 dark:text-gray-600 dark:hover:bg-white/6 dark:hover:text-gray-300 transition-colors duration-75"
|
||||
onclick={handleClose}
|
||||
aria-label="Close"
|
||||
aria-label={$t('common.close')}
|
||||
>
|
||||
<Icon name="xmark" size={14} />
|
||||
</button>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import { onMount, onDestroy } from 'svelte';
|
||||
import { clearTabEdit, markTabUnsaved, updateTabFilePath, activeWorkspace } from '$lib/stores';
|
||||
import { get } from 'svelte/store';
|
||||
import { t } from '$lib/i18n';
|
||||
import { tooltip } from '$lib/tooltip';
|
||||
import { readFile, writeFile } from '$lib/apis/files';
|
||||
import { getGitDiff } from '$lib/apis/git';
|
||||
@@ -1210,7 +1211,7 @@
|
||||
{:else if fileData?.binary}
|
||||
<!-- Unknown binary, fallback -->
|
||||
<div class="state">
|
||||
<p class="state-title">Binary file</p>
|
||||
<p class="state-title">{$t('editor.binaryFile')}</p>
|
||||
<p class="state-sub">{fileData.name} ({formatSize(fileData.size)})</p>
|
||||
</div>
|
||||
{:else if diffMode}
|
||||
@@ -1219,8 +1220,8 @@
|
||||
<div class="state"><Spinner size={20} /></div>
|
||||
{:else if diffFiles.length === 0}
|
||||
<div class="state">
|
||||
<p class="state-title">No changes</p>
|
||||
<p class="state-sub">This file has no uncommitted modifications.</p>
|
||||
<p class="state-title">{$t('editor.noChanges')}</p>
|
||||
<p class="state-sub">{$t('editor.noUncommittedModifications')}</p>
|
||||
</div>
|
||||
{:else}
|
||||
<div class="diff-scroll">
|
||||
|
||||
@@ -349,7 +349,7 @@
|
||||
flash($t('git.uncommitted'));
|
||||
switchView('changes');
|
||||
} catch (e) {
|
||||
flash(e instanceof Error ? e.message : 'Failed to undo commit');
|
||||
flash(e instanceof Error ? e.message : $t('git.uncommitFailed'));
|
||||
}
|
||||
loading = false;
|
||||
await refresh();
|
||||
@@ -449,7 +449,7 @@
|
||||
message?: string;
|
||||
};
|
||||
if (!stashResult.ok) {
|
||||
flash(stashResult.message || 'No changes stashed');
|
||||
flash(stashResult.message || $t('git.noChangesStashed'));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -457,7 +457,7 @@
|
||||
pendingCheckoutBranch = null;
|
||||
await restoreStashedChangesForBranch(branch);
|
||||
} catch (e) {
|
||||
flash(e instanceof Error ? e.message : 'Failed to switch branch');
|
||||
flash(e instanceof Error ? e.message : $t('git.switchBranchFailed'));
|
||||
} finally {
|
||||
loading = false;
|
||||
await refresh();
|
||||
@@ -493,7 +493,7 @@
|
||||
await loadWorktrees();
|
||||
}
|
||||
} catch (e) {
|
||||
flash(e instanceof Error ? e.message : 'Failed to create worktree');
|
||||
flash(e instanceof Error ? e.message : $t('git.createWorktreeFailed'));
|
||||
} finally {
|
||||
loading = false;
|
||||
}
|
||||
@@ -512,7 +512,7 @@
|
||||
message?: string;
|
||||
};
|
||||
if (!stashResult.ok) {
|
||||
flash(stashResult.message || 'No changes stashed');
|
||||
flash(stashResult.message || $t('git.noChangesStashed'));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -522,7 +522,7 @@
|
||||
showBranches = false;
|
||||
pendingCreateBranch = null;
|
||||
} catch (e) {
|
||||
flash(e instanceof Error ? e.message : 'Failed to create branch');
|
||||
flash(e instanceof Error ? e.message : $t('git.createBranchFailed'));
|
||||
} finally {
|
||||
loading = false;
|
||||
await refresh();
|
||||
@@ -564,36 +564,36 @@
|
||||
|
||||
async function renameBranch(branch: BranchItem) {
|
||||
if (!branch.is_local) return;
|
||||
const nextName = window.prompt('Rename branch', branch.name)?.trim();
|
||||
const nextName = window.prompt($t('git.renameBranch'), branch.name)?.trim();
|
||||
if (!nextName || nextName === branch.name) return;
|
||||
try {
|
||||
await renameGitBranch(workspacePath, branch.name, nextName);
|
||||
flash('Branch renamed');
|
||||
flash($t('git.branchRenamed'));
|
||||
closeBranchActionMenu();
|
||||
await refresh({ force: true });
|
||||
await loadBranches();
|
||||
} catch (e) {
|
||||
flash(e instanceof Error ? e.message : 'Failed to rename branch');
|
||||
flash(e instanceof Error ? e.message : $t('git.renameBranchFailed'));
|
||||
}
|
||||
}
|
||||
|
||||
function copyBranchName(branch: BranchItem) {
|
||||
navigator.clipboard.writeText(branch.name);
|
||||
flash('Branch name copied');
|
||||
flash($t('git.branchNameCopied'));
|
||||
closeBranchActionMenu();
|
||||
}
|
||||
|
||||
async function deleteBranch(branch: BranchItem) {
|
||||
if (!branch.is_local || branch.is_current) return;
|
||||
if (!confirm(`Delete branch "${branch.name}"?`)) return;
|
||||
if (!confirm($t('git.deleteBranchConfirm', { name: branch.name }))) return;
|
||||
try {
|
||||
await deleteGitBranch(workspacePath, branch.name);
|
||||
flash('Branch deleted');
|
||||
flash($t('git.branchDeleted'));
|
||||
closeBranchActionMenu();
|
||||
await refresh({ force: true });
|
||||
await loadBranches();
|
||||
} catch (e) {
|
||||
flash(e instanceof Error ? e.message : 'Failed to delete branch');
|
||||
flash(e instanceof Error ? e.message : $t('git.deleteBranchFailed'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -864,7 +864,7 @@
|
||||
<input
|
||||
bind:this={branchSearchInputEl}
|
||||
bind:value={branchSearch}
|
||||
placeholder="Search"
|
||||
placeholder={$t('search.search')}
|
||||
class="w-full bg-transparent text-[0.6875rem] text-gray-500 dark:text-gray-400 placeholder:text-gray-300 dark:placeholder:text-gray-600 outline-none"
|
||||
onkeydown={(e) => {
|
||||
if (e.key === 'Escape') showBranches = false;
|
||||
@@ -884,7 +884,7 @@
|
||||
<div
|
||||
class="px-2 pt-1 pb-0.5 text-[0.625rem] uppercase text-gray-300 dark:text-gray-600"
|
||||
>
|
||||
Branches
|
||||
{$t('git.branches')}
|
||||
</div>
|
||||
{#each filteredBranches as branch (branch.name)}
|
||||
<div
|
||||
@@ -915,7 +915,7 @@
|
||||
</button>
|
||||
<button
|
||||
class="flex items-center justify-center w-5 h-5 mr-0.5 rounded-lg shrink-0 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 hover:bg-gray-200 dark:hover:bg-white/10 transition-all duration-75"
|
||||
aria-label="Branch actions"
|
||||
aria-label={$t('git.branchActions')}
|
||||
onclick={(e) => {
|
||||
e.stopPropagation();
|
||||
branchActionMenu = { branch, anchor: e.currentTarget as HTMLElement };
|
||||
@@ -929,12 +929,12 @@
|
||||
|
||||
{#if filteredBranches.length === 0}
|
||||
<div class="px-3 py-2 text-[0.6875rem] text-gray-400 dark:text-gray-500 text-center">
|
||||
No branches found
|
||||
{$t('git.noBranchesFound')}
|
||||
</div>
|
||||
{/if}
|
||||
{:else if branchData}
|
||||
<div class="px-3 py-2 text-[0.6875rem] text-gray-400 dark:text-gray-500 text-center">
|
||||
No branches found
|
||||
{$t('git.noBranchesFound')}
|
||||
</div>
|
||||
{/if}
|
||||
{/snippet}
|
||||
@@ -981,7 +981,7 @@
|
||||
}}
|
||||
>
|
||||
<Icon name="plus" size={14} />
|
||||
<span class="truncate">New branch</span>
|
||||
<span class="truncate">{$t('git.newBranch')}</span>
|
||||
</button>
|
||||
{/if}
|
||||
{/snippet}
|
||||
@@ -1013,7 +1013,7 @@
|
||||
<input
|
||||
bind:this={worktreeSearchInputEl}
|
||||
bind:value={worktreeSearch}
|
||||
placeholder="Search worktrees"
|
||||
placeholder={$t('git.searchWorktrees')}
|
||||
class="w-full bg-transparent text-[0.6875rem] text-gray-500 dark:text-gray-400 placeholder:text-gray-300 dark:placeholder:text-gray-600 outline-none"
|
||||
onkeydown={(e) => {
|
||||
if (e.key === 'Escape') showWorktrees = false;
|
||||
@@ -1033,7 +1033,7 @@
|
||||
<div
|
||||
class="px-2 pt-1 pb-0.5 text-[0.625rem] uppercase text-gray-300 dark:text-gray-600"
|
||||
>
|
||||
Worktrees
|
||||
{$t('git.worktrees')}
|
||||
</div>
|
||||
{#each filteredWorktrees as worktree (worktree.path)}
|
||||
<button
|
||||
@@ -1068,7 +1068,7 @@
|
||||
{/each}
|
||||
{:else}
|
||||
<div class="px-3 py-2 text-[0.6875rem] text-gray-400 dark:text-gray-500 text-center">
|
||||
No worktrees found
|
||||
{$t('git.noWorktreesFound')}
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
@@ -1081,7 +1081,7 @@
|
||||
bind:this={newWorktreeInputEl}
|
||||
type="text"
|
||||
class="flex-1 border-none outline-none bg-transparent text-xs text-gray-900 dark:text-white placeholder:text-gray-400"
|
||||
placeholder="Branch name"
|
||||
placeholder={$t('git.branchName')}
|
||||
bind:value={newWorktreeBranch}
|
||||
onkeydown={(e) => {
|
||||
if (e.key === 'Enter') createWorktree();
|
||||
@@ -1117,7 +1117,7 @@
|
||||
}}
|
||||
>
|
||||
<Icon name="plus" size={14} />
|
||||
<span class="truncate">New worktree</span>
|
||||
<span class="truncate">{$t('git.newWorktree')}</span>
|
||||
</button>
|
||||
{/if}
|
||||
{/snippet}
|
||||
@@ -1331,7 +1331,7 @@
|
||||
class="text-gray-400 dark:text-gray-600 shrink-0"
|
||||
/>
|
||||
<span class="text-[0.625rem] text-gray-400 dark:text-gray-600">
|
||||
{unpushedCount} unpushed {unpushedCount === 1 ? 'commit' : 'commits'}
|
||||
{$t('git.unpushedCommit', { count: unpushedCount })}
|
||||
</span>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -1345,7 +1345,7 @@
|
||||
{#if i < unpushedCount}
|
||||
<span
|
||||
class="w-1.5 h-1.5 rounded-full bg-blue-500 dark:bg-blue-400 shrink-0"
|
||||
title="Unpushed"
|
||||
title={$t('git.unpushed')}
|
||||
></span>
|
||||
{/if}
|
||||
<div class="flex flex-col min-w-0 flex-1">
|
||||
@@ -1469,11 +1469,11 @@
|
||||
{#if pendingCheckoutBranch}
|
||||
<Modal onclose={() => (pendingCheckoutBranch = null)} class="w-full max-w-sm mx-4">
|
||||
<div class="p-4">
|
||||
<h2 class="text-sm font-medium text-gray-900 dark:text-white">Switch branches?</h2>
|
||||
<h2 class="text-sm font-medium text-gray-900 dark:text-white">{$t('git.switchBranches')}</h2>
|
||||
<p class="mt-1.5 text-xs leading-relaxed text-gray-500 dark:text-gray-400">
|
||||
You have {totalChanges} changed {totalChanges === 1 ? 'file' : 'files'} on
|
||||
<span class="font-mono text-gray-700 dark:text-gray-300">{gitStatus?.branch}</span>. Choose
|
||||
whether to leave those changes here or bring them to
|
||||
{$t('git.moveChangesPromptPrefix', { count: totalChanges })}
|
||||
<span class="font-mono text-gray-700 dark:text-gray-300">{gitStatus?.branch}</span>.
|
||||
{$t('git.moveChangesPromptMiddle')}
|
||||
<span class="font-mono text-gray-700 dark:text-gray-300">{pendingCheckoutBranch}</span>.
|
||||
</p>
|
||||
<div class="mt-4 flex items-center justify-end gap-2">
|
||||
@@ -1481,21 +1481,21 @@
|
||||
class="px-2.5 py-1 text-xs text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 transition-colors"
|
||||
onclick={() => (pendingCheckoutBranch = null)}
|
||||
>
|
||||
Cancel
|
||||
{$t('common.cancel')}
|
||||
</button>
|
||||
<button
|
||||
class="px-2.5 py-1 text-xs text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white transition-colors"
|
||||
onclick={() => performBranchCheckout(pendingCheckoutBranch!, 'leave')}
|
||||
disabled={loading}
|
||||
>
|
||||
Leave changes
|
||||
{$t('git.leaveChanges')}
|
||||
</button>
|
||||
<button
|
||||
class="px-3.5 py-1.5 text-xs bg-black hover:bg-gray-900 text-white dark:bg-white dark:text-black dark:hover:bg-gray-100 transition-colors rounded-full disabled:opacity-50"
|
||||
onclick={() => performBranchCheckout(pendingCheckoutBranch!, 'bring')}
|
||||
disabled={loading}
|
||||
>
|
||||
Bring changes
|
||||
{$t('git.bringChanges')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1505,11 +1505,13 @@
|
||||
{#if pendingCreateBranch}
|
||||
<Modal onclose={() => (pendingCreateBranch = null)} class="w-full max-w-sm mx-4">
|
||||
<div class="p-4">
|
||||
<h2 class="text-sm font-medium text-gray-900 dark:text-white">Create branch?</h2>
|
||||
<h2 class="text-sm font-medium text-gray-900 dark:text-white">
|
||||
{$t('git.createBranchPrompt')}
|
||||
</h2>
|
||||
<p class="mt-1.5 text-xs leading-relaxed text-gray-500 dark:text-gray-400">
|
||||
You have {totalChanges} changed {totalChanges === 1 ? 'file' : 'files'} on
|
||||
<span class="font-mono text-gray-700 dark:text-gray-300">{gitStatus?.branch}</span>. Choose
|
||||
whether to leave those changes here or bring them to
|
||||
{$t('git.moveChangesPromptPrefix', { count: totalChanges })}
|
||||
<span class="font-mono text-gray-700 dark:text-gray-300">{gitStatus?.branch}</span>.
|
||||
{$t('git.moveChangesPromptMiddle')}
|
||||
<span class="font-mono text-gray-700 dark:text-gray-300">{pendingCreateBranch}</span>.
|
||||
</p>
|
||||
<div class="mt-4 flex items-center justify-end gap-2">
|
||||
@@ -1517,21 +1519,21 @@
|
||||
class="px-2.5 py-1 text-xs text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 transition-colors"
|
||||
onclick={() => (pendingCreateBranch = null)}
|
||||
>
|
||||
Cancel
|
||||
{$t('common.cancel')}
|
||||
</button>
|
||||
<button
|
||||
class="px-2.5 py-1 text-xs text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white transition-colors"
|
||||
onclick={() => performBranchCreate(pendingCreateBranch!, 'leave')}
|
||||
disabled={loading}
|
||||
>
|
||||
Leave changes
|
||||
{$t('git.leaveChanges')}
|
||||
</button>
|
||||
<button
|
||||
class="px-3.5 py-1.5 text-xs bg-black hover:bg-gray-900 text-white dark:bg-white dark:text-black dark:hover:bg-gray-100 transition-colors rounded-full disabled:opacity-50"
|
||||
onclick={() => performBranchCreate(pendingCreateBranch!, 'bring')}
|
||||
disabled={loading}
|
||||
>
|
||||
Bring changes
|
||||
{$t('git.bringChanges')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1545,21 +1547,21 @@
|
||||
...(branchActionMenu.branch.is_local
|
||||
? [
|
||||
{
|
||||
label: 'Rename',
|
||||
label: $t('files.rename'),
|
||||
icon: 'pencil',
|
||||
onclick: () => renameBranch(branchActionMenu!.branch)
|
||||
}
|
||||
]
|
||||
: []),
|
||||
{
|
||||
label: 'Copy branch name',
|
||||
label: $t('git.copyBranchName'),
|
||||
icon: 'copy',
|
||||
onclick: () => copyBranchName(branchActionMenu!.branch)
|
||||
},
|
||||
...(branchActionMenu.branch.is_local && !branchActionMenu.branch.is_current
|
||||
? [
|
||||
{
|
||||
label: 'Delete',
|
||||
label: $t('files.delete'),
|
||||
icon: 'xmark',
|
||||
onclick: () => deleteBranch(branchActionMenu!.branch)
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
reviewFiles = nextFiles;
|
||||
} catch (e) {
|
||||
if (seq !== loadSeq) return;
|
||||
error = e instanceof Error ? e.message : 'Failed to load git changes';
|
||||
error = e instanceof Error ? e.message : $t('git.loadChangesFailed');
|
||||
reviewFiles = [];
|
||||
} finally {
|
||||
if (seq === loadSeq) {
|
||||
@@ -265,13 +265,15 @@
|
||||
{:else if error && !gitStatus}
|
||||
<div class="flex h-full flex-col items-center justify-center gap-2 px-6 text-center">
|
||||
<Icon name="git-diff" size={24} class="text-gray-300 dark:text-gray-700" />
|
||||
<p class="text-xs font-medium text-gray-700 dark:text-gray-300">Unable to load changes</p>
|
||||
<p class="text-xs font-medium text-gray-700 dark:text-gray-300">
|
||||
{$t('git.unableToLoadChanges')}
|
||||
</p>
|
||||
<p class="max-w-sm text-[0.6875rem] text-gray-400 dark:text-gray-600">{error}</p>
|
||||
</div>
|
||||
{:else if !gitStatus?.is_repo}
|
||||
<div class="flex h-full flex-col items-center justify-center gap-2 px-6 text-center">
|
||||
<Icon name="git-branch" size={24} class="text-gray-300 dark:text-gray-700" />
|
||||
<p class="text-xs text-gray-400 dark:text-gray-600">Not a git repository</p>
|
||||
<p class="text-xs text-gray-400 dark:text-gray-600">{$t('git.notARepo')}</p>
|
||||
</div>
|
||||
{:else}
|
||||
<header
|
||||
@@ -300,7 +302,7 @@
|
||||
{/if}
|
||||
{#if totalChanges > 0}
|
||||
<span class="ml-1 font-mono text-[0.625rem] text-gray-400 dark:text-gray-600"
|
||||
>{totalChanges} changed</span
|
||||
>{$t('git.changedCount', { count: totalChanges })}</span
|
||||
>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -325,11 +327,13 @@
|
||||
onclick={toggleAll}
|
||||
>
|
||||
<Icon name={anyExpanded ? 'chevron-down' : 'chevron-right'} size={12} />
|
||||
<span>{anyExpanded ? 'Collapse All' : 'Expand All'}</span>
|
||||
<span>{anyExpanded ? $t('git.collapseAll') : $t('git.expandAll')}</span>
|
||||
</button>
|
||||
<span class="text-[0.6875rem] text-gray-500 dark:text-gray-400">Uncommitted</span>
|
||||
<span class="text-[0.6875rem] text-gray-500 dark:text-gray-400">
|
||||
{$t('git.uncommittedChanges')}
|
||||
</span>
|
||||
<span class="ml-auto text-[0.6875rem] text-gray-400 dark:text-gray-600"
|
||||
>{totalChanges} {totalChanges === 1 ? 'change' : 'changes'}</span
|
||||
>{$t('git.change', { count: totalChanges })}</span
|
||||
>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -345,10 +349,10 @@
|
||||
class="text-gray-300 dark:text-gray-700"
|
||||
/>
|
||||
<h2 class="text-sm font-medium text-gray-700 dark:text-gray-300">
|
||||
No file changes yet
|
||||
{$t('git.noFileChangesYet')}
|
||||
</h2>
|
||||
<p class="text-xs text-gray-400 dark:text-gray-600">
|
||||
Changes in this project will appear here.
|
||||
{$t('git.projectChangesHint')}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -406,7 +410,7 @@
|
||||
<span
|
||||
class="shrink-0 rounded px-1.5 py-0.5 text-[0.625rem] font-medium text-rose-500 bg-rose-50 dark:bg-rose-500/10 dark:text-rose-300"
|
||||
>
|
||||
{file.staged ? 'Staged' : 'Uncommitted'}
|
||||
{file.staged ? $t('git.staged') : $t('git.uncommittedChanges')}
|
||||
</span>
|
||||
</button>
|
||||
|
||||
@@ -462,7 +466,7 @@
|
||||
<div
|
||||
class="px-3 py-8 text-center text-[0.6875rem] text-gray-400 dark:text-gray-600"
|
||||
>
|
||||
No textual diff available
|
||||
{$t('git.noTextualDiff')}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -126,7 +126,7 @@
|
||||
class="preview-btn {canGoBack ? '' : 'disabled'}"
|
||||
onclick={goBack}
|
||||
disabled={!canGoBack}
|
||||
use:tooltip={'Back'}
|
||||
use:tooltip={$t('settings.back')}
|
||||
>
|
||||
<Icon name="chevron-left" size={12} />
|
||||
</button>
|
||||
@@ -136,13 +136,13 @@
|
||||
class="preview-btn {canGoForward ? '' : 'disabled'}"
|
||||
onclick={goForward}
|
||||
disabled={!canGoForward}
|
||||
use:tooltip={'Forward'}
|
||||
use:tooltip={$t('common.forward')}
|
||||
>
|
||||
<Icon name="chevron-right" size={12} />
|
||||
</button>
|
||||
|
||||
<!-- Refresh -->
|
||||
<button class="preview-btn" onclick={refresh} use:tooltip={'Refresh'}>
|
||||
<button class="preview-btn" onclick={refresh} use:tooltip={$t('files.refresh')}>
|
||||
<Icon name="refresh" size={12} />
|
||||
</button>
|
||||
|
||||
@@ -159,7 +159,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Open external -->
|
||||
<button class="preview-btn" onclick={openExternal} use:tooltip={'Open in new tab'}>
|
||||
<button class="preview-btn" onclick={openExternal} use:tooltip={$t('port.openInNewTab')}>
|
||||
<Icon name="external-link" size={12} />
|
||||
</button>
|
||||
</div>
|
||||
@@ -176,15 +176,15 @@
|
||||
{#if loadError}
|
||||
<div class="preview-error">
|
||||
<p class="error-title">{$t('port.cannotConnect')}</p>
|
||||
<p class="error-sub">localhost:{port} is not responding</p>
|
||||
<button class="error-retry" onclick={refresh}>Retry</button>
|
||||
<p class="error-sub">{$t('port.notResponding', { port })}</p>
|
||||
<button class="error-retry" onclick={refresh}>{$t('files.retry')}</button>
|
||||
</div>
|
||||
{:else}
|
||||
{#key iframeKey}
|
||||
<iframe
|
||||
bind:this={iframeEl}
|
||||
src={proxyUrl}
|
||||
title="Port {port} preview"
|
||||
title={$t('port.previewTitle', { port })}
|
||||
sandbox="allow-scripts allow-same-origin allow-forms allow-popups allow-modals allow-downloads"
|
||||
class="preview-iframe"
|
||||
onload={onIframeLoad}
|
||||
|
||||
@@ -183,7 +183,7 @@
|
||||
<p class="text-xs text-red-400">{error}</p>
|
||||
<button
|
||||
class="text-xs text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 px-3 py-1 rounded-lg bg-gray-100 dark:bg-white/6 transition-colors duration-100"
|
||||
onclick={() => fetchDirectories(currentPath)}>Retry</button
|
||||
onclick={() => fetchDirectories(currentPath)}>{$t('saveDialog.retry')}</button
|
||||
>
|
||||
</div>
|
||||
{:else if filteredDirs.length === 0}
|
||||
|
||||
@@ -201,8 +201,8 @@
|
||||
bind:value={apiType}
|
||||
class="bg-transparent text-[0.8125rem] text-gray-700 dark:text-gray-300 outline-none py-0.5 border-none cursor-pointer"
|
||||
>
|
||||
<option value="chat_completions">Chat Completions</option>
|
||||
<option value="responses">Responses</option>
|
||||
<option value="chat_completions">{$t('connections.chatCompletions')}</option>
|
||||
<option value="responses">{$t('connections.responses')}</option>
|
||||
</select>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@@ -144,8 +144,8 @@
|
||||
<button
|
||||
class="key inline-flex items-center justify-center"
|
||||
class:active={dictating}
|
||||
aria-label="Dictate terminal input"
|
||||
title="Dictate terminal input"
|
||||
aria-label={i18next.t('terminal.dictateInput')}
|
||||
title={i18next.t('terminal.dictateInput')}
|
||||
onmousedown={(e) => e.preventDefault()}
|
||||
ontouchstart={(e) => {
|
||||
e.preventDefault();
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<button
|
||||
onclick={onclose}
|
||||
class="app-icon-muted app-interactive ml-0.5 flex items-center justify-center w-5 h-5 rounded transition-colors duration-75"
|
||||
aria-label="Dismiss"
|
||||
aria-label={$t('a11y.dismissNotification')}
|
||||
>
|
||||
<Icon name="xmark" size={12} />
|
||||
</button>
|
||||
|
||||
@@ -14,23 +14,23 @@
|
||||
|
||||
type Frequency = 'ONCE' | 'HOURLY' | 'DAILY' | 'WEEKLY' | 'MONTHLY' | 'CUSTOM';
|
||||
|
||||
const FREQUENCIES: { key: Frequency; label: string }[] = [
|
||||
{ key: 'ONCE', label: 'Once' },
|
||||
{ key: 'HOURLY', label: 'Hourly' },
|
||||
{ key: 'DAILY', label: 'Daily' },
|
||||
{ key: 'WEEKLY', label: 'Weekly' },
|
||||
{ key: 'MONTHLY', label: 'Monthly' },
|
||||
{ key: 'CUSTOM', label: 'Custom' }
|
||||
const FREQUENCIES: { key: Frequency; labelKey: string }[] = [
|
||||
{ key: 'ONCE', labelKey: 'automations.once' },
|
||||
{ key: 'HOURLY', labelKey: 'automations.hourly' },
|
||||
{ key: 'DAILY', labelKey: 'automations.daily' },
|
||||
{ key: 'WEEKLY', labelKey: 'automations.weekly' },
|
||||
{ key: 'MONTHLY', labelKey: 'automations.monthly' },
|
||||
{ key: 'CUSTOM', labelKey: 'automations.custom' }
|
||||
];
|
||||
|
||||
const DAYS = [
|
||||
{ key: 'MO', label: 'Mo' },
|
||||
{ key: 'TU', label: 'Tu' },
|
||||
{ key: 'WE', label: 'We' },
|
||||
{ key: 'TH', label: 'Th' },
|
||||
{ key: 'FR', label: 'Fr' },
|
||||
{ key: 'SA', label: 'Sa' },
|
||||
{ key: 'SU', label: 'Su' }
|
||||
{ key: 'MO', labelKey: 'automations.dayMo' },
|
||||
{ key: 'TU', labelKey: 'automations.dayTu' },
|
||||
{ key: 'WE', labelKey: 'automations.dayWe' },
|
||||
{ key: 'TH', labelKey: 'automations.dayTh' },
|
||||
{ key: 'FR', labelKey: 'automations.dayFr' },
|
||||
{ key: 'SA', labelKey: 'automations.daySa' },
|
||||
{ key: 'SU', labelKey: 'automations.daySu' }
|
||||
];
|
||||
|
||||
let frequency = $state<Frequency>('DAILY');
|
||||
@@ -126,19 +126,7 @@
|
||||
}
|
||||
|
||||
let scheduleLabel = $derived(
|
||||
frequency === 'ONCE'
|
||||
? 'Once'
|
||||
: frequency === 'HOURLY'
|
||||
? 'Hourly'
|
||||
: frequency === 'DAILY'
|
||||
? 'Daily'
|
||||
: frequency === 'WEEKLY'
|
||||
? 'Weekly'
|
||||
: frequency === 'MONTHLY'
|
||||
? 'Monthly'
|
||||
: frequency === 'CUSTOM'
|
||||
? 'Custom'
|
||||
: 'Schedule'
|
||||
$t(FREQUENCIES.find((item) => item.key === frequency)?.labelKey ?? 'automations.schedule')
|
||||
);
|
||||
</script>
|
||||
|
||||
@@ -189,7 +177,7 @@
|
||||
style="left:{panelX}px; top:{panelY}px;"
|
||||
onmousedown={(e) => e.stopPropagation()}
|
||||
>
|
||||
<div class="px-2 text-xs text-gray-500 pt-1">Schedule</div>
|
||||
<div class="px-2 text-xs text-gray-500 pt-1">{$t('automations.schedule')}</div>
|
||||
|
||||
<div class="px-1.5 py-0.5">
|
||||
<select
|
||||
@@ -198,7 +186,7 @@
|
||||
onchange={emitChange}
|
||||
>
|
||||
{#each FREQUENCIES as f}
|
||||
<option value={f.key}>{f.label}</option>
|
||||
<option value={f.key}>{$t(f.labelKey)}</option>
|
||||
{/each}
|
||||
</select>
|
||||
</div>
|
||||
@@ -232,7 +220,7 @@
|
||||
{:else if frequency !== 'HOURLY'}
|
||||
<div class="flex gap-2 flex-wrap items-center px-3 pb-2 text-xs">
|
||||
<div class="flex items-center gap-1.5">
|
||||
<span class="text-xs text-gray-500 mr-0.5">Time</span>
|
||||
<span class="text-xs text-gray-500 mr-0.5">{$t('automations.time')}</span>
|
||||
<input
|
||||
type="time"
|
||||
value={`${String(hour).padStart(2, '0')}:${String(minute).padStart(2, '0')}`}
|
||||
@@ -248,7 +236,7 @@
|
||||
|
||||
{#if frequency === 'MONTHLY'}
|
||||
<div class="flex items-center gap-1.5">
|
||||
<span class="text-xs text-gray-500">Day</span>
|
||||
<span class="text-xs text-gray-500">{$t('automations.day')}</span>
|
||||
<input
|
||||
type="number"
|
||||
bind:value={monthDay}
|
||||
@@ -271,7 +259,7 @@
|
||||
: 'text-gray-400 dark:text-gray-500 hover:text-gray-700 dark:hover:text-gray-200'}"
|
||||
onclick={() => toggleDay(d.key)}
|
||||
>
|
||||
{d.label}
|
||||
{$t(d.labelKey)}
|
||||
</button>
|
||||
{/each}
|
||||
</div>
|
||||
|
||||
@@ -991,7 +991,9 @@
|
||||
<div
|
||||
class="app-theme app-surface absolute left-2 bottom-full mb-1 z-50 w-60 max-h-40 overflow-y-auto rounded-xl border shadow-xl p-0.5"
|
||||
>
|
||||
<div class="app-muted mb-0.5 px-2 pt-1 pb-0.5 text-[0.625rem] leading-none">Commands</div>
|
||||
<div class="app-muted mb-0.5 px-2 pt-1 pb-0.5 text-[0.625rem] leading-none">
|
||||
{$t('chat.commands')}
|
||||
</div>
|
||||
{#if slashCommandIds.includes('compact')}
|
||||
<button
|
||||
type="button"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script lang="ts">
|
||||
import Icon from '../Icon.svelte';
|
||||
import { fileIconName } from '$lib/utils/fileIcon';
|
||||
import { t } from '$lib/i18n';
|
||||
|
||||
interface SuggestionItem {
|
||||
id: string;
|
||||
@@ -37,9 +38,11 @@
|
||||
class="app-theme app-surface fixed z-50 w-60 max-h-40 overflow-y-auto rounded-xl border shadow-xl p-0.5"
|
||||
>
|
||||
{#if items.length === 0}
|
||||
<div class="app-muted flex items-center h-6 px-2 text-xs">No files found</div>
|
||||
<div class="app-muted flex items-center h-6 px-2 text-xs">{$t('quickOpen.noFiles')}</div>
|
||||
{:else}
|
||||
<div class="app-muted mb-0.5 px-2 pt-1 pb-0.5 text-[0.625rem] leading-none">Files</div>
|
||||
<div class="app-muted mb-0.5 px-2 pt-1 pb-0.5 text-[0.625rem] leading-none">
|
||||
{$t('search.files')}
|
||||
</div>
|
||||
<div bind:this={listEl}>
|
||||
{#each items as item, i (item.id)}
|
||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
||||
|
||||
@@ -315,7 +315,9 @@
|
||||
{/each}
|
||||
|
||||
{#if displayItems.length === 0}
|
||||
<div class="text-sm text-gray-400 dark:text-gray-500 italic px-1">No output items</div>
|
||||
<div class="text-sm text-gray-400 dark:text-gray-500 italic px-1">
|
||||
{$t('chat.noOutputItems')}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { t } from '$lib/i18n';
|
||||
|
||||
interface Props {
|
||||
canSend: boolean;
|
||||
streaming: boolean;
|
||||
@@ -35,8 +37,8 @@
|
||||
? 'bg-gray-900 text-white dark:bg-white dark:text-black'
|
||||
: 'bg-gray-100 text-gray-800 hover:bg-gray-200 dark:bg-white/90 dark:text-black dark:hover:bg-white'}"
|
||||
onclick={onvoice}
|
||||
aria-label="Voice mode"
|
||||
title="Voice mode"
|
||||
aria-label={$t('admin.audio.voiceMode')}
|
||||
title={$t('admin.audio.voiceMode')}
|
||||
>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { t } from '$lib/i18n';
|
||||
|
||||
interface SuggestionItem {
|
||||
id: string;
|
||||
label: string;
|
||||
@@ -28,9 +30,11 @@
|
||||
class="app-theme app-surface fixed z-50 w-60 max-h-40 overflow-y-auto rounded-xl border shadow-xl p-0.5"
|
||||
>
|
||||
{#if items.length === 0}
|
||||
<div class="app-muted flex items-center h-6 px-2 text-xs">No skills found</div>
|
||||
<div class="app-muted flex items-center h-6 px-2 text-xs">{$t('chat.noSkillsFound')}</div>
|
||||
{:else}
|
||||
<div class="app-muted px-2 pt-1 pb-0.5 text-[0.625rem] leading-none">Skills</div>
|
||||
<div class="app-muted px-2 pt-1 pb-0.5 text-[0.625rem] leading-none">
|
||||
{$t('chat.skills')}
|
||||
</div>
|
||||
<div bind:this={listEl}>
|
||||
{#each items as item, i (item.id)}
|
||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
||||
|
||||
@@ -84,8 +84,10 @@
|
||||
|
||||
function statusLabel(session: CommandSession): string {
|
||||
if (!session.done) return elapsedLabel(session.created_at);
|
||||
if (session.exit_code && session.exit_code !== 0) return `Failed ${session.exit_code}`;
|
||||
return 'Finished';
|
||||
if (session.exit_code && session.exit_code !== 0) {
|
||||
return $t('chat.failedWithCode', { code: session.exit_code });
|
||||
}
|
||||
return $t('chat.finished');
|
||||
}
|
||||
|
||||
function terminateSelectedSession() {
|
||||
@@ -126,7 +128,7 @@
|
||||
onclick={onclose}
|
||||
>
|
||||
<Icon name="chevron-left" size={12} />
|
||||
<span>Back</span>
|
||||
<span>{$t('settings.back')}</span>
|
||||
</button>
|
||||
<div class="min-w-0 flex-1">
|
||||
<div class="truncate font-mono text-xs font-medium text-gray-900 dark:text-white">
|
||||
@@ -136,11 +138,11 @@
|
||||
<button
|
||||
type="button"
|
||||
class="h-7 shrink-0 px-1.5 text-xs text-gray-400 underline-offset-2 transition-colors duration-75 hover:text-gray-700 hover:underline disabled:cursor-default disabled:text-gray-300 disabled:no-underline dark:text-gray-600 dark:hover:text-gray-200 dark:disabled:text-gray-700"
|
||||
title={terminatingSelectedSession ? 'Terminating' : 'Force terminate'}
|
||||
title={terminatingSelectedSession ? $t('chat.terminating') : $t('chat.forceTerminate')}
|
||||
disabled={terminatingSelectedSession}
|
||||
onclick={terminateSelectedSession}
|
||||
>
|
||||
{terminatingSelectedSession ? 'Terminating' : 'Terminate'}
|
||||
{terminatingSelectedSession ? $t('chat.terminating') : $t('chat.terminate')}
|
||||
</button>
|
||||
</div>
|
||||
<div class="min-h-0 flex-1" style="background: var(--app-bg); color: var(--app-fg);">
|
||||
@@ -167,7 +169,7 @@
|
||||
<div
|
||||
class="rounded-xl px-1.5 py-1.5 text-[0.6875rem] leading-relaxed text-gray-400 dark:text-gray-600"
|
||||
>
|
||||
Live session unavailable. Saved output remains in the chat.
|
||||
{$t('chat.sessionUnavailable')}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@@ -176,7 +178,7 @@
|
||||
<div
|
||||
class="px-1.5 pb-0.5 pt-1.5 text-[0.625rem] font-medium uppercase tracking-wide text-gray-400 dark:text-gray-600"
|
||||
>
|
||||
Sessions
|
||||
{$t('chat.sessions')}
|
||||
</div>
|
||||
{#each runningSessions as session}
|
||||
<div
|
||||
@@ -201,7 +203,7 @@
|
||||
<section>
|
||||
<div class="rounded-xl px-1.5 py-1.5 text-gray-600 dark:text-gray-400">
|
||||
<div class="flex h-5 items-center gap-3">
|
||||
<span class="min-w-0 flex-1 truncate">Context</span>
|
||||
<span class="min-w-0 flex-1 truncate">{$t('chat.statusContextUsage')}</span>
|
||||
<span class="shrink-0 font-mono text-[0.625rem] text-gray-400 dark:text-gray-600">
|
||||
{contextValue}
|
||||
</span>
|
||||
@@ -218,7 +220,7 @@
|
||||
<div
|
||||
class="flex h-7 items-center gap-3 rounded-xl px-1.5 text-gray-600 dark:text-gray-400"
|
||||
>
|
||||
<span class="min-w-0 flex-1 truncate">Queued messages</span>
|
||||
<span class="min-w-0 flex-1 truncate">{$t('chat.queuedMessages')}</span>
|
||||
<span class="font-mono text-[0.625rem] text-gray-400 dark:text-gray-600">
|
||||
{queuedMessages.length}
|
||||
</span>
|
||||
@@ -229,7 +231,7 @@
|
||||
<div
|
||||
class="flex h-7 items-center gap-3 rounded-xl px-1.5 text-gray-600 dark:text-gray-400"
|
||||
>
|
||||
<span class="min-w-0 flex-1 truncate">Chat ID</span>
|
||||
<span class="min-w-0 flex-1 truncate">{$t('chat.statusChatId')}</span>
|
||||
<button
|
||||
type="button"
|
||||
class="min-w-0 max-w-[11rem] truncate font-mono text-[0.625rem] text-gray-400 underline-offset-2 transition-colors duration-75 hover:text-gray-700 hover:underline dark:text-gray-600 dark:hover:text-gray-200"
|
||||
@@ -242,7 +244,7 @@
|
||||
<div
|
||||
class="flex h-7 items-center gap-3 rounded-xl px-1.5 text-gray-600 dark:text-gray-400"
|
||||
>
|
||||
<span class="min-w-0 flex-1 truncate">Chat ID</span>
|
||||
<span class="min-w-0 flex-1 truncate">{$t('chat.statusChatId')}</span>
|
||||
<span class="font-mono text-[0.625rem] text-gray-400 dark:text-gray-600">
|
||||
{$t('chat.statusNoChat')}
|
||||
</span>
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
class="pagination-btn"
|
||||
class:active={item === page}
|
||||
onclick={() => onpagechange(item)}
|
||||
aria-label="Page {item}"
|
||||
aria-label={$t('a11y.page', { page: item })}
|
||||
aria-current={item === page ? 'page' : undefined}
|
||||
>
|
||||
{item}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { t } from '$lib/i18n';
|
||||
|
||||
interface Props {
|
||||
/** Size in px or Tailwind class like '3.5' or '5'. Defaults to 1rem. */
|
||||
size?: number | string;
|
||||
@@ -17,7 +19,7 @@
|
||||
class="spinner {className}"
|
||||
style="width:{px}px;height:{px}px;border-width:{bw}px"
|
||||
role="status"
|
||||
aria-label="Loading"
|
||||
aria-label={$t('common.loading')}
|
||||
></div>
|
||||
|
||||
<style>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script lang="ts">
|
||||
import type { HighlighterCore } from 'shiki/core';
|
||||
import { t } from '$lib/i18n';
|
||||
|
||||
interface Props {
|
||||
language: string;
|
||||
@@ -145,18 +146,18 @@
|
||||
{#if isDiff && onapply}
|
||||
<button
|
||||
class="text-[0.6875rem] px-2 py-0.5 rounded text-green-600 hover:bg-green-600/10 transition-all duration-100"
|
||||
onclick={() => onapply?.(code)}>Apply</button
|
||||
onclick={() => onapply?.(code)}>{$t('common.apply')}</button
|
||||
>
|
||||
<button
|
||||
class="text-[0.6875rem] px-2 py-0.5 rounded text-red-600 hover:bg-red-600/10 transition-all duration-100"
|
||||
onclick={() => onreject?.()}>Reject</button
|
||||
onclick={() => onreject?.()}>{$t('common.reject')}</button
|
||||
>
|
||||
{/if}
|
||||
<button
|
||||
class="text-[0.6875rem] px-2 py-0.5 rounded text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 hover:bg-gray-200 dark:hover:bg-white/[0.08] transition-all duration-100"
|
||||
onclick={handleCopy}
|
||||
>
|
||||
{copied ? '✓' : 'Copy'}
|
||||
{copied ? '✓' : $t('common.copy')}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import type { Editor } from '@tiptap/core';
|
||||
import Icon from '../Icon.svelte';
|
||||
import { tooltip } from '$lib/tooltip';
|
||||
import { t } from '$lib/i18n';
|
||||
|
||||
interface Props {
|
||||
editor: Editor;
|
||||
@@ -75,42 +76,42 @@
|
||||
class="tb-btn"
|
||||
class:active={active.bold}
|
||||
onclick={() => editor.chain().focus().toggleBold().run()}
|
||||
use:tooltip={'Bold (⌘B)'}><strong>B</strong></button
|
||||
use:tooltip={$t('markdown.boldShortcut')}><strong>B</strong></button
|
||||
>
|
||||
|
||||
<button
|
||||
class="tb-btn"
|
||||
class:active={active.italic}
|
||||
onclick={() => editor.chain().focus().toggleItalic().run()}
|
||||
use:tooltip={'Italic (⌘I)'}><em>I</em></button
|
||||
use:tooltip={$t('markdown.italicShortcut')}><em>I</em></button
|
||||
>
|
||||
|
||||
<button
|
||||
class="tb-btn"
|
||||
class:active={active.underline}
|
||||
onclick={() => editor.chain().focus().toggleUnderline().run()}
|
||||
use:tooltip={'Underline (⌘U)'}><u>U</u></button
|
||||
use:tooltip={$t('markdown.underlineShortcut')}><u>U</u></button
|
||||
>
|
||||
|
||||
<button
|
||||
class="tb-btn"
|
||||
class:active={active.strike}
|
||||
onclick={() => editor.chain().focus().toggleStrike().run()}
|
||||
use:tooltip={'Strikethrough'}><s>S</s></button
|
||||
use:tooltip={$t('markdown.strikethrough')}><s>S</s></button
|
||||
>
|
||||
|
||||
<button
|
||||
class="tb-btn"
|
||||
class:active={active.code}
|
||||
onclick={() => editor.chain().focus().toggleCode().run()}
|
||||
use:tooltip={'Inline code'}><Icon name="code" size={12} /></button
|
||||
use:tooltip={$t('markdown.inlineCode')}><Icon name="code" size={12} /></button
|
||||
>
|
||||
|
||||
<button
|
||||
class="tb-btn"
|
||||
class:active={active.highlight}
|
||||
onclick={() => editor.chain().focus().toggleHighlight().run()}
|
||||
use:tooltip={'Highlight'}><span class="highlight-icon">H</span></button
|
||||
use:tooltip={$t('markdown.highlight')}><span class="highlight-icon">H</span></button
|
||||
>
|
||||
|
||||
<span class="tb-divider"></span>
|
||||
@@ -120,21 +121,21 @@
|
||||
class="tb-btn heading-btn"
|
||||
class:active={active.h1}
|
||||
onclick={() => editor.chain().focus().toggleHeading({ level: 1 }).run()}
|
||||
use:tooltip={'Heading 1'}>H1</button
|
||||
use:tooltip={$t('markdown.heading1')}>H1</button
|
||||
>
|
||||
|
||||
<button
|
||||
class="tb-btn heading-btn"
|
||||
class:active={active.h2}
|
||||
onclick={() => editor.chain().focus().toggleHeading({ level: 2 }).run()}
|
||||
use:tooltip={'Heading 2'}>H2</button
|
||||
use:tooltip={$t('markdown.heading2')}>H2</button
|
||||
>
|
||||
|
||||
<button
|
||||
class="tb-btn heading-btn"
|
||||
class:active={active.h3}
|
||||
onclick={() => editor.chain().focus().toggleHeading({ level: 3 }).run()}
|
||||
use:tooltip={'Heading 3'}>H3</button
|
||||
use:tooltip={$t('markdown.heading3')}>H3</button
|
||||
>
|
||||
|
||||
<span class="tb-divider"></span>
|
||||
@@ -144,21 +145,21 @@
|
||||
class="tb-btn"
|
||||
class:active={active.bulletList}
|
||||
onclick={() => editor.chain().focus().toggleBulletList().run()}
|
||||
use:tooltip={'Bullet list'}><Icon name="list" size={12} /></button
|
||||
use:tooltip={$t('markdown.bulletList')}><Icon name="list" size={12} /></button
|
||||
>
|
||||
|
||||
<button
|
||||
class="tb-btn"
|
||||
class:active={active.orderedList}
|
||||
onclick={() => editor.chain().focus().toggleOrderedList().run()}
|
||||
use:tooltip={'Numbered list'}><Icon name="list-ordered" size={12} /></button
|
||||
use:tooltip={$t('markdown.numberedList')}><Icon name="list-ordered" size={12} /></button
|
||||
>
|
||||
|
||||
<button
|
||||
class="tb-btn"
|
||||
class:active={active.taskList}
|
||||
onclick={() => editor.chain().focus().toggleTaskList().run()}
|
||||
use:tooltip={'Task list'}><Icon name="check-square" size={12} /></button
|
||||
use:tooltip={$t('markdown.taskList')}><Icon name="check-square" size={12} /></button
|
||||
>
|
||||
|
||||
<span class="tb-divider"></span>
|
||||
@@ -168,20 +169,20 @@
|
||||
class="tb-btn"
|
||||
class:active={active.blockquote}
|
||||
onclick={() => editor.chain().focus().toggleBlockquote().run()}
|
||||
use:tooltip={'Quote'}><Icon name="quote" size={12} /></button
|
||||
use:tooltip={$t('markdown.quote')}><Icon name="quote" size={12} /></button
|
||||
>
|
||||
|
||||
<button
|
||||
class="tb-btn"
|
||||
class:active={active.codeBlock}
|
||||
onclick={() => editor.chain().focus().toggleCodeBlock().run()}
|
||||
use:tooltip={'Code block'}>{'{ }'}</button
|
||||
use:tooltip={$t('markdown.codeBlock')}>{'{ }'}</button
|
||||
>
|
||||
|
||||
<button
|
||||
class="tb-btn"
|
||||
onclick={() => editor.chain().focus().setHorizontalRule().run()}
|
||||
use:tooltip={'Horizontal rule'}>──</button
|
||||
use:tooltip={$t('markdown.horizontalRule')}>──</button
|
||||
>
|
||||
|
||||
<span class="tb-divider"></span>
|
||||
@@ -191,7 +192,7 @@
|
||||
class="tb-btn"
|
||||
onclick={() =>
|
||||
editor.chain().focus().insertTable({ rows: 3, cols: 3, withHeaderRow: true }).run()}
|
||||
use:tooltip={'Insert table'}><Icon name="table" size={12} /></button
|
||||
use:tooltip={$t('markdown.insertTable')}><Icon name="table" size={12} /></button
|
||||
>
|
||||
|
||||
<!-- Undo/Redo -->
|
||||
@@ -201,14 +202,14 @@
|
||||
class="tb-btn"
|
||||
onclick={() => editor.chain().focus().undo().run()}
|
||||
disabled={!editor.can().undo()}
|
||||
use:tooltip={'Undo (⌘Z)'}><Icon name="undo" size={12} /></button
|
||||
use:tooltip={$t('markdown.undoShortcut')}><Icon name="undo" size={12} /></button
|
||||
>
|
||||
|
||||
<button
|
||||
class="tb-btn"
|
||||
onclick={() => editor.chain().focus().redo().run()}
|
||||
disabled={!editor.can().redo()}
|
||||
use:tooltip={'Redo (⌘⇧Z)'}><Icon name="redo" size={12} /></button
|
||||
use:tooltip={$t('markdown.redoShortcut')}><Icon name="redo" size={12} /></button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script lang="ts">
|
||||
import type { Token } from 'marked';
|
||||
import { openFileTab, setFileBrowserCwd, setActiveTab } from '$lib/stores';
|
||||
import { t } from '$lib/i18n';
|
||||
|
||||
interface Props {
|
||||
items: Token[];
|
||||
@@ -138,7 +139,7 @@
|
||||
{#if wl}
|
||||
<span
|
||||
class="text-blue-500 dark:text-blue-400 bg-blue-500/8 dark:bg-blue-400/10 rounded px-1 cursor-pointer hover:underline transition-colors"
|
||||
title="Link to {wl.target}">{wl.label}</span
|
||||
title={$t('markdown.linkTo', { target: wl.target })}>{wl.label}</span
|
||||
>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { t } from '$lib/i18n';
|
||||
|
||||
let { code }: { code: string } = $props();
|
||||
|
||||
let containerEl: HTMLDivElement | undefined = $state();
|
||||
@@ -27,7 +29,7 @@
|
||||
rendered = true;
|
||||
}
|
||||
} catch (e: any) {
|
||||
error = e.message || 'Failed to render diagram';
|
||||
error = e.message || $t('preview.diagramRenderError');
|
||||
}
|
||||
})();
|
||||
});
|
||||
@@ -36,7 +38,7 @@
|
||||
<div class="mermaid-block">
|
||||
{#if error}
|
||||
<div class="mermaid-error">
|
||||
<span class="mermaid-error-label">Diagram error</span>
|
||||
<span class="mermaid-error-label">{$t('preview.diagramError')}</span>
|
||||
<pre class="mermaid-error-msg">{error}</pre>
|
||||
<pre class="mermaid-source">{code}</pre>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { onMount, onDestroy } from 'svelte';
|
||||
import panzoom, { type PanZoom } from 'panzoom';
|
||||
import { t } from '$lib/i18n';
|
||||
|
||||
interface Props {
|
||||
src: string;
|
||||
@@ -75,7 +76,7 @@
|
||||
</div>
|
||||
|
||||
<div class="zoom-toolbar">
|
||||
<button class="zoom-btn" onclick={zoomOut} aria-label="Zoom out">
|
||||
<button class="zoom-btn" onclick={zoomOut} aria-label={$t('a11y.zoomOut')}>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 20 20"
|
||||
@@ -90,10 +91,10 @@
|
||||
/>
|
||||
</svg>
|
||||
</button>
|
||||
<button class="zoom-level" onclick={resetView} aria-label="Reset zoom">
|
||||
<button class="zoom-level" onclick={resetView} aria-label={$t('a11y.resetZoom')}>
|
||||
{Math.round(zoomLevel * 100)}%
|
||||
</button>
|
||||
<button class="zoom-btn" onclick={zoomIn} aria-label="Zoom in">
|
||||
<button class="zoom-btn" onclick={zoomIn} aria-label={$t('a11y.zoomIn')}>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 20 20"
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import panzoom, { type PanZoom } from 'panzoom';
|
||||
import { fetchHandler } from '$lib/apis';
|
||||
import Spinner from '$lib/components/common/Spinner.svelte';
|
||||
import { t } from '$lib/i18n';
|
||||
|
||||
interface Props {
|
||||
src: string;
|
||||
@@ -41,7 +42,7 @@
|
||||
await renderAllPages();
|
||||
} catch (e: any) {
|
||||
console.error('PDF render error:', e);
|
||||
error = 'Failed to load PDF.';
|
||||
error = $t('preview.pdfLoadError');
|
||||
} finally {
|
||||
loading = false;
|
||||
}
|
||||
@@ -240,7 +241,7 @@
|
||||
|
||||
{#if !loading && !error && pdfDoc}
|
||||
<div class="zoom-toolbar">
|
||||
<button class="zoom-btn" onclick={zoomOut} aria-label="Zoom out">
|
||||
<button class="zoom-btn" onclick={zoomOut} aria-label={$t('a11y.zoomOut')}>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 20 20"
|
||||
@@ -255,10 +256,10 @@
|
||||
/>
|
||||
</svg>
|
||||
</button>
|
||||
<button class="zoom-level" onclick={resetView} aria-label="Reset zoom">
|
||||
<button class="zoom-level" onclick={resetView} aria-label={$t('a11y.resetZoom')}>
|
||||
{Math.round(zoomLevel * 100)}%
|
||||
</button>
|
||||
<button class="zoom-btn" onclick={zoomIn} aria-label="Zoom in">
|
||||
<button class="zoom-btn" onclick={zoomIn} aria-label={$t('a11y.zoomIn')}>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 20 20"
|
||||
|
||||
@@ -179,7 +179,7 @@
|
||||
<textarea
|
||||
class="query-input"
|
||||
bind:value={customQuery}
|
||||
placeholder="SELECT * FROM ..."
|
||||
placeholder={$t('sqlite.queryPlaceholder')}
|
||||
rows="2"
|
||||
onkeydown={(e) => {
|
||||
if ((e.metaKey || e.ctrlKey) && e.key === 'Enter') runQuery();
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
import panzoom, { type PanZoom } from 'panzoom';
|
||||
import { onMount, onDestroy } from 'svelte';
|
||||
import DOMPurify from 'dompurify';
|
||||
import { t } from '$lib/i18n';
|
||||
|
||||
interface Props {
|
||||
content: string;
|
||||
@@ -77,7 +78,7 @@
|
||||
onclick={() => {
|
||||
mode = 'visual';
|
||||
}}
|
||||
use:tooltip={'Visual'}><Icon name="eye" size={14} /></button
|
||||
use:tooltip={$t('preview.visual')}><Icon name="eye" size={14} /></button
|
||||
>
|
||||
<button
|
||||
class="toolbar-btn"
|
||||
@@ -85,10 +86,10 @@
|
||||
onclick={() => {
|
||||
mode = 'source';
|
||||
}}
|
||||
use:tooltip={'Source'}><Icon name="code" size={14} /></button
|
||||
use:tooltip={$t('preview.source')}><Icon name="code" size={14} /></button
|
||||
>
|
||||
{#if mode === 'visual'}
|
||||
<button class="toolbar-btn" onclick={resetView} use:tooltip={'Reset zoom'}>
|
||||
<button class="toolbar-btn" onclick={resetView} use:tooltip={$t('a11y.resetZoom')}>
|
||||
<span class="zoom-text">{Math.round(zoomLevel * 100)}%</span>
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
Reference in new issue
Block a user