feat(ui): improve i18n

This commit is contained in:
Fu Diwei 2025-01-01 14:22:23 +08:00
parent 7bd0cbce10
commit 5c1854948c
6 changed files with 100 additions and 27 deletions

View File

@ -220,21 +220,41 @@ Remove-Item -Path "$pfxPath" -Force
</Show>
<Show when={fieldFormat === FORMAT_PFX}>
<Form.Item name="pfxPassword" label={t("workflow_node.deploy.form.local_pfx_password.label")} rules={[formRule]}>
<Form.Item
name="pfxPassword"
label={t("workflow_node.deploy.form.local_pfx_password.label")}
rules={[formRule]}
tooltip={<span dangerouslySetInnerHTML={{ __html: t("workflow_node.deploy.form.local_pfx_password.tooltip") }}></span>}
>
<Input placeholder={t("workflow_node.deploy.form.local_pfx_password.placeholder")} />
</Form.Item>
</Show>
<Show when={fieldFormat === FORMAT_JKS}>
<Form.Item name="jksAlias" label={t("workflow_node.deploy.form.local_jks_alias.label")} rules={[formRule]}>
<Form.Item
name="jksAlias"
label={t("workflow_node.deploy.form.local_jks_alias.label")}
rules={[formRule]}
tooltip={<span dangerouslySetInnerHTML={{ __html: t("workflow_node.deploy.form.local_jks_alias.tooltip") }}></span>}
>
<Input placeholder={t("workflow_node.deploy.form.local_jks_alias.placeholder")} />
</Form.Item>
<Form.Item name="jksKeypass" label={t("workflow_node.deploy.form.local_jks_keypass.label")} rules={[formRule]}>
<Form.Item
name="jksKeypass"
label={t("workflow_node.deploy.form.local_jks_keypass.label")}
rules={[formRule]}
tooltip={<span dangerouslySetInnerHTML={{ __html: t("workflow_node.deploy.form.local_jks_keypass.tooltip") }}></span>}
>
<Input placeholder={t("workflow_node.deploy.form.local_jks_keypass.placeholder")} />
</Form.Item>
<Form.Item name="jksStorepass" label={t("workflow_node.deploy.form.local_jks_storepass.label")} rules={[formRule]}>
<Form.Item
name="jksStorepass"
label={t("workflow_node.deploy.form.local_jks_storepass.label")}
rules={[formRule]}
tooltip={<span dangerouslySetInnerHTML={{ __html: t("workflow_node.deploy.form.local_jks_storepass.tooltip") }}></span>}
>
<Input placeholder={t("workflow_node.deploy.form.local_jks_storepass.placeholder")} />
</Form.Item>
</Show>

View File

