OpenRAG is a comprehensive, single package Retrieval-Augmented Generation platform built on Langflow, Docling, and Opensearch.
Python
icons and connector design updates
Mike Fortman14c39a481219
diff --git a/frontend/app/settings/_components/card-icon.tsx b/frontend/app/settings/_components/card-icon.tsxindex 6f532b29d..ee9e86fbd 100644--- a/frontend/app/settings/_components/card-icon.tsx+++ b/frontend/app/settings/_components/card-icon.tsx@@ -16,7 +16,7 @@ export default function CardIcon({className={cn("w-8 h-8 rounded flex items-center justify-center border",isActive- ? activeBgColor+ ? `${activeBgColor} text-black`: "bg-muted grayscale group-hover:bg-background",)}>diff --git a/frontend/app/settings/_components/connector-card.tsx b/frontend/app/settings/_components/connector-card.tsxindex 3d994d09e..c3e2ab42e 100644--- a/frontend/app/settings/_components/connector-card.tsx+++ b/frontend/app/settings/_components/connector-card.tsx@@ -45,7 +45,6 @@ export default function ConnectorCard({console.log(connector);const isConnected =connector.status === "connected" && connector.connectionId;- connector?.status === "connected" && connector?.connectionId;return (<Card className="group relative flex flex-col hover:bg-secondary-hover hover:border-muted-foreground transition-colors">@@ -93,7 +92,9 @@ export default function ConnectorCard({</Button><Buttonvariant="outline"- onClick={() => onConnect(connector)}+ onClick={() =>+ onConfigure ? onConfigure(connector) : onConnect(connector)+ }disabled={isConnecting || isDisconnecting}className="cursor-pointer"size="iconMd"@@ -101,7 +102,7 @@ export default function ConnectorCard({{isConnecting ? (<RefreshCcw className="h-4 w-4 animate-spin" />) : (- <RefreshCcw className="h-4 w-4" />+ <Settings2 className="h-4 w-4" />)}</Button><Button@@ -120,45 +121,24 @@ export default function ConnectorCard({</div>) : (<Button- variant="outline"- onClick={() => onConnect(connector)}- disabled={isConnecting || isDisconnecting}- className="cursor-pointer"- size="iconMd"+ onClick={() =>+ onConfigure ? onConfigure(connector) : onConnect(connector)+ }+ disabled={isConnecting}+ className="w-full cursor-pointer group-hover:bg-background group-hover:border-zinc-700 group-hover:text-primary"+ size="sm">{isConnecting ? (- <RefreshCcw className="h-4 w-4 animate-spin" />+ <>+ <Loader2 className="h-4 w-4 animate-spin" />+ Connecting...+ </>) : (- <RefreshCcw className="h-4 w-4" />+ <>Connect</>)}</Button>)}</div>- ) : onConfigure ? (- <Button- onClick={() => onConfigure(connector)}- disabled={isConnecting}- className="w-full cursor-pointer group-hover:bg-background group-hover:border-zinc-700 group-hover:text-primary"- size="sm"- >- Configure- </Button>- ) : connector?.available ? (- <Button- onClick={() => onConnect(connector)}- disabled={isConnecting}- className="w-full cursor-pointer group-hover:bg-background group-hover:border-zinc-700 group-hover:text-primary"- size="sm"- >- {isConnecting ? (- <>- <Loader2 className="h-4 w-4 animate-spin" />- Connecting...- </>- ) : (- <>Connect</>- )}- </Button>) : (<div className="text-sm text-muted-foreground"><p>For more details see our</p>diff --git a/frontend/app/upload/[provider]/page.tsx b/frontend/app/upload/[provider]/page.tsxindex ace13be5a..2e73bb838 100644--- a/frontend/app/upload/[provider]/page.tsx+++ b/frontend/app/upload/[provider]/page.tsx@@ -1,7 +1,7 @@"use client";import { useQueryClient } from "@tanstack/react-query";-import { AlertCircle, ArrowLeft, RefreshCw } from "lucide-react";+import { AlertCircle, ArrowLeft, FolderOpen, RefreshCw } from "lucide-react";import { useParams, useRouter } from "next/navigation";import { useState } from "react";import { toast } from "sonner";@@ -52,7 +52,9 @@ function BucketView({onDone: () => void;}) {const queryClient = useQueryClient();- const [syncingBucket, setSyncingBucket] = useState<string | null>(null);+ const [selectedBuckets, setSelectedBuckets] = useState<Set<string>>(+ new Set(),+ );const [ingestSettings, setIngestSettings] = useState<IngestSettingsType>({chunkSize: 1000,chunkOverlap: 200,@@ -66,59 +68,40 @@ function BucketView({queryClient.invalidateQueries({ queryKey: invalidateQueryKey });};- const syncAll = () => {- syncMutation.mutate(- {- connectorType: connector.type,- body: {- connection_id: connector.connectionId!,- selected_files: [],- sync_all: true,- settings: ingestSettings,- },- },- {- onSuccess: (result) => {- invalidate();- if (result.task_ids?.length) {- addTask(result.task_ids[0]);- onDone();- } else {- toast.info("No files found in any bucket.");- }- },- onError: (err) => {- toast.error(err instanceof Error ? err.message : "Sync failed");- },- },- );+ const toggleBucket = (bucketName: string) => {+ setSelectedBuckets((prev) => {+ const next = new Set(prev);+ if (next.has(bucketName)) {+ next.delete(bucketName);+ } else {+ next.add(bucketName);+ }+ return next;+ });};- const syncBucket = (bucketName: string) => {- setSyncingBucket(bucketName);+ const ingestSelected = () => {syncMutation.mutate({connectorType: connector.type,body: {connection_id: connector.connectionId!,selected_files: [],- bucket_filter: [bucketName],+ bucket_filter: Array.from(selectedBuckets),settings: ingestSettings,},},{onSuccess: (result) => {- setSyncingBucket(null);invalidate();if (result.task_ids?.length) {addTask(result.task_ids[0]);onDone();} else {- toast.info(`No files found in bucket "${bucketName}".`);+ toast.info("No files found in the selected buckets.");}},onError: (err) => {- setSyncingBucket(null);toast.error(err instanceof Error ? err.message : "Sync failed");},},@@ -139,17 +122,32 @@ function BucketView({<div className="max-w-3xl mx-auto space-y-4"><div className="flex items-center justify-between"><p className="text-sm text-muted-foreground">- Select a bucket to ingest, or sync everything at once.+ Select buckets to ingest.</p>- <Button- variant="ghost"- size="icon"- onClick={onRefetch}- disabled={isLoading}- title="Refresh bucket status"- >- <RefreshCw size={16} className={isLoading ? "animate-spin" : ""} />- </Button>+ <div className="flex items-center gap-2">+ <Button+ variant="outline"+ size="sm"+ onClick={() =>+ setSelectedBuckets(new Set(buckets?.map((b) => b.name) ?? []))+ }+ disabled={isLoading || !buckets?.length}+ >+ Select All+ </Button>+ <Button+ variant="outline"+ size="sm"+ onClick={onRefetch}+ disabled={isLoading}+ >+ <RefreshCw+ size={14}+ className={isLoading ? "animate-spin" : ""}+ />+ Refresh+ </Button>+ </div></div>{isLoading ? (@@ -167,34 +165,54 @@ function BucketView({</div>) : (<div className="rounded-lg border divide-y">- {buckets.map((bucket) => (- <div- key={bucket.name}- className="flex items-center justify-between px-4 py-3"- >- <div>- <p className="font-medium text-sm">{bucket.name}</p>- {bucket.ingested_count > 0 && (- <p className="text-xs text-muted-foreground">- {bucket.ingested_count} document- {bucket.ingested_count !== 1 ? "s" : ""} ingested- </p>- )}- </div>- <Button- variant="outline"- size="sm"- onClick={() => syncBucket(bucket.name)}- disabled={syncMutation.isPending}+ {buckets.map((bucket) => {+ const isSelected = selectedBuckets.has(bucket.name);+ return (+ <div+ key={bucket.name}+ className="flex items-center gap-[18px] px-4 py-3 cursor-pointer"+ onClick={() => toggleBucket(bucket.name)}>- {syncingBucket === bucket.name- ? "Ingesting…"- : bucket.ingested_count > 0- ? "Re-sync"- : "Ingest"}- </Button>- </div>- ))}+ <div+ className={`shrink-0 size-5 rounded-[6px] border-2 flex items-center justify-center transition-colors ${+ isSelected+ ? "bg-foreground border-foreground"+ : "border-muted-foreground/60"+ }`}+ >+ {isSelected && (+ <svg+ viewBox="0 0 12 12"+ fill="none"+ className="size-3 text-background"+ stroke="currentColor"+ strokeWidth={2}+ strokeLinecap="round"+ strokeLinejoin="round"+ >+ <polyline points="2,6 5,9 10,3" />+ </svg>+ )}+ </div>+ <div className="flex items-center gap-4 flex-1 min-w-0">+ <div className="bg-white/5 rounded-[10px] shrink-0 size-10 flex items-center justify-center">+ <FolderOpen size={20} className="text-muted-foreground" />+ </div>+ <div className="flex flex-col gap-1 min-w-0">+ <p className="font-medium text-sm leading-6">+ {bucket.name}+ </p>+ {bucket.ingested_count > 0 && (+ <p className="text-xs text-muted-foreground">+ {bucket.ingested_count} document+ {bucket.ingested_count !== 1 ? "s" : ""} ingested+ </p>+ )}+ </div>+ </div>+ </div>+ );+ })}</div>)}@@ -217,13 +235,15 @@ function BucketView({</Button><ButtonclassName="bg-foreground text-background hover:bg-foreground/90 font-semibold"- onClick={syncAll}- disabled={syncMutation.isPending}- loading={syncMutation.isPending && !syncingBucket}+ onClick={ingestSelected}+ disabled={syncMutation.isPending || selectedBuckets.size === 0}+ loading={syncMutation.isPending}>- {syncMutation.isPending && !syncingBucket+ {syncMutation.isPending? "Ingesting…"- : "Sync All Buckets"}+ : selectedBuckets.size > 0+ ? `Ingest ${selectedBuckets.size} Bucket${selectedBuckets.size !== 1 ? "s" : ""}`+ : "Select Buckets to Ingest"}</Button></div></div>diff --git a/frontend/components/icons/ibm-cos-icon.tsx b/frontend/components/icons/ibm-cos-icon.tsxindex a8fc4b324..1637afbf3 100644--- a/frontend/components/icons/ibm-cos-icon.tsx+++ b/frontend/components/icons/ibm-cos-icon.tsx@@ -1,63 +1,64 @@export default function IBMCOSIcon(props: React.SVGProps<SVGSVGElement>) {return (<svg- xmlns="http://www.w3.org/2000/svg"- viewBox="0 0 32 32"width="16"height="16"+ viewBox="0 0 32 32"+ fill="none"+ xmlns="http://www.w3.org/2000/svg"{...props}>+ <rect width="32" height="32" fill="white" fillOpacity="0.01" />+ <mask+ id="mask0_40_3996"+ style={{ maskType: "luminance" }}+ maskUnits="userSpaceOnUse"+ x="2"+ y="19"+ width="28"+ height="11"+ >+ <path+ d="M7 26C7.55228 26 8 25.5523 8 25C8 24.4477 7.55228 24 7 24C6.44772 24 6 24.4477 6 25C6 25.5523 6.44772 26 7 26Z"+ fill="white"+ />+ <path+ d="M28 20H26V22H28V28H4V22H14V20H4C3.46957 20 2.96086 20.2107 2.58579 20.5858C2.21071 20.9609 2 21.4696 2 22V28C2 28.5304 2.21071 29.0391 2.58579 29.4142C2.96086 29.7893 3.46957 30 4 30H28C28.5304 30 29.0391 29.7893 29.4142 29.4142C29.7893 29.0391 30 28.5304 30 28V22C30 21.4696 29.7893 20.9609 29.4142 20.5858C29.0391 20.2107 28.5304 20 28 20Z"+ fill="white"+ />+ <path d="M15 23H4V19H15V23Z" fill="url(#paint0_linear_40_3996)" />+ </mask>+ <g mask="url(#mask0_40_3996)">+ <rect width="32" height="32" fill="url(#paint1_linear_40_3996)" />+ </g>+ <path+ d="M18 10H10V2H18V10ZM12 8H16V4H12V8ZM22 14H16V22H24V16H30V8H22V14ZM22 20H18V16H22V20ZM28 10V14H24V10H28Z"+ fill="currentColor"+ /><defs><linearGradient- id="ibm-cos-grad-a"- x1="827.5"- y1="4690.5"- x2="838.5"- y2="4690.5"- gradientTransform="translate(-823.5 -4669.5)"+ id="paint0_linear_40_3996"+ x1="15"+ y1="21"+ x2="4"+ y2="21"gradientUnits="userSpaceOnUse">- <stop offset=".1" />- <stop offset=".888" stopOpacity="0" />+ <stop offset="0.1" />+ <stop offset="0.888" stopOpacity="0" /></linearGradient><linearGradient- id="ibm-cos-grad-b"- y1="32"- x2="32"+ id="paint1_linear_40_3996"+ x1="32"+ y1="0"+ x2="0"+ y2="32"gradientUnits="userSpaceOnUse">- <stop offset=".1" stopColor="#a56eff" />- <stop offset=".9" stopColor="#0f62fe" />+ <stop offset="0.1" stopColor="#0F62FE" />+ <stop offset="0.9" stopColor="#A56EFF" /></linearGradient>- <mask- id="ibm-cos-mask"- x="0"- y="0"- width="32"- height="32"- maskUnits="userSpaceOnUse"- >- <circle cx="7" cy="25" r="1" fill="#fff" />- <path- d="M28 20h-2v2h2v6H4v-6h10v-2H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h24a2 2 0 0 0 2-2v-6a2 2 0 0 0-2-2z"- fill="#fff"- />- <path- transform="rotate(180 9.5 21)"- fill="url(#ibm-cos-grad-a)"- d="M4 19h11v4H4z"- />- </mask></defs>- <g>- <g mask="url(#ibm-cos-mask)">- <path fill="url(#ibm-cos-grad-b)" d="M0 0h32v32H0z" />- </g>- <path- d="M18 10h-8V2h8zm-6-2h4V4h-4zm10 6h-6v8h8v-6h6V8h-8zm0 6h-4v-4h4zm6-10v4h-4v-4z"- fill="#001d6c"- />- </g></svg>);}