fix: fix typo

This commit is contained in:
Fu Diwei 2024-12-20 23:11:45 +08:00
parent 3fcea4ba2f
commit b6203e57ed
2 changed files with 10 additions and 10 deletions

View File

@ -48,7 +48,7 @@ const formSchema = z
jksKeypass: z.string().nullish(), jksKeypass: z.string().nullish(),
jksStorepass: z.string().nullish(), jksStorepass: z.string().nullish(),
preCommand: z.string().nullish(), preCommand: z.string().nullish(),
command: z.string().nullish(), postCommand: z.string().nullish(),
shell: z.union([z.literal("sh"), z.literal("cmd"), z.literal("powershell")], { shell: z.union([z.literal("sh"), z.literal("cmd"), z.literal("powershell")], {
message: t("domain.deployment.form.shell.placeholder"), message: t("domain.deployment.form.shell.placeholder"),
}), }),
@ -100,9 +100,9 @@ const DeployToLocal = ({ data }: DeployFormProps) => {
jksAlias: (data.config?.jksAlias as string) || "", jksAlias: (data.config?.jksAlias as string) || "",
jksKeypass: (data.config?.jksKeypass as string) || "", jksKeypass: (data.config?.jksKeypass as string) || "",
jksStorepass: (data.config?.jksStorepass as string) || "", jksStorepass: (data.config?.jksStorepass as string) || "",
preCommand: (data.config?.preCommand as string) || "",
command: (data.config?.command as string) || "service nginx reload",
shell: (data.config?.shell as "sh" | "cmd" | "powershell") || "sh", shell: (data.config?.shell as "sh" | "cmd" | "powershell") || "sh",
preCommand: (data.config?.preCommand as string) || "",
postCommand: (data.config?.postCommand as string) || "service nginx reload",
}, },
}); });
@ -129,7 +129,7 @@ const DeployToLocal = ({ data }: DeployFormProps) => {
case "reload_nginx": case "reload_nginx":
{ {
form.setValue("shell", "sh"); form.setValue("shell", "sh");
form.setValue("command", "sudo service nginx reload"); form.setValue("postCommand", "sudo service nginx reload");
} }
break; break;
@ -137,7 +137,7 @@ const DeployToLocal = ({ data }: DeployFormProps) => {
{ {
form.setValue("shell", "powershell"); form.setValue("shell", "powershell");
form.setValue( form.setValue(
"command", "postCommand",
`# 请将以下变量替换为实际值 `# 请将以下变量替换为实际值
$pfxPath = "<your-pfx-path>" # PFX $pfxPath = "<your-pfx-path>" # PFX
$pfxPassword = "<your-pfx-password>" # PFX $pfxPassword = "<your-pfx-password>" # PFX
@ -174,7 +174,7 @@ Remove-Item -Path "$pfxPath" -Force
{ {
form.setValue("shell", "powershell"); form.setValue("shell", "powershell");
form.setValue( form.setValue(
"command", "postCommand",
`# 请将以下变量替换为实际值 `# 请将以下变量替换为实际值
$pfxPath = "<your-pfx-path>" # PFX $pfxPath = "<your-pfx-path>" # PFX
$pfxPassword = "<your-pfx-password>" # PFX $pfxPassword = "<your-pfx-password>" # PFX
@ -432,7 +432,7 @@ Remove-Item -Path "$pfxPath" -Force
<FormField <FormField
control={form.control} control={form.control}
name="command" name="postCommand"
render={({ field }) => ( render={({ field }) => (
<FormItem> <FormItem>
<FormLabel className="flex justify-between items-center"> <FormLabel className="flex justify-between items-center">

View File

@ -47,7 +47,7 @@ const formSchema = z
jksKeypass: z.string().nullish(), jksKeypass: z.string().nullish(),
jksStorepass: z.string().nullish(), jksStorepass: z.string().nullish(),
preCommand: z.string().nullish(), preCommand: z.string().nullish(),
command: z.string().nullish(), postCommand: z.string().nullish(),
}) })
.refine((data) => (data.format === "pem" ? !!data.keyPath?.trim() : true), { .refine((data) => (data.format === "pem" ? !!data.keyPath?.trim() : true), {
message: t("domain.deployment.form.file_key_path.placeholder"), message: t("domain.deployment.form.file_key_path.placeholder"),
@ -97,7 +97,7 @@ const DeployToSSH = ({ data }: DeployFormProps) => {
jksKeypass: (data.config?.jksKeypass as string) || "", jksKeypass: (data.config?.jksKeypass as string) || "",
jksStorepass: (data.config?.jksStorepass as string) || "", jksStorepass: (data.config?.jksStorepass as string) || "",
preCommand: (data.config?.preCommand as string) || "", preCommand: (data.config?.preCommand as string) || "",
command: (data.config?.command as string) || "service nginx reload", postCommand: (data.config?.postCommand as string) || "",
}, },
}); });
@ -327,7 +327,7 @@ const DeployToSSH = ({ data }: DeployFormProps) => {
<FormField <FormField
control={form.control} control={form.control}
name="command" name="postCommand"
render={({ field }) => ( render={({ field }) => (
<FormItem> <FormItem>
<FormLabel>{t("domain.deployment.form.shell_command.label")}</FormLabel> <FormLabel>{t("domain.deployment.form.shell_command.label")}</FormLabel>