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'
}