From 7b2c16ca21974cff398cfe79e5637abd6a7e40c5 Mon Sep 17 00:00:00 2001 From: phact Date: Fri, 29 Aug 2025 17:09:54 -0400 Subject: [PATCH] sync all files checkbox --- frontend/src/app/settings/page.tsx | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/frontend/src/app/settings/page.tsx b/frontend/src/app/settings/page.tsx index 6b7fd76b..05220d4c 100644 --- a/frontend/src/app/settings/page.tsx +++ b/frontend/src/app/settings/page.tsx @@ -7,6 +7,7 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/com import { Badge } from "@/components/ui/badge" import { Input } from "@/components/ui/input" import { Label } from "@/components/ui/label" +import { Checkbox } from "@/components/ui/checkbox" import { Loader2, PlugZap, RefreshCw } from "lucide-react" import { ProtectedRoute } from "@/components/protected-route" import { useTask } from "@/contexts/task-context" @@ -51,6 +52,7 @@ function KnowledgeSourcesPage() { const [isSyncing, setIsSyncing] = useState(null) const [syncResults, setSyncResults] = useState<{[key: string]: SyncResult | null}>({}) const [maxFiles, setMaxFiles] = useState(10) + const [syncAllFiles, setSyncAllFiles] = useState(false) // Settings state // Note: backend internal Langflow URL is not needed on the frontend @@ -220,7 +222,7 @@ function KnowledgeSourcesPage() { }, body: JSON.stringify({ connection_id: connector.connectionId, - max_files: maxFiles || undefined + max_files: syncAllFiles ? 0 : (maxFiles || undefined) }), }) @@ -355,7 +357,24 @@ function KnowledgeSourcesPage() {

Sync Settings

Configure how many files to sync when manually triggering a sync

-
+
+
+ { + setSyncAllFiles(!!checked) + if (checked) { + setMaxFiles(0) + } else { + setMaxFiles(10) + } + }} + /> + +
@@ -363,12 +382,13 @@ function KnowledgeSourcesPage() { setMaxFiles(parseInt(e.target.value) || 10)} - className="w-16 min-w-16 max-w-16 flex-shrink-0" + disabled={syncAllFiles} + className="w-16 min-w-16 max-w-16 flex-shrink-0 disabled:opacity-50 disabled:cursor-not-allowed" min="1" max="100" - title="Leave blank or set to 0 for unlimited" + title={syncAllFiles ? "Disabled when 'Sync all files' is checked" : "Leave blank or set to 0 for unlimited"} />