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
93754fdd
Commit
93754fdd
authored
Aug 01, 2023
by
StyleZhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: model-item
parent
149a59f6
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
119 additions
and
0 deletions
+119
-0
chevron-down-double.svg
...e/icons/assets/vender/line/arrows/chevron-down-double.svg
+5
-0
ChevronDownDouble.json
.../base/icons/src/vender/line/arrows/ChevronDownDouble.json
+39
-0
ChevronDownDouble.tsx
...s/base/icons/src/vender/line/arrows/ChevronDownDouble.tsx
+14
-0
index.ts
...app/components/base/icons/src/vender/line/arrows/index.ts
+1
-0
index.tsx
...pp/components/header/account-setting/model-page/index.tsx
+36
-0
index.tsx
...ts/header/account-setting/model-page/model-item/index.tsx
+22
-0
common.en.ts
web/i18n/lang/common.en.ts
+1
-0
common.zh.ts
web/i18n/lang/common.zh.ts
+1
-0
No files found.
web/app/components/base/icons/assets/vender/line/arrows/chevron-down-double.svg
0 → 100644
View file @
93754fdd
<svg
width=
"12"
height=
"13"
viewBox=
"0 0 12 13"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
<g
id=
"chevron-down-double"
>
<path
id=
"Icon"
d=
"M3.5 7L6 9.5L8.5 7M3.5 3.5L6 6L8.5 3.5"
stroke=
"#667085"
stroke-width=
"1.25"
stroke-linecap=
"round"
stroke-linejoin=
"round"
/>
</g>
</svg>
web/app/components/base/icons/src/vender/line/arrows/ChevronDownDouble.json
0 → 100644
View file @
93754fdd
{
"icon"
:
{
"type"
:
"element"
,
"isRootNode"
:
true
,
"name"
:
"svg"
,
"attributes"
:
{
"width"
:
"12"
,
"height"
:
"13"
,
"viewBox"
:
"0 0 12 13"
,
"fill"
:
"none"
,
"xmlns"
:
"http://www.w3.org/2000/svg"
},
"children"
:
[
{
"type"
:
"element"
,
"name"
:
"g"
,
"attributes"
:
{
"id"
:
"chevron-down-double"
},
"children"
:
[
{
"type"
:
"element"
,
"name"
:
"path"
,
"attributes"
:
{
"id"
:
"Icon"
,
"d"
:
"M3.5 7L6 9.5L8.5 7M3.5 3.5L6 6L8.5 3.5"
,
"stroke"
:
"currentColor"
,
"stroke-width"
:
"1.25"
,
"stroke-linecap"
:
"round"
,
"stroke-linejoin"
:
"round"
},
"children"
:
[]
}
]
}
]
},
"name"
:
"ChevronDownDouble"
}
\ No newline at end of file
web/app/components/base/icons/src/vender/line/arrows/ChevronDownDouble.tsx
0 → 100644
View file @
93754fdd
// GENERATE BY script
// DON NOT EDIT IT MANUALLY
import
*
as
React
from
'react'
import
data
from
'./ChevronDownDouble.json'
import
IconBase
from
'@/app/components/base/icons/IconBase'
import
type
{
IconBaseProps
,
IconData
}
from
'@/app/components/base/icons/IconBase'
const
Icon
=
React
.
forwardRef
<
React
.
MutableRefObject
<
SVGElement
>
,
Omit
<
IconBaseProps
,
'data'
>>
((
props
,
ref
,
)
=>
<
IconBase
{
...
props
}
ref=
{
ref
}
data=
{
data
as
IconData
}
/>)
export
default
Icon
web/app/components/base/icons/src/vender/line/arrows/index.ts
View file @
93754fdd
export
{
default
as
ArrowNarrowLeft
}
from
'./ArrowNarrowLeft'
export
{
default
as
ArrowUpRight
}
from
'./ArrowUpRight'
export
{
default
as
ChevronDownDouble
}
from
'./ChevronDownDouble'
export
{
default
as
ChevronDown
}
from
'./ChevronDown'
export
{
default
as
ChevronRight
}
from
'./ChevronRight'
export
{
default
as
RefreshCw05
}
from
'./RefreshCw05'
web/app/components/header/account-setting/model-page/index.tsx
View file @
93754fdd
import
{
useState
}
from
'react'
import
{
useTranslation
}
from
'react-i18next'
import
ModelSelector
from
'./model-selector'
import
ModelCard
from
'./model-card'
import
ModelItem
from
'./model-item'
import
{
ChevronDownDouble
}
from
'@/app/components/base/icons/src/vender/line/arrows'
const
MODEL_LIST
=
[
{
key
:
'azure'
,
type
:
'specific'
,
},
{
key
:
'replicate'
,
type
:
'specific'
,
},
{
key
:
'hugging-face'
,
type
:
'customized'
,
},
{
key
:
'tongyi'
,
type
:
'customized'
,
},
]
const
ModelPage
=
()
=>
{
const
{
t
}
=
useTranslation
()
const
[
showMoreModel
,
setShowMoreModel
]
=
useState
(
false
)
return
(
<
div
className=
'pt-1'
>
...
...
@@ -23,6 +46,19 @@ const ModelPage = () => {
<
ModelCard
/>
<
ModelCard
type=
'anthropic'
/>
</
div
>
{
MODEL_LIST
.
slice
(
0
,
showMoreModel
?
MODEL_LIST
.
length
:
3
).
map
(
model
=>
(
<
ModelItem
key=
{
model
.
key
}
type=
{
model
.
type
}
/>
))
}
{
!
showMoreModel
&&
(
<
div
className=
'inline-flex items-center px-1 h-[26px] cursor-pointer'
onClick=
{
()
=>
setShowMoreModel
(
true
)
}
>
<
ChevronDownDouble
className=
'mr-1 w-3 h-3 text-gray-500'
/>
<
div
className=
'text-xs font-medium text-gray-500'
>
{
t
(
'common.modelProvider.showMoreModelProvider'
)
}
</
div
>
</
div
>
)
}
</
div
>
)
}
...
...
web/app/components/header/account-setting/model-page/model-item/index.tsx
0 → 100644
View file @
93754fdd
import
type
{
FC
}
from
'react'
import
{
useTranslation
}
from
'react-i18next'
import
Button
from
'@/app/components/base/button'
type
ModelItemProps
=
{
type
?:
string
}
const
ModelItem
:
FC
<
ModelItemProps
>
=
({
type
=
'specific'
,
})
=>
{
const
{
t
}
=
useTranslation
()
return
(
<
div
className=
'flex justify-between items-center mb-2 px-4 h-14 bg-gray-50 rounded-xl'
>
<
div
/>
<
Button
className=
'!px-3 !h-7 rounded-md bg-white !text-xs font-medium text-gray-700'
>
{
t
(
`common.operation.${type === 'specific' ? 'add' : 'setup'}`
)
}
</
Button
>
</
div
>
)
}
export
default
ModelItem
web/i18n/lang/common.en.ts
View file @
93754fdd
...
...
@@ -23,6 +23,7 @@ const translation = {
lineBreak
:
'Line break'
,
sure
:
'I
\'
m sure'
,
download
:
'Download'
,
setup
:
'Setup'
,
},
placeholder
:
{
input
:
'Please enter'
,
...
...
web/i18n/lang/common.zh.ts
View file @
93754fdd
...
...
@@ -23,6 +23,7 @@ const translation = {
lineBreak
:
'换行'
,
sure
:
'我确定'
,
download
:
'下载'
,
setup
:
'设置'
,
},
placeholder
:
{
input
:
'请输入'
,
...
...
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