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
d86ef15d
Commit
d86ef15d
authored
Mar 07, 2024
by
JzoNg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add tip for switch
parent
fa3eb11b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
45 additions
and
3 deletions
+45
-3
app-info.tsx
web/app/components/app-sidebar/app-info.tsx
+35
-3
completion.png
web/app/components/app-sidebar/completion.png
+0
-0
expert.png
web/app/components/app-sidebar/expert.png
+0
-0
style.module.css
web/app/components/app-sidebar/style.module.css
+8
-0
app.ts
web/i18n/en-US/app.ts
+1
-0
app.ts
web/i18n/zh-Hans/app.ts
+1
-0
No files found.
web/app/components/app-sidebar/app-info.tsx
View file @
d86ef15d
...
@@ -4,6 +4,7 @@ import { useContext, useContextSelector } from 'use-context-selector'
...
@@ -4,6 +4,7 @@ import { useContext, useContextSelector } from 'use-context-selector'
import
cn
from
'classnames'
import
cn
from
'classnames'
import
React
,
{
useCallback
,
useState
}
from
'react'
import
React
,
{
useCallback
,
useState
}
from
'react'
import
AppIcon
from
'../base/app-icon'
import
AppIcon
from
'../base/app-icon'
import
s
from
'./style.module.css'
import
{
import
{
PortalToFollowElem
,
PortalToFollowElem
,
PortalToFollowElemContent
,
PortalToFollowElemContent
,
...
@@ -39,6 +40,7 @@ const AppInfo = ({ expand }: IAppInfoProps) => {
...
@@ -39,6 +40,7 @@ const AppInfo = ({ expand }: IAppInfoProps) => {
const
[
showEditModal
,
setShowEditModal
]
=
useState
(
false
)
const
[
showEditModal
,
setShowEditModal
]
=
useState
(
false
)
const
[
showDuplicateModal
,
setShowDuplicateModal
]
=
useState
(
false
)
const
[
showDuplicateModal
,
setShowDuplicateModal
]
=
useState
(
false
)
const
[
showConfirmDelete
,
setShowConfirmDelete
]
=
useState
(
false
)
const
[
showConfirmDelete
,
setShowConfirmDelete
]
=
useState
(
false
)
const
[
showSwitchTip
,
setShowSwitchTip
]
=
useState
<
string
>
(
''
)
const
mutateApps
=
useContextSelector
(
const
mutateApps
=
useContextSelector
(
AppsContext
,
AppsContext
,
...
@@ -191,7 +193,7 @@ const AppInfo = ({ expand }: IAppInfoProps) => {
...
@@ -191,7 +193,7 @@ const AppInfo = ({ expand }: IAppInfoProps) => {
</
div
>
</
div
>
</
PortalToFollowElemTrigger
>
</
PortalToFollowElemTrigger
>
<
PortalToFollowElemContent
className=
'z-[1002]'
>
<
PortalToFollowElemContent
className=
'z-[1002]'
>
<
div
className=
'w-[320px] bg-white rounded-2xl shadow-xl'
>
<
div
className=
'
relative
w-[320px] bg-white rounded-2xl shadow-xl'
>
{
/* header */
}
{
/* header */
}
<
div
className=
{
cn
(
'flex pl-4 pt-3 pr-3'
,
!
appDetail
.
description
&&
'pb-2'
)
}
>
<
div
className=
{
cn
(
'flex pl-4 pt-3 pr-3'
,
!
appDetail
.
description
&&
'pb-2'
)
}
>
<
div
className=
'shrink-0 mr-2'
>
<
div
className=
'shrink-0 mr-2'
>
...
@@ -232,7 +234,6 @@ const AppInfo = ({ expand }: IAppInfoProps) => {
...
@@ -232,7 +234,6 @@ const AppInfo = ({ expand }: IAppInfoProps) => {
<
div
className=
'px-4 py-2 text-gray-500 text-xs leading-[18px]'
>
{
appDetail
.
description
}
</
div
>
<
div
className=
'px-4 py-2 text-gray-500 text-xs leading-[18px]'
>
{
appDetail
.
description
}
</
div
>
)
}
)
}
{
/* operations */
}
{
/* operations */
}
<
div
></
div
>
<
Divider
className=
"!my-1"
/>
<
Divider
className=
"!my-1"
/>
<
div
className=
"w-full py-1"
>
<
div
className=
"w-full py-1"
>
<
div
className=
'h-9 py-2 px-3 mx-1 flex items-center hover:bg-gray-50 rounded-lg cursor-pointer'
onClick=
{
()
=>
{
<
div
className=
'h-9 py-2 px-3 mx-1 flex items-center hover:bg-gray-50 rounded-lg cursor-pointer'
onClick=
{
()
=>
{
...
@@ -241,7 +242,7 @@ const AppInfo = ({ expand }: IAppInfoProps) => {
...
@@ -241,7 +242,7 @@ const AppInfo = ({ expand }: IAppInfoProps) => {
}
}
>
}
}
>
<
span
className=
'text-gray-700 text-sm leading-5'
>
{
t
(
'app.editApp'
)
}
</
span
>
<
span
className=
'text-gray-700 text-sm leading-5'
>
{
t
(
'app.editApp'
)
}
</
span
>
</
div
>
</
div
>
{
appDetail
.
mode
!==
'completion'
&&
(
{
appDetail
.
mode
!==
'completion'
&&
appDetail
.
model_config
.
prompt_type
!==
'advanced'
&&
(
<>
<>
<
div
className=
'h-9 py-2 px-3 mx-1 flex items-center hover:bg-gray-50 rounded-lg cursor-pointer'
onClick=
{
()
=>
{
<
div
className=
'h-9 py-2 px-3 mx-1 flex items-center hover:bg-gray-50 rounded-lg cursor-pointer'
onClick=
{
()
=>
{
setOpen
(
false
)
setOpen
(
false
)
...
@@ -254,6 +255,19 @@ const AppInfo = ({ expand }: IAppInfoProps) => {
...
@@ -254,6 +255,19 @@ const AppInfo = ({ expand }: IAppInfoProps) => {
</
div
>
</
div
>
</>
</>
)
}
)
}
{
(
appDetail
.
mode
===
'completion'
||
appDetail
.
model_config
.
prompt_type
===
'advanced'
)
&&
(
<>
<
Divider
className=
"!my-1"
/>
<
div
className=
'h-9 py-2 px-3 mx-1 flex items-center hover:bg-gray-50 rounded-lg cursor-pointer'
onMouseEnter=
{
()
=>
setShowSwitchTip
(
appDetail
.
mode
)
}
onMouseLeave=
{
()
=>
setShowSwitchTip
(
''
)
}
onClick=
{
()
=>
setShowSwitchTip
(
appDetail
.
mode
)
}
>
<
span
className=
'text-gray-700 text-sm leading-5'
>
{
t
(
'app.switch'
)
}
</
span
>
</
div
>
</>
)
}
<
Divider
className=
"!my-1"
/>
<
Divider
className=
"!my-1"
/>
<
div
className=
'group h-9 py-2 px-3 mx-1 flex items-center hover:bg-red-50 rounded-lg cursor-pointer'
onClick=
{
()
=>
{
<
div
className=
'group h-9 py-2 px-3 mx-1 flex items-center hover:bg-red-50 rounded-lg cursor-pointer'
onClick=
{
()
=>
{
setOpen
(
false
)
setOpen
(
false
)
...
@@ -264,6 +278,24 @@ const AppInfo = ({ expand }: IAppInfoProps) => {
...
@@ -264,6 +278,24 @@ const AppInfo = ({ expand }: IAppInfoProps) => {
</
span
>
</
span
>
</
div
>
</
div
>
</
div
>
</
div
>
{
/* switch tip */
}
<
div
className=
{
cn
(
'hidden absolute left-[324px] top-0 w-[376px] rounded-xl bg-white border-[0.5px] border-[rgba(0,0,0,0.05)] shadow-lg'
,
showSwitchTip
&&
'!block'
,
)
}
>
<
div
className=
{
cn
(
'w-full h-[256px] bg-center bg-no-repeat bg-contain'
,
showSwitchTip
===
'chat'
&&
s
.
expertPic
,
showSwitchTip
===
'completion'
&&
s
.
completionPic
,
)
}
/>
<
div
className=
'px-4 pb-2'
>
<
div
className=
'text-gray-700 text-md leading-6 font-semibold'
>
{
t
(
'app.newApp.advanced'
)
}
</
div
>
<
div
className=
'text-orange-500 text-xs leading-[18px] font-medium'
>
{
t
(
'app.newApp.advancedFor'
)
}
</
div
>
<
div
className=
'mt-1 text-gray-500 text-sm leading-5'
>
{
t
(
'app.newApp.advancedDescription'
)
}
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
PortalToFollowElemContent
>
</
PortalToFollowElemContent
>
{
showEditModal
&&
(
{
showEditModal
&&
(
...
...
web/app/components/app-sidebar/
switch-modal/
completion.png
→
web/app/components/app-sidebar/completion.png
View file @
d86ef15d
File moved
web/app/components/app-sidebar/
switch-modal/
expert.png
→
web/app/components/app-sidebar/expert.png
View file @
d86ef15d
File moved
web/app/components/app-sidebar/style.module.css
View file @
d86ef15d
.sidebar
{
.sidebar
{
border-right
:
1px
solid
#F3F4F6
;
border-right
:
1px
solid
#F3F4F6
;
}
.completionPic
{
background-image
:
url('./completion.png')
}
.expertPic
{
background-image
:
url('./expert.png')
}
}
\ No newline at end of file
web/i18n/en-US/app.ts
View file @
d86ef15d
...
@@ -66,6 +66,7 @@ const translation = {
...
@@ -66,6 +66,7 @@ const translation = {
ok
:
'OK'
,
ok
:
'OK'
,
cancel
:
'Cancel'
,
cancel
:
'Cancel'
,
},
},
switch
:
'Switch to Workflow Orchestrate'
,
}
}
export
default
translation
export
default
translation
web/i18n/zh-Hans/app.ts
View file @
d86ef15d
...
@@ -65,6 +65,7 @@ const translation = {
...
@@ -65,6 +65,7 @@ const translation = {
ok
:
'确认'
,
ok
:
'确认'
,
cancel
:
'取消'
,
cancel
:
'取消'
,
},
},
switch
:
'迁移为工作流编排'
,
}
}
export
default
translation
export
default
translation
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