From b7a6e3af3d2b342879fa915ca85ad5459892330f Mon Sep 17 00:00:00 2001 From: Anish Sarkar <104695310+AnishSarkar22@users.noreply.github.com> Date: Mon, 18 May 2026 23:46:16 +0530 Subject: [PATCH] refactor: update alert components across various files to use a consistent structure and styling --- .../components/AgentPermissionsContent.tsx | 12 +- .../components/CommunityPromptsContent.tsx | 11 +- .../components/MemoryContent.tsx | 6 +- .../components/PromptsContent.tsx | 11 +- .../assistant-ui/connector-popup.tsx | 53 ++-- .../baidu-search-api-connect-form.tsx | 30 ++- .../components/bookstack-connect-form.tsx | 8 +- .../components/elasticsearch-connect-form.tsx | 241 +----------------- .../components/github-connect-form.tsx | 31 ++- .../components/linkup-api-connect-form.tsx | 28 +- .../components/luma-connect-form.tsx | 28 +- .../components/obsidian-connect-form.tsx | 23 +- .../components/searxng-connect-form.tsx | 30 ++- .../components/tavily-api-connect-form.tsx | 28 +- .../components/circleback-config.tsx | 8 +- .../components/clickup-config.tsx | 21 +- .../components/confluence-config.tsx | 25 +- .../components/discord-config.tsx | 20 +- .../components/jira-config.tsx | 25 +- .../components/obsidian-config.tsx | 28 +- .../components/slack-config.tsx | 21 +- .../components/teams-config.tsx | 21 +- .../components/webcrawler-config.tsx | 16 +- .../views/connector-edit-view.tsx | 21 +- .../views/indexing-configuration-view.tsx | 19 +- .../views/youtube-crawler-view.tsx | 9 +- .../assistant-ui/document-upload-popup.tsx | 49 ++-- .../public-chat-snapshots-manager.tsx | 10 +- .../settings/agent-model-manager.tsx | 38 +-- .../settings/general-settings-manager.tsx | 8 +- .../settings/image-model-manager.tsx | 38 +-- .../settings/prompt-config-manager.tsx | 30 +-- .../settings/team-memory-manager.tsx | 6 +- .../settings/vision-model-manager.tsx | 38 +-- 34 files changed, 372 insertions(+), 619 deletions(-) diff --git a/surfsense_web/app/dashboard/[search_space_id]/user-settings/components/AgentPermissionsContent.tsx b/surfsense_web/app/dashboard/[search_space_id]/user-settings/components/AgentPermissionsContent.tsx index b01f556ad..6d8233515 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/user-settings/components/AgentPermissionsContent.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/user-settings/components/AgentPermissionsContent.tsx @@ -218,13 +218,13 @@ export function AgentPermissionsContent() { if (isError) { return ( -
Failed to load rules
-
+
Failed to load community prompts
-Please try refreshing the page.
-SurfSense uses this personal memory to personalize your responses across all conversations. diff --git a/surfsense_web/app/dashboard/[search_space_id]/user-settings/components/PromptsContent.tsx b/surfsense_web/app/dashboard/[search_space_id]/user-settings/components/PromptsContent.tsx index a3c824ea0..02edac148 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/user-settings/components/PromptsContent.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/user-settings/components/PromptsContent.tsx @@ -20,6 +20,7 @@ import { AlertDialogHeader, AlertDialogTitle, } from "@/components/ui/alert-dialog"; +import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; @@ -133,11 +134,11 @@ export function PromptsContent() { if (isError) { return ( -
Failed to load prompts
-Please try refreshing the page.
-- {isAutoMode && !hasGlobalConfigs - ? "Auto mode requires a global LLM configuration. Please add one in Settings" - : "A Document Summary LLM is required to process uploads, configure one in Settings"} -
- -+ {isAutoMode && !hasGlobalConfigs + ? "Auto mode requires a global LLM configuration. Please add one in Settings" + : "A Document Summary LLM is required to process uploads, configure one in Settings"} +
+ ++ You'll need a Baidu AppBuilder API key to use this connector. You can get one by + signing up at{" "} + + qianfan.cloud.baidu.com + +
- The Elasticsearch connector allows you to search and retrieve documents from your - Elasticsearch cluster. Configure connection details, select specific indices, and - set search parameters to make your existing data searchable within SurfSense. -
-- You'll need the endpoint URL for your Elasticsearch cluster. This typically - looks like: -
-
- https://your-cluster.es.region.aws.com:443
-
-
- https://elasticsearch.example.com:9200
-
- - Elasticsearch requires authentication. You can use either: -
-
- POST /_security/api_key
-
- - Specify which indices to search. You can: -
-logs-*{" "}
- to match multiple indices
-
- logs-2024, documents-2024
-
-
- The default query used for searches. Use{" "}
- * to match all
- documents, or specify a more complex Elasticsearch query.
-
- Limit searches to specific fields for better performance. Common fields - include: -
-title - Document
- titles
- content - Main content
- description -
- Descriptions
- - Leave empty to search all fields in your documents. -
-- Set a limit on the number of documents retrieved per search (1-10,000). This - helps control response times and resource usage. Leave empty to use - Elasticsearch's default limit. -
-
+ A GitHub PAT is only required for private repositories. Public repos work without a
+ token.{" "}
+
+ Get your token
+
+ You'll need a Linkup API key to use this connector. You can get one by signing up at{" "} + + linkup.so + +
+ You'll need a Luma API Key to use this connector. You can create one from{" "} + + Luma API Settings + +
+ You need access to a running SearxNG instance. Refer to the{" "} + + SearxNG installation guide + {" "} + for setup instructions. If your instance requires an API key, include it below. +
+ You'll need a Tavily API key to use this connector. You can get one by signing up at{" "} + + tavily.com + +
Connected via OAuth
-
+
Workspace:{" "}
- To update your connection, reconnect this connector.
- {workspaceName}
To update your connection, reconnect this connector.
+ +Connected via OAuth
-- This connector is authenticated using OAuth 2.0. Your Confluence instance is: -
-
+ This connector is authenticated using OAuth 2.0. Your Confluence instance is:
- To update your connection, reconnect this connector.
- {siteUrl}
To update your connection, reconnect this connector.
+ +- The bot needs "Read Message History" permission to access channels. Ask a - server admin to grant this permission for channels shown below. -
-Connected via OAuth
-- This connector is authenticated using OAuth 2.0. Your Jira instance is: -
-
+ This connector is authenticated using OAuth 2.0. Your Jira instance is:
- To update your connection, reconnect this connector.
- {baseUrl}
To update your connection, reconnect this connector.
+ +Add Bot to Channels
-
+
Before indexing, add the SurfSense bot to each channel you want to index. The bot can
only access messages from channels it's been added to. Type{" "}
- /invite @SurfSense in
- any channel to add it.
+ /invite @SurfSense{" "}
+ in any channel to add it.
Microsoft Teams Access
-
+
Your agent can search and read messages from Teams channels you have access to, and send
- messages on your behalf. Make sure you're a member of the teams you want to interact
- with.
+ messages on your behalf. Make sure you're a member of the teams you want to
+ interact with.
+
- Re-indexing runs in the background -
-- You can continue using SurfSense while we sync your data. Check inbox for - updates. -
-Indexing runs in the background
-- You can continue using SurfSense while we sync your data. Check inbox for - updates. -
-{t("chat_tip")}
-- {isAutoMode && !hasGlobalConfigs - ? "Auto mode requires a global LLM configuration. Please add one in Settings" - : "A Document Summary LLM is required to process uploads, configure one in Settings"} -
- -+ {isAutoMode && !hasGlobalConfigs + ? "Auto mode requires a global LLM configuration. Please add one in Settings" + : "A Document Summary LLM is required to process uploads, configure one in Settings"} +
+ ++ You have read-only access to LLM + configurations. Contact a space owner to request additional permissions. +
+ You can{" "} + {[canCreate && "create", canUpdate && "edit", canDelete && "delete"] + .filter(Boolean) + .join(" and ")}{" "} + configurations + {!canDelete && ", but cannot delete them"}. +
{globalConfigs.length} global {globalConfigs.length === 1 ? "model" : "models"}
diff --git a/surfsense_web/components/settings/general-settings-manager.tsx b/surfsense_web/components/settings/general-settings-manager.tsx
index 796746f75..02791e4a0 100644
--- a/surfsense_web/components/settings/general-settings-manager.tsx
+++ b/surfsense_web/components/settings/general-settings-manager.tsx
@@ -135,11 +135,9 @@ export function GeneralSettingsManager({ searchSpaceId }: GeneralSettingsManager
return (