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
5e145c1c
Unverified
Commit
5e145c1c
authored
Feb 05, 2024
by
Joel
Committed by
GitHub
Feb 05, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: show credit help link (#2393)
parent
714ff3c6
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
0 deletions
+20
-0
declarations.ts
...eader/account-setting/model-provider-page/declarations.ts
+1
-0
Form.tsx
.../account-setting/model-provider-page/model-modal/Form.tsx
+5
-0
config-credentials.tsx
.../components/tools/setting/build-in/config-credentials.tsx
+11
-0
tools.en.ts
web/i18n/lang/tools.en.ts
+1
-0
tools.pt.ts
web/i18n/lang/tools.pt.ts
+1
-0
tools.zh.ts
web/i18n/lang/tools.zh.ts
+1
-0
No files found.
web/app/components/header/account-setting/model-provider-page/declarations.ts
View file @
5e145c1c
...
@@ -98,6 +98,7 @@ export type CredentialFormSchemaBase = {
...
@@ -98,6 +98,7 @@ export type CredentialFormSchemaBase = {
default
?:
string
default
?:
string
tooltip
?:
TypeWithI18N
tooltip
?:
TypeWithI18N
show_on
:
FormShowOnObject
[]
show_on
:
FormShowOnObject
[]
url
?:
string
}
}
export
type
CredentialFormSchemaTextInput
=
CredentialFormSchemaBase
&
{
max_length
?:
number
;
placeholder
?:
TypeWithI18N
}
export
type
CredentialFormSchemaTextInput
=
CredentialFormSchemaBase
&
{
max_length
?:
number
;
placeholder
?:
TypeWithI18N
}
...
...
web/app/components/header/account-setting/model-provider-page/model-modal/Form.tsx
View file @
5e145c1c
...
@@ -28,6 +28,7 @@ type FormProps = {
...
@@ -28,6 +28,7 @@ type FormProps = {
readonly
?:
boolean
readonly
?:
boolean
inputClassName
?:
string
inputClassName
?:
string
isShowDefaultValue
?:
boolean
isShowDefaultValue
?:
boolean
fieldMoreInfo
?:
(
payload
:
CredentialFormSchema
)
=>
JSX
.
Element
|
null
}
}
const
Form
:
FC
<
FormProps
>
=
({
const
Form
:
FC
<
FormProps
>
=
({
...
@@ -41,6 +42,7 @@ const Form: FC<FormProps> = ({
...
@@ -41,6 +42,7 @@ const Form: FC<FormProps> = ({
readonly
,
readonly
,
inputClassName
,
inputClassName
,
isShowDefaultValue
=
false
,
isShowDefaultValue
=
false
,
fieldMoreInfo
,
})
=>
{
})
=>
{
const
language
=
useLanguage
()
const
language
=
useLanguage
()
const
[
changeKey
,
setChangeKey
]
=
useState
(
''
)
const
[
changeKey
,
setChangeKey
]
=
useState
(
''
)
...
@@ -106,6 +108,7 @@ const Form: FC<FormProps> = ({
...
@@ -106,6 +108,7 @@ const Form: FC<FormProps> = ({
type=
{
formSchema
.
type
===
FormTypeEnum
.
textNumber
?
'number'
:
'text'
}
type=
{
formSchema
.
type
===
FormTypeEnum
.
textNumber
?
'number'
:
'text'
}
{
...
(
formSchema
.
type
===
FormTypeEnum
.
textNumber
?
{
min
:
(
formSchema
as
CredentialFormSchemaNumberInput
)
.
min
,
max
:
(
formSchema
as
CredentialFormSchemaNumberInput
)
.
max
}
:
{})}
{
...
(
formSchema
.
type
===
FormTypeEnum
.
textNumber
?
{
min
:
(
formSchema
as
CredentialFormSchemaNumberInput
)
.
min
,
max
:
(
formSchema
as
CredentialFormSchemaNumberInput
)
.
max
}
:
{})}
/>
/>
{
fieldMoreInfo
?.(
formSchema
)
}
{
validating
&&
changeKey
===
variable
&&
<
ValidatingTip
/>
}
{
validating
&&
changeKey
===
variable
&&
<
ValidatingTip
/>
}
</
div
>
</
div
>
)
)
...
@@ -162,6 +165,7 @@ const Form: FC<FormProps> = ({
...
@@ -162,6 +165,7 @@ const Form: FC<FormProps> = ({
))
))
}
}
</
div
>
</
div
>
{
fieldMoreInfo
?.(
formSchema
)
}
{
validating
&&
changeKey
===
variable
&&
<
ValidatingTip
/>
}
{
validating
&&
changeKey
===
variable
&&
<
ValidatingTip
/>
}
</
div
>
</
div
>
)
)
...
@@ -205,6 +209,7 @@ const Form: FC<FormProps> = ({
...
@@ -205,6 +209,7 @@ const Form: FC<FormProps> = ({
onSelect=
{
item
=>
handleFormChange
(
variable
,
item
.
value
as
string
)
}
onSelect=
{
item
=>
handleFormChange
(
variable
,
item
.
value
as
string
)
}
placeholder=
{
placeholder
?.[
language
]
}
placeholder=
{
placeholder
?.[
language
]
}
/>
/>
{
fieldMoreInfo
?.(
formSchema
)
}
{
validating
&&
changeKey
===
variable
&&
<
ValidatingTip
/>
}
{
validating
&&
changeKey
===
variable
&&
<
ValidatingTip
/>
}
</
div
>
</
div
>
)
)
...
...
web/app/components/tools/setting/build-in/config-credentials.tsx
View file @
5e145c1c
...
@@ -10,6 +10,7 @@ import Button from '@/app/components/base/button'
...
@@ -10,6 +10,7 @@ import Button from '@/app/components/base/button'
import
{
fetchBuiltInToolCredentialSchema
}
from
'@/service/tools'
import
{
fetchBuiltInToolCredentialSchema
}
from
'@/service/tools'
import
Loading
from
'@/app/components/base/loading'
import
Loading
from
'@/app/components/base/loading'
import
Form
from
'@/app/components/header/account-setting/model-provider-page/model-modal/Form'
import
Form
from
'@/app/components/header/account-setting/model-provider-page/model-modal/Form'
import
{
LinkExternal02
}
from
'@/app/components/base/icons/src/vender/line/general'
type
Props
=
{
type
Props
=
{
collection
:
Collection
collection
:
Collection
...
@@ -62,6 +63,16 @@ const ConfigCredential: FC<Props> = ({
...
@@ -62,6 +63,16 @@ const ConfigCredential: FC<Props> = ({
showOnVariableMap=
{
{}
}
showOnVariableMap=
{
{}
}
validating=
{
false
}
validating=
{
false
}
inputClassName=
'!bg-gray-50'
inputClassName=
'!bg-gray-50'
fieldMoreInfo=
{
item
=>
item
.
url
?
(<
a
href=
{
item
.
url
}
target=
'_blank'
rel=
'noopener noreferrer'
className=
'inline-flex items-center text-xs text-primary-600'
>
{
t
(
'tools.howToGet'
)
}
<
LinkExternal02
className=
'ml-1 w-3 h-3'
/>
</
a
>)
:
null
}
/>
/>
<
div
className=
{
cn
(
collection
.
is_team_authorization
?
'justify-between'
:
'justify-end'
,
'mt-2 flex '
)
}
>
<
div
className=
{
cn
(
collection
.
is_team_authorization
?
'justify-between'
:
'justify-end'
,
'mt-2 flex '
)
}
>
{
{
...
...
web/i18n/lang/tools.en.ts
View file @
5e145c1c
...
@@ -98,6 +98,7 @@ const translation = {
...
@@ -98,6 +98,7 @@ const translation = {
builtInPromptTitle
:
'Prompt'
,
builtInPromptTitle
:
'Prompt'
,
toolRemoved
:
'Tool removed'
,
toolRemoved
:
'Tool removed'
,
notAuthorized
:
'Tool not authorized'
,
notAuthorized
:
'Tool not authorized'
,
howToGet
:
'How to get'
,
}
}
export
default
translation
export
default
translation
web/i18n/lang/tools.pt.ts
View file @
5e145c1c
...
@@ -97,6 +97,7 @@ const translation = {
...
@@ -97,6 +97,7 @@ const translation = {
},
},
builtInPromptTitle
:
'Prompt'
,
builtInPromptTitle
:
'Prompt'
,
toolRemoved
:
'Ferramenta removida'
,
toolRemoved
:
'Ferramenta removida'
,
howToGet
:
'Como conseguir'
,
}
}
export
default
translation
export
default
translation
web/i18n/lang/tools.zh.ts
View file @
5e145c1c
...
@@ -90,6 +90,7 @@ const translation = {
...
@@ -90,6 +90,7 @@ const translation = {
builtInPromptTitle
:
'提示词'
,
builtInPromptTitle
:
'提示词'
,
toolRemoved
:
'工具已被移除'
,
toolRemoved
:
'工具已被移除'
,
notAuthorized
:
'工具未授权'
,
notAuthorized
:
'工具未授权'
,
howToGet
:
'如何获取'
,
}
}
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