diff --git a/surfsense_web/app/dashboard/[search_space_id]/connectors/add/baidu-search-api/page.tsx b/surfsense_web/app/dashboard/[search_space_id]/connectors/add/baidu-search-api/page.tsx index 1eaee9676..6624b8214 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/connectors/add/baidu-search-api/page.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/connectors/add/baidu-search-api/page.tsx @@ -153,8 +153,8 @@ export default function BaiduSearchApiPage() { Connect Baidu Search - Integrate with Baidu AI Search to enhance your search capabilities with - intelligent Chinese web search results. + Integrate with Baidu AI Search to enhance your search capabilities with intelligent + Chinese web search results. @@ -224,13 +224,9 @@ export default function BaiduSearchApiPage() { ERNIE 3.5 8K ERNIE 4.5 Turbo 32K - - ERNIE 4.5 Turbo 128K - + ERNIE 4.5 Turbo 128K DeepSeek V3 - - Qwen3 235B - + Qwen3 235B @@ -255,7 +251,9 @@ export default function BaiduSearchApiPage() { Baidu Search V1 - Baidu Search V2 (Recommended) + + Baidu Search V2 (Recommended) + diff --git a/surfsense_web/app/dashboard/[search_space_id]/connectors/add/page.tsx b/surfsense_web/app/dashboard/[search_space_id]/connectors/add/page.tsx index ccf02f107..7e63f5815 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/connectors/add/page.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/connectors/add/page.tsx @@ -65,7 +65,7 @@ const connectorCategories: ConnectorCategory[] = [ description: "Connect to Elasticsearch to index and search documents, logs and metrics.", icon: getConnectorIcon(EnumConnectorName.ELASTICSEARCH_CONNECTOR, "h-6 w-6"), status: "available", - }, + }, { id: "baidu-search-api", title: "Baidu Search", diff --git a/surfsense_web/components/chat/SourceDetailSheet.tsx b/surfsense_web/components/chat/SourceDetailSheet.tsx index ecc8db4d2..e28e35070 100644 --- a/surfsense_web/components/chat/SourceDetailSheet.tsx +++ b/surfsense_web/components/chat/SourceDetailSheet.tsx @@ -53,9 +53,9 @@ export function SourceDetailSheet({ // Check if this is a source type that should render directly from node const isDirectRenderSource = - sourceType === "TAVILY_API" || - sourceType === "LINKUP_API" || - sourceType === "SEARXNG_API" || + sourceType === "TAVILY_API" || + sourceType === "LINKUP_API" || + sourceType === "SEARXNG_API" || sourceType === "BAIDU_SEARCH_API"; useEffect(() => { diff --git a/surfsense_web/hooks/use-github-starts.ts b/surfsense_web/hooks/use-github-starts.ts new file mode 100644 index 000000000..8f343796d --- /dev/null +++ b/surfsense_web/hooks/use-github-starts.ts @@ -0,0 +1,37 @@ +import { useCallback, useEffect, useState } from "react"; +import { apiClient } from "@/lib/api"; + +export const useGithubStarts = () => { + const repo = process.env.NEXT_PUBLIC_GITHUB_REPO; + const owner = process.env.NEXT_PUBLIC_GITHUB_OWNER; + const token = process.env.NEXT_PUBLIC_GITHUB_TOKEN; + + const [starts, setStarts] = useState(null); + + useEffect(() => { + const getStarts = async () => { + try { + if (!repo || !owner || !token) { + throw new Error("Missing GitHub credentials"); + } + const response = await apiClient.get<{ stargazers_count: number }>( + `https://api.github.com/repos/${owner}/${repo}`, + { + headers: { + Authorization: `Bearer ${token}`, + }, + } + ); + + setStarts(response.stargazers_count); + } catch (err) { + console.error("Error fetching starts:", err); + throw err; + } + }; + + getStarts(); + }, []); + + return { starts }; +};