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
93d9bddf
Commit
93d9bddf
authored
Jul 21, 2023
by
StyleZhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: setting plugin style
parent
92f4fdad
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
6 deletions
+10
-6
index.tsx
web/app/components/base/toast/index.tsx
+4
-3
KeyInput.tsx
...ponents/header/account-setting/key-validator/KeyInput.tsx
+1
-1
SerpapiPlugin.tsx
...ents/header/account-setting/plugin-page/SerpapiPlugin.tsx
+3
-0
index.tsx
...p/components/header/account-setting/plugin-page/index.tsx
+2
-2
No files found.
web/app/components/base/toast/index.tsx
View file @
93d9bddf
...
...
@@ -9,7 +9,7 @@ import {
InformationCircleIcon
,
XCircleIcon
,
}
from
'@heroicons/react/20/solid'
import
{
createContext
}
from
'use-context-selector'
import
{
createContext
,
useContext
}
from
'use-context-selector'
export
type
IToastProps
=
{
type
?:
'success'
|
'error'
|
'warning'
|
'info'
...
...
@@ -24,6 +24,7 @@ type IToastContext = {
const
defaultDuring
=
3000
export
const
ToastContext
=
createContext
<
IToastContext
>
({}
as
IToastContext
)
export
const
useToastContext
=
()
=>
useContext
(
ToastContext
)
const
Toast
=
({
type
=
'info'
,
duration
,
...
...
@@ -31,9 +32,9 @@ const Toast = ({
children
,
}:
IToastProps
)
=>
{
// sometimes message is react node array. Not handle it.
if
(
typeof
message
!==
'string'
)
{
if
(
typeof
message
!==
'string'
)
return
null
}
return
<
div
className=
{
classNames
(
'fixed rounded-md p-4 my-4 mx-8 z-50'
,
'top-0'
,
...
...
web/app/components/header/account-setting/key-validator/KeyInput.tsx
View file @
93d9bddf
...
...
@@ -58,7 +58,7 @@ const KeyInput = ({
'
>
<
input
className=
'
w-full py-[9px]
w-full py-[9px]
mr-2
text-xs font-medium text-gray-700 leading-[18px]
appearance-none outline-none bg-transparent
'
...
...
web/app/components/header/account-setting/plugin-page/SerpapiPlugin.tsx
View file @
93d9bddf
...
...
@@ -4,6 +4,7 @@ import SerpapiLogo from '../../assets/serpapi.png'
import
KeyValidator
from
'../key-validator'
import
type
{
Form
,
ValidateValue
}
from
'../key-validator/declarations'
import
{
updatePluginKey
,
validatePluginKey
}
from
'./utils'
import
{
useToastContext
}
from
'@/app/components/base/toast'
import
type
{
PluginProvider
}
from
'@/models/common'
type
SerpapiPluginProps
=
{
...
...
@@ -15,6 +16,7 @@ const SerpapiPlugin = ({
onUpdate
,
}:
SerpapiPluginProps
)
=>
{
const
{
t
}
=
useTranslation
()
const
{
notify
}
=
useToastContext
()
const
forms
:
Form
[]
=
[{
key
:
'api_key'
,
...
...
@@ -51,6 +53,7 @@ const SerpapiPlugin = ({
})
if
(
res
.
status
===
'success'
)
{
notify
({
type
:
'success'
,
message
:
t
(
'common.actionMsg.modifiedSuccessfully'
)
})
onUpdate
()
return
true
}
...
...
web/app/components/header/account-setting/plugin-page/index.tsx
View file @
93d9bddf
...
...
@@ -11,7 +11,7 @@ const PluginPage = () => {
const
{
data
:
plugins
,
mutate
}
=
useSWR
(
'/workspaces/current/tool-providers'
,
fetchPluginProviders
)
const
Plugin_MAP
:
Record
<
string
,
any
>
=
{
serpapi
:
(
plugin
:
PluginProvider
)
=>
<
SerpapiPlugin
plugin=
{
plugin
}
onUpdate=
{
()
=>
mutate
()
}
/>,
serpapi
:
(
plugin
:
PluginProvider
)
=>
<
SerpapiPlugin
key=
'serpapi'
plugin=
{
plugin
}
onUpdate=
{
()
=>
mutate
()
}
/>,
}
return
(
...
...
@@ -19,7 +19,7 @@ const PluginPage = () => {
<
div
>
{
plugins
?.
map
(
plugin
=>
Plugin_MAP
[
plugin
.
tool_name
](
plugin
))
}
</
div
>
<
div
className=
'
absolute bottom-0 w-full
h-[42px] flex items-center bg-white text-xs text-gray-500'
>
<
div
className=
'
fixed bottom-0 w-[472px]
h-[42px] flex items-center bg-white text-xs text-gray-500'
>
<
LockClosedIcon
className=
'w-3 h-3 mr-1'
/>
{
t
(
'common.provider.encrypted.front'
)
}
<
Link
...
...
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