diff --git a/frontend/src/pages/Flow/index.jsx b/frontend/src/pages/Flow/index.jsx index df39d7a..c945196 100644 --- a/frontend/src/pages/Flow/index.jsx +++ b/frontend/src/pages/Flow/index.jsx @@ -56,7 +56,7 @@ export default () => { }, { dataIndex: 'title', - title: "工作流", + title: "工作", render: (_, record) => { return {record?.work_title} diff --git a/frontend/src/pages/Layout.jsx b/frontend/src/pages/Layout.jsx index ecd5793..b5de4a5 100644 --- a/frontend/src/pages/Layout.jsx +++ b/frontend/src/pages/Layout.jsx @@ -1,7 +1,7 @@ import React, { useState } from "react"; import { Outlet, useNavigate, useLocation } from "react-router-dom"; import { Layout, Menu, Button, Flex, Dropdown, Steps } from "antd"; -import { MenuFoldOutlined, MenuUnfoldOutlined, UserOutlined, LoginOutlined, ProfileOutlined, NodeExpandOutlined, LaptopOutlined } from "@ant-design/icons"; +import { MenuFoldOutlined, MenuUnfoldOutlined, UserOutlined, LoginOutlined, ProfileOutlined, NodeExpandOutlined, LaptopOutlined, SolutionOutlined } from "@ant-design/icons"; import { useAuth } from "../context/AuthContext"; import './Layout.css'; @@ -14,8 +14,9 @@ export default function LayoutPage() { const location = useLocation(); const menuItems = [ - { key: "1", icon: , label: "工作台", path: "/flow" }, - { key: "2", icon: , label: "节点管理", path: "/client" }, + { key: "flow", icon: , label: "工作台", path: "/flow" }, + { key: "logs", icon: , label: "操作日志", path: "/logs" }, + { key: "client", icon: , label: "节点管理", path: "/client" }, ]; const selectedKey = menuItems.find(item => location.pathname.startsWith(item.path))?.key || ""; diff --git a/frontend/src/pages/Log/index.jsx b/frontend/src/pages/Log/index.jsx new file mode 100644 index 0000000..c52dee7 --- /dev/null +++ b/frontend/src/pages/Log/index.jsx @@ -0,0 +1,68 @@ +import { ProTable } from "@ant-design/pro-components"; +import { Card } from "antd"; +import { useRef } from "react"; + +const LogPage = () => { + const actionRef = useRef(null); + const columns = [ + { + dataIndex: 'index', + title: "序号", + }, + { + dataIndex: 'title', + title: "工作", + render: (_, record) => { + return + {record?.work_title} + ({record?.work_desc}) + + } + }, + { + dataIndex: 'last_user', + title: '执行用户', + }, + { + dataIndex: 'last_run_time', + title: '执行时间', + render: (_, record) => record?.last_run_time ? new Date(record?.last_run_time * 1000).toLocaleString() : '' + }, + { + dataIndex: 'last_status', + title: '执行结果', + valueType: 'select', + valueEnum: { + 'RUNNING': { text: "执行中", status: 'processing' }, + 'SUCCESS': { text: "成功", status: 'success' }, + 'FAILED': { text: "失败", status: 'error' }, + 'CANCELLED': { text: "取消", status: 'default' } + } + }, + { + title: '操作', + valueType: 'option', + key: 'option', + width: 60, + fixed: 'right', + render: (_, record) => [ + 查看 + ] + } + ]; + const onRequest = async (params) => { + return {}; + } + return + + +} + +export default LogPage; \ No newline at end of file diff --git a/frontend/src/routes.jsx b/frontend/src/routes.jsx index 23da8ef..41e7705 100644 --- a/frontend/src/routes.jsx +++ b/frontend/src/routes.jsx @@ -9,7 +9,7 @@ import Flow from "./pages/Flow"; import FlowDetail from "./pages/Flow/Detail"; import LayoutPage from "./pages/Layout"; import ClientPage from "./pages/Client"; - +import LogPage from "./pages/Log"; // 受保护的路由:没登录就跳转到登录页 function PrivateRoute() { @@ -33,7 +33,8 @@ const routes = [ { path: "/client", element: }, { path: "/flow/detail/:work_uuid", element: }, { path: "/user", element: }, - { path: "/user/detail", element: } + { path: "/user/detail", element: }, + { path: "/logs", element: } ] } ],