mirror of
https://github.com/usual2970/certimate.git
synced 2025-06-08 13:39:53 +00:00
Merge branch 'l123wx-local_deployment_translate'
This commit is contained in:
commit
3375839a40
File diff suppressed because one or more lines are too long
2
ui/dist/index.html
vendored
2
ui/dist/index.html
vendored
@ -5,7 +5,7 @@
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Certimate - Your Trusted SSL Automation Partner</title>
|
||||
<script type="module" crossorigin src="/assets/index-TzNEc_kS.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index--un-5Tw_.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-I--T0qY3.css">
|
||||
</head>
|
||||
<body class="bg-background">
|
||||
|
@ -9,6 +9,7 @@ import { useConfig } from "@/providers/config";
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import { useForm } from "react-hook-form";
|
||||
import { z } from "zod";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import {
|
||||
Form,
|
||||
FormControl,
|
||||
@ -32,15 +33,16 @@ const AccessLocalForm = ({
|
||||
onAfterReq: () => void;
|
||||
}) => {
|
||||
const { addAccess, updateAccess, reloadAccessGroups } = useConfig();
|
||||
const { t } = useTranslation();
|
||||
|
||||
const formSchema = z.object({
|
||||
id: z.string().optional(),
|
||||
name: z.string().min(1).max(64),
|
||||
name: z.string().min(1, 'access.form.name.not.empty').max(64, t('zod.rule.string.max', { max: 64 })),
|
||||
configType: accessFormType,
|
||||
|
||||
command: z.string().min(1).max(2048),
|
||||
certPath: z.string().min(0).max(2048),
|
||||
keyPath: z.string().min(0).max(2048),
|
||||
command: z.string().min(1, 'access.form.ssh.command.not.empty').max(2048, t('zod.rule.string.max', { max: 2048 })),
|
||||
certPath: z.string().min(0, 'access.form.ssh.cert.path.not.empty').max(2048, t('zod.rule.string.max', { max: 2048 })),
|
||||
keyPath: z.string().min(0, 'access.form.ssh.key.path.not.empty').max(2048, t('zod.rule.string.max', { max: 2048 })),
|
||||
});
|
||||
|
||||
let config: LocalConfig = {
|
||||
@ -54,7 +56,7 @@ const AccessLocalForm = ({
|
||||
resolver: zodResolver(formSchema),
|
||||
defaultValues: {
|
||||
id: data?.id,
|
||||
name: data?.name,
|
||||
name: data?.name || '',
|
||||
configType: "local",
|
||||
certPath: config.certPath,
|
||||
keyPath: config.keyPath,
|
||||
@ -123,9 +125,9 @@ const AccessLocalForm = ({
|
||||
name="name"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>名称</FormLabel>
|
||||
<FormLabel>{t('name')}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="请输入授权名称" {...field} />
|
||||
<Input placeholder={t('access.form.name.not.empty')} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -138,7 +140,7 @@ const AccessLocalForm = ({
|
||||
name="id"
|
||||
render={({ field }) => (
|
||||
<FormItem className="hidden">
|
||||
<FormLabel>配置类型</FormLabel>
|
||||
<FormLabel>{t('access.form.config.field')}</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
@ -153,7 +155,7 @@ const AccessLocalForm = ({
|
||||
name="configType"
|
||||
render={({ field }) => (
|
||||
<FormItem className="hidden">
|
||||
<FormLabel>配置类型</FormLabel>
|
||||
<FormLabel>{t('access.form.config.field')}</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
@ -168,9 +170,9 @@ const AccessLocalForm = ({
|
||||
name="certPath"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>证书保存路径</FormLabel>
|
||||
<FormLabel>{t('access.form.ssh.cert.path')}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="请输入证书上传路径" {...field} />
|
||||
<Input placeholder={t('access.form.ssh.cert.path.not.empty')} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -183,9 +185,9 @@ const AccessLocalForm = ({
|
||||
name="keyPath"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>私钥保存路径</FormLabel>
|
||||
<FormLabel>{t('access.form.ssh.key.path')}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="请输入私钥上传路径" {...field} />
|
||||
<Input placeholder={t('access.form.ssh.key.path.not.empty')} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -198,9 +200,9 @@ const AccessLocalForm = ({
|
||||
name="command"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Command</FormLabel>
|
||||
<FormLabel>{t('access.form.ssh.command')}</FormLabel>
|
||||
<FormControl>
|
||||
<Textarea placeholder="请输入要执行的命令" {...field} />
|
||||
<Textarea placeholder={t('access.form.ssh.command.not.empty')} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -211,7 +213,7 @@ const AccessLocalForm = ({
|
||||
<FormMessage />
|
||||
|
||||
<div className="flex justify-end">
|
||||
<Button type="submit">保存</Button>
|
||||
<Button type="submit">{t('save')}</Button>
|
||||
</div>
|
||||
</form>
|
||||
</Form>
|
||||
|
@ -81,7 +81,7 @@ const AccessSSHForm = ({
|
||||
key: z.string().min(0, 'access.form.ssh.key.not.empty').max(20480, t('zod.rule.string.max', { max: 20480 })),
|
||||
keyFile: z.any().optional(),
|
||||
|
||||
preCommand: z.string().min(0).max(2048).optional(),
|
||||
preCommand: z.string().min(0).max(2048, t('zod.rule.string.max', { max: 2048 })).optional(),
|
||||
command: z.string().min(1, 'access.form.ssh.command.not.empty').max(2048, t('zod.rule.string.max', { max: 2048 })),
|
||||
certPath: z.string().min(0, 'access.form.ssh.cert.path.not.empty').max(2048, t('zod.rule.string.max', { max: 2048 })),
|
||||
keyPath: z.string().min(0, 'access.form.ssh.key.path.not.empty').max(2048, t('zod.rule.string.max', { max: 2048 })),
|
||||
@ -122,7 +122,6 @@ const AccessSSHForm = ({
|
||||
});
|
||||
|
||||
const onSubmit = async (data: z.infer<typeof formSchema>) => {
|
||||
console.log(data);
|
||||
let group = data.group;
|
||||
if (group == "emptyId") group = "";
|
||||
|
||||
@ -480,9 +479,9 @@ const AccessSSHForm = ({
|
||||
name="preCommand"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>前置 Command</FormLabel>
|
||||
<FormLabel>{t('access.form.ssh.pre.command')}</FormLabel>
|
||||
<FormControl>
|
||||
<Textarea placeholder="请输入要在部署证书前执行的前置命令" {...field} />
|
||||
<Textarea placeholder={t('access.form.ssh.pre.command.not.empty')} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
|
@ -9,7 +9,7 @@ export const accessTypeMap: Map<string, [string, string]> = new Map([
|
||||
["qiniu", ["qiniu", "/imgs/providers/qiniu.svg"]],
|
||||
["ssh", ["ssh", "/imgs/providers/ssh.svg"]],
|
||||
["webhook", ["webhook", "/imgs/providers/webhook.svg"]],
|
||||
["local", ["local", "/imgs/providers/local.svg"]],
|
||||
["local", ["local.deployment", "/imgs/providers/local.svg"]],
|
||||
]);
|
||||
|
||||
export const getProviderInfo = (t: string) => {
|
||||
|
@ -47,7 +47,7 @@ export const targetTypeMap: Map<string, [string, string]> = new Map([
|
||||
["ssh", ["ssh", "/imgs/providers/ssh.svg"]],
|
||||
["qiniu-cdn", ["qiniu.cdn", "/imgs/providers/qiniu.svg"]],
|
||||
["webhook", ["webhook", "/imgs/providers/webhook.svg"]],
|
||||
["local", ["local", "/imgs/providers/local.svg"]],
|
||||
["local", ["local.deployment", "/imgs/providers/local.svg"]],
|
||||
]);
|
||||
|
||||
export const targetTypeKeys = Array.from(targetTypeMap.keys());
|
||||
|
@ -1 +1 @@
|
||||
export const version = "Certimate v0.1.12";
|
||||
export const version = "Certimate v0.1.14";
|
||||
|
@ -42,7 +42,7 @@
|
||||
"ding.talk": "Ding Talk",
|
||||
"telegram": "Telegram",
|
||||
"webhook": "Webhook",
|
||||
"local": "Local Deployment",
|
||||
"local.deployment": "Local Deployment",
|
||||
"tencent": "Tencent",
|
||||
"tencent.cdn": "Tencent-CDN",
|
||||
"aliyun": "Alibaba Cloud",
|
||||
@ -200,10 +200,12 @@
|
||||
"access.form.ssh.key": "Key (Log in using certificate)",
|
||||
"access.form.ssh.key.not.empty": "Please enter Key",
|
||||
"access.form.ssh.key.file.not.empty": "Please select file",
|
||||
"access.form.ssh.cert.path": "Certificate Upload Path",
|
||||
"access.form.ssh.cert.path.not.empty": "Please enter certificate upload path",
|
||||
"access.form.ssh.key.path": "Private Key Upload Path",
|
||||
"access.form.ssh.key.path.not.empty": "Please enter private key upload path",
|
||||
"access.form.ssh.cert.path": "Certificate Save Path",
|
||||
"access.form.ssh.cert.path.not.empty": "Please enter certificate save path",
|
||||
"access.form.ssh.key.path": "Private Key Save Path",
|
||||
"access.form.ssh.key.path.not.empty": "Please enter private key save path",
|
||||
"access.form.ssh.pre.command": "Pre-deployment Command",
|
||||
"access.form.ssh.pre.command.not.empty": "Command to be executed before deploying the certificate",
|
||||
"access.form.ssh.command": "Command",
|
||||
"access.form.ssh.command.not.empty": "Please enter command",
|
||||
"access.form.ding.access.token.placeholder": "Signature for signed addition"
|
||||
|
@ -42,7 +42,7 @@
|
||||
"ding.talk": "钉钉",
|
||||
"telegram": "Telegram",
|
||||
"webhook": "Webhook",
|
||||
"local": "本地部署",
|
||||
"local.deployment": "本地部署",
|
||||
"tencent": "腾讯云",
|
||||
"tencent.cdn": "腾讯云-CDN",
|
||||
"aliyun": "阿里云",
|
||||
@ -200,10 +200,12 @@
|
||||
"access.form.ssh.key": "Key(使用证书登录)",
|
||||
"access.form.ssh.key.not.empty": "请输入 Key",
|
||||
"access.form.ssh.key.file.not.empty": "请选择文件",
|
||||
"access.form.ssh.cert.path": "证书上传路径",
|
||||
"access.form.ssh.cert.path.not.empty": "请输入证书上传路径",
|
||||
"access.form.ssh.key.path": "私钥上传路径",
|
||||
"access.form.ssh.key.path.not.empty": "请输入私钥上传路径",
|
||||
"access.form.ssh.cert.path": "证书保存路径",
|
||||
"access.form.ssh.cert.path.not.empty": "请输入证书保存路径",
|
||||
"access.form.ssh.key.path": "私钥保存路径",
|
||||
"access.form.ssh.key.path.not.empty": "请输入私钥保存路径",
|
||||
"access.form.ssh.pre.command": "前置 Command",
|
||||
"access.form.ssh.pre.command.not.empty": "在部署证书前执行的前置命令",
|
||||
"access.form.ssh.command": "Command",
|
||||
"access.form.ssh.command.not.empty": "请输入要执行的命令",
|
||||
"access.form.ding.access.token.placeholder": "加签的签名"
|
||||
|
Loading…
x
Reference in New Issue
Block a user