Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵月辉
/
fastgpt-migrated
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
b8b26ad7
authored
Jun 13, 2024
by
Archer
Committed by
GitHub
Jun 13, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Perf: vector queue and app ui (#1750)
parent
05611df0
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
160 additions
and
62 deletions
+160
-62
docSite/content/zh-cn/docs/development/intro.md
+3
-0
docSite/content/zh-cn/docs/development/upgrading/484.md
+3
-2
packages/service/common/mongo/sessionRun.ts
+8
-1
packages/service/core/workflow/dispatch/index.ts
+3
-3
packages/web/components/common/Icon/constants.ts
+2
-0
packages/web/components/common/Icon/icons/core/app/type/simple.svg
+16
-0
packages/web/components/common/Icon/icons/core/app/type/workflow.svg
+19
-0
packages/web/components/common/MyModal/EditFolderModal.tsx
+1
-1
packages/web/components/common/MyTooltip/index.tsx
+17
-25
packages/web/components/common/Textarea/CodeEditor/index.tsx
+1
-1
packages/web/components/common/Textarea/PromptEditor/index.tsx
+1
-1
packages/web/hooks/useConfirm.tsx
+3
-1
packages/web/hooks/useEditTextarea.tsx
+3
-1
projects/app/i18n/en/app.json
+4
-0
projects/app/i18n/zh/app.json
+4
-0
projects/app/src/components/common/Modal/EditResourceModal.tsx
+1
-1
projects/app/src/components/core/app/TypeTag.tsx
+35
-0
projects/app/src/components/core/workflow/Flow/hooks/useKeyboard.tsx
+16
-13
projects/app/src/components/core/workflow/Flow/nodes/render/RenderInput/templates/Reference.tsx
+1
-1
projects/app/src/components/support/permission/MemberManager/MemberListCard.tsx
+3
-1
projects/app/src/components/support/user/team/TeamManageModal/components/PermissionManage/index.tsx
+10
-8
projects/app/src/pages/app/list/component/CreateModal.tsx
+1
-1
projects/app/src/pages/app/list/component/List.tsx
+5
-1
No files found.
docSite/content/zh-cn/docs/development/intro.md
View file @
b8b26ad7
...
@@ -79,6 +79,7 @@ Mongo 数据库需要注意,需要注意在连接地址中增加 `directConnec
...
@@ -79,6 +79,7 @@ Mongo 数据库需要注意,需要注意在连接地址中增加 `directConnec
# 给自动化脚本代码执行权限(非 linux 系统, 可以手动执行里面的 postinstall.sh 文件内容)
# 给自动化脚本代码执行权限(非 linux 系统, 可以手动执行里面的 postinstall.sh 文件内容)
chmod
-R
+x ./scripts/
chmod
-R
+x ./scripts/
# 代码根目录下执行,会安装根 package、projects 和 packages 内所有依赖
# 代码根目录下执行,会安装根 package、projects 和 packages 内所有依赖
# 如果提示 isolate-vm 安装失败,可以参考:https://github.com/laverdet/isolated-vm?tab=readme-ov-file#requirements
pnpm i
pnpm i
# 非 Make 运行
# 非 Make 运行
...
@@ -103,6 +104,8 @@ docker build -f ./projects/app/Dockerfile -t registry.cn-hangzhou.aliyuncs.com/f
...
@@ -103,6 +104,8 @@ docker build -f ./projects/app/Dockerfile -t registry.cn-hangzhou.aliyuncs.com/f
make build
name
=
app
image
=
registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.8.1
proxy
=
taobao
make build
name
=
app
image
=
registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.8.1
proxy
=
taobao
```
```
如果不使用
`docker`
打包,需要手动把
`Dockerfile`
里 run 阶段的内容全部手动执行一遍(非常不推荐)。
## 提交代码至开源仓库
## 提交代码至开源仓库
1.
确保你的代码是 Fork
[
FastGPT
](
https://github.com/labring/FastGPT
)
仓库
1.
确保你的代码是 Fork
[
FastGPT
](
https://github.com/labring/FastGPT
)
仓库
...
...
docSite/content/zh-cn/docs/development/upgrading/484.md
View file @
b8b26ad7
...
@@ -33,4 +33,5 @@ curl --location --request POST 'https://{{host}}/api/admin/init/484' \
...
@@ -33,4 +33,5 @@ curl --location --request POST 'https://{{host}}/api/admin/init/484' \
4.
修复 - Debug 模式下,相同 source 和 target 内容,导致连线显示异常。
4.
修复 - Debug 模式下,相同 source 和 target 内容,导致连线显示异常。
5.
修复 - 定时执行初始化错误。
5.
修复 - 定时执行初始化错误。
6.
修复 - 应用调用传参异常。
6.
修复 - 应用调用传参异常。
7.
调整组件库全局theme。
7.
修复 - ctrl + cv 复杂节点时,nodeId错误。
\ No newline at end of file
8.
调整组件库全局theme。
\ No newline at end of file
packages/service/common/mongo/sessionRun.ts
View file @
b8b26ad7
import
{
addLog
}
from
'../system/log'
;
import
{
connectionMongo
,
ClientSession
}
from
'./index'
;
import
{
connectionMongo
,
ClientSession
}
from
'./index'
;
export
const
mongoSessionRun
=
async
<
T
=
unknown
>
(
fn
:
(
session
:
ClientSession
)
=>
Promise
<
T
>
)
=>
{
export
const
mongoSessionRun
=
async
<
T
=
unknown
>
(
fn
:
(
session
:
ClientSession
)
=>
Promise
<
T
>
)
=>
{
const
session
=
await
connectionMongo
.
startSession
();
const
session
=
await
connectionMongo
.
startSession
();
let
committed
=
false
;
try
{
try
{
session
.
startTransaction
();
session
.
startTransaction
();
const
result
=
await
fn
(
session
);
const
result
=
await
fn
(
session
);
await
session
.
commitTransaction
();
await
session
.
commitTransaction
();
committed
=
true
;
return
result
as
T
;
return
result
as
T
;
}
catch
(
error
)
{
}
catch
(
error
)
{
await
session
.
abortTransaction
();
if
(
!
committed
)
{
await
session
.
abortTransaction
();
}
else
{
addLog
.
warn
(
'Un catch mongo session error'
,
{
error
});
}
return
Promise
.
reject
(
error
);
return
Promise
.
reject
(
error
);
}
finally
{
}
finally
{
await
session
.
endSession
();
await
session
.
endSession
();
...
...
packages/service/core/workflow/dispatch/index.ts
View file @
b8b26ad7
...
@@ -217,16 +217,16 @@ export async function dispatchWorkFlow(data: Props): Promise<DispatchFlowRespons
...
@@ -217,16 +217,16 @@ export async function dispatchWorkFlow(data: Props): Promise<DispatchFlowRespons
if
(
res
?.
closed
||
props
.
maxRunTimes
<=
0
)
return
;
if
(
res
?.
closed
||
props
.
maxRunTimes
<=
0
)
return
;
props
.
maxRunTimes
--
;
props
.
maxRunTimes
--
;
console
.
log
(
props
.
maxRunTimes
,
user
.
_id
);
addLog
.
debug
(
`Run node`
,
{
maxRunTimes
:
props
.
maxRunTimes
,
uid
:
user
.
_id
}
);
await
surrenderProcess
();
await
surrenderProcess
();
if
(
status
===
'run'
)
{
if
(
status
===
'run'
)
{
addLog
.
info
(
`[dispatchWorkFlow] nodeRunWithActive:
${
node
.
name
}
`
);
addLog
.
debug
(
`[dispatchWorkFlow] nodeRunWithActive:
${
node
.
name
}
`
);
return
nodeRunWithActive
(
node
);
return
nodeRunWithActive
(
node
);
}
}
if
(
status
===
'skip'
)
{
if
(
status
===
'skip'
)
{
addLog
.
info
(
`[dispatchWorkFlow] nodeRunWithSkip:
${
node
.
name
}
`
);
addLog
.
debug
(
`[dispatchWorkFlow] nodeRunWithSkip:
${
node
.
name
}
`
);
return
nodeRunWithSkip
(
node
);
return
nodeRunWithSkip
(
node
);
}
}
...
...
packages/web/components/common/Icon/constants.ts
View file @
b8b26ad7
...
@@ -82,6 +82,8 @@ export const iconPaths = {
...
@@ -82,6 +82,8 @@ export const iconPaths = {
'core/app/simpleMode/whisper'
:
()
=>
import
(
'./icons/core/app/simpleMode/whisper.svg'
),
'core/app/simpleMode/whisper'
:
()
=>
import
(
'./icons/core/app/simpleMode/whisper.svg'
),
'core/app/toolCall'
:
()
=>
import
(
'./icons/core/app/toolCall.svg'
),
'core/app/toolCall'
:
()
=>
import
(
'./icons/core/app/toolCall.svg'
),
'core/app/ttsFill'
:
()
=>
import
(
'./icons/core/app/ttsFill.svg'
),
'core/app/ttsFill'
:
()
=>
import
(
'./icons/core/app/ttsFill.svg'
),
'core/app/type/simple'
:
()
=>
import
(
'./icons/core/app/type/simple.svg'
),
'core/app/type/workflow'
:
()
=>
import
(
'./icons/core/app/type/workflow.svg'
),
'core/app/variable/external'
:
()
=>
import
(
'./icons/core/app/variable/external.svg'
),
'core/app/variable/external'
:
()
=>
import
(
'./icons/core/app/variable/external.svg'
),
'core/app/variable/input'
:
()
=>
import
(
'./icons/core/app/variable/input.svg'
),
'core/app/variable/input'
:
()
=>
import
(
'./icons/core/app/variable/input.svg'
),
'core/app/variable/select'
:
()
=>
import
(
'./icons/core/app/variable/select.svg'
),
'core/app/variable/select'
:
()
=>
import
(
'./icons/core/app/variable/select.svg'
),
...
...
packages/web/components/common/Icon/icons/core/app/type/simple.svg
0 → 100644
View file @
b8b26ad7
<svg
xmlns=
"http://www.w3.org/2000/svg"
viewBox=
"0 0 14 15"
fill=
"none"
>
<g
clip-path=
"url(#clip0_5676_3579)"
>
<path
d=
"M6.46665 1.10308C6.74565 0.941999 7.19801 0.941998 7.47701 1.10308L11.7403 3.56452C12.2984 3.88669 12.2984 4.40902 11.7403 4.73119L7.53312 7.16023C7.25411 7.32132 6.80176 7.32132 6.52275 7.16023L2.25942 4.6988C1.70141 4.37663 1.70141 3.85429 2.25941 3.53213L6.46665 1.10308Z"
/>
<path
d=
"M1.49066 6.17483C1.49066 5.7238 1.80731 5.54098 2.19792 5.7665L6.13886 8.0418C6.36206 8.17067 6.54301 8.48407 6.54301 8.74181V12.9081C6.54301 13.3592 6.22636 13.542 5.83575 13.3165L1.89481 11.0411C1.6716 10.9123 1.49066 10.5989 1.49066 10.3411V6.17483Z"
/>
<path
d=
"M7.45634 8.77325C7.45634 8.51552 7.63729 8.20212 7.86049 8.07325L11.8021 5.79758C12.1927 5.57206 12.5093 5.75488 12.5093 6.20591V10.3717C12.5093 10.6295 12.3284 10.9429 12.1052 11.0717L8.1636 13.3474C7.77299 13.5729 7.45634 13.3901 7.45634 12.9391V8.77325Z"
/>
</g>
<defs>
<clipPath
id=
"clip0_5676_3579"
>
<rect
width=
"14"
height=
"14"
fill=
"white"
transform=
"translate(0 0.213127)"
/>
</clipPath>
</defs>
</svg>
\ No newline at end of file
packages/web/components/common/Icon/icons/core/app/type/workflow.svg
0 → 100644
View file @
b8b26ad7
<svg
xmlns=
"http://www.w3.org/2000/svg"
viewBox=
"0 0 14 15"
fill=
"none"
>
<path
d=
"M4.35632 8.49118C4.35632 8.79915 4.10666 9.04881 3.79868 9.04881C3.49071 9.04881 3.24105 8.79915 3.24105 8.49118L3.24105 6.36137C3.24105 6.05339 3.49071 5.80373 3.79868 5.80373C4.10666 5.80373 4.35632 6.05339 4.35632 6.36137L4.35632 8.49118Z"
/>
<path
fill-rule=
"evenodd"
clip-rule=
"evenodd"
d=
"M3.79868 5.4847C4.49442 5.4847 5.05843 4.92069 5.05843 4.22495C5.05843 3.52922 4.49442 2.96521 3.79868 2.96521C3.10295 2.96521 2.53894 3.52922 2.53894 4.22495C2.53894 4.92069 3.10295 5.4847 3.79868 5.4847ZM3.79868 6.59996C5.11036 6.59996 6.17369 5.53663 6.17369 4.22495C6.17369 2.91327 5.11036 1.84995 3.79868 1.84995C2.487 1.84995 1.42368 2.91327 1.42368 4.22495C1.42368 5.53663 2.487 6.59996 3.79868 6.59996Z"
/>
<path
fill-rule=
"evenodd"
clip-rule=
"evenodd"
d=
"M6.79074 3.68998C6.79074 3.382 7.0404 3.13234 7.34838 3.13234C7.93704 3.13234 8.52062 3.24176 9.06606 3.45504C9.61153 3.66834 10.1092 3.98174 10.5298 4.37882C10.9505 4.77596 11.286 5.2492 11.5156 5.7724C11.7452 6.29569 11.8639 6.85778 11.8639 7.42627C11.8639 7.73424 11.6142 7.9839 11.3062 7.9839C10.9983 7.9839 10.7486 7.73424 10.7486 7.42627C10.7486 7.01345 10.6625 6.60383 10.4943 6.22051C10.3261 5.83709 10.0786 5.48655 9.76421 5.1898C9.4498 4.89299 9.07481 4.65597 8.65991 4.49373C8.24496 4.33147 7.79922 4.24761 7.34838 4.24761C7.0404 4.24761 6.79074 3.99795 6.79074 3.68998Z"
/>
<path
fill-rule=
"evenodd"
clip-rule=
"evenodd"
d=
"M3.79868 11.8873C4.49442 11.8873 5.05843 11.3233 5.05843 10.6276C5.05843 9.93185 4.49442 9.36785 3.79868 9.36785C3.10295 9.36785 2.53894 9.93185 2.53894 10.6276C2.53894 11.3233 3.10295 11.8873 3.79868 11.8873ZM3.79868 13.0026C5.11036 13.0026 6.17369 11.9393 6.17369 10.6276C6.17369 9.31591 5.11036 8.25258 3.79868 8.25258C2.487 8.25258 1.42368 9.31591 1.42368 10.6276C1.42368 11.9393 2.487 13.0026 3.79868 13.0026Z"
/>
<path
fill-rule=
"evenodd"
clip-rule=
"evenodd"
d=
"M10.7808 9.55902H9.81307C9.47678 9.55902 9.29277 9.55992 9.16063 9.57089C9.15546 9.57132 9.15056 9.57175 9.14592 9.57219C9.14549 9.57682 9.14506 9.58172 9.14463 9.58689C9.13365 9.71903 9.13276 9.90305 9.13276 10.2393V11.207C9.13276 11.5433 9.13365 11.7273 9.14463 11.8595C9.14506 11.8646 9.14549 11.8695 9.14592 11.8742C9.15056 11.8746 9.15546 11.875 9.16063 11.8755C9.29277 11.8864 9.47678 11.8873 9.81307 11.8873H10.7808C11.117 11.8873 11.3011 11.8864 11.4332 11.8755C11.4384 11.875 11.4433 11.8746 11.4479 11.8742C11.4483 11.8695 11.4488 11.8646 11.4492 11.8595C11.4602 11.7273 11.4611 11.5433 11.4611 11.207V10.2393C11.4611 9.90305 11.4602 9.71903 11.4492 9.58689C11.4488 9.58172 11.4483 9.57682 11.4479 9.57219C11.4433 9.57175 11.4384 9.57132 11.4332 9.57089C11.3011 9.55992 11.117 9.55902 10.7808 9.55902ZM8.14306 9.04491C8.01749 9.28663 8.01749 9.6042 8.01749 10.2393V11.207C8.01749 11.8421 8.01749 12.1597 8.14306 12.4014C8.24887 12.6051 8.41495 12.7712 8.61865 12.877C8.86037 13.0026 9.17794 13.0026 9.81307 13.0026H10.7808C11.4159 13.0026 11.7335 13.0026 11.9752 12.877C12.1789 12.7712 12.345 12.6051 12.4508 12.4014C12.5763 12.1597 12.5763 11.8421 12.5763 11.207V10.2393C12.5763 9.6042 12.5763 9.28663 12.4508 9.04491C12.345 8.84122 12.1789 8.67513 11.9752 8.56932C11.7335 8.44375 11.4159 8.44375 10.7808 8.44375H9.81307C9.17794 8.44375 8.86037 8.44375 8.61865 8.56932C8.41495 8.67513 8.24887 8.84122 8.14306 9.04491Z"
/>
<path
d=
"M5.05843 4.22495C5.05843 4.92069 4.49442 5.4847 3.79868 5.4847C3.10295 5.4847 2.53894 4.92069 2.53894 4.22495C2.53894 3.52922 3.10295 2.96521 3.79868 2.96521C4.49442 2.96521 5.05843 3.52922 5.05843 4.22495Z"
/>
<path
d=
"M5.05843 10.6276C5.05843 11.3233 4.49442 11.8873 3.79868 11.8873C3.10295 11.8873 2.53894 11.3233 2.53894 10.6276C2.53894 9.93185 3.10295 9.36785 3.79868 9.36785C4.49442 9.36785 5.05843 9.93185 5.05843 10.6276Z"
/>
<path
d=
"M9.81307 9.55902H10.7808C11.117 9.55902 11.3011 9.55992 11.4332 9.57089L11.4479 9.57219L11.4492 9.58689C11.4602 9.71903 11.4611 9.90305 11.4611 10.2393V11.207C11.4611 11.5433 11.4602 11.7273 11.4492 11.8595L11.4479 11.8742L11.4332 11.8755C11.3011 11.8864 11.117 11.8873 10.7808 11.8873H9.81307C9.47678 11.8873 9.29277 11.8864 9.16063 11.8755L9.14592 11.8742L9.14463 11.8595C9.13365 11.7273 9.13276 11.5433 9.13276 11.207V10.2393C9.13276 9.90305 9.13365 9.71903 9.14463 9.58689L9.14592 9.57219L9.16063 9.57089C9.29277 9.55992 9.47678 9.55902 9.81307 9.55902Z"
/>
</svg>
\ No newline at end of file
packages/web/components/common/MyModal/EditFolderModal.tsx
View file @
b8b26ad7
...
@@ -81,7 +81,7 @@ const EditFolderModal = ({
...
@@ -81,7 +81,7 @@ const EditFolderModal = ({
</
Box
>
</
Box
>
</
ModalBody
>
</
ModalBody
>
<
ModalFooter
>
<
ModalFooter
>
<
Button
isLoading=
{
loading
}
onClick=
{
handleSubmit
(
onSave
)
}
>
<
Button
isLoading=
{
loading
}
onClick=
{
handleSubmit
(
onSave
)
}
px=
{
6
}
>
{
t
(
'common.Confirm'
)
}
{
t
(
'common.Confirm'
)
}
</
Button
>
</
Button
>
</
ModalFooter
>
</
ModalFooter
>
...
...
packages/web/components/common/MyTooltip/index.tsx
View file @
b8b26ad7
...
@@ -9,32 +9,24 @@ const MyTooltip = ({ children, forceShow = false, shouldWrapChildren = true, ...
...
@@ -9,32 +9,24 @@ const MyTooltip = ({ children, forceShow = false, shouldWrapChildren = true, ...
const
[
isPc
]
=
useMediaQuery
(
'(min-width: 900px)'
);
const
[
isPc
]
=
useMediaQuery
(
'(min-width: 900px)'
);
return
isPc
||
forceShow
?
(
return
isPc
||
forceShow
?
(
<
Box
<
Tooltip
css=
{
css
({
className=
"chakra-tooltip"
'& span'
:
{
bg=
{
'white'
}
display
:
'block'
arrowShadowColor=
{
'rgba(0,0,0,0.05)'
}
}
hasArrow
})
}
arrowSize=
{
12
}
offset=
{
[
-
15
,
15
]
}
color=
{
'myGray.800'
}
px=
{
4
}
py=
{
2
}
borderRadius=
{
'8px'
}
whiteSpace=
{
'pre-wrap'
}
boxShadow=
{
'1px 1px 10px rgba(0,0,0,0.2)'
}
shouldWrapChildren=
{
shouldWrapChildren
}
{
...
props
}
>
>
<
Tooltip
{
children
}
className=
"chakra-tooltip"
</
Tooltip
>
bg=
{
'white'
}
arrowShadowColor=
{
'rgba(0,0,0,0.05)'
}
hasArrow
arrowSize=
{
12
}
offset=
{
[
-
15
,
15
]
}
color=
{
'myGray.800'
}
px=
{
4
}
py=
{
2
}
borderRadius=
{
'8px'
}
whiteSpace=
{
'pre-wrap'
}
boxShadow=
{
'1px 1px 10px rgba(0,0,0,0.2)'
}
shouldWrapChildren=
{
shouldWrapChildren
}
{
...
props
}
>
{
children
}
</
Tooltip
>
</
Box
>
)
:
(
)
:
(
<>
{
children
}
</>
<>
{
children
}
</>
);
);
...
...
packages/web/components/common/Textarea/CodeEditor/index.tsx
View file @
b8b26ad7
...
@@ -24,7 +24,7 @@ const CodeEditor = (props: Props) => {
...
@@ -24,7 +24,7 @@ const CodeEditor = (props: Props) => {
<
MyEditor
{
...
props
}
bg=
{
'myGray.50'
}
defaultHeight=
{
600
}
/>
<
MyEditor
{
...
props
}
bg=
{
'myGray.50'
}
defaultHeight=
{
600
}
/>
</
ModalBody
>
</
ModalBody
>
<
ModalFooter
>
<
ModalFooter
>
<
Button
mr=
{
2
}
onClick=
{
onClose
}
>
<
Button
mr=
{
2
}
onClick=
{
onClose
}
px=
{
6
}
>
{
t
(
'common.Confirm'
)
}
{
t
(
'common.Confirm'
)
}
</
Button
>
</
Button
>
</
ModalFooter
>
</
ModalFooter
>
...
...
packages/web/components/common/Textarea/PromptEditor/index.tsx
View file @
b8b26ad7
...
@@ -78,7 +78,7 @@ const PromptEditor = ({
...
@@ -78,7 +78,7 @@ const PromptEditor = ({
/>
/>
</
ModalBody
>
</
ModalBody
>
<
ModalFooter
>
<
ModalFooter
>
<
Button
mr=
{
2
}
onClick=
{
onClose
}
>
<
Button
mr=
{
2
}
onClick=
{
onClose
}
px=
{
6
}
>
{
t
(
'common.Confirm'
)
}
{
t
(
'common.Confirm'
)
}
</
Button
>
</
Button
>
</
ModalFooter
>
</
ModalFooter
>
...
...
packages/web/hooks/useConfirm.tsx
View file @
b8b26ad7
...
@@ -100,6 +100,7 @@ export const useConfirm = (props?: {
...
@@ -100,6 +100,7 @@ export const useConfirm = (props?: {
onClose
();
onClose
();
typeof
cancelCb
.
current
===
'function'
&&
cancelCb
.
current
();
typeof
cancelCb
.
current
===
'function'
&&
cancelCb
.
current
();
}
}
}
}
px=
{
5
}
>
>
{
closeText
}
{
closeText
}
</
Button
>
</
Button
>
...
@@ -109,8 +110,9 @@ export const useConfirm = (props?: {
...
@@ -109,8 +110,9 @@ export const useConfirm = (props?: {
size=
{
'sm'
}
size=
{
'sm'
}
bg=
{
bg
?
bg
:
map
.
bg
}
bg=
{
bg
?
bg
:
map
.
bg
}
isDisabled=
{
countDownAmount
>
0
}
isDisabled=
{
countDownAmount
>
0
}
ml=
{
4
}
ml=
{
3
}
isLoading=
{
isLoading
||
requesting
}
isLoading=
{
isLoading
||
requesting
}
px=
{
5
}
onClick=
{
async
()
=>
{
onClick=
{
async
()
=>
{
setRequesting
(
true
);
setRequesting
(
true
);
try
{
try
{
...
...
packages/web/hooks/useEditTextarea.tsx
View file @
b8b26ad7
...
@@ -115,7 +115,9 @@ export const useEditTextarea = ({
...
@@ -115,7 +115,9 @@ export const useEditTextarea = ({
{
closeBtnText
}
{
closeBtnText
}
</
Button
>
</
Button
>
)
}
)
}
<
Button
onClick=
{
onclickConfirm
}
>
{
t
(
'common.Confirm'
)
}
</
Button
>
<
Button
onClick=
{
onclickConfirm
}
px=
{
6
}
>
{
t
(
'common.Confirm'
)
}
</
Button
>
</
ModalFooter
>
</
ModalFooter
>
</
MyModal
>
</
MyModal
>
),
),
...
...
projects/app/i18n/en/app.json
View file @
b8b26ad7
...
@@ -54,5 +54,9 @@
...
@@ -54,5 +54,9 @@
},
},
"modules"
:
{
"modules"
:
{
"Title is required"
:
"Module name cannot be empty"
"Title is required"
:
"Module name cannot be empty"
},
"type"
:
{
"Simple bot"
:
"Simple bot"
,
"Workflow bot"
:
"Workflow"
}
}
}
}
projects/app/i18n/zh/app.json
View file @
b8b26ad7
...
@@ -53,5 +53,9 @@
...
@@ -53,5 +53,9 @@
},
},
"modules"
:
{
"modules"
:
{
"Title is required"
:
"模块名不能为空"
"Title is required"
:
"模块名不能为空"
},
"type"
:
{
"Simple bot"
:
"简易应用"
,
"Workflow bot"
:
"工作流"
}
}
}
}
projects/app/src/components/common/Modal/EditResourceModal.tsx
View file @
b8b26ad7
...
@@ -103,7 +103,7 @@ const EditResourceModal = ({
...
@@ -103,7 +103,7 @@ const EditResourceModal = ({
</
Box
>
</
Box
>
</
ModalBody
>
</
ModalBody
>
<
ModalFooter
>
<
ModalFooter
>
<
Button
isLoading=
{
loading
}
onClick=
{
handleSubmit
(
onSave
)
}
>
<
Button
isLoading=
{
loading
}
onClick=
{
handleSubmit
(
onSave
)
}
px=
{
6
}
>
{
t
(
'common.Confirm'
)
}
{
t
(
'common.Confirm'
)
}
</
Button
>
</
Button
>
</
ModalFooter
>
</
ModalFooter
>
...
...
projects/app/src/components/core/app/TypeTag.tsx
0 → 100644
View file @
b8b26ad7
import
React
,
{
useRef
}
from
'react'
;
import
{
AppTypeEnum
}
from
'@fastgpt/global/core/app/constants'
;
import
MyTag
from
'@fastgpt/web/components/common/Tag/index'
;
import
{
useI18n
}
from
'@/web/context/I18n'
;
import
MyIcon
from
'@fastgpt/web/components/common/Icon'
;
import
{
Box
}
from
'@chakra-ui/react'
;
const
AppTypeTag
=
({
type
}:
{
type
:
AppTypeEnum
})
=>
{
const
{
appT
}
=
useI18n
();
const
map
=
useRef
({
[
AppTypeEnum
.
simple
]:
{
label
:
appT
(
'type.Simple bot'
),
icon
:
'core/app/type/simple'
},
[
AppTypeEnum
.
advanced
]:
{
label
:
appT
(
'type.Workflow bot'
),
icon
:
'core/app/type/workflow'
},
[
AppTypeEnum
.
folder
]:
undefined
});
const
data
=
map
.
current
[
type
];
return
data
?
(
<
MyTag
type=
"borderFill"
colorSchema=
"gray"
>
<
MyIcon
name=
{
data
.
icon
as
any
}
w=
{
'0.8rem'
}
color=
{
'myGray.500'
}
/>
<
Box
ml=
{
1
}
fontSize=
{
'mini'
}
>
{
data
.
label
}
</
Box
>
</
MyTag
>
)
:
null
;
};
export
default
AppTypeTag
;
projects/app/src/components/core/workflow/Flow/hooks/useKeyboard.tsx
View file @
b8b26ad7
...
@@ -48,19 +48,22 @@ export const useKeyboard = () => {
...
@@ -48,19 +48,22 @@ export const useKeyboard = () => {
// filter workflow data
// filter workflow data
const
newNodes
=
parseData
const
newNodes
=
parseData
.
filter
((
item
)
=>
!!
item
.
type
&&
item
.
data
?.
unique
!==
true
)
.
filter
((
item
)
=>
!!
item
.
type
&&
item
.
data
?.
unique
!==
true
)
.
map
((
item
)
=>
({
.
map
((
item
)
=>
{
// reset id
const
nodeId
=
getNanoid
();
...
item
,
return
{
id
:
getNanoid
(),
// reset id
data
:
{
...
item
,
...
item
.
data
,
id
:
nodeId
,
nodeId
:
getNanoid
()
data
:
{
},
...
item
.
data
,
position
:
{
nodeId
x
:
item
.
position
.
x
+
100
,
},
y
:
item
.
position
.
y
+
100
position
:
{
}
x
:
item
.
position
.
x
+
100
,
}));
y
:
item
.
position
.
y
+
100
}
};
});
setNodes
((
prev
)
=>
setNodes
((
prev
)
=>
prev
prev
...
...
projects/app/src/components/core/workflow/Flow/nodes/render/RenderInput/templates/Reference.tsx
View file @
b8b26ad7
...
@@ -144,7 +144,7 @@ export const useReference = ({
...
@@ -144,7 +144,7 @@ export const useReference = ({
.
filter
((
item
)
=>
item
.
children
.
length
>
0
);
.
filter
((
item
)
=>
item
.
children
.
length
>
0
);
return
list
;
return
list
;
},
[
edges
,
nodeId
,
nodeList
,
t
,
valueType
]);
},
[
appDetail
.
chatConfig
,
edges
,
nodeId
,
nodeList
,
t
,
valueType
]);
const
formatValue
=
useMemo
(()
=>
{
const
formatValue
=
useMemo
(()
=>
{
if
(
if
(
...
...
projects/app/src/components/support/permission/MemberManager/MemberListCard.tsx
View file @
b8b26ad7
...
@@ -29,7 +29,9 @@ const MemberListCard = ({ tagStyle, ...props }: MemberListCardProps) => {
...
@@ -29,7 +29,9 @@ const MemberListCard = ({ tagStyle, ...props }: MemberListCardProps) => {
return
(
return
(
<
Tag
key=
{
member
.
tmbId
}
type=
{
'fill'
}
colorSchema=
"white"
{
...
tagStyle
}
>
<
Tag
key=
{
member
.
tmbId
}
type=
{
'fill'
}
colorSchema=
"white"
{
...
tagStyle
}
>
<
Avatar
src=
{
member
.
avatar
}
w=
"1.25rem"
/>
<
Avatar
src=
{
member
.
avatar
}
w=
"1.25rem"
/>
<
Box
fontSize=
{
'sm'
}
>
{
member
.
name
}
</
Box
>
<
Box
fontSize=
{
'sm'
}
ml=
{
1
}
>
{
member
.
name
}
</
Box
>
</
Tag
>
</
Tag
>
);
);
})
}
})
}
...
...
projects/app/src/components/support/user/team/TeamManageModal/components/PermissionManage/index.tsx
View file @
b8b26ad7
...
@@ -12,6 +12,7 @@ import { TeamModalContext } from '../../context';
...
@@ -12,6 +12,7 @@ import { TeamModalContext } from '../../context';
import
{
TeamPermissionList
}
from
'@fastgpt/global/support/permission/user/constant'
;
import
{
TeamPermissionList
}
from
'@fastgpt/global/support/permission/user/constant'
;
import
dynamic
from
'next/dynamic'
;
import
dynamic
from
'next/dynamic'
;
import
MyBox
from
'@fastgpt/web/components/common/MyBox'
;
import
MyBox
from
'@fastgpt/web/components/common/MyBox'
;
import
MyTag
from
'@fastgpt/web/components/common/Tag/index'
;
const
AddManagerModal
=
dynamic
(()
=>
import
(
'./AddManager'
));
const
AddManagerModal
=
dynamic
(()
=>
import
(
'./AddManager'
));
...
@@ -56,8 +57,8 @@ function PermissionManage() {
...
@@ -56,8 +57,8 @@ function PermissionManage() {
bgColor=
{
'myGray.100'
}
bgColor=
{
'myGray.100'
}
alignItems=
{
'center'
}
alignItems=
{
'center'
}
alignContent=
{
'center'
}
alignContent=
{
'center'
}
mx=
{
'6'
}
px=
{
'3'
}
px=
{
'3'
}
ml=
{
3
}
borderRadius=
{
'sm'
}
borderRadius=
{
'sm'
}
>
>
{
TeamPermissionList
[
'manage'
].
description
}
{
TeamPermissionList
[
'manage'
].
description
}
...
@@ -78,19 +79,20 @@ function PermissionManage() {
...
@@ -78,19 +79,20 @@ function PermissionManage() {
</
Button
>
</
Button
>
)
}
)
}
</
Flex
>
</
Flex
>
<
Flex
mt=
"4"
mx=
"4"
>
<
Flex
mt=
"4"
mx=
"4"
flexWrap=
{
'wrap'
}
gap=
{
3
}
>
{
members
.
map
((
member
)
=>
{
{
members
.
map
((
member
)
=>
{
if
(
member
.
permission
.
hasManagePer
&&
!
member
.
permission
.
isOwner
)
{
if
(
member
.
permission
.
hasManagePer
&&
!
member
.
permission
.
isOwner
)
{
return
(
return
(
<
Tag
key=
{
member
.
memberName
}
mx=
{
'2'
}
px=
"4"
py=
"2"
bg=
"myGray.100
"
>
<
MyTag
key=
{
member
.
tmbId
}
px=
"4"
py=
"2"
type=
"fill"
colorSchema=
"gray
"
>
<
Avatar
src=
{
member
.
avatar
}
w=
"
20px
"
/>
<
Avatar
src=
{
member
.
avatar
}
w=
"
1.25rem
"
/>
<
TagLabel
fontSize=
{
'md'
}
alignItems=
"center"
mr=
"6"
ml=
"2"
>
<
Box
fontSize=
{
'sm'
}
ml=
{
1
}
>
{
member
.
memberName
}
{
member
.
memberName
}
</
TagLabel
>
</
Box
>
{
userInfo
?.
team
.
role
===
'owner'
&&
(
{
userInfo
?.
team
.
role
===
'owner'
&&
(
<
MyIcon
<
MyIcon
ml=
{
4
}
name=
"common/trash"
name=
"common/trash"
w=
"1
6px
"
w=
"1
rem
"
color=
"myGray.500"
color=
"myGray.500"
cursor=
"pointer"
cursor=
"pointer"
_hover=
{
{
color
:
'red.600'
}
}
_hover=
{
{
color
:
'red.600'
}
}
...
@@ -99,7 +101,7 @@ function PermissionManage() {
...
@@ -99,7 +101,7 @@ function PermissionManage() {
}
}
}
}
/>
/>
)
}
)
}
</
Tag
>
</
My
Tag
>
);
);
}
}
})
}
})
}
...
...
projects/app/src/pages/app/list/component/CreateModal.tsx
View file @
b8b26ad7
...
@@ -186,7 +186,7 @@ const CreateModal = ({ onClose }: { onClose: () => void }) => {
...
@@ -186,7 +186,7 @@ const CreateModal = ({ onClose }: { onClose: () => void }) => {
<
Button
variant=
{
'whiteBase'
}
mr=
{
3
}
onClick=
{
onClose
}
>
<
Button
variant=
{
'whiteBase'
}
mr=
{
3
}
onClick=
{
onClose
}
>
{
t
(
'common.Close'
)
}
{
t
(
'common.Close'
)
}
</
Button
>
</
Button
>
<
Button
isLoading=
{
creating
}
onClick=
{
handleSubmit
((
data
)
=>
onclickCreate
(
data
))
}
>
<
Button
px=
{
6
}
isLoading=
{
creating
}
onClick=
{
handleSubmit
((
data
)
=>
onclickCreate
(
data
))
}
>
{
t
(
'common.Confirm Create'
)
}
{
t
(
'common.Confirm Create'
)
}
</
Button
>
</
Button
>
</
ModalFooter
>
</
ModalFooter
>
...
...
projects/app/src/pages/app/list/component/List.tsx
View file @
b8b26ad7
...
@@ -28,6 +28,7 @@ import {
...
@@ -28,6 +28,7 @@ import {
postUpdateAppCollaborators
postUpdateAppCollaborators
}
from
'@/web/core/app/api/collaborator'
;
}
from
'@/web/core/app/api/collaborator'
;
import
MyTooltip
from
'@fastgpt/web/components/common/MyTooltip'
;
import
MyTooltip
from
'@fastgpt/web/components/common/MyTooltip'
;
import
AppTypeTag
from
'@/components/core/app/TypeTag'
;
const
EditResourceModal
=
dynamic
(()
=>
import
(
'@/components/common/Modal/EditResourceModal'
));
const
EditResourceModal
=
dynamic
(()
=>
import
(
'@/components/common/Modal/EditResourceModal'
));
const
ConfigPerModal
=
dynamic
(()
=>
import
(
'@/components/support/permission/ConfigPerModal'
));
const
ConfigPerModal
=
dynamic
(()
=>
import
(
'@/components/support/permission/ConfigPerModal'
));
...
@@ -90,10 +91,12 @@ const ListItem = () => {
...
@@ -90,10 +91,12 @@ const ListItem = () => {
py=
{
[
4
,
6
]
}
py=
{
[
4
,
6
]
}
gridTemplateColumns=
{
[
'1fr'
,
'repeat(2,1fr)'
,
'repeat(3,1fr)'
,
'repeat(4,1fr)'
]
}
gridTemplateColumns=
{
[
'1fr'
,
'repeat(2,1fr)'
,
'repeat(3,1fr)'
,
'repeat(4,1fr)'
]
}
gridGap=
{
5
}
gridGap=
{
5
}
alignItems=
{
'stretch'
}
>
>
{
myApps
.
map
((
app
,
index
)
=>
(
{
myApps
.
map
((
app
,
index
)
=>
(
<
MyTooltip
<
MyTooltip
key=
{
app
.
_id
}
key=
{
app
.
_id
}
h=
"100%"
label=
{
label=
{
app
.
type
===
AppTypeEnum
.
folder
app
.
type
===
AppTypeEnum
.
folder
?
t
(
'common.folder.Open folder'
)
?
t
(
'common.folder.Open folder'
)
...
@@ -105,7 +108,7 @@ const ListItem = () => {
...
@@ -105,7 +108,7 @@ const ListItem = () => {
<
MyBox
<
MyBox
isLoading=
{
loadingAppId
===
app
.
_id
}
isLoading=
{
loadingAppId
===
app
.
_id
}
lineHeight=
{
1.5
}
lineHeight=
{
1.5
}
h=
{
'100%'
}
h=
"100%"
py=
{
3
}
py=
{
3
}
px=
{
5
}
px=
{
5
}
cursor=
{
'pointer'
}
cursor=
{
'pointer'
}
...
@@ -238,6 +241,7 @@ const ListItem = () => {
...
@@ -238,6 +241,7 @@ const ListItem = () => {
color=
{
'myGray.600'
}
color=
{
'myGray.600'
}
/>
/>
</
Box
>
</
Box
>
<
AppTypeTag
type=
{
app
.
type
}
/>
</
Flex
>
</
Flex
>
</
MyBox
>
</
MyBox
>
</
MyTooltip
>
</
MyTooltip
>
...
...
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