mirror of
https://github.com/open-webui/computer.git
synced 2026-11-29 08:31:49 -05:00
refac
This commit is contained in:
1 parent
6a359036c5
commit
2eaaa5c8f2
87 files changed
+1306
-976
No files matched your search
@@ -67,7 +67,7 @@
|
||||
--tw-border-opacity: 1;
|
||||
background-color: rgba(215, 215, 215, 0.6);
|
||||
border-color: rgba(255, 255, 255, var(--tw-border-opacity));
|
||||
border-radius: 9999px;
|
||||
border-radius: 624.9375rem;
|
||||
border-width: 1px;
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
background-color: transparent;
|
||||
border-radius: 9999px;
|
||||
border-radius: 624.9375rem;
|
||||
}
|
||||
|
||||
.scrollbar-hidden,
|
||||
@@ -202,9 +202,9 @@
|
||||
.tippy-box[data-theme~='cptr'] {
|
||||
background: #1a1a1a;
|
||||
color: #e0e0e0;
|
||||
font-size: 11px;
|
||||
font-size: 0.6875rem;
|
||||
font-weight: 500;
|
||||
padding: 2px 4px;
|
||||
border-radius: 6px;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
|
||||
padding: 0.125rem 0.25rem;
|
||||
border-radius: 0.375rem;
|
||||
box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
@@ -63,8 +63,7 @@ export const updateMemory = (
|
||||
scope: MemoryScope,
|
||||
workspace: string,
|
||||
operations: MemoryOperation[]
|
||||
) =>
|
||||
fetchJSON('/api/memory/update', jsonBody({ scope, workspace, operations }));
|
||||
) => fetchJSON('/api/memory/update', jsonBody({ scope, workspace, operations }));
|
||||
|
||||
export const searchMemory = (body: {
|
||||
query?: string;
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
</h2>
|
||||
<button
|
||||
type="button"
|
||||
class="text-[13px] text-gray-400 dark:text-gray-600 hover:text-gray-700 dark:hover:text-gray-300 transition-colors"
|
||||
class="text-[0.8125rem] text-gray-400 dark:text-gray-600 hover:text-gray-700 dark:hover:text-gray-300 transition-colors"
|
||||
onclick={onclose}
|
||||
>
|
||||
Close
|
||||
@@ -85,7 +85,7 @@
|
||||
|
||||
<div class="flex gap-3">
|
||||
<div class="flex-1">
|
||||
<label for={`${fieldPrefix}-name`} class="text-[10px] text-gray-400 dark:text-gray-600">
|
||||
<label for={`${fieldPrefix}-name`} class="text-[0.625rem] text-gray-400 dark:text-gray-600">
|
||||
{$t('admin.agentsProfileName')}
|
||||
</label>
|
||||
<input
|
||||
@@ -94,11 +94,11 @@
|
||||
bind:value={draft.name}
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5"
|
||||
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"
|
||||
/>
|
||||
</div>
|
||||
<div class="w-32 shrink-0">
|
||||
<label for={`${fieldPrefix}-type`} class="text-[10px] text-gray-400 dark:text-gray-600">
|
||||
<label for={`${fieldPrefix}-type`} class="text-[0.625rem] text-gray-400 dark:text-gray-600">
|
||||
{$t('admin.agentsType')}
|
||||
</label>
|
||||
<select
|
||||
@@ -119,7 +119,7 @@
|
||||
launch_args: draft.launch_args || ''
|
||||
};
|
||||
}}
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 outline-none py-0.5 cursor-pointer"
|
||||
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="codex">Codex</option>
|
||||
<option value="claude_code">Claude Code</option>
|
||||
@@ -130,7 +130,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label for={`${fieldPrefix}-id`} class="text-[10px] text-gray-400 dark:text-gray-600 mt-2">
|
||||
<label for={`${fieldPrefix}-id`} class="text-[0.625rem] text-gray-400 dark:text-gray-600 mt-2">
|
||||
{$t('admin.agentsProfileId')}
|
||||
</label>
|
||||
<input
|
||||
@@ -139,10 +139,13 @@
|
||||
bind:value={draft.id}
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5 font-mono"
|
||||
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"
|
||||
/>
|
||||
|
||||
<label for={`${fieldPrefix}-command`} class="text-[10px] text-gray-400 dark:text-gray-600 mt-2">
|
||||
<label
|
||||
for={`${fieldPrefix}-command`}
|
||||
class="text-[0.625rem] text-gray-400 dark:text-gray-600 mt-2"
|
||||
>
|
||||
{$t('admin.agentsCommand')}
|
||||
</label>
|
||||
<input
|
||||
@@ -152,10 +155,13 @@
|
||||
placeholder={defaultCommand(draft.agent)}
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5 font-mono"
|
||||
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"
|
||||
/>
|
||||
|
||||
<label for={`${fieldPrefix}-home`} class="text-[10px] text-gray-400 dark:text-gray-600 mt-2">
|
||||
<label
|
||||
for={`${fieldPrefix}-home`}
|
||||
class="text-[0.625rem] text-gray-400 dark:text-gray-600 mt-2"
|
||||
>
|
||||
{$t('admin.agentsHome')}
|
||||
</label>
|
||||
<input
|
||||
@@ -166,13 +172,13 @@
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
oninput={(e) => (draft.home = e.currentTarget.value || null)}
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5 font-mono"
|
||||
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"
|
||||
/>
|
||||
|
||||
{#if draft.agent === 'claude_code'}
|
||||
<label
|
||||
for={`${fieldPrefix}-launch-args`}
|
||||
class="text-[10px] text-gray-400 dark:text-gray-600 mt-2"
|
||||
class="text-[0.625rem] text-gray-400 dark:text-gray-600 mt-2"
|
||||
>
|
||||
{$t('admin.agentsLaunchArgs')}
|
||||
</label>
|
||||
@@ -182,14 +188,14 @@
|
||||
bind:value={draft.launch_args}
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5 font-mono"
|
||||
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"
|
||||
/>
|
||||
{/if}
|
||||
|
||||
{#if draft.agent === 'cursor'}
|
||||
<label
|
||||
for={`${fieldPrefix}-api-endpoint`}
|
||||
class="text-[10px] text-gray-400 dark:text-gray-600 mt-2"
|
||||
class="text-[0.625rem] text-gray-400 dark:text-gray-600 mt-2"
|
||||
>
|
||||
{$t('admin.agentsApiEndpoint')}
|
||||
</label>
|
||||
@@ -200,14 +206,14 @@
|
||||
placeholder="Optional"
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5 font-mono"
|
||||
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"
|
||||
/>
|
||||
{/if}
|
||||
|
||||
{#if draft.agent === 'opencode'}
|
||||
<label
|
||||
for={`${fieldPrefix}-server-url`}
|
||||
class="text-[10px] text-gray-400 dark:text-gray-600 mt-2"
|
||||
class="text-[0.625rem] text-gray-400 dark:text-gray-600 mt-2"
|
||||
>
|
||||
{$t('admin.agentsServerUrl')}
|
||||
</label>
|
||||
@@ -218,12 +224,12 @@
|
||||
placeholder="Optional"
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5 font-mono"
|
||||
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"
|
||||
/>
|
||||
|
||||
<label
|
||||
for={`${fieldPrefix}-server-password`}
|
||||
class="text-[10px] text-gray-400 dark:text-gray-600 mt-2"
|
||||
class="text-[0.625rem] text-gray-400 dark:text-gray-600 mt-2"
|
||||
>
|
||||
{$t('admin.agentsServerPassword')}
|
||||
</label>
|
||||
@@ -234,7 +240,7 @@
|
||||
placeholder="Optional"
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5 font-mono"
|
||||
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"
|
||||
/>
|
||||
{/if}
|
||||
|
||||
@@ -243,7 +249,7 @@
|
||||
{#if !isNew}
|
||||
<button
|
||||
type="button"
|
||||
class="text-[13px] text-gray-400 hover:text-red-500 dark:hover:text-red-400 transition-colors duration-100"
|
||||
class="text-[0.8125rem] text-gray-400 hover:text-red-500 dark:hover:text-red-400 transition-colors duration-100"
|
||||
onclick={ondelete}
|
||||
title={$t('admin.agentsDeleteProfile')}
|
||||
>
|
||||
@@ -254,7 +260,7 @@
|
||||
<button
|
||||
type="button"
|
||||
onclick={() => onsave(normalizeDraft())}
|
||||
class="text-[13px] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100"
|
||||
class="text-[0.8125rem] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100"
|
||||
>
|
||||
{$t('settings.save')}
|
||||
</button>
|
||||
|
||||
@@ -262,23 +262,23 @@
|
||||
>
|
||||
<span class="flex-1 min-w-0">
|
||||
<span
|
||||
class="block text-[13px] truncate {profile.mode === 'disabled'
|
||||
class="block text-[0.8125rem] truncate {profile.mode === 'disabled'
|
||||
? 'text-gray-400 dark:text-gray-600'
|
||||
: 'text-gray-700 dark:text-gray-300'}"
|
||||
>
|
||||
{profile.name}
|
||||
</span>
|
||||
<span class="block text-[11px] text-gray-400 dark:text-gray-600 truncate">
|
||||
<span class="block text-[0.6875rem] text-gray-400 dark:text-gray-600 truncate">
|
||||
{profileSubtitle(profile)}
|
||||
</span>
|
||||
{#if detected[profile.id]?.message}
|
||||
<span class="block text-[11px] text-gray-300 dark:text-gray-700 truncate">
|
||||
<span class="block text-[0.6875rem] text-gray-300 dark:text-gray-700 truncate">
|
||||
{detected[profile.id]?.message}
|
||||
</span>
|
||||
{/if}
|
||||
</span>
|
||||
<span
|
||||
class="hidden sm:flex items-center gap-1.5 shrink-0 text-[11px] text-gray-400 dark:text-gray-600"
|
||||
class="hidden sm:flex items-center gap-1.5 shrink-0 text-[0.6875rem] text-gray-400 dark:text-gray-600"
|
||||
>
|
||||
<span class="w-1.5 h-1.5 rounded-full {statusTone(profile)}"></span>
|
||||
<span>{$t(statusKey(profile))}</span>
|
||||
@@ -310,7 +310,7 @@
|
||||
</div>
|
||||
|
||||
{#if profiles.length === 0}
|
||||
<p class="text-[13px] 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">No agent profiles</p>
|
||||
{/if}
|
||||
|
||||
<div class="mt-auto pt-6 flex items-center justify-between">
|
||||
@@ -318,7 +318,7 @@
|
||||
{profiles.length} profile{profiles.length === 1 ? '' : 's'}
|
||||
</span>
|
||||
<button
|
||||
class="text-[13px] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100 disabled:opacity-50"
|
||||
class="text-[0.8125rem] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100 disabled:opacity-50"
|
||||
onclick={save}
|
||||
disabled={saving}
|
||||
>
|
||||
|
||||
@@ -121,7 +121,7 @@
|
||||
}}
|
||||
/>
|
||||
</label>
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600 -mt-1">
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600 -mt-1">
|
||||
{$t('admin.audio.voiceMemosHint')}
|
||||
</p>
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
}}
|
||||
/>
|
||||
</label>
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600 -mt-1">
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600 -mt-1">
|
||||
{transcribeEnabled
|
||||
? $t('admin.audio.transcribeOnHint')
|
||||
: $t('admin.audio.transcribeOffHint')}
|
||||
@@ -155,7 +155,7 @@
|
||||
<option value="low">{$t('admin.audio.qualityLow')}</option>
|
||||
</select>
|
||||
</div>
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600 -mt-1">
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600 -mt-1">
|
||||
{quality === 'high'
|
||||
? $t('admin.audio.qualityHintHigh')
|
||||
: quality === 'medium'
|
||||
@@ -204,7 +204,7 @@
|
||||
class="w-full mt-1 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"
|
||||
/>
|
||||
</div>
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600">
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600">
|
||||
{$t('admin.audio.sttHint')}
|
||||
</p>
|
||||
</div>
|
||||
@@ -223,7 +223,7 @@
|
||||
}}
|
||||
/>
|
||||
</label>
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600 -mt-1">
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600 -mt-1">
|
||||
{$t('admin.audio.ttsEnabledHint')}
|
||||
</p>
|
||||
<label class="flex items-center justify-between cursor-pointer">
|
||||
@@ -237,7 +237,7 @@
|
||||
}}
|
||||
/>
|
||||
</label>
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600 -mt-1">
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600 -mt-1">
|
||||
{$t('admin.audio.ttsAutoStreamHint')}
|
||||
</p>
|
||||
<div>
|
||||
@@ -322,7 +322,7 @@
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600">
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600">
|
||||
{$t('admin.audio.ttsHint')}
|
||||
</p>
|
||||
</div>
|
||||
@@ -345,7 +345,7 @@
|
||||
<option value="provider">{$t('admin.audio.voiceModeSttProvider')}</option>
|
||||
</select>
|
||||
</div>
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600 -mt-1">
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600 -mt-1">
|
||||
{voiceModeSttMode === 'browser'
|
||||
? $t('admin.audio.voiceModeBrowserSttHint')
|
||||
: $t('admin.audio.voiceModeProviderSttHint')}
|
||||
@@ -362,7 +362,7 @@
|
||||
class="w-full mt-1 px-2 py-1.5 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 resize-y min-h-24"
|
||||
></textarea>
|
||||
</div>
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600">
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600">
|
||||
{$t('admin.audio.voiceModeSystemPromptHint')}
|
||||
</p>
|
||||
</div>
|
||||
@@ -371,7 +371,7 @@
|
||||
<!-- Save -->
|
||||
<div class="shrink-0 pt-3 flex justify-end">
|
||||
<button
|
||||
class="text-[13px] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100 disabled:opacity-50"
|
||||
class="text-[0.8125rem] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100 disabled:opacity-50"
|
||||
onclick={() => save()}
|
||||
disabled={saving}
|
||||
>
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
onclick={() => (editConn = conn)}
|
||||
>
|
||||
<span
|
||||
class="flex-1 text-[13px] truncate
|
||||
class="flex-1 text-[0.8125rem] truncate
|
||||
{conn.enabled ? 'text-gray-700 dark:text-gray-300' : 'text-gray-400 dark:text-gray-600'}"
|
||||
>
|
||||
{conn.name}
|
||||
@@ -106,7 +106,9 @@
|
||||
{/each}
|
||||
|
||||
{#if connections.length === 0}
|
||||
<p class="text-[13px] text-gray-400 dark:text-gray-600 py-4">{$t('connections.empty')}</p>
|
||||
<p class="text-[0.8125rem] text-gray-400 dark:text-gray-600 py-4">
|
||||
{$t('connections.empty')}
|
||||
</p>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@@ -142,7 +142,9 @@
|
||||
<!-- Platform + Name on same row -->
|
||||
<div class="flex gap-3">
|
||||
<div class="flex-1">
|
||||
<label class="text-[10px] text-gray-400 dark:text-gray-600">{$t('messaging.name')}</label>
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600"
|
||||
>{$t('messaging.name')}</label
|
||||
>
|
||||
<input
|
||||
type="text"
|
||||
bind:value={name}
|
||||
@@ -150,11 +152,11 @@
|
||||
autofocus
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5"
|
||||
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"
|
||||
/>
|
||||
</div>
|
||||
<div class="w-28 shrink-0">
|
||||
<label class="text-[10px] text-gray-400 dark:text-gray-600"
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600"
|
||||
>{$t('messaging.platform')}</label
|
||||
>
|
||||
<select
|
||||
@@ -162,7 +164,7 @@
|
||||
onchange={() => {
|
||||
verifyResult = null;
|
||||
}}
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 outline-none py-0.5 cursor-pointer"
|
||||
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="telegram">Telegram</option>
|
||||
<option value="discord">Discord</option>
|
||||
@@ -174,7 +176,7 @@
|
||||
</div>
|
||||
{:else}
|
||||
<!-- Edit mode: just name -->
|
||||
<label class="text-[10px] text-gray-400 dark:text-gray-600">{$t('messaging.name')}</label>
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600">{$t('messaging.name')}</label>
|
||||
<input
|
||||
type="text"
|
||||
bind:value={name}
|
||||
@@ -182,12 +184,12 @@
|
||||
autofocus
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5"
|
||||
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"
|
||||
/>
|
||||
{/if}
|
||||
|
||||
<!-- Token -->
|
||||
<label class="text-[10px] text-gray-400 dark:text-gray-600">
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600">
|
||||
Token {#if bot}<span class="text-gray-300 dark:text-gray-700">({bot.token_masked})</span>{/if}
|
||||
</label>
|
||||
<div class="flex gap-2 items-center mb-0.5">
|
||||
@@ -198,12 +200,12 @@
|
||||
? $t('messaging.tokenKeep')
|
||||
: platformHints[platform] || $t('messaging.tokenPaste')}
|
||||
autocomplete="new-password"
|
||||
class="flex-1 bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5 font-mono"
|
||||
class="flex-1 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"
|
||||
/>
|
||||
{#if !bot}
|
||||
<button
|
||||
type="button"
|
||||
class="text-[11px] text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors disabled:opacity-30"
|
||||
class="text-[0.6875rem] text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors disabled:opacity-30"
|
||||
onclick={handleVerify}
|
||||
disabled={verifying || !token.trim()}
|
||||
>
|
||||
@@ -217,7 +219,7 @@
|
||||
</div>
|
||||
|
||||
{#if verifyResult}
|
||||
<p class="text-[10px] mb-1 text-gray-500 dark:text-gray-400">
|
||||
<p class="text-[0.625rem] mb-1 text-gray-500 dark:text-gray-400">
|
||||
{#if verifyResult.ok}
|
||||
✓ {verifyResult.info?.username
|
||||
? `@${verifyResult.info.username}`
|
||||
@@ -229,10 +231,10 @@
|
||||
{/if}
|
||||
|
||||
<!-- Allowed senders -->
|
||||
<label class="text-[10px] text-gray-400 dark:text-gray-600 mt-1"
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600 mt-1"
|
||||
>{$t('messaging.allowedSenders')}</label
|
||||
>
|
||||
<p class="text-[10px] text-gray-300 dark:text-gray-700 mb-0.5">
|
||||
<p class="text-[0.625rem] text-gray-300 dark:text-gray-700 mb-0.5">
|
||||
{$t('messaging.allowedSendersHint')}
|
||||
</p>
|
||||
<input
|
||||
@@ -241,7 +243,7 @@
|
||||
placeholder="123456789, 987654321"
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5 font-mono"
|
||||
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"
|
||||
/>
|
||||
|
||||
<!-- Bottom toolbar -->
|
||||
@@ -254,11 +256,11 @@
|
||||
<button
|
||||
bind:this={workspaceButtonEl}
|
||||
type="button"
|
||||
class="flex items-center gap-1 px-2 py-1 rounded-lg text-[11px] text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-400 hover:bg-gray-50 dark:hover:bg-white/5 transition-colors duration-100"
|
||||
class="flex items-center gap-1 px-2 py-1 rounded-lg text-[0.6875rem] text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-400 hover:bg-gray-50 dark:hover:bg-white/5 transition-colors duration-100"
|
||||
onclick={() => (showWsMenu = !showWsMenu)}
|
||||
>
|
||||
<Icon name="folder" size={12} />
|
||||
<span class="truncate max-w-[120px]">{selectedWorkspaceName}</span>
|
||||
<span class="truncate max-w-[7.5rem]">{selectedWorkspaceName}</span>
|
||||
<svg
|
||||
class="w-3 h-3 opacity-50"
|
||||
viewBox="0 0 24 24"
|
||||
@@ -277,7 +279,7 @@
|
||||
type="button"
|
||||
disabled={saving || !name.trim() || (!bot && !token.trim()) || !modelId || !workspace}
|
||||
onclick={handleSubmit}
|
||||
class="text-[13px] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100 disabled:opacity-30 disabled:pointer-events-none"
|
||||
class="text-[0.8125rem] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100 disabled:opacity-30 disabled:pointer-events-none"
|
||||
>
|
||||
{#if saving}
|
||||
<Spinner size={14} />
|
||||
|
||||
@@ -77,7 +77,9 @@
|
||||
|
||||
<div class="flex gap-3">
|
||||
<div class="flex-1">
|
||||
<label class="text-[10px] text-gray-400 dark:text-gray-600">{$t('connections.name')}</label>
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600"
|
||||
>{$t('connections.name')}</label
|
||||
>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Optional"
|
||||
@@ -85,14 +87,14 @@
|
||||
autofocus
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5"
|
||||
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"
|
||||
/>
|
||||
</div>
|
||||
<div class="w-28 shrink-0">
|
||||
<label class="text-[10px] text-gray-400 dark:text-gray-600">Provider</label>
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600">Provider</label>
|
||||
<select
|
||||
bind:value={formProvider}
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 outline-none py-0.5 cursor-pointer"
|
||||
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="openai">OpenAI</option>
|
||||
<option value="anthropic">Anthropic</option>
|
||||
@@ -101,17 +103,17 @@
|
||||
</div>
|
||||
|
||||
{#if formProvider === 'openai'}
|
||||
<label class="text-[10px] 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">API Type</label>
|
||||
<select
|
||||
bind:value={formApiType}
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 outline-none py-0.5 cursor-pointer"
|
||||
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>
|
||||
</select>
|
||||
{/if}
|
||||
|
||||
<label class="text-[10px] text-gray-400 dark:text-gray-600 mt-2"
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600 mt-2"
|
||||
>{$t('connections.baseUrl')}</label
|
||||
>
|
||||
<input
|
||||
@@ -121,7 +123,7 @@
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
list="base-url-suggestions"
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5 font-mono"
|
||||
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"
|
||||
/>
|
||||
<datalist id="base-url-suggestions">
|
||||
<option value="https://api.anthropic.com/v1" />
|
||||
@@ -130,7 +132,7 @@
|
||||
<option value="http://localhost:11434/v1" />
|
||||
</datalist>
|
||||
|
||||
<label class="text-[10px] text-gray-400 dark:text-gray-600 mt-2"
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600 mt-2"
|
||||
>{$t('connections.apiKey')}</label
|
||||
>
|
||||
<input
|
||||
@@ -138,10 +140,10 @@
|
||||
placeholder="sk-..."
|
||||
bind:value={formApiKey}
|
||||
autocomplete="new-password"
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5 font-mono"
|
||||
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"
|
||||
/>
|
||||
|
||||
<label class="text-[10px] text-gray-400 dark:text-gray-600 mt-2"
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600 mt-2"
|
||||
>{$t('connections.prefixId')}</label
|
||||
>
|
||||
<input
|
||||
@@ -150,27 +152,29 @@
|
||||
bind:value={formPrefixId}
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5 font-mono"
|
||||
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"
|
||||
/>
|
||||
|
||||
<label class="text-[10px] text-gray-400 dark:text-gray-600 mt-2"
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600 mt-2"
|
||||
>{$t('connections.models')}</label
|
||||
>
|
||||
<p class="text-[10px] text-gray-300 dark:text-gray-700 mb-0.5">{$t('connections.modelsHint')}</p>
|
||||
<p class="text-[0.625rem] text-gray-300 dark:text-gray-700 mb-0.5">
|
||||
{$t('connections.modelsHint')}
|
||||
</p>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="claude-sonnet-4-20250514, claude-opus-4-20250514"
|
||||
bind:value={formModels}
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5 font-mono"
|
||||
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"
|
||||
/>
|
||||
|
||||
<div class="flex justify-end mt-3">
|
||||
<button
|
||||
disabled={creating || !formBaseUrl.trim() || !formApiKey.trim()}
|
||||
onclick={create}
|
||||
class="text-[13px] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100 disabled:opacity-30 disabled:pointer-events-none"
|
||||
class="text-[0.8125rem] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100 disabled:opacity-30 disabled:pointer-events-none"
|
||||
>
|
||||
{#if creating}
|
||||
<Spinner size={14} />
|
||||
|
||||
@@ -52,7 +52,9 @@
|
||||
}}
|
||||
>
|
||||
<h2 class="text-sm font-medium text-gray-900 dark:text-white mb-2">{$t('admin.newUser')}</h2>
|
||||
<label class="text-[10px] text-gray-400 dark:text-gray-600 mt-1">{$t('admin.username')}</label>
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600 mt-1"
|
||||
>{$t('admin.username')}</label
|
||||
>
|
||||
<input
|
||||
type="text"
|
||||
placeholder={$t('admin.enterUsername')}
|
||||
@@ -60,9 +62,9 @@
|
||||
autofocus
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5"
|
||||
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"
|
||||
/>
|
||||
<label class="text-[10px] text-gray-400 dark:text-gray-600 mt-1"
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600 mt-1"
|
||||
>{$t('admin.displayName')}</label
|
||||
>
|
||||
<input
|
||||
@@ -71,9 +73,9 @@
|
||||
bind:value={displayName}
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5"
|
||||
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"
|
||||
/>
|
||||
<label class="text-[10px] text-gray-400 dark:text-gray-600 mt-1"
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600 mt-1"
|
||||
>{$t('admin.passwordLabel')}</label
|
||||
>
|
||||
<input
|
||||
@@ -81,12 +83,12 @@
|
||||
placeholder={$t('admin.minChars')}
|
||||
bind:value={password}
|
||||
autocomplete="new-password"
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5"
|
||||
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"
|
||||
/>
|
||||
<label class="text-[10px] text-gray-400 dark:text-gray-600 mt-1">{$t('admin.role')}</label>
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600 mt-1">{$t('admin.role')}</label>
|
||||
<select
|
||||
bind:value={role}
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 outline-none py-0.5 cursor-pointer"
|
||||
class="block w-full bg-transparent text-[0.8125rem] text-gray-700 dark:text-gray-300 outline-none py-0.5 cursor-pointer"
|
||||
>
|
||||
{#each ROLES as r}<option value={r}>{r}</option>{/each}
|
||||
</select>
|
||||
@@ -94,7 +96,7 @@
|
||||
<button
|
||||
disabled={creating || !username.trim() || password.length < 6}
|
||||
onclick={create}
|
||||
class="text-[13px] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100 disabled:opacity-30 disabled:pointer-events-none"
|
||||
class="text-[0.8125rem] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100 disabled:opacity-30 disabled:pointer-events-none"
|
||||
>
|
||||
{#if creating}
|
||||
<Spinner size={14} />
|
||||
|
||||
@@ -113,7 +113,9 @@
|
||||
|
||||
<div class="flex gap-3">
|
||||
<div class="flex-1">
|
||||
<label class="text-[10px] text-gray-400 dark:text-gray-600">{$t('connections.name')}</label>
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600"
|
||||
>{$t('connections.name')}</label
|
||||
>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Optional"
|
||||
@@ -121,14 +123,14 @@
|
||||
autofocus
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5"
|
||||
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"
|
||||
/>
|
||||
</div>
|
||||
<div class="w-28 shrink-0">
|
||||
<label class="text-[10px] text-gray-400 dark:text-gray-600">Provider</label>
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600">Provider</label>
|
||||
<select
|
||||
bind:value={formProvider}
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 outline-none py-0.5 cursor-pointer"
|
||||
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="openai">OpenAI</option>
|
||||
<option value="anthropic">Anthropic</option>
|
||||
@@ -137,17 +139,17 @@
|
||||
</div>
|
||||
|
||||
{#if formProvider === 'openai'}
|
||||
<label class="text-[10px] 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">API Type</label>
|
||||
<select
|
||||
bind:value={formApiType}
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 outline-none py-0.5 cursor-pointer"
|
||||
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>
|
||||
</select>
|
||||
{/if}
|
||||
|
||||
<label class="text-[10px] text-gray-400 dark:text-gray-600 mt-2"
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600 mt-2"
|
||||
>{$t('connections.baseUrl')}</label
|
||||
>
|
||||
<input
|
||||
@@ -157,7 +159,7 @@
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
list="base-url-suggestions-edit"
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5 font-mono"
|
||||
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"
|
||||
/>
|
||||
<datalist id="base-url-suggestions-edit">
|
||||
<option value="https://api.anthropic.com/v1" />
|
||||
@@ -166,7 +168,7 @@
|
||||
<option value="http://localhost:11434/v1" />
|
||||
</datalist>
|
||||
|
||||
<label class="text-[10px] text-gray-400 dark:text-gray-600 mt-2"
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600 mt-2"
|
||||
>{$t('connections.apiKey')}</label
|
||||
>
|
||||
<input
|
||||
@@ -174,10 +176,10 @@
|
||||
placeholder="•••••••• (leave blank to keep)"
|
||||
bind:value={formApiKey}
|
||||
autocomplete="new-password"
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5 font-mono"
|
||||
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"
|
||||
/>
|
||||
|
||||
<label class="text-[10px] text-gray-400 dark:text-gray-600 mt-2"
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600 mt-2"
|
||||
>{$t('connections.prefixId')}</label
|
||||
>
|
||||
<input
|
||||
@@ -186,30 +188,32 @@
|
||||
bind:value={formPrefixId}
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5 font-mono"
|
||||
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"
|
||||
/>
|
||||
|
||||
<label class="text-[10px] text-gray-400 dark:text-gray-600 mt-2"
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600 mt-2"
|
||||
>{$t('connections.models')}</label
|
||||
>
|
||||
<p class="text-[10px] text-gray-300 dark:text-gray-700 mb-0.5">{$t('connections.modelsHint')}</p>
|
||||
<p class="text-[0.625rem] text-gray-300 dark:text-gray-700 mb-0.5">
|
||||
{$t('connections.modelsHint')}
|
||||
</p>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="claude-sonnet-4-20250514, claude-opus-4-20250514"
|
||||
bind:value={formModels}
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5 font-mono"
|
||||
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"
|
||||
/>
|
||||
|
||||
<div class="flex items-center justify-between mt-3">
|
||||
<div class="flex items-center gap-3">
|
||||
<button
|
||||
class="text-[13px] text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors duration-100"
|
||||
class="text-[0.8125rem] text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors duration-100"
|
||||
onclick={handleDelete}>{$t('admin.delete') || 'Delete'}</button
|
||||
>
|
||||
<button
|
||||
class="text-[13px] text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors duration-100 disabled:opacity-30"
|
||||
class="text-[0.8125rem] text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors duration-100 disabled:opacity-30"
|
||||
disabled={verifying}
|
||||
onclick={handleVerify}
|
||||
>
|
||||
@@ -223,7 +227,7 @@
|
||||
<button
|
||||
disabled={saving || !formBaseUrl.trim()}
|
||||
onclick={save}
|
||||
class="text-[13px] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100 disabled:opacity-30 disabled:pointer-events-none"
|
||||
class="text-[0.8125rem] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100 disabled:opacity-30 disabled:pointer-events-none"
|
||||
>
|
||||
{#if saving}
|
||||
<Spinner size={14} />
|
||||
|
||||
@@ -91,23 +91,25 @@
|
||||
<Modal {onclose} class="w-full max-w-sm mx-4">
|
||||
<div class="p-4">
|
||||
<h2 class="text-sm font-medium text-gray-900 dark:text-white mb-2">{$t('admin.editUser')}</h2>
|
||||
<label class="text-[10px] text-gray-400 dark:text-gray-600 mt-1">{$t('admin.username')}</label>
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600 mt-1"
|
||||
>{$t('admin.username')}</label
|
||||
>
|
||||
<input
|
||||
type="text"
|
||||
placeholder={$t('admin.username')}
|
||||
bind:value={username}
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5"
|
||||
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"
|
||||
/>
|
||||
<label class="text-[10px] text-gray-400 dark:text-gray-600 mt-1"
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600 mt-1"
|
||||
>{$t('admin.displayName')}</label
|
||||
>
|
||||
<input
|
||||
type="text"
|
||||
placeholder={$t('admin.optional')}
|
||||
bind:value={displayName}
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5"
|
||||
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"
|
||||
/>
|
||||
<label class="text-[10px] text-gray-400 dark:text-gray-600 mt-1"
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600 mt-1"
|
||||
>{$t('admin.newPasswordLabel')}</label
|
||||
>
|
||||
<input
|
||||
@@ -115,20 +117,20 @@
|
||||
placeholder={$t('admin.leaveBlank')}
|
||||
bind:value={newPassword}
|
||||
autocomplete="new-password"
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5"
|
||||
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"
|
||||
/>
|
||||
<label class="text-[10px] text-gray-400 dark:text-gray-600 mt-1">{$t('admin.role')}</label>
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600 mt-1">{$t('admin.role')}</label>
|
||||
<select
|
||||
bind:value={role}
|
||||
disabled={isSelf}
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 outline-none py-0.5 cursor-pointer disabled:opacity-50"
|
||||
class="block w-full bg-transparent text-[0.8125rem] text-gray-700 dark:text-gray-300 outline-none py-0.5 cursor-pointer disabled:opacity-50"
|
||||
>
|
||||
{#each ROLES as r}<option value={r}>{r}</option>{/each}
|
||||
</select>
|
||||
<div class="flex items-center justify-between mt-3">
|
||||
{#if !isSelf && (user.role !== 'admin' || adminCount > 1)}
|
||||
<button
|
||||
class="text-[13px] text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors duration-100"
|
||||
class="text-[0.8125rem] text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors duration-100"
|
||||
onclick={deleteUser}>{$t('admin.delete')}</button
|
||||
>
|
||||
{:else}
|
||||
@@ -137,7 +139,7 @@
|
||||
<button
|
||||
disabled={saving}
|
||||
onclick={save}
|
||||
class="text-[13px] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100 disabled:opacity-30 disabled:pointer-events-none"
|
||||
class="text-[0.8125rem] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100 disabled:opacity-30 disabled:pointer-events-none"
|
||||
>
|
||||
{#if saving}{$t('settings.saving')}{:else}{$t('settings.save')}{/if}
|
||||
</button>
|
||||
|
||||
@@ -127,7 +127,7 @@
|
||||
<h2 class="text-sm font-medium text-gray-900 dark:text-white mb-1">
|
||||
{$t('admin.gateway.title')}
|
||||
</h2>
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600 mb-4">
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600 mb-4">
|
||||
{$t('admin.gateway.description')}
|
||||
</p>
|
||||
|
||||
@@ -152,7 +152,7 @@
|
||||
{/each}
|
||||
</select>
|
||||
</div>
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600 mt-1.5">
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600 mt-1.5">
|
||||
{$t('admin.gateway.modelDescription')}
|
||||
</p>
|
||||
</div>
|
||||
@@ -164,7 +164,7 @@
|
||||
{$t('admin.gateway.newKey')}
|
||||
</h3>
|
||||
<button
|
||||
class="shrink-0 text-[11px] text-gray-500 hover:text-gray-900 dark:text-gray-500 dark:hover:text-white transition-colors"
|
||||
class="shrink-0 text-[0.6875rem] text-gray-500 hover:text-gray-900 dark:text-gray-500 dark:hover:text-white transition-colors"
|
||||
onclick={copyKey}
|
||||
>
|
||||
{$t('admin.gateway.copy')}
|
||||
@@ -172,12 +172,12 @@
|
||||
</div>
|
||||
<div class="flex items-center gap-2">
|
||||
<code
|
||||
class="flex-1 min-w-0 text-[11px] font-mono bg-gray-50 dark:bg-white/4 px-2.5 py-2 rounded-lg border border-gray-100 dark:border-white/5 text-gray-600 dark:text-gray-400 select-all break-all"
|
||||
class="flex-1 min-w-0 text-[0.6875rem] font-mono bg-gray-50 dark:bg-white/4 px-2.5 py-2 rounded-lg border border-gray-100 dark:border-white/5 text-gray-600 dark:text-gray-400 select-all break-all"
|
||||
>
|
||||
{revealedKey}
|
||||
</code>
|
||||
</div>
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600 mt-1.5">
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600 mt-1.5">
|
||||
{$t('admin.gateway.keyWarning')}
|
||||
</p>
|
||||
</div>
|
||||
@@ -194,7 +194,7 @@
|
||||
disabled={creating}
|
||||
/>
|
||||
<button
|
||||
class="shrink-0 text-[13px] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100 disabled:opacity-50"
|
||||
class="shrink-0 text-[0.8125rem] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100 disabled:opacity-50"
|
||||
onclick={createKey}
|
||||
disabled={creating}
|
||||
>
|
||||
@@ -224,7 +224,7 @@
|
||||
<span class="text-xs font-medium text-gray-700 dark:text-gray-300 truncate">
|
||||
{key.name}
|
||||
</span>
|
||||
<span class="text-[10px] text-gray-400 dark:text-gray-600 shrink-0">
|
||||
<span class="text-[0.625rem] text-gray-400 dark:text-gray-600 shrink-0">
|
||||
{formatDate(key.created_at)}
|
||||
</span>
|
||||
</div>
|
||||
@@ -244,7 +244,7 @@
|
||||
<h3 class="text-xs text-gray-400 dark:text-gray-600 mb-2">
|
||||
{$t('admin.gateway.howToConnect')}
|
||||
</h3>
|
||||
<div class="space-y-1.5 text-[11px] font-mono text-gray-600 dark:text-gray-400">
|
||||
<div class="space-y-1.5 text-[0.6875rem] font-mono text-gray-600 dark:text-gray-400">
|
||||
<div>
|
||||
<span class="text-gray-400 dark:text-gray-600">{$t('admin.gateway.baseUrl')}</span>
|
||||
<span class="text-gray-700 dark:text-gray-300"
|
||||
@@ -259,14 +259,14 @@
|
||||
<div class="flex items-center justify-between gap-2 mb-1">
|
||||
<span class="text-gray-400 dark:text-gray-600">{$t('admin.gateway.headers')}</span>
|
||||
<button
|
||||
class="shrink-0 text-[11px] font-sans text-gray-500 hover:text-gray-900 dark:text-gray-500 dark:hover:text-white transition-colors"
|
||||
class="shrink-0 text-[0.6875rem] font-sans text-gray-500 hover:text-gray-900 dark:text-gray-500 dark:hover:text-white transition-colors"
|
||||
onclick={copyHeaders}
|
||||
>
|
||||
{$t('admin.gateway.copy')}
|
||||
</button>
|
||||
</div>
|
||||
<button
|
||||
class="w-full text-left whitespace-pre-wrap rounded-lg border border-gray-100 dark:border-white/5 bg-gray-50 dark:bg-white/4 px-2.5 py-2 text-[11px] font-mono text-gray-700 dark:text-gray-300 transition-colors hover:border-gray-200 dark:hover:border-white/10"
|
||||
class="w-full text-left whitespace-pre-wrap rounded-lg border border-gray-100 dark:border-white/5 bg-gray-50 dark:bg-white/4 px-2.5 py-2 text-[0.6875rem] font-mono text-gray-700 dark:text-gray-300 transition-colors hover:border-gray-200 dark:hover:border-white/10"
|
||||
onclick={copyHeaders}
|
||||
>
|
||||
{openWebUIHeaders}
|
||||
@@ -277,7 +277,7 @@
|
||||
|
||||
<div class="mt-auto pt-6 flex justify-end">
|
||||
<button
|
||||
class="text-[13px] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100 disabled:opacity-50"
|
||||
class="text-[0.8125rem] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100 disabled:opacity-50"
|
||||
onclick={() => save()}
|
||||
disabled={saving}>{$t('settings.save')}</button
|
||||
>
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
}}
|
||||
/>
|
||||
</label>
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600 -mt-1">
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600 -mt-1">
|
||||
{$t('admin.images.generationHint')}
|
||||
</p>
|
||||
<div>
|
||||
@@ -167,7 +167,7 @@
|
||||
}}
|
||||
/>
|
||||
</label>
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600 -mt-1">
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600 -mt-1">
|
||||
{$t('admin.images.editHint')}
|
||||
</p>
|
||||
<div>
|
||||
@@ -224,7 +224,7 @@
|
||||
<!-- Save -->
|
||||
<div class="shrink-0 pt-3 flex justify-end">
|
||||
<button
|
||||
class="text-[13px] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100 disabled:opacity-50"
|
||||
class="text-[0.8125rem] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100 disabled:opacity-50"
|
||||
onclick={() => save()}
|
||||
disabled={saving}
|
||||
>
|
||||
|
||||
@@ -81,15 +81,17 @@
|
||||
{#each bots as bot}
|
||||
<div class="group flex items-center gap-2 w-full h-7">
|
||||
<!-- Platform icon -->
|
||||
<span class="shrink-0
|
||||
{bot.is_running ? 'text-gray-400 dark:text-gray-500' : 'text-gray-300 dark:text-gray-700'}">
|
||||
<span
|
||||
class="shrink-0
|
||||
{bot.is_running ? 'text-gray-400 dark:text-gray-500' : 'text-gray-300 dark:text-gray-700'}"
|
||||
>
|
||||
<Icon name={bot.platform} size={14} />
|
||||
</span>
|
||||
|
||||
<!-- Name (clickable to edit) -->
|
||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
||||
<span
|
||||
class="flex-1 text-[13px] truncate cursor-pointer
|
||||
class="flex-1 text-[0.8125rem] truncate cursor-pointer
|
||||
{bot.is_running ? 'text-gray-700 dark:text-gray-300' : 'text-gray-400 dark:text-gray-600'}"
|
||||
onclick={() => (editBot = bot)}
|
||||
onkeydown={() => {}}
|
||||
@@ -131,7 +133,7 @@
|
||||
{/each}
|
||||
|
||||
{#if bots.length === 0}
|
||||
<p class="text-[13px] text-gray-400 dark:text-gray-600 py-4">{$t('messaging.noBots')}</p>
|
||||
<p class="text-[0.8125rem] text-gray-400 dark:text-gray-600 py-4">{$t('messaging.noBots')}</p>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
@@ -141,9 +143,5 @@
|
||||
{/if}
|
||||
|
||||
{#if editBot}
|
||||
<CreateBotModal
|
||||
bot={editBot}
|
||||
onclose={() => (editBot = null)}
|
||||
onsave={handleSaved}
|
||||
/>
|
||||
<CreateBotModal bot={editBot} onclose={() => (editBot = null)} onsave={handleSaved} />
|
||||
{/if}
|
||||
@@ -256,11 +256,11 @@ Files:
|
||||
|
||||
{#snippet systemPromptField(value: string, onInput: (v: string) => void, placeholder: string)}
|
||||
<div class="mb-2">
|
||||
<span class="text-[10px] text-gray-400 dark:text-gray-600 uppercase tracking-wide"
|
||||
<span class="text-[0.625rem] text-gray-400 dark:text-gray-600 uppercase tracking-wide"
|
||||
>{$t('models.systemPrompt')}</span
|
||||
>
|
||||
<textarea
|
||||
class="w-full mt-1 bg-gray-50 dark:bg-white/4 border border-gray-200 dark:border-white/8 rounded-lg px-2.5 py-2 text-[11px] font-mono text-gray-600 dark:text-gray-400 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none resize-y leading-relaxed"
|
||||
class="w-full mt-1 bg-gray-50 dark:bg-white/4 border border-gray-200 dark:border-white/8 rounded-lg px-2.5 py-2 text-[0.6875rem] font-mono text-gray-600 dark:text-gray-400 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none resize-y leading-relaxed"
|
||||
rows="6"
|
||||
{placeholder}
|
||||
{value}
|
||||
@@ -269,7 +269,7 @@ Files:
|
||||
></textarea>
|
||||
<div class="flex items-center gap-2 mt-1">
|
||||
<button
|
||||
class="text-[10px] text-gray-400 dark:text-gray-600 hover:text-gray-600 dark:hover:text-gray-400 transition-colors duration-75"
|
||||
class="text-[0.625rem] text-gray-400 dark:text-gray-600 hover:text-gray-600 dark:hover:text-gray-400 transition-colors duration-75"
|
||||
onclick={() => (showVariables = !showVariables)}
|
||||
>
|
||||
{$t('models.templateVariables')}
|
||||
@@ -277,7 +277,7 @@ Files:
|
||||
</button>
|
||||
{#if value.trim()}
|
||||
<button
|
||||
class="text-[10px] text-gray-400 dark:text-gray-600 hover:text-gray-600 dark:hover:text-gray-400 transition-colors duration-75"
|
||||
class="text-[0.625rem] text-gray-400 dark:text-gray-600 hover:text-gray-600 dark:hover:text-gray-400 transition-colors duration-75"
|
||||
onclick={() => onInput('')}
|
||||
>
|
||||
{$t('models.resetToDefault')}
|
||||
@@ -290,10 +290,11 @@ Files:
|
||||
>
|
||||
{#each TEMPLATE_VARIABLES as v}
|
||||
<div class="flex items-baseline gap-2 h-5">
|
||||
<code class="text-[10px] font-mono text-gray-500 dark:text-gray-500 shrink-0 select-all"
|
||||
<code
|
||||
class="text-[0.625rem] font-mono text-gray-500 dark:text-gray-500 shrink-0 select-all"
|
||||
>{`{{${v.name}}}`}</code
|
||||
>
|
||||
<span class="text-[10px] text-gray-400 dark:text-gray-600 truncate">{v.desc}</span>
|
||||
<span class="text-[0.625rem] text-gray-400 dark:text-gray-600 truncate">{v.desc}</span>
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
@@ -308,7 +309,7 @@ Files:
|
||||
onAdd: () => void
|
||||
)}
|
||||
<div class="mb-2">
|
||||
<span class="text-[10px] text-gray-400 dark:text-gray-600 uppercase tracking-wide"
|
||||
<span class="text-[0.625rem] text-gray-400 dark:text-gray-600 uppercase tracking-wide"
|
||||
>request params</span
|
||||
>
|
||||
{#each rows as row, i}
|
||||
@@ -320,7 +321,7 @@ Files:
|
||||
oninput={onInput}
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
class="w-24 shrink-0 bg-transparent text-[11px] font-mono text-gray-500 dark:text-gray-500 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none"
|
||||
class="w-24 shrink-0 bg-transparent text-[0.6875rem] font-mono text-gray-500 dark:text-gray-500 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none"
|
||||
/>
|
||||
<input
|
||||
type="text"
|
||||
@@ -329,7 +330,7 @@ Files:
|
||||
oninput={onInput}
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
class="flex-1 min-w-0 bg-transparent text-[11px] font-mono text-gray-500 dark:text-gray-500 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none"
|
||||
class="flex-1 min-w-0 bg-transparent text-[0.6875rem] font-mono text-gray-500 dark:text-gray-500 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none"
|
||||
/>
|
||||
<button
|
||||
type="button"
|
||||
@@ -342,7 +343,7 @@ Files:
|
||||
</div>
|
||||
{/each}
|
||||
<button
|
||||
class="flex items-center gap-1 h-6 text-[11px] text-gray-400 dark:text-gray-600 hover:text-gray-600 dark:hover:text-gray-400 transition-colors duration-75"
|
||||
class="flex items-center gap-1 h-6 text-[0.6875rem] text-gray-400 dark:text-gray-600 hover:text-gray-600 dark:hover:text-gray-400 transition-colors duration-75"
|
||||
onclick={onAdd}
|
||||
>
|
||||
<Icon name="plus" size={10} />
|
||||
@@ -358,7 +359,7 @@ Files:
|
||||
)}
|
||||
<div class="mb-2">
|
||||
<label
|
||||
class="text-[10px] text-gray-400 dark:text-gray-600 uppercase tracking-wide"
|
||||
class="text-[0.625rem] text-gray-400 dark:text-gray-600 uppercase tracking-wide"
|
||||
for={inputId}>{$t('admin.compactTokenThreshold')}</label
|
||||
>
|
||||
<div class="flex items-center gap-1.5 mt-1">
|
||||
@@ -372,7 +373,7 @@ Files:
|
||||
placeholder={$t('admin.compactTokenThreshold')}
|
||||
class="w-24 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-[11px] text-gray-400 dark:text-gray-600"
|
||||
<span class="text-[0.6875rem] text-gray-400 dark:text-gray-600"
|
||||
>{$t('admin.compactTokenThresholdUnit')}</span
|
||||
>
|
||||
</div>
|
||||
@@ -406,7 +407,7 @@ Files:
|
||||
<div class="mb-1">
|
||||
<ModelSelector bind:selectedModel={defaultModelId} preferAbove={false} align="start" />
|
||||
</div>
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600 mb-5">
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600 mb-5">
|
||||
{$t('models.defaultModelHint')}
|
||||
</p>
|
||||
|
||||
@@ -429,11 +430,11 @@ Files:
|
||||
step="10000"
|
||||
class="w-24 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-[11px] text-gray-400 dark:text-gray-600"
|
||||
<span class="text-[0.6875rem] text-gray-400 dark:text-gray-600"
|
||||
>{$t('admin.compactTokenThresholdUnit')}</span
|
||||
>
|
||||
</div>
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600 mt-0.5">
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600 mt-0.5">
|
||||
{$t('admin.compactTokenThresholdHint')}
|
||||
</p>
|
||||
</div>
|
||||
@@ -444,11 +445,11 @@ Files:
|
||||
class="group flex items-center gap-2 w-full h-7 text-left"
|
||||
onclick={() => (globalExpanded = !globalExpanded)}
|
||||
>
|
||||
<span class="flex-1 text-[13px] text-gray-500 dark:text-gray-400"
|
||||
<span class="flex-1 text-[0.8125rem] text-gray-500 dark:text-gray-400"
|
||||
>{$t('models.defaults')}</span
|
||||
>
|
||||
{#if globalRows.filter((r) => r.key.trim()).length > 0 || globalSystemPrompt.trim()}
|
||||
<span class="text-[10px] text-gray-400 dark:text-gray-600">
|
||||
<span class="text-[0.625rem] text-gray-400 dark:text-gray-600">
|
||||
{#if globalSystemPrompt.trim()}prompt{/if}
|
||||
{#if globalRows.filter((r) => r.key.trim()).length > 0}
|
||||
{globalRows.filter((r) => r.key.trim()).length} params
|
||||
@@ -500,7 +501,7 @@ Files:
|
||||
onclick={() => (selectedId = selectedId === model.id ? null : model.id)}
|
||||
>
|
||||
<span
|
||||
class="flex-1 text-[13px] truncate {model.is_active
|
||||
class="flex-1 text-[0.8125rem] truncate {model.is_active
|
||||
? 'text-gray-700 dark:text-gray-300'
|
||||
: 'text-gray-400 dark:text-gray-600'}"
|
||||
>
|
||||
@@ -561,7 +562,7 @@ Files:
|
||||
{/each}
|
||||
|
||||
{#if models.length === 0}
|
||||
<p class="text-[13px] text-gray-400 dark:text-gray-600 py-4">
|
||||
<p class="text-[0.8125rem] text-gray-400 dark:text-gray-600 py-4">
|
||||
{$t('models.noModels')}
|
||||
</p>
|
||||
{/if}
|
||||
@@ -569,7 +570,7 @@ Files:
|
||||
|
||||
<div class="shrink-0 pt-3 flex justify-end">
|
||||
<button
|
||||
class="text-[13px] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100"
|
||||
class="text-[0.8125rem] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100"
|
||||
onclick={saveAll}
|
||||
>
|
||||
{#if saving}{$t('settings.saving')}{:else}{$t('settings.save')}{/if}
|
||||
|
||||
@@ -21,7 +21,9 @@
|
||||
try {
|
||||
const config = await getAdminConfig();
|
||||
enabled = config['subagents.enabled'] === true || config['subagents.enabled'] === 'true';
|
||||
backgroundEnabled = config['subagents.background_enabled'] === true || config['subagents.background_enabled'] === 'true';
|
||||
backgroundEnabled =
|
||||
config['subagents.background_enabled'] === true ||
|
||||
config['subagents.background_enabled'] === 'true';
|
||||
maxConcurrent = Number(config['subagents.max_concurrent']) || 3;
|
||||
maxAsync = Number(config['subagents.max_async']) || 3;
|
||||
maxIterations = Number(config['subagents.max_iterations']) || 30;
|
||||
@@ -63,67 +65,126 @@
|
||||
<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">{$t('admin.subagentsEnabled')}</span>
|
||||
<ToggleSwitch value={enabled} onchange={(v) => { enabled = v; }} />
|
||||
<ToggleSwitch
|
||||
value={enabled}
|
||||
onchange={(v) => {
|
||||
enabled = v;
|
||||
}}
|
||||
/>
|
||||
</label>
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600 -mt-1">
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600 -mt-1">
|
||||
{$t('admin.subagentsHint')}
|
||||
</p>
|
||||
|
||||
{#if enabled}
|
||||
<div>
|
||||
<label class="text-xs text-gray-600 dark:text-gray-400" for="sa-concurrent">{$t('admin.subagentsMaxConcurrent')}</label>
|
||||
<label class="text-xs text-gray-600 dark:text-gray-400" for="sa-concurrent"
|
||||
>{$t('admin.subagentsMaxConcurrent')}</label
|
||||
>
|
||||
<div class="flex items-center gap-1.5 mt-1">
|
||||
<input id="sa-concurrent" type="number" bind:value={maxConcurrent} min="1" max="10"
|
||||
class="w-16 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-[11px] text-gray-400 dark:text-gray-600">{$t('admin.subagentsMaxConcurrentHint')}</span>
|
||||
<input
|
||||
id="sa-concurrent"
|
||||
type="number"
|
||||
bind:value={maxConcurrent}
|
||||
min="1"
|
||||
max="10"
|
||||
class="w-16 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"
|
||||
>{$t('admin.subagentsMaxConcurrentHint')}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="flex items-center justify-between cursor-pointer">
|
||||
<span class="text-xs text-gray-600 dark:text-gray-400">{$t('admin.subagentsBackgroundEnabled')}</span>
|
||||
<ToggleSwitch value={backgroundEnabled} onchange={(v) => { backgroundEnabled = v; }} />
|
||||
<span class="text-xs text-gray-600 dark:text-gray-400"
|
||||
>{$t('admin.subagentsBackgroundEnabled')}</span
|
||||
>
|
||||
<ToggleSwitch
|
||||
value={backgroundEnabled}
|
||||
onchange={(v) => {
|
||||
backgroundEnabled = v;
|
||||
}}
|
||||
/>
|
||||
</label>
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600 mt-1">
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600 mt-1">
|
||||
{$t('admin.subagentsBackgroundHint')}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{#if backgroundEnabled}
|
||||
<div>
|
||||
<label class="text-xs text-gray-600 dark:text-gray-400" for="sa-async">{$t('admin.subagentsMaxAsync')}</label>
|
||||
<label class="text-xs text-gray-600 dark:text-gray-400" for="sa-async"
|
||||
>{$t('admin.subagentsMaxAsync')}</label
|
||||
>
|
||||
<div class="flex items-center gap-1.5 mt-1">
|
||||
<input id="sa-async" type="number" bind:value={maxAsync} min="1" max="10"
|
||||
class="w-16 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-[11px] text-gray-400 dark:text-gray-600">{$t('admin.subagentsMaxAsyncHint')}</span>
|
||||
<input
|
||||
id="sa-async"
|
||||
type="number"
|
||||
bind:value={maxAsync}
|
||||
min="1"
|
||||
max="10"
|
||||
class="w-16 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"
|
||||
>{$t('admin.subagentsMaxAsyncHint')}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div>
|
||||
<label class="text-xs text-gray-600 dark:text-gray-400" for="sa-iterations">{$t('admin.subagentsMaxIterations')}</label>
|
||||
<label class="text-xs text-gray-600 dark:text-gray-400" for="sa-iterations"
|
||||
>{$t('admin.subagentsMaxIterations')}</label
|
||||
>
|
||||
<div class="flex items-center gap-1.5 mt-1">
|
||||
<input id="sa-iterations" type="number" bind:value={maxIterations} min="1" max="100"
|
||||
class="w-16 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-[11px] text-gray-400 dark:text-gray-600">{$t('admin.subagentsMaxIterationsHint')}</span>
|
||||
<input
|
||||
id="sa-iterations"
|
||||
type="number"
|
||||
bind:value={maxIterations}
|
||||
min="1"
|
||||
max="100"
|
||||
class="w-16 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"
|
||||
>{$t('admin.subagentsMaxIterationsHint')}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="text-xs text-gray-600 dark:text-gray-400" for="sa-output">{$t('admin.subagentsMaxOutput')}</label>
|
||||
<label class="text-xs text-gray-600 dark:text-gray-400" for="sa-output"
|
||||
>{$t('admin.subagentsMaxOutput')}</label
|
||||
>
|
||||
<div class="flex items-center gap-1.5 mt-1">
|
||||
<input id="sa-output" type="number" bind:value={maxOutput} min="1000" max="100000" 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-[11px] text-gray-400 dark:text-gray-600">chars</span>
|
||||
<input
|
||||
id="sa-output"
|
||||
type="number"
|
||||
bind:value={maxOutput}
|
||||
min="1000"
|
||||
max="100000"
|
||||
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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="text-xs text-gray-600 dark:text-gray-400" for="sa-prompt">{$t('admin.subagentsSystemPrompt')}</label>
|
||||
<textarea id="sa-prompt" bind:value={systemPrompt} rows="4"
|
||||
<label class="text-xs text-gray-600 dark:text-gray-400" for="sa-prompt"
|
||||
>{$t('admin.subagentsSystemPrompt')}</label
|
||||
>
|
||||
<textarea
|
||||
id="sa-prompt"
|
||||
bind:value={systemPrompt}
|
||||
rows="4"
|
||||
placeholder={$t('admin.subagentsSystemPromptPlaceholder')}
|
||||
class="w-full mt-1 px-2 py-1.5 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 resize-y font-mono" />
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600 mt-0.5">{$t('admin.subagentsSystemPromptHint')}</p>
|
||||
class="w-full mt-1 px-2 py-1.5 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 resize-y font-mono"
|
||||
/>
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600 mt-0.5">
|
||||
{$t('admin.subagentsSystemPromptHint')}
|
||||
</p>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -131,10 +192,10 @@
|
||||
<!-- Save -->
|
||||
<div class="mt-auto pt-6 flex justify-end">
|
||||
<button
|
||||
class="text-[13px] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100 disabled:opacity-50"
|
||||
class="text-[0.8125rem] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100 disabled:opacity-50"
|
||||
onclick={() => save()}
|
||||
disabled={saving}
|
||||
>{$t('settings.save')}</button>
|
||||
disabled={saving}>{$t('settings.save')}</button
|
||||
>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -227,7 +227,7 @@
|
||||
onclick={() => openEdit(s)}
|
||||
>
|
||||
<span
|
||||
class="text-[10px] font-mono shrink-0
|
||||
class="text-[0.625rem] font-mono shrink-0
|
||||
{s.type === 'mcp' || s.type === 'mcp_stdio'
|
||||
? 'text-purple-500 dark:text-purple-400'
|
||||
: 'text-blue-500 dark:text-blue-400'}"
|
||||
@@ -235,7 +235,7 @@
|
||||
{s.type === 'mcp' ? 'MCP' : s.type === 'mcp_stdio' ? 'STDIO' : 'API'}
|
||||
</span>
|
||||
<span
|
||||
class="flex-1 text-[13px] truncate
|
||||
class="flex-1 text-[0.8125rem] truncate
|
||||
{s.enabled ? 'text-gray-700 dark:text-gray-300' : 'text-gray-400 dark:text-gray-600'}"
|
||||
>
|
||||
{s.name || s.command || s.url}
|
||||
@@ -264,7 +264,7 @@
|
||||
{/each}
|
||||
|
||||
{#if servers.length === 0}
|
||||
<p class="text-[13px] text-gray-400 dark:text-gray-600 py-4">
|
||||
<p class="text-[0.8125rem] text-gray-400 dark:text-gray-600 py-4">
|
||||
{$t('toolServers.empty')}
|
||||
</p>
|
||||
{/if}
|
||||
@@ -287,7 +287,7 @@
|
||||
<!-- ID + Type -->
|
||||
<div class="flex gap-3">
|
||||
<div class="flex-1">
|
||||
<label class="text-[10px] text-gray-400 dark:text-gray-600"
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600"
|
||||
>{$t('toolServers.id')}</label
|
||||
>
|
||||
<input
|
||||
@@ -298,16 +298,16 @@
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
disabled={!!editServer}
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5 font-mono disabled:opacity-50"
|
||||
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 disabled:opacity-50"
|
||||
/>
|
||||
</div>
|
||||
<div class="w-28 shrink-0">
|
||||
<label class="text-[10px] text-gray-400 dark:text-gray-600"
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600"
|
||||
>{$t('toolServers.type')}</label
|
||||
>
|
||||
<select
|
||||
bind:value={formType}
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 outline-none py-0.5 cursor-pointer"
|
||||
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="openapi">{$t('toolServers.typeOpenAPI')}</option>
|
||||
<option value="mcp">{$t('toolServers.typeMCP')}</option>
|
||||
@@ -317,7 +317,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Name -->
|
||||
<label class="text-[10px] text-gray-400 dark:text-gray-600 mt-2"
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600 mt-2"
|
||||
>{$t('toolServers.name')}</label
|
||||
>
|
||||
<input
|
||||
@@ -326,12 +326,12 @@
|
||||
bind:value={formName}
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5"
|
||||
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"
|
||||
/>
|
||||
|
||||
<!-- URL (openapi/mcp only) -->
|
||||
{#if formType !== 'mcp_stdio'}
|
||||
<label class="text-[10px] text-gray-400 dark:text-gray-600 mt-2"
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600 mt-2"
|
||||
>{$t('toolServers.url')}</label
|
||||
>
|
||||
<input
|
||||
@@ -342,13 +342,13 @@
|
||||
bind:value={formUrl}
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5 font-mono"
|
||||
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"
|
||||
/>
|
||||
{/if}
|
||||
|
||||
<!-- Command + Args (mcp_stdio only) -->
|
||||
{#if formType === 'mcp_stdio'}
|
||||
<label class="text-[10px] text-gray-400 dark:text-gray-600 mt-2"
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600 mt-2"
|
||||
>{$t('toolServers.command')}</label
|
||||
>
|
||||
<input
|
||||
@@ -357,9 +357,9 @@
|
||||
bind:value={formCommand}
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5 font-mono"
|
||||
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"
|
||||
/>
|
||||
<label class="text-[10px] text-gray-400 dark:text-gray-600 mt-2"
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600 mt-2"
|
||||
>{$t('toolServers.args')}</label
|
||||
>
|
||||
<input
|
||||
@@ -368,9 +368,9 @@
|
||||
bind:value={formArgs}
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5 font-mono"
|
||||
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"
|
||||
/>
|
||||
<label class="text-[10px] text-gray-400 dark:text-gray-600 mt-2"
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600 mt-2"
|
||||
>{$t('toolServers.cwd')}</label
|
||||
>
|
||||
<input
|
||||
@@ -379,13 +379,13 @@
|
||||
bind:value={formCwd}
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5 font-mono"
|
||||
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"
|
||||
/>
|
||||
{/if}
|
||||
|
||||
<!-- Spec path (OpenAPI only) -->
|
||||
{#if formType === 'openapi'}
|
||||
<label class="text-[10px] text-gray-400 dark:text-gray-600 mt-2"
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600 mt-2"
|
||||
>{$t('toolServers.specPath')}</label
|
||||
>
|
||||
<input
|
||||
@@ -394,7 +394,7 @@
|
||||
bind:value={formPath}
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5 font-mono"
|
||||
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"
|
||||
/>
|
||||
{/if}
|
||||
|
||||
@@ -402,12 +402,12 @@
|
||||
{#if formType !== 'mcp_stdio'}
|
||||
<div class="flex gap-3 mt-2">
|
||||
<div class="w-28 shrink-0">
|
||||
<label class="text-[10px] text-gray-400 dark:text-gray-600"
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600"
|
||||
>{$t('toolServers.auth')}</label
|
||||
>
|
||||
<select
|
||||
bind:value={formAuthType}
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 outline-none py-0.5 cursor-pointer"
|
||||
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="none">{$t('toolServers.authNone')}</option>
|
||||
<option value="bearer">{$t('toolServers.authBearer')}</option>
|
||||
@@ -415,7 +415,7 @@
|
||||
</div>
|
||||
{#if formAuthType === 'bearer'}
|
||||
<div class="flex-1">
|
||||
<label class="text-[10px] text-gray-400 dark:text-gray-600"
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600"
|
||||
>{$t('toolServers.apiKey')}</label
|
||||
>
|
||||
<input
|
||||
@@ -423,7 +423,7 @@
|
||||
placeholder={editServer ? $t('toolServers.apiKeyKeep') : 'sk-...'}
|
||||
bind:value={formKey}
|
||||
autocomplete="new-password"
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5 font-mono"
|
||||
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"
|
||||
/>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -431,7 +431,7 @@
|
||||
{/if}
|
||||
|
||||
<!-- Description -->
|
||||
<label class="text-[10px] text-gray-400 dark:text-gray-600 mt-2"
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600 mt-2"
|
||||
>{$t('toolServers.description')}</label
|
||||
>
|
||||
<input
|
||||
@@ -440,27 +440,28 @@
|
||||
bind:value={formDescription}
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5"
|
||||
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"
|
||||
/>
|
||||
|
||||
<!-- Headers -->
|
||||
<label class="text-[10px] text-gray-400 dark:text-gray-600 mt-2"
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600 mt-2"
|
||||
>{$t('toolServers.headers')}</label
|
||||
>
|
||||
<p class="text-[10px] text-gray-300 dark:text-gray-700 mb-0.5">{$t('toolServers.headersHint')}</p>
|
||||
<p class="text-[0.625rem] text-gray-300 dark:text-gray-700 mb-0.5">
|
||||
{$t('toolServers.headersHint')}
|
||||
</p>
|
||||
<textarea
|
||||
placeholder={'{"X-Custom-Header": "value"}'}
|
||||
bind:value={formHeaders}
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
rows="2"
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5 font-mono resize-none"
|
||||
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 resize-none"
|
||||
></textarea>
|
||||
|
||||
|
||||
<!-- Verify result -->
|
||||
{#if verifyResult?.ok && verifyResult.tools}
|
||||
<div class="mt-2 text-[11px] text-gray-500 dark:text-gray-400">
|
||||
<div class="mt-2 text-[0.6875rem] text-gray-500 dark:text-gray-400">
|
||||
{verifyResult.tools.length}
|
||||
{$t('toolServers.toolsFound')}:
|
||||
<span class="text-gray-400 dark:text-gray-500"
|
||||
@@ -474,11 +475,11 @@
|
||||
<div class="flex items-center gap-3">
|
||||
{#if editServer}
|
||||
<button
|
||||
class="text-[13px] text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors duration-100"
|
||||
class="text-[0.8125rem] text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors duration-100"
|
||||
onclick={handleDelete}>{$t('toolServers.delete')}</button
|
||||
>
|
||||
<button
|
||||
class="text-[13px] text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors duration-100 disabled:opacity-30"
|
||||
class="text-[0.8125rem] text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors duration-100 disabled:opacity-30"
|
||||
disabled={verifying}
|
||||
onclick={handleVerify}
|
||||
>
|
||||
@@ -493,7 +494,7 @@
|
||||
<button
|
||||
disabled={saving || (formType === 'mcp_stdio' ? !formCommand.trim() : !formUrl.trim())}
|
||||
onclick={handleSubmit}
|
||||
class="text-[13px] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100 disabled:opacity-30 disabled:pointer-events-none"
|
||||
class="text-[0.8125rem] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100 disabled:opacity-30 disabled:pointer-events-none"
|
||||
>
|
||||
{#if saving}
|
||||
<Spinner size={14} />
|
||||
|
||||
@@ -97,13 +97,9 @@
|
||||
<div class="flex flex-col gap-2.5 mb-3">
|
||||
<label class="flex items-center justify-between cursor-pointer">
|
||||
<span class="text-xs text-gray-600 dark:text-gray-400">{$t('admin.allowSignUp')}</span>
|
||||
<ToggleSwitch
|
||||
value={signupEnabled}
|
||||
onchange={(v) => toggleSignup(v)}
|
||||
disabled={savingConfig}
|
||||
/>
|
||||
<ToggleSwitch value={signupEnabled} onchange={(v) => toggleSignup(v)} disabled={savingConfig} />
|
||||
</label>
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600 -mt-1">
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600 -mt-1">
|
||||
{signupEnabled ? $t('admin.signUpEnabled') : $t('admin.signUpDisabled')}
|
||||
</p>
|
||||
</div>
|
||||
@@ -124,11 +120,11 @@
|
||||
alt=""
|
||||
class="w-4 h-4 rounded-full object-cover shrink-0"
|
||||
/>
|
||||
<span class="flex-1 text-[13px] text-gray-700 dark:text-gray-300 truncate"
|
||||
<span class="flex-1 text-[0.8125rem] text-gray-700 dark:text-gray-300 truncate"
|
||||
>{user.display_name || user.username}</span
|
||||
>
|
||||
<span
|
||||
class="text-[11px] transition-colors duration-75
|
||||
class="text-[0.6875rem] transition-colors duration-75
|
||||
{user.role === 'admin'
|
||||
? 'text-gray-900 dark:text-white font-medium'
|
||||
: 'text-gray-400 dark:text-gray-600'}">{user.role}</span
|
||||
@@ -137,7 +133,7 @@
|
||||
{/each}
|
||||
|
||||
{#if users.length === 0}
|
||||
<p class="text-[13px] text-gray-400 dark:text-gray-600 py-4">{$t('admin.noUsers')}</p>
|
||||
<p class="text-[0.8125rem] text-gray-400 dark:text-gray-600 py-4">{$t('admin.noUsers')}</p>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -146,13 +142,15 @@
|
||||
class="flex items-center justify-between mt-4 pt-3 border-t border-gray-200 dark:border-white/6"
|
||||
>
|
||||
<button
|
||||
class="text-[11px] text-gray-400 dark:text-gray-600 hover:text-gray-700 dark:hover:text-gray-300 transition-colors disabled:opacity-30 disabled:pointer-events-none"
|
||||
class="text-[0.6875rem] text-gray-400 dark:text-gray-600 hover:text-gray-700 dark:hover:text-gray-300 transition-colors disabled:opacity-30 disabled:pointer-events-none"
|
||||
disabled={page === 0}
|
||||
onclick={() => page--}>← {$t('admin.prev').replace('← ', '')}</button
|
||||
>
|
||||
<span class="text-[11px] text-gray-400 dark:text-gray-600">{page + 1} / {totalPages}</span>
|
||||
<span class="text-[0.6875rem] text-gray-400 dark:text-gray-600"
|
||||
>{page + 1} / {totalPages}</span
|
||||
>
|
||||
<button
|
||||
class="text-[11px] text-gray-400 dark:text-gray-600 hover:text-gray-700 dark:hover:text-gray-300 transition-colors disabled:opacity-30 disabled:pointer-events-none"
|
||||
class="text-[0.6875rem] text-gray-400 dark:text-gray-600 hover:text-gray-700 dark:hover:text-gray-300 transition-colors disabled:opacity-30 disabled:pointer-events-none"
|
||||
disabled={page >= totalPages - 1}
|
||||
onclick={() => page++}>{$t('admin.next')}</button
|
||||
>
|
||||
|
||||
@@ -49,7 +49,8 @@
|
||||
perplexityKey = (config['web.perplexity_api_key'] as string) || '';
|
||||
perplexityBaseUrl = (config['web.perplexity_base_url'] as string) || '';
|
||||
firecrawlSearchKey = (config['web.firecrawl_api_key'] as string) || '';
|
||||
firecrawlSearchBaseUrl = (config['web.firecrawl_base_url'] as string) || 'https://api.firecrawl.dev';
|
||||
firecrawlSearchBaseUrl =
|
||||
(config['web.firecrawl_base_url'] as string) || 'https://api.firecrawl.dev';
|
||||
ccKey = (config['web.chat_completions_api_key'] as string) || '';
|
||||
ccBaseUrl = (config['web.chat_completions_base_url'] as string) || '';
|
||||
ccModel = (config['web.chat_completions_model'] as string) || '';
|
||||
@@ -58,12 +59,15 @@
|
||||
browserEnabled = config['browser.enabled'] === true || config['browser.enabled'] === 'true';
|
||||
browserProvider = (config['browser.provider'] as typeof browserProvider) || 'local';
|
||||
cdpUrl = (config['browser.cdp_url'] as string) || 'http://localhost:9222';
|
||||
autoLaunch = config['browser.auto_launch'] !== false && config['browser.auto_launch'] !== 'false';
|
||||
autoLaunch =
|
||||
config['browser.auto_launch'] !== false && config['browser.auto_launch'] !== 'false';
|
||||
sessionTimeout = Number(config['browser.session_timeout_minutes']) || 10;
|
||||
firecrawlApiKey = (config['browser.firecrawl_api_key'] as string) || '';
|
||||
firecrawlBaseUrl = (config['browser.firecrawl_base_url'] as string) || 'https://api.firecrawl.dev';
|
||||
firecrawlBaseUrl =
|
||||
(config['browser.firecrawl_base_url'] as string) || 'https://api.firecrawl.dev';
|
||||
browserUseApiKey = (config['browser.browser_use_api_key'] as string) || '';
|
||||
browserUseBaseUrl = (config['browser.browser_use_base_url'] as string) || 'https://api.browser-use.com';
|
||||
browserUseBaseUrl =
|
||||
(config['browser.browser_use_base_url'] as string) || 'https://api.browser-use.com';
|
||||
} catch {
|
||||
toast.error($t('admin.failedToLoadConfig'));
|
||||
}
|
||||
@@ -136,15 +140,22 @@
|
||||
<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">{$t('admin.webEnabled')}</span>
|
||||
<ToggleSwitch value={webEnabled} onchange={(v) => { webEnabled = v; }} />
|
||||
<ToggleSwitch
|
||||
value={webEnabled}
|
||||
onchange={(v) => {
|
||||
webEnabled = v;
|
||||
}}
|
||||
/>
|
||||
</label>
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600 -mt-1">
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600 -mt-1">
|
||||
{webEnabled ? $t('admin.webEnabledHint') : $t('admin.webDisabledHint')}
|
||||
</p>
|
||||
|
||||
{#if webEnabled}
|
||||
<div class="flex items-center justify-between">
|
||||
<span class="text-xs text-gray-600 dark:text-gray-400">{$t('admin.webSearchProvider')}</span>
|
||||
<span class="text-xs text-gray-600 dark:text-gray-400"
|
||||
>{$t('admin.webSearchProvider')}</span
|
||||
>
|
||||
<select
|
||||
bind:value={searchProvider}
|
||||
class="bg-transparent text-xs text-gray-600 dark:text-gray-400 outline-none cursor-pointer"
|
||||
@@ -159,7 +170,7 @@
|
||||
<option value="chat_completions">{$t('admin.webChatCompletions')}</option>
|
||||
</select>
|
||||
</div>
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600 -mt-1">
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600 -mt-1">
|
||||
{#if searchProvider === 'auto'}
|
||||
{$t('admin.webAutoHint')}
|
||||
{:else if searchProvider === 'duckduckgo'}
|
||||
@@ -169,68 +180,154 @@
|
||||
|
||||
{#if searchProvider === 'exa'}
|
||||
<div>
|
||||
<label class="text-xs text-gray-600 dark:text-gray-400" for="exa-key">{$t('admin.webExaKey')}</label>
|
||||
<input id="exa-key" type="password" bind:value={exaKey} placeholder="exa-..."
|
||||
class="w-full mt-1 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" />
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600 mt-0.5">{$t('admin.webExaHint')}</p>
|
||||
<label class="text-xs text-gray-600 dark:text-gray-400" for="exa-key"
|
||||
>{$t('admin.webExaKey')}</label
|
||||
>
|
||||
<input
|
||||
id="exa-key"
|
||||
type="password"
|
||||
bind:value={exaKey}
|
||||
placeholder="exa-..."
|
||||
class="w-full mt-1 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"
|
||||
/>
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600 mt-0.5">
|
||||
{$t('admin.webExaHint')}
|
||||
</p>
|
||||
</div>
|
||||
{:else if searchProvider === 'tavily'}
|
||||
<div>
|
||||
<label class="text-xs text-gray-600 dark:text-gray-400" for="tavily-key">{$t('admin.webTavilyKey')}</label>
|
||||
<input id="tavily-key" type="password" bind:value={tavilyKey} placeholder="tvly-..."
|
||||
class="w-full mt-1 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" />
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600 mt-0.5">{$t('admin.webTavilyHint')}</p>
|
||||
<label class="text-xs text-gray-600 dark:text-gray-400" for="tavily-key"
|
||||
>{$t('admin.webTavilyKey')}</label
|
||||
>
|
||||
<input
|
||||
id="tavily-key"
|
||||
type="password"
|
||||
bind:value={tavilyKey}
|
||||
placeholder="tvly-..."
|
||||
class="w-full mt-1 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"
|
||||
/>
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600 mt-0.5">
|
||||
{$t('admin.webTavilyHint')}
|
||||
</p>
|
||||
</div>
|
||||
{:else if searchProvider === 'brave'}
|
||||
<div>
|
||||
<label class="text-xs text-gray-600 dark:text-gray-400" for="brave-key">{$t('admin.webBraveKey')}</label>
|
||||
<input id="brave-key" type="password" bind:value={braveKey} placeholder="BSA..."
|
||||
class="w-full mt-1 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" />
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600 mt-0.5">{$t('admin.webBraveHint')}</p>
|
||||
<label class="text-xs text-gray-600 dark:text-gray-400" for="brave-key"
|
||||
>{$t('admin.webBraveKey')}</label
|
||||
>
|
||||
<input
|
||||
id="brave-key"
|
||||
type="password"
|
||||
bind:value={braveKey}
|
||||
placeholder="BSA..."
|
||||
class="w-full mt-1 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"
|
||||
/>
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600 mt-0.5">
|
||||
{$t('admin.webBraveHint')}
|
||||
</p>
|
||||
</div>
|
||||
{:else if searchProvider === 'firecrawl'}
|
||||
<div>
|
||||
<label class="text-xs text-gray-600 dark:text-gray-400" for="web-fc-key">{$t('admin.webFirecrawlKey')}</label>
|
||||
<input id="web-fc-key" type="password" bind:value={firecrawlSearchKey} placeholder="fc-..."
|
||||
class="w-full mt-1 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" />
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600 mt-0.5">{$t('admin.webFirecrawlHint')}</p>
|
||||
<label class="text-xs text-gray-600 dark:text-gray-400" for="web-fc-key"
|
||||
>{$t('admin.webFirecrawlKey')}</label
|
||||
>
|
||||
<input
|
||||
id="web-fc-key"
|
||||
type="password"
|
||||
bind:value={firecrawlSearchKey}
|
||||
placeholder="fc-..."
|
||||
class="w-full mt-1 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"
|
||||
/>
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600 mt-0.5">
|
||||
{$t('admin.webFirecrawlHint')}
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<label class="text-xs text-gray-600 dark:text-gray-400" for="web-fc-url">{$t('admin.webFirecrawlBaseUrl')}</label>
|
||||
<input id="web-fc-url" type="text" bind:value={firecrawlSearchBaseUrl} placeholder="https://api.firecrawl.dev"
|
||||
class="w-full mt-1 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" />
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600 mt-0.5">{$t('admin.browserFirecrawlBaseUrlHint')}</p>
|
||||
<label class="text-xs text-gray-600 dark:text-gray-400" for="web-fc-url"
|
||||
>{$t('admin.webFirecrawlBaseUrl')}</label
|
||||
>
|
||||
<input
|
||||
id="web-fc-url"
|
||||
type="text"
|
||||
bind:value={firecrawlSearchBaseUrl}
|
||||
placeholder="https://api.firecrawl.dev"
|
||||
class="w-full mt-1 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"
|
||||
/>
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600 mt-0.5">
|
||||
{$t('admin.browserFirecrawlBaseUrlHint')}
|
||||
</p>
|
||||
</div>
|
||||
{:else if searchProvider === 'perplexity'}
|
||||
<div>
|
||||
<label class="text-xs text-gray-600 dark:text-gray-400" for="pplx-key">{$t('admin.webPerplexityKey')}</label>
|
||||
<input id="pplx-key" type="password" bind:value={perplexityKey} placeholder="pplx-..."
|
||||
class="w-full mt-1 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" />
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600 mt-0.5">{$t('admin.webPerplexityHint')}</p>
|
||||
<label class="text-xs text-gray-600 dark:text-gray-400" for="pplx-key"
|
||||
>{$t('admin.webPerplexityKey')}</label
|
||||
>
|
||||
<input
|
||||
id="pplx-key"
|
||||
type="password"
|
||||
bind:value={perplexityKey}
|
||||
placeholder="pplx-..."
|
||||
class="w-full mt-1 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"
|
||||
/>
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600 mt-0.5">
|
||||
{$t('admin.webPerplexityHint')}
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<label class="text-xs text-gray-600 dark:text-gray-400" for="pplx-base-url">{$t('admin.webPerplexityBaseUrl')}</label>
|
||||
<input id="pplx-base-url" type="text" bind:value={perplexityBaseUrl} placeholder="https://api.perplexity.ai"
|
||||
class="w-full mt-1 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" />
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600 mt-0.5">{$t('admin.webPerplexityBaseUrlHint')}</p>
|
||||
<label class="text-xs text-gray-600 dark:text-gray-400" for="pplx-base-url"
|
||||
>{$t('admin.webPerplexityBaseUrl')}</label
|
||||
>
|
||||
<input
|
||||
id="pplx-base-url"
|
||||
type="text"
|
||||
bind:value={perplexityBaseUrl}
|
||||
placeholder="https://api.perplexity.ai"
|
||||
class="w-full mt-1 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"
|
||||
/>
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600 mt-0.5">
|
||||
{$t('admin.webPerplexityBaseUrlHint')}
|
||||
</p>
|
||||
</div>
|
||||
{:else if searchProvider === 'chat_completions'}
|
||||
<div>
|
||||
<label class="text-xs text-gray-600 dark:text-gray-400" for="cc-base-url">{$t('admin.webCcBaseUrl')}</label>
|
||||
<input id="cc-base-url" type="text" bind:value={ccBaseUrl} placeholder="https://api.perplexity.ai/v1"
|
||||
class="w-full mt-1 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" />
|
||||
<label class="text-xs text-gray-600 dark:text-gray-400" for="cc-base-url"
|
||||
>{$t('admin.webCcBaseUrl')}</label
|
||||
>
|
||||
<input
|
||||
id="cc-base-url"
|
||||
type="text"
|
||||
bind:value={ccBaseUrl}
|
||||
placeholder="https://api.perplexity.ai/v1"
|
||||
class="w-full mt-1 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"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<label class="text-xs text-gray-600 dark:text-gray-400" for="cc-key">{$t('admin.webCcKey')}</label>
|
||||
<input id="cc-key" type="password" bind:value={ccKey} placeholder="sk-..."
|
||||
class="w-full mt-1 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" />
|
||||
<label class="text-xs text-gray-600 dark:text-gray-400" for="cc-key"
|
||||
>{$t('admin.webCcKey')}</label
|
||||
>
|
||||
<input
|
||||
id="cc-key"
|
||||
type="password"
|
||||
bind:value={ccKey}
|
||||
placeholder="sk-..."
|
||||
class="w-full mt-1 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"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<label class="text-xs text-gray-600 dark:text-gray-400" for="cc-model">{$t('admin.webCcModel')}</label>
|
||||
<input id="cc-model" type="text" bind:value={ccModel} placeholder="sonar-pro"
|
||||
class="w-full mt-1 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" />
|
||||
<label class="text-xs text-gray-600 dark:text-gray-400" for="cc-model"
|
||||
>{$t('admin.webCcModel')}</label
|
||||
>
|
||||
<input
|
||||
id="cc-model"
|
||||
type="text"
|
||||
bind:value={ccModel}
|
||||
placeholder="sonar-pro"
|
||||
class="w-full mt-1 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"
|
||||
/>
|
||||
</div>
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600 -mt-1">{$t('admin.webCcHint')}</p>
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600 -mt-1">
|
||||
{$t('admin.webCcHint')}
|
||||
</p>
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
||||
@@ -241,15 +338,21 @@
|
||||
<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">{$t('admin.browserTools')}</span>
|
||||
<ToggleSwitch value={browserEnabled} onchange={(v) => { browserEnabled = v; }} />
|
||||
<ToggleSwitch
|
||||
value={browserEnabled}
|
||||
onchange={(v) => {
|
||||
browserEnabled = v;
|
||||
}}
|
||||
/>
|
||||
</label>
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600 -mt-1">
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600 -mt-1">
|
||||
{$t('admin.browserHint')}
|
||||
</p>
|
||||
|
||||
{#if browserEnabled}
|
||||
<div class="flex items-center justify-between">
|
||||
<span class="text-xs text-gray-600 dark:text-gray-400">{$t('admin.browserProvider')}</span>
|
||||
<span class="text-xs text-gray-600 dark:text-gray-400">{$t('admin.browserProvider')}</span
|
||||
>
|
||||
<select
|
||||
bind:value={browserProvider}
|
||||
class="bg-transparent text-xs text-gray-600 dark:text-gray-400 outline-none cursor-pointer"
|
||||
@@ -259,7 +362,7 @@
|
||||
<option value="browser_use">{$t('admin.browserBrowserUse')}</option>
|
||||
</select>
|
||||
</div>
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600 -mt-1">
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600 -mt-1">
|
||||
{#if browserProvider === 'local'}
|
||||
{$t('admin.browserLocalHint')}
|
||||
{:else if browserProvider === 'firecrawl'}
|
||||
@@ -272,60 +375,120 @@
|
||||
{#if browserProvider === 'local'}
|
||||
<label class="flex items-center justify-between cursor-pointer">
|
||||
<div>
|
||||
<span class="text-xs text-gray-600 dark:text-gray-400">{$t('admin.browserAutoLaunch')}</span>
|
||||
<p class="text-[10px] text-gray-400 dark:text-gray-600">{$t('admin.browserAutoLaunchHint')}</p>
|
||||
<span class="text-xs text-gray-600 dark:text-gray-400"
|
||||
>{$t('admin.browserAutoLaunch')}</span
|
||||
>
|
||||
<p class="text-[0.625rem] text-gray-400 dark:text-gray-600">
|
||||
{$t('admin.browserAutoLaunchHint')}
|
||||
</p>
|
||||
</div>
|
||||
<ToggleSwitch value={autoLaunch} onchange={(v) => { autoLaunch = v; }} />
|
||||
<ToggleSwitch
|
||||
value={autoLaunch}
|
||||
onchange={(v) => {
|
||||
autoLaunch = v;
|
||||
}}
|
||||
/>
|
||||
</label>
|
||||
|
||||
<div>
|
||||
<label class="text-xs text-gray-600 dark:text-gray-400" for="cdp-url">{$t('admin.browserCdpUrl')}</label>
|
||||
<label class="text-xs text-gray-600 dark:text-gray-400" for="cdp-url"
|
||||
>{$t('admin.browserCdpUrl')}</label
|
||||
>
|
||||
<div class="flex gap-1.5 mt-1">
|
||||
<input id="cdp-url" type="text" bind:value={cdpUrl} placeholder="http://localhost:9222"
|
||||
class="flex-1 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" />
|
||||
<input
|
||||
id="cdp-url"
|
||||
type="text"
|
||||
bind:value={cdpUrl}
|
||||
placeholder="http://localhost:9222"
|
||||
class="flex-1 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"
|
||||
/>
|
||||
<button
|
||||
class="h-7 px-2.5 rounded-lg text-xs bg-gray-200/50 dark:bg-white/8 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors disabled:opacity-50"
|
||||
onclick={() => testConnection()}
|
||||
disabled={testing}
|
||||
>{testing ? '...' : $t('admin.browserTest')}</button>
|
||||
disabled={testing}>{testing ? '...' : $t('admin.browserTest')}</button
|
||||
>
|
||||
</div>
|
||||
{#if testResult}
|
||||
<p class="text-[11px] mt-1 {testResult.ok ? 'text-emerald-600 dark:text-emerald-400' : 'text-red-500'}">
|
||||
<p
|
||||
class="text-[0.6875rem] mt-1 {testResult.ok
|
||||
? 'text-emerald-600 dark:text-emerald-400'
|
||||
: 'text-red-500'}"
|
||||
>
|
||||
{testResult.message}
|
||||
</p>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="text-xs text-gray-600 dark:text-gray-400" for="session-timeout">{$t('admin.browserSessionTimeout')}</label>
|
||||
<label class="text-xs text-gray-600 dark:text-gray-400" for="session-timeout"
|
||||
>{$t('admin.browserSessionTimeout')}</label
|
||||
>
|
||||
<div class="flex items-center gap-1.5 mt-1">
|
||||
<input id="session-timeout" type="number" bind:value={sessionTimeout} min="1" max="120"
|
||||
class="w-16 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-[11px] text-gray-400 dark:text-gray-600">{$t('admin.browserMinutes')}</span>
|
||||
<input
|
||||
id="session-timeout"
|
||||
type="number"
|
||||
bind:value={sessionTimeout}
|
||||
min="1"
|
||||
max="120"
|
||||
class="w-16 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"
|
||||
>{$t('admin.browserMinutes')}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
{:else if browserProvider === 'firecrawl'}
|
||||
<div>
|
||||
<label class="text-xs text-gray-600 dark:text-gray-400" for="fc-key">{$t('admin.browserApiKey')}</label>
|
||||
<input id="fc-key" type="password" bind:value={firecrawlApiKey} placeholder="fc-..."
|
||||
class="w-full mt-1 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" />
|
||||
<label class="text-xs text-gray-600 dark:text-gray-400" for="fc-key"
|
||||
>{$t('admin.browserApiKey')}</label
|
||||
>
|
||||
<input
|
||||
id="fc-key"
|
||||
type="password"
|
||||
bind:value={firecrawlApiKey}
|
||||
placeholder="fc-..."
|
||||
class="w-full mt-1 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"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<label class="text-xs text-gray-600 dark:text-gray-400" for="fc-url">{$t('admin.browserBaseUrl')}</label>
|
||||
<input id="fc-url" type="text" bind:value={firecrawlBaseUrl} placeholder="https://api.firecrawl.dev"
|
||||
class="w-full mt-1 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" />
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600 mt-0.5">{$t('admin.browserFirecrawlBaseUrlHint')}</p>
|
||||
<label class="text-xs text-gray-600 dark:text-gray-400" for="fc-url"
|
||||
>{$t('admin.browserBaseUrl')}</label
|
||||
>
|
||||
<input
|
||||
id="fc-url"
|
||||
type="text"
|
||||
bind:value={firecrawlBaseUrl}
|
||||
placeholder="https://api.firecrawl.dev"
|
||||
class="w-full mt-1 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"
|
||||
/>
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600 mt-0.5">
|
||||
{$t('admin.browserFirecrawlBaseUrlHint')}
|
||||
</p>
|
||||
</div>
|
||||
{:else if browserProvider === 'browser_use'}
|
||||
<div>
|
||||
<label class="text-xs text-gray-600 dark:text-gray-400" for="bu-key">{$t('admin.browserApiKey')}</label>
|
||||
<input id="bu-key" type="password" bind:value={browserUseApiKey} placeholder="bu-..."
|
||||
class="w-full mt-1 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" />
|
||||
<label class="text-xs text-gray-600 dark:text-gray-400" for="bu-key"
|
||||
>{$t('admin.browserApiKey')}</label
|
||||
>
|
||||
<input
|
||||
id="bu-key"
|
||||
type="password"
|
||||
bind:value={browserUseApiKey}
|
||||
placeholder="bu-..."
|
||||
class="w-full mt-1 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"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<label class="text-xs text-gray-600 dark:text-gray-400" for="bu-url">{$t('admin.browserBaseUrl')}</label>
|
||||
<input id="bu-url" type="text" bind:value={browserUseBaseUrl} placeholder="https://api.browser-use.com"
|
||||
class="w-full mt-1 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" />
|
||||
<label class="text-xs text-gray-600 dark:text-gray-400" for="bu-url"
|
||||
>{$t('admin.browserBaseUrl')}</label
|
||||
>
|
||||
<input
|
||||
id="bu-url"
|
||||
type="text"
|
||||
bind:value={browserUseBaseUrl}
|
||||
placeholder="https://api.browser-use.com"
|
||||
class="w-full mt-1 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"
|
||||
/>
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
@@ -334,10 +497,10 @@
|
||||
<!-- Save -->
|
||||
<div class="mt-auto pt-6 flex justify-end">
|
||||
<button
|
||||
class="text-[13px] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100 disabled:opacity-50"
|
||||
class="text-[0.8125rem] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100 disabled:opacity-50"
|
||||
onclick={() => save()}
|
||||
disabled={saving}
|
||||
>{$t('settings.save')}</button>
|
||||
disabled={saving}>{$t('settings.save')}</button
|
||||
>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -97,20 +97,20 @@
|
||||
autofocus
|
||||
autocomplete="username"
|
||||
spellcheck="false"
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-1"
|
||||
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-1"
|
||||
/>
|
||||
<input
|
||||
type="password"
|
||||
placeholder={$t('auth.password')}
|
||||
bind:value={password}
|
||||
autocomplete={isSetup ? 'new-password' : 'current-password'}
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-1"
|
||||
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-1"
|
||||
/>
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
disabled={loading || !password || !username.trim()}
|
||||
class="flex items-center gap-2 text-[13px] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100
|
||||
class="flex items-center gap-2 text-[0.8125rem] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100
|
||||
disabled:opacity-30 disabled:pointer-events-none mt-2"
|
||||
>
|
||||
{#if loading}
|
||||
@@ -126,7 +126,7 @@
|
||||
</form>
|
||||
|
||||
{#if !isSetup && signupEnabled && mode === 'password'}
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600 mt-4">
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600 mt-4">
|
||||
{#if isSignup}
|
||||
{$t('auth.alreadyHaveAccount')}
|
||||
<button
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
<!-- Workspace name -->
|
||||
{#if $activeWorkspace}
|
||||
<span
|
||||
class="text-[11px] font-medium text-gray-500 dark:text-gray-500 px-1 truncate flex-1 min-w-0"
|
||||
class="text-[0.6875rem] font-medium text-gray-500 dark:text-gray-500 px-1 truncate flex-1 min-w-0"
|
||||
>
|
||||
{$activeWorkspace.name}
|
||||
</span>
|
||||
@@ -125,9 +125,9 @@
|
||||
<style>
|
||||
@media (display-mode: window-controls-overlay) {
|
||||
.wco-bar {
|
||||
padding-left: env(titlebar-area-x, 0px);
|
||||
padding-left: env(titlebar-area-x, 0);
|
||||
width: env(titlebar-area-width, 100%);
|
||||
height: env(titlebar-area-height, 36px);
|
||||
height: env(titlebar-area-height, 2.25rem);
|
||||
app-region: drag;
|
||||
}
|
||||
.wco-bar button,
|
||||
|
||||
@@ -62,9 +62,11 @@
|
||||
<Modal onclose={handleClose} class="w-full max-w-3xl mx-4 md:mx-0 flex flex-col max-h-[52vh]">
|
||||
<div class="flex items-center gap-3 px-4 pt-4 pb-2 shrink-0">
|
||||
<div class="min-w-0 flex-1">
|
||||
<h2 class="text-sm font-medium text-gray-900 dark:text-white">{$t('changelog.whatsNew')}</h2>
|
||||
<h2 class="text-sm font-medium text-gray-900 dark:text-white">
|
||||
{$t('changelog.whatsNew')}
|
||||
</h2>
|
||||
{#if $appVersion}
|
||||
<p class="mt-0.5 text-[11px] text-gray-400 dark:text-gray-600">
|
||||
<p class="mt-0.5 text-[0.6875rem] text-gray-400 dark:text-gray-600">
|
||||
{$t('changelog.releaseNotes')}
|
||||
</p>
|
||||
{/if}
|
||||
@@ -85,15 +87,17 @@
|
||||
{#each versions as [ver, data], i}
|
||||
<div>
|
||||
<div class="mb-2">
|
||||
<h3 class="text-[13px] font-semibold text-gray-900 dark:text-white">v{ver}</h3>
|
||||
<p class="text-[10px] text-gray-400 dark:text-gray-600 mt-0.5">{formatDate(data.date)}</p>
|
||||
<h3 class="text-[0.8125rem] font-semibold text-gray-900 dark:text-white">v{ver}</h3>
|
||||
<p class="text-[0.625rem] text-gray-400 dark:text-gray-600 mt-0.5">
|
||||
{formatDate(data.date)}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{#each Object.entries(data).filter(([key]) => key !== 'date') as [section, items]}
|
||||
{#if Array.isArray(items) && items.length > 0}
|
||||
<div class="mb-3">
|
||||
<span
|
||||
class="inline-block text-[10px] font-semibold uppercase tracking-wide rounded-full px-2 py-0.5 my-1.5
|
||||
class="inline-block text-[0.625rem] font-semibold uppercase tracking-wide rounded-full px-2 py-0.5 my-1.5
|
||||
{section === 'added'
|
||||
? 'bg-blue-500/10 text-blue-600 dark:text-blue-400'
|
||||
: section === 'fixed'
|
||||
@@ -150,14 +154,16 @@
|
||||
{:else}
|
||||
<div class="flex flex-col items-center justify-center py-16 gap-3">
|
||||
<Spinner size={16} />
|
||||
<span class="text-[11px] text-gray-400 dark:text-gray-600">{$t('changelog.loading')}</span>
|
||||
<span class="text-[0.6875rem] text-gray-400 dark:text-gray-600"
|
||||
>{$t('changelog.loading')}</span
|
||||
>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<div class="flex items-center justify-end px-4 pt-1 pb-4 shrink-0">
|
||||
<button
|
||||
class="text-[13px] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100"
|
||||
class="text-[0.8125rem] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100"
|
||||
onclick={handleClose}
|
||||
>
|
||||
{$t('changelog.done')}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<span class="text-xs text-gray-400 dark:text-gray-600">{title}</span>
|
||||
{#if !expanded && summary}
|
||||
<span
|
||||
class="text-[11px] text-gray-400 dark:text-gray-600 font-mono ml-auto truncate max-w-[60%] text-right"
|
||||
class="text-[0.6875rem] text-gray-400 dark:text-gray-600 font-mono ml-auto truncate max-w-[60%] text-right"
|
||||
>{summary}</span
|
||||
>
|
||||
{/if}
|
||||
|
||||
@@ -289,7 +289,7 @@
|
||||
|
||||
<Modal
|
||||
{onclose}
|
||||
class="w-full max-w-[560px] mx-4 max-md:mx-0 max-md:rounded-none max-h-[480px] max-md:max-h-dvh flex flex-col mb-[6vh] max-md:mb-0"
|
||||
class="w-full max-w-[35rem] mx-4 max-md:mx-0 max-md:rounded-none max-h-[30rem] max-md:max-h-dvh flex flex-col mb-[6vh] max-md:mb-0"
|
||||
>
|
||||
<!-- Path bar -->
|
||||
<div class="flex items-center px-3.5 pt-2.5 pb-2 gap-2 shrink-0">
|
||||
@@ -329,10 +329,10 @@
|
||||
<span class="text-red-400 shrink-0 flex"><Icon name="xmark" size={12} /></span>
|
||||
{/if}
|
||||
{#if tabHint}
|
||||
<span class="text-[10px] text-gray-400 whitespace-nowrap shrink-0">{tabHint}</span>
|
||||
<span class="text-[0.625rem] text-gray-400 whitespace-nowrap shrink-0">{tabHint}</span>
|
||||
{/if}
|
||||
<span
|
||||
class="text-[10px] font-mono px-1.5 py-0.5 rounded bg-gray-100 dark:bg-white/6 text-gray-400 shrink-0"
|
||||
class="text-[0.625rem] font-mono px-1.5 py-0.5 rounded bg-gray-100 dark:bg-white/6 text-gray-400 shrink-0"
|
||||
>TAB</span
|
||||
>
|
||||
</div>
|
||||
@@ -348,17 +348,18 @@
|
||||
}}
|
||||
>
|
||||
{#each breadcrumbs as seg, i (seg.path)}
|
||||
{#if i > 1}<span class="text-gray-300 dark:text-gray-600 text-[11px] font-mono">/</span
|
||||
{#if i > 1}<span class="text-gray-300 dark:text-gray-600 text-[0.6875rem] font-mono"
|
||||
>/</span
|
||||
>{/if}
|
||||
{#if i === breadcrumbs.length - 1}
|
||||
<span
|
||||
class="text-[11px] font-mono text-gray-900 dark:text-white whitespace-nowrap overflow-hidden text-ellipsis"
|
||||
class="text-[0.6875rem] font-mono text-gray-900 dark:text-white whitespace-nowrap overflow-hidden text-ellipsis"
|
||||
>{seg.name}</span
|
||||
>
|
||||
{:else}
|
||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
||||
<span
|
||||
class="text-[11px] font-mono text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 whitespace-nowrap shrink-0 cursor-pointer px-0.5 transition-colors duration-75"
|
||||
class="text-[0.6875rem] font-mono text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 whitespace-nowrap shrink-0 cursor-pointer px-0.5 transition-colors duration-75"
|
||||
role="button"
|
||||
tabindex="-1"
|
||||
onclick={(e) => {
|
||||
@@ -439,7 +440,7 @@
|
||||
<!-- Footer -->
|
||||
<div class="flex items-center gap-2 px-3.5 pb-3 pt-1 shrink-0">
|
||||
<span
|
||||
class="flex-1 text-[11px] text-gray-400 dark:text-gray-600 font-mono truncate min-w-0"
|
||||
class="flex-1 text-[0.6875rem] text-gray-400 dark:text-gray-600 font-mono truncate min-w-0"
|
||||
title={currentPath}>{currentPath}</span
|
||||
>
|
||||
<button
|
||||
|
||||
@@ -989,10 +989,10 @@
|
||||
<div
|
||||
class="flex items-center gap-1.5 h-7 px-3 border-b border-gray-200 dark:border-white/6 shrink-0"
|
||||
>
|
||||
<span class="text-[10px] text-gray-400 shrink-0">{$t('files.ports')}</span>
|
||||
<span class="text-[0.625rem] text-gray-400 shrink-0">{$t('files.ports')}</span>
|
||||
{#each workspacePorts as p (p.port)}
|
||||
<button
|
||||
class="px-1.5 py-0.5 rounded text-[11px] font-mono font-medium text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-white/6 transition-colors duration-75"
|
||||
class="px-1.5 py-0.5 rounded text-[0.6875rem] font-mono font-medium text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-white/6 transition-colors duration-75"
|
||||
onclick={() => openPreviewTab(p.port)}
|
||||
use:tooltip={$t('files.clickToPreview', { process: p.process })}>:{p.port}</button
|
||||
>
|
||||
@@ -1082,7 +1082,7 @@
|
||||
<!-- Inline rename -->
|
||||
<div
|
||||
class="flex items-center gap-2 h-7"
|
||||
style="padding-left: {8 + entry.depth * 16}px; padding-right: 8px;"
|
||||
style="padding-left: {8 + entry.depth * 16}px; padding-right: 0.5rem;"
|
||||
>
|
||||
<Icon
|
||||
name={fileIconName(entry.name, entry.type)}
|
||||
@@ -1122,7 +1122,7 @@
|
||||
? 'bg-blue-100 dark:bg-blue-500/20'
|
||||
: 'bg-blue-50/60 dark:bg-blue-500/8'
|
||||
: 'hover:bg-gray-100 dark:hover:bg-white/4'}"
|
||||
style="padding-left: {8 + entry.depth * 16}px; padding-right: 8px;"
|
||||
style="padding-left: {8 + entry.depth * 16}px; padding-right: 0.5rem;"
|
||||
onclick={(e) => handleClick(e, entry, i)}
|
||||
oncontextmenu={(e) => onContextMenu(e, entry)}
|
||||
draggable="true"
|
||||
@@ -1185,12 +1185,13 @@
|
||||
{/if}
|
||||
{#if fileGitStatus && entryGitDecoration}
|
||||
<span
|
||||
class="text-[10px] font-mono font-bold shrink-0 {entryGitDecoration.badgeColor}"
|
||||
class="text-[0.625rem] font-mono font-bold shrink-0 {entryGitDecoration.badgeColor}"
|
||||
use:tooltip={gitStatusTooltip(fileGitStatus, entry)}>{entryGitDecoration.char}</span
|
||||
>
|
||||
{/if}
|
||||
{#if entry.type !== 'directory' && entry.size !== null}
|
||||
<span class="ml-1 text-[11px] font-mono text-gray-400 dark:text-gray-600 shrink-0"
|
||||
<span
|
||||
class="ml-1 text-[0.6875rem] font-mono text-gray-400 dark:text-gray-600 shrink-0"
|
||||
>{formatSize(entry.size)}</span
|
||||
>
|
||||
{/if}
|
||||
@@ -1227,26 +1228,26 @@
|
||||
<div
|
||||
class="flex items-center justify-between h-8 px-2 border-t border-gray-200 dark:border-white/6 shrink-0 bg-blue-50 dark:bg-blue-500/5"
|
||||
>
|
||||
<span class="text-[11px] font-medium text-blue-600 dark:text-blue-400"
|
||||
<span class="text-[0.6875rem] font-medium text-blue-600 dark:text-blue-400"
|
||||
>{$t('files.selected', { count: selectedPaths.size })}</span
|
||||
>
|
||||
<div class="flex items-center gap-1">
|
||||
<button
|
||||
class="text-[11px] 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/10 transition-colors duration-75"
|
||||
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/10 transition-colors duration-75"
|
||||
onclick={selectAll}>{$t('files.all')}</button
|
||||
>
|
||||
<button
|
||||
class="text-[11px] 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/10 transition-colors duration-75"
|
||||
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/10 transition-colors duration-75"
|
||||
onclick={archiveSelected}
|
||||
use:tooltip={$t('files.downloadAsZip')}><Icon name="download" size={12} /></button
|
||||
>
|
||||
<button
|
||||
class="text-[11px] px-2 py-0.5 rounded text-red-400 hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-500/10 transition-colors duration-75"
|
||||
class="text-[0.6875rem] px-2 py-0.5 rounded text-red-400 hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-500/10 transition-colors duration-75"
|
||||
onclick={deleteSelected}
|
||||
use:tooltip={$t('files.deleteSelected')}><Icon name="trash" size={12} /></button
|
||||
>
|
||||
<button
|
||||
class="text-[11px] px-2 py-0.5 rounded text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors duration-75"
|
||||
class="text-[0.6875rem] px-2 py-0.5 rounded text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors duration-75"
|
||||
onclick={clearSelection}><Icon name="xmark" size={11} /></button
|
||||
>
|
||||
</div>
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { onMount, onDestroy } from 'svelte';
|
||||
import {
|
||||
clearTabEdit,
|
||||
markTabUnsaved,
|
||||
updateTabFilePath,
|
||||
activeWorkspace
|
||||
} from '$lib/stores';
|
||||
import { clearTabEdit, markTabUnsaved, updateTabFilePath, activeWorkspace } from '$lib/stores';
|
||||
import { get } from 'svelte/store';
|
||||
import { tooltip } from '$lib/tooltip';
|
||||
import { readFile, writeFile } from '$lib/apis/files';
|
||||
@@ -202,14 +197,20 @@
|
||||
for (const change of changes) {
|
||||
if (change.line < 1) continue;
|
||||
const current = byLine.get(change.line);
|
||||
byLine.set(change.line, current === 'added' || change.type === 'added' ? 'added' : 'modified');
|
||||
byLine.set(
|
||||
change.line,
|
||||
current === 'added' || change.type === 'added' ? 'added' : 'modified'
|
||||
);
|
||||
}
|
||||
return [...byLine.entries()]
|
||||
.sort((a, b) => a[0] - b[0])
|
||||
.map(([line, type]) => ({ line, type }));
|
||||
}
|
||||
|
||||
function buildGitGutterMarkers(doc: EditorState['doc'], changes: GitLineChange[]): RangeSet<GutterMarker> {
|
||||
function buildGitGutterMarkers(
|
||||
doc: EditorState['doc'],
|
||||
changes: GitLineChange[]
|
||||
): RangeSet<GutterMarker> {
|
||||
const builder = new RangeSetBuilder<GutterMarker>();
|
||||
for (const change of normalizeGitLineChanges(changes)) {
|
||||
if (change.line < 1 || change.line > doc.lines) continue;
|
||||
@@ -246,9 +247,7 @@
|
||||
}
|
||||
return value;
|
||||
},
|
||||
provide: (field) => [
|
||||
gutterLineClass.from(field, (value) => value.markers)
|
||||
]
|
||||
provide: (field) => [gutterLineClass.from(field, (value) => value.markers)]
|
||||
});
|
||||
|
||||
function diffHunkStart(header: string): { oldStart: number; newStart: number } {
|
||||
@@ -537,9 +536,8 @@
|
||||
|
||||
function diffBlockClass(type: DiffLine['type']): string {
|
||||
if (type === 'added')
|
||||
return 'bg-green-100 border-l-[3px] border-l-green-500 dark:bg-green-500/15 dark:border-l-green-400';
|
||||
if (type === 'removed')
|
||||
return 'bg-red-100 diff-gutter-removed dark:bg-red-500/15';
|
||||
return 'bg-green-100 border-l-[0.1875rem] border-l-green-500 dark:bg-green-500/15 dark:border-l-green-400';
|
||||
if (type === 'removed') return 'bg-red-100 diff-gutter-removed dark:bg-red-500/15';
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -642,13 +640,18 @@
|
||||
const status = gitStatusStore.status;
|
||||
const data = fileData;
|
||||
const content = data?.content;
|
||||
if (!data || data.binary || isBinaryPreview || isUntitled || content === null || content === undefined) {
|
||||
if (
|
||||
!data ||
|
||||
data.binary ||
|
||||
isBinaryPreview ||
|
||||
isUntitled ||
|
||||
content === null ||
|
||||
content === undefined
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
const statusKey = status
|
||||
? `${status.is_repo}:${gitFilesSignature(status.files)}`
|
||||
: 'pending';
|
||||
const statusKey = status ? `${status.is_repo}:${gitFilesSignature(status.files)}` : 'pending';
|
||||
const key = `${wsPath}:${data.path}:${content.length}:${statusKey}`;
|
||||
if (key === lastGitLineRefreshKey) return;
|
||||
lastGitLineRefreshKey = key;
|
||||
@@ -953,10 +956,10 @@
|
||||
'.cm-activeLineGutter': { backgroundColor: dark ? '#1a1a1a' : '#f3f4f6' },
|
||||
'.cm-activeLine': { backgroundColor: dark ? '#1a1a1a' : '#f9fafb' },
|
||||
'.cm-lineNumbers .cm-gutterElement.cm-git-line-added': {
|
||||
boxShadow: `inset 2px 0 0 ${dark ? 'rgba(52, 211, 153, 0.75)' : 'rgba(5, 150, 105, 0.65)'}`
|
||||
boxShadow: `inset 0.125rem 0 0 ${dark ? 'rgba(52, 211, 153, 0.75)' : 'rgba(5, 150, 105, 0.65)'}`
|
||||
},
|
||||
'.cm-lineNumbers .cm-gutterElement.cm-git-line-modified': {
|
||||
boxShadow: `inset 2px 0 0 ${dark ? 'rgba(251, 191, 36, 0.7)' : 'rgba(217, 119, 6, 0.6)'}`
|
||||
boxShadow: `inset 0.125rem 0 0 ${dark ? 'rgba(251, 191, 36, 0.7)' : 'rgba(217, 119, 6, 0.6)'}`
|
||||
},
|
||||
'&.cm-focused': { outline: 'none' }
|
||||
}),
|
||||
@@ -1224,7 +1227,7 @@
|
||||
{#each diffFiles as df}
|
||||
{#each df.hunks as hunk}
|
||||
<div
|
||||
class="grid w-full grid-cols-[2.75rem_2.75rem_1.25rem_auto] border-b border-gray-100 bg-gray-50 text-gray-400 dark:border-white/4 dark:bg-white/3 dark:text-gray-600 font-mono text-[11px]"
|
||||
class="grid w-full grid-cols-[2.75rem_2.75rem_1.25rem_auto] border-b border-gray-100 bg-gray-50 text-gray-400 dark:border-white/4 dark:bg-white/3 dark:text-gray-600 font-mono text-[0.6875rem]"
|
||||
>
|
||||
<span></span>
|
||||
<span></span>
|
||||
@@ -1235,7 +1238,7 @@
|
||||
<div class="w-full {diffBlockClass(group.type)}">
|
||||
{#each group.lines as line}
|
||||
<div
|
||||
class="grid w-full grid-cols-[2.75rem_2.75rem_1.25rem_auto] font-mono text-[11px] leading-[18px]"
|
||||
class="grid w-full grid-cols-[2.75rem_2.75rem_1.25rem_auto] font-mono text-[0.6875rem] leading-[1.125rem]"
|
||||
>
|
||||
<span
|
||||
class="select-none border-r border-black/5 px-2 text-right text-gray-400 dark:border-white/4 dark:text-gray-600"
|
||||
@@ -1293,9 +1296,9 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 8px;
|
||||
height: 30px;
|
||||
padding: 0 10px;
|
||||
gap: 0.5rem;
|
||||
height: 1.875rem;
|
||||
padding: 0 0.625rem;
|
||||
border-bottom: 1px solid var(--color-gray-200);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
@@ -1308,7 +1311,7 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex: 1 1 auto;
|
||||
gap: 8px;
|
||||
gap: 0.5rem;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
@@ -1317,7 +1320,7 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex: 0 0 auto;
|
||||
gap: 2px;
|
||||
gap: 0.125rem;
|
||||
}
|
||||
|
||||
.file-name {
|
||||
@@ -1327,7 +1330,7 @@
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
white-space: nowrap;
|
||||
font-size: 12px;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 500;
|
||||
color: var(--color-gray-700);
|
||||
}
|
||||
@@ -1343,7 +1346,7 @@
|
||||
.file-size {
|
||||
flex: 0 0 auto;
|
||||
white-space: nowrap;
|
||||
font-size: 11px;
|
||||
font-size: 0.6875rem;
|
||||
color: var(--color-gray-400);
|
||||
}
|
||||
|
||||
@@ -1352,26 +1355,26 @@
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex: 0 0 auto;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border-radius: 4px;
|
||||
width: 1.25rem;
|
||||
height: 1.25rem;
|
||||
border-radius: 0.25rem;
|
||||
color: var(--color-gray-400);
|
||||
transition: all 0.1s;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.toolbar-btn {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border-radius: 6px;
|
||||
width: 2rem;
|
||||
height: 2rem;
|
||||
border-radius: 0.375rem;
|
||||
}
|
||||
|
||||
.toolbar {
|
||||
height: 38px;
|
||||
height: 2.375rem;
|
||||
}
|
||||
|
||||
.toolbar-right {
|
||||
gap: 4px;
|
||||
gap: 0.25rem;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1408,19 +1411,19 @@
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
padding: 24px;
|
||||
padding: 1.5rem;
|
||||
}
|
||||
|
||||
.media-container video {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
border-radius: 8px;
|
||||
border-radius: 0.5rem;
|
||||
background: #000;
|
||||
}
|
||||
|
||||
.media-container audio {
|
||||
width: 100%;
|
||||
max-width: 480px;
|
||||
max-width: 30rem;
|
||||
}
|
||||
|
||||
/* ── Tree container ──────────────────────────────────── */
|
||||
@@ -1428,7 +1431,7 @@
|
||||
.tree-container {
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
padding: 8px 12px;
|
||||
padding: 0.5rem 0.75rem;
|
||||
}
|
||||
|
||||
/* ── Markdown preview container ──────────────────────── */
|
||||
@@ -1437,7 +1440,7 @@
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
overflow-y: auto;
|
||||
padding: 24px 32px;
|
||||
padding: 1.5rem 2rem;
|
||||
}
|
||||
|
||||
/* ── States ──────────────────────────────────────────── */
|
||||
@@ -1448,39 +1451,37 @@
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
gap: 6px;
|
||||
gap: 0.375rem;
|
||||
}
|
||||
|
||||
.state.error {
|
||||
color: var(--color-gray-400);
|
||||
font-size: 13px;
|
||||
font-size: 0.8125rem;
|
||||
}
|
||||
|
||||
.state-title {
|
||||
font-size: 14px;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
color: var(--color-gray-400);
|
||||
}
|
||||
|
||||
.state-sub {
|
||||
font-size: 12px;
|
||||
font-size: 0.75rem;
|
||||
color: var(--color-gray-500);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ── Diff view ────────────────────────────────────────── */
|
||||
|
||||
.diff-scroll {
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
font-size: 0.75rem;
|
||||
line-height: 1.125rem;
|
||||
}
|
||||
|
||||
.diff-hunk-header {
|
||||
padding: 2px 8px;
|
||||
padding: 0.125rem 0.5rem;
|
||||
color: var(--color-gray-400);
|
||||
background: var(--color-gray-50);
|
||||
}
|
||||
@@ -1491,14 +1492,14 @@
|
||||
}
|
||||
|
||||
.diff-line {
|
||||
padding: 0 8px;
|
||||
padding: 0 0.5rem;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.diff-prefix {
|
||||
display: inline-block;
|
||||
width: 16px;
|
||||
width: 1rem;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
@@ -1553,13 +1554,13 @@
|
||||
}
|
||||
|
||||
.diff-gutter-removed {
|
||||
border-left: 3px solid transparent;
|
||||
border-left: 0.1875rem solid transparent;
|
||||
border-image: repeating-linear-gradient(
|
||||
-45deg,
|
||||
#ef4444 0,
|
||||
#ef4444 1px,
|
||||
transparent 1px,
|
||||
transparent 3px
|
||||
transparent 0.1875rem
|
||||
)
|
||||
3;
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@
|
||||
function blockClass(type: DiffLine['type']): string {
|
||||
switch (type) {
|
||||
case 'added':
|
||||
return 'bg-green-100 border-l-[3px] border-l-green-500 dark:bg-green-500/15 dark:border-l-green-400';
|
||||
return 'bg-green-100 border-l-[0.1875rem] border-l-green-500 dark:bg-green-500/15 dark:border-l-green-400';
|
||||
case 'removed':
|
||||
return 'bg-red-100 diff-gutter-removed dark:bg-red-500/15';
|
||||
default:
|
||||
@@ -266,7 +266,7 @@
|
||||
<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="max-w-sm text-[11px] text-gray-400 dark:text-gray-600">{error}</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">
|
||||
@@ -284,22 +284,22 @@
|
||||
>
|
||||
{#if gitStatus.upstream}
|
||||
<Icon name="chevron-right" size={12} class="shrink-0 text-gray-300 dark:text-gray-700" />
|
||||
<span class="truncate font-mono text-[11px] text-gray-400 dark:text-gray-600"
|
||||
<span class="truncate font-mono text-[0.6875rem] text-gray-400 dark:text-gray-600"
|
||||
>{gitStatus.upstream}</span
|
||||
>
|
||||
{/if}
|
||||
{#if gitStatus.ahead > 0}
|
||||
<span class="font-mono text-[10px] text-gray-400 dark:text-gray-600"
|
||||
<span class="font-mono text-[0.625rem] text-gray-400 dark:text-gray-600"
|
||||
>+{gitStatus.ahead}</span
|
||||
>
|
||||
{/if}
|
||||
{#if gitStatus.behind > 0}
|
||||
<span class="font-mono text-[10px] text-gray-400 dark:text-gray-600"
|
||||
<span class="font-mono text-[0.625rem] text-gray-400 dark:text-gray-600"
|
||||
>-{gitStatus.behind}</span
|
||||
>
|
||||
{/if}
|
||||
{#if totalChanges > 0}
|
||||
<span class="ml-1 font-mono text-[10px] text-gray-400 dark:text-gray-600"
|
||||
<span class="ml-1 font-mono text-[0.625rem] text-gray-400 dark:text-gray-600"
|
||||
>{totalChanges} changed</span
|
||||
>
|
||||
{/if}
|
||||
@@ -321,14 +321,14 @@
|
||||
class="flex h-8 shrink-0 items-center gap-2 border-b border-gray-200 px-3 dark:border-white/6"
|
||||
>
|
||||
<button
|
||||
class="flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[11px] text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-white/6 dark:hover:text-gray-300"
|
||||
class="flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[0.6875rem] text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-white/6 dark:hover:text-gray-300"
|
||||
onclick={toggleAll}
|
||||
>
|
||||
<Icon name={anyExpanded ? 'chevron-down' : 'chevron-right'} size={12} />
|
||||
<span>{anyExpanded ? 'Collapse All' : 'Expand All'}</span>
|
||||
</button>
|
||||
<span class="text-[11px] text-gray-500 dark:text-gray-400">Uncommitted</span>
|
||||
<span class="ml-auto text-[11px] text-gray-400 dark:text-gray-600"
|
||||
<span class="text-[0.6875rem] text-gray-500 dark:text-gray-400">Uncommitted</span>
|
||||
<span class="ml-auto text-[0.6875rem] text-gray-400 dark:text-gray-600"
|
||||
>{totalChanges} {totalChanges === 1 ? 'change' : 'changes'}</span
|
||||
>
|
||||
</div>
|
||||
@@ -370,7 +370,7 @@
|
||||
: ''}"
|
||||
/>
|
||||
<span
|
||||
class="w-4 shrink-0 text-center font-mono text-[11px] font-bold {meta.className}"
|
||||
class="w-4 shrink-0 text-center font-mono text-[0.6875rem] font-bold {meta.className}"
|
||||
title={meta.label}>{meta.char}</span
|
||||
>
|
||||
<Icon name="git-diff" size={13} class="shrink-0 text-gray-400 dark:text-gray-600" />
|
||||
@@ -385,26 +385,26 @@
|
||||
>
|
||||
{#if parts.dir}
|
||||
<span
|
||||
class="hidden truncate text-[11px] text-gray-400 dark:text-gray-600 sm:inline"
|
||||
class="hidden truncate text-[0.6875rem] text-gray-400 dark:text-gray-600 sm:inline"
|
||||
>{parts.dir}</span
|
||||
>
|
||||
{/if}
|
||||
</div>
|
||||
{#if file.additions > 0}
|
||||
<span
|
||||
class="shrink-0 font-mono text-[11px] font-medium text-green-600 dark:text-green-400"
|
||||
class="shrink-0 font-mono text-[0.6875rem] font-medium text-green-600 dark:text-green-400"
|
||||
>+{file.additions}</span
|
||||
>
|
||||
{/if}
|
||||
{#if file.deletions > 0}
|
||||
<span
|
||||
class="shrink-0 font-mono text-[11px] font-medium text-red-500 dark:text-red-400"
|
||||
class="shrink-0 font-mono text-[0.6875rem] font-medium text-red-500 dark:text-red-400"
|
||||
>-{file.deletions}</span
|
||||
>
|
||||
{/if}
|
||||
|
||||
<span
|
||||
class="shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium text-rose-500 bg-rose-50 dark:bg-rose-500/10 dark:text-rose-300"
|
||||
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'}
|
||||
</span>
|
||||
@@ -412,14 +412,14 @@
|
||||
|
||||
{#if file.expanded}
|
||||
<div
|
||||
class="mb-1 overflow-x-auto border-y border-gray-100 bg-white font-mono text-[11px] leading-[18px] dark:border-white/4 dark:bg-black"
|
||||
class="mb-1 overflow-x-auto border-y border-gray-100 bg-white font-mono text-[0.6875rem] leading-[1.125rem] dark:border-white/4 dark:bg-black"
|
||||
>
|
||||
<div class="diff-content">
|
||||
{#if file.diffFiles.some((diffFile) => diffFile.hunks.length > 0)}
|
||||
{#each file.diffFiles as diffFile}
|
||||
{#if file.diffFiles.length > 1}
|
||||
<div
|
||||
class="sticky top-0 z-10 border-b border-gray-100 bg-gray-50 px-2 py-1 text-[10px] font-medium text-gray-500 dark:border-white/4 dark:bg-white/3 dark:text-gray-400"
|
||||
class="sticky top-0 z-10 border-b border-gray-100 bg-gray-50 px-2 py-1 text-[0.625rem] font-medium text-gray-500 dark:border-white/4 dark:bg-white/3 dark:text-gray-400"
|
||||
>
|
||||
{diffFile.path}
|
||||
</div>
|
||||
@@ -460,7 +460,7 @@
|
||||
{/each}
|
||||
{:else}
|
||||
<div
|
||||
class="px-3 py-8 text-center text-[11px] text-gray-400 dark:text-gray-600"
|
||||
class="px-3 py-8 text-center text-[0.6875rem] text-gray-400 dark:text-gray-600"
|
||||
>
|
||||
No textual diff available
|
||||
</div>
|
||||
@@ -483,13 +483,13 @@
|
||||
}
|
||||
|
||||
.diff-gutter-removed {
|
||||
border-left: 3px solid transparent;
|
||||
border-left: 0.1875rem solid transparent;
|
||||
border-image: repeating-linear-gradient(
|
||||
-45deg,
|
||||
#ef4444 0,
|
||||
#ef4444 1px,
|
||||
transparent 1px,
|
||||
transparent 3px
|
||||
transparent 0.1875rem
|
||||
)
|
||||
3;
|
||||
}
|
||||
|
||||
@@ -423,6 +423,4 @@
|
||||
.group-tabs-row::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
@@ -397,9 +397,15 @@
|
||||
{:else if name === 'stop'}
|
||||
<rect x="6" y="6" width="12" height="12" rx="1" fill="currentColor" />
|
||||
{:else if name === 'share'}
|
||||
<path d="M18 22C19.6569 22 21 20.6569 21 19C21 17.3431 19.6569 16 18 16C16.3431 16 15 17.3431 15 19C15 20.6569 16.3431 22 18 22Z" />
|
||||
<path d="M18 8C19.6569 8 21 6.65685 21 5C21 3.34315 19.6569 2 18 2C16.3431 2 15 3.34315 15 5C15 6.65685 16.3431 8 18 8Z" />
|
||||
<path d="M6 15C7.65685 15 9 13.6569 9 12C9 10.3431 7.65685 9 6 9C4.34315 9 3 10.3431 3 12C3 13.6569 4.34315 15 6 15Z" />
|
||||
<path
|
||||
d="M18 22C19.6569 22 21 20.6569 21 19C21 17.3431 19.6569 16 18 16C16.3431 16 15 17.3431 15 19C15 20.6569 16.3431 22 18 22Z"
|
||||
/>
|
||||
<path
|
||||
d="M18 8C19.6569 8 21 6.65685 21 5C21 3.34315 19.6569 2 18 2C16.3431 2 15 3.34315 15 5C15 6.65685 16.3431 8 18 8Z"
|
||||
/>
|
||||
<path
|
||||
d="M6 15C7.65685 15 9 13.6569 9 12C9 10.3431 7.65685 9 6 9C4.34315 9 3 10.3431 3 12C3 13.6569 4.34315 15 6 15Z"
|
||||
/>
|
||||
<path d="M15.5 6.5L8.5 10.5" />
|
||||
<path d="M8.5 13.5L15.5 17.5" />
|
||||
{:else if name === 'wifi-off'}
|
||||
|
||||
@@ -9,6 +9,6 @@
|
||||
</script>
|
||||
|
||||
<span
|
||||
class="inline-flex items-center justify-center h-[18px] px-[5px] rounded-full text-[10px] font-medium leading-none bg-[#e8e8e8] text-[#555] dark:bg-[#1e1e1e] dark:text-[#999] {className}"
|
||||
class="inline-flex items-center justify-center h-[1.125rem] px-[0.3125rem] rounded-full text-[0.625rem] font-medium leading-none bg-[#e8e8e8] text-[#555] dark:bg-[#1e1e1e] dark:text-[#999] {className}"
|
||||
>{text}</span
|
||||
>
|
||||
@@ -23,11 +23,7 @@
|
||||
<svelte:window onkeydown={handleKeydown} />
|
||||
|
||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
||||
<div
|
||||
class="fixed inset-0 z-[100] flex {overlayClass}"
|
||||
onmousedown={onclose}
|
||||
onkeydown={() => {}}
|
||||
>
|
||||
<div class="fixed inset-0 z-[100] flex {overlayClass}" onmousedown={onclose} onkeydown={() => {}}>
|
||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
||||
<div
|
||||
class="bg-white dark:bg-[#0a0a0a] dark:border dark:border-white/8 rounded-3xl overflow-visible shadow-2xl {className}"
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
<div class="min-w-0">
|
||||
{#if title}
|
||||
<div
|
||||
class="text-[13px] font-medium mb-0.5 overflow-hidden text-ellipsis whitespace-nowrap text-gray-900 dark:text-white"
|
||||
class="text-[0.8125rem] font-medium mb-0.5 overflow-hidden text-ellipsis whitespace-nowrap text-gray-900 dark:text-white"
|
||||
>
|
||||
{title}
|
||||
</div>
|
||||
@@ -105,6 +105,6 @@
|
||||
|
||||
<style>
|
||||
.notification-toast {
|
||||
min-width: var(--width, 300px);
|
||||
min-width: var(--width, 18.75rem);
|
||||
}
|
||||
</style>
|
||||
@@ -67,14 +67,14 @@
|
||||
<span class="text-xs font-medium font-mono text-gray-700 dark:text-gray-200"
|
||||
>:{port.port}</span
|
||||
>
|
||||
<span class="text-[11px] text-gray-400">({port.process})</span>
|
||||
<span class="text-[0.6875rem] text-gray-400">({port.process})</span>
|
||||
{#if terminalLabel(port.session_id)}
|
||||
<span class="text-[10px] text-gray-400 italic"
|
||||
<span class="text-[0.625rem] text-gray-400 italic"
|
||||
>{$t('port.via', { name: terminalLabel(port.session_id) })}</span
|
||||
>
|
||||
{/if}
|
||||
<button
|
||||
class="ml-1 px-2 py-0.5 rounded text-[11px] font-medium text-white bg-blue-500 hover:bg-blue-600 transition-colors duration-100 shrink-0"
|
||||
class="ml-1 px-2 py-0.5 rounded text-[0.6875rem] font-medium text-white bg-blue-500 hover:bg-blue-600 transition-colors duration-100 shrink-0"
|
||||
onclick={() => preview(port)}>{$t('port.preview')}</button
|
||||
>
|
||||
<button
|
||||
@@ -95,7 +95,7 @@
|
||||
|
||||
@keyframes slideIn {
|
||||
from {
|
||||
transform: translateY(6px);
|
||||
transform: translateY(0.375rem);
|
||||
opacity: 0;
|
||||
}
|
||||
to {
|
||||
|
||||
@@ -211,9 +211,9 @@
|
||||
.preview-toolbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
height: 32px;
|
||||
padding: 0 6px;
|
||||
gap: 0.25rem;
|
||||
height: 2rem;
|
||||
padding: 0 0.375rem;
|
||||
border-bottom: 1px solid var(--color-gray-200);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
@@ -226,9 +226,9 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
border-radius: 4px;
|
||||
width: 1.375rem;
|
||||
height: 1.375rem;
|
||||
border-radius: 0.25rem;
|
||||
color: var(--color-gray-500);
|
||||
transition: all 0.1s;
|
||||
flex-shrink: 0;
|
||||
@@ -265,9 +265,9 @@
|
||||
.url-input {
|
||||
width: 100%;
|
||||
border: 1px solid var(--color-gray-200);
|
||||
border-radius: 9999px;
|
||||
padding: 3px 12px;
|
||||
font-size: 11px;
|
||||
border-radius: 624.9375rem;
|
||||
padding: 0.1875rem 0.75rem;
|
||||
font-size: 0.6875rem;
|
||||
font-family: var(--font-mono);
|
||||
background: white;
|
||||
color: var(--color-gray-600);
|
||||
@@ -277,7 +277,7 @@
|
||||
|
||||
.url-input:focus {
|
||||
border-color: oklch(0.65 0.15 250);
|
||||
box-shadow: 0 0 0 2px oklch(0.65 0.15 250 / 0.15);
|
||||
box-shadow: 0 0 0 0.125rem oklch(0.65 0.15 250 / 0.15);
|
||||
}
|
||||
|
||||
:global(.dark) .url-input {
|
||||
@@ -288,11 +288,11 @@
|
||||
|
||||
:global(.dark) .url-input:focus {
|
||||
border-color: oklch(0.65 0.15 250);
|
||||
box-shadow: 0 0 0 2px oklch(0.65 0.15 250 / 0.1);
|
||||
box-shadow: 0 0 0 0.125rem oklch(0.65 0.15 250 / 0.1);
|
||||
}
|
||||
|
||||
.loading-track {
|
||||
height: 2px;
|
||||
height: 0.125rem;
|
||||
background: var(--color-gray-100);
|
||||
flex-shrink: 0;
|
||||
overflow: hidden;
|
||||
@@ -305,7 +305,7 @@
|
||||
.loading-bar {
|
||||
height: 100%;
|
||||
background: oklch(0.65 0.15 250);
|
||||
border-radius: 9999px;
|
||||
border-radius: 624.9375rem;
|
||||
animation: loading-bar 1.5s ease-in-out infinite;
|
||||
}
|
||||
|
||||
@@ -343,26 +343,26 @@
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
gap: 6px;
|
||||
gap: 0.375rem;
|
||||
}
|
||||
|
||||
.error-title {
|
||||
font-size: 14px;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
color: var(--color-gray-500);
|
||||
}
|
||||
|
||||
.error-sub {
|
||||
font-size: 12px;
|
||||
font-size: 0.75rem;
|
||||
color: var(--color-gray-400);
|
||||
font-family: var(--font-mono);
|
||||
}
|
||||
|
||||
.error-retry {
|
||||
margin-top: 8px;
|
||||
padding: 4px 14px;
|
||||
border-radius: 6px;
|
||||
font-size: 12px;
|
||||
margin-top: 0.5rem;
|
||||
padding: 0.25rem 0.875rem;
|
||||
border-radius: 0.375rem;
|
||||
font-size: 0.75rem;
|
||||
background: var(--color-gray-100);
|
||||
color: var(--color-gray-600);
|
||||
transition: all 0.1s;
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
|
||||
<Modal
|
||||
{onclose}
|
||||
class="w-full max-w-[520px] mx-4 max-md:mx-0 max-md:rounded-none max-h-[400px] max-md:max-h-dvh flex flex-col mb-[6vh] max-md:mb-0"
|
||||
class="w-full max-w-[32.5rem] mx-4 max-md:mx-0 max-md:rounded-none max-h-[25rem] max-md:max-h-dvh flex flex-col mb-[6vh] max-md:mb-0"
|
||||
>
|
||||
<div class="flex items-center px-4 py-2.5 gap-2.5 border-b border-gray-200 dark:border-white/6">
|
||||
<Icon name="search" size={14} class="text-gray-400 shrink-0" />
|
||||
@@ -89,7 +89,7 @@
|
||||
bind:value={query}
|
||||
/>
|
||||
<span
|
||||
class="text-[10px] font-mono font-medium px-1.5 py-0.5 rounded bg-gray-100 dark:bg-white/6 text-gray-400 shrink-0"
|
||||
class="text-[0.625rem] font-mono font-medium px-1.5 py-0.5 rounded bg-gray-100 dark:bg-white/6 text-gray-400 shrink-0"
|
||||
>ESC</span
|
||||
>
|
||||
</div>
|
||||
@@ -111,7 +111,8 @@
|
||||
class="shrink-0 text-gray-400"
|
||||
/>
|
||||
<span class="text-xs font-medium shrink-0">{r.name}</span>
|
||||
<span class="text-[11px] text-gray-400 overflow-hidden text-ellipsis whitespace-nowrap"
|
||||
<span
|
||||
class="text-[0.6875rem] text-gray-400 overflow-hidden text-ellipsis whitespace-nowrap"
|
||||
>{relativePath(r.path)}</span
|
||||
>
|
||||
</button>
|
||||
|
||||
@@ -128,7 +128,7 @@
|
||||
>
|
||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
||||
<div
|
||||
class="w-full max-w-[520px] mx-4 bg-white dark:bg-[#111] dark:border dark:border-white/8 rounded-3xl overflow-hidden shadow-2xl max-h-[420px] flex flex-col"
|
||||
class="w-full max-w-[32.5rem] mx-4 bg-white dark:bg-[#111] dark:border dark:border-white/8 rounded-3xl overflow-hidden shadow-2xl max-h-[26.25rem] flex flex-col"
|
||||
onmousedown={(e) => e.stopPropagation()}
|
||||
onkeydown={() => {}}
|
||||
>
|
||||
@@ -145,7 +145,7 @@
|
||||
autocomplete="off"
|
||||
/>
|
||||
<span
|
||||
class="text-[10px] font-mono font-medium px-1.5 py-0.5 rounded bg-gray-100 dark:bg-white/6 text-gray-400 shrink-0"
|
||||
class="text-[0.625rem] font-mono font-medium px-1.5 py-0.5 rounded bg-gray-100 dark:bg-white/6 text-gray-400 shrink-0"
|
||||
>ESC</span
|
||||
>
|
||||
</div>
|
||||
@@ -163,12 +163,12 @@
|
||||
<Icon name="chevron-left" size={13} />
|
||||
</button>
|
||||
{/if}
|
||||
<span class="flex-1 text-[11px] text-gray-400 dark:text-gray-500 font-mono truncate"
|
||||
<span class="flex-1 text-[0.6875rem] text-gray-400 dark:text-gray-500 font-mono truncate"
|
||||
>{currentPath}</span
|
||||
>
|
||||
<label class="flex items-center gap-1.5 cursor-pointer select-none shrink-0">
|
||||
<input type="checkbox" bind:checked={showHidden} class="w-3 h-3 rounded accent-gray-500" />
|
||||
<span class="text-[10px] text-gray-400">{$t('saveDialog.hidden')}</span>
|
||||
<span class="text-[0.625rem] text-gray-400">{$t('saveDialog.hidden')}</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
@@ -221,7 +221,7 @@
|
||||
>
|
||||
{#if fileName.trim()}
|
||||
<span
|
||||
class="flex-1 text-[11px] text-gray-400 dark:text-gray-600 font-mono truncate min-w-0"
|
||||
class="flex-1 text-[0.6875rem] text-gray-400 dark:text-gray-600 font-mono truncate min-w-0"
|
||||
title={savePath}>{savePath}</span
|
||||
>
|
||||
{:else}
|
||||
|
||||
@@ -208,7 +208,7 @@
|
||||
|
||||
<Modal
|
||||
{onclose}
|
||||
class="w-full max-w-[560px] mx-4 max-md:mx-0 max-md:rounded-none max-h-[480px] max-md:max-h-dvh flex flex-col mb-[6vh] max-md:mb-0"
|
||||
class="w-full max-w-[35rem] mx-4 max-md:mx-0 max-md:rounded-none max-h-[30rem] max-md:max-h-dvh flex flex-col mb-[6vh] max-md:mb-0"
|
||||
>
|
||||
<!-- Search input -->
|
||||
<div class="flex items-center px-3.5 py-3 gap-2">
|
||||
@@ -227,7 +227,7 @@
|
||||
{#if showingRecents && filteredRecents.length > 0}
|
||||
<!-- Recent chats (empty query) -->
|
||||
<div
|
||||
class="text-[10px] font-medium uppercase tracking-wide text-gray-400 dark:text-gray-600 px-2 pt-1 pb-0.5"
|
||||
class="text-[0.625rem] font-medium uppercase tracking-wide text-gray-400 dark:text-gray-600 px-2 pt-1 pb-0.5"
|
||||
>
|
||||
{$t('search.recentChats')}
|
||||
</div>
|
||||
@@ -248,7 +248,7 @@
|
||||
class="shrink-0 opacity-0 group-hover:opacity-100 transition-opacity duration-100"
|
||||
/>
|
||||
{/if}
|
||||
<span class="text-[10px] text-gray-400 dark:text-gray-600 shrink-0"
|
||||
<span class="text-[0.625rem] text-gray-400 dark:text-gray-600 shrink-0"
|
||||
>{getWorkspaceDisplayName(chat.workspace)}</span
|
||||
>
|
||||
</button>
|
||||
@@ -261,7 +261,7 @@
|
||||
{#if displayedChats.length > 0}
|
||||
<!-- Chat search results -->
|
||||
<div
|
||||
class="text-[10px] font-medium uppercase tracking-wide text-gray-400 dark:text-gray-600 px-2 pt-1 pb-0.5"
|
||||
class="text-[0.625rem] font-medium uppercase tracking-wide text-gray-400 dark:text-gray-600 px-2 pt-1 pb-0.5"
|
||||
>
|
||||
{$t('search.chats')}
|
||||
</div>
|
||||
@@ -279,17 +279,17 @@
|
||||
<div class="flex-1 min-w-0">
|
||||
<div class="flex items-center gap-2">
|
||||
<span class="text-xs font-medium truncate">{chat.title}</span>
|
||||
<span class="text-[10px] text-gray-400 dark:text-gray-600 shrink-0"
|
||||
<span class="text-[0.625rem] text-gray-400 dark:text-gray-600 shrink-0"
|
||||
>{relativeTime(chat.updated_at)}</span
|
||||
>
|
||||
</div>
|
||||
{#if chat.snippet}
|
||||
<div class="text-[11px] text-gray-400 dark:text-gray-600 truncate mt-0.5">
|
||||
<div class="text-[0.6875rem] text-gray-400 dark:text-gray-600 truncate mt-0.5">
|
||||
{chat.snippet}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<span class="text-[10px] text-gray-400 dark:text-gray-600 shrink-0"
|
||||
<span class="text-[0.625rem] text-gray-400 dark:text-gray-600 shrink-0"
|
||||
>{getWorkspaceDisplayName(chat.workspace)}</span
|
||||
>
|
||||
</button>
|
||||
@@ -299,7 +299,7 @@
|
||||
{#if fileResults.length > 0}
|
||||
<!-- File search results -->
|
||||
<div
|
||||
class="text-[10px] font-medium uppercase tracking-wide text-gray-400 dark:text-gray-600 px-2 pt-1 pb-0.5 {displayedChats.length >
|
||||
class="text-[0.625rem] font-medium uppercase tracking-wide text-gray-400 dark:text-gray-600 px-2 pt-1 pb-0.5 {displayedChats.length >
|
||||
0
|
||||
? 'mt-1'
|
||||
: ''}"
|
||||
@@ -323,10 +323,11 @@
|
||||
class="shrink-0 text-gray-400"
|
||||
/>
|
||||
<span class="text-xs font-medium shrink-0">{file.name}</span>
|
||||
<span class="text-[11px] text-gray-400 overflow-hidden text-ellipsis whitespace-nowrap"
|
||||
<span
|
||||
class="text-[0.6875rem] text-gray-400 overflow-hidden text-ellipsis whitespace-nowrap"
|
||||
>{relPath(file.path, file.workspace)}</span
|
||||
>
|
||||
<span class="text-[10px] text-gray-400 dark:text-gray-600 shrink-0 ml-auto"
|
||||
<span class="text-[0.625rem] text-gray-400 dark:text-gray-600 shrink-0 ml-auto"
|
||||
>{getWorkspaceDisplayName(file.workspace)}</span
|
||||
>
|
||||
</button>
|
||||
|
||||
@@ -44,28 +44,28 @@
|
||||
{#if $appVersion}
|
||||
<button
|
||||
onclick={() => showChangelog.set(true)}
|
||||
class="text-[11px] text-gray-400 dark:text-gray-600 hover:text-gray-500 dark:hover:text-gray-400 font-mono hover:underline cursor-pointer"
|
||||
class="text-[0.6875rem] text-gray-400 dark:text-gray-600 hover:text-gray-500 dark:hover:text-gray-400 font-mono hover:underline cursor-pointer"
|
||||
>v{$appVersion}</button
|
||||
>
|
||||
{/if}
|
||||
{#if $updateAvailable}
|
||||
<span class="text-[11px] text-gray-300 dark:text-gray-600">·</span>
|
||||
<span class="text-[0.6875rem] text-gray-300 dark:text-gray-600">·</span>
|
||||
<a
|
||||
href="https://github.com/open-webui/computer/releases"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="text-[11px] text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-300 transition-colors"
|
||||
class="text-[0.6875rem] text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-300 transition-colors"
|
||||
>{$t('about.updateAvailable', { version: $latestVersion })}</a
|
||||
>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<p class="text-[13px] text-gray-500 mt-0.5 mb-4">{$t('app.tagline')}</p>
|
||||
<p class="text-[0.8125rem] text-gray-500 mt-0.5 mb-4">{$t('app.tagline')}</p>
|
||||
|
||||
<h3 class="text-xs text-gray-400 dark:text-gray-600 mb-1">
|
||||
{$t('about.license')}
|
||||
</h3>
|
||||
<p class="text-[11px] text-gray-500 leading-relaxed font-mono whitespace-pre-line">
|
||||
<p class="text-[0.6875rem] text-gray-500 leading-relaxed font-mono whitespace-pre-line">
|
||||
<a
|
||||
href="https://github.com/open-webui/computer/blob/main/LICENSE"
|
||||
target="_blank"
|
||||
@@ -79,28 +79,28 @@
|
||||
</div>
|
||||
|
||||
<div class="flex items-center gap-1.5 pt-6">
|
||||
<span class="text-[11px] text-gray-400 dark:text-gray-600 mr-1">{$t('about.share')}</span>
|
||||
<span class="text-[0.6875rem] text-gray-400 dark:text-gray-600 mr-1">{$t('about.share')}</span>
|
||||
{#each shareLinks as link, i}
|
||||
{#if i > 0}
|
||||
<span class="text-[11px] text-gray-200 dark:text-gray-700">·</span>
|
||||
<span class="text-[0.6875rem] text-gray-200 dark:text-gray-700">·</span>
|
||||
{/if}
|
||||
<a
|
||||
href={link.href}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="text-[11px] text-gray-400 hover:text-gray-600 dark:hover:text-gray-500 transition-colors"
|
||||
class="text-[0.6875rem] text-gray-400 hover:text-gray-600 dark:hover:text-gray-500 transition-colors"
|
||||
>{link.label}</a
|
||||
>
|
||||
{/each}
|
||||
<span class="text-[11px] text-gray-200 dark:text-gray-700">·</span>
|
||||
<span class="text-[0.6875rem] text-gray-200 dark:text-gray-700">·</span>
|
||||
<button
|
||||
onclick={copyLink}
|
||||
class="text-[11px] text-gray-400 hover:text-gray-600 dark:hover:text-gray-500 transition-colors cursor-pointer"
|
||||
class="text-[0.6875rem] text-gray-400 hover:text-gray-600 dark:hover:text-gray-500 transition-colors cursor-pointer"
|
||||
>
|
||||
{copied ? $t('about.copied') : $t('about.copyLink')}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<p class="text-[11px] text-gray-300 dark:text-gray-700 pt-4">
|
||||
<p class="text-[0.6875rem] text-gray-300 dark:text-gray-700 pt-4">
|
||||
{$t('about.createdBy')}
|
||||
</p>
|
||||
@@ -170,14 +170,14 @@
|
||||
>
|
||||
<div class="flex items-center gap-2">
|
||||
<button
|
||||
class="text-[11px] text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors duration-100"
|
||||
class="text-[0.6875rem] text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors duration-100"
|
||||
onclick={handleAvatarSelect}
|
||||
disabled={uploadingAvatar}>{$t('account.uploadPhoto')}</button
|
||||
>
|
||||
{#if avatarUrl}
|
||||
<span class="text-gray-300 dark:text-gray-700 text-[11px]">·</span>
|
||||
<span class="text-gray-300 dark:text-gray-700 text-[0.6875rem]">·</span>
|
||||
<button
|
||||
class="text-[11px] text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors duration-100"
|
||||
class="text-[0.6875rem] text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors duration-100"
|
||||
onclick={handleAvatarDelete}
|
||||
disabled={uploadingAvatar}>{$t('account.removePhoto')}</button
|
||||
>
|
||||
@@ -192,7 +192,7 @@
|
||||
type="text"
|
||||
placeholder={$t('account.displayNamePlaceholder')}
|
||||
bind:value={displayName}
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-1 mb-5"
|
||||
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-1 mb-5"
|
||||
/>
|
||||
|
||||
<!-- Password -->
|
||||
@@ -202,19 +202,19 @@
|
||||
placeholder={$t('account.currentPassword')}
|
||||
bind:value={currentPassword}
|
||||
autocomplete="current-password"
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-1"
|
||||
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-1"
|
||||
/>
|
||||
<input
|
||||
type="password"
|
||||
placeholder={$t('account.newPassword')}
|
||||
bind:value={newPassword}
|
||||
autocomplete="new-password"
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-1"
|
||||
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-1"
|
||||
/>
|
||||
<button
|
||||
disabled={updatingPassword || !currentPassword || !newPassword}
|
||||
onclick={updatePassword}
|
||||
class="mt-2 self-start text-[13px] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100
|
||||
class="mt-2 self-start text-[0.8125rem] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100
|
||||
disabled:opacity-30 disabled:pointer-events-none"
|
||||
>
|
||||
{#if updatingPassword}
|
||||
@@ -229,7 +229,7 @@
|
||||
<button
|
||||
onclick={saveDisplayName}
|
||||
disabled={savingProfile}
|
||||
class="text-[13px] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100
|
||||
class="text-[0.8125rem] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100
|
||||
disabled:opacity-30 disabled:pointer-events-none"
|
||||
>
|
||||
{#if savingProfile}
|
||||
|
||||
@@ -128,7 +128,7 @@
|
||||
|
||||
<h3 class="text-xs text-gray-400 dark:text-gray-600 mb-2 mt-5">{$t('general.language')}</h3>
|
||||
<select
|
||||
class="w-full max-w-[200px] bg-transparent text-[13px] text-gray-700 dark:text-gray-300 outline-none py-1 cursor-pointer"
|
||||
class="w-full max-w-[12.5rem] bg-transparent text-[0.8125rem] text-gray-700 dark:text-gray-300 outline-none py-1 cursor-pointer"
|
||||
value={$locale}
|
||||
onchange={(e) => changeLocale((e.currentTarget as HTMLSelectElement).value)}
|
||||
>
|
||||
@@ -205,7 +205,7 @@
|
||||
>
|
||||
<ToggleSwitch value={$notificationsEnabled} onchange={() => toggleNotifications()} />
|
||||
</label>
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600 -mt-1">
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600 -mt-1">
|
||||
{$t('general.browserNotificationsDesc')}
|
||||
</p>
|
||||
|
||||
@@ -229,7 +229,7 @@
|
||||
placeholder="https://hooks.slack.com/services/..."
|
||||
class="w-full mt-1 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"
|
||||
/>
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600 mt-1">
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600 mt-1">
|
||||
{$t('general.webhookUrlHint')}
|
||||
</p>
|
||||
</div>
|
||||
@@ -243,7 +243,7 @@
|
||||
>
|
||||
<ToggleSwitch value={$showUpdateToastPref} onchange={(v) => showUpdateToastPref.set(v)} />
|
||||
</label>
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600 mt-1">
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600 mt-1">
|
||||
{$t('general.updateNotificationsDesc')}
|
||||
</p>
|
||||
{/if}
|
||||
@@ -262,14 +262,14 @@
|
||||
</button>
|
||||
{/each}
|
||||
</div>
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600 mt-1">
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600 mt-1">
|
||||
{$streamingBehavior === 'queue' ? $t('general.queueDesc') : $t('general.interruptDesc')}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="shrink-0 pt-3 flex justify-end">
|
||||
<button
|
||||
class="text-[13px] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100
|
||||
class="text-[0.8125rem] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100
|
||||
disabled:opacity-30 disabled:pointer-events-none"
|
||||
onclick={save}
|
||||
disabled={saving}
|
||||
@@ -289,7 +289,7 @@
|
||||
|
||||
.ui-scale-range::-webkit-slider-runnable-track {
|
||||
height: 0.125rem;
|
||||
border-radius: 9999px;
|
||||
border-radius: 624.9375rem;
|
||||
background: rgb(209 213 219 / 0.7);
|
||||
}
|
||||
|
||||
@@ -298,21 +298,21 @@
|
||||
width: 0.75rem;
|
||||
height: 0.75rem;
|
||||
margin-top: -0.3125rem;
|
||||
border-radius: 9999px;
|
||||
border-radius: 624.9375rem;
|
||||
border: 1px solid rgb(156 163 175 / 0.45);
|
||||
background: rgb(255 255 255);
|
||||
}
|
||||
|
||||
.ui-scale-range::-moz-range-track {
|
||||
height: 0.125rem;
|
||||
border-radius: 9999px;
|
||||
border-radius: 624.9375rem;
|
||||
background: rgb(209 213 219 / 0.7);
|
||||
}
|
||||
|
||||
.ui-scale-range::-moz-range-thumb {
|
||||
width: 0.75rem;
|
||||
height: 0.75rem;
|
||||
border-radius: 9999px;
|
||||
border-radius: 624.9375rem;
|
||||
border: 1px solid rgb(156 163 175 / 0.45);
|
||||
background: rgb(255 255 255);
|
||||
}
|
||||
|
||||
@@ -95,15 +95,18 @@
|
||||
<div class="flex items-center justify-between mb-3">
|
||||
<h2 class="text-sm font-medium text-gray-900 dark:text-white">{$t('keyboard.title')}</h2>
|
||||
<button
|
||||
class="text-[10px] text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors duration-100"
|
||||
class="text-[0.625rem] text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors duration-100"
|
||||
onclick={resetKeybindings}>{$t('keyboard.resetDefaults')}</button
|
||||
>
|
||||
</div>
|
||||
|
||||
<!-- Column headers -->
|
||||
<div class="flex items-center gap-2 mb-0.5 px-1">
|
||||
<span class="flex-1 text-[10px] font-medium text-gray-400 dark:text-gray-600">{$t('keyboard.command')}</span>
|
||||
<span class="w-[140px] text-[10px] font-medium text-gray-400 dark:text-gray-600 text-right"
|
||||
<span class="flex-1 text-[0.625rem] font-medium text-gray-400 dark:text-gray-600"
|
||||
>{$t('keyboard.command')}</span
|
||||
>
|
||||
<span
|
||||
class="w-[8.75rem] text-[0.625rem] font-medium text-gray-400 dark:text-gray-600 text-right"
|
||||
>{$t('keyboard.keybinding')}</span
|
||||
>
|
||||
</div>
|
||||
@@ -116,15 +119,15 @@
|
||||
|
||||
<div class="shortcut-row">
|
||||
<div class="flex-1 min-w-0">
|
||||
<div class="text-[11.5px] text-gray-700 dark:text-gray-300">
|
||||
<div class="text-[0.71875rem] text-gray-700 dark:text-gray-300">
|
||||
{ACTION_LABELS[actionId]}
|
||||
</div>
|
||||
<div class="text-[10px] text-gray-400 dark:text-gray-600 truncate leading-tight">
|
||||
<div class="text-[0.625rem] text-gray-400 dark:text-gray-600 truncate leading-tight">
|
||||
{ACTION_DESCRIPTIONS[actionId]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="w-[140px] flex items-center justify-end shrink-0">
|
||||
<div class="w-[8.75rem] flex items-center justify-end shrink-0">
|
||||
{#if isRecording}
|
||||
<span class="recording-indicator">{$t('keyboard.pressKeys')}</span>
|
||||
{:else if chord}
|
||||
@@ -137,14 +140,14 @@
|
||||
</button>
|
||||
{:else}
|
||||
<button
|
||||
class="text-[10px] text-gray-500 dark:text-gray-600 cursor-pointer hover:text-gray-400 transition-colors duration-75"
|
||||
class="text-[0.625rem] text-gray-500 dark:text-gray-600 cursor-pointer hover:text-gray-400 transition-colors duration-75"
|
||||
onclick={() => startRecording(actionId)}>{$t('keyboard.unassigned')}</button
|
||||
>
|
||||
{/if}
|
||||
|
||||
{#if conflict}
|
||||
<span
|
||||
class="text-[9px] text-amber-500 ml-1"
|
||||
class="text-[0.5625rem] text-amber-500 ml-1"
|
||||
title={$t('keyboard.conflict', { action: ACTION_LABELS[conflict] })}>!</span
|
||||
>
|
||||
{/if}
|
||||
@@ -153,7 +156,7 @@
|
||||
{/each}
|
||||
</div>
|
||||
|
||||
<p class="text-[10px] text-gray-400 dark:text-gray-600 mt-3">
|
||||
<p class="text-[0.625rem] text-gray-400 dark:text-gray-600 mt-3">
|
||||
{$t('keyboard.rebindHint')}
|
||||
</p>
|
||||
</div>
|
||||
@@ -173,10 +176,10 @@
|
||||
.recording-indicator {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
height: 18px;
|
||||
padding: 0 8px;
|
||||
border-radius: 4px;
|
||||
font-size: 10px;
|
||||
height: 1.125rem;
|
||||
padding: 0 0.5rem;
|
||||
border-radius: 0.25rem;
|
||||
font-size: 0.625rem;
|
||||
font-weight: 500;
|
||||
background: rgba(59, 130, 246, 0.1);
|
||||
color: rgba(59, 130, 246, 0.7);
|
||||
@@ -194,6 +197,6 @@
|
||||
}
|
||||
|
||||
.kbd-inline {
|
||||
@apply inline px-0.5 py-px rounded text-[9px] font-mono bg-gray-100 dark:bg-white/6 text-gray-500;
|
||||
@apply inline px-0.5 py-px rounded text-[0.5625rem] font-mono bg-gray-100 dark:bg-white/6 text-gray-500;
|
||||
}
|
||||
</style>
|
||||
@@ -153,7 +153,7 @@
|
||||
</button>
|
||||
</div>
|
||||
{/each}
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600 -mt-1">{userUsage}</p>
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600 -mt-1">{userUsage}</p>
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
@@ -161,7 +161,7 @@
|
||||
|
||||
<div class="shrink-0 pt-3 flex justify-end">
|
||||
<button
|
||||
class="text-[13px] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100 disabled:opacity-50"
|
||||
class="text-[0.8125rem] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100 disabled:opacity-50"
|
||||
onclick={saveSettings}
|
||||
disabled={saving}
|
||||
>
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
|
||||
<h3 class="text-xs text-gray-400 dark:text-gray-600 mb-2">{tr('pwa.shareBehavior')}</h3>
|
||||
<select
|
||||
class="w-full max-w-[200px] bg-transparent text-[13px] text-gray-700 dark:text-gray-300 outline-none py-1 cursor-pointer"
|
||||
class="w-full max-w-[12.5rem] bg-transparent text-[0.8125rem] text-gray-700 dark:text-gray-300 outline-none py-1 cursor-pointer"
|
||||
value={$pwaPreferences.shareBehavior}
|
||||
onchange={updateShareBehavior}
|
||||
>
|
||||
@@ -63,7 +63,7 @@
|
||||
|
||||
<h3 class="text-xs text-gray-400 dark:text-gray-600 mb-2 mt-5">{tr('pwa.fileImports')}</h3>
|
||||
<select
|
||||
class="w-full max-w-[200px] bg-transparent text-[13px] text-gray-700 dark:text-gray-300 outline-none py-1 cursor-pointer"
|
||||
class="w-full max-w-[12.5rem] bg-transparent text-[0.8125rem] text-gray-700 dark:text-gray-300 outline-none py-1 cursor-pointer"
|
||||
value={$pwaPreferences.importDestination}
|
||||
onchange={updateImportDestination}
|
||||
>
|
||||
@@ -73,7 +73,7 @@
|
||||
</select>
|
||||
{#if $pwaPreferences.importDestination === 'configuredFolder'}
|
||||
<input
|
||||
class="mt-2 w-full h-8 bg-gray-100 dark:bg-white/6 rounded-lg px-2 text-[13px] text-gray-700 dark:text-gray-300 outline-none"
|
||||
class="mt-2 w-full h-8 bg-gray-100 dark:bg-white/6 rounded-lg px-2 text-[0.8125rem] text-gray-700 dark:text-gray-300 outline-none"
|
||||
placeholder={tr('pwa.importFolderPlaceholder')}
|
||||
value={$pwaPreferences.importFolder ?? ''}
|
||||
oninput={(e) =>
|
||||
@@ -83,13 +83,13 @@
|
||||
|
||||
<h3 class="text-xs text-gray-400 dark:text-gray-600 mb-2 mt-5">{tr('pwa.resetTitle')}</h3>
|
||||
<button
|
||||
class="text-[13px] text-gray-500 dark:text-gray-500 hover:text-gray-900 dark:hover:text-white transition-colors disabled:opacity-40 disabled:pointer-events-none"
|
||||
class="text-[0.8125rem] text-gray-500 dark:text-gray-500 hover:text-gray-900 dark:hover:text-white transition-colors disabled:opacity-40 disabled:pointer-events-none"
|
||||
onclick={resetPwa}
|
||||
disabled={resetting}
|
||||
>
|
||||
{resetting ? tr('pwa.resetting') : tr('pwa.reset')}
|
||||
</button>
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600 mt-1">
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600 mt-1">
|
||||
{tr('pwa.resetDesc')}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -121,10 +121,10 @@
|
||||
|
||||
<Modal
|
||||
{onclose}
|
||||
class="w-full max-w-3xl mx-4 md:mx-0 flex flex-col md:flex-row max-h-[85vh] md:h-[560px]"
|
||||
class="w-full max-w-3xl mx-4 md:mx-0 flex flex-col md:flex-row max-h-[85vh] md:h-[35rem]"
|
||||
>
|
||||
<nav
|
||||
class="shrink-0 min-w-0 md:min-h-0 overflow-x-auto md:overflow-x-hidden md:overflow-y-auto scrollbar-none border-b md:border-b-0 md:border-r border-gray-200 dark:border-white/6 md:w-[180px]"
|
||||
class="shrink-0 min-w-0 md:min-h-0 overflow-x-auto md:overflow-x-hidden md:overflow-y-auto scrollbar-none border-b md:border-b-0 md:border-r border-gray-200 dark:border-white/6 md:w-[11.25rem]"
|
||||
>
|
||||
<div class="flex w-max min-w-full md:w-auto md:min-w-0 md:flex-col p-1 gap-px">
|
||||
<button
|
||||
@@ -151,7 +151,8 @@
|
||||
|
||||
<!-- Admin section -->
|
||||
{#if isAdmin}
|
||||
<span class="hidden md:block text-[10px] text-gray-400 dark:text-gray-600 px-2 mt-2 mb-0.5"
|
||||
<span
|
||||
class="hidden md:block text-[0.625rem] text-gray-400 dark:text-gray-600 px-2 mt-2 mb-0.5"
|
||||
>{$t('sidebar.admin')}</span
|
||||
>
|
||||
|
||||
|
||||
@@ -109,12 +109,12 @@
|
||||
<h1 class="text-lg tracking-tight text-gray-900 dark:text-white mb-1">
|
||||
{$t('onboarding.welcomeTitle')}
|
||||
</h1>
|
||||
<p class="text-[13px] text-gray-500 dark:text-gray-500 mb-6 leading-relaxed">
|
||||
<p class="text-[0.8125rem] text-gray-500 dark:text-gray-500 mb-6 leading-relaxed">
|
||||
{$t('onboarding.welcomeDesc')}
|
||||
</p>
|
||||
|
||||
<button
|
||||
class="text-[13px] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100"
|
||||
class="text-[0.8125rem] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100"
|
||||
onclick={next}
|
||||
>
|
||||
{$t('onboarding.getStarted')}
|
||||
@@ -126,18 +126,18 @@
|
||||
<h2 class="text-xs text-gray-400 dark:text-gray-600 mb-1">
|
||||
{$t('onboarding.openFolder')}
|
||||
</h2>
|
||||
<p class="text-[13px] text-gray-500 dark:text-gray-500 mb-4 leading-relaxed">
|
||||
<p class="text-[0.8125rem] text-gray-500 dark:text-gray-500 mb-4 leading-relaxed">
|
||||
{$t('onboarding.openFolderDesc')}
|
||||
</p>
|
||||
|
||||
{#if selectedPath}
|
||||
<p class="text-[12px] font-mono text-gray-700 dark:text-gray-300 mb-3">
|
||||
<p class="text-[0.75rem] font-mono text-gray-700 dark:text-gray-300 mb-3">
|
||||
{selectedPath}
|
||||
</p>
|
||||
{/if}
|
||||
|
||||
<button
|
||||
class="text-[13px] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100"
|
||||
class="text-[0.8125rem] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100"
|
||||
onclick={() => (showPicker = true)}
|
||||
>
|
||||
{$t('onboarding.openFolder')}
|
||||
@@ -145,7 +145,7 @@
|
||||
|
||||
<div class="mt-4">
|
||||
<button
|
||||
class="text-[11px] text-gray-400 dark:text-gray-600 hover:text-gray-500 dark:hover:text-gray-400 transition-colors duration-100"
|
||||
class="text-[0.6875rem] text-gray-400 dark:text-gray-600 hover:text-gray-500 dark:hover:text-gray-400 transition-colors duration-100"
|
||||
onclick={skipFolder}
|
||||
>
|
||||
{$t('onboarding.skip')}
|
||||
@@ -164,28 +164,28 @@
|
||||
<h2 class="text-xs text-gray-400 dark:text-gray-600 mb-1">
|
||||
{$t('onboarding.connectAi')}
|
||||
</h2>
|
||||
<p class="text-[13px] text-gray-500 dark:text-gray-500 mb-4 leading-relaxed">
|
||||
<p class="text-[0.8125rem] text-gray-500 dark:text-gray-500 mb-4 leading-relaxed">
|
||||
{$t('onboarding.connectAiDesc')}
|
||||
</p>
|
||||
|
||||
{#if aiConnected}
|
||||
<p class="text-[13px] text-gray-700 dark:text-gray-300 mb-4">
|
||||
<p class="text-[0.8125rem] text-gray-700 dark:text-gray-300 mb-4">
|
||||
{$t('onboarding.connected', { name: config.name })}
|
||||
</p>
|
||||
<button
|
||||
class="text-[13px] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100"
|
||||
class="text-[0.8125rem] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100"
|
||||
onclick={next}
|
||||
>
|
||||
{$t('onboarding.next')}
|
||||
</button>
|
||||
{:else}
|
||||
<div class="mb-3">
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600 mb-0.5">
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600 mb-0.5">
|
||||
{$t('onboarding.provider')}
|
||||
</p>
|
||||
<select
|
||||
bind:value={provider}
|
||||
class="bg-transparent text-[13px] text-gray-700 dark:text-gray-300 outline-none py-0.5 border-none cursor-pointer"
|
||||
class="bg-transparent text-[0.8125rem] text-gray-700 dark:text-gray-300 outline-none py-0.5 border-none cursor-pointer"
|
||||
>
|
||||
<option value="openai">OpenAI</option>
|
||||
<option value="anthropic">Anthropic</option>
|
||||
@@ -194,12 +194,12 @@
|
||||
|
||||
{#if provider === 'openai'}
|
||||
<div class="mb-3">
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600 mb-0.5">
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600 mb-0.5">
|
||||
{$t('onboarding.apiType')}
|
||||
</p>
|
||||
<select
|
||||
bind:value={apiType}
|
||||
class="bg-transparent text-[13px] text-gray-700 dark:text-gray-300 outline-none py-0.5 border-none cursor-pointer"
|
||||
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>
|
||||
@@ -208,7 +208,7 @@
|
||||
{/if}
|
||||
|
||||
<div class="mb-3">
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600 mb-0.5">
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600 mb-0.5">
|
||||
{$t('connections.baseUrl')}
|
||||
</p>
|
||||
<input
|
||||
@@ -218,7 +218,7 @@
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
list="setup-base-url-suggestions"
|
||||
class="block w-full bg-transparent text-[13px] font-mono text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5"
|
||||
class="block w-full bg-transparent text-[0.8125rem] font-mono text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5"
|
||||
/>
|
||||
<datalist id="setup-base-url-suggestions">
|
||||
<option value="https://api.openai.com/v1" />
|
||||
@@ -229,7 +229,7 @@
|
||||
</div>
|
||||
|
||||
<div class="mb-2">
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600 mb-0.5">
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600 mb-0.5">
|
||||
{$t('connections.apiKey')}
|
||||
</p>
|
||||
<input
|
||||
@@ -237,16 +237,16 @@
|
||||
placeholder={config.placeholder}
|
||||
bind:value={apiKey}
|
||||
autocomplete="new-password"
|
||||
class="block w-full bg-transparent text-[13px] font-mono text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-1"
|
||||
class="block w-full bg-transparent text-[0.8125rem] font-mono text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-1"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<p class="text-[11px] text-gray-400 dark:text-gray-600 mb-4">
|
||||
<p class="text-[0.6875rem] text-gray-400 dark:text-gray-600 mb-4">
|
||||
{$t('onboarding.keyStaysLocal')}
|
||||
</p>
|
||||
|
||||
<button
|
||||
class="flex items-center gap-2 text-[13px] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100
|
||||
class="flex items-center gap-2 text-[0.8125rem] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100
|
||||
disabled:opacity-30 disabled:pointer-events-none"
|
||||
onclick={connectAi}
|
||||
disabled={connecting || !apiKey.trim()}
|
||||
@@ -260,7 +260,7 @@
|
||||
|
||||
<div class="mt-4">
|
||||
<button
|
||||
class="text-[11px] text-gray-400 dark:text-gray-600 hover:text-gray-500 dark:hover:text-gray-400 transition-colors duration-100"
|
||||
class="text-[0.6875rem] text-gray-400 dark:text-gray-600 hover:text-gray-500 dark:hover:text-gray-400 transition-colors duration-100"
|
||||
onclick={skipAi}
|
||||
>
|
||||
{$t('onboarding.connectAiSkip')}
|
||||
@@ -274,24 +274,24 @@
|
||||
<h2 class="text-xs text-gray-400 dark:text-gray-600 mb-1">
|
||||
{$t('onboarding.ready')}
|
||||
</h2>
|
||||
<p class="text-[13px] text-gray-500 dark:text-gray-500 mb-5 leading-relaxed">
|
||||
<p class="text-[0.8125rem] text-gray-500 dark:text-gray-500 mb-5 leading-relaxed">
|
||||
{$t('onboarding.readyDesc')}
|
||||
</p>
|
||||
|
||||
<div class="flex flex-col gap-1.5 mb-6">
|
||||
<p class="text-[12px] text-gray-500 dark:text-gray-500">
|
||||
<p class="text-[0.75rem] text-gray-500 dark:text-gray-500">
|
||||
{$t('onboarding.tipSearch', { shortcut: searchShortcut })}
|
||||
</p>
|
||||
<p class="text-[12px] text-gray-500 dark:text-gray-500">
|
||||
<p class="text-[0.75rem] text-gray-500 dark:text-gray-500">
|
||||
{$t('onboarding.tipTerminal')}
|
||||
</p>
|
||||
<p class="text-[12px] text-gray-500 dark:text-gray-500">
|
||||
<p class="text-[0.75rem] text-gray-500 dark:text-gray-500">
|
||||
{$t('onboarding.tipMobile')}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<button
|
||||
class="text-[13px] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100"
|
||||
class="text-[0.8125rem] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100"
|
||||
onclick={finish}
|
||||
>
|
||||
{$t('onboarding.startUsing')}
|
||||
@@ -326,7 +326,7 @@
|
||||
@keyframes fadeIn {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(4px);
|
||||
transform: translateY(0.25rem);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
|
||||
@@ -222,8 +222,8 @@
|
||||
.shortcut-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
padding: 4px 8px;
|
||||
gap: 0.25rem;
|
||||
padding: 0.25rem 0.5rem;
|
||||
background: var(--color-gray-100);
|
||||
border-top: 1px solid var(--color-gray-200);
|
||||
overflow-x: auto;
|
||||
@@ -241,17 +241,17 @@
|
||||
}
|
||||
|
||||
.key {
|
||||
padding: 4px 10px;
|
||||
font-size: 12px;
|
||||
padding: 0.25rem 0.625rem;
|
||||
font-size: 0.75rem;
|
||||
font-family: var(--font-mono);
|
||||
font-weight: 500;
|
||||
border-radius: 5px;
|
||||
border-radius: 0.3125rem;
|
||||
color: var(--color-gray-600);
|
||||
background: var(--color-gray-200);
|
||||
white-space: nowrap;
|
||||
flex-shrink: 0;
|
||||
transition: all 0.1s ease;
|
||||
min-width: 32px;
|
||||
min-width: 2rem;
|
||||
text-align: center;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
}
|
||||
|
||||
@@ -475,7 +475,7 @@
|
||||
e.stopPropagation();
|
||||
showChangelog.set(true);
|
||||
}}
|
||||
class="ml-auto text-[10px] text-gray-400 dark:text-gray-600 hover:text-gray-500 dark:hover:text-gray-400 font-mono hover:underline cursor-pointer"
|
||||
class="ml-auto text-[0.625rem] text-gray-400 dark:text-gray-600 hover:text-gray-500 dark:hover:text-gray-400 font-mono hover:underline cursor-pointer"
|
||||
>
|
||||
v{$appVersion}
|
||||
</button>
|
||||
@@ -562,13 +562,13 @@
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 220px;
|
||||
width: 13.75rem;
|
||||
z-index: 50;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: white;
|
||||
border-right: 1px solid var(--color-gray-200);
|
||||
padding-top: env(safe-area-inset-top, 0px);
|
||||
padding-top: env(safe-area-inset-top, 0);
|
||||
}
|
||||
|
||||
:global(.dark) .sidebar {
|
||||
@@ -580,7 +580,7 @@
|
||||
.sidebar {
|
||||
position: relative;
|
||||
z-index: auto;
|
||||
width: var(--sw, 220px);
|
||||
width: var(--sw, 13.75rem);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -592,10 +592,10 @@
|
||||
.resize-handle {
|
||||
display: block;
|
||||
position: absolute;
|
||||
right: -3px;
|
||||
right: -0.1875rem;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 6px;
|
||||
width: 0.375rem;
|
||||
cursor: col-resize;
|
||||
z-index: 10;
|
||||
transition: background 0.15s;
|
||||
@@ -610,7 +610,7 @@
|
||||
/* ── Workspace chat items ────────────────────────────── */
|
||||
|
||||
.ws-item {
|
||||
margin-bottom: 2px;
|
||||
margin-bottom: 0.125rem;
|
||||
}
|
||||
|
||||
.ws-expand-btn {
|
||||
@@ -623,8 +623,8 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
width: 0.875rem;
|
||||
height: 0.875rem;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
@@ -660,18 +660,18 @@
|
||||
}
|
||||
|
||||
.ws-chats {
|
||||
padding-left: 4px;
|
||||
padding-bottom: 4px;
|
||||
padding-left: 0.25rem;
|
||||
padding-bottom: 0.25rem;
|
||||
}
|
||||
|
||||
.ws-chat-show-more {
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding: 2px 8px;
|
||||
padding: 0.125rem 0.5rem;
|
||||
border: none;
|
||||
background: none;
|
||||
cursor: pointer;
|
||||
font-size: 11px;
|
||||
font-size: 0.6875rem;
|
||||
color: #b0b5be;
|
||||
text-align: left;
|
||||
transition: color 0.1s;
|
||||
@@ -691,13 +691,13 @@
|
||||
|
||||
.ws-chat-loading {
|
||||
display: flex;
|
||||
gap: 4px;
|
||||
padding: 6px 8px;
|
||||
gap: 0.25rem;
|
||||
padding: 0.375rem 0.5rem;
|
||||
}
|
||||
|
||||
.ws-chat-loading-dot {
|
||||
width: 4px;
|
||||
height: 4px;
|
||||
width: 0.25rem;
|
||||
height: 0.25rem;
|
||||
border-radius: 50%;
|
||||
background: #9ca3af;
|
||||
animation: dotPulse 1s ease-in-out infinite;
|
||||
|
||||
@@ -71,8 +71,8 @@
|
||||
{#if sys.cpu_usage != null}
|
||||
<div>
|
||||
<div class="flex items-center justify-between mb-1">
|
||||
<span class="text-[11px] text-gray-500 dark:text-gray-500">{$t('system.cpu')}</span>
|
||||
<span class="text-[11px] text-gray-400 dark:text-gray-600 font-mono"
|
||||
<span class="text-[0.6875rem] text-gray-500 dark:text-gray-500">{$t('system.cpu')}</span>
|
||||
<span class="text-[0.6875rem] text-gray-400 dark:text-gray-600 font-mono"
|
||||
>{sys.cpu_usage}%</span
|
||||
>
|
||||
</div>
|
||||
@@ -90,8 +90,10 @@
|
||||
{@const memPct = Math.round((memUsed / sys.memory_total) * 100)}
|
||||
<div>
|
||||
<div class="flex items-center justify-between mb-1">
|
||||
<span class="text-[11px] text-gray-500 dark:text-gray-500">{$t('system.memory')}</span>
|
||||
<span class="text-[11px] text-gray-400 dark:text-gray-600 font-mono"
|
||||
<span class="text-[0.6875rem] text-gray-500 dark:text-gray-500"
|
||||
>{$t('system.memory')}</span
|
||||
>
|
||||
<span class="text-[0.6875rem] text-gray-400 dark:text-gray-600 font-mono"
|
||||
>{formatBytes(memUsed)} / {formatBytes(sys.memory_total)}</span
|
||||
>
|
||||
</div>
|
||||
@@ -108,8 +110,8 @@
|
||||
{@const diskPct = Math.round(((sys.disk_used ?? 0) / sys.disk_total) * 100)}
|
||||
<div>
|
||||
<div class="flex items-center justify-between mb-1">
|
||||
<span class="text-[11px] text-gray-500 dark:text-gray-500">{$t('system.disk')}</span>
|
||||
<span class="text-[11px] text-gray-400 dark:text-gray-600 font-mono"
|
||||
<span class="text-[0.6875rem] text-gray-500 dark:text-gray-500">{$t('system.disk')}</span>
|
||||
<span class="text-[0.6875rem] text-gray-400 dark:text-gray-600 font-mono"
|
||||
>{formatBytes(sys.disk_used ?? 0)} / {formatBytes(sys.disk_total)}</span
|
||||
>
|
||||
</div>
|
||||
@@ -122,7 +124,9 @@
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div class="flex items-center gap-4 text-[11px] text-gray-400 dark:text-gray-600 font-mono">
|
||||
<div
|
||||
class="flex items-center gap-4 text-[0.6875rem] text-gray-400 dark:text-gray-600 font-mono"
|
||||
>
|
||||
<span>{$t('system.cores', { count: sys.cpu_count })}</span>
|
||||
<span>{sys.arch}</span>
|
||||
{#if sys.uptime_seconds}
|
||||
@@ -135,7 +139,7 @@
|
||||
|
||||
{#if sys.network?.length}
|
||||
<div
|
||||
class="flex flex-wrap gap-x-4 gap-y-0.5 text-[11px] font-mono text-gray-400 dark:text-gray-600"
|
||||
class="flex flex-wrap gap-x-4 gap-y-0.5 text-[0.6875rem] font-mono text-gray-400 dark:text-gray-600"
|
||||
>
|
||||
{#each sys.network as iface}
|
||||
<span>{iface.name} {iface.ip}</span>
|
||||
@@ -144,7 +148,7 @@
|
||||
{/if}
|
||||
|
||||
{#if processes.length}
|
||||
<div class="mt-1 font-mono text-[11px]">
|
||||
<div class="mt-1 font-mono text-[0.6875rem]">
|
||||
<div class="flex items-center gap-2 text-gray-400 dark:text-gray-600 mb-1">
|
||||
<span class="w-14 text-right">{$t('system.cpuShort')}</span>
|
||||
<span class="w-12 text-right">{$t('system.memoryShort')}</span>
|
||||
|
||||
@@ -47,13 +47,13 @@
|
||||
});
|
||||
</script>
|
||||
|
||||
<Modal {onclose} class="w-full max-w-[420px] mx-4">
|
||||
<Modal {onclose} class="w-full max-w-[26.25rem] mx-4">
|
||||
<div class="px-4 py-3.5">
|
||||
<div class="mb-3 flex items-baseline justify-between gap-3">
|
||||
<div class="min-w-0">
|
||||
<h2 class="text-sm font-medium text-gray-900 dark:text-white">{$t('system.infoTitle')}</h2>
|
||||
{#if welcomeData?.hostname}
|
||||
<p class="mt-0.5 truncate font-mono text-[11px] text-gray-400 dark:text-gray-600">
|
||||
<p class="mt-0.5 truncate font-mono text-[0.6875rem] text-gray-400 dark:text-gray-600">
|
||||
{welcomeData.hostname}
|
||||
</p>
|
||||
{/if}
|
||||
|
||||
@@ -6,14 +6,14 @@
|
||||
|
||||
// ── Compact binary WebSocket protocol ─────────────────────
|
||||
// Client → Server: byte 0 = type, rest = payload
|
||||
// 0x00 + raw input bytes (microtask-batched for throughput)
|
||||
// 0x02 + uint16 cols + uint16 rows, big-endian (5 bytes total)
|
||||
// 0x03 stop, 0x04 force stop
|
||||
// Server → Client: raw PTY output bytes (no prefix)
|
||||
const MSG_INPUT = 0;
|
||||
const MSG_RESIZE = 2;
|
||||
const MSG_STOP = 3;
|
||||
const MSG_FORCE_STOP = 4;
|
||||
// 0x00 + raw input bytes (microtask-batched for throughput)
|
||||
// 0x02 + uint16 cols + uint16 rows, big-endian (5 bytes total)
|
||||
// 0x03 stop, 0x04 force stop
|
||||
// Server → Client: raw PTY output bytes (no prefix)
|
||||
const MSG_INPUT = 0;
|
||||
const MSG_RESIZE = 2;
|
||||
const MSG_STOP = 3;
|
||||
const MSG_FORCE_STOP = 4;
|
||||
|
||||
const textEncoder = new TextEncoder();
|
||||
|
||||
@@ -38,24 +38,24 @@ const MSG_FORCE_STOP = 4;
|
||||
}
|
||||
|
||||
interface Props {
|
||||
sessionId?: string;
|
||||
wsPath?: string;
|
||||
initialOutput?: string;
|
||||
initialOffset?: number;
|
||||
stopSignal?: number;
|
||||
forceStopSignal?: number;
|
||||
readOnly?: boolean;
|
||||
}
|
||||
sessionId?: string;
|
||||
wsPath?: string;
|
||||
initialOutput?: string;
|
||||
initialOffset?: number;
|
||||
stopSignal?: number;
|
||||
forceStopSignal?: number;
|
||||
readOnly?: boolean;
|
||||
}
|
||||
|
||||
let {
|
||||
sessionId = '',
|
||||
wsPath = '',
|
||||
initialOutput = '',
|
||||
initialOffset = 0,
|
||||
stopSignal = 0,
|
||||
forceStopSignal = 0,
|
||||
readOnly = false
|
||||
}: Props = $props();
|
||||
let {
|
||||
sessionId = '',
|
||||
wsPath = '',
|
||||
initialOutput = '',
|
||||
initialOffset = 0,
|
||||
stopSignal = 0,
|
||||
forceStopSignal = 0,
|
||||
readOnly = false
|
||||
}: Props = $props();
|
||||
|
||||
let containerEl: HTMLDivElement | undefined = $state();
|
||||
let term: Terminal | null = null;
|
||||
@@ -211,23 +211,23 @@ let {
|
||||
ws!.send(resizeBuf);
|
||||
}
|
||||
|
||||
let lastStopSignal = 0;
|
||||
$effect(() => {
|
||||
if (!stopSignal || stopSignal === lastStopSignal) return;
|
||||
lastStopSignal = stopSignal;
|
||||
if (ws?.readyState === WebSocket.OPEN) {
|
||||
ws.send(new Uint8Array([MSG_STOP]));
|
||||
}
|
||||
});
|
||||
let lastStopSignal = 0;
|
||||
$effect(() => {
|
||||
if (!stopSignal || stopSignal === lastStopSignal) return;
|
||||
lastStopSignal = stopSignal;
|
||||
if (ws?.readyState === WebSocket.OPEN) {
|
||||
ws.send(new Uint8Array([MSG_STOP]));
|
||||
}
|
||||
});
|
||||
|
||||
let lastForceStopSignal = 0;
|
||||
$effect(() => {
|
||||
if (!forceStopSignal || forceStopSignal === lastForceStopSignal) return;
|
||||
lastForceStopSignal = forceStopSignal;
|
||||
if (ws?.readyState === WebSocket.OPEN) {
|
||||
ws.send(new Uint8Array([MSG_FORCE_STOP]));
|
||||
}
|
||||
});
|
||||
let lastForceStopSignal = 0;
|
||||
$effect(() => {
|
||||
if (!forceStopSignal || forceStopSignal === lastForceStopSignal) return;
|
||||
lastForceStopSignal = forceStopSignal;
|
||||
if (ws?.readyState === WebSocket.OPEN) {
|
||||
ws.send(new Uint8Array([MSG_FORCE_STOP]));
|
||||
}
|
||||
});
|
||||
|
||||
$effect(() => {
|
||||
if (term) term.options.disableStdin = readOnly;
|
||||
|
||||
@@ -7,15 +7,11 @@
|
||||
let { onclose }: { onclose: () => void } = $props();
|
||||
</script>
|
||||
|
||||
<div
|
||||
class="fixed bottom-4 right-4 z-50"
|
||||
in:fade={{ duration: 100 }}
|
||||
out:fade={{ duration: 75 }}
|
||||
>
|
||||
<div class="fixed bottom-4 right-4 z-50" in:fade={{ duration: 100 }} out:fade={{ duration: 75 }}>
|
||||
<div
|
||||
class="flex items-center gap-2 rounded-lg border border-gray-200 dark:border-white/6 bg-white dark:bg-[#1a1a1a] px-3 py-2"
|
||||
>
|
||||
<span class="text-[11px] text-gray-500 dark:text-gray-400">
|
||||
<span class="text-[0.6875rem] text-gray-500 dark:text-gray-400">
|
||||
{$t('update.available', { version: $latestVersion })}
|
||||
</span>
|
||||
|
||||
@@ -23,7 +19,7 @@
|
||||
href="https://github.com/open-webui/computer/releases"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="text-[11px] text-gray-900 dark:text-white hover:underline font-medium"
|
||||
class="text-[0.6875rem] text-gray-900 dark:text-white hover:underline font-medium"
|
||||
>
|
||||
{$t('update.viewRelease')}
|
||||
</a>
|
||||
|
||||
@@ -232,7 +232,7 @@
|
||||
</script>
|
||||
|
||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
||||
<Modal onclose={phase === 'recording' ? cancel : onclose} class="w-full max-w-[260px] mx-4">
|
||||
<Modal onclose={phase === 'recording' ? cancel : onclose} class="w-full max-w-[16.25rem] mx-4">
|
||||
<div
|
||||
class="px-4 py-3.5"
|
||||
onkeydown={(e) => {
|
||||
@@ -259,11 +259,11 @@
|
||||
|
||||
<div class="flex items-center justify-end gap-3 mt-3">
|
||||
<button
|
||||
class="text-[13px] text-gray-400 dark:text-gray-600 hover:text-gray-600 dark:hover:text-gray-400 transition-colors"
|
||||
class="text-[0.8125rem] text-gray-400 dark:text-gray-600 hover:text-gray-600 dark:hover:text-gray-400 transition-colors"
|
||||
onclick={cancel}>{$t('common.cancel')}</button
|
||||
>
|
||||
<button
|
||||
class="text-[13px] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100"
|
||||
class="text-[0.8125rem] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100"
|
||||
onclick={stop}>{$t('voiceMemo.done')}</button
|
||||
>
|
||||
</div>
|
||||
@@ -279,7 +279,9 @@
|
||||
</p>
|
||||
{/if}
|
||||
|
||||
<label class="text-[10px] text-gray-400 dark:text-gray-600">{$t('voiceMemo.filename')}</label>
|
||||
<label class="text-[0.625rem] text-gray-400 dark:text-gray-600"
|
||||
>{$t('voiceMemo.filename')}</label
|
||||
>
|
||||
<input
|
||||
bind:this={filenameInput}
|
||||
type="text"
|
||||
@@ -287,9 +289,9 @@
|
||||
placeholder={$t('voiceMemo.filenamePlaceholder')}
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
class="block w-full bg-transparent text-[13px] text-gray-700 dark:text-gray-300 placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-none py-0.5"
|
||||
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"
|
||||
/>
|
||||
<p class="text-[10px] text-gray-300 dark:text-gray-700 mt-0.5">
|
||||
<p class="text-[0.625rem] text-gray-300 dark:text-gray-700 mt-0.5">
|
||||
{directory.split('/').pop()}
|
||||
</p>
|
||||
|
||||
@@ -297,7 +299,7 @@
|
||||
<button
|
||||
onclick={save}
|
||||
disabled={!fileName.trim()}
|
||||
class="text-[13px] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100 disabled:opacity-30 disabled:pointer-events-none"
|
||||
class="text-[0.8125rem] text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors duration-100 disabled:opacity-30 disabled:pointer-events-none"
|
||||
>{$t('common.save')} →</button
|
||||
>
|
||||
</div>
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
<Modal
|
||||
onclose={oncancel}
|
||||
class="w-full max-w-[560px] mx-4 max-md:mx-0 max-md:rounded-none max-h-[480px] max-md:max-h-dvh flex flex-col mb-[6vh] max-md:mb-0"
|
||||
class="w-full max-w-[35rem] mx-4 max-md:mx-0 max-md:rounded-none max-h-[30rem] max-md:max-h-dvh flex flex-col mb-[6vh] max-md:mb-0"
|
||||
>
|
||||
<div class="flex items-center px-3.5 py-3 gap-2">
|
||||
<div class="flex-1 min-w-0">
|
||||
@@ -53,7 +53,10 @@
|
||||
|
||||
{#if needsShareBehavior}
|
||||
<div class="flex items-center gap-3 px-3.5 pb-2">
|
||||
<label class="text-[11px] text-gray-400 dark:text-gray-600 shrink-0" for="share-behavior">
|
||||
<label
|
||||
class="text-[0.6875rem] text-gray-400 dark:text-gray-600 shrink-0"
|
||||
for="share-behavior"
|
||||
>
|
||||
{$t('pwa.shareBehavior')}
|
||||
</label>
|
||||
<select
|
||||
@@ -80,7 +83,7 @@
|
||||
>
|
||||
<span class="text-xs shrink-0 truncate max-w-[34%]">{ws.name}</span>
|
||||
<span
|
||||
class="text-[11px] text-gray-400 overflow-hidden text-ellipsis whitespace-nowrap font-mono"
|
||||
class="text-[0.6875rem] text-gray-400 overflow-hidden text-ellipsis whitespace-nowrap font-mono"
|
||||
>
|
||||
{ws.path}
|
||||
</span>
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
|
||||
<!-- Prompt -->
|
||||
<div class="px-5 pb-2">
|
||||
<div class="mb-1 text-[11px] text-gray-400 dark:text-gray-500">
|
||||
<div class="mb-1 text-[0.6875rem] text-gray-400 dark:text-gray-500">
|
||||
{$t('automationModal.instructions')}
|
||||
</div>
|
||||
<textarea
|
||||
@@ -133,11 +133,11 @@
|
||||
<button
|
||||
bind:this={workspaceButtonEl}
|
||||
type="button"
|
||||
class="flex items-center gap-1 px-2 py-1 rounded-lg text-[11px] text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-400 hover:bg-gray-50 dark:hover:bg-white/5 transition-colors duration-100"
|
||||
class="flex items-center gap-1 px-2 py-1 rounded-lg text-[0.6875rem] text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-400 hover:bg-gray-50 dark:hover:bg-white/5 transition-colors duration-100"
|
||||
onclick={() => (showWsMenu = !showWsMenu)}
|
||||
>
|
||||
<Icon name="folder" size={12} />
|
||||
<span class="truncate max-w-[120px]">{selectedWorkspaceName}</span>
|
||||
<span class="truncate max-w-[7.5rem]">{selectedWorkspaceName}</span>
|
||||
<svg
|
||||
class="w-3 h-3 opacity-50"
|
||||
viewBox="0 0 24 24"
|
||||
|
||||
@@ -253,7 +253,7 @@
|
||||
<!-- Info rows -->
|
||||
<div class="border-b border-gray-200 dark:border-white/6">
|
||||
<div class="flex items-center h-7 px-3">
|
||||
<span class="text-[11px] text-gray-400 dark:text-gray-500 w-20 shrink-0"
|
||||
<span class="text-[0.6875rem] text-gray-400 dark:text-gray-500 w-20 shrink-0"
|
||||
>{$t('automations.status')}</span
|
||||
>
|
||||
<div class="flex items-center gap-1.5">
|
||||
@@ -268,7 +268,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center h-7 px-3">
|
||||
<span class="text-[11px] text-gray-400 dark:text-gray-500 w-20 shrink-0"
|
||||
<span class="text-[0.6875rem] text-gray-400 dark:text-gray-500 w-20 shrink-0"
|
||||
>{$t('automations.schedule')}</span
|
||||
>
|
||||
<span class="text-xs text-gray-700 dark:text-gray-300"
|
||||
@@ -276,15 +276,15 @@
|
||||
>
|
||||
</div>
|
||||
<div class="flex items-center h-7 px-3">
|
||||
<span class="text-[11px] text-gray-400 dark:text-gray-500 w-20 shrink-0"
|
||||
<span class="text-[0.6875rem] text-gray-400 dark:text-gray-500 w-20 shrink-0"
|
||||
>{$t('automations.model')}</span
|
||||
>
|
||||
<span class="text-[11px] text-gray-500 dark:text-gray-400 font-mono"
|
||||
<span class="text-[0.6875rem] text-gray-500 dark:text-gray-400 font-mono"
|
||||
>{detail.model_id}</span
|
||||
>
|
||||
</div>
|
||||
<div class="flex items-center h-7 px-3">
|
||||
<span class="text-[11px] text-gray-400 dark:text-gray-500 w-20 shrink-0"
|
||||
<span class="text-[0.6875rem] text-gray-400 dark:text-gray-500 w-20 shrink-0"
|
||||
>{$t('automations.nextRun')}</span
|
||||
>
|
||||
<span class="text-xs text-gray-700 dark:text-gray-300"
|
||||
@@ -292,7 +292,7 @@
|
||||
>
|
||||
</div>
|
||||
<div class="flex items-center h-7 px-3">
|
||||
<span class="text-[11px] text-gray-400 dark:text-gray-500 w-20 shrink-0"
|
||||
<span class="text-[0.6875rem] text-gray-400 dark:text-gray-500 w-20 shrink-0"
|
||||
>{$t('automations.lastRun')}</span
|
||||
>
|
||||
<span class="text-xs text-gray-700 dark:text-gray-300"
|
||||
@@ -300,16 +300,16 @@
|
||||
>
|
||||
</div>
|
||||
<div class="flex items-center min-h-[1.75rem] px-3">
|
||||
<span class="text-[11px] text-gray-400 dark:text-gray-500 w-20 shrink-0"
|
||||
<span class="text-[0.6875rem] text-gray-400 dark:text-gray-500 w-20 shrink-0"
|
||||
>{$t('automations.webhook')}</span
|
||||
>
|
||||
{#if detail.webhook_url}
|
||||
<div class="flex items-center gap-1.5 min-w-0 flex-1">
|
||||
<span class="text-[11px] text-gray-500 dark:text-gray-400 font-mono truncate"
|
||||
<span class="text-[0.6875rem] text-gray-500 dark:text-gray-400 font-mono truncate"
|
||||
>...?token={detail.webhook_url.split('token=')[1]?.slice(0, 12)}...</span
|
||||
>
|
||||
<button
|
||||
class="text-[11px] text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors duration-75 shrink-0"
|
||||
class="text-[0.6875rem] text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors duration-75 shrink-0"
|
||||
onclick={copyWebhookUrl}
|
||||
>
|
||||
{webhookCopied ? $t('automations.copied') : $t('automations.copy')}
|
||||
@@ -318,12 +318,12 @@
|
||||
{:else if detail.has_webhook}
|
||||
<!-- Webhook enabled, URL not available -->
|
||||
<div class="flex items-center gap-1.5">
|
||||
<span class="text-[11px] text-gray-700 dark:text-gray-300"
|
||||
<span class="text-[0.6875rem] text-gray-700 dark:text-gray-300"
|
||||
>{$t('automations.enabled')}</span
|
||||
>
|
||||
<span class="text-gray-300 dark:text-gray-600">·</span>
|
||||
<button
|
||||
class="text-[11px] text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors duration-75"
|
||||
class="text-[0.6875rem] text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors duration-75"
|
||||
onclick={handleGenerateWebhook}
|
||||
disabled={webhookLoading}
|
||||
>
|
||||
@@ -331,7 +331,7 @@
|
||||
</button>
|
||||
<span class="text-gray-300 dark:text-gray-600">·</span>
|
||||
<button
|
||||
class="text-[11px] text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors duration-75"
|
||||
class="text-[0.6875rem] text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors duration-75"
|
||||
onclick={handleRevokeWebhook}
|
||||
disabled={webhookLoading}
|
||||
>
|
||||
@@ -340,7 +340,7 @@
|
||||
</div>
|
||||
{:else}
|
||||
<button
|
||||
class="text-[11px] text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors duration-75"
|
||||
class="text-[0.6875rem] text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors duration-75"
|
||||
onclick={handleGenerateWebhook}
|
||||
disabled={webhookLoading}
|
||||
>
|
||||
@@ -352,7 +352,7 @@
|
||||
|
||||
<!-- Prompt -->
|
||||
<div class="border-b border-gray-200 dark:border-white/6 px-3 py-2">
|
||||
<div class="text-[11px] text-gray-400 dark:text-gray-500 mb-1">
|
||||
<div class="text-[0.6875rem] text-gray-400 dark:text-gray-500 mb-1">
|
||||
{$t('automations.prompt')}
|
||||
</div>
|
||||
<div
|
||||
@@ -364,11 +364,11 @@
|
||||
|
||||
<!-- Runs -->
|
||||
<div class="px-3 py-2">
|
||||
<div class="text-[11px] text-gray-400 dark:text-gray-500 mb-1">
|
||||
<div class="text-[0.6875rem] text-gray-400 dark:text-gray-500 mb-1">
|
||||
{$t('automations.runs')}
|
||||
</div>
|
||||
{#if runs.length === 0}
|
||||
<div class="text-[11px] text-gray-400 dark:text-gray-600 py-2">
|
||||
<div class="text-[0.6875rem] text-gray-400 dark:text-gray-600 py-2">
|
||||
{$t('automations.noRuns')}
|
||||
</div>
|
||||
{:else}
|
||||
@@ -382,7 +382,7 @@
|
||||
<span class="text-gray-500 dark:text-gray-400">{formatTime(run.created_at)}</span>
|
||||
{#if run.chat_id}
|
||||
<button
|
||||
class="text-[11px] text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors duration-75"
|
||||
class="text-[0.6875rem] text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors duration-75"
|
||||
onclick={() => {
|
||||
const workspacePath = detail?.workspace;
|
||||
const workspaceQuery = workspacePath
|
||||
@@ -395,7 +395,7 @@
|
||||
</button>
|
||||
{/if}
|
||||
{#if run.error}
|
||||
<span class="text-[11px] text-red-400 truncate" title={run.error}
|
||||
<span class="text-[0.6875rem] text-red-400 truncate" title={run.error}
|
||||
>{run.error}</span
|
||||
>
|
||||
{/if}
|
||||
@@ -424,12 +424,12 @@
|
||||
{/if}
|
||||
<span class="text-xs text-gray-900 dark:text-white">{$t('automations.title')}</span>
|
||||
{#if total > 0}
|
||||
<span class="text-[11px] text-gray-400 dark:text-gray-600">{total}</span>
|
||||
<span class="text-[0.6875rem] text-gray-400 dark:text-gray-600">{total}</span>
|
||||
{/if}
|
||||
|
||||
<div class="ml-auto flex items-center gap-1">
|
||||
<select
|
||||
class="text-[11px] bg-transparent text-gray-400 dark:text-gray-500 outline-none cursor-pointer"
|
||||
class="text-[0.6875rem] bg-transparent text-gray-400 dark:text-gray-500 outline-none cursor-pointer"
|
||||
bind:value={statusFilter}
|
||||
onchange={loadList}
|
||||
>
|
||||
@@ -513,11 +513,11 @@
|
||||
>
|
||||
{a.name}
|
||||
</button>
|
||||
<span class="text-[11px] text-gray-400 dark:text-gray-600 shrink-0"
|
||||
<span class="text-[0.6875rem] text-gray-400 dark:text-gray-600 shrink-0"
|
||||
>{getPathDisplayName(a.workspace, a.workspace)}</span
|
||||
>
|
||||
<span class="text-[11px] text-gray-400 dark:text-gray-600 shrink-0">·</span>
|
||||
<span class="text-[11px] text-gray-400 dark:text-gray-600 shrink-0"
|
||||
<span class="text-[0.6875rem] text-gray-400 dark:text-gray-600 shrink-0">·</span>
|
||||
<span class="text-[0.6875rem] text-gray-400 dark:text-gray-600 shrink-0"
|
||||
>{parseFrequency(a.rrule)}</span
|
||||
>
|
||||
|
||||
|
||||
@@ -147,13 +147,34 @@
|
||||
bind:this={triggerEl}
|
||||
type="button"
|
||||
class="schedule-trigger"
|
||||
onclick={() => { updatePosition(); showDropdown = !showDropdown; }}
|
||||
onclick={() => {
|
||||
updatePosition();
|
||||
showDropdown = !showDropdown;
|
||||
}}
|
||||
>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-3.5 h-3.5">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" />
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
stroke-width="1.5"
|
||||
stroke="currentColor"
|
||||
class="w-3.5 h-3.5"
|
||||
>
|
||||
<path
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
d="M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"
|
||||
/>
|
||||
</svg>
|
||||
<span>{scheduleLabel}</span>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" class="w-2.5 h-2.5">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
stroke-width="2"
|
||||
stroke="currentColor"
|
||||
class="w-2.5 h-2.5"
|
||||
>
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5" />
|
||||
</svg>
|
||||
</button>
|
||||
@@ -269,10 +290,10 @@
|
||||
.schedule-trigger {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
padding: 4px 10px;
|
||||
border-radius: 16px;
|
||||
font-size: 12px;
|
||||
gap: 0.375rem;
|
||||
padding: 0.25rem 0.625rem;
|
||||
border-radius: 1rem;
|
||||
font-size: 0.75rem;
|
||||
color: var(--color-gray-600);
|
||||
transition: background 0.1s;
|
||||
}
|
||||
@@ -293,13 +314,13 @@
|
||||
position: fixed;
|
||||
z-index: 201;
|
||||
width: 12rem;
|
||||
padding: 4px;
|
||||
border-radius: 16px;
|
||||
padding: 0.25rem;
|
||||
border-radius: 1rem;
|
||||
background: white;
|
||||
border: 1px solid var(--color-gray-200);
|
||||
box-shadow:
|
||||
0 4px 6px -1px rgba(0, 0, 0, 0.1),
|
||||
0 2px 4px -2px rgba(0, 0, 0, 0.1);
|
||||
0 0.25rem 0.375rem -0.0625rem rgba(0, 0, 0, 0.1),
|
||||
0 0.125rem 0.25rem -0.125rem rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
:global(.dark) .schedule-panel {
|
||||
|
||||
@@ -379,14 +379,14 @@
|
||||
<textarea
|
||||
bind:this={textareaEl}
|
||||
bind:value={editedContent}
|
||||
class="w-full bg-transparent outline-none resize-none text-[13px] leading-relaxed text-gray-900 dark:text-gray-200"
|
||||
class="w-full bg-transparent outline-none resize-none text-[0.8125rem] leading-relaxed text-gray-900 dark:text-gray-200"
|
||||
oninput={autoResize}
|
||||
onkeydown={handleKeydown}
|
||||
rows="1"
|
||||
></textarea>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="flex justify-between mt-2 text-[12px] font-medium">
|
||||
<div class="flex justify-between mt-2 text-[0.75rem] font-medium">
|
||||
<button
|
||||
class="px-3 py-1 rounded-lg text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-300 transition-colors duration-100"
|
||||
onclick={saveAsCopy}>{$t('chat.saveAs')}</button
|
||||
@@ -408,7 +408,7 @@
|
||||
<div>
|
||||
{#if !done && (!output || output.length === 0)}
|
||||
<MarkdownRenderer {content} /><span
|
||||
class="inline-block w-[2px] h-3.5 bg-gray-400 dark:bg-gray-500 ml-0.5 animate-pulse align-text-bottom"
|
||||
class="inline-block w-[0.125rem] h-3.5 bg-gray-400 dark:bg-gray-500 ml-0.5 animate-pulse align-text-bottom"
|
||||
></span>
|
||||
{:else}
|
||||
{#if done && displayItems.length === 0 && content}
|
||||
@@ -428,7 +428,7 @@
|
||||
border border-gray-200 dark:border-white/8
|
||||
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-[70px]' : 'h-[38px]'}"
|
||||
transition-colors duration-150 {preview ? 'h-[4.375rem]' : 'h-[2.375rem]'}"
|
||||
onclick={() => {
|
||||
const ws = get(currentWorkspace);
|
||||
if (ws && artifact.path) {
|
||||
@@ -446,7 +446,7 @@
|
||||
{#if preview}
|
||||
<div class="h-8 overflow-hidden">
|
||||
<div
|
||||
class="line-clamp-2 break-words text-[10px] leading-4 font-normal text-gray-400 dark:text-gray-500"
|
||||
class="line-clamp-2 break-words text-[0.625rem] leading-4 font-normal text-gray-400 dark:text-gray-500"
|
||||
>
|
||||
{preview}
|
||||
</div>
|
||||
@@ -514,7 +514,7 @@
|
||||
<MarkdownRenderer content={leftoverText} />
|
||||
{/if}
|
||||
<span
|
||||
class="inline-block w-[2px] h-3.5 bg-gray-400 dark:bg-gray-500 ml-0.5 animate-pulse align-text-bottom"
|
||||
class="inline-block w-[0.125rem] h-3.5 bg-gray-400 dark:bg-gray-500 ml-0.5 animate-pulse align-text-bottom"
|
||||
></span>
|
||||
{/if}
|
||||
{/if}
|
||||
@@ -539,7 +539,7 @@
|
||||
/></svg
|
||||
>
|
||||
</button>
|
||||
<span class="text-[11px] tabular-nums text-gray-400 dark:text-gray-600 select-none"
|
||||
<span class="text-[0.6875rem] tabular-nums text-gray-400 dark:text-gray-600 select-none"
|
||||
>{siblingIndex + 1}/{siblingTotal}</span
|
||||
>
|
||||
<button
|
||||
@@ -672,9 +672,9 @@
|
||||
<div
|
||||
class="absolute bottom-full left-1/2 -translate-x-1/2 mb-1.5 z-50
|
||||
bg-gray-900 dark:bg-gray-800 text-gray-100 dark:text-gray-100
|
||||
rounded-lg shadow-lg px-2.5 py-1.5 text-[10px] font-mono
|
||||
rounded-lg shadow-lg px-2.5 py-1.5 text-[0.625rem] font-mono
|
||||
whitespace-nowrap pointer-events-none
|
||||
min-w-[160px] border border-transparent dark:border-gray-700"
|
||||
min-w-[10rem] border border-transparent dark:border-gray-700"
|
||||
>
|
||||
<div class="space-y-0.5">
|
||||
{#each Object.entries(usage) as [key, value]}
|
||||
@@ -689,9 +689,9 @@
|
||||
<!-- Arrow -->
|
||||
<div
|
||||
class="absolute top-full left-1/2 -translate-x-1/2 w-0 h-0
|
||||
border-l-[5px] border-l-transparent
|
||||
border-r-[5px] border-r-transparent
|
||||
border-t-[5px] border-t-gray-900 dark:border-t-gray-800"
|
||||
border-l-[0.3125rem] border-l-transparent
|
||||
border-r-[0.3125rem] border-r-transparent
|
||||
border-t-[0.3125rem] border-t-gray-900 dark:border-t-gray-800"
|
||||
></div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
<!-- Sort header -->
|
||||
{#if onsort}
|
||||
<div
|
||||
class="flex items-center text-[10px] font-medium text-gray-400 dark:text-gray-600 mb-1 px-2 select-none"
|
||||
class="flex items-center text-[0.625rem] font-medium text-gray-400 dark:text-gray-600 mb-1 px-2 select-none"
|
||||
>
|
||||
<button
|
||||
class="flex-1 flex items-center gap-1 hover:text-gray-600 dark:hover:text-gray-400 transition-colors"
|
||||
@@ -131,11 +131,7 @@
|
||||
{/if}
|
||||
|
||||
{#each chats as chat (chat.id)}
|
||||
<ChatItem
|
||||
{chat}
|
||||
onclick={() => onopen(chat.id)}
|
||||
onmenu={(e) => openMenu(e, chat.id)}
|
||||
/>
|
||||
<ChatItem {chat} onclick={() => onopen(chat.id)} onmenu={(e) => openMenu(e, chat.id)} />
|
||||
{/each}
|
||||
{#if onpagechange}
|
||||
<Pagination {page} {totalPages} {onpagechange} />
|
||||
@@ -159,4 +155,3 @@
|
||||
onclose={closeMenu}
|
||||
/>
|
||||
{/if}
|
||||
|
||||
@@ -992,7 +992,7 @@
|
||||
class="absolute left-2 bottom-full mb-1 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"
|
||||
>
|
||||
<div
|
||||
class="mb-0.5 px-2 pt-1 pb-0.5 text-[10px] leading-none text-gray-400 dark:text-gray-600"
|
||||
class="mb-0.5 px-2 pt-1 pb-0.5 text-[0.625rem] leading-none text-gray-400 dark:text-gray-600"
|
||||
>
|
||||
Commands
|
||||
</div>
|
||||
@@ -1038,7 +1038,7 @@
|
||||
</span>
|
||||
<span class="flex-1 min-w-0 flex items-baseline gap-1.5 overflow-hidden">
|
||||
<span class="truncate">{$t('chat.commandCompact')}</span>
|
||||
<span class="text-[10px] text-gray-400 dark:text-gray-600 truncate shrink-0">
|
||||
<span class="text-[0.625rem] text-gray-400 dark:text-gray-600 truncate shrink-0">
|
||||
{$t('chat.commandCompactPercent', { percent: contextPercent })}
|
||||
</span>
|
||||
</span>
|
||||
@@ -1078,7 +1078,7 @@
|
||||
</span>
|
||||
<span class="flex-1 min-w-0 flex items-baseline gap-1.5 overflow-hidden">
|
||||
<span class="truncate">{$t('chat.commandPlan')}</span>
|
||||
<span class="text-[10px] text-gray-400 dark:text-gray-600 truncate shrink-0">
|
||||
<span class="text-[0.625rem] text-gray-400 dark:text-gray-600 truncate shrink-0">
|
||||
{$planMode ? $t('chat.commandPlanOn') : $t('chat.commandPlanOff')}
|
||||
</span>
|
||||
</span>
|
||||
@@ -1116,7 +1116,7 @@
|
||||
</span>
|
||||
<span class="flex-1 min-w-0 flex items-baseline gap-1.5 overflow-hidden">
|
||||
<span class="truncate">{$t('chat.commandStatus')}</span>
|
||||
<span class="text-[10px] text-gray-400 dark:text-gray-600 truncate shrink-0">
|
||||
<span class="text-[0.625rem] text-gray-400 dark:text-gray-600 truncate shrink-0">
|
||||
{$t('chat.commandStatusDesc')}
|
||||
</span>
|
||||
</span>
|
||||
@@ -1157,7 +1157,7 @@
|
||||
class="dark:text-gray-100 text-xs flex justify-between items-center w-full gap-2"
|
||||
>
|
||||
<div class="font-medium truncate flex-1">{upload.name}</div>
|
||||
<div class="text-[10px] text-gray-500 capitalize shrink-0">
|
||||
<div class="text-[0.625rem] text-gray-500 capitalize shrink-0">
|
||||
{upload.type === 'file' ? 'File' : upload.type}
|
||||
</div>
|
||||
</div>
|
||||
@@ -1193,7 +1193,7 @@
|
||||
<div class="px-2.5">
|
||||
{#if $voiceModeEnabled}
|
||||
<div
|
||||
class="pt-2 flex items-center gap-2 text-[11px] font-medium text-gray-600 dark:text-gray-300"
|
||||
class="pt-2 flex items-center gap-2 text-[0.6875rem] font-medium text-gray-600 dark:text-gray-300"
|
||||
>
|
||||
<span class="relative flex size-2">
|
||||
<span
|
||||
@@ -1232,7 +1232,7 @@
|
||||
{#if $planMode}
|
||||
<button
|
||||
type="button"
|
||||
class="group p-[5px] flex gap-1 items-center text-xs rounded-full transition-colors duration-150
|
||||
class="group p-[0.3125rem] flex gap-1 items-center text-xs rounded-full transition-colors duration-150
|
||||
text-gray-600 dark:text-gray-300 bg-gray-50 hover:bg-gray-100 dark:bg-white/8 dark:hover:bg-white/12 border border-gray-200 dark:border-white/8"
|
||||
onclick={() => planMode.set(false)}
|
||||
>
|
||||
@@ -1291,7 +1291,7 @@
|
||||
/* ── ProseMirror editor ───────────────────────── */
|
||||
|
||||
.chat-editor-mount :global(.chat-prosemirror) {
|
||||
@apply pt-2.5 pb-2 px-1 min-h-6 max-h-96 overflow-y-auto text-[13px] leading-relaxed text-gray-900 dark:text-gray-100 outline-none break-words;
|
||||
@apply pt-2.5 pb-2 px-1 min-h-6 max-h-96 overflow-y-auto text-[0.8125rem] leading-relaxed text-gray-900 dark:text-gray-100 outline-none break-words;
|
||||
font-size: 0.8125rem;
|
||||
}
|
||||
|
||||
@@ -1352,7 +1352,7 @@
|
||||
@apply text-sm font-semibold my-1;
|
||||
}
|
||||
.chat-editor-mount :global(.chat-prosemirror h3) {
|
||||
@apply text-[13px] font-semibold my-1;
|
||||
@apply text-[0.8125rem] font-semibold my-1;
|
||||
font-size: 0.8125rem;
|
||||
}
|
||||
|
||||
|
||||
@@ -295,7 +295,9 @@
|
||||
const summaryCount = $derived(runningCommandSessions.length);
|
||||
const statusButtonClass =
|
||||
'text-gray-400 hover:bg-gray-50 hover:text-gray-700 dark:text-gray-600 dark:hover:bg-white/5 dark:hover:text-gray-300';
|
||||
const statusTitle = $derived(summaryCount > 0 ? `${summaryCount} active command session` : 'Status');
|
||||
const statusTitle = $derived(
|
||||
summaryCount > 0 ? `${summaryCount} active command session` : 'Status'
|
||||
);
|
||||
|
||||
// Queued messages: user-authored messages waiting behind an active response.
|
||||
const queuedMessages = $derived(
|
||||
@@ -1417,7 +1419,9 @@
|
||||
<div
|
||||
class="flex h-7 shrink-0 items-center gap-2 border-b border-gray-100 px-3 dark:border-white/6"
|
||||
>
|
||||
<div class="min-w-0 flex-1 truncate text-[11px] font-medium text-gray-600 dark:text-gray-400">
|
||||
<div
|
||||
class="min-w-0 flex-1 truncate text-[0.6875rem] font-medium text-gray-600 dark:text-gray-400"
|
||||
>
|
||||
{displayChatTitle}
|
||||
</div>
|
||||
<button
|
||||
|
||||
@@ -238,7 +238,7 @@
|
||||
</span>
|
||||
<span class="flex gap-1 shrink-0">
|
||||
<button
|
||||
class="text-[11px] px-2.5 py-0.5 rounded-md
|
||||
class="text-[0.6875rem] px-2.5 py-0.5 rounded-md
|
||||
text-gray-600 dark:text-gray-300
|
||||
bg-gray-100 dark:bg-white/8
|
||||
hover:bg-gray-200 dark:hover:bg-white/12
|
||||
@@ -246,7 +246,7 @@
|
||||
onclick={() => onapprove(messageId, item.call_id, true)}>{$t('chat.allow')}</button
|
||||
>
|
||||
<button
|
||||
class="text-[11px] px-2 py-0.5 rounded-md
|
||||
class="text-[0.6875rem] px-2 py-0.5 rounded-md
|
||||
text-gray-400 dark:text-gray-500
|
||||
hover:text-gray-600 dark:hover:text-gray-300
|
||||
transition-colors duration-100"
|
||||
|
||||
@@ -41,7 +41,9 @@
|
||||
No files found
|
||||
</div>
|
||||
{:else}
|
||||
<div class="mb-0.5 px-2 pt-1 pb-0.5 text-[10px] leading-none text-gray-400 dark:text-gray-600">
|
||||
<div
|
||||
class="mb-0.5 px-2 pt-1 pb-0.5 text-[0.625rem] leading-none text-gray-400 dark:text-gray-600"
|
||||
>
|
||||
Files
|
||||
</div>
|
||||
<div bind:this={listEl}>
|
||||
@@ -68,7 +70,7 @@
|
||||
<span class="flex-1 min-w-0 flex items-baseline gap-1.5 overflow-hidden">
|
||||
<span class="truncate">{item.label}</span>
|
||||
{#if relativePath(item.id)}
|
||||
<span class="text-[10px] text-gray-400 dark:text-gray-600 truncate shrink-0"
|
||||
<span class="text-[0.625rem] text-gray-400 dark:text-gray-600 truncate shrink-0"
|
||||
>{relativePath(item.id)}</span
|
||||
>
|
||||
{/if}
|
||||
|
||||
@@ -37,9 +37,9 @@
|
||||
json(),
|
||||
editorTheme.of(isDark ? oneDark : []),
|
||||
EditorView.theme({
|
||||
'&': { fontSize: '13px' },
|
||||
'&': { fontSize: '0.8125rem' },
|
||||
'.cm-content': { fontFamily: 'ui-monospace, monospace' },
|
||||
'.cm-scroller': { maxHeight: '320px', overflow: 'auto' },
|
||||
'.cm-scroller': { maxHeight: '20rem', overflow: 'auto' },
|
||||
'&.cm-focused': { outline: 'none' }
|
||||
}),
|
||||
EditorView.updateListener.of((e) => {
|
||||
@@ -237,7 +237,7 @@
|
||||
<!-- Role label -->
|
||||
<div class="flex items-start pt-1.5">
|
||||
<div
|
||||
class="text-[11px] font-semibold uppercase tracking-wide min-w-[4.5rem] text-gray-400 dark:text-gray-500"
|
||||
class="text-[0.6875rem] font-semibold uppercase tracking-wide min-w-[4.5rem] text-gray-400 dark:text-gray-500"
|
||||
>
|
||||
{getItemLabel(di)}
|
||||
</div>
|
||||
|
||||
@@ -39,9 +39,7 @@
|
||||
}))
|
||||
);
|
||||
|
||||
const paramCount = $derived(
|
||||
paramRows.filter((r) => r.key.trim()).length
|
||||
);
|
||||
const paramCount = $derived(paramRows.filter((r) => r.key.trim()).length);
|
||||
|
||||
const canAddParam = $derived(
|
||||
paramRows.length === 0 || paramRows.every((r) => r.key.trim() || r.value.trim())
|
||||
@@ -271,7 +269,9 @@
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z" />
|
||||
<path
|
||||
d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"
|
||||
/>
|
||||
<circle cx="12" cy="13" r="4" />
|
||||
</svg>
|
||||
<span class="flex-1 text-left truncate">{$t('plusMenu.capture')}</span>
|
||||
@@ -310,7 +310,7 @@
|
||||
>
|
||||
<Icon name="shield" size={14} />
|
||||
<span class="flex-1 text-left truncate">{$t('plusMenu.toolPermissions')}</span>
|
||||
<span class="text-[10px] text-gray-400 dark:text-gray-500 truncate max-w-16"
|
||||
<span class="text-[0.625rem] text-gray-400 dark:text-gray-500 truncate max-w-16"
|
||||
>{currentModeLabel}</span
|
||||
>
|
||||
<Icon name="chevron-right" size={12} class="shrink-0 text-gray-400 dark:text-gray-500" />
|
||||
@@ -332,11 +332,13 @@
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<circle cx="12" cy="12" r="3" />
|
||||
<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z" />
|
||||
<path
|
||||
d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"
|
||||
/>
|
||||
</svg>
|
||||
<span class="flex-1 text-left truncate">{$t('plusMenu.parameters')}</span>
|
||||
{#if paramCount > 0}
|
||||
<span class="text-[10px] text-gray-400 dark:text-gray-500">{paramCount}</span>
|
||||
<span class="text-[0.625rem] text-gray-400 dark:text-gray-500">{paramCount}</span>
|
||||
{/if}
|
||||
<Icon name="chevron-right" size={12} class="shrink-0 text-gray-400 dark:text-gray-500" />
|
||||
</button>
|
||||
@@ -394,7 +396,11 @@
|
||||
<div class="h-px bg-gray-100/50 dark:bg-white/3 mx-1 my-0.5"></div>
|
||||
|
||||
{#if paramRows.length === 0}
|
||||
<p class="px-2 h-7 flex items-center justify-center text-[11px] text-gray-400 dark:text-gray-500">{$t('plusMenu.noParams')}</p>
|
||||
<p
|
||||
class="px-2 h-7 flex items-center justify-center text-[0.6875rem] text-gray-400 dark:text-gray-500"
|
||||
>
|
||||
{$t('plusMenu.noParams')}
|
||||
</p>
|
||||
{:else}
|
||||
<div class="px-0.5 py-0.5 flex flex-col max-h-48 overflow-y-auto">
|
||||
{#each paramRows as row, i}
|
||||
@@ -406,7 +412,7 @@
|
||||
onblur={syncParams}
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
class="w-[72px] shrink-0 bg-transparent text-[11px] font-mono text-gray-600 dark:text-gray-400 placeholder:text-gray-300 dark:placeholder:text-gray-600 outline-none"
|
||||
class="w-[4.5rem] shrink-0 bg-transparent text-[0.6875rem] font-mono text-gray-600 dark:text-gray-400 placeholder:text-gray-300 dark:placeholder:text-gray-600 outline-none"
|
||||
/>
|
||||
<input
|
||||
type="text"
|
||||
@@ -415,7 +421,7 @@
|
||||
onblur={syncParams}
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
class="flex-1 min-w-0 bg-transparent text-[11px] font-mono text-gray-600 dark:text-gray-400 placeholder:text-gray-300 dark:placeholder:text-gray-600 outline-none"
|
||||
class="flex-1 min-w-0 bg-transparent text-[0.6875rem] font-mono text-gray-600 dark:text-gray-400 placeholder:text-gray-300 dark:placeholder:text-gray-600 outline-none"
|
||||
/>
|
||||
<button
|
||||
type="button"
|
||||
@@ -457,7 +463,7 @@
|
||||
@keyframes slideFromLeft {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateX(-12px);
|
||||
transform: translateX(-0.75rem);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
@@ -468,7 +474,7 @@
|
||||
@keyframes slideFromRight {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateX(12px);
|
||||
transform: translateX(0.75rem);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="flex shrink-0 self-center translate-y-[1px]">
|
||||
<div class="flex shrink-0 self-center translate-y-[0.0625rem]">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
fill="none"
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
No skills found
|
||||
</div>
|
||||
{:else}
|
||||
<div class="px-2 pt-1 pb-0.5 text-[10px] leading-none text-gray-400 dark:text-gray-600">
|
||||
<div class="px-2 pt-1 pb-0.5 text-[0.625rem] leading-none text-gray-400 dark:text-gray-600">
|
||||
Skills
|
||||
</div>
|
||||
<div bind:this={listEl}>
|
||||
@@ -62,7 +62,7 @@
|
||||
<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"
|
||||
<span class="text-[0.625rem] text-gray-400 dark:text-gray-600 truncate shrink-0"
|
||||
>{item.source}</span
|
||||
>
|
||||
{/if}
|
||||
|
||||
@@ -114,10 +114,12 @@
|
||||
{#if selectedSession}
|
||||
<Modal
|
||||
{onclose}
|
||||
class="mx-4 flex h-[min(760px,82dvh)] w-full max-w-[min(960px,calc(100vw-2rem))] flex-col overflow-hidden max-sm:mx-0 max-sm:h-[100dvh] max-sm:max-w-none max-sm:rounded-none"
|
||||
class="mx-4 flex h-[min(47.5rem,82dvh)] w-full max-w-[min(60rem,calc(100vw-2rem))] flex-col overflow-hidden max-sm:mx-0 max-sm:h-[100dvh] max-sm:max-w-none max-sm:rounded-none"
|
||||
>
|
||||
<div class="flex h-full min-h-0 flex-col overflow-hidden">
|
||||
<div class="flex h-9 shrink-0 items-center gap-3 border-b border-gray-100 px-3 dark:border-white/8">
|
||||
<div
|
||||
class="flex h-9 shrink-0 items-center gap-3 border-b border-gray-100 px-3 dark:border-white/8"
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
class="flex h-7 shrink-0 items-center gap-1.5 rounded-lg pr-2 text-xs text-gray-400 transition-colors duration-75 hover:text-gray-700 dark:text-gray-600 dark:hover:text-gray-300"
|
||||
@@ -160,10 +162,10 @@
|
||||
align="end"
|
||||
className="w-80 max-w-[calc(100vw-1.5rem)] p-0"
|
||||
>
|
||||
<div class="max-h-[70dvh] overflow-y-auto px-1 py-0.5 text-xs sm:max-h-[min(72dvh,520px)]">
|
||||
<div class="max-h-[70dvh] overflow-y-auto px-1 py-0.5 text-xs sm:max-h-[min(72dvh,32.5rem)]">
|
||||
{#if missingSessionId}
|
||||
<div
|
||||
class="rounded-xl px-1.5 py-1.5 text-[11px] leading-relaxed text-gray-400 dark:text-gray-600"
|
||||
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.
|
||||
</div>
|
||||
@@ -172,21 +174,23 @@
|
||||
{#if runningSessions.length}
|
||||
<section>
|
||||
<div
|
||||
class="px-1.5 pb-0.5 pt-1.5 text-[10px] font-medium uppercase tracking-wide text-gray-400 dark:text-gray-600"
|
||||
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
|
||||
</div>
|
||||
{#each runningSessions as session}
|
||||
<div class="flex h-7 min-w-0 items-center gap-3 rounded-xl px-1.5 text-gray-600 dark:text-gray-400">
|
||||
<div
|
||||
class="flex h-7 min-w-0 items-center gap-3 rounded-xl px-1.5 text-gray-600 dark:text-gray-400"
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
class="min-w-0 flex-1 truncate text-left font-mono text-[11px] 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"
|
||||
class="min-w-0 flex-1 truncate text-left font-mono text-[0.6875rem] 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"
|
||||
title={shortCommand(session.command)}
|
||||
onclick={() => (selectedSessionId = session.command_session_id)}
|
||||
>
|
||||
{sessionLabel(session)}
|
||||
</button>
|
||||
<span class="shrink-0 text-[10px] text-gray-400 dark:text-gray-600">
|
||||
<span class="shrink-0 text-[0.625rem] text-gray-400 dark:text-gray-600">
|
||||
{statusLabel(session)}
|
||||
</span>
|
||||
</div>
|
||||
@@ -198,7 +202,7 @@
|
||||
<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="shrink-0 font-mono text-[10px] text-gray-400 dark:text-gray-600">
|
||||
<span class="shrink-0 font-mono text-[0.625rem] text-gray-400 dark:text-gray-600">
|
||||
{contextValue}
|
||||
</span>
|
||||
</div>
|
||||
@@ -211,29 +215,35 @@
|
||||
</div>
|
||||
|
||||
{#if queuedMessages.length}
|
||||
<div class="flex h-7 items-center gap-3 rounded-xl px-1.5 text-gray-600 dark:text-gray-400">
|
||||
<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="font-mono text-[10px] text-gray-400 dark:text-gray-600">
|
||||
<span class="font-mono text-[0.625rem] text-gray-400 dark:text-gray-600">
|
||||
{queuedMessages.length}
|
||||
</span>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{#if chatId}
|
||||
<div class="flex h-7 items-center gap-3 rounded-xl px-1.5 text-gray-600 dark:text-gray-400">
|
||||
<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>
|
||||
<button
|
||||
type="button"
|
||||
class="min-w-0 max-w-[11rem] truncate font-mono text-[10px] 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"
|
||||
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"
|
||||
onclick={copyChatId}
|
||||
>
|
||||
{copied ? $t('about.copied') : chatId}
|
||||
</button>
|
||||
</div>
|
||||
{:else}
|
||||
<div class="flex h-7 items-center gap-3 rounded-xl px-1.5 text-gray-600 dark:text-gray-400">
|
||||
<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="font-mono text-[10px] text-gray-400 dark:text-gray-600">
|
||||
<span class="font-mono text-[0.625rem] text-gray-400 dark:text-gray-600">
|
||||
{$t('chat.statusNoChat')}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -56,7 +56,6 @@
|
||||
toggleExpanded();
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<div class="w-full min-w-0 flex flex-col">
|
||||
@@ -156,7 +155,7 @@
|
||||
{#if isPending && chatId}
|
||||
<span class="flex gap-1 shrink-0">
|
||||
<button
|
||||
class="text-[11px] px-2.5 py-0.5 rounded-md
|
||||
class="text-[0.6875rem] px-2.5 py-0.5 rounded-md
|
||||
text-gray-600 dark:text-gray-300
|
||||
bg-gray-100 dark:bg-white/8
|
||||
hover:bg-gray-200 dark:hover:bg-white/12
|
||||
@@ -167,7 +166,7 @@
|
||||
}}>{$t('chat.allow')}</button
|
||||
>
|
||||
<button
|
||||
class="text-[11px] px-2 py-0.5 rounded-md
|
||||
class="text-[0.6875rem] px-2 py-0.5 rounded-md
|
||||
text-gray-400 dark:text-gray-500
|
||||
hover:text-gray-600 dark:hover:text-gray-300
|
||||
transition-colors duration-100"
|
||||
@@ -204,13 +203,13 @@
|
||||
{#if Object.keys(args).length > 0}
|
||||
<div>
|
||||
<div
|
||||
class="text-[10px] uppercase tracking-wider text-gray-400 dark:text-gray-500 mb-1.5 px-1"
|
||||
class="text-[0.625rem] uppercase tracking-wider text-gray-400 dark:text-gray-500 mb-1.5 px-1"
|
||||
>
|
||||
{$t('chat.toolInput')}
|
||||
</div>
|
||||
{#if toolName === 'edit_file' && args.target}
|
||||
<div
|
||||
class="text-[11px] font-mono rounded-lg overflow-hidden border border-gray-200/60 dark:border-white/6"
|
||||
class="text-[0.6875rem] font-mono rounded-lg overflow-hidden border border-gray-200/60 dark:border-white/6"
|
||||
>
|
||||
<div
|
||||
class="bg-red-50/80 dark:bg-red-950/20 text-red-700 dark:text-red-400 px-2.5 py-1 whitespace-pre-wrap break-all leading-relaxed"
|
||||
@@ -231,7 +230,7 @@
|
||||
</div>
|
||||
</div>
|
||||
{#if args.start_line}
|
||||
<div class="text-[10px] text-gray-400 dark:text-gray-600 mt-1 px-1">
|
||||
<div class="text-[0.625rem] text-gray-400 dark:text-gray-600 mt-1 px-1">
|
||||
{$t('chat.toolLines', {
|
||||
start: args.start_line,
|
||||
end: args.end_line || 'end'
|
||||
@@ -261,7 +260,7 @@
|
||||
{#if pairedOutput?.output}
|
||||
<div>
|
||||
<div
|
||||
class="text-[10px] uppercase tracking-wider text-gray-400 dark:text-gray-500 mb-1.5 px-1"
|
||||
class="text-[0.625rem] uppercase tracking-wider text-gray-400 dark:text-gray-500 mb-1.5 px-1"
|
||||
>
|
||||
{$t('chat.toolOutput')}
|
||||
</div>
|
||||
@@ -282,7 +281,7 @@
|
||||
: formattedOutput}</pre>
|
||||
{/if}
|
||||
{#if !imageToolOutput?.length && formattedOutput.length > 10000}
|
||||
<div class="text-[10px] text-gray-400 dark:text-gray-600 mt-1 px-1">
|
||||
<div class="text-[0.625rem] text-gray-400 dark:text-gray-600 mt-1 px-1">
|
||||
{$t('chat.totalChars', {
|
||||
count: formattedOutput.length.toLocaleString()
|
||||
})}
|
||||
|
||||
@@ -13,7 +13,14 @@
|
||||
onedit?: (content: string, submit: boolean) => void;
|
||||
onnavigate?: (direction: -1 | 1) => void;
|
||||
}
|
||||
let { content, meta = null, siblingIndex = 0, siblingTotal = 1, onedit, onnavigate }: Props = $props();
|
||||
let {
|
||||
content,
|
||||
meta = null,
|
||||
siblingIndex = 0,
|
||||
siblingTotal = 1,
|
||||
onedit,
|
||||
onnavigate
|
||||
}: Props = $props();
|
||||
|
||||
type Segment = { type: 'text'; value: string } | { type: 'file'; label: string; path: string };
|
||||
|
||||
@@ -119,22 +126,27 @@
|
||||
onclick={() => (asyncExpanded = !asyncExpanded)}
|
||||
>
|
||||
<span class="w-1.5 h-1.5 rounded-full bg-gray-300 dark:bg-gray-600 shrink-0"></span>
|
||||
<span class="text-[12px] font-medium shrink-0">{$t('chat.asyncSubagentComplete')}</span>
|
||||
<span class="text-[0.75rem] font-medium shrink-0">{$t('chat.asyncSubagentComplete')}</span>
|
||||
{#if asyncSummary}
|
||||
<span class="text-[12px] truncate min-w-0 flex-1">{asyncSummary}</span>
|
||||
<span class="text-[0.75rem] truncate min-w-0 flex-1">{asyncSummary}</span>
|
||||
{/if}
|
||||
{#if delegationLabel}
|
||||
<span class="hidden sm:inline text-[11px] font-mono text-gray-400 dark:text-gray-600 shrink-0">{delegationLabel}</span>
|
||||
<span
|
||||
class="hidden sm:inline text-[0.6875rem] font-mono text-gray-400 dark:text-gray-600 shrink-0"
|
||||
>{delegationLabel}</span
|
||||
>
|
||||
{/if}
|
||||
<Icon
|
||||
name="chevron-down"
|
||||
size={12}
|
||||
class="text-gray-400 dark:text-gray-600 shrink-0 transition-transform duration-150 {asyncExpanded ? 'rotate-180' : ''}"
|
||||
class="text-gray-400 dark:text-gray-600 shrink-0 transition-transform duration-150 {asyncExpanded
|
||||
? 'rotate-180'
|
||||
: ''}"
|
||||
/>
|
||||
</button>
|
||||
{#if asyncExpanded}
|
||||
<div
|
||||
class="mt-2 ml-3 border-l border-gray-100 dark:border-white/8 pl-3 text-[12.5px] leading-relaxed text-gray-600 dark:text-gray-400 whitespace-pre-wrap break-words"
|
||||
class="mt-2 ml-3 border-l border-gray-100 dark:border-white/8 pl-3 text-[0.78125rem] leading-relaxed text-gray-600 dark:text-gray-400 whitespace-pre-wrap break-words"
|
||||
>
|
||||
{content}
|
||||
</div>
|
||||
@@ -149,13 +161,13 @@
|
||||
<textarea
|
||||
bind:this={textareaEl}
|
||||
bind:value={editedContent}
|
||||
class="w-full bg-transparent outline-none resize-none text-[13px] leading-relaxed text-gray-900 dark:text-gray-200"
|
||||
class="w-full bg-transparent outline-none resize-none text-[0.8125rem] leading-relaxed text-gray-900 dark:text-gray-200"
|
||||
oninput={autoResize}
|
||||
onkeydown={handleKeydown}
|
||||
rows="1"
|
||||
></textarea>
|
||||
</div>
|
||||
<div class="flex justify-between mt-2 text-[12px] font-medium">
|
||||
<div class="flex justify-between mt-2 text-[0.75rem] font-medium">
|
||||
<button
|
||||
class="px-3 py-1 rounded-lg text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 bg-gray-100 dark:bg-white/6 hover:bg-gray-200 dark:hover:bg-white/10 transition-colors duration-100"
|
||||
onclick={saveEdit}>{$t('common.save')}</button
|
||||
@@ -181,14 +193,20 @@
|
||||
{#if upload.type === 'image'}
|
||||
<img src={upload.url} alt={upload.name || 'image'} class="max-h-96 rounded-lg" />
|
||||
{:else}
|
||||
<div class="relative group py-1.5 px-2 w-48 flex items-center gap-1.5 bg-white dark:bg-[#1a1a1a] border border-gray-100 dark:border-white/5 rounded-xl text-left flex-shrink-0 shadow-sm">
|
||||
<div
|
||||
class="relative group py-1.5 px-2 w-48 flex items-center gap-1.5 bg-white dark:bg-[#1a1a1a] border border-gray-100 dark:border-white/5 rounded-xl text-left flex-shrink-0 shadow-sm"
|
||||
>
|
||||
<div class="shrink-0">
|
||||
<Icon name="page-text" size={14} class="text-gray-500 dark:text-gray-400" />
|
||||
</div>
|
||||
<div class="flex flex-col justify-center w-full overflow-hidden">
|
||||
<div class="dark:text-gray-100 text-xs flex justify-between items-center w-full gap-2">
|
||||
<div
|
||||
class="dark:text-gray-100 text-xs flex justify-between items-center w-full gap-2"
|
||||
>
|
||||
<div class="font-medium truncate flex-1">{upload.name || 'File'}</div>
|
||||
<div class="text-[10px] text-gray-500 capitalize shrink-0">{upload.type === 'file' ? 'File' : (upload.type || 'File')}</div>
|
||||
<div class="text-[0.625rem] text-gray-500 capitalize shrink-0">
|
||||
{upload.type === 'file' ? 'File' : upload.type || 'File'}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -200,7 +218,7 @@
|
||||
<div class="flex justify-end">
|
||||
<div class="max-w-[90%] px-4 py-2 rounded-3xl bg-gray-50 dark:bg-white/[0.06]">
|
||||
<div
|
||||
class="text-[13px] leading-relaxed text-gray-900 dark:text-gray-200 whitespace-pre-wrap break-words"
|
||||
class="text-[0.8125rem] leading-relaxed text-gray-900 dark:text-gray-200 whitespace-pre-wrap break-words"
|
||||
>
|
||||
{#each parsedContent as segment}{#if segment.type === 'text'}{segment.value}{:else}{@const isDir =
|
||||
segment.path.endsWith('/')}{@const cleanPath = isDir
|
||||
@@ -243,7 +261,7 @@
|
||||
/></svg
|
||||
>
|
||||
</button>
|
||||
<span class="text-[11px] tabular-nums text-gray-400 dark:text-gray-600 select-none"
|
||||
<span class="text-[0.6875rem] tabular-nums text-gray-400 dark:text-gray-600 select-none"
|
||||
>{siblingIndex + 1}/{siblingTotal}</span
|
||||
>
|
||||
<button
|
||||
|
||||
@@ -38,19 +38,26 @@
|
||||
hover:bg-gray-50 dark:hover:bg-white/3"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
onclick={onclick}
|
||||
onkeydown={(e) => { if (e.key === 'Enter') onclick(); }}
|
||||
{onclick}
|
||||
onkeydown={(e) => {
|
||||
if (e.key === 'Enter') onclick();
|
||||
}}
|
||||
title={chat.title}
|
||||
>
|
||||
{#if chat.is_active}
|
||||
<Spinner size={10} borderWidth={1.5} class="opacity-50" />
|
||||
{/if}
|
||||
<span class="flex-1 text-xs text-gray-500 dark:text-gray-500 truncate min-w-0">{chat.title}</span>
|
||||
<span class="text-[10px] text-gray-300 dark:text-gray-700 shrink-0 tabular-nums">{formatTime(chat.updated_at)}</span>
|
||||
<span class="text-[0.625rem] text-gray-300 dark:text-gray-700 shrink-0 tabular-nums"
|
||||
>{formatTime(chat.updated_at)}</span
|
||||
>
|
||||
{#if onmenu}
|
||||
<button
|
||||
class="flex items-center justify-center w-5 h-5 rounded shrink-0 text-gray-300 dark:text-gray-700 hover:text-gray-500 dark:hover:text-gray-400 hover:bg-gray-200 dark:hover:bg-white/8 transition-all duration-75"
|
||||
onclick={(e) => { e.stopPropagation(); onmenu?.(e); }}
|
||||
onclick={(e) => {
|
||||
e.stopPropagation();
|
||||
onmenu?.(e);
|
||||
}}
|
||||
aria-label={$t('a11y.chatOptions')}
|
||||
>
|
||||
<svg width="11" height="11" viewBox="0 0 16 16" fill="currentColor">
|
||||
|
||||
@@ -68,13 +68,14 @@
|
||||
<span class="relative inline-flex {open ? 'z-[1001]' : ''}">
|
||||
<button
|
||||
bind:this={btnEl}
|
||||
class="flex items-center gap-1 px-2 py-1 rounded-lg text-[11px] text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-400 hover:bg-gray-50 dark:hover:bg-white/5 transition-colors duration-100"
|
||||
class="flex items-center gap-1 px-2 py-1 rounded-lg text-[0.6875rem] text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-400 hover:bg-gray-50 dark:hover:bg-white/5 transition-colors duration-100"
|
||||
onclick={toggle}
|
||||
>
|
||||
<span class="truncate max-w-[160px]"
|
||||
<span class="truncate max-w-[10rem]"
|
||||
>{$chatModels.length === 0
|
||||
? $t('modelSelector.noModels')
|
||||
: $chatModels.find((m) => m.id === selectedModel)?.name || $t('modelSelector.selectModel')}</span
|
||||
: $chatModels.find((m) => m.id === selectedModel)?.name ||
|
||||
$t('modelSelector.selectModel')}</span
|
||||
>
|
||||
{#if $chatModels.length > 0}
|
||||
<svg
|
||||
@@ -96,11 +97,11 @@
|
||||
items={menuItems}
|
||||
anchor={btnEl}
|
||||
onclose={() => (open = false)}
|
||||
preferAbove={preferAbove}
|
||||
{preferAbove}
|
||||
forceAbove={preferAbove}
|
||||
maxHeight={selectorMaxHeight}
|
||||
className="w-48"
|
||||
align={align}
|
||||
{align}
|
||||
>
|
||||
{#snippet header()}
|
||||
<div class="flex items-center gap-1.5 h-6 px-2 mt-0.5">
|
||||
@@ -119,7 +120,7 @@
|
||||
bind:this={searchInputEl}
|
||||
bind:value={search}
|
||||
placeholder={$t('modelSelector.search')}
|
||||
class="w-full bg-transparent text-[11px] text-gray-500 dark:text-gray-400 placeholder:text-gray-300 dark:placeholder:text-gray-600 outline-none"
|
||||
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') open = false;
|
||||
}}
|
||||
@@ -127,7 +128,9 @@
|
||||
</div>
|
||||
{/snippet}
|
||||
{#snippet empty()}
|
||||
<div class="px-3 py-1.5 text-[11px] text-gray-400 dark:text-gray-500 text-center">{$t('modelSelector.noMatches')}</div>
|
||||
<div class="px-3 py-1.5 text-[0.6875rem] text-gray-400 dark:text-gray-500 text-center">
|
||||
{$t('modelSelector.noMatches')}
|
||||
</div>
|
||||
{/snippet}
|
||||
</DropdownMenu>
|
||||
{/if}
|
||||
|
||||
@@ -88,22 +88,22 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 1px;
|
||||
padding-top: 8px;
|
||||
gap: 0.0625rem;
|
||||
padding-top: 0.5rem;
|
||||
}
|
||||
|
||||
.pagination-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-width: 22px;
|
||||
height: 22px;
|
||||
padding: 0 3px;
|
||||
min-width: 1.375rem;
|
||||
height: 1.375rem;
|
||||
padding: 0 0.1875rem;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
border-radius: 0.3125rem;
|
||||
background: transparent;
|
||||
color: #c4c4c4;
|
||||
font-size: 10.5px;
|
||||
font-size: 0.65625rem;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
transition:
|
||||
@@ -131,12 +131,12 @@
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-width: 22px;
|
||||
height: 22px;
|
||||
font-size: 10.5px;
|
||||
min-width: 1.375rem;
|
||||
height: 1.375rem;
|
||||
font-size: 0.65625rem;
|
||||
color: #d1d5db;
|
||||
user-select: none;
|
||||
letter-spacing: 1px;
|
||||
letter-spacing: 0.0625rem;
|
||||
}
|
||||
|
||||
/* Dark mode */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
interface Props {
|
||||
/** Size in px or Tailwind class like '3.5' or '5'. Defaults to 16px. */
|
||||
/** Size in px or Tailwind class like '3.5' or '5'. Defaults to 1rem. */
|
||||
size?: number | string;
|
||||
/** Border width in px. Scales automatically if not set. */
|
||||
borderWidth?: number;
|
||||
@@ -26,7 +26,7 @@
|
||||
border-style: solid;
|
||||
border-color: var(--color-gray-300);
|
||||
border-top-color: var(--color-gray-600);
|
||||
border-radius: 9999px;
|
||||
border-radius: 624.9375rem;
|
||||
animation: spin 0.75s linear infinite;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
@@ -17,9 +17,7 @@
|
||||
aria-checked={value}
|
||||
>
|
||||
<span
|
||||
class="absolute top-[2px] w-3 h-3 rounded-full transition-all duration-150
|
||||
{value
|
||||
? 'left-[14px] bg-white dark:bg-black'
|
||||
: 'left-[2px] bg-white dark:bg-gray-500'}"
|
||||
class="absolute top-[0.125rem] w-3 h-3 rounded-full transition-all duration-150
|
||||
{value ? 'left-[0.875rem] bg-white dark:bg-black' : 'left-[0.125rem] bg-white dark:bg-gray-500'}"
|
||||
></span>
|
||||
</button>
|
||||
@@ -51,7 +51,7 @@
|
||||
<div
|
||||
class="overflow-x-auto max-w-full rounded-lg border border-gray-200/60 dark:border-white/8"
|
||||
>
|
||||
<table class="w-full text-[13px] text-left text-gray-600 dark:text-gray-300">
|
||||
<table class="w-full text-[0.8125rem] text-left text-gray-600 dark:text-gray-300">
|
||||
<thead
|
||||
class="text-xs text-gray-500 dark:text-gray-400 uppercase bg-gray-50/80 dark:bg-white/[0.03]"
|
||||
>
|
||||
|
||||
@@ -139,21 +139,21 @@
|
||||
<div
|
||||
class="not-prose rounded-2xl overflow-hidden bg-black/[0.03] dark:bg-white/[0.03] border border-black/[0.06] dark:border-white/[0.06]"
|
||||
>
|
||||
<div class="flex items-center justify-between h-[30px] px-2.5">
|
||||
<span class="text-[11px] font-medium text-gray-500 lowercase">{language || 'text'}</span>
|
||||
<div class="flex items-center justify-between h-[1.875rem] px-2.5">
|
||||
<span class="text-[0.6875rem] font-medium text-gray-500 lowercase">{language || 'text'}</span>
|
||||
<div class="flex items-center gap-1">
|
||||
{#if isDiff && onapply}
|
||||
<button
|
||||
class="text-[11px] px-2 py-0.5 rounded text-green-600 hover:bg-green-600/10 transition-all duration-100"
|
||||
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
|
||||
>
|
||||
<button
|
||||
class="text-[11px] px-2 py-0.5 rounded text-red-600 hover:bg-red-600/10 transition-all duration-100"
|
||||
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
|
||||
>
|
||||
{/if}
|
||||
<button
|
||||
class="text-[11px] 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"
|
||||
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'}
|
||||
@@ -163,14 +163,14 @@
|
||||
|
||||
{#if isDiff}
|
||||
<pre
|
||||
class="!m-0 !pb-3 !px-4 overflow-x-auto text-[13px] leading-normal !bg-transparent font-mono"><code
|
||||
class="!m-0 !pb-3 !px-4 overflow-x-auto text-[0.8125rem] leading-normal !bg-transparent font-mono"><code
|
||||
>{#each diffLines as line}<span class="diff-line diff-{line.type}"
|
||||
>{line.text}
|
||||
</span>{/each}</code
|
||||
></pre>
|
||||
{:else}
|
||||
<pre
|
||||
class="!m-0 !pb-3 !px-4 overflow-x-auto text-[13px] leading-normal !bg-transparent text-[#24292e] dark:text-[#e1e4e8] font-mono"><code
|
||||
class="!m-0 !pb-3 !px-4 overflow-x-auto text-[0.8125rem] leading-normal !bg-transparent text-[#24292e] dark:text-[#e1e4e8] font-mono"><code
|
||||
class="font-[inherit]"
|
||||
bind:this={codeEl}>{code}</code
|
||||
></pre>
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
{@const fileName = filePath.split('/').pop() || filePath}
|
||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
||||
<button
|
||||
class="inline-flex items-center gap-1 px-1 py-px rounded text-[13px] leading-snug font-medium cursor-pointer border-none text-blue-500 dark:text-blue-400 hover:bg-blue-500/8 transition-colors align-baseline"
|
||||
class="inline-flex items-center gap-1 px-1 py-px rounded text-[0.8125rem] leading-snug font-medium cursor-pointer border-none text-blue-500 dark:text-blue-400 hover:bg-blue-500/8 transition-colors align-baseline"
|
||||
title={filePath}
|
||||
onclick={(e) => {
|
||||
e.preventDefault();
|
||||
|
||||
@@ -49,8 +49,8 @@
|
||||
@reference "../../../app.css";
|
||||
|
||||
.mermaid-block {
|
||||
margin: 0 0 12px;
|
||||
border-radius: 8px;
|
||||
margin: 0 0 0.75rem;
|
||||
border-radius: 0.5rem;
|
||||
overflow: hidden;
|
||||
border: 1px solid var(--color-gray-200);
|
||||
}
|
||||
@@ -62,7 +62,7 @@
|
||||
.mermaid-container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 16px;
|
||||
padding: 1rem;
|
||||
background: var(--color-gray-50);
|
||||
overflow-x: auto;
|
||||
}
|
||||
@@ -77,19 +77,19 @@
|
||||
}
|
||||
|
||||
.mermaid-error {
|
||||
padding: 12px 16px;
|
||||
padding: 0.75rem 1rem;
|
||||
background: rgba(220, 38, 38, 0.04);
|
||||
}
|
||||
|
||||
.mermaid-error-label {
|
||||
font-size: 11px;
|
||||
font-size: 0.6875rem;
|
||||
font-weight: 500;
|
||||
color: #dc2626;
|
||||
}
|
||||
|
||||
.mermaid-error-msg {
|
||||
margin: 4px 0 8px;
|
||||
font-size: 12px;
|
||||
margin: 0.25rem 0 0.5rem;
|
||||
font-size: 0.75rem;
|
||||
color: #dc2626;
|
||||
white-space: pre-wrap;
|
||||
font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
|
||||
@@ -97,10 +97,10 @@
|
||||
|
||||
.mermaid-source {
|
||||
margin: 0;
|
||||
padding: 8px 12px;
|
||||
font-size: 12px;
|
||||
padding: 0.5rem 0.75rem;
|
||||
font-size: 0.75rem;
|
||||
background: var(--color-gray-100);
|
||||
border-radius: 4px;
|
||||
border-radius: 0.25rem;
|
||||
color: var(--color-gray-600);
|
||||
font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
font-size: 12.5px;
|
||||
font-size: 0.78125rem;
|
||||
font-family: var(--font-mono);
|
||||
white-space: nowrap;
|
||||
}
|
||||
@@ -91,10 +91,10 @@
|
||||
background: var(--color-gray-50);
|
||||
color: var(--color-gray-600);
|
||||
font-weight: 600;
|
||||
font-size: 11px;
|
||||
font-size: 0.6875rem;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.03em;
|
||||
padding: 6px 12px;
|
||||
padding: 0.375rem 0.75rem;
|
||||
text-align: left;
|
||||
border-bottom: 1px solid var(--color-gray-200);
|
||||
}
|
||||
@@ -106,7 +106,7 @@
|
||||
}
|
||||
|
||||
td {
|
||||
padding: 4px 12px;
|
||||
padding: 0.25rem 0.75rem;
|
||||
color: var(--color-gray-800);
|
||||
border-bottom: 1px solid var(--color-gray-100);
|
||||
}
|
||||
@@ -127,12 +127,12 @@
|
||||
/* Row numbers */
|
||||
.row-num {
|
||||
color: var(--color-gray-400);
|
||||
font-size: 11px;
|
||||
font-size: 0.6875rem;
|
||||
text-align: right;
|
||||
padding-right: 8px;
|
||||
padding-left: 8px;
|
||||
padding-right: 0.5rem;
|
||||
padding-left: 0.5rem;
|
||||
user-select: none;
|
||||
min-width: 32px;
|
||||
min-width: 2rem;
|
||||
border-right: 1px solid var(--color-gray-100);
|
||||
}
|
||||
|
||||
|
||||
@@ -118,12 +118,12 @@
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
background: repeating-conic-gradient(var(--color-gray-100) 0% 25%, transparent 0% 50%) 50% /
|
||||
16px 16px;
|
||||
1rem 1rem;
|
||||
}
|
||||
|
||||
:global(.dark) .image-preview {
|
||||
background: repeating-conic-gradient(rgba(255, 255, 255, 0.04) 0% 25%, transparent 0% 50%) 50% /
|
||||
16px 16px;
|
||||
1rem 1rem;
|
||||
}
|
||||
|
||||
.image-content {
|
||||
@@ -138,39 +138,39 @@
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
object-fit: contain;
|
||||
padding: 12px;
|
||||
padding: 0.75rem;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.zoom-toolbar {
|
||||
position: absolute;
|
||||
bottom: 12px;
|
||||
bottom: 0.75rem;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 2px;
|
||||
padding: 2px;
|
||||
border-radius: 8px;
|
||||
gap: 0.125rem;
|
||||
padding: 0.125rem;
|
||||
border-radius: 0.5rem;
|
||||
background: rgba(255, 255, 255, 0.9);
|
||||
backdrop-filter: blur(8px);
|
||||
backdrop-filter: blur(0.5rem);
|
||||
border: 1px solid rgba(0, 0, 0, 0.08);
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||
box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
:global(.dark) .zoom-toolbar {
|
||||
background: rgba(30, 30, 30, 0.9);
|
||||
border-color: rgba(255, 255, 255, 0.1);
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
|
||||
box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
.zoom-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
border-radius: 6px;
|
||||
width: 1.75rem;
|
||||
height: 1.75rem;
|
||||
border-radius: 0.375rem;
|
||||
color: var(--color-gray-500);
|
||||
transition: all 0.1s;
|
||||
}
|
||||
@@ -186,13 +186,13 @@
|
||||
}
|
||||
|
||||
.zoom-level {
|
||||
min-width: 48px;
|
||||
padding: 4px 6px;
|
||||
font-size: 11px;
|
||||
min-width: 3rem;
|
||||
padding: 0.25rem 0.375rem;
|
||||
font-size: 0.6875rem;
|
||||
font-weight: 500;
|
||||
text-align: center;
|
||||
color: var(--color-gray-500);
|
||||
border-radius: 6px;
|
||||
border-radius: 0.375rem;
|
||||
font-variant-numeric: tabular-nums;
|
||||
transition: all 0.1s;
|
||||
}
|
||||
|
||||
@@ -95,9 +95,9 @@
|
||||
.tree-node {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
min-height: 22px;
|
||||
min-height: 1.375rem;
|
||||
font-family: var(--font-mono);
|
||||
font-size: 12.5px;
|
||||
font-size: 0.78125rem;
|
||||
line-height: 1.6;
|
||||
white-space: nowrap;
|
||||
}
|
||||
@@ -106,11 +106,11 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
width: 1rem;
|
||||
height: 1rem;
|
||||
flex-shrink: 0;
|
||||
color: var(--color-gray-400);
|
||||
font-size: 8px;
|
||||
font-size: 0.5rem;
|
||||
transition: color 0.1s;
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
}
|
||||
|
||||
.spacer {
|
||||
width: 16px;
|
||||
width: 1rem;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@
|
||||
|
||||
.preview {
|
||||
color: var(--color-gray-400);
|
||||
font-size: 11px;
|
||||
font-size: 0.6875rem;
|
||||
}
|
||||
|
||||
.bracket {
|
||||
|
||||
@@ -348,19 +348,17 @@
|
||||
}
|
||||
|
||||
.error-msg {
|
||||
font-size: 13px;
|
||||
font-size: 0.8125rem;
|
||||
color: #ef4444;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ── DOCX ────────────────────────────────────── */
|
||||
|
||||
.docx-content {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 24px 32px;
|
||||
font-size: 14px;
|
||||
padding: 1.5rem 2rem;
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.7;
|
||||
color: var(--color-gray-800);
|
||||
}
|
||||
@@ -370,32 +368,32 @@
|
||||
}
|
||||
|
||||
.docx-content :global(h1) {
|
||||
font-size: 24px;
|
||||
font-size: 1.5rem;
|
||||
font-weight: 600;
|
||||
margin: 0 0 8px;
|
||||
margin: 0 0 0.5rem;
|
||||
}
|
||||
.docx-content :global(h2) {
|
||||
font-size: 20px;
|
||||
font-size: 1.25rem;
|
||||
font-weight: 600;
|
||||
margin: 24px 0 8px;
|
||||
margin: 1.5rem 0 0.5rem;
|
||||
}
|
||||
.docx-content :global(h3) {
|
||||
font-size: 16px;
|
||||
font-size: 1rem;
|
||||
font-weight: 600;
|
||||
margin: 20px 0 6px;
|
||||
margin: 1.25rem 0 0.375rem;
|
||||
}
|
||||
.docx-content :global(p) {
|
||||
margin: 0 0 12px;
|
||||
margin: 0 0 0.75rem;
|
||||
}
|
||||
.docx-content :global(table) {
|
||||
border-collapse: collapse;
|
||||
margin: 12px 0;
|
||||
font-size: 13px;
|
||||
margin: 0.75rem 0;
|
||||
font-size: 0.8125rem;
|
||||
}
|
||||
.docx-content :global(td),
|
||||
.docx-content :global(th) {
|
||||
border: 1px solid var(--color-gray-200);
|
||||
padding: 4px 8px;
|
||||
padding: 0.25rem 0.5rem;
|
||||
}
|
||||
.docx-content :global(img) {
|
||||
max-width: 100%;
|
||||
@@ -408,7 +406,7 @@
|
||||
display: flex;
|
||||
gap: 0;
|
||||
border-bottom: 1px solid var(--color-gray-200);
|
||||
padding: 0 4px;
|
||||
padding: 0 0.25rem;
|
||||
flex-shrink: 0;
|
||||
overflow-x: auto;
|
||||
}
|
||||
@@ -418,11 +416,11 @@
|
||||
}
|
||||
|
||||
.sheet-tab {
|
||||
padding: 6px 12px;
|
||||
font-size: 11px;
|
||||
padding: 0.375rem 0.75rem;
|
||||
font-size: 0.6875rem;
|
||||
font-weight: 500;
|
||||
color: var(--color-gray-500);
|
||||
border-bottom: 2px solid transparent;
|
||||
border-bottom: 0.125rem solid transparent;
|
||||
white-space: nowrap;
|
||||
transition: all 0.1s;
|
||||
}
|
||||
@@ -445,7 +443,7 @@
|
||||
.xlsx-content :global(table) {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
font-size: 12px;
|
||||
font-size: 0.75rem;
|
||||
font-family: var(--font-mono);
|
||||
white-space: nowrap;
|
||||
}
|
||||
@@ -460,8 +458,8 @@
|
||||
background: var(--color-gray-50);
|
||||
color: var(--color-gray-500);
|
||||
font-weight: 600;
|
||||
font-size: 10px;
|
||||
padding: 4px 8px;
|
||||
font-size: 0.625rem;
|
||||
padding: 0.25rem 0.5rem;
|
||||
text-align: center;
|
||||
border-bottom: 1px solid var(--color-gray-200);
|
||||
}
|
||||
@@ -473,7 +471,7 @@
|
||||
}
|
||||
|
||||
.xlsx-content :global(td) {
|
||||
padding: 3px 8px;
|
||||
padding: 0.1875rem 0.5rem;
|
||||
color: var(--color-gray-800);
|
||||
border-bottom: 1px solid var(--color-gray-100);
|
||||
border-right: 1px solid var(--color-gray-100);
|
||||
@@ -487,10 +485,10 @@
|
||||
|
||||
.xlsx-content :global(.rn) {
|
||||
color: var(--color-gray-400);
|
||||
font-size: 10px;
|
||||
font-size: 0.625rem;
|
||||
text-align: right;
|
||||
user-select: none;
|
||||
min-width: 28px;
|
||||
min-width: 1.75rem;
|
||||
border-right: 1px solid var(--color-gray-200);
|
||||
background: var(--color-gray-50);
|
||||
}
|
||||
@@ -514,10 +512,10 @@
|
||||
.pptx-content {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 16px;
|
||||
padding: 1rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
gap: 0.5rem;
|
||||
align-items: center;
|
||||
background: var(--color-gray-100);
|
||||
}
|
||||
@@ -529,9 +527,9 @@
|
||||
.slide {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
max-width: 800px;
|
||||
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
|
||||
border-radius: 4px;
|
||||
max-width: 50rem;
|
||||
box-shadow: 0 0.0625rem 0.25rem rgba(0, 0, 0, 0.12);
|
||||
border-radius: 0.25rem;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@@ -542,13 +540,13 @@
|
||||
|
||||
.slide-num {
|
||||
position: absolute;
|
||||
top: 6px;
|
||||
left: 6px;
|
||||
font-size: 10px;
|
||||
top: 0.375rem;
|
||||
left: 0.375rem;
|
||||
font-size: 0.625rem;
|
||||
font-weight: 600;
|
||||
color: white;
|
||||
background: rgba(0, 0, 0, 0.4);
|
||||
padding: 1px 6px;
|
||||
border-radius: 3px;
|
||||
padding: 0.0625rem 0.375rem;
|
||||
border-radius: 0.1875rem;
|
||||
}
|
||||
</style>
|
||||
@@ -72,7 +72,7 @@
|
||||
wrapper.style.width = `${Math.round(cssScale * viewport.width)}px`;
|
||||
wrapper.style.height = `${Math.round(cssScale * viewport.height)}px`;
|
||||
wrapper.style.setProperty('--scale-factor', String(cssViewport.scale));
|
||||
if (i > 1) wrapper.style.marginTop = '4px';
|
||||
if (i > 1) wrapper.style.marginTop = '0.25rem';
|
||||
|
||||
// Canvas
|
||||
const canvas = document.createElement('canvas');
|
||||
@@ -304,42 +304,40 @@
|
||||
}
|
||||
|
||||
.error-msg {
|
||||
font-size: 13px;
|
||||
font-size: 0.8125rem;
|
||||
color: #ef4444;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.zoom-toolbar {
|
||||
position: absolute;
|
||||
bottom: 12px;
|
||||
bottom: 0.75rem;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 2px;
|
||||
padding: 2px;
|
||||
border-radius: 8px;
|
||||
gap: 0.125rem;
|
||||
padding: 0.125rem;
|
||||
border-radius: 0.5rem;
|
||||
background: rgba(255, 255, 255, 0.9);
|
||||
backdrop-filter: blur(8px);
|
||||
backdrop-filter: blur(0.5rem);
|
||||
border: 1px solid rgba(0, 0, 0, 0.08);
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||
box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.1);
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
:global(.dark) .zoom-toolbar {
|
||||
background: rgba(30, 30, 30, 0.9);
|
||||
border-color: rgba(255, 255, 255, 0.1);
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
|
||||
box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
.zoom-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
border-radius: 6px;
|
||||
width: 1.75rem;
|
||||
height: 1.75rem;
|
||||
border-radius: 0.375rem;
|
||||
color: var(--color-gray-500);
|
||||
transition: all 0.1s;
|
||||
}
|
||||
@@ -355,13 +353,13 @@
|
||||
}
|
||||
|
||||
.zoom-level {
|
||||
min-width: 48px;
|
||||
padding: 4px 6px;
|
||||
font-size: 11px;
|
||||
min-width: 3rem;
|
||||
padding: 0.25rem 0.375rem;
|
||||
font-size: 0.6875rem;
|
||||
font-weight: 500;
|
||||
text-align: center;
|
||||
color: var(--color-gray-500);
|
||||
border-radius: 6px;
|
||||
border-radius: 0.375rem;
|
||||
font-variant-numeric: tabular-nums;
|
||||
transition: all 0.1s;
|
||||
}
|
||||
|
||||
@@ -220,9 +220,15 @@
|
||||
<!-- Pagination -->
|
||||
{#if !queryMode && totalRows > PAGE_SIZE}
|
||||
<div class="pagination">
|
||||
<button class="page-btn" onclick={prevPage} disabled={page === 0}>{$t('sqlite.prev')}</button>
|
||||
<button class="page-btn" onclick={prevPage} disabled={page === 0}
|
||||
>{$t('sqlite.prev')}</button
|
||||
>
|
||||
<span class="page-info">
|
||||
{$t('sqlite.pageInfo', { start: page * PAGE_SIZE + 1, end: Math.min((page + 1) * PAGE_SIZE, totalRows), total: totalRows })}
|
||||
{$t('sqlite.pageInfo', {
|
||||
start: page * PAGE_SIZE + 1,
|
||||
end: Math.min((page + 1) * PAGE_SIZE, totalRows),
|
||||
total: totalRows
|
||||
})}
|
||||
</span>
|
||||
<button class="page-btn" onclick={nextPage} disabled={(page + 1) * PAGE_SIZE >= totalRows}
|
||||
>{$t('sqlite.next')}</button
|
||||
@@ -250,12 +256,10 @@
|
||||
}
|
||||
|
||||
.error-msg {
|
||||
font-size: 13px;
|
||||
font-size: 0.8125rem;
|
||||
color: #ef4444;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ── Tab bar ──────────────────────────────────── */
|
||||
|
||||
.tab-bar {
|
||||
@@ -263,7 +267,7 @@
|
||||
align-items: center;
|
||||
gap: 0;
|
||||
border-bottom: 1px solid var(--color-gray-200);
|
||||
padding: 0 4px;
|
||||
padding: 0 0.25rem;
|
||||
flex-shrink: 0;
|
||||
overflow-x: auto;
|
||||
}
|
||||
@@ -281,11 +285,11 @@
|
||||
}
|
||||
|
||||
.tab {
|
||||
padding: 6px 12px;
|
||||
font-size: 11px;
|
||||
padding: 0.375rem 0.75rem;
|
||||
font-size: 0.6875rem;
|
||||
font-weight: 500;
|
||||
color: var(--color-gray-500);
|
||||
border-bottom: 2px solid transparent;
|
||||
border-bottom: 0.125rem solid transparent;
|
||||
transition: all 0.1s;
|
||||
white-space: nowrap;
|
||||
}
|
||||
@@ -311,15 +315,15 @@
|
||||
.query-tab {
|
||||
margin-left: auto;
|
||||
font-family: var(--font-mono);
|
||||
font-size: 10px;
|
||||
font-size: 0.625rem;
|
||||
}
|
||||
|
||||
/* ── Query bar ────────────────────────────────── */
|
||||
|
||||
.query-bar {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
padding: 8px 12px;
|
||||
gap: 0.5rem;
|
||||
padding: 0.5rem 0.75rem;
|
||||
border-bottom: 1px solid var(--color-gray-100);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
@@ -331,10 +335,10 @@
|
||||
.query-input {
|
||||
flex: 1;
|
||||
font-family: var(--font-mono);
|
||||
font-size: 12px;
|
||||
padding: 6px 10px;
|
||||
font-size: 0.75rem;
|
||||
padding: 0.375rem 0.625rem;
|
||||
border: 1px solid var(--color-gray-200);
|
||||
border-radius: 6px;
|
||||
border-radius: 0.375rem;
|
||||
background: transparent;
|
||||
color: var(--color-gray-800);
|
||||
resize: vertical;
|
||||
@@ -351,12 +355,12 @@
|
||||
}
|
||||
|
||||
.run-btn {
|
||||
padding: 6px 12px;
|
||||
font-size: 11px;
|
||||
padding: 0.375rem 0.75rem;
|
||||
font-size: 0.6875rem;
|
||||
font-weight: 500;
|
||||
color: white;
|
||||
background: #2563eb;
|
||||
border-radius: 6px;
|
||||
border-radius: 0.375rem;
|
||||
align-self: flex-end;
|
||||
transition: background 0.1s;
|
||||
}
|
||||
@@ -366,8 +370,8 @@
|
||||
}
|
||||
|
||||
.query-error {
|
||||
padding: 6px 12px;
|
||||
font-size: 11px;
|
||||
padding: 0.375rem 0.75rem;
|
||||
font-size: 0.6875rem;
|
||||
font-family: var(--font-mono);
|
||||
color: #ef4444;
|
||||
background: rgba(239, 68, 68, 0.06);
|
||||
@@ -384,7 +388,7 @@
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
font-size: 12px;
|
||||
font-size: 0.75rem;
|
||||
font-family: var(--font-mono);
|
||||
white-space: nowrap;
|
||||
}
|
||||
@@ -399,8 +403,8 @@
|
||||
background: var(--color-gray-50);
|
||||
color: var(--color-gray-600);
|
||||
font-weight: 600;
|
||||
font-size: 11px;
|
||||
padding: 5px 10px;
|
||||
font-size: 0.6875rem;
|
||||
padding: 0.3125rem 0.625rem;
|
||||
text-align: left;
|
||||
border-bottom: 1px solid var(--color-gray-200);
|
||||
}
|
||||
@@ -412,7 +416,7 @@
|
||||
}
|
||||
|
||||
td {
|
||||
padding: 3px 10px;
|
||||
padding: 0.1875rem 0.625rem;
|
||||
color: var(--color-gray-800);
|
||||
border-bottom: 1px solid var(--color-gray-100);
|
||||
}
|
||||
@@ -432,11 +436,11 @@
|
||||
|
||||
.row-num {
|
||||
color: var(--color-gray-400);
|
||||
font-size: 10px;
|
||||
font-size: 0.625rem;
|
||||
text-align: right;
|
||||
padding-right: 6px;
|
||||
padding-right: 0.375rem;
|
||||
user-select: none;
|
||||
min-width: 32px;
|
||||
min-width: 2rem;
|
||||
border-right: 1px solid var(--color-gray-100);
|
||||
}
|
||||
|
||||
@@ -469,8 +473,8 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 12px;
|
||||
padding: 6px;
|
||||
gap: 0.75rem;
|
||||
padding: 0.375rem;
|
||||
border-top: 1px solid var(--color-gray-100);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
@@ -480,9 +484,9 @@
|
||||
}
|
||||
|
||||
.page-btn {
|
||||
font-size: 11px;
|
||||
padding: 3px 10px;
|
||||
border-radius: 4px;
|
||||
font-size: 0.6875rem;
|
||||
padding: 0.1875rem 0.625rem;
|
||||
border-radius: 0.25rem;
|
||||
color: var(--color-gray-500);
|
||||
transition: all 0.1s;
|
||||
}
|
||||
@@ -503,7 +507,7 @@
|
||||
}
|
||||
|
||||
.page-info {
|
||||
font-size: 11px;
|
||||
font-size: 0.6875rem;
|
||||
color: var(--color-gray-400);
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
@@ -122,8 +122,8 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 36px;
|
||||
padding: 0 12px;
|
||||
height: 2.25rem;
|
||||
padding: 0 0.75rem;
|
||||
border-bottom: 1px solid var(--color-gray-200);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
@@ -140,11 +140,11 @@
|
||||
.toolbar-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 2px;
|
||||
gap: 0.125rem;
|
||||
}
|
||||
|
||||
.file-label {
|
||||
font-size: 11px;
|
||||
font-size: 0.6875rem;
|
||||
font-weight: 500;
|
||||
color: var(--color-gray-500);
|
||||
}
|
||||
@@ -153,10 +153,10 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-width: 24px;
|
||||
height: 24px;
|
||||
padding: 0 4px;
|
||||
border-radius: 6px;
|
||||
min-width: 1.5rem;
|
||||
height: 1.5rem;
|
||||
padding: 0 0.25rem;
|
||||
border-radius: 0.375rem;
|
||||
color: var(--color-gray-400);
|
||||
transition: all 0.1s;
|
||||
}
|
||||
@@ -178,7 +178,7 @@
|
||||
}
|
||||
|
||||
.zoom-text {
|
||||
font-size: 10px;
|
||||
font-size: 0.625rem;
|
||||
font-weight: 500;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
@@ -193,12 +193,12 @@
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
background: repeating-conic-gradient(var(--color-gray-100) 0% 25%, transparent 0% 50%) 50% /
|
||||
16px 16px;
|
||||
1rem 1rem;
|
||||
}
|
||||
|
||||
:global(.dark) .visual-container {
|
||||
background: repeating-conic-gradient(rgba(255, 255, 255, 0.04) 0% 25%, transparent 0% 50%) 50% /
|
||||
16px 16px;
|
||||
1rem 1rem;
|
||||
}
|
||||
|
||||
.visual-content {
|
||||
@@ -207,7 +207,7 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 24px;
|
||||
padding: 1.5rem;
|
||||
}
|
||||
|
||||
.visual-content :global(svg) {
|
||||
@@ -220,9 +220,9 @@
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
margin: 0;
|
||||
padding: 12px 16px;
|
||||
padding: 0.75rem 1rem;
|
||||
font-family: var(--font-mono);
|
||||
font-size: 12.5px;
|
||||
font-size: 0.78125rem;
|
||||
line-height: 1.6;
|
||||
color: var(--color-gray-800);
|
||||
white-space: pre-wrap;
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
const keyboardInset = Math.max(0, window.innerHeight - visualBottom);
|
||||
document.documentElement.style.setProperty(
|
||||
'--keyboard-inset-bottom',
|
||||
keyboardInset > 100 ? `${keyboardInset}px` : '0px'
|
||||
keyboardInset > 100 ? `${keyboardInset}px` : '0'
|
||||
);
|
||||
};
|
||||
|
||||
@@ -448,7 +448,7 @@
|
||||
<div
|
||||
id="main-col"
|
||||
class="flex flex-col flex-1 min-w-0 min-h-0 overflow-hidden"
|
||||
style="padding-top: env(safe-area-inset-top, 0px); padding-bottom: var(--keyboard-inset-bottom, 0px);"
|
||||
style="padding-top: env(safe-area-inset-top, 0); padding-bottom: var(--keyboard-inset-bottom, 0);"
|
||||
>
|
||||
{#if !$currentWorkspace && $page.url.pathname === '/'}
|
||||
<Bar />
|
||||
@@ -494,6 +494,6 @@
|
||||
closeButton
|
||||
richColors
|
||||
toastOptions={{
|
||||
style: 'font-size: 12px; font-family: var(--font-sans); border-radius: 8px;'
|
||||
style: 'font-size: 0.75rem; font-family: var(--font-sans); border-radius: 0.5rem;'
|
||||
}}
|
||||
/>
|
||||
@@ -715,7 +715,7 @@
|
||||
{#if $appVersion}
|
||||
<button
|
||||
onclick={() => showChangelog.set(true)}
|
||||
class="cursor-pointer font-mono text-[11px] text-gray-400 hover:text-gray-500 hover:underline dark:text-gray-600 dark:hover:text-gray-400"
|
||||
class="cursor-pointer font-mono text-[0.6875rem] text-gray-400 hover:text-gray-500 hover:underline dark:text-gray-600 dark:hover:text-gray-400"
|
||||
>
|
||||
v{$appVersion}
|
||||
</button>
|
||||
@@ -731,7 +731,7 @@
|
||||
<div class="mb-6">
|
||||
<h2 class="mb-2 text-xs text-gray-400 dark:text-gray-600">{$t('home.start')}</h2>
|
||||
<button
|
||||
class="text-[13px] text-gray-600 transition-colors duration-100 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white"
|
||||
class="text-[0.8125rem] text-gray-600 transition-colors duration-100 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white"
|
||||
onclick={() => (showPicker = true)}
|
||||
>
|
||||
{$t('home.openWorkspace')}
|
||||
@@ -747,22 +747,22 @@
|
||||
>
|
||||
<span class="flex min-w-0 items-baseline gap-2">
|
||||
<span
|
||||
class="truncate text-[13px] text-gray-800 group-hover:text-gray-950 dark:text-gray-200 dark:group-hover:text-white"
|
||||
class="truncate text-[0.8125rem] text-gray-800 group-hover:text-gray-950 dark:text-gray-200 dark:group-hover:text-white"
|
||||
>
|
||||
{continuation.name}
|
||||
</span>
|
||||
<span class="truncate font-mono text-[11px] text-gray-400 dark:text-gray-600">
|
||||
<span class="truncate font-mono text-[0.6875rem] text-gray-400 dark:text-gray-600">
|
||||
{shortenPath(continuation.path)}
|
||||
</span>
|
||||
</span>
|
||||
{#if continueSignals.length}
|
||||
<span
|
||||
class="mt-0.5 block truncate font-mono text-[10px] text-gray-400 dark:text-gray-600"
|
||||
class="mt-0.5 block truncate font-mono text-[0.625rem] text-gray-400 dark:text-gray-600"
|
||||
>
|
||||
{continueSignals.join(' ')}
|
||||
</span>
|
||||
{:else if continueResume?.activeLabels.length}
|
||||
<span class="mt-0.5 block truncate text-[11px] text-gray-400 dark:text-gray-600">
|
||||
<span class="mt-0.5 block truncate text-[0.6875rem] text-gray-400 dark:text-gray-600">
|
||||
{continueResume.activeLabels.join(' · ')}
|
||||
</span>
|
||||
{/if}
|
||||
@@ -783,22 +783,26 @@
|
||||
>
|
||||
<span class="flex min-w-0 items-baseline gap-2">
|
||||
<span
|
||||
class="truncate text-[13px] text-gray-700 group-hover:text-gray-900 dark:text-gray-300 dark:group-hover:text-white"
|
||||
class="truncate text-[0.8125rem] text-gray-700 group-hover:text-gray-900 dark:text-gray-300 dark:group-hover:text-white"
|
||||
>
|
||||
{item.name}
|
||||
</span>
|
||||
<span class="truncate font-mono text-[11px] text-gray-400 dark:text-gray-600">
|
||||
<span
|
||||
class="truncate font-mono text-[0.6875rem] text-gray-400 dark:text-gray-600"
|
||||
>
|
||||
{shortenPath(item.path)}
|
||||
</span>
|
||||
</span>
|
||||
{#if signals.length}
|
||||
<span
|
||||
class="mt-0.5 block truncate font-mono text-[10px] text-gray-400 dark:text-gray-600"
|
||||
class="mt-0.5 block truncate font-mono text-[0.625rem] text-gray-400 dark:text-gray-600"
|
||||
>
|
||||
{signals.join(' ')}
|
||||
</span>
|
||||
{:else if resume?.activeLabels.length}
|
||||
<span class="mt-0.5 block truncate text-[11px] text-gray-400 dark:text-gray-600">
|
||||
<span
|
||||
class="mt-0.5 block truncate text-[0.6875rem] text-gray-400 dark:text-gray-600"
|
||||
>
|
||||
{resume.activeLabels.join(' · ')}
|
||||
</span>
|
||||
{/if}
|
||||
@@ -810,7 +814,7 @@
|
||||
<div class="mb-6">
|
||||
<h2 class="mb-2 text-xs text-gray-400 dark:text-gray-600">{$t('home.recent')}</h2>
|
||||
<button
|
||||
class="text-[13px] text-gray-500 transition-colors duration-100 hover:text-gray-900 dark:text-gray-500 dark:hover:text-white"
|
||||
class="text-[0.8125rem] text-gray-500 transition-colors duration-100 hover:text-gray-900 dark:text-gray-500 dark:hover:text-white"
|
||||
onclick={() => (showPicker = true)}
|
||||
>
|
||||
{$t('home.noWorkspaces')}
|
||||
@@ -824,7 +828,7 @@
|
||||
<div class="flex flex-col">
|
||||
{#each nearby as item}
|
||||
<button
|
||||
class="flex min-w-0 items-center gap-2 py-1.5 text-left text-[13px] text-gray-600 transition-colors duration-100 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white"
|
||||
class="flex min-w-0 items-center gap-2 py-1.5 text-left text-[0.8125rem] text-gray-600 transition-colors duration-100 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white"
|
||||
onclick={() => quickOpen(item.path)}
|
||||
>
|
||||
<Icon
|
||||
@@ -834,7 +838,7 @@
|
||||
class="shrink-0 text-gray-400 dark:text-gray-600"
|
||||
/>
|
||||
<span class="truncate">{item.name}</span>
|
||||
<span class="truncate font-mono text-[11px] text-gray-400 dark:text-gray-600">
|
||||
<span class="truncate font-mono text-[0.6875rem] text-gray-400 dark:text-gray-600">
|
||||
{shortenPath(item.path)}
|
||||
</span>
|
||||
</button>
|
||||
@@ -1024,12 +1028,12 @@
|
||||
}
|
||||
|
||||
.split-divider-h {
|
||||
width: 6px;
|
||||
width: 0.375rem;
|
||||
cursor: col-resize;
|
||||
}
|
||||
|
||||
.split-divider-v {
|
||||
height: 6px;
|
||||
height: 0.375rem;
|
||||
cursor: row-resize;
|
||||
}
|
||||
|
||||
@@ -1090,22 +1094,22 @@
|
||||
position: absolute;
|
||||
z-index: 15;
|
||||
background: oklch(0.65 0.15 250 / 0.08);
|
||||
border: 2px dashed oklch(0.65 0.15 250 / 0.3);
|
||||
border-radius: 8px;
|
||||
border: 0.125rem dashed oklch(0.65 0.15 250 / 0.3);
|
||||
border-radius: 0.5rem;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.split-drop-right {
|
||||
top: 8px;
|
||||
right: 8px;
|
||||
bottom: 8px;
|
||||
top: 0.5rem;
|
||||
right: 0.5rem;
|
||||
bottom: 0.5rem;
|
||||
width: 45%;
|
||||
}
|
||||
|
||||
.split-drop-bottom {
|
||||
left: 8px;
|
||||
right: 8px;
|
||||
bottom: 8px;
|
||||
left: 0.5rem;
|
||||
right: 0.5rem;
|
||||
bottom: 0.5rem;
|
||||
height: 45%;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user