RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.
Go agent-harnessagent-native-databaseagentic-aiagentic-retrievalagentic-searchaiai-agentscontext-enginecontext-engineeringcontext-managementharness-engineeringknowledge-compilationragretrieval-augmented-generationretrieval-harnesssearch-harness
fix(web): cap embed dialog User ID input length and add data-type hint (#18773)
euvre6f30ed2bae0e
diff --git a/web/src/components/embed-dialog/index.tsx b/web/src/components/embed-dialog/index.tsxindex 34cfe3e960..29c200c767 100644--- a/web/src/components/embed-dialog/index.tsx+++ b/web/src/components/embed-dialog/index.tsx@@ -59,6 +59,8 @@ import { SwitchFormField } from '../switch-fom-field';import { useIsDarkTheme } from '../theme-provider';import { Input } from '../ui/input';+const MAX_EMBED_USER_ID_LENGTH = 255;+const FormSchema = z.object({visibleAvatar: z.boolean(),published: z.boolean(),@@ -67,7 +69,7 @@ const FormSchema = z.object({enableStreaming: z.boolean(),muteWidget: z.boolean(),theme: z.enum([ThemeEnum.Light, ThemeEnum.Dark]),- userId: z.string().optional(),+ userId: z.string().max(MAX_EMBED_USER_ID_LENGTH).optional(),widgetTitle: z.string(),widgetSubtitle: z.string(),widgetFooterText: z.string(),@@ -431,8 +433,15 @@ window.addEventListener('message',e=>{></SelectWithSearch></RAGFlowFormItem>{isAgent && (- <RAGFlowFormItem name="userId" label={t('flow.userId')}>- <Input></Input>+ <RAGFlowFormItem+ name="userId"+ label={t('flow.userId')}+ tooltip={t('chat.embedUserIdTooltip')}+ >+ <Input+ maxLength={MAX_EMBED_USER_ID_LENGTH}+ placeholder={t('chat.embedUserIdPlaceholder')}+ ></Input></RAGFlowFormItem>)}</TabsContent>diff --git a/web/src/locales/en.ts b/web/src/locales/en.tsindex 479f581fbf..adbca74b49 100644--- a/web/src/locales/en.ts+++ b/web/src/locales/en.ts@@ -1150,6 +1150,9 @@ This auto-tagging feature enhances retrieval by adding another layer of domain-screated: 'Created',action: 'Action',embedModalTitle: 'Embed into webpage',+ embedUserIdPlaceholder: 'e.g. user-001',+ embedUserIdTooltip:+ 'A plain-text identifier (up to 255 characters) for the end user of the embedded page. It is appended to the embed URL as the userId parameter.',published: 'Published',publishedTooltip:'Use the published version for this embed. When enabled, the generated URL includes release=true.',diff --git a/web/src/locales/fr.ts b/web/src/locales/fr.tsindex 5a480196cf..25eb1dd4db 100644--- a/web/src/locales/fr.ts+++ b/web/src/locales/fr.ts@@ -1029,6 +1029,9 @@ Applicable lorsque vous avez besoin que le LLM résume le document entier.created: 'Créé',action: 'Action',embedModalTitle: 'Intégrer dans une page web',+ embedUserIdPlaceholder: 'ex. user-001',+ embedUserIdTooltip:+ 'Chaîne de texte (255 caractères maximum) identifiant l\'utilisateur final de la page intégrée. Elle est ajoutée à l\'URL d\'intégration comme paramètre userId.',comingSoon: 'Bientôt disponible',fullScreenTitle: 'Intégration complète',fullScreenDescription:diff --git a/web/src/locales/it.ts b/web/src/locales/it.tsindex 512009e85d..5c22962398 100644--- a/web/src/locales/it.ts+++ b/web/src/locales/it.ts@@ -1091,6 +1091,9 @@ Questa funzionalità di auto-tagging migliora il recupero aggiungendo un ulteriocreated: 'Creato',action: 'Azione',embedModalTitle: 'Incorpora nella pagina web',+ embedUserIdPlaceholder: 'es. user-001',+ embedUserIdTooltip:+ 'Stringa di testo (massimo 255 caratteri) che identifica l\'utente finale della pagina incorporata. Viene aggiunta all\'URL di incorporamento come parametro userId.',published: 'Pubblicato',publishedTooltip:"Usa la versione pubblicata per questo embed. Quando abilitato, l'URL generato include release=true.",diff --git a/web/src/locales/ja.ts b/web/src/locales/ja.tsindex ae6bee68e3..7cfe9adc97 100644--- a/web/src/locales/ja.ts+++ b/web/src/locales/ja.ts@@ -894,6 +894,9 @@ export default {created: '作成日',action: 'アクション',embedModalTitle: 'ウェブサイトに埋め込む',+ embedUserIdPlaceholder: '例: user-001',+ embedUserIdTooltip:+ '埋め込みページのエンドユーザーを識別する文字列(最大255文字)です。埋め込みURLに userId パラメータとして付加されます。',comingSoon: '近日公開',fullScreenTitle: '全画面埋め込み',diff --git a/web/src/locales/ko.ts b/web/src/locales/ko.tsindex 6a3b13fa74..f3574864aa 100644--- a/web/src/locales/ko.ts+++ b/web/src/locales/ko.ts@@ -1069,6 +1069,9 @@ export default {created: '생성됨',action: '작업',embedModalTitle: '웹페이지에 삽입',+ embedUserIdPlaceholder: '예: user-001',+ embedUserIdTooltip:+ '임베드 페이지의 최종 사용자를 식별하는 문자열(최대 255자)입니다. 임베드 URL에 userId 매개변수로 추가됩니다.',published: '게시됨',publishedTooltip:'이 삽입에 게시된 버전을 사용합니다. 활성화하면 생성된 URL에 release=true가 포함됩니다.',diff --git a/web/src/locales/ru.ts b/web/src/locales/ru.tsindex 69e9089745..3881cb74e7 100644--- a/web/src/locales/ru.ts+++ b/web/src/locales/ru.ts@@ -892,6 +892,9 @@ export default {created: 'Создано',action: 'Действие',embedModalTitle: 'Встроить на веб-страницу',+ embedUserIdPlaceholder: 'например: user-001',+ embedUserIdTooltip:+ 'Строка (до 255 символов), идентифицирующая конечного пользователя встроенной страницы. Она добавляется в URL встраивания как параметр userId.',published: 'Опубликовано',publishedTooltip:'Использовать опубликованную версию для встраивания. В URL будет release=true.',diff --git a/web/src/locales/tr.ts b/web/src/locales/tr.tsindex 7b92f22957..03cdc161bf 100644--- a/web/src/locales/tr.ts+++ b/web/src/locales/tr.ts@@ -1052,6 +1052,9 @@ Bu otomatik etiketleme özelliği, mevcut datasete alanına özgü bilgi katmancreated: 'Oluşturuldu',action: 'İşlem',embedModalTitle: 'Web sayfasına göm',+ embedUserIdPlaceholder: 'örn. user-001',+ embedUserIdTooltip:+ 'Gömülü sayfanın son kullanıcısını tanımlayan bir metin (en fazla 255 karakter). Gömme URL\'sine userId parametresi olarak eklenir.',published: 'Yayınlandı',publishedTooltip: 'Bu göm için yayınlanan sürümü kullanın.',embedType: 'Embed türü',diff --git a/web/src/locales/zh.ts b/web/src/locales/zh.tsindex f45ea94c8f..1d85e48fa0 100644--- a/web/src/locales/zh.ts+++ b/web/src/locales/zh.ts@@ -1048,6 +1048,9 @@ NER:使用 spaCy NER 和基于规则的关键词提取来抽取 Entities 和 Rcreated: '创建于',action: '操作',embedModalTitle: '嵌入网站',+ embedUserIdPlaceholder: '例如:user-001',+ embedUserIdTooltip:+ '用于标识嵌入页面终端用户的字符串,最长 255 个字符,会作为 userId 参数附加到嵌入链接中。',published: '已发布',publishedTooltip:'在嵌入中使用已发布的版本。启用后,生成的 URL 将包含 release=true。',