diff --git a/ui/src/components/workflow/WorkflowRunDetail.tsx b/ui/src/components/workflow/WorkflowRunDetail.tsx index 35759eca..69fdef82 100644 --- a/ui/src/components/workflow/WorkflowRunDetail.tsx +++ b/ui/src/components/workflow/WorkflowRunDetail.tsx @@ -125,7 +125,7 @@ const WorkflowRunLogs = ({ runId, runStatus }: { runId: string; runStatus: strin {Object.entries(record.data).map(([key, value]) => (
{key}:
-
{JSON.stringify(value)}
+
{JSON.stringify(value)}
))} @@ -263,6 +263,94 @@ const WorkflowRunLogs = ({ runId, runStatus }: { runId: string; runStatus: strin ); }; -const WorkflowRunArtifacts = ({ runId }: { runId: string }) => {}; +const WorkflowRunArtifacts = ({ runId }: { runId: string }) => { + const { t } = useTranslation(); + + const { notification } = App.useApp(); + + const tableColumns: TableProps["columns"] = [ + { + key: "$index", + align: "center", + fixed: "left", + width: 50, + render: (_, __, index) => index + 1, + }, + { + key: "type", + title: t("workflow_run_artifact.props.type"), + render: () => t("workflow_run_artifact.props.type.certificate"), + }, + { + key: "name", + title: t("workflow_run_artifact.props.name"), + render: (_, record) => { + return ( +
+ + {record.subjectAltNames} + +
+ ); + }, + }, + { + key: "$action", + align: "end", + width: 32, + render: (_, record) => ( +
+ +
+ ), + }, + ]; + const [tableData, setTableData] = useState([]); + const { loading: tableLoading } = useRequest( + () => { + return listCertificatesByWorkflowRunId(runId); + }, + { + refreshDeps: [runId], + onSuccess: (res) => { + setTableData(res.items); + }, + onError: (err) => { + if (err instanceof ClientResponseError && err.isAbort) { + return; + } + + console.error(err); + notification.error({ message: t("common.text.request_error"), description: getErrMsg(err) }); + + throw err; + }, + } + ); + + return ( + <> + {t("workflow_run.artifacts")} + + columns={tableColumns} + dataSource={tableData} + loading={tableLoading} + locale={{ + emptyText: , + }} + pagination={false} + rowKey={(record) => record.id} + size="small" + /> + + ); +}; export default WorkflowRunDetail; diff --git a/ui/src/i18n/locales/en/nls.access.json b/ui/src/i18n/locales/en/nls.access.json index 5a55cd29..74738e15 100644 --- a/ui/src/i18n/locales/en/nls.access.json +++ b/ui/src/i18n/locales/en/nls.access.json @@ -11,8 +11,11 @@ "access.action.create.button": "Create credential", "access.action.create.modal.title": "Create credential", + "access.action.edit.button": "Edit credential", "access.action.edit.modal.title": "Edit credential", + "access.action.duplicate.button": "Duplicate credential", "access.action.duplicate.modal.title": "Duplicate credential", + "access.action.delete.button": "Delete credential", "access.action.delete.modal.title": "Delete \"{{name}}\"", "access.action.delete.modal.content": "Are you sure want to delete this credential?
This action cannot be undone.", "access.action.batch_delete.modal.title": "Delete credentials", diff --git a/ui/src/i18n/locales/en/nls.certificate.json b/ui/src/i18n/locales/en/nls.certificate.json index 832ae508..52857b58 100644 --- a/ui/src/i18n/locales/en/nls.certificate.json +++ b/ui/src/i18n/locales/en/nls.certificate.json @@ -8,6 +8,8 @@ "certificate.search.placeholder": "Search by certificate name or serial number ...", + "certificate.action.view.button": "View details", + "certificate.action.delete.button": "Delete certificate", "certificate.action.delete.modal.title": "Delete \"{{name}}\"", "certificate.action.delete.modal.content": "Are you sure want to delete this certificate?
This action cannot be undone.", "certificate.action.batch_delete.modal.title": "Delete certificates", diff --git a/ui/src/i18n/locales/en/nls.workflow.json b/ui/src/i18n/locales/en/nls.workflow.json index 9855552b..1f9130c4 100644 --- a/ui/src/i18n/locales/en/nls.workflow.json +++ b/ui/src/i18n/locales/en/nls.workflow.json @@ -9,8 +9,11 @@ "workflow.search.placeholder": "Search by workflow name ...", "workflow.action.create.button": "Create workflow", + "workflow.action.edit.button": "Edit workflow", + "workflow.action.duplicate.button": "Duplicate workflow", "workflow.action.duplicate.modal.title": "Duplicate \"{{name}}\"", "workflow.action.duplicate.modal.content": "Are you sure to duplicate this workflow?", + "workflow.action.delete.button": "Delete workflow", "workflow.action.delete.modal.title": "Delete \"{{name}}\"", "workflow.action.delete.modal.content": "Are you sure want to delete this workflow?
This action cannot be undone.", "workflow.action.batch_delete.modal.title": "Delete workflows", diff --git a/ui/src/i18n/locales/zh/nls.access.json b/ui/src/i18n/locales/zh/nls.access.json index 161bcc22..e09ea1a2 100644 --- a/ui/src/i18n/locales/zh/nls.access.json +++ b/ui/src/i18n/locales/zh/nls.access.json @@ -10,8 +10,11 @@ "access.action.create.button": "新建授权", "access.action.create.modal.title": "新建授权", + "access.action.edit.button": "编辑授权", "access.action.edit.modal.title": "编辑授权", + "access.action.duplicate.button": "复制授权", "access.action.duplicate.modal.title": "复制授权", + "access.action.delete.button": "删除授权", "access.action.delete.modal.title": "删除「{{name}}」", "access.action.delete.modal.content": "确定要删除该授权吗?
注意此操作不可撤销,请谨慎操作。", "access.action.batch_delete.modal.title": "删除授权", diff --git a/ui/src/i18n/locales/zh/nls.certificate.json b/ui/src/i18n/locales/zh/nls.certificate.json index 0e89cf0a..57a8fd6b 100644 --- a/ui/src/i18n/locales/zh/nls.certificate.json +++ b/ui/src/i18n/locales/zh/nls.certificate.json @@ -8,6 +8,8 @@ "certificate.search.placeholder": "按证书名称或序列号搜索……", + "certificate.action.view.button": "查看详情", + "certificate.action.delete.button": "删除证书", "certificate.action.delete.modal.title": "删除「{{name}}」", "certificate.action.delete.modal.content": "确定要删除该证书吗?
注意此操作不可撤销,请谨慎操作。", "certificate.action.batch_delete.modal.title": "删除证书", diff --git a/ui/src/i18n/locales/zh/nls.workflow.json b/ui/src/i18n/locales/zh/nls.workflow.json index 63825ebf..e5221801 100644 --- a/ui/src/i18n/locales/zh/nls.workflow.json +++ b/ui/src/i18n/locales/zh/nls.workflow.json @@ -9,8 +9,11 @@ "workflow.search.placeholder": "按工作流名称搜索……", "workflow.action.create.button": "新建工作流", + "workflow.action.edit.button": "编辑工作流", + "workflow.action.duplicate.button": "复制工作流", "workflow.action.duplicate.modal.title": "复制「{{name}}」", "workflow.action.duplicate.modal.content": "确定要复制该工作流吗?", + "workflow.action.delete.button": "删除工作流", "workflow.action.delete.modal.title": "删除「{{name}}」", "workflow.action.delete.modal.content": "确定要删除该工作流吗?
注意此操作不可撤销,请谨慎操作。", "workflow.action.batch_delete.modal.title": "删除工作流", diff --git a/ui/src/pages/ConsoleLayout.tsx b/ui/src/pages/ConsoleLayout.tsx index 8a0f5d62..a8e628d5 100644 --- a/ui/src/pages/ConsoleLayout.tsx +++ b/ui/src/pages/ConsoleLayout.tsx @@ -12,7 +12,7 @@ import { IconMenu2, IconSettings, } from "@tabler/icons-react"; -import { Alert, Button, Divider, Drawer, Layout, Menu, type MenuProps, theme } from "antd"; +import { Alert, Button, Drawer, Layout, Menu, type MenuProps, theme } from "antd"; import AppLocale from "@/components/AppLocale"; import AppTheme from "@/components/AppTheme"; @@ -103,7 +103,25 @@ const ConsoleLayout = () => { - + +
+
+
+
+
} />} /> diff --git a/ui/src/pages/accesses/AccessList.tsx b/ui/src/pages/accesses/AccessList.tsx index 036eae61..c64be2e7 100644 --- a/ui/src/pages/accesses/AccessList.tsx +++ b/ui/src/pages/accesses/AccessList.tsx @@ -1,7 +1,7 @@ import { useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; import { useNavigate, useSearchParams } from "react-router-dom"; -import { IconCirclePlus, IconCopy, IconDotsVertical, IconFingerprint, IconPlus, IconReload, IconTrash } from "@tabler/icons-react"; +import { IconCirclePlus, IconCopy, IconDotsVertical, IconEdit, IconFingerprint, IconPlus, IconReload, IconTrash } from "@tabler/icons-react"; import { useRequest } from "ahooks"; import { App, Avatar, Button, Dropdown, Input, Skeleton, Table, type TableProps, Tabs, Typography, theme } from "antd"; import dayjs from "dayjs"; @@ -87,9 +87,21 @@ const AccessList = () => { + + + ), + onClick: () => { + handleRecordDetailClick(record); + }, + }, { key: "duplicate", - label: t("common.button.duplicate"), + label: t("access.action.duplicate.button"), icon: ( @@ -104,7 +116,7 @@ const AccessList = () => { }, { key: "delete", - label: t("common.button.delete"), + label: t("access.action.delete.button"), danger: true, icon: ( diff --git a/ui/src/pages/certificates/CertificateList.tsx b/ui/src/pages/certificates/CertificateList.tsx index d502629e..d89e2019 100644 --- a/ui/src/pages/certificates/CertificateList.tsx +++ b/ui/src/pages/certificates/CertificateList.tsx @@ -1,7 +1,7 @@ import { useState } from "react"; import { useTranslation } from "react-i18next"; import { useNavigate, useSearchParams } from "react-router-dom"; -import { IconCertificate, IconDotsVertical, IconExternalLink, IconReload, IconTrash } from "@tabler/icons-react"; +import { IconBrowserShare, IconCertificate, IconDotsVertical, IconExternalLink, IconReload, IconTrash } from "@tabler/icons-react"; import { useRequest } from "ahooks"; import { App, Button, Dropdown, Input, Segmented, Skeleton, Table, type TableProps, Typography, theme } from "antd"; import dayjs from "dayjs"; @@ -146,9 +146,24 @@ const CertificateList = () => { + + + ), + onClick: () => { + handleRecordDetailClick(record); + }, + }, + { + type: "divider", + }, { key: "delete", - label: t("common.button.delete"), + label: t("certificate.action.delete.button"), danger: true, icon: ( diff --git a/ui/src/pages/workflows/WorkflowDetail.tsx b/ui/src/pages/workflows/WorkflowDetail.tsx index 0df31c07..b609635b 100644 --- a/ui/src/pages/workflows/WorkflowDetail.tsx +++ b/ui/src/pages/workflows/WorkflowDetail.tsx @@ -2,7 +2,7 @@ import { useEffect, useMemo, useState } from "react"; import { useTranslation } from "react-i18next"; import { useNavigate, useParams } from "react-router-dom"; import { IconArrowBackUp, IconChevronDown, IconDots, IconHistory, IconPlayerPlay, IconRobot, IconTrash } from "@tabler/icons-react"; -import { Alert, App, Button, Card, Dropdown, Flex, Form, Input, Space, Tabs } from "antd"; +import { Alert, App, Button, Card, Dropdown, Flex, Form, Input, Segmented, Space, Tabs } from "antd"; import { createSchemaFieldRule } from "antd-zod"; import { isEqual } from "radash"; import { z } from "zod"; @@ -194,55 +194,53 @@ const WorkflowDetail = () => { return (
- -
-
-
-
-

{workflow.name || "\u00A0"}

-

{workflow.description || "\u00A0"}

-
- - {initialized - ? [ - {t("common.button.edit")}} />, - , - , - onClick: () => { - handleDeleteClick(); - }, - }, - ], - }} - trigger={["click"]} - > - - , - ] - : []} - +
+
+
+
+

{workflow.name || "\u00A0"}

+

{workflow.description || "\u00A0"}

+ + {initialized + ? [ + {t("common.button.edit")}} />, + , + , + onClick: () => { + handleDeleteClick(); + }, + }, + ], + }} + trigger={["click"]} + > + + , + ] + : []} + +
- + {t("workflow.detail.orchestration.tab")}, icon: ( @@ -250,8 +248,8 @@ const WorkflowDetail = () => { ), }, { - key: "runs", - label: t("workflow.detail.runs.tab"), + value: "runs", + label: {t("workflow.detail.runs.tab")}, icon: ( @@ -259,13 +257,16 @@ const WorkflowDetail = () => { ), }, ]} - renderTabBar={(props, DefaultTabBar) => } - tabBarStyle={{ border: "none" }} - onChange={(key) => setTabValue(key as typeof tabValue)} + size="large" + value={tabValue} + defaultValue="orchestration" + onChange={(value) => { + setTabValue(value as typeof tabValue); + }} />
- +
@@ -280,7 +281,7 @@ const WorkflowDetail = () => { }} loading={!initialized} > -
+
{t("workflow.detail.orchestration.draft.alert")}
} showIcon type="warning" /> @@ -316,14 +317,14 @@ const WorkflowDetail = () => {
- +
-
+
diff --git a/ui/src/pages/workflows/WorkflowList.tsx b/ui/src/pages/workflows/WorkflowList.tsx index 52e6aaf4..82455b94 100644 --- a/ui/src/pages/workflows/WorkflowList.tsx +++ b/ui/src/pages/workflows/WorkflowList.tsx @@ -1,7 +1,7 @@ import { useState } from "react"; import { useTranslation } from "react-i18next"; import { useNavigate, useSearchParams } from "react-router-dom"; -import { IconCirclePlus, IconCopy, IconDotsVertical, IconHierarchy3, IconPlus, IconReload, IconTrash } from "@tabler/icons-react"; +import { IconCirclePlus, IconCopy, IconDotsVertical, IconEdit, IconHierarchy3, IconPlus, IconReload, IconTrash } from "@tabler/icons-react"; import { useRequest } from "ahooks"; import { App, Button, Dropdown, Flex, Input, Segmented, Skeleton, Switch, Table, type TableProps, Typography, theme } from "antd"; import dayjs from "dayjs"; @@ -133,9 +133,21 @@ const WorkflowList = () => { + + + ), + onClick: () => { + handleRecordDetailClick(record); + }, + }, { key: "duplicate", - label: t("common.button.duplicate"), + label: t("workflow.action.duplicate.button"), icon: ( @@ -150,7 +162,7 @@ const WorkflowList = () => { }, { key: "delete", - label: t("common.button.delete"), + label: t("workflow.action.delete.button"), danger: true, icon: (