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
13174aac
Commit
13174aac
authored
Mar 07, 2024
by
StyleZhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug and preview
parent
74f02363
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
76 additions
and
10 deletions
+76
-10
chat-wrapper.tsx
...ponents/workflow/panel/debug-and-preview/chat-wrapper.tsx
+4
-5
index.tsx
...app/components/workflow/panel/debug-and-preview/index.tsx
+5
-2
user-input.tsx
...omponents/workflow/panel/debug-and-preview/user-input.tsx
+47
-0
record.tsx
web/app/components/workflow/panel/record.tsx
+11
-2
run-history.tsx
web/app/components/workflow/panel/run-history.tsx
+3
-1
workflow.ts
web/i18n/en-US/workflow.ts
+3
-0
workflow.ts
web/i18n/zh-Hans/workflow.ts
+3
-0
No files found.
web/app/components/workflow/panel/debug-and-preview/chat-wrapper.tsx
View file @
13174aac
import
UserInput
from
'./user-input'
import
Chat
from
'@/app/components/base/chat/chat'
import
{
useChat
}
from
'@/app/components/base/chat/chat/hooks'
const
ChatWrapper
=
()
=>
{
const
{
handleStop
,
isRespon
s
ing
,
isRespon
d
ing
,
suggestedQuestions
,
}
=
useChat
()
return
(
<
Chat
chatList=
{
[]
}
isRespon
sing=
{
isRespons
ing
}
isRespon
ding=
{
isRespond
ing
}
chatContainerclassName=
'px-4'
chatContainerInnerClassName=
'px-4'
chatFooterClassName=
'pb-4'
chatFooterInnerClassName=
'px-4'
onSend=
{
()
=>
{}
}
onStopResponding=
{
handleStop
}
chatNode=
{
(
<
div
className=
'h-[150px] rounded-xl bg-white shadow-xs'
></
div
>
)
}
chatNode=
{
<
UserInput
/>
}
allToolIcons=
{
{}
}
suggestedQuestions=
{
suggestedQuestions
}
/>
...
...
web/app/components/workflow/panel/debug-and-preview/index.tsx
View file @
13174aac
import
type
{
FC
}
from
'react'
import
{
useTranslation
}
from
'react-i18next'
import
ChatWrapper
from
'./chat-wrapper'
const
DebugAndPreview
:
FC
=
()
=>
{
const
{
t
}
=
useTranslation
()
return
(
<
div
className=
'flex flex-col w-[400px] h-full rounded-l-2xl border border-black/[0.02] shadow-xl'
style=
{
{
background
:
'linear-gradient(156deg, rgba(242, 244, 247, 0.80) 0%, rgba(242, 244, 247, 0.00) 99.43%), var(--white, #FFF)'
}
}
>
<
div
className=
'shrink-0 flex items-center justify-between px-4 pt-3 pb-2'
>
Debug and Preview
<
div
className=
'shrink-0 flex items-center justify-between px-4 pt-3 pb-2
font-semibold text-gray-900
'
>
{
t
(
'workflow.common.debugAndPreview'
).
toLocaleUpperCase
()
}
<
div
className=
'h-8'
/>
</
div
>
<
div
className=
'grow rounded-b-2xl'
>
...
...
web/app/components/workflow/panel/debug-and-preview/user-input.tsx
0 → 100644
View file @
13174aac
import
{
memo
,
useState
,
}
from
'react'
import
{
useTranslation
}
from
'react-i18next'
import
{
ChevronDown
}
from
'@/app/components/base/icons/src/vender/line/arrows'
const
UserInput
=
()
=>
{
const
{
t
}
=
useTranslation
()
const
[
expanded
,
setExpanded
]
=
useState
(
true
)
return
(
<
div
className=
{
`
rounded-xl border
${!expanded ? 'bg-indigo-25 border-indigo-100 shadow-none' : 'bg-white shadow-xs border-transparent'}
`
}
>
<
div
className=
{
`
flex items-center px-2 pt-4 h-[18px] text-[13px] font-semibold cursor-pointer
${!expanded ? 'text-indigo-800' : 'text-gray-800'}
`
}
onClick=
{
()
=>
setExpanded
(
!
expanded
)
}
>
<
ChevronDown
className=
{
`mr-1 w-3 h-3 ${!expanded ? '-rotate-90 text-indigo-600' : 'text-gray-300'}`
}
/>
{
t
(
'workflow.panel.userInputField'
).
toLocaleUpperCase
()
}
</
div
>
<
div
className=
'px-2 pt-1 pb-3'
>
{
expanded
&&
(
<
div
className=
'py-2 text-[13px] text-gray-900'
>
<
div
className=
'flex px-4 py-1'
>
<
div
className=
'shrink-0 mr-4 leading-8'
>
Service Name
</
div
>
<
input
className=
'grow px-3 h-8 appearance-none outline-none rounded-lg bg-gray-100'
/>
</
div
>
</
div
>
)
}
</
div
>
</
div
>
)
}
export
default
memo
(
UserInput
)
web/app/components/workflow/panel/record.tsx
View file @
13174aac
import
{
memo
}
from
'react'
import
Run
from
'../run'
import
{
useStore
}
from
'../store'
import
{
XClose
}
from
'@/app/components/base/icons/src/vender/line/general'
const
Record
=
()
=>
{
return
(
<
div
className=
'flex flex-col w-[400px] h-full rounded-2xl border-[0.5px] border-gray-200 shadow-xl bg-white'
>
<
div
className=
'p-4 pb-1 text-base font-semibold text-gray-900'
>
<
div
className=
'
flex items-center justify-between
p-4 pb-1 text-base font-semibold text-gray-900'
>
Test Run#5
<
div
className=
'flex items-center justify-center w-6 h-6 cursor-pointer'
onClick=
{
()
=>
useStore
.
setState
({
runTaskId
:
''
})
}
>
<
XClose
className=
'w-4 h-4 text-gray-500'
/>
</
div
>
</
div
>
<
Run
activeTab=
'RESULT'
appId=
''
/>
</
div
>
)
}
export
default
Record
export
default
memo
(
Record
)
web/app/components/workflow/panel/run-history.tsx
View file @
13174aac
import
{
memo
}
from
'react'
import
{
useTranslation
}
from
'react-i18next'
import
{
XClose
}
from
'@/app/components/base/icons/src/vender/line/general'
import
{
AlertCircle
}
from
'@/app/components/base/icons/src/vender/line/alertsAndFeedback'
import
{
useStore
}
from
'@/app/components/workflow/store'
import
{
useStore
as
useAppStore
}
from
'@/app/components/app/store'
const
RunHistory
=
()
=>
{
const
{
t
}
=
useTranslation
()
const
appDetail
=
useAppStore
(
state
=>
state
.
appDetail
)
return
(
<
div
className=
'ml-2 w-[200px] h-full bg-white border-[0.5px] border-gray-200 shadow-xl rounded-l-2xl'
>
<
div
className=
'flex items-center justify-between px-4 pt-3 text-base font-semibold text-gray-900'
>
Run History
{
t
(
'workflow.common.runHistory'
)
}
<
div
className=
'flex items-center justify-center w-6 h-6 cursor-pointer'
onClick=
{
()
=>
useStore
.
setState
({
showRunHistory
:
false
})
}
...
...
web/i18n/en-US/workflow.ts
View file @
13174aac
...
...
@@ -47,6 +47,9 @@ const translation = {
zoomTo100
:
'Zoom to 100%'
,
zoomToFit
:
'Zoom to Fit'
,
},
panel
:
{
userInputField
:
'User Input Field'
,
},
nodes
:
{
common
:
{
outputVars
:
'Output Variables'
,
...
...
web/i18n/zh-Hans/workflow.ts
View file @
13174aac
...
...
@@ -47,6 +47,9 @@ const translation = {
zoomTo100
:
'放大到 100%'
,
zoomToFit
:
'自适应视图'
,
},
panel
:
{
userInputField
:
'用户输入字段'
,
},
nodes
:
{
common
:
{
outputVars
:
'输出变量'
,
...
...
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