mirror of
https://github.com/open-webui/computer.git
synced 2026-11-26 07:11:02 -05:00
refac
This commit is contained in:
1 parent
9a162b1bfd
commit
14cfd98a67
22 files changed
+127
-77
No files matched your search
@@ -15,7 +15,7 @@
|
||||
<meta name="mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
||||
<meta name="apple-mobile-web-app-title" content="cptr" />
|
||||
<meta name="apple-mobile-web-app-title" content="Computer" />
|
||||
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
|
||||
<link rel="apple-touch-startup-image" href="/icon-512.png" />
|
||||
%sveltekit.head%
|
||||
|
||||
@@ -61,12 +61,12 @@
|
||||
{ name: 'ARCH', desc: 'Machine architecture' },
|
||||
{ name: 'SHELL', desc: 'Default shell path' },
|
||||
{ name: 'HOME', desc: 'Home directory' },
|
||||
{ name: 'CPTR_VERSION', desc: 'cptr version' },
|
||||
{ name: 'CPTR_VERSION', desc: 'Computer version' },
|
||||
{ name: 'DATE', desc: 'Current date (ISO format)' },
|
||||
{ name: 'MODEL', desc: 'Model ID being used' }
|
||||
];
|
||||
|
||||
const DEFAULT_PROMPT_PLACEHOLDER = `You are Computer (cptr), a helpful assistant running inside the user's computer interface. You have access to tools to read, search, and modify files in the workspace, run commands, and use configured tools. Use them to help the user directly. Approach hard requests with initiative and persistence: make the best possible attempt, adapt as needed, and keep going unless a real constraint prevents progress.
|
||||
const DEFAULT_PROMPT_PLACEHOLDER = `You are Computer, a helpful assistant running inside the user's computer interface. You have access to tools to read, search, and modify files in the workspace, run commands, and use configured tools. Use them to help the user directly. Approach hard requests with initiative and persistence: make the best possible attempt, adapt as needed, and keep going unless a real constraint prevents progress.
|
||||
|
||||
{{CPTR_CONTEXT}}
|
||||
|
||||
|
||||
@@ -72,7 +72,9 @@
|
||||
|
||||
<div class="flex items-center justify-center h-dvh bg-white dark:bg-black p-6">
|
||||
<div class="w-full max-w-md">
|
||||
<h1 class="text-lg font-semibold tracking-tight text-gray-900 dark:text-white mb-3">cptr</h1>
|
||||
<h1 class="text-lg font-semibold tracking-tight text-gray-900 dark:text-white mb-3">
|
||||
Computer
|
||||
</h1>
|
||||
|
||||
{#if isSetup}
|
||||
<p class="text-xs text-gray-400 dark:text-gray-600 -mt-2 mb-3">
|
||||
|
||||
@@ -47,10 +47,7 @@
|
||||
|
||||
function onPointerUp(e: PointerEvent) {
|
||||
(e.currentTarget as HTMLElement).releasePointerCapture?.(e.pointerId);
|
||||
if (
|
||||
closeButtonEl &&
|
||||
(e.target === closeButtonEl || closeButtonEl.contains(e.target as Node))
|
||||
) {
|
||||
if (closeButtonEl && (e.target === closeButtonEl || closeButtonEl.contains(e.target as Node))) {
|
||||
return;
|
||||
}
|
||||
if (!moved) {
|
||||
@@ -74,22 +71,31 @@
|
||||
bind:this={closeButtonEl}
|
||||
class="absolute -top-0.5 -left-0.5 p-0.5 rounded-full opacity-0 group-hover:opacity-100 bg-gray-200 dark:bg-[#222] text-gray-500 dark:text-gray-400 hover:bg-gray-300 dark:hover:bg-[#333] hover:text-gray-700 dark:hover:text-gray-300 border-none cursor-pointer transition-opacity duration-150 z-10"
|
||||
aria-label={$t('a11y.dismissNotification')}
|
||||
onclick={(e) => { e.stopPropagation(); onclose(); }}
|
||||
onclick={(e) => {
|
||||
e.stopPropagation();
|
||||
onclose();
|
||||
}}
|
||||
>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-3 h-3">
|
||||
<path d="M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z" />
|
||||
<path
|
||||
d="M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"
|
||||
/>
|
||||
</svg>
|
||||
</button>
|
||||
|
||||
<!-- Icon -->
|
||||
<div class="shrink-0 self-start -translate-y-0.5">
|
||||
<img src="/favicon.png" alt="cptr" class="w-5 h-5 rounded-full" />
|
||||
<img src="/favicon.png" alt="Computer" class="w-5 h-5 rounded-full" />
|
||||
</div>
|
||||
|
||||
<!-- Content -->
|
||||
<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">{title}</div>
|
||||
<div
|
||||
class="text-[13px] font-medium mb-0.5 overflow-hidden text-ellipsis whitespace-nowrap text-gray-900 dark:text-white"
|
||||
>
|
||||
{title}
|
||||
</div>
|
||||
{/if}
|
||||
{#if content}
|
||||
<div class="text-xs text-gray-500 dark:text-[#aaa] font-normal line-clamp-2">{content}</div>
|
||||
@@ -102,4 +108,3 @@
|
||||
min-width: var(--width, 300px);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { appVersion, showChangelog, updateAvailable, latestVersion } from '$lib/stores';
|
||||
|
||||
const REPO_URL = 'https://github.com/open-webui/computer';
|
||||
const SHARE_TEXT = 'Check out cptr. Your computer, from anywhere.';
|
||||
const SHARE_TEXT = 'Check out Computer. Your computer, from anywhere.';
|
||||
|
||||
const shareLinks = [
|
||||
{
|
||||
@@ -39,7 +39,7 @@
|
||||
href="https://github.com/open-webui/computer"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="text-xs font-semibold text-gray-900 dark:text-white hover:underline">cptr</a
|
||||
class="text-xs font-semibold text-gray-900 dark:text-white hover:underline">Computer</a
|
||||
>
|
||||
{#if $appVersion}
|
||||
<button
|
||||
@@ -104,4 +104,3 @@
|
||||
<p class="text-[11px] text-gray-300 dark:text-gray-700 pt-4">
|
||||
{$t('about.createdBy')}
|
||||
</p>
|
||||
|
||||
@@ -289,7 +289,7 @@
|
||||
e.preventDefault();
|
||||
goto('/');
|
||||
if (typeof window !== 'undefined' && window.innerWidth < 768) sidebarOpen.set(false);
|
||||
}}><img src="/favicon.png" alt="cptr logo" class="w-4 h-4" />Computer</a
|
||||
}}><img src="/favicon.png" alt="Computer logo" class="w-4 h-4" />Computer</a
|
||||
>
|
||||
<button
|
||||
class="flex items-center justify-center w-7 h-7 rounded-lg text-gray-300 hover:text-gray-500 dark:text-gray-600 dark:hover:text-gray-400 transition-colors duration-100"
|
||||
|
||||
@@ -212,7 +212,7 @@
|
||||
"home.start": "Start",
|
||||
"home.openFolder": "Ordner öffnen...",
|
||||
"home.recent": "Zuletzt verwendet",
|
||||
"home.folders": "Ordner",
|
||||
"home.folders": "Vorgeschlagen",
|
||||
"home.chatComingSoon": "Chat (demnächst verfügbar)",
|
||||
"directory.cancel": "Abbrechen",
|
||||
"directory.open": "\"{{name}}\" öffnen",
|
||||
@@ -293,7 +293,7 @@
|
||||
"general.webhookUrlHint": "Unterstützt Slack, Discord, Teams und generische JSON-Webhooks.",
|
||||
"general.updates": "Aktualisierungen",
|
||||
"general.updateNotifications": "Update-Benachrichtigungen",
|
||||
"general.updateNotificationsDesc": "Eine Benachrichtigung anzeigen, wenn eine neue Version von cptr verfügbar ist.",
|
||||
"general.updateNotificationsDesc": "Eine Benachrichtigung anzeigen, wenn eine neue Version von Computer verfügbar ist.",
|
||||
"general.messageQueue": "Nachrichtenwarteschlange",
|
||||
"general.queue": "Warteschlange",
|
||||
"general.interrupt": "Unterbrechen",
|
||||
@@ -597,7 +597,7 @@
|
||||
"admin.gateway.keyWarning": "Dieser Schlüssel wird nur einmal angezeigt. Speichern Sie ihn sicher.",
|
||||
"admin.gateway.loadError": "API-Schlüssel konnten nicht geladen werden",
|
||||
"admin.gateway.model": "Antwortmodell",
|
||||
"admin.gateway.modelDescription": "Gateway-Clients wählen einen Arbeitsbereich; cptr verwendet dieses Modell für die Antwort.",
|
||||
"admin.gateway.modelDescription": "Gateway-Clients wählen einen Arbeitsbereich; Computer verwendet dieses Modell für die Antwort.",
|
||||
"admin.gateway.modelFallback": "Arbeitsbereich-/Standardmodell verwenden",
|
||||
"admin.gateway.modelSaveError": "Gateway-Modell konnte nicht gespeichert werden",
|
||||
"admin.gateway.newKey": "Neuer API-Schlüssel erstellt. Jetzt kopieren",
|
||||
|
||||
@@ -262,7 +262,7 @@
|
||||
"home.start": "Start",
|
||||
"home.openFolder": "Open Folder...",
|
||||
"home.recent": "Recent",
|
||||
"home.folders": "Folders",
|
||||
"home.folders": "Suggested",
|
||||
"home.chatComingSoon": "Chat (coming soon)",
|
||||
|
||||
"directory.cancel": "Cancel",
|
||||
@@ -379,7 +379,7 @@
|
||||
"general.webhookUrlHint": "Supports Slack, Discord, Teams, and generic JSON webhooks.",
|
||||
"general.updates": "Updates",
|
||||
"general.updateNotifications": "Update notifications",
|
||||
"general.updateNotificationsDesc": "Show a toast when a new version of cptr is available.",
|
||||
"general.updateNotificationsDesc": "Show a toast when a new version of Computer is available.",
|
||||
"general.messageQueue": "Message queue",
|
||||
"general.queue": "Queue",
|
||||
"general.interrupt": "Interrupt",
|
||||
@@ -482,7 +482,7 @@
|
||||
"admin.gateway.description": "Generate API keys to connect Open WebUI or any OpenAI-compatible client to your workspaces.",
|
||||
"admin.gateway.loadError": "Failed to load API keys",
|
||||
"admin.gateway.model": "Response model",
|
||||
"admin.gateway.modelDescription": "Gateway clients choose a workspace; cptr uses this model to generate the response.",
|
||||
"admin.gateway.modelDescription": "Gateway clients choose a workspace; Computer uses this model to generate the response.",
|
||||
"admin.gateway.modelFallback": "Use workspace/default model",
|
||||
"admin.gateway.modelSaveError": "Failed to save gateway model",
|
||||
"admin.gateway.createKey": "Create key",
|
||||
|
||||
@@ -212,7 +212,7 @@
|
||||
"home.start": "Inicio",
|
||||
"home.openFolder": "Abrir carpeta...",
|
||||
"home.recent": "Recientes",
|
||||
"home.folders": "Carpetas",
|
||||
"home.folders": "Sugeridos",
|
||||
"home.chatComingSoon": "Chat (próximamente)",
|
||||
"directory.cancel": "Cancelar",
|
||||
"directory.open": "Abrir \"{{name}}\"",
|
||||
@@ -293,7 +293,7 @@
|
||||
"general.webhookUrlHint": "Compatible con Slack, Discord, Teams y webhooks JSON genéricos.",
|
||||
"general.updates": "Actualizaciones",
|
||||
"general.updateNotifications": "Notificaciones de actualización",
|
||||
"general.updateNotificationsDesc": "Mostrar un aviso cuando hay una nueva versión de cptr disponible.",
|
||||
"general.updateNotificationsDesc": "Mostrar un aviso cuando hay una nueva versión de Computer disponible.",
|
||||
"general.messageQueue": "Cola de mensajes",
|
||||
"general.queue": "Cola",
|
||||
"general.interrupt": "Interrumpir",
|
||||
@@ -597,7 +597,7 @@
|
||||
"admin.gateway.keyWarning": "Esta clave solo se mostrará una vez. Guárdala de forma segura.",
|
||||
"admin.gateway.loadError": "Error al cargar las claves API",
|
||||
"admin.gateway.model": "Modelo de respuesta",
|
||||
"admin.gateway.modelDescription": "Los clientes gateway eligen un espacio de trabajo; cptr usa este modelo para generar la respuesta.",
|
||||
"admin.gateway.modelDescription": "Los clientes gateway eligen un espacio de trabajo; Computer usa este modelo para generar la respuesta.",
|
||||
"admin.gateway.modelFallback": "Usar modelo del espacio de trabajo/predeterminado",
|
||||
"admin.gateway.modelSaveError": "Error al guardar el modelo gateway",
|
||||
"admin.gateway.newKey": "Nueva clave API creada. Cópiala ahora",
|
||||
|
||||
@@ -212,7 +212,7 @@
|
||||
"home.start": "Démarrer",
|
||||
"home.openFolder": "Ouvrir un dossier...",
|
||||
"home.recent": "Récents",
|
||||
"home.folders": "Dossiers",
|
||||
"home.folders": "Suggérés",
|
||||
"home.chatComingSoon": "Chat (bientôt disponible)",
|
||||
"directory.cancel": "Annuler",
|
||||
"directory.open": "Ouvrir « {{name}} »",
|
||||
@@ -293,7 +293,7 @@
|
||||
"general.webhookUrlHint": "Prend en charge Slack, Discord, Teams et les webhooks JSON génériques.",
|
||||
"general.updates": "Mises à jour",
|
||||
"general.updateNotifications": "Notifications de mise à jour",
|
||||
"general.updateNotificationsDesc": "Afficher une notification lorsqu'une nouvelle version de cptr est disponible.",
|
||||
"general.updateNotificationsDesc": "Afficher une notification lorsqu'une nouvelle version de Computer est disponible.",
|
||||
"general.messageQueue": "File de messages",
|
||||
"general.queue": "File",
|
||||
"general.interrupt": "Interrompre",
|
||||
@@ -596,7 +596,7 @@
|
||||
"admin.gateway.keyWarning": "Cette clé ne sera affichée qu'une seule fois. Conservez-la en sécurité.",
|
||||
"admin.gateway.loadError": "Échec du chargement des clés API",
|
||||
"admin.gateway.model": "Modèle de réponse",
|
||||
"admin.gateway.modelDescription": "Les clients passerelle choisissent un espace de travail ; cptr utilise ce modèle pour générer la réponse.",
|
||||
"admin.gateway.modelDescription": "Les clients passerelle choisissent un espace de travail ; Computer utilise ce modèle pour générer la réponse.",
|
||||
"admin.gateway.modelFallback": "Utiliser le modèle de l'espace de travail/par défaut",
|
||||
"admin.gateway.modelSaveError": "Échec de l'enregistrement du modèle passerelle",
|
||||
"admin.gateway.newKey": "Nouvelle clé API créée. Copiez-la maintenant",
|
||||
|
||||
@@ -212,7 +212,7 @@
|
||||
"home.start": "スタート",
|
||||
"home.openFolder": "フォルダを開く...",
|
||||
"home.recent": "最近",
|
||||
"home.folders": "フォルダ",
|
||||
"home.folders": "おすすめ",
|
||||
"home.chatComingSoon": "チャット(近日公開)",
|
||||
"directory.cancel": "キャンセル",
|
||||
"directory.open": "「{{name}}」を開く",
|
||||
@@ -293,7 +293,7 @@
|
||||
"general.webhookUrlHint": "Slack、Discord、Teams、汎用JSONウェブフックに対応。",
|
||||
"general.updates": "アップデート",
|
||||
"general.updateNotifications": "アップデート通知",
|
||||
"general.updateNotificationsDesc": "cptrの新しいバージョンが利用可能な場合にトーストを表示します。",
|
||||
"general.updateNotificationsDesc": "Computerの新しいバージョンが利用可能な場合にトーストを表示します。",
|
||||
"general.messageQueue": "メッセージキュー",
|
||||
"general.queue": "キュー",
|
||||
"general.interrupt": "中断",
|
||||
@@ -597,7 +597,7 @@
|
||||
"admin.gateway.keyWarning": "このキーは一度だけ表示されます。安全に保管してください。",
|
||||
"admin.gateway.loadError": "APIキーの読み込みに失敗しました",
|
||||
"admin.gateway.model": "応答モデル",
|
||||
"admin.gateway.modelDescription": "ゲートウェイクライアントがワークスペースを選択し、cptrがこのモデルで応答を生成します。",
|
||||
"admin.gateway.modelDescription": "ゲートウェイクライアントがワークスペースを選択し、Computerがこのモデルで応答を生成します。",
|
||||
"admin.gateway.modelFallback": "ワークスペース/デフォルトモデルを使用",
|
||||
"admin.gateway.modelSaveError": "ゲートウェイモデルの保存に失敗しました",
|
||||
"admin.gateway.newKey": "新しいAPIキーが作成されました。今すぐコピーしてください",
|
||||
|
||||
@@ -212,7 +212,7 @@
|
||||
"home.start": "시작",
|
||||
"home.openFolder": "폴더 열기...",
|
||||
"home.recent": "최근",
|
||||
"home.folders": "폴더",
|
||||
"home.folders": "추천",
|
||||
"home.chatComingSoon": "채팅 (출시 예정)",
|
||||
"directory.cancel": "취소",
|
||||
"directory.open": "\"{{name}}\" 열기",
|
||||
@@ -293,7 +293,7 @@
|
||||
"general.webhookUrlHint": "Slack, Discord, Teams 및 일반 JSON 웹훅을 지원합니다.",
|
||||
"general.updates": "업데이트",
|
||||
"general.updateNotifications": "업데이트 알림",
|
||||
"general.updateNotificationsDesc": "cptr의 새 버전이 사용 가능할 때 알림을 표시합니다.",
|
||||
"general.updateNotificationsDesc": "Computer의 새 버전이 사용 가능할 때 알림을 표시합니다.",
|
||||
"general.messageQueue": "메시지 대기열",
|
||||
"general.queue": "대기열",
|
||||
"general.interrupt": "중단",
|
||||
@@ -597,7 +597,7 @@
|
||||
"admin.gateway.keyWarning": "이 키는 한 번만 표시됩니다. 안전하게 보관하세요.",
|
||||
"admin.gateway.loadError": "API 키 로드에 실패했습니다",
|
||||
"admin.gateway.model": "응답 모델",
|
||||
"admin.gateway.modelDescription": "게이트웨이 클라이언트가 작업 공간을 선택하고, cptr이 이 모델로 응답을 생성합니다.",
|
||||
"admin.gateway.modelDescription": "게이트웨이 클라이언트가 작업 공간을 선택하고, Computer가 이 모델로 응답을 생성합니다.",
|
||||
"admin.gateway.modelFallback": "작업 공간/기본 모델 사용",
|
||||
"admin.gateway.modelSaveError": "게이트웨이 모델 저장에 실패했습니다",
|
||||
"admin.gateway.newKey": "새 API 키가 생성되었습니다. 지금 복사하세요",
|
||||
|
||||
@@ -212,7 +212,7 @@
|
||||
"home.start": "Início",
|
||||
"home.openFolder": "Abrir pasta...",
|
||||
"home.recent": "Recentes",
|
||||
"home.folders": "Pastas",
|
||||
"home.folders": "Sugeridos",
|
||||
"home.chatComingSoon": "Chat (em breve)",
|
||||
"directory.cancel": "Cancelar",
|
||||
"directory.open": "Abrir \"{{name}}\"",
|
||||
@@ -293,7 +293,7 @@
|
||||
"general.webhookUrlHint": "Suporta Slack, Discord, Teams e webhooks JSON genéricos.",
|
||||
"general.updates": "Atualizações",
|
||||
"general.updateNotifications": "Notificações de atualização",
|
||||
"general.updateNotificationsDesc": "Mostrar um aviso quando uma nova versão do cptr estiver disponível.",
|
||||
"general.updateNotificationsDesc": "Mostrar um aviso quando uma nova versão do Computer estiver disponível.",
|
||||
"general.messageQueue": "Fila de mensagens",
|
||||
"general.queue": "Fila",
|
||||
"general.interrupt": "Interromper",
|
||||
@@ -597,7 +597,7 @@
|
||||
"admin.gateway.keyWarning": "Esta chave será exibida apenas uma vez. Guarde-a com segurança.",
|
||||
"admin.gateway.loadError": "Falha ao carregar as chaves API",
|
||||
"admin.gateway.model": "Modelo de resposta",
|
||||
"admin.gateway.modelDescription": "Clientes gateway escolhem um workspace; cptr usa este modelo para gerar a resposta.",
|
||||
"admin.gateway.modelDescription": "Clientes gateway escolhem um workspace; Computer usa este modelo para gerar a resposta.",
|
||||
"admin.gateway.modelFallback": "Usar modelo do workspace/padrão",
|
||||
"admin.gateway.modelSaveError": "Falha ao salvar o modelo gateway",
|
||||
"admin.gateway.newKey": "Nova chave API criada. Copie-a agora",
|
||||
|
||||
@@ -212,7 +212,7 @@
|
||||
"home.start": "Начало",
|
||||
"home.openFolder": "Открыть папку...",
|
||||
"home.recent": "Недавние",
|
||||
"home.folders": "Папки",
|
||||
"home.folders": "Предложенные",
|
||||
"home.chatComingSoon": "Чат (скоро)",
|
||||
"directory.cancel": "Отмена",
|
||||
"directory.open": "Открыть \"{{name}}\"",
|
||||
@@ -293,7 +293,7 @@
|
||||
"general.webhookUrlHint": "Поддерживает Slack, Discord, Teams и универсальные JSON-вебхуки.",
|
||||
"general.updates": "Обновления",
|
||||
"general.updateNotifications": "Уведомления об обновлениях",
|
||||
"general.updateNotificationsDesc": "Показывать уведомление, когда доступна новая версия cptr.",
|
||||
"general.updateNotificationsDesc": "Показывать уведомление, когда доступна новая версия Computer.",
|
||||
"general.messageQueue": "Очередь сообщений",
|
||||
"general.queue": "Очередь",
|
||||
"general.interrupt": "Прервать",
|
||||
@@ -597,7 +597,7 @@
|
||||
"admin.gateway.keyWarning": "Этот ключ будет показан только один раз. Сохраните его надёжно.",
|
||||
"admin.gateway.loadError": "Не удалось загрузить API-ключи",
|
||||
"admin.gateway.model": "Модель ответа",
|
||||
"admin.gateway.modelDescription": "Клиенты шлюза выбирают рабочее пространство; cptr использует эту модель для генерации ответа.",
|
||||
"admin.gateway.modelDescription": "Клиенты шлюза выбирают рабочее пространство; Computer использует эту модель для генерации ответа.",
|
||||
"admin.gateway.modelFallback": "Использовать модель рабочего пространства/по умолчанию",
|
||||
"admin.gateway.modelSaveError": "Не удалось сохранить модель шлюза",
|
||||
"admin.gateway.newKey": "Новый API-ключ создан. Скопируйте его сейчас",
|
||||
|
||||
@@ -212,7 +212,7 @@
|
||||
"home.start": "开始",
|
||||
"home.openFolder": "打开文件夹...",
|
||||
"home.recent": "最近",
|
||||
"home.folders": "文件夹",
|
||||
"home.folders": "建议",
|
||||
"home.chatComingSoon": "聊天(即将推出)",
|
||||
"directory.cancel": "取消",
|
||||
"directory.open": "打开「{{name}}」",
|
||||
@@ -293,7 +293,7 @@
|
||||
"general.webhookUrlHint": "支持 Slack、Discord、Teams 和通用 JSON Webhook。",
|
||||
"general.updates": "更新",
|
||||
"general.updateNotifications": "更新通知",
|
||||
"general.updateNotificationsDesc": "当 cptr 有新版本可用时显示提示。",
|
||||
"general.updateNotificationsDesc": "当 Computer 有新版本可用时显示提示。",
|
||||
"general.messageQueue": "消息队列",
|
||||
"general.queue": "队列",
|
||||
"general.interrupt": "中断",
|
||||
@@ -597,7 +597,7 @@
|
||||
"admin.gateway.keyWarning": "此密钥只会显示一次。请安全保存。",
|
||||
"admin.gateway.loadError": "加载 API 密钥失败",
|
||||
"admin.gateway.model": "响应模型",
|
||||
"admin.gateway.modelDescription": "网关客户端选择工作区;cptr 使用此模型生成响应。",
|
||||
"admin.gateway.modelDescription": "网关客户端选择工作区;Computer 使用此模型生成响应。",
|
||||
"admin.gateway.modelFallback": "使用工作区/默认模型",
|
||||
"admin.gateway.modelSaveError": "保存网关模型失败",
|
||||
"admin.gateway.newKey": "新 API 密钥已创建。请立即复制",
|
||||
|
||||
@@ -212,7 +212,7 @@
|
||||
"home.start": "開始",
|
||||
"home.openFolder": "開啟資料夾...",
|
||||
"home.recent": "最近",
|
||||
"home.folders": "資料夾",
|
||||
"home.folders": "建議",
|
||||
"home.chatComingSoon": "聊天(即將推出)",
|
||||
"directory.cancel": "取消",
|
||||
"directory.open": "開啟「{{name}}」",
|
||||
@@ -293,7 +293,7 @@
|
||||
"general.webhookUrlHint": "支援 Slack、Discord、Teams 和通用 JSON Webhook。",
|
||||
"general.updates": "更新",
|
||||
"general.updateNotifications": "更新通知",
|
||||
"general.updateNotificationsDesc": "當 cptr 有新版本可用時顯示提示。",
|
||||
"general.updateNotificationsDesc": "當 Computer 有新版本可用時顯示提示。",
|
||||
"general.messageQueue": "訊息佇列",
|
||||
"general.queue": "佇列",
|
||||
"general.interrupt": "中斷",
|
||||
@@ -597,7 +597,7 @@
|
||||
"admin.gateway.keyWarning": "此金鑰只會顯示一次。請安全儲存。",
|
||||
"admin.gateway.loadError": "載入 API 金鑰失敗",
|
||||
"admin.gateway.model": "回應模型",
|
||||
"admin.gateway.modelDescription": "閘道客戶端選擇工作區;cptr 使用此模型產生回應。",
|
||||
"admin.gateway.modelDescription": "閘道客戶端選擇工作區;Computer 使用此模型產生回應。",
|
||||
"admin.gateway.modelFallback": "使用工作區/預設模型",
|
||||
"admin.gateway.modelSaveError": "儲存閘道模型失敗",
|
||||
"admin.gateway.newKey": "新 API 金鑰已建立。請立即複製",
|
||||
|
||||
@@ -74,8 +74,8 @@ export function setTtsAudioPlaybackSource(src: string, title?: string): HTMLAudi
|
||||
// Control Center (iOS) while TTS is playing.
|
||||
if ('mediaSession' in navigator) {
|
||||
navigator.mediaSession.metadata = new MediaMetadata({
|
||||
title: title || 'cptr',
|
||||
artist: 'cptr',
|
||||
title: title || 'Computer',
|
||||
artist: 'Computer',
|
||||
artwork: [
|
||||
{ src: '/icon-192.png', sizes: '192x192', type: 'image/png' },
|
||||
{ src: '/icon-512.png', sizes: '512x512', type: 'image/png' }
|
||||
|
||||
@@ -121,7 +121,7 @@ export function bindGlobalChatListener() {
|
||||
// Browser notification (only when tab is hidden)
|
||||
if (document.hidden && get(notificationsEnabled)) {
|
||||
try {
|
||||
const notification = new Notification(`${title} • cptr`, {
|
||||
const notification = new Notification(`${title} • Computer`, {
|
||||
body: body.slice(0, 200),
|
||||
icon: '/favicon.png'
|
||||
});
|
||||
|
||||
@@ -408,11 +408,11 @@
|
||||
<title
|
||||
>{$activeTab && $activeTab.type !== 'files'
|
||||
? $currentWorkspace
|
||||
? `${$activeTab.label} / ${$currentWorkspace.name} / cptr`
|
||||
: `${$activeTab.label} / cptr`
|
||||
? `${$activeTab.label} / ${$currentWorkspace.name} / Computer`
|
||||
: `${$activeTab.label} / Computer`
|
||||
: $currentWorkspace
|
||||
? `${$currentWorkspace.name} / cptr`
|
||||
: 'cptr'}</title
|
||||
? `${$currentWorkspace.name} / Computer`
|
||||
: 'Computer'}</title
|
||||
>
|
||||
<meta name="description" content={$t('app.tagline')} />
|
||||
</svelte:head>
|
||||
|
||||
@@ -543,22 +543,42 @@
|
||||
if (resume.terminalCount) signals.push(`${resume.terminalCount} term`);
|
||||
if (resume.previewPorts.length)
|
||||
signals.push(resume.previewPorts.map((port) => `:${port}`).join(', '));
|
||||
if (resume.fileCount)
|
||||
signals.push(`${resume.fileCount} file${resume.fileCount === 1 ? '' : 's'}`);
|
||||
if (resume.chatCount || resume.activeChatCount) {
|
||||
signals.push(
|
||||
resume.activeChatCount ? `${resume.activeChatCount} active` : `${resume.chatCount} chat`
|
||||
resume.activeChatCount
|
||||
? `${resume.activeChatCount} active chat${resume.activeChatCount === 1 ? '' : 's'}`
|
||||
: `${resume.chatCount} chat${resume.chatCount === 1 ? '' : 's'}`
|
||||
);
|
||||
}
|
||||
return signals;
|
||||
}
|
||||
|
||||
function workspaceItems() {
|
||||
const recent = welcomeData?.recent ?? [];
|
||||
if (recent.length) return recent.slice(0, 6);
|
||||
return (welcomeData?.suggestions ?? []).slice(0, 6);
|
||||
function hasMeaningfulResume(resume: WorkspaceResume | undefined): boolean {
|
||||
return !!resume && (resumeSignals(resume).length > 0 || resume.activeLabels.length > 0);
|
||||
}
|
||||
|
||||
function continueWorkspace() {
|
||||
const recent = welcomeData?.recent ?? [];
|
||||
return recent.find((item) => hasMeaningfulResume(workspaceResumes.get(item.path))) ?? recent[0];
|
||||
}
|
||||
|
||||
function recentItems(continuePath?: string) {
|
||||
const recent = welcomeData?.recent ?? [];
|
||||
return recent.filter((item) => item.path !== continuePath).slice(0, 6);
|
||||
}
|
||||
|
||||
function nearbyItems() {
|
||||
return (welcomeData?.suggestions ?? []).slice(0, 5);
|
||||
}
|
||||
|
||||
const continuation = $derived(continueWorkspace());
|
||||
const continueResume = $derived(
|
||||
continuation ? workspaceResumes.get(continuation.path) : undefined
|
||||
);
|
||||
const continueSignals = $derived(resumeSignals(continueResume));
|
||||
const recent = $derived(recentItems(continuation?.path));
|
||||
const nearby = $derived(nearbyItems());
|
||||
|
||||
// ── Draggable divider ──────────────────────────────────────────
|
||||
|
||||
let isDragging = $state(false);
|
||||
@@ -717,13 +737,43 @@
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{#if workspaceItems().length}
|
||||
{#if continuation}
|
||||
<div class="mb-6">
|
||||
<h2 class="mb-2 text-xs text-gray-400 dark:text-gray-600">
|
||||
{welcomeData?.recent?.length ? $t('home.recent') : $t('home.folders')}
|
||||
</h2>
|
||||
<h2 class="mb-2 text-xs text-gray-400 dark:text-gray-600">Continue</h2>
|
||||
<button
|
||||
class="group w-full min-w-0 py-1.5 text-left transition-colors duration-100"
|
||||
onclick={() => quickOpen(continuation.path)}
|
||||
>
|
||||
<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"
|
||||
>
|
||||
{continuation.name}
|
||||
</span>
|
||||
<span class="truncate font-mono text-[11px] 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"
|
||||
>
|
||||
{continueSignals.join(' ')}
|
||||
</span>
|
||||
{:else if continueResume?.activeLabels.length}
|
||||
<span class="mt-0.5 block truncate text-[11px] text-gray-400 dark:text-gray-600">
|
||||
{continueResume.activeLabels.join(' · ')}
|
||||
</span>
|
||||
{/if}
|
||||
</button>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{#if recent.length}
|
||||
<div class="mb-6">
|
||||
<h2 class="mb-2 text-xs text-gray-400 dark:text-gray-600">{$t('home.recent')}</h2>
|
||||
<div class="flex flex-col">
|
||||
{#each workspaceItems() as item}
|
||||
{#each recent as item}
|
||||
{@const resume = workspaceResumes.get(item.path)}
|
||||
{@const signals = resumeSignals(resume)}
|
||||
<button
|
||||
@@ -751,17 +801,11 @@
|
||||
{resume.activeLabels.join(' · ')}
|
||||
</span>
|
||||
{/if}
|
||||
{#if resume?.recentChats[0]?.is_active}
|
||||
<span class="mt-0.5 block truncate text-[11px] text-gray-400 dark:text-gray-600">
|
||||
active
|
||||
{resume.recentChats[0].title}
|
||||
</span>
|
||||
{/if}
|
||||
</button>
|
||||
{/each}
|
||||
</div>
|
||||
</div>
|
||||
{:else}
|
||||
{:else if !continuation}
|
||||
<div class="mb-6">
|
||||
<h2 class="mb-2 text-xs text-gray-400 dark:text-gray-600">{$t('home.recent')}</h2>
|
||||
<button
|
||||
@@ -773,11 +817,11 @@
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{#if welcomeData?.suggestions?.length && welcomeData?.recent?.length}
|
||||
{#if nearby.length && !welcomeData?.recent?.length}
|
||||
<div>
|
||||
<h2 class="mb-2 text-xs text-gray-400 dark:text-gray-600">{$t('home.folders')}</h2>
|
||||
<div class="flex flex-col">
|
||||
{#each welcomeData.suggestions.slice(0, 5) as item}
|
||||
{#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"
|
||||
onclick={() => quickOpen(item.path)}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title>Automations / cptr</title>
|
||||
<title>Automations / Computer</title>
|
||||
</svelte:head>
|
||||
|
||||
<AutomationsPanel />
|
||||
@@ -6,7 +6,7 @@
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title>Automation / cptr</title>
|
||||
<title>Automation / Computer</title>
|
||||
</svelte:head>
|
||||
|
||||
<AutomationsPanel {automationId} />
|
||||
Reference in new issue
Block a user