Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: change config string variable limit (#837)

Matri50b11e925be3
diff --git a/web/app/components/app/configuration/config-var/config-string/index.tsx b/web/app/components/app/configuration/config-var/config-string/index.tsx
index 41ebf651539..c471b1e47e5 100644
--- a/web/app/components/app/configuration/config-var/config-string/index.tsx
+++ b/web/app/components/app/configuration/config-var/config-string/index.tsx
@@ -1,18 +1,18 @@
'use client'
-import React, { FC, } from 'react'
+import type { FC } from 'react'
+import React from 'react'
-export interface IConfigStringProps {
+export type IConfigStringProps = {
value: number | undefined
onChange: (value: number | undefined) => void
}
-const MAX_LENGTH = 64
+const MAX_LENGTH = 256
const ConfigString: FC<IConfigStringProps> = ({
value,
onChange,
}) => {
-
return (
<div>
<input
@@ -20,13 +20,8 @@ const ConfigString: FC<IConfigStringProps> = ({
max={MAX_LENGTH}
min={1}
value={value || ''}
- onChange={e => {
- let value = parseInt(e.target.value, 10)
- if (value > MAX_LENGTH) {
- value = MAX_LENGTH
- } else if (value < 1) {
- value = 1
- }
+ onChange={(e) => {
+ const value = Math.max(1, Math.min(MAX_LENGTH, parseInt(e.target.value))) || 1
onChange(value)
}}
className="w-full px-3 text-sm leading-9 text-gray-900 border-0 rounded-lg grow h-9 bg-gray-50 focus:outline-none focus:ring-1 focus:ring-inset focus:ring-gray-200"