feat(ui): improve i18n
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useControllableValue } from "ahooks";
|
||||
import { Alert, Drawer } from "antd";
|
||||
import { Alert, Drawer, Typography } from "antd";
|
||||
|
||||
import Show from "@/components/Show";
|
||||
import { useTriggerElement } from "@/hooks";
|
||||
@@ -32,11 +32,28 @@ const WorkflowRunDetailDrawer = ({ data, loading, trigger, ...props }: WorkflowR
|
||||
<Drawer closable destroyOnClose open={open} loading={loading} placement="right" title={`runlog-${data?.id}`} width={640} onClose={() => setOpen(false)}>
|
||||
<Show when={!!data}>
|
||||
<Show when={data!.succeed}>
|
||||
<Alert showIcon type="success" message={t("workflow_run.props.status.succeeded")} />
|
||||
<Alert
|
||||
showIcon
|
||||
type="success"
|
||||
message={
|
||||
<>
|
||||
<Typography.Text type="success">{t("workflow_run.props.status.succeeded")}</Typography.Text>
|
||||
</>
|
||||
}
|
||||
/>
|
||||
</Show>
|
||||
|
||||
<Show when={!!data!.error}>
|
||||
<Alert showIcon type="error" message={t("workflow_run.props.status.failed")} description={data!.error} />
|
||||
<Alert
|
||||
showIcon
|
||||
type="error"
|
||||
message={
|
||||
<>
|
||||
<Typography.Text type="danger">{t("workflow_run.props.status.failed")}</Typography.Text>
|
||||
</>
|
||||
}
|
||||
description={data!.error}
|
||||
/>
|
||||
</Show>
|
||||
|
||||
<div className="mt-4 p-4 bg-black text-stone-200 rounded-md">
|
||||
|
||||
@@ -3,8 +3,8 @@ import { useTranslation } from "react-i18next";
|
||||
import { useRequest } from "ahooks";
|
||||
import { Button, Empty, notification, Space, Table, theme, Tooltip, Typography, type TableProps } from "antd";
|
||||
import {
|
||||
CheckCircleTwoTone as CheckCircleTwoToneIcon,
|
||||
CloseCircleTwoTone as CloseCircleTwoToneIcon,
|
||||
CheckCircleOutlined as CheckCircleOutlinedIcon,
|
||||
CloseCircleOutlined as CloseCircleOutlinedIcon,
|
||||
SelectOutlined as SelectOutlinedIcon,
|
||||
} from "@ant-design/icons";
|
||||
import { ClientResponseError } from "pocketbase";
|
||||
@@ -49,14 +49,14 @@ const WorkflowRuns = ({ className, style, workflowId }: WorkflowRunsProps) => {
|
||||
if (record.succeed) {
|
||||
return (
|
||||
<Space>
|
||||
<CheckCircleTwoToneIcon twoToneColor={themeToken.colorSuccess} />
|
||||
<CheckCircleOutlinedIcon style={{ color: themeToken.colorSuccess }} />
|
||||
<Typography.Text type="success">{t("workflow_run.props.status.succeeded")}</Typography.Text>
|
||||
</Space>
|
||||
);
|
||||
} else {
|
||||
<Tooltip title={record.error}>
|
||||
<Space>
|
||||
<CloseCircleTwoToneIcon twoToneColor={themeToken.colorError} />
|
||||
<CloseCircleOutlinedIcon style={{ color: themeToken.colorError }} />
|
||||
<Typography.Text type="danger">{t("workflow_run.props.status.failed")}</Typography.Text>
|
||||
</Space>
|
||||
</Tooltip>;
|
||||
|
||||
Reference in New Issue
Block a user