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
4a28599f
Unverified
Commit
4a28599f
authored
Sep 05, 2023
by
bowen
Committed by
GitHub
Sep 05, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: optimize feedback and app icon (#1099)
parent
7c66d3c7
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
45 additions
and
37 deletions
+45
-37
cardView.tsx
...yout)/app/(appDetailLayout)/[appId]/overview/cardView.tsx
+17
-16
AppCard.tsx
web/app/(commonLayout)/apps/AppCard.tsx
+1
-1
index.tsx
...components/app/configuration/prompt-value-panel/index.tsx
+1
-1
list.tsx
web/app/components/app/log/list.tsx
+4
-4
appCard.tsx
web/app/components/app/overview/appCard.tsx
+5
-3
index.tsx
web/app/components/app/overview/settings/index.tsx
+2
-1
index.tsx
web/app/components/base/confirm-ui/index.tsx
+2
-2
index.tsx
.../components/datasets/documents/detail/completed/index.tsx
+2
-2
index.tsx
.../components/datasets/documents/detail/embedding/index.tsx
+1
-1
index.tsx
...p/components/datasets/documents/detail/metadata/index.tsx
+1
-1
list.tsx
web/app/components/datasets/documents/list.tsx
+1
-1
index.tsx
web/app/components/datasets/settings/form/index.tsx
+1
-1
massive-component.tsx
web/app/components/share/chat/welcome/massive-component.tsx
+1
-1
common.en.ts
web/i18n/lang/common.en.ts
+3
-1
common.zh.ts
web/i18n/lang/common.zh.ts
+3
-1
No files found.
web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/cardView.tsx
View file @
4a28599f
...
@@ -33,21 +33,19 @@ const CardView: FC<ICardViewProps> = ({ appId }) => {
...
@@ -33,21 +33,19 @@ const CardView: FC<ICardViewProps> = ({ appId }) => {
if
(
!
response
)
if
(
!
response
)
return
<
Loading
/>
return
<
Loading
/>
const
handle
Error
=
(
err
:
Error
|
null
)
=>
{
const
handle
CallbackResult
=
(
err
:
Error
|
null
,
message
?:
string
)
=>
{
if
(
!
err
)
{
const
type
=
err
?
'error'
:
'success'
notify
({
type
:
'success'
,
message
||=
(
type
===
'success'
?
'modifiedSuccessfully'
:
'modifiedUnsuccessfully'
)
message
:
t
(
'common.actionMsg.modifiedSuccessfully'
),
})
if
(
type
===
'success'
)
{
mutate
(
detailParams
)
mutate
(
detailParams
)
}
}
else
{
notify
({
notify
({
type
:
'error'
,
type
,
message
:
t
(
'common.actionMsg.modificationFailed'
),
message
:
t
(
`common.actionMsg.
${
message
}
`
),
})
})
}
}
}
const
onChangeSiteStatus
=
async
(
value
:
boolean
)
=>
{
const
onChangeSiteStatus
=
async
(
value
:
boolean
)
=>
{
const
[
err
]
=
await
asyncRunSafe
<
App
>
(
const
[
err
]
=
await
asyncRunSafe
<
App
>
(
...
@@ -56,7 +54,8 @@ const CardView: FC<ICardViewProps> = ({ appId }) => {
...
@@ -56,7 +54,8 @@ const CardView: FC<ICardViewProps> = ({ appId }) => {
body
:
{
enable_site
:
value
},
body
:
{
enable_site
:
value
},
})
as
Promise
<
App
>
,
})
as
Promise
<
App
>
,
)
)
handleError
(
err
)
handleCallbackResult
(
err
)
}
}
const
onChangeApiStatus
=
async
(
value
:
boolean
)
=>
{
const
onChangeApiStatus
=
async
(
value
:
boolean
)
=>
{
...
@@ -66,7 +65,8 @@ const CardView: FC<ICardViewProps> = ({ appId }) => {
...
@@ -66,7 +65,8 @@ const CardView: FC<ICardViewProps> = ({ appId }) => {
body
:
{
enable_api
:
value
},
body
:
{
enable_api
:
value
},
})
as
Promise
<
App
>
,
})
as
Promise
<
App
>
,
)
)
handleError
(
err
)
handleCallbackResult
(
err
)
}
}
const
onSaveSiteConfig
:
IAppCardProps
[
'onSaveSiteConfig'
]
=
async
(
params
)
=>
{
const
onSaveSiteConfig
:
IAppCardProps
[
'onSaveSiteConfig'
]
=
async
(
params
)
=>
{
...
@@ -79,7 +79,7 @@ const CardView: FC<ICardViewProps> = ({ appId }) => {
...
@@ -79,7 +79,7 @@ const CardView: FC<ICardViewProps> = ({ appId }) => {
if
(
!
err
)
if
(
!
err
)
localStorage
.
setItem
(
NEED_REFRESH_APP_LIST_KEY
,
'1'
)
localStorage
.
setItem
(
NEED_REFRESH_APP_LIST_KEY
,
'1'
)
handleError
(
err
)
handleCallbackResult
(
err
)
}
}
const
onGenerateCode
=
async
()
=>
{
const
onGenerateCode
=
async
()
=>
{
...
@@ -88,7 +88,8 @@ const CardView: FC<ICardViewProps> = ({ appId }) => {
...
@@ -88,7 +88,8 @@ const CardView: FC<ICardViewProps> = ({ appId }) => {
url
:
`/apps/
${
appId
}
/site/access-token-reset`
,
url
:
`/apps/
${
appId
}
/site/access-token-reset`
,
})
as
Promise
<
UpdateAppSiteCodeResponse
>
,
})
as
Promise
<
UpdateAppSiteCodeResponse
>
,
)
)
handleError
(
err
)
handleCallbackResult
(
err
,
err
?
'generatedUnsuccessfully'
:
'generatedSuccessfully'
)
}
}
return
(
return
(
...
...
web/app/(commonLayout)/apps/AppCard.tsx
View file @
4a28599f
...
@@ -93,7 +93,7 @@ const AppCard = ({ app, onRefresh }: AppCardProps) => {
...
@@ -93,7 +93,7 @@ const AppCard = ({ app, onRefresh }: AppCardProps) => {
else
{
else
{
notify
({
notify
({
type
:
'error'
,
type
:
'error'
,
message
:
t
(
'common.actionMsg.modifi
cationFailed
'
),
message
:
t
(
'common.actionMsg.modifi
edUnsuccessfully
'
),
})
})
}
}
},
},
...
...
web/app/components/app/configuration/prompt-value-panel/index.tsx
View file @
4a28599f
...
@@ -134,7 +134,7 @@ const PromptValuePanel: FC<IPromptValuePanelProps> = ({
...
@@ -134,7 +134,7 @@ const PromptValuePanel: FC<IPromptValuePanelProps> = ({
<
div
className=
"space-y-3 "
>
<
div
className=
"space-y-3 "
>
{
promptVariables
.
map
(({
key
,
name
,
type
,
options
,
max_length
,
required
})
=>
(
{
promptVariables
.
map
(({
key
,
name
,
type
,
options
,
max_length
,
required
})
=>
(
<
div
key=
{
key
}
className=
"flex items-center justify-between"
>
<
div
key=
{
key
}
className=
"flex items-center justify-between"
>
<
div
className=
"mr-1 shrink-0 w-[120px] text-sm text-gray-900"
>
{
name
||
key
}
</
div
>
<
div
className=
"mr-1 shrink-0 w-[120px] text-sm text-gray-900
break-all
"
>
{
name
||
key
}
</
div
>
{
type
===
'select'
{
type
===
'select'
?
(
?
(
<
Select
<
Select
...
...
web/app/components/app/log/list.tsx
View file @
4a28599f
...
@@ -288,7 +288,7 @@ const CompletionConversationDetailComp: FC<{ appId?: string; conversationId?: st
...
@@ -288,7 +288,7 @@ const CompletionConversationDetailComp: FC<{ appId?: string; conversationId?: st
return
true
return
true
}
}
catch
(
err
)
{
catch
(
err
)
{
notify
({
type
:
'error'
,
message
:
t
(
'common.actionMsg.modifi
cationFailed
'
)
})
notify
({
type
:
'error'
,
message
:
t
(
'common.actionMsg.modifi
edUnsuccessfully
'
)
})
return
false
return
false
}
}
}
}
...
@@ -301,7 +301,7 @@ const CompletionConversationDetailComp: FC<{ appId?: string; conversationId?: st
...
@@ -301,7 +301,7 @@ const CompletionConversationDetailComp: FC<{ appId?: string; conversationId?: st
return
true
return
true
}
}
catch
(
err
)
{
catch
(
err
)
{
notify
({
type
:
'error'
,
message
:
t
(
'common.actionMsg.modifi
cationFailed
'
)
})
notify
({
type
:
'error'
,
message
:
t
(
'common.actionMsg.modifi
edUnsuccessfully
'
)
})
return
false
return
false
}
}
}
}
...
@@ -332,7 +332,7 @@ const ChatConversationDetailComp: FC<{ appId?: string; conversationId?: string }
...
@@ -332,7 +332,7 @@ const ChatConversationDetailComp: FC<{ appId?: string; conversationId?: string }
return
true
return
true
}
}
catch
(
err
)
{
catch
(
err
)
{
notify
({
type
:
'error'
,
message
:
t
(
'common.actionMsg.modifi
cationFailed
'
)
})
notify
({
type
:
'error'
,
message
:
t
(
'common.actionMsg.modifi
edUnsuccessfully
'
)
})
return
false
return
false
}
}
}
}
...
@@ -344,7 +344,7 @@ const ChatConversationDetailComp: FC<{ appId?: string; conversationId?: string }
...
@@ -344,7 +344,7 @@ const ChatConversationDetailComp: FC<{ appId?: string; conversationId?: string }
return
true
return
true
}
}
catch
(
err
)
{
catch
(
err
)
{
notify
({
type
:
'error'
,
message
:
t
(
'common.actionMsg.modifi
cationFailed
'
)
})
notify
({
type
:
'error'
,
message
:
t
(
'common.actionMsg.modifi
edUnsuccessfully
'
)
})
return
false
return
false
}
}
}
}
...
...
web/app/components/app/overview/appCard.tsx
View file @
4a28599f
...
@@ -119,10 +119,12 @@ function AppCard({
...
@@ -119,10 +119,12 @@ function AppCard({
}
}
const
onGenCode
=
async
()
=>
{
const
onGenCode
=
async
()
=>
{
if
(
onGenerateCode
)
{
setGenLoading
(
true
)
setGenLoading
(
true
)
await
asyncRunSafe
(
onGenerateCode
?.()
as
any
)
await
asyncRunSafe
(
onGenerateCode
()
)
setGenLoading
(
false
)
setGenLoading
(
false
)
}
}
}
return
(
return
(
<
div
<
div
...
...
web/app/components/app/overview/settings/index.tsx
View file @
4a28599f
...
@@ -46,7 +46,8 @@ const SettingsModal: FC<ISettingsModalProps> = ({
...
@@ -46,7 +46,8 @@ const SettingsModal: FC<ISettingsModalProps> = ({
onSave
,
onSave
,
})
=>
{
})
=>
{
const
[
isShowMore
,
setIsShowMore
]
=
useState
(
false
)
const
[
isShowMore
,
setIsShowMore
]
=
useState
(
false
)
const
{
title
,
description
,
copyright
,
privacy_policy
,
default_language
,
icon
,
icon_background
}
=
appInfo
.
site
const
{
icon
,
icon_background
}
=
appInfo
const
{
title
,
description
,
copyright
,
privacy_policy
,
default_language
}
=
appInfo
.
site
const
[
inputInfo
,
setInputInfo
]
=
useState
({
title
,
desc
:
description
,
copyright
,
privacyPolicy
:
privacy_policy
})
const
[
inputInfo
,
setInputInfo
]
=
useState
({
title
,
desc
:
description
,
copyright
,
privacyPolicy
:
privacy_policy
})
const
[
language
,
setLanguage
]
=
useState
(
default_language
)
const
[
language
,
setLanguage
]
=
useState
(
default_language
)
const
[
saveLoading
,
setSaveLoading
]
=
useState
(
false
)
const
[
saveLoading
,
setSaveLoading
]
=
useState
(
false
)
...
...
web/app/components/base/confirm-ui/index.tsx
View file @
4a28599f
...
@@ -41,8 +41,8 @@ const ConfirmUI: FC<IConfirmUIProps> = ({
...
@@ -41,8 +41,8 @@ const ConfirmUI: FC<IConfirmUIProps> = ({
</
div
>
</
div
>
<
div
className=
'flex gap-3 mt-4 ml-12'
>
<
div
className=
'flex gap-3 mt-4 ml-12'
>
<
div
onClick=
{
onConfirm
}
className=
'w-20 leading-
[34px]
text-center text-white border rounded-lg cursor-pointer h-9 border-color-primary-700 bg-primary-700'
>
{
confirmText
||
t
(
'common.operation.confirm'
)
}
</
div
>
<
div
onClick=
{
onConfirm
}
className=
'w-20 leading-
9
text-center text-white border rounded-lg cursor-pointer h-9 border-color-primary-700 bg-primary-700'
>
{
confirmText
||
t
(
'common.operation.confirm'
)
}
</
div
>
<
div
onClick=
{
onCancel
}
className=
'w-20 leading-
[34px]
text-center text-gray-500 border rounded-lg cursor-pointer h-9 border-color-gray-200'
>
{
cancelText
||
t
(
'common.operation.cancel'
)
}
</
div
>
<
div
onClick=
{
onCancel
}
className=
'w-20 leading-
9
text-center text-gray-500 border rounded-lg cursor-pointer h-9 border-color-gray-200'
>
{
cancelText
||
t
(
'common.operation.cancel'
)
}
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
...
...
web/app/components/datasets/documents/detail/completed/index.tsx
View file @
4a28599f
...
@@ -304,7 +304,7 @@ const Completed: FC<ICompletedProps> = ({
...
@@ -304,7 +304,7 @@ const Completed: FC<ICompletedProps> = ({
setAllSegments
([...
allSegments
])
setAllSegments
([...
allSegments
])
}
}
else
{
else
{
notify
({
type
:
'error'
,
message
:
t
(
'common.actionMsg.modifi
cationFailed
'
)
})
notify
({
type
:
'error'
,
message
:
t
(
'common.actionMsg.modifi
edUnsuccessfully
'
)
})
}
}
}
}
...
@@ -315,7 +315,7 @@ const Completed: FC<ICompletedProps> = ({
...
@@ -315,7 +315,7 @@ const Completed: FC<ICompletedProps> = ({
resetList
()
resetList
()
}
}
else
{
else
{
notify
({
type
:
'error'
,
message
:
t
(
'common.actionMsg.modifi
cationFailed
'
)
})
notify
({
type
:
'error'
,
message
:
t
(
'common.actionMsg.modifi
edUnsuccessfully
'
)
})
}
}
}
}
...
...
web/app/components/datasets/documents/detail/embedding/index.tsx
View file @
4a28599f
...
@@ -206,7 +206,7 @@ const EmbeddingDetail: FC<Props> = ({ detail, stopPosition = 'top', datasetId: d
...
@@ -206,7 +206,7 @@ const EmbeddingDetail: FC<Props> = ({ detail, stopPosition = 'top', datasetId: d
setIndexingStatusDetail
(
null
)
setIndexingStatusDetail
(
null
)
}
}
else
{
else
{
notify
({
type
:
'error'
,
message
:
t
(
'common.actionMsg.modifi
cationFailed
'
)
})
notify
({
type
:
'error'
,
message
:
t
(
'common.actionMsg.modifi
edUnsuccessfully
'
)
})
}
}
}
}
...
...
web/app/components/datasets/documents/detail/metadata/index.tsx
View file @
4a28599f
...
@@ -292,7 +292,7 @@ const Metadata: FC<IMetadataProps> = ({ docDetail, loading, onUpdate }) => {
...
@@ -292,7 +292,7 @@ const Metadata: FC<IMetadataProps> = ({ docDetail, loading, onUpdate }) => {
if
(
!
e
)
if
(
!
e
)
notify
({
type
:
'success'
,
message
:
t
(
'common.actionMsg.modifiedSuccessfully'
)
})
notify
({
type
:
'success'
,
message
:
t
(
'common.actionMsg.modifiedSuccessfully'
)
})
else
else
notify
({
type
:
'error'
,
message
:
t
(
'common.actionMsg.modifi
cationFailed
'
)
})
notify
({
type
:
'error'
,
message
:
t
(
'common.actionMsg.modifi
edUnsuccessfully
'
)
})
onUpdate
?.()
onUpdate
?.()
setEditStatus
(
false
)
setEditStatus
(
false
)
setSaveLoading
(
false
)
setSaveLoading
(
false
)
...
...
web/app/components/datasets/documents/list.tsx
View file @
4a28599f
...
@@ -150,7 +150,7 @@ export const OperationAction: FC<{
...
@@ -150,7 +150,7 @@ export const OperationAction: FC<{
if
(
!
e
)
if
(
!
e
)
notify
({
type
:
'success'
,
message
:
t
(
'common.actionMsg.modifiedSuccessfully'
)
})
notify
({
type
:
'success'
,
message
:
t
(
'common.actionMsg.modifiedSuccessfully'
)
})
else
else
notify
({
type
:
'error'
,
message
:
t
(
'common.actionMsg.modifi
cationFailed
'
)
})
notify
({
type
:
'error'
,
message
:
t
(
'common.actionMsg.modifi
edUnsuccessfully
'
)
})
onUpdate
(
operationName
)
onUpdate
(
operationName
)
}
}
...
...
web/app/components/datasets/settings/form/index.tsx
View file @
4a28599f
...
@@ -70,7 +70,7 @@ const Form = ({
...
@@ -70,7 +70,7 @@ const Form = ({
await
mutateDatasets
()
await
mutateDatasets
()
}
}
catch
(
e
)
{
catch
(
e
)
{
notify
({
type
:
'error'
,
message
:
t
(
'common.actionMsg.modifi
cationFailed
'
)
})
notify
({
type
:
'error'
,
message
:
t
(
'common.actionMsg.modifi
edUnsuccessfully
'
)
})
}
}
finally
{
finally
{
setLoading
(
false
)
setLoading
(
false
)
...
...
web/app/components/share/chat/welcome/massive-component.tsx
View file @
4a28599f
...
@@ -44,7 +44,7 @@ export const ChatBtn: FC<{ onClick: () => void; className?: string }> = ({
...
@@ -44,7 +44,7 @@ export const ChatBtn: FC<{ onClick: () => void; className?: string }> = ({
return
(
return
(
<
Button
<
Button
type=
'primary'
type=
'primary'
className=
{
cn
(
className
,
`flex items-center ${s.customBtn} gap-2`
)
}
className=
{
cn
(
className
,
`
!px-0
flex items-center ${s.customBtn} gap-2`
)
}
onClick=
{
onClick
}
>
onClick=
{
onClick
}
>
<
svg
width=
"20"
height=
"20"
viewBox=
"0 0 20 20"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
<
svg
width=
"20"
height=
"20"
viewBox=
"0 0 20 20"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
<
path
fillRule=
"evenodd"
clipRule=
"evenodd"
d=
"M18 10.5C18 14.366 14.418 17.5 10 17.5C8.58005 17.506 7.17955 17.1698 5.917 16.52L2 17.5L3.338 14.377C2.493 13.267 2 11.934 2 10.5C2 6.634 5.582 3.5 10 3.5C14.418 3.5 18 6.634 18 10.5ZM7 9.5H5V11.5H7V9.5ZM15 9.5H13V11.5H15V9.5ZM9 9.5H11V11.5H9V9.5Z"
fill=
"white"
/>
<
path
fillRule=
"evenodd"
clipRule=
"evenodd"
d=
"M18 10.5C18 14.366 14.418 17.5 10 17.5C8.58005 17.506 7.17955 17.1698 5.917 16.52L2 17.5L3.338 14.377C2.493 13.267 2 11.934 2 10.5C2 6.634 5.582 3.5 10 3.5C14.418 3.5 18 6.634 18 10.5ZM7 9.5H5V11.5H7V9.5ZM15 9.5H13V11.5H15V9.5ZM9 9.5H11V11.5H9V9.5Z"
fill=
"white"
/>
...
...
web/i18n/lang/common.en.ts
View file @
4a28599f
...
@@ -40,10 +40,12 @@ const translation = {
...
@@ -40,10 +40,12 @@ const translation = {
actionMsg
:
{
actionMsg
:
{
noModification
:
'No modifications at the moment.'
,
noModification
:
'No modifications at the moment.'
,
modifiedSuccessfully
:
'Modified successfully'
,
modifiedSuccessfully
:
'Modified successfully'
,
modifi
cationFailed
:
'Modification failed
'
,
modifi
edUnsuccessfully
:
'Modified unsuccessfully
'
,
copySuccessfully
:
'Copied successfully'
,
copySuccessfully
:
'Copied successfully'
,
paySucceeded
:
'Payment succeeded'
,
paySucceeded
:
'Payment succeeded'
,
payCancelled
:
'Payment cancelled'
,
payCancelled
:
'Payment cancelled'
,
generatedSuccessfully
:
'Generated successfully'
,
generatedUnsuccessfully
:
'Generated unsuccessfully'
,
},
},
model
:
{
model
:
{
params
:
{
params
:
{
...
...
web/i18n/lang/common.zh.ts
View file @
4a28599f
...
@@ -40,8 +40,10 @@ const translation = {
...
@@ -40,8 +40,10 @@ const translation = {
actionMsg
:
{
actionMsg
:
{
noModification
:
'暂无修改'
,
noModification
:
'暂无修改'
,
modifiedSuccessfully
:
'修改成功'
,
modifiedSuccessfully
:
'修改成功'
,
modifi
cationFailed
:
'修改失败'
,
modifi
edUnsuccessfully
:
'修改失败'
,
copySuccessfully
:
'复制成功'
,
copySuccessfully
:
'复制成功'
,
generatedSuccessfully
:
'已重新生成'
,
generatedUnsuccessfully
:
'生成失败'
,
paySucceeded
:
'已支付成功'
,
paySucceeded
:
'已支付成功'
,
payCancelled
:
'已取消支付'
,
payCancelled
:
'已取消支付'
,
},
},
...
...
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