refactor: workflow condition node

refactor: workflow condition node
This commit is contained in:
Fu Diwei
2025-05-28 23:30:38 +08:00
parent 3a829ad53b
commit 6731c465e7
59 changed files with 1140 additions and 988 deletions

View File

@@ -265,7 +265,7 @@ const AccessFormSSHConfig = ({ form: formInst, formName, disabled, initialValues
})}
/>
) : null}
<Button type="dashed" className="w-full" icon={<PlusOutlined />} onClick={() => add()}>
<Button className="w-full" type="dashed" icon={<PlusOutlined />} onClick={() => add()}>
{t("access.form.ssh_jump_servers.add")}
</Button>
</Space>

View File

@@ -1,5 +1,5 @@
import { useEffect, useState } from "react";
import { Avatar, Select, type SelectProps, Space, Typography } from "antd";
import { Avatar, Select, type SelectProps, Space, Typography, theme } from "antd";
import { type AccessModel } from "@/domain/access";
import { accessProvidersMap } from "@/domain/provider";
@@ -14,6 +14,8 @@ export type AccessTypeSelectProps = Omit<
};
const AccessSelect = ({ filter, ...props }: AccessTypeSelectProps) => {
const { token: themeToken } = theme.useToken();
const { accesses, loadedAtOnce, fetchAccesses } = useAccessesStore(useZustandShallowSelector(["accesses", "loadedAtOnce", "fetchAccesses"]));
useEffect(() => {
fetchAccesses();
@@ -65,12 +67,12 @@ const AccessSelect = ({ filter, ...props }: AccessTypeSelectProps) => {
const value = inputValue.toLowerCase();
return option.label.toLowerCase().includes(value);
}}
labelRender={({ label, value }) => {
if (label) {
labelRender={({ value }) => {
if (value != null) {
return renderOption(value as string);
}
return <Typography.Text type="secondary">{props.placeholder}</Typography.Text>;
return <span style={{ color: themeToken.colorTextPlaceholder }}>{props.placeholder}</span>;
}}
loading={!loadedAtOnce}
options={options}