diff --git a/surfsense_web/app/dashboard/[search_space_id]/connectors/(manage)/page.tsx b/surfsense_web/app/dashboard/[search_space_id]/connectors/(manage)/page.tsx index a5d811c81..caeff4ff0 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/connectors/(manage)/page.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/connectors/(manage)/page.tsx @@ -38,7 +38,6 @@ import { } from "@/components/ui/alert-dialog"; import { Button } from "@/components/ui/button"; import { Calendar } from "@/components/ui/calendar"; -import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; import { Dialog, DialogContent, @@ -348,221 +347,213 @@ export default function ConnectorsPage() { - - - {t("your_connectors")} - {t("view_manage")} - - - {isLoading ? ( -
-
-
-
-
-
- ) : connectors.length === 0 ? ( -
-

{t("no_connectors")}

-

{t("no_connectors_desc")}

- -
- ) : ( -
- - - - {t("name")} - {t("type")} - {t("last_indexed")} - {t("periodic")} - {t("actions")} - - - - {connectors.map((connector) => ( - - {connector.name} - {getConnectorIcon(connector.connector_type)} - - {connector.is_indexable - ? formatDateTime(connector.last_indexed_at) - : t("not_indexable")} - - - {connector.is_indexable ? ( - connector.periodic_indexing_enabled ? ( - - - -
- - - {connector.indexing_frequency_minutes - ? formatFrequency(connector.indexing_frequency_minutes) - : "Enabled"} - -
-
- -

- Runs every {connector.indexing_frequency_minutes} minutes - {connector.next_scheduled_at && ( - <> -
- Next: {formatDateTime(connector.next_scheduled_at)} - - )} -

-
-
-
- ) : ( - Disabled - ) - ) : ( - - - )} -
- -
- {connector.is_indexable && ( -
- - - - - - -

- {connector.connector_type === EnumConnectorName.GOOGLE_DRIVE_CONNECTOR - ? "Select folder to index" - : t("index_date_range")} -

-
-
-
- {/* Hide quick index button for Google Drive (requires folder selection) */} - {connector.connector_type !== EnumConnectorName.GOOGLE_DRIVE_CONNECTOR && ( - - - - - - -

{t("quick_index_auto")}

-
-
-
- )} -
- )} - {connector.is_indexable && ( + {isLoading ? ( +
+
+
+
+
+
+ ) : connectors.length === 0 ? ( +
+

{t("no_connectors")}

+

{t("no_connectors_desc")}

+ +
+ ) : ( +
+
+ + + {t("name")} + {t("type")} + {t("last_indexed")} + {t("periodic")} + {t("actions")} + + + + {connectors.map((connector) => ( + + {connector.name} + {getConnectorIcon(connector.connector_type)} + + {connector.is_indexable + ? formatDateTime(connector.last_indexed_at) + : t("not_indexable")} + + + {connector.is_indexable ? ( + connector.periodic_indexing_enabled ? ( + + + +
+ + + {connector.indexing_frequency_minutes + ? formatFrequency(connector.indexing_frequency_minutes) + : "Enabled"} + +
+
+ +

+ Runs every {connector.indexing_frequency_minutes} minutes + {connector.next_scheduled_at && ( + <> +
+ Next: {formatDateTime(connector.next_scheduled_at)} + + )} +

+
+
+
+ ) : ( + Disabled + ) + ) : ( + - + )} +
+ +
+ {connector.is_indexable && ( +
+ + + + + + +

+ {connector.connector_type === EnumConnectorName.GOOGLE_DRIVE_CONNECTOR + ? "Select folder to index" + : t("index_date_range")} +

+
+
+
+ {/* Hide quick index button for Google Drive (requires folder selection) */} + {connector.connector_type !== EnumConnectorName.GOOGLE_DRIVE_CONNECTOR && ( -

Configure Periodic Indexing

+

{t("quick_index_auto")}

)} - - - +
+ )} + {connector.is_indexable && ( + + + - - - - {t("delete_connector")} - - {t("delete_confirm")} - - - - setConnectorToDelete(null)}> - {tCommon("cancel")} - - - {tCommon("delete")} - - - - -
-
-
- ))} -
-
-
- )} -
-
+ + +

Configure Periodic Indexing

+
+ + + )} + + + + + + + + {t("delete_connector")} + + {t("delete_confirm")} + + + + setConnectorToDelete(null)}> + {tCommon("cancel")} + + + {tCommon("delete")} + + + + + + + + ))} + + + + )} {/* Date Picker Dialog */} diff --git a/surfsense_web/app/dashboard/[search_space_id]/documents/upload/page.tsx b/surfsense_web/app/dashboard/[search_space_id]/documents/upload/page.tsx index 2c3220524..d980c73e0 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/documents/upload/page.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/documents/upload/page.tsx @@ -1,16 +1,36 @@ "use client"; -import { useParams, useRouter } from "next/navigation"; -import { useEffect } from "react"; +import { Upload } from "lucide-react"; +import { motion } from "motion/react"; +import { useParams } from "next/navigation"; +import { DocumentUploadTab } from "@/components/sources/DocumentUploadTab"; -export default function UploadDocumentsRedirect() { +export default function UploadDocumentsPage() { const params = useParams(); - const router = useRouter(); const search_space_id = params.search_space_id as string; - useEffect(() => { - router.replace(`/dashboard/${search_space_id}/sources/add?tab=documents`); - }, [search_space_id, router]); + return ( +
+ + {/* Header */} +
+

+ + Upload Documents +

+

+ Upload documents to your search space for AI-powered search and chat +

+
- return null; + {/* Document Upload */} + +
+
+ ); } diff --git a/surfsense_web/app/dashboard/[search_space_id]/sources/add/page.tsx b/surfsense_web/app/dashboard/[search_space_id]/sources/add/page.tsx index 12b3cec78..0ca4ee169 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/sources/add/page.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/sources/add/page.tsx @@ -1,12 +1,11 @@ "use client"; import { IconBrandYoutube } from "@tabler/icons-react"; -import { Cable, Database, Globe, Upload } from "lucide-react"; +import { Cable, Database, Globe } from "lucide-react"; import { motion } from "motion/react"; import { useParams, useRouter, useSearchParams } from "next/navigation"; import { useEffect, useState } from "react"; import { ConnectorsTab } from "@/components/sources/ConnectorsTab"; -import { DocumentUploadTab } from "@/components/sources/DocumentUploadTab"; import { YouTubeTab } from "@/components/sources/YouTubeTab"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; import { trackSourcesTabViewed } from "@/lib/posthog/events"; @@ -16,12 +15,12 @@ export default function AddSourcesPage() { const router = useRouter(); const searchParams = useSearchParams(); const search_space_id = params.search_space_id as string; - const [activeTab, setActiveTab] = useState("documents"); + const [activeTab, setActiveTab] = useState("youtube"); // Handle tab from query parameter useEffect(() => { const tabParam = searchParams.get("tab"); - if (tabParam && ["documents", "youtube", "connectors"].includes(tabParam)) { + if (tabParam && ["youtube", "connectors"].includes(tabParam)) { setActiveTab(tabParam); } }, [searchParams]); @@ -62,12 +61,7 @@ export default function AddSourcesPage() { {/* Tabs */} - - - - Documents - Docs - + YouTube @@ -85,10 +79,6 @@ export default function AddSourcesPage() {
- - - - diff --git a/surfsense_web/components/assistant-ui/attachment.tsx b/surfsense_web/components/assistant-ui/attachment.tsx index 2400f3966..c08736d7c 100644 --- a/surfsense_web/components/assistant-ui/attachment.tsx +++ b/surfsense_web/components/assistant-ui/attachment.tsx @@ -325,7 +325,7 @@ export const ComposerAddAttachment: FC = () => { const chatAttachmentInputRef = useRef(null); const handleFileUpload = () => { - router.push(`/dashboard/${searchSpaceId}/sources/add?tab=documents`); + router.push(`/dashboard/${searchSpaceId}/documents/upload`); }; const handleChatAttachment = () => {