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
f814884e
Commit
f814884e
authored
Jul 04, 2023
by
Joel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: two colum not effect other
parent
670143f6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
index.tsx
web/app/components/share/text-generation/index.tsx
+6
-0
index.tsx
web/app/components/share/text-generation/result/index.tsx
+7
-0
No files found.
web/app/components/share/text-generation/index.tsx
View file @
f814884e
...
...
@@ -92,9 +92,12 @@ const TextGeneration: FC<IMainProps> = ({
// send message task
const
[
controlSend
,
setControlSend
]
=
useState
(
0
)
const
[
controlStopResponding
,
setControlStopResponding
]
=
useState
(
0
)
const
handleSend
=
()
=>
{
setIsCallBatchAPI
(
false
)
setControlSend
(
Date
.
now
())
// eslint-disable-next-line @typescript-eslint/no-use-before-define
setAllTaskList
([])
// clear batch task running status
}
const
[
allTaskList
,
setAllTaskList
,
getLatestTaskList
]
=
useGetState
<
Task
[]
>
([])
...
...
@@ -222,6 +225,8 @@ const TextGeneration: FC<IMainProps> = ({
setAllTaskList
(
allTaskList
)
setControlSend
(
Date
.
now
())
// clear run once task status
setControlStopResponding
(
Date
.
now
())
}
const
handleCompleted
=
(
taskId
?:
number
,
isSuccess
?:
boolean
)
=>
{
...
...
@@ -305,6 +310,7 @@ const TextGeneration: FC<IMainProps> = ({
inputs=
{
isCallBatchAPI
?
(
task
as
Task
).
params
.
inputs
:
inputs
}
query=
{
isCallBatchAPI
?
(
task
as
Task
).
params
.
query
:
query
}
controlSend=
{
controlSend
}
controlStopResponding=
{
controlStopResponding
}
onShowRes=
{
showResSidebar
}
handleSaveMessage=
{
handleSaveMessage
}
taskId=
{
task
?.
id
}
...
...
web/app/components/share/text-generation/result/index.tsx
View file @
f814884e
...
...
@@ -23,6 +23,7 @@ export type IResultProps = {
inputs
:
Record
<
string
,
any
>
query
:
string
controlSend
?:
number
controlStopResponding
?:
number
onShowRes
:
()
=>
void
handleSaveMessage
:
(
messageId
:
string
)
=>
void
taskId
?:
number
...
...
@@ -40,12 +41,18 @@ const Result: FC<IResultProps> = ({
inputs
,
query
,
controlSend
,
controlStopResponding
,
onShowRes
,
handleSaveMessage
,
taskId
,
onCompleted
,
})
=>
{
const
[
isResponsing
,
{
setTrue
:
setResponsingTrue
,
setFalse
:
setResponsingFalse
}]
=
useBoolean
(
false
)
useEffect
(()
=>
{
if
(
controlStopResponding
)
setResponsingFalse
()
},
[
controlStopResponding
])
const
[
completionRes
,
setCompletionRes
]
=
useState
(
''
)
const
{
notify
}
=
Toast
const
isNoData
=
!
completionRes
...
...
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