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
47bcf52a
Commit
47bcf52a
authored
Jul 05, 2023
by
Joel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: not clear more like this
parent
a82d6485
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
index.tsx
web/app/components/app/text-generate/item/index.tsx
+12
-1
index.tsx
web/app/components/share/text-generation/result/index.tsx
+6
-1
No files found.
web/app/components/app/text-generate/item/index.tsx
View file @
47bcf52a
'use client'
'use client'
import
type
{
FC
}
from
'react'
import
type
{
FC
}
from
'react'
import
React
,
{
useState
}
from
'react'
import
React
,
{
use
Effect
,
use
State
}
from
'react'
import
{
useTranslation
}
from
'react-i18next'
import
{
useTranslation
}
from
'react-i18next'
import
cn
from
'classnames'
import
cn
from
'classnames'
import
copy
from
'copy-to-clipboard'
import
copy
from
'copy-to-clipboard'
...
@@ -29,6 +29,7 @@ export type IGenerationItemProps = {
...
@@ -29,6 +29,7 @@ export type IGenerationItemProps = {
isInstalledApp
:
boolean
isInstalledApp
:
boolean
installedAppId
?:
string
installedAppId
?:
string
taskId
?:
string
taskId
?:
string
controlClearMoreLikeThis
?:
number
}
}
export
const
SimpleBtn
=
({
className
,
onClick
,
children
}:
{
export
const
SimpleBtn
=
({
className
,
onClick
,
children
}:
{
...
@@ -84,6 +85,7 @@ const GenerationItem: FC<IGenerationItemProps> = ({
...
@@ -84,6 +85,7 @@ const GenerationItem: FC<IGenerationItemProps> = ({
isInstalledApp
,
isInstalledApp
,
installedAppId
,
installedAppId
,
taskId
,
taskId
,
controlClearMoreLikeThis
,
})
=>
{
})
=>
{
const
{
t
}
=
useTranslation
()
const
{
t
}
=
useTranslation
()
const
isTop
=
depth
===
1
const
isTop
=
depth
===
1
...
@@ -115,6 +117,7 @@ const GenerationItem: FC<IGenerationItemProps> = ({
...
@@ -115,6 +117,7 @@ const GenerationItem: FC<IGenerationItemProps> = ({
isMobile
,
isMobile
,
isInstalledApp
,
isInstalledApp
,
installedAppId
,
installedAppId
,
controlClearMoreLikeThis
,
}
}
const
handleMoreLikeThis
=
async
()
=>
{
const
handleMoreLikeThis
=
async
()
=>
{
...
@@ -141,6 +144,14 @@ const GenerationItem: FC<IGenerationItemProps> = ({
...
@@ -141,6 +144,14 @@ const GenerationItem: FC<IGenerationItemProps> = ({
return
res
return
res
})()
})()
useEffect
(()
=>
{
if
(
controlClearMoreLikeThis
)
{
setChildMessageId
(
null
)
setCompletionRes
(
''
)
}
},
[
controlClearMoreLikeThis
])
return
(
return
(
<
div
className=
{
cn
(
className
,
isTop
?
'rounded-xl border border-gray-200 bg-white'
:
'rounded-br-xl !mt-0'
)
}
<
div
className=
{
cn
(
className
,
isTop
?
'rounded-xl border border-gray-200 bg-white'
:
'rounded-br-xl !mt-0'
)
}
style=
{
isTop
style=
{
isTop
...
...
web/app/components/share/text-generation/result/index.tsx
View file @
47bcf52a
...
@@ -149,9 +149,13 @@ const Result: FC<IResultProps> = ({
...
@@ -149,9 +149,13 @@ const Result: FC<IResultProps> = ({
},
},
},
isInstalledApp
,
installedAppInfo
?.
id
)
},
isInstalledApp
,
installedAppInfo
?.
id
)
}
}
const
[
controlClearMoreLikeThis
,
setControlClearMoreLikeThis
]
=
useState
(
0
)
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
controlSend
)
if
(
controlSend
)
{
handleSend
()
handleSend
()
setControlClearMoreLikeThis
(
Date
.
now
())
}
},
[
controlSend
])
},
[
controlSend
])
const
renderTextGenerationRes
=
()
=>
(
const
renderTextGenerationRes
=
()
=>
(
...
@@ -169,6 +173,7 @@ const Result: FC<IResultProps> = ({
...
@@ -169,6 +173,7 @@ const Result: FC<IResultProps> = ({
installedAppId=
{
installedAppInfo
?.
id
}
installedAppId=
{
installedAppInfo
?.
id
}
isLoading=
{
isCallBatchAPI
?
(
!
completionRes
&&
isResponsing
)
:
false
}
isLoading=
{
isCallBatchAPI
?
(
!
completionRes
&&
isResponsing
)
:
false
}
taskId=
{
isCallBatchAPI
?
((
taskId
as
number
)
<
10
?
`0${taskId}`
:
`${taskId}`
)
:
undefined
}
taskId=
{
isCallBatchAPI
?
((
taskId
as
number
)
<
10
?
`0${taskId}`
:
`${taskId}`
)
:
undefined
}
controlClearMoreLikeThis=
{
controlClearMoreLikeThis
}
/>
/>
)
)
...
...
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