Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
45701a81
Unverified
Commit
45701a81
authored
Jan 29, 2024
by
crazywoola
Committed by
GitHub
Jan 29, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: initial paragraph can not input more than 48 chars (#2258)
parent
409e0c8e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
var.ts
web/utils/var.ts
+11
-0
No files found.
web/utils/var.ts
View file @
45701a81
import
{
MAX_VAR_KEY_LENGHT
,
VAR_ITEM_TEMPLATE
,
getMaxVarNameLength
}
from
'@/config'
import
{
MAX_VAR_KEY_LENGHT
,
VAR_ITEM_TEMPLATE
,
getMaxVarNameLength
}
from
'@/config'
import
{
CONTEXT_PLACEHOLDER_TEXT
,
HISTORY_PLACEHOLDER_TEXT
,
PRE_PROMPT_PLACEHOLDER_TEXT
,
QUERY_PLACEHOLDER_TEXT
}
from
'@/app/components/base/prompt-editor/constants'
import
{
CONTEXT_PLACEHOLDER_TEXT
,
HISTORY_PLACEHOLDER_TEXT
,
PRE_PROMPT_PLACEHOLDER_TEXT
,
QUERY_PLACEHOLDER_TEXT
}
from
'@/app/components/base/prompt-editor/constants'
const
otherAllowedRegex
=
/^
[
a-zA-Z0-9_
]
+$/
const
otherAllowedRegex
=
/^
[
a-zA-Z0-9_
]
+$/
export
const
getNewVar
=
(
key
:
string
,
type
:
string
)
=>
{
export
const
getNewVar
=
(
key
:
string
,
type
:
string
)
=>
{
const
{
max_length
,
...
rest
}
=
VAR_ITEM_TEMPLATE
if
(
type
!==
'string'
)
{
return
{
...
rest
,
type
:
type
||
'string'
,
key
,
name
:
key
.
slice
(
0
,
getMaxVarNameLength
(
key
)),
}
}
return
{
return
{
...
VAR_ITEM_TEMPLATE
,
...
VAR_ITEM_TEMPLATE
,
type
:
type
||
'string'
,
type
:
type
||
'string'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment