mirror of
https://github.com/usual2970/certimate.git
synced 2025-07-11 21:50:01 +00:00
Compare commits
3 Commits
07a443f6c4
...
a4eff0b408
Author | SHA1 | Date | |
---|---|---|---|
![]() |
a4eff0b408 | ||
![]() |
7b85da901d | ||
![]() |
be27789ea8 |
@ -1,7 +1,7 @@
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Button, Form, Input, message, Tooltip } from "antd";
|
import { Button, Dropdown, Form, Input, message, Space, Tooltip } from "antd";
|
||||||
import { CopyToClipboard } from "react-copy-to-clipboard";
|
import { CopyToClipboard } from "react-copy-to-clipboard";
|
||||||
import { Clipboard as ClipboardIcon } from "lucide-react";
|
import { ChevronDown as ChevronDownIcon, Clipboard as ClipboardIcon, ThumbsUp as ThumbsUpIcon } from "lucide-react";
|
||||||
|
|
||||||
import { type Certificate } from "@/domain/certificate";
|
import { type Certificate } from "@/domain/certificate";
|
||||||
import { saveFiles2Zip } from "@/utils/file";
|
import { saveFiles2Zip } from "@/utils/file";
|
||||||
@ -15,8 +15,7 @@ const CertificateDetail = ({ data }: CertificateDetailProps) => {
|
|||||||
|
|
||||||
const [messageApi, MessageContextHolder] = message.useMessage();
|
const [messageApi, MessageContextHolder] = message.useMessage();
|
||||||
|
|
||||||
const handleDownloadClick = async () => {
|
const handleDownloadPEMClick = async () => {
|
||||||
// TODO: 支持下载多种格式
|
|
||||||
const zipName = `${data.id}-${data.san}.zip`;
|
const zipName = `${data.id}-${data.san}.zip`;
|
||||||
const files = [
|
const files = [
|
||||||
{
|
{
|
||||||
@ -73,14 +72,41 @@ const CertificateDetail = ({ data }: CertificateDetailProps) => {
|
|||||||
</Form>
|
</Form>
|
||||||
|
|
||||||
<div className="flex items-center justify-end">
|
<div className="flex items-center justify-end">
|
||||||
<Button
|
<Dropdown
|
||||||
type="primary"
|
menu={{
|
||||||
onClick={() => {
|
items: [
|
||||||
handleDownloadClick();
|
{
|
||||||
|
key: "PEM",
|
||||||
|
label: "PEM",
|
||||||
|
extra: <ThumbsUpIcon size="14" />,
|
||||||
|
onClick: () => handleDownloadPEMClick(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "PFX",
|
||||||
|
label: "PFX",
|
||||||
|
onClick: () => {
|
||||||
|
// TODO: 下载 PFX 格式证书
|
||||||
|
alert("TODO");
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "JKS",
|
||||||
|
label: "JKS",
|
||||||
|
onClick: () => {
|
||||||
|
// TODO: 下载 JKS 格式证书
|
||||||
|
alert("TODO");
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{t("certificate.action.download")}
|
<Button type="primary">
|
||||||
</Button>
|
<Space>
|
||||||
|
<span>{t("certificate.action.download")}</span>
|
||||||
|
<ChevronDownIcon size={14} />
|
||||||
|
</Space>
|
||||||
|
</Button>
|
||||||
|
</Dropdown>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { Link, Navigate, Outlet, useLocation, useNavigate } from "react-router-dom";
|
import { Link, Navigate, Outlet, useLocation, useNavigate } from "react-router-dom";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Button, Dropdown, Layout, Menu, Tooltip, theme, type ButtonProps, type MenuProps } from "antd";
|
import { Button, Drawer, Dropdown, Layout, Menu, Tooltip, theme, type ButtonProps, type MenuProps } from "antd";
|
||||||
import {
|
import {
|
||||||
Languages as LanguagesIcon,
|
Languages as LanguagesIcon,
|
||||||
LogOut as LogOutIcon,
|
LogOut as LogOutIcon,
|
||||||
@ -21,65 +21,21 @@ import { getPocketBase } from "@/repository/pocketbase";
|
|||||||
import { ConfigProvider } from "@/providers/config";
|
import { ConfigProvider } from "@/providers/config";
|
||||||
|
|
||||||
const ConsoleLayout = () => {
|
const ConsoleLayout = () => {
|
||||||
const location = useLocation();
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const { token: themeToken } = theme.useToken();
|
const { token: themeToken } = theme.useToken();
|
||||||
const { theme: browserTheme } = useTheme();
|
|
||||||
|
|
||||||
const menuItems: Required<MenuProps>["items"] = [
|
const [siderOpen, setSiderOpen] = useState(false);
|
||||||
{
|
|
||||||
key: "/",
|
|
||||||
icon: <HomeIcon size={16} />,
|
|
||||||
label: t("dashboard.page.title"),
|
|
||||||
onClick: () => navigate("/"),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "/workflows",
|
|
||||||
icon: <WorkflowIcon size={16} />,
|
|
||||||
label: t("workflow.page.title"),
|
|
||||||
onClick: () => navigate("/workflows"),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "/certificates",
|
|
||||||
icon: <ShieldCheckIcon size={16} />,
|
|
||||||
label: t("certificate.page.title"),
|
|
||||||
onClick: () => navigate("/certificates"),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "/accesses",
|
|
||||||
icon: <ServerIcon size={16} />,
|
|
||||||
label: t("access.page.title"),
|
|
||||||
onClick: () => navigate("/accesses"),
|
|
||||||
},
|
|
||||||
];
|
|
||||||
const [menuSelectedKey, setMenuSelectedKey] = useState<string>();
|
|
||||||
|
|
||||||
const getActiveMenuItem = () => {
|
const handleSiderOpen = () => {
|
||||||
const item =
|
setSiderOpen(true);
|
||||||
menuItems.find((item) => item!.key === location.pathname) ??
|
|
||||||
menuItems.find((item) => item!.key !== "/" && location.pathname.startsWith(item!.key as string));
|
|
||||||
return item;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
const handleSiderClose = () => {
|
||||||
const item = getActiveMenuItem();
|
setSiderOpen(false);
|
||||||
if (item) {
|
};
|
||||||
setMenuSelectedKey(item.key as string);
|
|
||||||
} else {
|
|
||||||
setMenuSelectedKey(undefined);
|
|
||||||
}
|
|
||||||
}, [location.pathname]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (menuSelectedKey && menuSelectedKey !== getActiveMenuItem()?.key) {
|
|
||||||
navigate(menuSelectedKey);
|
|
||||||
}
|
|
||||||
}, [menuSelectedKey]);
|
|
||||||
|
|
||||||
// TODO: 响应式侧边栏菜单
|
|
||||||
|
|
||||||
const handleLogoutClick = () => {
|
const handleLogoutClick = () => {
|
||||||
auth.clear();
|
auth.clear();
|
||||||
@ -99,22 +55,10 @@ const ConsoleLayout = () => {
|
|||||||
<>
|
<>
|
||||||
<ConfigProvider>
|
<ConfigProvider>
|
||||||
<Layout className="w-full min-h-screen">
|
<Layout className="w-full min-h-screen">
|
||||||
<Layout.Sider theme={browserTheme} width={256}>
|
<Layout.Sider className="max-md:hidden" theme="light" width={256}>
|
||||||
<div className="flex flex-col items-center justify-between w-full h-full overflow-hidden">
|
<div className="flex flex-col items-center justify-between w-full h-full overflow-hidden">
|
||||||
<Link to="/" className="flex items-center gap-2 w-full px-4 font-semibold overflow-hidden">
|
<div className="w-full">
|
||||||
<img src="/logo.svg" className="w-[36px] h-[36px]" />
|
<SiderMenu />
|
||||||
<span className="w-[64px] h-[64px] leading-[64px] dark:text-white truncate">Certimate</span>
|
|
||||||
</Link>
|
|
||||||
<div className="flex-grow w-full overflow-x-hidden overflow-y-auto">
|
|
||||||
<Menu
|
|
||||||
items={menuItems}
|
|
||||||
mode="vertical"
|
|
||||||
selectedKeys={menuSelectedKey ? [menuSelectedKey] : []}
|
|
||||||
theme={browserTheme}
|
|
||||||
onSelect={({ key }) => {
|
|
||||||
setMenuSelectedKey(key);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div className="w-full py-2 text-center">
|
<div className="w-full py-2 text-center">
|
||||||
<Version />
|
<Version />
|
||||||
@ -125,7 +69,22 @@ const ConsoleLayout = () => {
|
|||||||
<Layout>
|
<Layout>
|
||||||
<Layout.Header style={{ padding: 0, background: themeToken.colorBgContainer }}>
|
<Layout.Header style={{ padding: 0, background: themeToken.colorBgContainer }}>
|
||||||
<div className="flex items-center justify-between size-full px-4 overflow-hidden">
|
<div className="flex items-center justify-between size-full px-4 overflow-hidden">
|
||||||
<div className="flex items-center gap-4 size-full">{/* <Button icon={<MenuIcon />} size="large" /> */}</div>
|
<div className="flex items-center gap-4 size-full">
|
||||||
|
<Button className="md:hidden" icon={<MenuIcon />} size="large" onClick={handleSiderOpen} />
|
||||||
|
<Drawer
|
||||||
|
closable={false}
|
||||||
|
destroyOnClose
|
||||||
|
open={siderOpen}
|
||||||
|
placement="left"
|
||||||
|
styles={{
|
||||||
|
content: { paddingTop: themeToken.paddingSM, paddingBottom: themeToken.paddingSM },
|
||||||
|
body: { padding: 0 },
|
||||||
|
}}
|
||||||
|
onClose={handleSiderClose}
|
||||||
|
>
|
||||||
|
<SiderMenu onSelect={() => handleSiderClose()} />
|
||||||
|
</Drawer>
|
||||||
|
</div>
|
||||||
<div className="flex-grow flex items-center justify-end gap-4 size-full overflow-hidden">
|
<div className="flex-grow flex items-center justify-end gap-4 size-full overflow-hidden">
|
||||||
<Tooltip title={t("common.menu.theme")} mouseEnterDelay={2}>
|
<Tooltip title={t("common.menu.theme")} mouseEnterDelay={2}>
|
||||||
<ThemeToggleButton size="large" />
|
<ThemeToggleButton size="large" />
|
||||||
@ -155,7 +114,99 @@ const ConsoleLayout = () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const ThemeToggleButton = ({ size }: { size?: ButtonProps["size"] }) => {
|
const SiderMenu = React.memo(({ onSelect }: { onSelect?: (key: string) => void }) => {
|
||||||
|
const location = useLocation();
|
||||||
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
const MENU_KEY_HOME = "/";
|
||||||
|
const MENU_KEY_WORKFLOWS = "/workflows";
|
||||||
|
const MENU_KEY_CERTIFICATES = "/certificates";
|
||||||
|
const MENU_KEY_ACCESSES = "/accesses";
|
||||||
|
const menuItems: Required<MenuProps>["items"] = [
|
||||||
|
{
|
||||||
|
key: MENU_KEY_HOME,
|
||||||
|
icon: <HomeIcon size={16} />,
|
||||||
|
label: t("dashboard.page.title"),
|
||||||
|
onClick: () => {
|
||||||
|
navigate(MENU_KEY_HOME);
|
||||||
|
onSelect?.(MENU_KEY_HOME);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: MENU_KEY_WORKFLOWS,
|
||||||
|
icon: <WorkflowIcon size={16} />,
|
||||||
|
label: t("workflow.page.title"),
|
||||||
|
onClick: () => {
|
||||||
|
navigate(MENU_KEY_WORKFLOWS);
|
||||||
|
onSelect?.(MENU_KEY_WORKFLOWS);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: MENU_KEY_CERTIFICATES,
|
||||||
|
icon: <ShieldCheckIcon size={16} />,
|
||||||
|
label: t("certificate.page.title"),
|
||||||
|
onClick: () => {
|
||||||
|
navigate(MENU_KEY_CERTIFICATES);
|
||||||
|
onSelect?.(MENU_KEY_CERTIFICATES);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: MENU_KEY_ACCESSES,
|
||||||
|
icon: <ServerIcon size={16} />,
|
||||||
|
label: t("access.page.title"),
|
||||||
|
onClick: () => {
|
||||||
|
navigate(MENU_KEY_ACCESSES);
|
||||||
|
onSelect?.(MENU_KEY_ACCESSES);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
const [menuSelectedKey, setMenuSelectedKey] = useState<string>();
|
||||||
|
|
||||||
|
const getActiveMenuItem = () => {
|
||||||
|
const item =
|
||||||
|
menuItems.find((item) => item!.key === location.pathname) ??
|
||||||
|
menuItems.find((item) => item!.key !== MENU_KEY_HOME && location.pathname.startsWith(item!.key as string));
|
||||||
|
return item;
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const item = getActiveMenuItem();
|
||||||
|
if (item) {
|
||||||
|
setMenuSelectedKey(item.key as string);
|
||||||
|
} else {
|
||||||
|
setMenuSelectedKey(undefined);
|
||||||
|
}
|
||||||
|
}, [location.pathname]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (menuSelectedKey && menuSelectedKey !== getActiveMenuItem()?.key) {
|
||||||
|
navigate(menuSelectedKey);
|
||||||
|
}
|
||||||
|
}, [menuSelectedKey]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Link to="/" className="flex items-center gap-2 w-full px-4 font-semibold overflow-hidden">
|
||||||
|
<img src="/logo.svg" className="w-[36px] h-[36px]" />
|
||||||
|
<span className="w-[64px] h-[64px] leading-[64px] dark:text-white truncate">Certimate</span>
|
||||||
|
</Link>
|
||||||
|
<div className="flex-grow w-full overflow-x-hidden overflow-y-auto">
|
||||||
|
<Menu
|
||||||
|
items={menuItems}
|
||||||
|
mode="vertical"
|
||||||
|
selectedKeys={menuSelectedKey ? [menuSelectedKey] : []}
|
||||||
|
onSelect={({ key }) => {
|
||||||
|
setMenuSelectedKey(key);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
const ThemeToggleButton = React.memo(({ size }: { size?: ButtonProps["size"] }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const { theme, setThemeMode } = useTheme();
|
const { theme, setThemeMode } = useTheme();
|
||||||
@ -183,9 +234,9 @@ const ThemeToggleButton = ({ size }: { size?: ButtonProps["size"] }) => {
|
|||||||
<Button icon={theme === "dark" ? <MoonIcon size={18} /> : <SunIcon size={18} />} size={size} />
|
<Button icon={theme === "dark" ? <MoonIcon size={18} /> : <SunIcon size={18} />} size={size} />
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
);
|
);
|
||||||
};
|
});
|
||||||
|
|
||||||
const LocaleToggleButton = ({ size }: { size?: ButtonProps["size"] }) => {
|
const LocaleToggleButton = React.memo(({ size }: { size?: ButtonProps["size"] }) => {
|
||||||
const { i18n } = useTranslation();
|
const { i18n } = useTranslation();
|
||||||
|
|
||||||
const items: Required<MenuProps>["items"] = Object.keys(i18n.store.data).map((key) => {
|
const items: Required<MenuProps>["items"] = Object.keys(i18n.store.data).map((key) => {
|
||||||
@ -201,6 +252,6 @@ const LocaleToggleButton = ({ size }: { size?: ButtonProps["size"] }) => {
|
|||||||
<Button icon={<LanguagesIcon size={18} />} size={size} />
|
<Button icon={<LanguagesIcon size={18} />} size={size} />
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
);
|
);
|
||||||
};
|
});
|
||||||
|
|
||||||
export default ConsoleLayout;
|
export default ConsoleLayout;
|
||||||
|
@ -23,7 +23,7 @@ const AccessList = () => {
|
|||||||
{
|
{
|
||||||
key: "$index",
|
key: "$index",
|
||||||
align: "center",
|
align: "center",
|
||||||
title: "",
|
fixed: "left",
|
||||||
width: 50,
|
width: 50,
|
||||||
render: (_, __, index) => (page - 1) * pageSize + index + 1,
|
render: (_, __, index) => (page - 1) * pageSize + index + 1,
|
||||||
},
|
},
|
||||||
@ -36,11 +36,12 @@ const AccessList = () => {
|
|||||||
{
|
{
|
||||||
key: "provider",
|
key: "provider",
|
||||||
title: t("common.text.provider"),
|
title: t("common.text.provider"),
|
||||||
|
ellipsis: true,
|
||||||
render: (_, record) => {
|
render: (_, record) => {
|
||||||
return (
|
return (
|
||||||
<Space className="max-w-full" size={4}>
|
<Space className="max-w-full truncate" size={4}>
|
||||||
<Avatar src={accessProvidersMap.get(record.configType)?.icon} size="small" />
|
<Avatar src={accessProvidersMap.get(record.configType)?.icon} size="small" />
|
||||||
<Typography.Text>{t(accessProvidersMap.get(record.configType)?.name ?? "")}</Typography.Text>
|
<Typography.Text ellipsis>{t(accessProvidersMap.get(record.configType)?.name ?? "")}</Typography.Text>
|
||||||
</Space>
|
</Space>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@ -156,8 +157,6 @@ const AccessList = () => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: 响应式表格
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{ModelContextHolder}
|
{ModelContextHolder}
|
||||||
@ -199,6 +198,7 @@ const AccessList = () => {
|
|||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
rowKey={(record) => record.id}
|
rowKey={(record) => record.id}
|
||||||
|
scroll={{ x: "max(100%, 960px)" }}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
@ -27,7 +27,7 @@ const CertificateList = () => {
|
|||||||
{
|
{
|
||||||
key: "$index",
|
key: "$index",
|
||||||
align: "center",
|
align: "center",
|
||||||
title: "",
|
fixed: "left",
|
||||||
width: 50,
|
width: 50,
|
||||||
render: (_, __, index) => (page - 1) * pageSize + index + 1,
|
render: (_, __, index) => (page - 1) * pageSize + index + 1,
|
||||||
},
|
},
|
||||||
@ -39,6 +39,7 @@ const CertificateList = () => {
|
|||||||
{
|
{
|
||||||
key: "expiry",
|
key: "expiry",
|
||||||
title: t("certificate.props.expiry"),
|
title: t("certificate.props.expiry"),
|
||||||
|
ellipsis: true,
|
||||||
defaultFilteredValue: searchParams.has("state") ? [searchParams.get("state") as string] : undefined,
|
defaultFilteredValue: searchParams.has("state") ? [searchParams.get("state") as string] : undefined,
|
||||||
filterDropdown: ({ setSelectedKeys, confirm, clearFilters }) => {
|
filterDropdown: ({ setSelectedKeys, confirm, clearFilters }) => {
|
||||||
const items: Required<MenuProps>["items"] = [
|
const items: Required<MenuProps>["items"] = [
|
||||||
@ -107,6 +108,7 @@ const CertificateList = () => {
|
|||||||
{
|
{
|
||||||
key: "source",
|
key: "source",
|
||||||
title: t("certificate.props.source"),
|
title: t("certificate.props.source"),
|
||||||
|
ellipsis: true,
|
||||||
render: (_, record) => {
|
render: (_, record) => {
|
||||||
const workflowId = record.workflow;
|
const workflowId = record.workflow;
|
||||||
return workflowId ? (
|
return workflowId ? (
|
||||||
@ -213,8 +215,6 @@ const CertificateList = () => {
|
|||||||
setCurrentRecord(certificate);
|
setCurrentRecord(certificate);
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: 响应式表格
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{NotificationContextHolder}
|
{NotificationContextHolder}
|
||||||
@ -242,6 +242,7 @@ const CertificateList = () => {
|
|||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
rowKey={(record) => record.id}
|
rowKey={(record) => record.id}
|
||||||
|
scroll={{ x: "max(100%, 960px)" }}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<CertificateDetailDrawer
|
<CertificateDetailDrawer
|
||||||
|
@ -65,7 +65,7 @@ const Dashboard = () => {
|
|||||||
|
|
||||||
<PageHeader title={t("dashboard.page.title")} />
|
<PageHeader title={t("dashboard.page.title")} />
|
||||||
|
|
||||||
<Row gutter={[16, 16]}>
|
<Row className="justify-stretch" gutter={[16, 16]}>
|
||||||
<Col {...statisticGridSpans}>
|
<Col {...statisticGridSpans}>
|
||||||
<StatisticCard
|
<StatisticCard
|
||||||
icon={<SquareSigmaIcon size={48} strokeWidth={1} color={themeToken.colorInfo} />}
|
icon={<SquareSigmaIcon size={48} strokeWidth={1} color={themeToken.colorInfo} />}
|
||||||
@ -134,7 +134,7 @@ const StatisticCard = ({
|
|||||||
onClick?: () => void;
|
onClick?: () => void;
|
||||||
}) => {
|
}) => {
|
||||||
return (
|
return (
|
||||||
<Card className="overflow-hidden" bordered={false} hoverable onClick={onClick}>
|
<Card className="size-full overflow-hidden" bordered={false} hoverable onClick={onClick}>
|
||||||
<Space size="middle">
|
<Space size="middle">
|
||||||
{icon}
|
{icon}
|
||||||
<Statistic
|
<Statistic
|
||||||
|
@ -43,13 +43,14 @@ const WorkflowList = () => {
|
|||||||
{
|
{
|
||||||
key: "$index",
|
key: "$index",
|
||||||
align: "center",
|
align: "center",
|
||||||
title: "",
|
fixed: "left",
|
||||||
width: 50,
|
width: 50,
|
||||||
render: (_, __, index) => (page - 1) * pageSize + index + 1,
|
render: (_, __, index) => (page - 1) * pageSize + index + 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "name",
|
key: "name",
|
||||||
title: t("common.text.name"),
|
title: t("common.text.name"),
|
||||||
|
ellipsis: true,
|
||||||
render: (_, record) => (
|
render: (_, record) => (
|
||||||
<Space className="max-w-full" direction="vertical" size={4}>
|
<Space className="max-w-full" direction="vertical" size={4}>
|
||||||
<Typography.Text ellipsis>{record.name}</Typography.Text>
|
<Typography.Text ellipsis>{record.name}</Typography.Text>
|
||||||
@ -62,6 +63,7 @@ const WorkflowList = () => {
|
|||||||
{
|
{
|
||||||
key: "type",
|
key: "type",
|
||||||
title: t("workflow.props.executionMethod"),
|
title: t("workflow.props.executionMethod"),
|
||||||
|
ellipsis: true,
|
||||||
render: (_, record) => {
|
render: (_, record) => {
|
||||||
const method = record.type;
|
const method = record.type;
|
||||||
if (!method) {
|
if (!method) {
|
||||||
@ -279,8 +281,6 @@ const WorkflowList = () => {
|
|||||||
navigate("/workflows/detail");
|
navigate("/workflows/detail");
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: 响应式表格
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{ModelContextHolder}
|
{ModelContextHolder}
|
||||||
@ -323,6 +323,7 @@ const WorkflowList = () => {
|
|||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
rowKey={(record) => record.id}
|
rowKey={(record) => record.id}
|
||||||
|
scroll={{ x: "max(100%, 960px)" }}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user