@ -146,21 +146,41 @@ const DeployNodeFormSSHFields = () => {
</Show>
<Show when={fieldFormat === FORMAT_PFX}>
<Form.Item name="pfxPassword" label={t("workflow_node.deploy.form.ssh_pfx_password.label")} rules={[formRule]}>
<Form.Item
name="pfxPassword"
label={t("workflow_node.deploy.form.ssh_pfx_password.label")}
rules={[formRule]}
tooltip={<span dangerouslySetInnerHTML={{ __html: t("workflow_node.deploy.form.ssh_pfx_password.tooltip") }}></span>}
>
<Input placeholder={t("workflow_node.deploy.form.ssh_pfx_password.placeholder")} />
</Form.Item>
</Show>
<Show when={fieldFormat === FORMAT_JKS}>
<Form.Item name="jksAlias" label={t("workflow_node.deploy.form.ssh_jks_alias.label")} rules={[formRule]}>
<Form.Item
name="jksAlias"
label={t("workflow_node.deploy.form.ssh_jks_alias.label")}
rules={[formRule]}
tooltip={<span dangerouslySetInnerHTML={{ __html: t("workflow_node.deploy.form.ssh_jks_alias.tooltip") }}></span>}
>
<Input placeholder={t("workflow_node.deploy.form.ssh_jks_alias.placeholder")} />
</Form.Item>
<Form.Item name="jksKeypass" label={t("workflow_node.deploy.form.ssh_jks_keypass.label")} rules={[formRule]}>
<Form.Item
name="jksKeypass"
label={t("workflow_node.deploy.form.ssh_jks_keypass.label")}
rules={[formRule]}
tooltip={<span dangerouslySetInnerHTML={{ __html: t("workflow_node.deploy.form.ssh_jks_keypass.tooltip") }}></span>}
>
<Input placeholder={t("workflow_node.deploy.form.ssh_jks_keypass.placeholder")} />
</Form.Item>
<Form.Item name="jksStorepass" label={t("workflow_node.deploy.form.ssh_jks_storepass.label")} rules={[formRule]}>
<Form.Item
name="jksStorepass"
label={t("workflow_node.deploy.form.ssh_jks_storepass.label")}
rules={[formRule]}
tooltip={<span dangerouslySetInnerHTML={{ __html: t("workflow_node.deploy.form.ssh_jks_storepass.tooltip") }}></span>}
>
<Input placeholder={t("workflow_node.deploy.form.ssh_jks_storepass.placeholder")} />
</Form.Item>
</Show>

View File

@ -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">

View File

@ -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>;

View File

@ -162,12 +162,16 @@
"workflow_node.deploy.form.local_key_path.tooltip": "Note that the path should include the complete file name, not just the directory.",
"workflow_node.deploy.form.local_pfx_password.label": "PFX password",
"workflow_node.deploy.form.local_pfx_password.placeholder": "Please enter PFX password",
"workflow_node.deploy.form.local_jks_alias.label": "JKS alias (KeyStore Alias)",
"workflow_node.deploy.form.local_pfx_password.tooltip": "For more information, see <a href=\"https://learn.microsoft.com/en-us/windows-hardware/drivers/install/personal-information-exchange---pfx--files\" target=\"_blank\">https://learn.microsoft.com/en-us/windows-hardware/drivers/install/personal-information-exchange---pfx--files</a>",
"workflow_node.deploy.form.local_jks_alias.label": "JKS alias",
"workflow_node.deploy.form.local_jks_alias.placeholder": "Please enter JKS alias",
"workflow_node.deploy.form.local_jks_keypass.label": "JKS key password (KeyStore Keypass)",
"workflow_node.deploy.form.local_jks_alias.tooltip": "For more information, see <a href=\"https://docs.oracle.com/cd/E19509-01/820-3503/ggfen/index.html\" target=\"_blank\">https://docs.oracle.com/cd/E19509-01/820-3503/ggfen/index.html</a>",
"workflow_node.deploy.form.local_jks_keypass.label": "JKS key password",
"workflow_node.deploy.form.local_jks_keypass.placeholder": "Please enter JKS key password",
"workflow_node.deploy.form.local_jks_storepass.label": "JKS store password (KeyStore Storepass)",
"workflow_node.deploy.form.local_jks_keypass.tooltip": "For more information, see <a href=\"https://docs.oracle.com/cd/E19509-01/820-3503/ggfen/index.html\" target=\"_blank\">https://docs.oracle.com/cd/E19509-01/820-3503/ggfen/index.html</a>",
"workflow_node.deploy.form.local_jks_storepass.label": "JKS store password",
"workflow_node.deploy.form.local_jks_storepass.placeholder": "Please enter JKS store password",
"workflow_node.deploy.form.local_jks_storepass.tooltip": "For more information, see <a href=\"https://docs.oracle.com/cd/E19509-01/820-3503/ggfen/index.html\" target=\"_blank\">https://docs.oracle.com/cd/E19509-01/820-3503/ggfen/index.html</a>",
"workflow_node.deploy.form.local_shell_env.label": "Shell",
"workflow_node.deploy.form.local_shell_env.placeholder": "Please select shell environment",
"workflow_node.deploy.form.local_shell_env.option.sh.label": "POSIX Bash (on Linux / macOS)",
@ -197,12 +201,16 @@
"workflow_node.deploy.form.ssh_key_path.tooltip": "Note that the path should include the complete file name, not just the directory.",
"workflow_node.deploy.form.ssh_pfx_password.label": "PFX password",
"workflow_node.deploy.form.ssh_pfx_password.placeholder": "Please enter PFX password",
"workflow_node.deploy.form.ssh_jks_alias.label": "JKS alias (KeyStore Alias)",
"workflow_node.deploy.form.ssh_pfx_password.tooltip": "For more information, see <a href=\"https://learn.microsoft.com/en-us/windows-hardware/drivers/install/personal-information-exchange---pfx--files\" target=\"_blank\">https://learn.microsoft.com/en-us/windows-hardware/drivers/install/personal-information-exchange---pfx--files</a>",
"workflow_node.deploy.form.ssh_jks_alias.label": "JKS alias",
"workflow_node.deploy.form.ssh_jks_alias.placeholder": "Please enter JKS alias",
"workflow_node.deploy.form.ssh_jks_keypass.label": "JKS key password (KeyStore Keypass)",
"workflow_node.deploy.form.ssh_jks_alias.tooltip": "For more information, see <a href=\"https://docs.oracle.com/cd/E19509-01/820-3503/ggfen/index.html\" target=\"_blank\">https://docs.oracle.com/cd/E19509-01/820-3503/ggfen/index.html</a>",
"workflow_node.deploy.form.ssh_jks_keypass.label": "JKS key password",
"workflow_node.deploy.form.ssh_jks_keypass.placeholder": "Please enter JKS key password",
"workflow_node.deploy.form.ssh_jks_storepass.label": "JKS store password (KeyStore Storepass)",
"workflow_node.deploy.form.ssh_jks_keypass.tooltip": "For more information, see <a href=\"https://docs.oracle.com/cd/E19509-01/820-3503/ggfen/index.html\" target=\"_blank\">https://docs.oracle.com/cd/E19509-01/820-3503/ggfen/index.html</a>",
"workflow_node.deploy.form.ssh_jks_storepass.label": "JKS store password",
"workflow_node.deploy.form.ssh_jks_storepass.placeholder": "Please enter JKS store password",
"workflow_node.deploy.form.ssh_jks_storepass.tooltip": "For more information, see <a href=\"https://docs.oracle.com/cd/E19509-01/820-3503/ggfen/index.html\" target=\"_blank\">https://docs.oracle.com/cd/E19509-01/820-3503/ggfen/index.html</a>",
"workflow_node.deploy.form.ssh_shell_env.label": "Shell",
"workflow_node.deploy.form.ssh_shell_env.value": "POSIX Bash (on Linux / macOS)",
"workflow_node.deploy.form.ssh_pre_command.label": "Pre-command",

View File

@ -162,12 +162,16 @@
"workflow_node.deploy.form.local_key_path.tooltip": "注意,路径需包含完整的文件名,而不是仅目录。",
"workflow_node.deploy.form.local_pfx_password.label": "PFX 导出密码",
"workflow_node.deploy.form.local_pfx_password.placeholder": "请输入 PFX 导出密码",
"workflow_node.deploy.form.local_jks_alias.label": "JKS 别名KeyStore Alias",
"workflow_node.deploy.form.local_pfx_password.tooltip": "这是什么?请参阅 <a href=\"https://learn.microsoft.com/zh-cn/windows-hardware/drivers/install/personal-information-exchange---pfx--files\" target=\"_blank\">https://learn.microsoft.com/zh-cn/windows-hardware/drivers/install/personal-information-exchange---pfx--files</a>",
"workflow_node.deploy.form.local_jks_alias.label": "JKS 别名",
"workflow_node.deploy.form.local_jks_alias.placeholder": "请输入 JKS 别名",
"workflow_node.deploy.form.local_jks_keypass.label": "JKS 私钥访问口令KeyStore Keypass",
"workflow_node.deploy.form.local_jks_alias.tooltip": "这是什么?请参阅 <a href=\"https://docs.oracle.com/cd/E19509-01/820-3503/ggfen/index.html\" target=\"_blank\">https://docs.oracle.com/cd/E19509-01/820-3503/ggfen/index.html</a>",
"workflow_node.deploy.form.local_jks_keypass.label": "JKS 私钥访问口令",
"workflow_node.deploy.form.local_jks_keypass.placeholder": "请输入 JKS 私钥访问口令",
"workflow_node.deploy.form.local_jks_storepass.label": "JKS 密钥库存储口令KeyStore Storepass",
"workflow_node.deploy.form.local_jks_keypass.tooltip": "这是什么?请参阅 <a href=\"https://docs.oracle.com/cd/E19509-01/820-3503/ggfen/index.html\" target=\"_blank\">https://docs.oracle.com/cd/E19509-01/820-3503/ggfen/index.html</a>",
"workflow_node.deploy.form.local_jks_storepass.label": "JKS 密钥库存储口令",
"workflow_node.deploy.form.local_jks_storepass.placeholder": "请输入 JKS 密钥库存储口令",
"workflow_node.deploy.form.local_jks_storepass.tooltip": "这是什么?请参阅 <a href=\"https://docs.oracle.com/cd/E19509-01/820-3503/ggfen/index.html\" target=\"_blank\">https://docs.oracle.com/cd/E19509-01/820-3503/ggfen/index.html</a>",
"workflow_node.deploy.form.local_shell_env.label": "命令执行环境",
"workflow_node.deploy.form.local_shell_env.placeholder": "请选择命令执行环境",
"workflow_node.deploy.form.local_shell_env.option.sh.label": "POSIX BashLinux / macOS",
@ -197,12 +201,16 @@
"workflow_node.deploy.form.ssh_key_path.tooltip": "注意,路径需包含完整的文件名,而不是仅目录。",
"workflow_node.deploy.form.ssh_pfx_password.label": "PFX 导出密码",
"workflow_node.deploy.form.ssh_pfx_password.placeholder": "请输入 PFX 导出密码",
"workflow_node.deploy.form.ssh_jks_alias.label": "JKS 别名KeyStore Alias",
"workflow_node.deploy.form.ssh_pfx_password.tooltip": "这是什么?请参阅 <a href=\"https://learn.microsoft.com/zh-cn/windows-hardware/drivers/install/personal-information-exchange---pfx--files\" target=\"_blank\">https://learn.microsoft.com/zh-cn/windows-hardware/drivers/install/personal-information-exchange---pfx--files</a>",
"workflow_node.deploy.form.ssh_jks_alias.label": "JKS 别名",
"workflow_node.deploy.form.ssh_jks_alias.placeholder": "请输入 JKS 别名",
"workflow_node.deploy.form.ssh_jks_keypass.label": "JKS 私钥访问口令KeyStore Keypass",
"workflow_node.deploy.form.ssh_jks_alias.tooltip": "这是什么?请参阅 <a href=\"https://docs.oracle.com/cd/E19509-01/820-3503/ggfen/index.html\" target=\"_blank\">https://docs.oracle.com/cd/E19509-01/820-3503/ggfen/index.html</a>",
"workflow_node.deploy.form.ssh_jks_keypass.label": "JKS 私钥访问口令",
"workflow_node.deploy.form.ssh_jks_keypass.placeholder": "请输入 JKS 私钥访问口令",
"workflow_node.deploy.form.ssh_jks_storepass.label": "JKS 密钥库存储口令KeyStore Storepass",
"workflow_node.deploy.form.ssh_jks_keypass.tooltip": "这是什么?请参阅 <a href=\"https://docs.oracle.com/cd/E19509-01/820-3503/ggfen/index.html\" target=\"_blank\">https://docs.oracle.com/cd/E19509-01/820-3503/ggfen/index.html</a>",
"workflow_node.deploy.form.ssh_jks_storepass.label": "JKS 密钥库存储口令",
"workflow_node.deploy.form.ssh_jks_storepass.placeholder": "请输入 JKS 密钥库存储口令",
"workflow_node.deploy.form.ssh_jks_storepass.tooltip": "这是什么?请参阅 <a href=\"https://docs.oracle.com/cd/E19509-01/820-3503/ggfen/index.html\" target=\"_blank\">https://docs.oracle.com/cd/E19509-01/820-3503/ggfen/index.html</a>",
"workflow_node.deploy.form.ssh_shell_env.label": "命令执行环境",
"workflow_node.deploy.form.ssh_shell_env.value": "POSIX BashLinux / macOS",
"workflow_node.deploy.form.ssh_pre_command.label": "前置命令",