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
92e9b1bb
Commit
92e9b1bb
authored
Mar 12, 2024
by
JzoNg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update style of app list
parent
446932e0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
19 deletions
+52
-19
AppCard.tsx
web/app/(commonLayout)/apps/AppCard.tsx
+51
-18
index.tsx
web/app/components/explore/app-card/index.tsx
+1
-1
No files found.
web/app/(commonLayout)/apps/AppCard.tsx
View file @
92e9b1bb
...
...
@@ -5,8 +5,6 @@ import { useRouter } from 'next/navigation'
import
{
useCallback
,
useState
}
from
'react'
import
{
useTranslation
}
from
'react-i18next'
import
cn
from
'classnames'
import
style
from
'../list.module.css'
import
AppModeLabel
from
'./AppModeLabel'
import
s
from
'./style.module.css'
import
SettingsModal
from
'@/app/components/app/overview/settings'
import
type
{
ConfigParams
}
from
'@/app/components/app/overview/settings'
...
...
@@ -25,6 +23,8 @@ import { asyncRunSafe } from '@/utils'
import
{
getRedirection
}
from
'@/utils/app-redirection'
import
{
useProviderContext
}
from
'@/context/provider-context'
import
{
NEED_REFRESH_APP_LIST_KEY
}
from
'@/config'
import
{
AiText
,
ChatBot
,
CuteRobote
}
from
'@/app/components/base/icons/src/vender/solid/communication'
import
{
Route
}
from
'@/app/components/base/icons/src/vender/line/mapsAndTravel'
export
type
AppCardProps
=
{
app
:
App
...
...
@@ -209,16 +209,54 @@ const AppCard = ({ app, onRefresh }: AppCardProps) => {
e
.
preventDefault
()
getRedirection
(
isCurrentWorkspaceManager
,
app
,
push
)
}
}
className=
{
style
.
listItem
}
className=
'group flex col-span-1 bg-white border-2 border-solid border-transparent rounded-lg shadow-sm min-h-[160px] flex flex-col transition-all duration-200 ease-in-out cursor-pointer hover:shadow-lg'
>
<
div
className=
{
style
.
listItemTitle
}
>
<
AppIcon
size=
"large"
icon=
{
app
.
icon
}
background=
{
app
.
icon_background
}
/>
<
div
className=
{
style
.
listItemHeading
}
>
<
div
className=
{
style
.
listItemHeadingContent
}
>
{
app
.
name
}
</
div
>
<
div
className=
'flex pt-[14px] px-[14px] pb-3 h-[66px] items-center gap-3 grow-0 shrink-0'
>
<
div
className=
'relative shrink-0'
>
<
AppIcon
size=
"large"
icon=
{
app
.
icon
}
background=
{
app
.
icon_background
}
/>
<
span
className=
'absolute bottom-[-3px] right-[-3px] w-4 h-4 p-0.5 bg-white rounded border-[0.5px] border-[rgba(0,0,0,0.02)] shadow-sm'
>
{
app
.
mode
===
'advanced-chat'
&&
(
<
ChatBot
className=
'w-3 h-3 text-blue-600'
/>
)
}
{
app
.
mode
===
'agent-chat'
&&
(
<
CuteRobote
className=
'w-3 h-3 text-indigo-600'
/>
)
}
{
app
.
mode
===
'chat'
&&
(
<
ChatBot
className=
'w-3 h-3 text-blue-600'
/>
)
}
{
app
.
mode
===
'completion'
&&
(
<
AiText
className=
'w-3 h-3 text-gray-500'
/>
)
}
{
app
.
mode
===
'workflow'
&&
(
<
Route
className=
'w-3 h-3 text-[#f79009]'
/>
)
}
</
span
>
</
div
>
<
div
className=
'grow w-0 py-[1px]'
>
<
div
className=
'flex items-center text-sm leading-5 font-semibold text-gray-800'
>
<
div
className=
'truncate'
title=
{
app
.
name
}
>
{
app
.
name
}
</
div
>
</
div
>
<
div
className=
'flex items-center text-[10px] leading-[18px] text-gray-500'
>
{
app
.
mode
===
'advanced-chat'
&&
(
<
div
className=
'truncate'
>
{
t
(
'app.types.chatbot'
).
toUpperCase
()
}
</
div
>
)
}
{
app
.
mode
===
'agent-chat'
&&
(
<
div
className=
'truncate'
>
{
t
(
'app.types.agent'
).
toUpperCase
()
}
</
div
>
)
}
{
app
.
mode
===
'chat'
&&
(
<
div
className=
'truncate'
>
{
t
(
'app.types.chatbot'
).
toUpperCase
()
}
</
div
>
)
}
{
app
.
mode
===
'completion'
&&
(
<
div
className=
'truncate'
>
{
t
(
'app.types.completion'
).
toUpperCase
()
}
</
div
>
)
}
{
app
.
mode
===
'workflow'
&&
(
<
div
className=
'truncate'
>
{
t
(
'app.types.workflow'
).
toUpperCase
()
}
</
div
>
)
}
</
div
>
</
div
>
{
isCurrentWorkspaceManager
&&
<
CustomPopover
onTriggerClick=
{
()
=>
{
...
...
@@ -232,19 +270,14 @@ const AppCard = ({ app, onRefresh }: AppCardProps) => {
btnClassName=
{
open
=>
cn
(
open
?
'!bg-gray-100 !shadow-none'
:
'!bg-transparent'
,
style
.
actionIconWrapper
,
'!hidden h-8 w-8 !p-2 rounded-md border-none hover:!bg-gray-100 group-hover:!inline-flex'
,
)
}
className=
{
'!w-[128px] h-fit !z-20'
}
manualClose
/>
}
</
div
>
<
div
className=
{
style
.
listItemDescription
}
>
{
app
.
description
}
</
div
>
<
div
className=
{
style
.
listItemFooter
}
>
<
AppModeLabel
mode=
{
app
.
mode
}
/>
</
div
>
<
div
className=
'mb-1 px-[14px] text-xs leading-normal text-gray-500 line-clamp-4'
>
{
app
.
description
}
</
div
>
{
showSettingsModal
&&
detailState
.
detail
&&
(
<
SettingsModal
appInfo=
{
detailState
.
detail
}
...
...
web/app/components/explore/app-card/index.tsx
View file @
92e9b1bb
...
...
@@ -45,7 +45,7 @@ const AppCard = ({
)
}
</
span
>
</
div
>
<
div
className=
'grow w-0'
>
<
div
className=
'grow w-0
py-[1px]
'
>
<
div
className=
'flex items-center text-sm leading-5 font-semibold text-gray-800'
>
<
div
className=
'truncate'
title=
{
appBasicInfo
.
name
}
>
{
appBasicInfo
.
name
}
</
div
>
</
div
>
...
...
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