refactor: workflow condition node
refactor: workflow condition node
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user