mirror of
https://github.com/open-webui/computer.git
synced 2026-11-22 21:50:43 -05:00
refac
This commit is contained in:
1 parent
c5d4bf76a5
commit
1cbb3a5e6f
25 files changed
+594
-139
No files matched your search
@@ -92,7 +92,7 @@ Bring your own API key (OpenAI, Anthropic, Ollama, or any OpenAI-compatible endp
|
||||
| ✏️ **Output editing** | Review and edit AI-generated changes before applying. |
|
||||
| 📎 **File mentions** | Type `@` to give the AI context about specific files. |
|
||||
| 🧩 **Skills** | Reusable instruction sets (SKILL.md files). Type `$` to mention one. |
|
||||
| ⏱️ **Automations** | Schedule recurring AI tasks. "Run tests every morning." "Deploy every Friday." |
|
||||
| ⏱️ **Scheduled** | Schedule recurring AI tasks. "Run tests every morning." "Deploy every Friday." |
|
||||
| 🤖 **Sub-agents** | AI spins up parallel workers for complex tasks. Each gets full tool access. |
|
||||
| 🔌 **Tool servers** | Connect external tools via MCP or OpenAPI. |
|
||||
| 🧠 **Context compaction** | Long conversations are automatically summarised to stay fast. |
|
||||
|
||||
@@ -1228,9 +1228,14 @@
|
||||
{/if}
|
||||
{#if fileGitStatus && entryGitDecoration}
|
||||
<span
|
||||
class="text-[0.625rem] font-mono font-bold shrink-0 {entryGitDecoration.badgeColor}"
|
||||
use:tooltip={gitStatusTooltip(fileGitStatus, entry)}>{entryGitDecoration.char}</span
|
||||
class="flex shrink-0 items-center gap-1 text-[0.625rem] font-mono font-medium"
|
||||
use:tooltip={gitStatusTooltip(fileGitStatus, entry)}
|
||||
>
|
||||
<span class="text-green-600 dark:text-green-400"
|
||||
>+{fileGitStatus.additions ?? 0}</span
|
||||
>
|
||||
<span class="text-red-500 dark:text-red-400">-{fileGitStatus.deletions ?? 0}</span>
|
||||
</span>
|
||||
{/if}
|
||||
{#if entry.type !== 'directory' && entry.size !== null}
|
||||
<span
|
||||
|
||||
@@ -394,6 +394,8 @@
|
||||
return status.files?.find((f) => f.path === relPath);
|
||||
}
|
||||
|
||||
let currentFileStatus = $derived(fileData ? gitFileStatus(fileData.path) : undefined);
|
||||
|
||||
function applyGitLineChanges() {
|
||||
gitLineChanges = normalizeGitLineChanges(gitLineChanges);
|
||||
view?.dispatch({ effects: setGitLineChangesEffect.of(gitLineChanges) });
|
||||
@@ -1030,7 +1032,15 @@
|
||||
<!-- Universal toolbar (hidden for untitled files with no content yet) -->
|
||||
<div class="toolbar">
|
||||
<div class="toolbar-left">
|
||||
<span class="file-name scrollbar-none">{fileData.name}</span>
|
||||
<span class="file-title">
|
||||
<span class="file-name scrollbar-none">{fileData.name}</span>
|
||||
{#if currentFileStatus}
|
||||
<span class="file-git-stats">
|
||||
<span class="file-git-additions">+{currentFileStatus.additions ?? 0}</span>
|
||||
<span class="file-git-deletions">-{currentFileStatus.deletions ?? 0}</span>
|
||||
</span>
|
||||
{/if}
|
||||
</span>
|
||||
<span class="file-size">{formatSize(fileData.size)}</span>
|
||||
</div>
|
||||
<div class="toolbar-right">
|
||||
@@ -1268,10 +1278,20 @@
|
||||
gap: 0.125rem;
|
||||
}
|
||||
|
||||
.file-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex: 1 1 auto;
|
||||
gap: 0.375rem;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.file-name {
|
||||
display: block;
|
||||
flex: 1 1 auto;
|
||||
flex: 0 1 auto;
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
white-space: nowrap;
|
||||
@@ -1288,6 +1308,34 @@
|
||||
color: var(--color-gray-300);
|
||||
}
|
||||
|
||||
.file-git-stats {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex: 0 0 auto;
|
||||
gap: 0.25rem;
|
||||
font-family:
|
||||
ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
|
||||
font-size: 0.6875rem;
|
||||
font-weight: 500;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.file-git-additions {
|
||||
color: #16a34a;
|
||||
}
|
||||
|
||||
.file-git-deletions {
|
||||
color: #ef4444;
|
||||
}
|
||||
|
||||
:global(.dark) .file-git-additions {
|
||||
color: #4ade80;
|
||||
}
|
||||
|
||||
:global(.dark) .file-git-deletions {
|
||||
color: #f87171;
|
||||
}
|
||||
|
||||
.file-size {
|
||||
flex: 0 0 auto;
|
||||
white-space: nowrap;
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
import { t } from '$lib/i18n';
|
||||
import Spinner from '$lib/components/common/Spinner.svelte';
|
||||
import DiffSettingsMenu from './DiffSettingsMenu.svelte';
|
||||
import type { DiffFile } from '$lib/utils/diff';
|
||||
import { countDiffStats, type DiffFile } from '$lib/utils/diff';
|
||||
import DiffHunkRows from './DiffHunkRows.svelte';
|
||||
|
||||
type GitFile = {
|
||||
@@ -44,6 +44,8 @@
|
||||
unstaged?: boolean;
|
||||
staged_status?: string;
|
||||
unstaged_status?: string;
|
||||
additions?: number;
|
||||
deletions?: number;
|
||||
};
|
||||
type Commit = { hash: string; short_hash: string; author: string; date: string; message: string };
|
||||
type BranchItem = {
|
||||
@@ -116,6 +118,13 @@
|
||||
const stagedFiles = $derived((gitStatus?.files ?? []).filter((f) => f.staged));
|
||||
const unstagedFiles = $derived((gitStatus?.files ?? []).filter((f) => !f.staged));
|
||||
const totalChanges = $derived((gitStatus?.files ?? []).length);
|
||||
const totalAdditions = $derived(
|
||||
(gitStatus?.files ?? []).reduce((sum, file) => sum + (file.additions ?? 0), 0)
|
||||
);
|
||||
const totalDeletions = $derived(
|
||||
(gitStatus?.files ?? []).reduce((sum, file) => sum + (file.deletions ?? 0), 0)
|
||||
);
|
||||
const selectedDiffStats = $derived(countDiffStats(fileDiff));
|
||||
const allStaged = $derived(totalChanges > 0 && unstagedFiles.length === 0);
|
||||
const someStaged = $derived(stagedFiles.length > 0 && unstagedFiles.length > 0);
|
||||
|
||||
@@ -664,25 +673,6 @@
|
||||
return `${Math.floor(s / 86400)}d`;
|
||||
}
|
||||
|
||||
function statusChar(s: string): { char: string; color: string } {
|
||||
switch (s) {
|
||||
case 'added':
|
||||
return { char: 'A', color: 'text-green-500' };
|
||||
case 'untracked':
|
||||
return { char: 'U', color: 'text-green-500' };
|
||||
case 'modified':
|
||||
return { char: 'M', color: 'text-amber-500' };
|
||||
case 'deleted':
|
||||
return { char: 'D', color: 'text-red-400' };
|
||||
case 'renamed':
|
||||
return { char: 'R', color: 'text-blue-400' };
|
||||
case 'conflict':
|
||||
return { char: '!', color: 'text-orange-500' };
|
||||
default:
|
||||
return { char: '?', color: 'text-gray-400' };
|
||||
}
|
||||
}
|
||||
|
||||
const syncAction = $derived.by(() => {
|
||||
if (!gitStatus) return { label: $t('git.fetch'), icon: 'refresh', action: doFetch };
|
||||
if (gitStatus.behind > 0)
|
||||
@@ -762,7 +752,7 @@
|
||||
<!-- Collapsed bar (entire bar is clickable to expand) -->
|
||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
||||
<div
|
||||
class="flex items-center h-7 px-3 cursor-pointer hover:bg-gray-50 dark:hover:bg-white/3 transition-colors duration-75"
|
||||
class="flex min-w-0 items-center h-7 px-3 cursor-pointer hover:bg-gray-50 dark:hover:bg-white/3 transition-colors duration-75"
|
||||
onclick={() => {
|
||||
expanded = !expanded;
|
||||
if (expanded) {
|
||||
@@ -774,11 +764,12 @@
|
||||
<!-- Branch button (opens branch picker, stops expand) -->
|
||||
<button
|
||||
bind:this={branchBtnEl}
|
||||
class="flex items-center gap-1.5 h-6 px-1.5 -ml-1.5 rounded-md hover:bg-gray-100 dark:hover:bg-white/6 transition-colors duration-75"
|
||||
class="flex min-w-0 max-w-32 shrink items-center gap-1.5 h-6 px-1.5 -ml-1.5 rounded-md hover:bg-gray-100 dark:hover:bg-white/6 transition-colors duration-75"
|
||||
onclick={toggleBranches}
|
||||
>
|
||||
<Icon name="git-branch" size={12} class="text-gray-400 dark:text-gray-600 shrink-0" />
|
||||
<span class="text-[0.6875rem] text-gray-600 dark:text-gray-400 font-mono"
|
||||
<span
|
||||
class="min-w-0 truncate whitespace-nowrap text-[0.6875rem] text-gray-600 dark:text-gray-400 font-mono"
|
||||
>{gitStatus.branch}</span
|
||||
>
|
||||
<Icon name="chevron-down" size={9} class="text-gray-400 dark:text-gray-600" />
|
||||
@@ -786,18 +777,19 @@
|
||||
|
||||
<button
|
||||
bind:this={worktreeBtnEl}
|
||||
class="flex items-center gap-1.5 h-6 px-1.5 rounded-md hover:bg-gray-100 dark:hover:bg-white/6 transition-colors duration-75"
|
||||
class="flex min-w-0 max-w-32 shrink items-center gap-1.5 h-6 px-1.5 rounded-md hover:bg-gray-100 dark:hover:bg-white/6 transition-colors duration-75"
|
||||
onclick={toggleWorktrees}
|
||||
>
|
||||
<Icon name="folder" size={12} class="text-gray-400 dark:text-gray-600 shrink-0" />
|
||||
<span class="text-[0.6875rem] text-gray-500 dark:text-gray-500 font-mono"
|
||||
<span
|
||||
class="min-w-0 truncate whitespace-nowrap text-[0.6875rem] text-gray-500 dark:text-gray-500 font-mono"
|
||||
>{pathTail(workspacePath)}</span
|
||||
>
|
||||
<Icon name="chevron-down" size={9} class="text-gray-400 dark:text-gray-600" />
|
||||
</button>
|
||||
|
||||
{#if gitStatus.ahead > 0}<span
|
||||
class="text-[0.625rem] font-mono text-gray-400 dark:text-gray-600 ml-1.5"
|
||||
class="ml-1.5 shrink-0 whitespace-nowrap text-[0.625rem] font-mono text-gray-400 dark:text-gray-600"
|
||||
>↑{gitStatus.ahead}</span
|
||||
>{/if}
|
||||
{#if gitStatus.behind > 0}<span
|
||||
@@ -805,11 +797,15 @@
|
||||
>↓{gitStatus.behind}</span
|
||||
>{/if}
|
||||
{#if totalChanges > 0}<span
|
||||
class="text-[0.625rem] font-mono text-gray-400 dark:text-gray-600 ml-1.5"
|
||||
class="ml-1.5 block min-w-0 max-w-20 shrink truncate whitespace-nowrap text-[0.625rem] font-mono text-gray-400 dark:text-gray-600"
|
||||
>{$t('git.changedCount', { count: totalChanges })}</span
|
||||
><span class="text-[0.625rem] font-mono text-green-600 dark:text-green-400 ml-2"
|
||||
>+{totalAdditions}</span
|
||||
><span class="text-[0.625rem] font-mono text-red-500 dark:text-red-400 ml-1"
|
||||
>-{totalDeletions}</span
|
||||
>{/if}
|
||||
{#if actionMsg}<span
|
||||
class="text-[0.625rem] font-mono text-gray-400 dark:text-gray-600 ml-auto"
|
||||
class="ml-auto min-w-0 max-w-32 truncate whitespace-nowrap text-[0.625rem] font-mono text-gray-400 dark:text-gray-600"
|
||||
>{actionMsg}</span
|
||||
>{/if}
|
||||
|
||||
@@ -817,7 +813,7 @@
|
||||
|
||||
<!-- Sync button (stops expand) -->
|
||||
<button
|
||||
class="flex items-center gap-1 h-6 px-2 rounded-md text-[0.6875rem] text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-white/6 transition-colors duration-75"
|
||||
class="flex shrink-0 items-center gap-1 h-6 px-2 rounded-md text-[0.6875rem] text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-white/6 transition-colors duration-75"
|
||||
onclick={(e) => {
|
||||
e.stopPropagation();
|
||||
syncAction.action();
|
||||
@@ -825,7 +821,7 @@
|
||||
disabled={loading}
|
||||
>
|
||||
<Icon name={syncAction.icon} size={12} />
|
||||
<span>{syncAction.label}</span>
|
||||
<span class="whitespace-nowrap">{syncAction.label}</span>
|
||||
</button>
|
||||
|
||||
<!-- Chevron indicator -->
|
||||
@@ -1240,7 +1236,6 @@
|
||||
<div class="flex-1 overflow-y-auto">
|
||||
{#each gitStatus?.files ?? [] as file (file.path)}
|
||||
{@const fp = fPath(file.path)}
|
||||
{@const sc = statusChar(file.status)}
|
||||
<button
|
||||
class="group flex items-center gap-1.5 w-full h-7 px-2.5 text-left transition-colors duration-75
|
||||
{selectedFile === file.path
|
||||
@@ -1277,9 +1272,12 @@
|
||||
openFileTab(workspacePath.replace(/\/$/, '') + '/' + file.path);
|
||||
}}>{fp.name}</span
|
||||
>
|
||||
<span class="ml-auto text-[0.625rem] font-mono font-bold shrink-0 {sc.color}"
|
||||
>{sc.char}</span
|
||||
<span
|
||||
class="ml-auto flex shrink-0 items-center gap-1 text-[0.625rem] font-mono font-medium"
|
||||
>
|
||||
<span class="text-green-600 dark:text-green-400">+{file.additions ?? 0}</span>
|
||||
<span class="text-red-500 dark:text-red-400">-{file.deletions ?? 0}</span>
|
||||
</span>
|
||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
||||
<span
|
||||
class="flex items-center justify-center w-5 h-5 rounded shrink-0 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 hover:bg-gray-200 dark:hover:bg-white/10 transition-all duration-75"
|
||||
@@ -1404,13 +1402,21 @@
|
||||
<div
|
||||
class="hidden md:flex items-center h-6 px-2 border-b border-gray-100 dark:border-white/4 shrink-0"
|
||||
>
|
||||
<span class="text-[0.625rem] text-gray-400 dark:text-gray-600 font-mono truncate">
|
||||
<span
|
||||
class="min-w-0 flex-1 text-[0.625rem] text-gray-400 dark:text-gray-600 font-mono truncate"
|
||||
>
|
||||
{#if selectedCommit}
|
||||
{selectedCommit.short_hash} · {selectedCommit.message}
|
||||
{:else}
|
||||
{selectedFile}
|
||||
{/if}
|
||||
</span>
|
||||
<span class="ml-2 text-[0.625rem] font-mono text-green-600 dark:text-green-400"
|
||||
>+{selectedDiffStats.additions}</span
|
||||
>
|
||||
<span class="text-[0.625rem] font-mono text-red-500 dark:text-red-400"
|
||||
>-{selectedDiffStats.deletions}</span
|
||||
>
|
||||
</div>
|
||||
<div class="flex-1 overflow-auto">
|
||||
<div class="diff-content" class:diff-content-split={$diffDisplayMode === 'split'}>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import { tooltip } from '$lib/tooltip';
|
||||
import { t } from '$lib/i18n';
|
||||
import type { DiffFile } from '$lib/utils/diff';
|
||||
import { countDiffStats, type DiffFile } from '$lib/utils/diff';
|
||||
import Icon from './Icon.svelte';
|
||||
import Spinner from '$lib/components/common/Spinner.svelte';
|
||||
import DiffSettingsMenu from './DiffSettingsMenu.svelte';
|
||||
@@ -34,6 +34,8 @@
|
||||
|
||||
const workspacePath = $derived($activeWorkspace?.path ?? '');
|
||||
const totalChanges = $derived(reviewFiles.length);
|
||||
const totalAdditions = $derived(reviewFiles.reduce((sum, file) => sum + file.additions, 0));
|
||||
const totalDeletions = $derived(reviewFiles.reduce((sum, file) => sum + file.deletions, 0));
|
||||
const anyExpanded = $derived(reviewFiles.some((file) => file.expanded));
|
||||
|
||||
// React to git status changes from centralized store
|
||||
@@ -89,7 +91,7 @@
|
||||
diffFiles = [];
|
||||
}
|
||||
|
||||
const counts = countDiff(diffFiles);
|
||||
const counts = countDiffStats(diffFiles);
|
||||
const key = fileKey(file);
|
||||
return {
|
||||
key,
|
||||
@@ -126,20 +128,6 @@
|
||||
return `${file.staged ? 'staged' : 'unstaged'}:${file.status}:${file.path}`;
|
||||
}
|
||||
|
||||
function countDiff(files: DiffFile[]): { additions: number; deletions: number } {
|
||||
let additions = 0;
|
||||
let deletions = 0;
|
||||
for (const file of files) {
|
||||
for (const hunk of file.hunks) {
|
||||
for (const line of hunk.lines) {
|
||||
if (line.type === 'added') additions += 1;
|
||||
if (line.type === 'removed') deletions += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return { additions, deletions };
|
||||
}
|
||||
|
||||
function toggleFile(key: string) {
|
||||
reviewFiles = reviewFiles.map((file) =>
|
||||
file.key === key ? { ...file, expanded: !file.expanded } : file
|
||||
@@ -162,27 +150,6 @@
|
||||
if (slash < 0) return { dir: '', name: path };
|
||||
return { dir: path.slice(0, slash + 1), name: path.slice(slash + 1) };
|
||||
}
|
||||
|
||||
function statusMeta(status: string): { char: string; label: string; className: string } {
|
||||
switch (status) {
|
||||
case 'added':
|
||||
return { char: 'A', label: 'Added', className: 'text-green-600 dark:text-green-400' };
|
||||
case 'untracked':
|
||||
return { char: 'U', label: 'Untracked', className: 'text-green-600 dark:text-green-400' };
|
||||
case 'modified':
|
||||
return { char: 'M', label: 'Modified', className: 'text-amber-500 dark:text-amber-400' };
|
||||
case 'deleted':
|
||||
return { char: 'D', label: 'Deleted', className: 'text-red-500 dark:text-red-400' };
|
||||
case 'renamed':
|
||||
return { char: 'R', label: 'Renamed', className: 'text-blue-500 dark:text-blue-400' };
|
||||
case 'copied':
|
||||
return { char: 'C', label: 'Copied', className: 'text-blue-500 dark:text-blue-400' };
|
||||
case 'conflict':
|
||||
return { char: '!', label: 'Conflict', className: 'text-orange-500 dark:text-orange-400' };
|
||||
default:
|
||||
return { char: '?', label: status, className: 'text-gray-400 dark:text-gray-500' };
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div
|
||||
@@ -234,6 +201,12 @@
|
||||
<span class="ml-1 font-mono text-[0.625rem] text-gray-400 dark:text-gray-600"
|
||||
>{$t('git.changedCount', { count: totalChanges })}</span
|
||||
>
|
||||
<span class="ml-2 font-mono text-[0.625rem] text-green-600 dark:text-green-400"
|
||||
>+{totalAdditions}</span
|
||||
>
|
||||
<span class="font-mono text-[0.625rem] text-red-500 dark:text-red-400"
|
||||
>-{totalDeletions}</span
|
||||
>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -279,6 +252,12 @@
|
||||
<span class="ml-auto text-[0.6875rem] text-gray-400 dark:text-gray-600"
|
||||
>{$t('git.change', { count: totalChanges })}</span
|
||||
>
|
||||
<span class="ml-2 font-mono text-[0.6875rem] text-green-600 dark:text-green-400"
|
||||
>+{totalAdditions}</span
|
||||
>
|
||||
<span class="font-mono text-[0.6875rem] text-red-500 dark:text-red-400"
|
||||
>-{totalDeletions}</span
|
||||
>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@@ -304,7 +283,6 @@
|
||||
<div class="p-1">
|
||||
{#each reviewFiles as file (file.key)}
|
||||
{@const parts = pathParts(file.path)}
|
||||
{@const meta = statusMeta(file.status)}
|
||||
<section class="overflow-hidden rounded-lg">
|
||||
<button
|
||||
class="flex h-8 w-full min-w-0 items-center gap-1.5 rounded-lg px-2 text-left transition-colors hover:bg-gray-100 dark:hover:bg-white/4"
|
||||
@@ -317,10 +295,6 @@
|
||||
? 'rotate-90'
|
||||
: ''}"
|
||||
/>
|
||||
<span
|
||||
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" />
|
||||
<div class="flex min-w-0 flex-1 items-baseline gap-2">
|
||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
||||
@@ -338,18 +312,14 @@
|
||||
>
|
||||
{/if}
|
||||
</div>
|
||||
{#if file.additions > 0}
|
||||
<span
|
||||
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-[0.6875rem] font-medium text-red-500 dark:text-red-400"
|
||||
>-{file.deletions}</span
|
||||
>
|
||||
{/if}
|
||||
<span
|
||||
class="shrink-0 font-mono text-[0.6875rem] font-medium text-green-600 dark:text-green-400"
|
||||
>+{file.additions}</span
|
||||
>
|
||||
<span
|
||||
class="shrink-0 font-mono text-[0.6875rem] font-medium text-red-500 dark:text-red-400"
|
||||
>-{file.deletions}</span
|
||||
>
|
||||
|
||||
<span
|
||||
class="shrink-0 rounded px-1.5 py-0.5 text-[0.625rem] font-medium text-rose-500 bg-rose-50 dark:bg-rose-500/10 dark:text-rose-300"
|
||||
|
||||
@@ -136,6 +136,249 @@
|
||||
<path d="M13.5 6L10 18.5" />
|
||||
<path d="M6.5 8.5L3 12L6.5 15.5" />
|
||||
<path d="M17.5 8.5L21 12L17.5 15.5" />
|
||||
{:else if name === 'python'}
|
||||
<path
|
||||
d="M8 10H16C17.1046 10 18 9.10457 18 8V5.5C18 4.11929 16.8807 3 15.5 3H10C8.89543 3 8 3.89543 8 5V10Z"
|
||||
/>
|
||||
<path
|
||||
d="M16 14H8C6.89543 14 6 14.8954 6 16V18.5C6 19.8807 7.11929 21 8.5 21H14C15.1046 21 16 20.1046 16 19V14Z"
|
||||
/>
|
||||
<path d="M8 7H6.5C5.11929 7 4 8.11929 4 9.5V12C4 13.1046 4.89543 14 6 14H8" />
|
||||
<path d="M16 10H18C19.1046 10 20 10.8954 20 12V14.5C20 15.8807 18.8807 17 17.5 17H16" />
|
||||
<circle cx="11" cy="6.5" r="0.8" fill="currentColor" stroke="none" />
|
||||
<circle cx="13" cy="17.5" r="0.8" fill="currentColor" stroke="none" />
|
||||
{:else if name === 'javascript-logo'}
|
||||
<rect x="4" y="4" width="16" height="16" rx="2" />
|
||||
<text
|
||||
x="12"
|
||||
y="15"
|
||||
text-anchor="middle"
|
||||
font-size="7"
|
||||
font-weight="700"
|
||||
fill="currentColor"
|
||||
stroke="none">JS</text
|
||||
>
|
||||
{:else if name === 'typescript-logo'}
|
||||
<rect x="4" y="4" width="16" height="16" rx="2" />
|
||||
<text
|
||||
x="12"
|
||||
y="15"
|
||||
text-anchor="middle"
|
||||
font-size="7"
|
||||
font-weight="700"
|
||||
fill="currentColor"
|
||||
stroke="none">TS</text
|
||||
>
|
||||
{:else if name === 'react'}
|
||||
<ellipse cx="12" cy="12" rx="9" ry="3.5" />
|
||||
<ellipse cx="12" cy="12" rx="9" ry="3.5" transform="rotate(60 12 12)" />
|
||||
<ellipse cx="12" cy="12" rx="9" ry="3.5" transform="rotate(120 12 12)" />
|
||||
<circle cx="12" cy="12" r="1.5" fill="currentColor" stroke="none" />
|
||||
{:else if name === 'rust'}
|
||||
<circle cx="12" cy="12" r="6" />
|
||||
<path
|
||||
d="M12 3V5M12 19V21M3 12H5M19 12H21M5.6 5.6L7 7M17 17L18.4 18.4M18.4 5.6L17 7M7 17L5.6 18.4"
|
||||
/>
|
||||
<text
|
||||
x="12"
|
||||
y="14.4"
|
||||
text-anchor="middle"
|
||||
font-size="7"
|
||||
font-weight="700"
|
||||
fill="currentColor"
|
||||
stroke="none">R</text
|
||||
>
|
||||
{:else if name === 'go-logo'}
|
||||
<path d="M3 9H10" />
|
||||
<path d="M2 12H9" />
|
||||
<path d="M3 15H10" />
|
||||
<text
|
||||
x="15"
|
||||
y="15"
|
||||
text-anchor="middle"
|
||||
font-size="8"
|
||||
font-weight="700"
|
||||
fill="currentColor"
|
||||
stroke="none">GO</text
|
||||
>
|
||||
{:else if name === 'java-logo'}
|
||||
<path d="M9 18H17" />
|
||||
<path d="M8 14H18L17 18C16.6667 19.3333 15.5 20 12.5 20C9.5 20 8.33333 19.3333 8 18L7 14H8Z" />
|
||||
<path d="M11 11C9 9 13 8 11 6" />
|
||||
<path d="M14 11C12 9 16 8 14 5" />
|
||||
<path d="M9 22H17" />
|
||||
{:else if name === 'c-logo'}
|
||||
<path d="M12 3L20 7.5V16.5L12 21L4 16.5V7.5L12 3Z" />
|
||||
<text
|
||||
x="12"
|
||||
y="15"
|
||||
text-anchor="middle"
|
||||
font-size="8"
|
||||
font-weight="700"
|
||||
fill="currentColor"
|
||||
stroke="none">C</text
|
||||
>
|
||||
{:else if name === 'cpp-logo'}
|
||||
<path d="M12 3L20 7.5V16.5L12 21L4 16.5V7.5L12 3Z" />
|
||||
<text
|
||||
x="10"
|
||||
y="15"
|
||||
text-anchor="middle"
|
||||
font-size="8"
|
||||
font-weight="700"
|
||||
fill="currentColor"
|
||||
stroke="none">C</text
|
||||
>
|
||||
<path d="M14.5 10V14M12.5 12H16.5M19 10V14M17 12H21" />
|
||||
{:else if name === 'c-sharp-logo'}
|
||||
<path d="M12 3L20 7.5V16.5L12 21L4 16.5V7.5L12 3Z" />
|
||||
<text
|
||||
x="12"
|
||||
y="15"
|
||||
text-anchor="middle"
|
||||
font-size="7"
|
||||
font-weight="700"
|
||||
fill="currentColor"
|
||||
stroke="none">C#</text
|
||||
>
|
||||
{:else if name === 'ruby-logo'}
|
||||
<path d="M12 3L20 8L17 18L12 21L7 18L4 8L12 3Z" />
|
||||
<path d="M4 8H20L12 21L4 8Z" />
|
||||
<path d="M8 8L12 3L16 8L12 21L8 8Z" />
|
||||
{:else if name === 'php-logo'}
|
||||
<ellipse cx="12" cy="12" rx="9" ry="5.5" />
|
||||
<text
|
||||
x="12"
|
||||
y="14.2"
|
||||
text-anchor="middle"
|
||||
font-size="6"
|
||||
font-weight="700"
|
||||
fill="currentColor"
|
||||
stroke="none">PHP</text
|
||||
>
|
||||
{:else if name === 'kotlin-logo'}
|
||||
<path d="M5 4H19L5 18V4Z" />
|
||||
<path d="M5 20L12 13L19 20H5Z" />
|
||||
<path d="M5 4V20" />
|
||||
{:else if name === 'svelte-logo'}
|
||||
<path
|
||||
d="M15.5 4.5C13.7 3.4 11.4 3.7 9.9 5.2L6.3 8.8C5 10.1 5 12.2 6.3 13.5C7.2 14.4 8.5 14.7 9.7 14.3"
|
||||
/>
|
||||
<path
|
||||
d="M8.5 19.5C10.3 20.6 12.6 20.3 14.1 18.8L17.7 15.2C19 13.9 19 11.8 17.7 10.5C16.8 9.6 15.5 9.3 14.3 9.7"
|
||||
/>
|
||||
<path d="M9 12H15" />
|
||||
{:else if name === 'vue-js'}
|
||||
<path d="M12 20.5L22.5 4H18.5L12 14L5.5 4H1.5L12 20.5Z" />
|
||||
<path d="M18.5 4H14.5L12 7.5L9.5 4H5.5" />
|
||||
{:else if name === 'apple-swift'}
|
||||
<path
|
||||
d="M20.457 14.5892C20.9032 13.1527 21.9081 7.84019 14.5261 3.10086C14.2661 2.9345 13.9248 2.97821 13.7186 3.20043C13.5111 3.42264 13.5024 3.75778 13.6974 3.99092C13.7274 4.02614 16.4472 7.33991 15.4798 11.1248C13.8074 9.97369 7.1565 4.70249 7.1565 4.70249L11 11L3.8617 6.40006C3.8617 6.40006 8.90765 12.5953 11.9962 14.9255C10.5013 15.4622 7.25274 16.0305 2.963 13.364C2.72052 13.2122 2.40179 13.2413 2.1918 13.438C1.98431 13.6311 1.93931 13.9395 2.08555 14.1812C2.2293 14.4192 5.66784 20 12.9387 20C14.9335 20 16.0997 19.4317 17.0372 18.9764C17.6134 18.6971 18.0683 18.4749 18.5646 18.4749C19.8007 18.4749 20.6119 19.7025 20.6194 19.7134C20.7344 19.8919 20.9357 20 21.1507 20C21.1669 20 21.1844 19.9988 21.2019 19.9976C21.4356 19.9794 21.6381 19.8373 21.7281 19.6272C22.6206 17.5544 21.0832 15.359 20.457 14.5892Z"
|
||||
/>
|
||||
{:else if name === 'markdown-logo'}
|
||||
<rect x="3" y="6" width="18" height="12" rx="1.5" />
|
||||
<path d="M6 15V9L9 12L12 9V15" />
|
||||
<path d="M16 9V15M14 13L16 15L18 13" />
|
||||
{:else if name === 'json-logo'}
|
||||
<path
|
||||
d="M9 6H8C6.89543 6 6 6.89543 6 8V10C6 11.1046 5.10457 12 4 12C5.10457 12 6 12.8954 6 14V16C6 17.1046 6.89543 18 8 18H9"
|
||||
/>
|
||||
<path
|
||||
d="M15 6H16C17.1046 6 18 6.89543 18 8V10C18 11.1046 18.8954 12 20 12C18.8954 12 18 12.8954 18 14V16C18 17.1046 17.1046 18 16 18H15"
|
||||
/>
|
||||
<path d="M11 9L13 15" />
|
||||
{:else if name === 'yaml-logo'}
|
||||
<path d="M5 5L9 12V19" />
|
||||
<path d="M13 5L9 12" />
|
||||
<path d="M14 9H20" />
|
||||
<path d="M14 13H19" />
|
||||
<path d="M14 17H18" />
|
||||
{:else if name === 'xml-logo'}
|
||||
<path d="M8 8L4 12L8 16" />
|
||||
<path d="M16 8L20 12L16 16" />
|
||||
<path d="M13.5 6L10.5 18" />
|
||||
{:else if name === 'shell-logo'}
|
||||
<path
|
||||
d="M4 5.6C4 5.26863 4.26863 5 4.6 5H19.4C19.7314 5 20 5.26863 20 5.6V18.4C20 18.7314 19.7314 19 19.4 19H4.6C4.26863 19 4 18.7314 4 18.4V5.6Z"
|
||||
/>
|
||||
<path d="M7 9L10 12L7 15" />
|
||||
<path d="M12 15H17" />
|
||||
{:else if name === 'html5'}
|
||||
<path d="M4 3L5.77778 20.0899L12 22L18.2222 20.0899L20 3H4Z" />
|
||||
<path d="M17 7H7.5L8 11.5H16L15.5 17L12 18L8.5 17L8.25 14.5" />
|
||||
{:else if name === 'css3'}
|
||||
<path d="M4 3L5.77778 20.0899L12 22L18.2222 20.0899L20 3H4Z" />
|
||||
<path d="M7 7H16.5L15.5 17L12 18L8.5 17L8.25 14.5" />
|
||||
<path d="M16 11.5H7.5" />
|
||||
{:else if name === 'svg-format'}
|
||||
<path
|
||||
d="M4.5 15H6.5C7.32843 15 8 14.3284 8 13.5C8 12.6716 7.32843 12 6.5 12H6C5.17157 12 4.5 11.3284 4.5 10.5C4.5 9.67157 5.17157 9 6 9H7.5"
|
||||
/>
|
||||
<path d="M10.5 9L12 15L13.5 9" />
|
||||
<path d="M19.5 9H16.5V15L19.5 15V12.6" />
|
||||
<path d="M4 6V3.6C4 3.26863 4.26863 3 4.6 3H19.4C19.7314 3 20 3.26863 20 3.6V6" />
|
||||
<path d="M4 18V20.4C4 20.7314 4.26863 21 4.6 21H19.4C19.7314 21 20 20.7314 20 20.4V18" />
|
||||
{:else if name === 'database-script'}
|
||||
<path d="M22 14V6C22 4.34315 20.6569 3 19 3H9C7.34315 3 6 4.34315 6 6V13" />
|
||||
<path
|
||||
d="M12 21H6C3.79086 21 2 19.2091 2 17C2 14.7909 3.79086 13 6 13H18C15.7909 13 14 14.7909 14 17C14 19.2091 15.7909 21 18 21C20.2091 21 22 19.2091 22 17V14"
|
||||
/>
|
||||
{:else if name === 'csv-logo'}
|
||||
<path
|
||||
d="M4 5.6C4 5.26863 4.26863 5 4.6 5H19.4C19.7314 5 20 5.26863 20 5.6V18.4C20 18.7314 19.7314 19 19.4 19H4.6C4.26863 19 4 18.7314 4 18.4V5.6Z"
|
||||
/>
|
||||
<path d="M4 10H20M4 14H20M10 5V19M15 5V19" />
|
||||
<text
|
||||
x="12"
|
||||
y="13.5"
|
||||
text-anchor="middle"
|
||||
font-size="5"
|
||||
font-weight="700"
|
||||
fill="currentColor"
|
||||
stroke="none">CSV</text
|
||||
>
|
||||
{:else if name === 'pdf-logo'}
|
||||
<path
|
||||
d="M4 21.4V2.6C4 2.26863 4.26863 2 4.6 2H16.2515C16.4106 2 16.5632 2.06321 16.6757 2.17574L19.8243 5.32426C19.9368 5.43679 20 5.5894 20 5.74853V21.4C20 21.7314 19.7314 22 19.4 22H4.6C4.26863 22 4 21.7314 4 21.4Z"
|
||||
/>
|
||||
<path d="M16 2V5.4C16 5.73137 16.2686 6 16.6 6H20" />
|
||||
<text
|
||||
x="12"
|
||||
y="15.2"
|
||||
text-anchor="middle"
|
||||
font-size="5.5"
|
||||
font-weight="700"
|
||||
fill="currentColor"
|
||||
stroke="none">PDF</text
|
||||
>
|
||||
{:else if name === 'npm'}
|
||||
<path d="M1 8L23 8V15L11 15V17L7.5 17V15L1 15V8Z" />
|
||||
<path d="M7.5 8L7.5 15" />
|
||||
<path d="M13.5 8V15" />
|
||||
<path d="M18 11V15" />
|
||||
<path d="M5 11V15" />
|
||||
<path d="M11 11V12" />
|
||||
<path d="M20.5 11V15" />
|
||||
{:else if name === 'archive'}
|
||||
<path d="M7 6L17 6" />
|
||||
<path d="M7 9L17 9" />
|
||||
<path d="M9 17H15" />
|
||||
<path
|
||||
d="M3 12H2.6C2.26863 12 2 12.2686 2 12.6V21.4C2 21.7314 2.26863 22 2.6 22H21.4C21.7314 22 22 21.7314 22 21.4V12.6C22 12.2686 21.7314 12 21.4 12H21M3 12V2.6C3 2.26863 3.26863 2 3.6 2H20.4C20.7314 2 21 2.26863 21 2.6V12M3 12H21"
|
||||
/>
|
||||
{:else if name === 'package'}
|
||||
<path
|
||||
d="M20 5.99999L20 18C20 19.1046 19.1046 20 18 20H6C4.89543 20 4 19.1046 4 18V6C4 4.89543 4.89543 4 6 4H18C19.1045 4 19.9999 4.89543 20 5.99999Z"
|
||||
/>
|
||||
<path d="M12 9V4" />
|
||||
{:else if name === 'package-lock'}
|
||||
<path
|
||||
d="M14 20H6C4.89543 20 4 19.1046 4 18V6C4 4.89543 4.89543 4 6 4H18C19.1045 4 19.9999 4.89543 20 5.99999L20 12"
|
||||
/>
|
||||
<path d="M12 9V4" />
|
||||
<path
|
||||
d="M21.1667 18.5H21.4C21.7314 18.5 22 18.7686 22 19.1V21.4C22 21.7314 21.7314 22 21.4 22H17.6C17.2686 22 17 21.7314 17 21.4V19.1C17 18.7686 17.2686 18.5 17.6 18.5H17.8333M21.1667 18.5V16.75C21.1667 16.1667 20.8333 15 19.5 15C18.1667 15 17.8333 16.1667 17.8333 16.75V18.5M21.1667 18.5H17.8333"
|
||||
/>
|
||||
{:else if name === 'list'}
|
||||
<path d="M8 6H20" />
|
||||
<path d="M4 6.01L4.01 5.99889" />
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
let resultsEl: HTMLDivElement | undefined = $state();
|
||||
|
||||
// Determine active workspace from the URL, not the store.
|
||||
// When on /automations or other non-workspace pages, $currentWorkspace
|
||||
// When on /scheduled or other non-workspace pages, $currentWorkspace
|
||||
// retains the last workspace but we should search across all.
|
||||
const urlWorkspacePath = $derived($page.url.searchParams.get('workspace'));
|
||||
const effectiveWorkspace = $derived(urlWorkspacePath ? $currentWorkspace : null);
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
function openAutomations(e: MouseEvent) {
|
||||
e.preventDefault();
|
||||
goto('/automations');
|
||||
goto('/scheduled');
|
||||
if (typeof window !== 'undefined' && window.innerWidth < 768) sidebarOpen.set(false);
|
||||
}
|
||||
</script>
|
||||
@@ -35,7 +35,7 @@
|
||||
{#if $chatEnabled}
|
||||
<div class="px-1.5 shrink-0">
|
||||
<a
|
||||
href="/automations"
|
||||
href="/scheduled"
|
||||
class="flex items-center gap-1.5 w-full h-7 px-2 rounded-lg text-xs text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 transition-colors duration-100 no-underline"
|
||||
onclick={openAutomations}
|
||||
>
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
try {
|
||||
await deleteAutomation(a.id);
|
||||
items = items.filter((i) => i.id !== a.id);
|
||||
if (detail?.id === a.id) goto('/automations');
|
||||
if (detail?.id === a.id) goto('/scheduled');
|
||||
toast.success($t('automations.deleted'));
|
||||
} catch (e: any) {
|
||||
toast.error(e.message || $t('automations.failedToDelete'));
|
||||
@@ -211,7 +211,7 @@
|
||||
{/if}
|
||||
<button
|
||||
class="flex items-center gap-1 text-xs text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors duration-75"
|
||||
onclick={() => goto('/automations')}
|
||||
onclick={() => goto('/scheduled')}
|
||||
>
|
||||
<Icon name="chevron-left" size={12} />
|
||||
<span>{$t('automations.title')}</span>
|
||||
@@ -509,7 +509,7 @@
|
||||
></span>
|
||||
<button
|
||||
class="text-xs text-gray-700 dark:text-gray-300 truncate flex-1 text-left hover:underline cursor-pointer transition-colors duration-75"
|
||||
onclick={() => goto(`/automations/${a.id}`)}
|
||||
onclick={() => goto(`/scheduled/${a.id}`)}
|
||||
>
|
||||
{a.name}
|
||||
</button>
|
||||
|
||||
@@ -464,7 +464,7 @@
|
||||
"about.share": "Teilen",
|
||||
"about.copyLink": "Link kopieren",
|
||||
"about.copied": "Kopiert!",
|
||||
"automations.title": "Automatisierungen",
|
||||
"automations.title": "Geplant",
|
||||
"automations.filter": "Filtern...",
|
||||
"automations.noMatches": "Keine Treffer",
|
||||
"automations.noAutomations": "Noch keine Automatisierungen",
|
||||
@@ -922,7 +922,7 @@
|
||||
"models.builtinTools.chatsDesc": "Frühere Chats durchsuchen",
|
||||
"models.builtinTools.skills": "Skills",
|
||||
"models.builtinTools.skillsDesc": "Computer-Skills anzeigen und verwalten",
|
||||
"models.builtinTools.automations": "Automatisierungen",
|
||||
"models.builtinTools.automations": "Geplant",
|
||||
"models.builtinTools.automationsDesc": "Geplante Automatisierungen auflisten und verwalten",
|
||||
"models.builtinTools.images": "Bilder",
|
||||
"models.builtinTools.imagesDesc": "Bilder erstellen oder bearbeiten",
|
||||
|
||||
@@ -466,11 +466,11 @@
|
||||
"about.share": "Share",
|
||||
"about.copyLink": "Copy link",
|
||||
"about.copied": "Copied!",
|
||||
"automations.title": "Automations",
|
||||
"automations.title": "Scheduled",
|
||||
"automations.filter": "Filter...",
|
||||
"automations.noMatches": "No matches",
|
||||
"automations.noAutomations": "No automations yet",
|
||||
"automations.create": "Create automation",
|
||||
"automations.noAutomations": "No scheduled tasks yet",
|
||||
"automations.create": "Create scheduled task",
|
||||
"automations.status": "Status",
|
||||
"automations.active": "Active",
|
||||
"automations.paused": "Paused",
|
||||
@@ -493,8 +493,8 @@
|
||||
"automations.deleted": "Deleted",
|
||||
"automations.webhookEnabled": "Webhook enabled",
|
||||
"automations.webhookDisabled": "Webhook disabled",
|
||||
"automations.failedToLoad": "Failed to load automations",
|
||||
"automations.failedToLoadOne": "Failed to load automation",
|
||||
"automations.failedToLoad": "Failed to load scheduled tasks",
|
||||
"automations.failedToLoadOne": "Failed to load scheduled task",
|
||||
"automations.failedToToggle": "Failed to toggle",
|
||||
"automations.failedToDelete": "Failed to delete",
|
||||
"automations.failedToRun": "Failed to run",
|
||||
@@ -503,9 +503,9 @@
|
||||
"automations.triggered": "\"{{name}}\" triggered",
|
||||
"automations.deleteConfirm": "Delete \"{{name}}\"?",
|
||||
"automations.runNow": "Run now",
|
||||
"automations.newAutomation": "New automation",
|
||||
"automations.newAutomation": "New scheduled task",
|
||||
"automations.toggleSidebar": "Toggle sidebar",
|
||||
"automationModal.titlePlaceholder": "Automation title",
|
||||
"automationModal.titlePlaceholder": "Scheduled task title",
|
||||
"automationModal.instructions": "Instructions",
|
||||
"automationModal.promptPlaceholder": "Enter prompt here...",
|
||||
"automationModal.selectWorkspace": "Select workspace",
|
||||
@@ -513,7 +513,7 @@
|
||||
"automationModal.saving": "Saving...",
|
||||
"automationModal.save": "Save",
|
||||
"automationModal.createBtn": "Create",
|
||||
"automationModal.failedToSave": "Failed to save automation",
|
||||
"automationModal.failedToSave": "Failed to save scheduled task",
|
||||
"connections.failedToUpdate": "Failed to update connection",
|
||||
"admin.gateway.tab": "Gateway",
|
||||
"admin.gateway.title": "API Gateway",
|
||||
@@ -866,7 +866,7 @@
|
||||
"onboarding.connectAi": "Connect AI",
|
||||
"onboarding.provider": "Provider",
|
||||
"onboarding.apiType": "API Type",
|
||||
"onboarding.connectAiDesc": "Add an API key to unlock chat, code editing, and automations.",
|
||||
"onboarding.connectAiDesc": "Add an API key to unlock chat, code editing, and scheduled tasks.",
|
||||
"onboarding.connectAiSkip": "I'll do this later",
|
||||
"onboarding.keyStaysLocal": "Your key stays on this machine.",
|
||||
"onboarding.connected": "{{name}} connected",
|
||||
@@ -936,8 +936,8 @@
|
||||
"models.builtinTools.skillsDesc": "View and manage Computer skills",
|
||||
"models.builtinTools.tasks": "Tasks",
|
||||
"models.builtinTools.tasksDesc": "Show visible task progress in chat",
|
||||
"models.builtinTools.automations": "Automations",
|
||||
"models.builtinTools.automationsDesc": "List and manage scheduled automations",
|
||||
"models.builtinTools.automations": "Scheduled",
|
||||
"models.builtinTools.automationsDesc": "List and manage scheduled tasks",
|
||||
"models.builtinTools.images": "Images",
|
||||
"models.builtinTools.imagesDesc": "Generate or edit images",
|
||||
"models.builtinTools.subagents": "Subagents",
|
||||
@@ -991,7 +991,7 @@
|
||||
"git.deleteBranchConfirm": "Delete branch \"{{name}}\"?",
|
||||
"git.branchDeleted": "Branch deleted",
|
||||
"git.deleteBranchFailed": "Failed to delete branch",
|
||||
"automations.automation": "Automation",
|
||||
"automations.automation": "Scheduled task",
|
||||
"automations.once": "Once",
|
||||
"automations.hourly": "Hourly",
|
||||
"automations.daily": "Daily",
|
||||
|
||||
@@ -464,7 +464,7 @@
|
||||
"about.share": "Compartir",
|
||||
"about.copyLink": "Copiar enlace",
|
||||
"about.copied": "¡Copiado!",
|
||||
"automations.title": "Automatizaciones",
|
||||
"automations.title": "Programadas",
|
||||
"automations.filter": "Filtrar...",
|
||||
"automations.noMatches": "Sin resultados",
|
||||
"automations.noAutomations": "Aún no hay automatizaciones",
|
||||
@@ -922,7 +922,7 @@
|
||||
"models.builtinTools.chatsDesc": "Buscar chats anteriores",
|
||||
"models.builtinTools.skills": "Habilidades",
|
||||
"models.builtinTools.skillsDesc": "Ver y administrar habilidades de Computer",
|
||||
"models.builtinTools.automations": "Automatizaciones",
|
||||
"models.builtinTools.automations": "Programadas",
|
||||
"models.builtinTools.automationsDesc": "Listar y administrar automatizaciones programadas",
|
||||
"models.builtinTools.images": "Imágenes",
|
||||
"models.builtinTools.imagesDesc": "Generar o editar imágenes",
|
||||
|
||||
@@ -464,7 +464,7 @@
|
||||
"about.share": "Partager",
|
||||
"about.copyLink": "Copier le lien",
|
||||
"about.copied": "Copié !",
|
||||
"automations.title": "Automatisations",
|
||||
"automations.title": "Planifiées",
|
||||
"automations.filter": "Filtrer...",
|
||||
"automations.noMatches": "Aucun résultat",
|
||||
"automations.noAutomations": "Aucune automatisation",
|
||||
@@ -922,7 +922,7 @@
|
||||
"models.builtinTools.chatsDesc": "Rechercher dans les chats précédents",
|
||||
"models.builtinTools.skills": "Compétences",
|
||||
"models.builtinTools.skillsDesc": "Afficher et gérer les compétences Computer",
|
||||
"models.builtinTools.automations": "Automatisations",
|
||||
"models.builtinTools.automations": "Planifiées",
|
||||
"models.builtinTools.automationsDesc": "Lister et gérer les automatisations planifiées",
|
||||
"models.builtinTools.images": "Images",
|
||||
"models.builtinTools.imagesDesc": "Générer ou modifier des images",
|
||||
|
||||
@@ -464,7 +464,7 @@
|
||||
"about.share": "共有",
|
||||
"about.copyLink": "リンクをコピー",
|
||||
"about.copied": "コピーしました!",
|
||||
"automations.title": "自動化",
|
||||
"automations.title": "スケジュール済み",
|
||||
"automations.filter": "フィルター...",
|
||||
"automations.noMatches": "一致なし",
|
||||
"automations.noAutomations": "自動化はまだありません",
|
||||
@@ -922,7 +922,7 @@
|
||||
"models.builtinTools.chatsDesc": "過去のチャットを検索します",
|
||||
"models.builtinTools.skills": "スキル",
|
||||
"models.builtinTools.skillsDesc": "Computer のスキルを表示および管理します",
|
||||
"models.builtinTools.automations": "自動化",
|
||||
"models.builtinTools.automations": "スケジュール済み",
|
||||
"models.builtinTools.automationsDesc": "スケジュール済みの自動化を一覧表示して管理します",
|
||||
"models.builtinTools.images": "画像",
|
||||
"models.builtinTools.imagesDesc": "画像を生成または編集します",
|
||||
|
||||
@@ -464,7 +464,7 @@
|
||||
"about.share": "공유",
|
||||
"about.copyLink": "링크 복사",
|
||||
"about.copied": "복사됨!",
|
||||
"automations.title": "자동화",
|
||||
"automations.title": "예약됨",
|
||||
"automations.filter": "필터...",
|
||||
"automations.noMatches": "일치 항목 없음",
|
||||
"automations.noAutomations": "자동화가 아직 없습니다",
|
||||
@@ -922,7 +922,7 @@
|
||||
"models.builtinTools.chatsDesc": "이전 채팅을 검색합니다",
|
||||
"models.builtinTools.skills": "스킬",
|
||||
"models.builtinTools.skillsDesc": "Computer 스킬을 보고 관리합니다",
|
||||
"models.builtinTools.automations": "자동화",
|
||||
"models.builtinTools.automations": "예약됨",
|
||||
"models.builtinTools.automationsDesc": "예약된 자동화를 나열하고 관리합니다",
|
||||
"models.builtinTools.images": "이미지",
|
||||
"models.builtinTools.imagesDesc": "이미지를 생성하거나 편집합니다",
|
||||
|
||||
@@ -464,7 +464,7 @@
|
||||
"about.share": "Compartilhar",
|
||||
"about.copyLink": "Copiar link",
|
||||
"about.copied": "Copiado!",
|
||||
"automations.title": "Automações",
|
||||
"automations.title": "Agendadas",
|
||||
"automations.filter": "Filtrar...",
|
||||
"automations.noMatches": "Sem resultados",
|
||||
"automations.noAutomations": "Nenhuma automação ainda",
|
||||
@@ -922,7 +922,7 @@
|
||||
"models.builtinTools.chatsDesc": "Pesquisar chats anteriores",
|
||||
"models.builtinTools.skills": "Habilidades",
|
||||
"models.builtinTools.skillsDesc": "Ver e gerenciar habilidades do Computer",
|
||||
"models.builtinTools.automations": "Automações",
|
||||
"models.builtinTools.automations": "Agendadas",
|
||||
"models.builtinTools.automationsDesc": "Listar e gerenciar automações agendadas",
|
||||
"models.builtinTools.images": "Imagens",
|
||||
"models.builtinTools.imagesDesc": "Gerar ou editar imagens",
|
||||
|
||||
@@ -464,7 +464,7 @@
|
||||
"about.share": "Поделиться",
|
||||
"about.copyLink": "Копировать ссылку",
|
||||
"about.copied": "Скопировано!",
|
||||
"automations.title": "Автоматизации",
|
||||
"automations.title": "Запланированные",
|
||||
"automations.filter": "Фильтр...",
|
||||
"automations.noMatches": "Нет совпадений",
|
||||
"automations.noAutomations": "Автоматизаций пока нет",
|
||||
@@ -922,7 +922,7 @@
|
||||
"models.builtinTools.chatsDesc": "Поиск по прошлым чатам",
|
||||
"models.builtinTools.skills": "Навыки",
|
||||
"models.builtinTools.skillsDesc": "Просмотр и управление навыками Computer",
|
||||
"models.builtinTools.automations": "Автоматизации",
|
||||
"models.builtinTools.automations": "Запланированные",
|
||||
"models.builtinTools.automationsDesc": "Список и управление запланированными автоматизациями",
|
||||
"models.builtinTools.images": "Изображения",
|
||||
"models.builtinTools.imagesDesc": "Создание или редактирование изображений",
|
||||
|
||||
@@ -464,7 +464,7 @@
|
||||
"about.share": "分享",
|
||||
"about.copyLink": "复制链接",
|
||||
"about.copied": "已复制!",
|
||||
"automations.title": "自动化",
|
||||
"automations.title": "已计划",
|
||||
"automations.filter": "筛选...",
|
||||
"automations.noMatches": "无匹配",
|
||||
"automations.noAutomations": "暂无自动化",
|
||||
@@ -922,7 +922,7 @@
|
||||
"models.builtinTools.chatsDesc": "搜索以前的聊天",
|
||||
"models.builtinTools.skills": "技能",
|
||||
"models.builtinTools.skillsDesc": "查看和管理 Computer 技能",
|
||||
"models.builtinTools.automations": "自动化",
|
||||
"models.builtinTools.automations": "已计划",
|
||||
"models.builtinTools.automationsDesc": "列出并管理计划自动化",
|
||||
"models.builtinTools.images": "图片",
|
||||
"models.builtinTools.imagesDesc": "生成或编辑图片",
|
||||
|
||||
@@ -464,7 +464,7 @@
|
||||
"about.share": "分享",
|
||||
"about.copyLink": "複製連結",
|
||||
"about.copied": "已複製!",
|
||||
"automations.title": "自動化",
|
||||
"automations.title": "已排程",
|
||||
"automations.filter": "篩選...",
|
||||
"automations.noMatches": "無符合項目",
|
||||
"automations.noAutomations": "尚無自動化",
|
||||
@@ -922,7 +922,7 @@
|
||||
"models.builtinTools.chatsDesc": "搜尋過去的聊天",
|
||||
"models.builtinTools.skills": "技能",
|
||||
"models.builtinTools.skillsDesc": "檢視和管理 Computer 技能",
|
||||
"models.builtinTools.automations": "自動化",
|
||||
"models.builtinTools.automations": "已排程",
|
||||
"models.builtinTools.automationsDesc": "列出並管理排程自動化",
|
||||
"models.builtinTools.images": "圖片",
|
||||
"models.builtinTools.imagesDesc": "生成或編輯圖片",
|
||||
|
||||
@@ -17,6 +17,8 @@ export interface GitFile {
|
||||
unstaged?: boolean;
|
||||
staged_status?: string;
|
||||
unstaged_status?: string;
|
||||
additions?: number;
|
||||
deletions?: number;
|
||||
}
|
||||
|
||||
export interface GitStatus {
|
||||
|
||||
@@ -7,6 +7,21 @@ export type InlineDiffSegment = { text: string; changed: boolean };
|
||||
export type InlineDiffLine = NumberedDiffLine & { segments: InlineDiffSegment[] };
|
||||
export type DiffLineGroup<T extends { type: string }> = { type: T['type']; lines: T[] };
|
||||
export type SplitDiffRow = { oldLine: InlineDiffLine | null; newLine: InlineDiffLine | null };
|
||||
export type DiffStats = { additions: number; deletions: number };
|
||||
|
||||
export function countDiffStats(files: DiffFile[]): DiffStats {
|
||||
let additions = 0;
|
||||
let deletions = 0;
|
||||
for (const file of files) {
|
||||
for (const hunk of file.hunks) {
|
||||
for (const line of hunk.lines) {
|
||||
if (line.type === 'added') additions += 1;
|
||||
if (line.type === 'removed') deletions += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return { additions, deletions };
|
||||
}
|
||||
|
||||
export function languageForPath(path: string): string {
|
||||
const ext = path.slice(path.lastIndexOf('.')).toLowerCase();
|
||||
|
||||
@@ -5,48 +5,157 @@
|
||||
|
||||
export function fileIconName(name: string, type: string = 'file'): string {
|
||||
if (type === 'directory') return 'folder';
|
||||
const ext = name.split('.').pop()?.toLowerCase() ?? '';
|
||||
if (name === 'Dockerfile') return 'docker';
|
||||
if (name === 'LICENSE' || name === 'LICENSE.md') return 'page-text';
|
||||
if (name.endsWith('.lock')) return 'lock';
|
||||
const base = name.split('/').pop() ?? name;
|
||||
const lower = base.toLowerCase();
|
||||
const ext = base.includes('.') ? (base.split('.').pop()?.toLowerCase() ?? '') : '';
|
||||
|
||||
if (lower === 'dockerfile' || lower === 'containerfile') return 'docker';
|
||||
if (lower === 'license' || lower === 'license.md') return 'page-text';
|
||||
if (lower === 'package.json' || lower === 'npm-shrinkwrap.json' || lower === 'bunfig.toml') {
|
||||
return 'npm';
|
||||
}
|
||||
if (
|
||||
lower.endsWith('.lock') ||
|
||||
lower === 'package-lock.json' ||
|
||||
lower === 'pnpm-lock.yaml' ||
|
||||
lower === 'yarn.lock'
|
||||
) {
|
||||
return 'package-lock';
|
||||
}
|
||||
|
||||
switch (ext) {
|
||||
case 'md':
|
||||
return 'page-text';
|
||||
case 'mdx':
|
||||
case 'markdown':
|
||||
return 'markdown-logo';
|
||||
case 'ts':
|
||||
return 'typescript-logo';
|
||||
case 'tsx':
|
||||
return 'react';
|
||||
case 'js':
|
||||
case 'mjs':
|
||||
case 'cjs':
|
||||
return 'javascript-logo';
|
||||
case 'jsx':
|
||||
return 'react';
|
||||
case 'py':
|
||||
case 'pyw':
|
||||
return 'python';
|
||||
case 'rs':
|
||||
return 'rust';
|
||||
case 'go':
|
||||
return 'go-logo';
|
||||
case 'java':
|
||||
return 'java-logo';
|
||||
case 'c':
|
||||
case 'cpp':
|
||||
case 'h':
|
||||
return 'c-logo';
|
||||
case 'cpp':
|
||||
case 'cc':
|
||||
case 'cxx':
|
||||
case 'hpp':
|
||||
case 'hh':
|
||||
case 'hxx':
|
||||
return 'cpp-logo';
|
||||
case 'cs':
|
||||
return 'c-sharp-logo';
|
||||
case 'rb':
|
||||
return 'ruby-logo';
|
||||
case 'php':
|
||||
return 'php-logo';
|
||||
case 'swift':
|
||||
return 'apple-swift';
|
||||
case 'kt':
|
||||
case 'kts':
|
||||
return 'kotlin-logo';
|
||||
case 'svelte':
|
||||
return 'svelte-logo';
|
||||
case 'vue':
|
||||
return 'code';
|
||||
return 'vue-js';
|
||||
case 'json':
|
||||
case 'jsonc':
|
||||
case 'json5':
|
||||
return 'json-logo';
|
||||
case 'yaml':
|
||||
case 'yml':
|
||||
return 'yaml-logo';
|
||||
case 'toml':
|
||||
case 'ini':
|
||||
case 'cfg':
|
||||
case 'conf':
|
||||
case 'env':
|
||||
return 'settings';
|
||||
case 'sh':
|
||||
case 'bash':
|
||||
case 'zsh':
|
||||
return 'terminal';
|
||||
case 'css':
|
||||
case 'fish':
|
||||
return 'shell-logo';
|
||||
case 'html':
|
||||
case 'htm':
|
||||
return 'html5';
|
||||
case 'css':
|
||||
case 'scss':
|
||||
case 'sass':
|
||||
case 'less':
|
||||
return 'css3';
|
||||
case 'xml':
|
||||
return 'code';
|
||||
return 'xml-logo';
|
||||
case 'svg':
|
||||
return 'svg-format';
|
||||
case 'sql':
|
||||
case 'sqlite':
|
||||
case 'sqlite3':
|
||||
case 'db':
|
||||
case 'db3':
|
||||
return 'database-script';
|
||||
case 'csv':
|
||||
case 'tsv':
|
||||
return 'csv-logo';
|
||||
case 'pdf':
|
||||
return 'pdf-logo';
|
||||
case 'jpg':
|
||||
case 'jpeg':
|
||||
case 'png':
|
||||
case 'gif':
|
||||
case 'webp':
|
||||
case 'bmp':
|
||||
case 'ico':
|
||||
case 'avif':
|
||||
case 'tiff':
|
||||
return 'image';
|
||||
case 'mp4':
|
||||
case 'webm':
|
||||
case 'mov':
|
||||
case 'ogv':
|
||||
case 'avi':
|
||||
case 'mkv':
|
||||
return 'play';
|
||||
case 'mp3':
|
||||
case 'wav':
|
||||
case 'ogg':
|
||||
case 'flac':
|
||||
case 'm4a':
|
||||
case 'aac':
|
||||
case 'opus':
|
||||
case 'wma':
|
||||
return 'speaker';
|
||||
case 'zip':
|
||||
case 'tar':
|
||||
case 'gz':
|
||||
case 'tgz':
|
||||
case 'bz2':
|
||||
case 'xz':
|
||||
case '7z':
|
||||
case 'rar':
|
||||
return 'archive';
|
||||
case 'docx':
|
||||
case 'txt':
|
||||
return 'page-text';
|
||||
case 'xlsx':
|
||||
case 'xls':
|
||||
return 'table';
|
||||
case 'pptx':
|
||||
return 'page';
|
||||
default:
|
||||
return 'empty-page';
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<script lang="ts">
|
||||
import AutomationsPanel from '$lib/components/automations/AutomationsPanel.svelte';
|
||||
import { t } from '$lib/i18n';
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title>{$t('automations.title')} / Computer</title>
|
||||
</svelte:head>
|
||||
|
||||
<AutomationsPanel />
|
||||
@@ -0,0 +1,13 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/stores';
|
||||
import AutomationsPanel from '$lib/components/automations/AutomationsPanel.svelte';
|
||||
import { t } from '$lib/i18n';
|
||||
|
||||
const automationId = $derived($page.params.id);
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title>{$t('automations.automation')} / Computer</title>
|
||||
</svelte:head>
|
||||
|
||||
<AutomationsPanel {automationId} />
|
||||
@@ -95,6 +95,21 @@ async def status(root: str) -> dict[str, Any]:
|
||||
# Prefer the working-tree status for the row label when both sides exist.
|
||||
entry["status"] = status_text
|
||||
|
||||
async def add_numstat(*args: str) -> None:
|
||||
code, numstat, _ = await _run("diff", "--numstat", *args, cwd=root, check=False)
|
||||
if code != 0:
|
||||
return
|
||||
for line in numstat.splitlines():
|
||||
parts = line.split("\t")
|
||||
if len(parts) < 3:
|
||||
continue
|
||||
added, deleted, path = parts[0], parts[1], parts[2]
|
||||
entry = files_by_path.get(path)
|
||||
if not entry or added == "-" or deleted == "-":
|
||||
continue
|
||||
entry["additions"] = entry.get("additions", 0) + int(added)
|
||||
entry["deletions"] = entry.get("deletions", 0) + int(deleted)
|
||||
|
||||
for line in out.splitlines():
|
||||
if line.startswith("# branch.head "):
|
||||
branch = line.split(" ", 2)[2]
|
||||
@@ -126,6 +141,9 @@ async def status(root: str) -> dict[str, Any]:
|
||||
# Untracked
|
||||
path = line[2:]
|
||||
add_file(path, "untracked", unstaged=True)
|
||||
entry = files_by_path[path]
|
||||
entry["additions"] = _count_text_lines(os.path.join(root, path))
|
||||
entry["deletions"] = 0
|
||||
elif line.startswith("u "):
|
||||
# Unmerged
|
||||
parts = line.split(" ", 10)
|
||||
@@ -137,6 +155,9 @@ async def status(root: str) -> dict[str, Any]:
|
||||
if upstream and not has_ab:
|
||||
upstream = ""
|
||||
|
||||
await add_numstat()
|
||||
await add_numstat("--staged")
|
||||
|
||||
# Get remote URL for "View on GitHub/GitLab" link
|
||||
code, remote_out, _ = await _run("remote", "get-url", "origin", cwd=root, check=False)
|
||||
remote_url = remote_out.strip() if code == 0 else ""
|
||||
@@ -163,6 +184,19 @@ def _status_char(c: str) -> str:
|
||||
}.get(c, c)
|
||||
|
||||
|
||||
def _count_text_lines(path: str) -> int:
|
||||
try:
|
||||
with open(path, "rb") as f:
|
||||
data = f.read()
|
||||
except OSError:
|
||||
return 0
|
||||
if b"\0" in data:
|
||||
return 0
|
||||
if not data:
|
||||
return 0
|
||||
return data.count(b"\n") + (0 if data.endswith(b"\n") else 1)
|
||||
|
||||
|
||||
async def diff(
|
||||
root: str,
|
||||
file: str | None = None,
|
||||
|
||||
Reference in new issue
Block a user