App run node update (#2542)

* feat(workflow): allow apps to be invoked like plugins (#2521)

* feat(workflow): allow apps to be invoked like plugins

* fix type

* Encapsulate SSE response methods (#2530)

* perf: sse response fn

* perf: sse response

* fix: ts

* perf: not ssl copy

* perf: myselect auto scroll

* perf: run app code

* fix: app plugin (#2538)

---------

Co-authored-by: heheer <heheer@sealos.io>
This commit is contained in:
Archer
2024-08-27 16:43:19 +08:00
committed by GitHub
parent 67445b40bc
commit 450167c951
67 changed files with 706 additions and 4899 deletions

View File

@@ -50,6 +50,9 @@ const MySelect = <T = any,>(
}>
) => {
const ButtonRef = useRef<HTMLButtonElement>(null);
const MenuListRef = useRef<HTMLDivElement>(null);
const SelectedItemRef = useRef<HTMLDivElement>(null);
const menuItemStyles: MenuItemProps = {
borderRadius: 'sm',
py: 2,
@@ -71,6 +74,14 @@ const MySelect = <T = any,>(
}
}));
useEffect(() => {
if (isOpen && MenuListRef.current && SelectedItemRef.current) {
const menu = MenuListRef.current;
const selectedItem = SelectedItemRef.current;
menu.scrollTop = selectedItem.offsetTop - menu.offsetTop - 100;
}
}, [isOpen]);
return (
<Box
css={css({
@@ -113,6 +124,7 @@ const MySelect = <T = any,>(
</MenuButton>
<MenuList
ref={MenuListRef}
className={props.className}
minW={(() => {
const w = ButtonRef.current?.clientWidth;
@@ -140,6 +152,7 @@ const MySelect = <T = any,>(
{...menuItemStyles}
{...(value === item.value
? {
ref: SelectedItemRef,
color: 'primary.600',
bg: 'myGray.100'
}

View File

@@ -45,7 +45,11 @@ const NodeInputSelect = ({
{
type: FlowNodeInputTypeEnum.switch,
icon: FlowNodeInputMap[FlowNodeInputTypeEnum.switch].icon,
title: t('common:core.workflow.inputType.Manual select')
},
{
type: FlowNodeInputTypeEnum.select,
icon: FlowNodeInputMap[FlowNodeInputTypeEnum.select].icon,
title: t('common:core.workflow.inputType.Manual select')
},
{

View File

@@ -902,6 +902,7 @@
"System Plugin": "System",
"System input module": "System input",
"Team Plugin": "Team",
"Team app": "Team",
"Tool module": "Tool",
"UnKnow Module": "Unknown module",
"http body placeholder": "Same syntax as APIFox"
@@ -1162,6 +1163,7 @@
"Please bind laf accout first": "Please bind laf account first",
"Plugin List": "Plugin list",
"Search plugin": "Search plugin",
"Search_app": "Search app",
"Set Name": "Name the plugin",
"contribute": "Contribute plugins",
"go to laf": "Go to write",

View File

@@ -902,6 +902,7 @@
"System Plugin": "系统插件",
"System input module": "系统输入",
"Team Plugin": "团队插件",
"Team app": "团队应用",
"Tool module": "工具",
"UnKnow Module": "未知模块",
"http body placeholder": "与 Apifox 相同的语法"
@@ -1162,6 +1163,7 @@
"Please bind laf accout first": "请先绑定 laf 账号",
"Plugin List": "插件列表",
"Search plugin": "搜索插件",
"Search_app": "搜索应用",
"Set Name": "给插件取个名字",
"contribute": "贡献插件",
"go to laf": "去编写",