mirror of
https://github.com/usual2970/certimate.git
synced 2025-10-05 14:04:54 +00:00
feat: support 1panel v2
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Form, type FormInstance, Input, Switch } from "antd";
|
||||
import { Form, type FormInstance, Input, Select, Switch } from "antd";
|
||||
import { createSchemaFieldRule } from "antd-zod";
|
||||
import { z } from "zod";
|
||||
|
||||
@@ -18,6 +18,7 @@ export type AccessForm1PanelConfigProps = {
|
||||
const initFormModel = (): AccessForm1PanelConfigFieldValues => {
|
||||
return {
|
||||
apiUrl: "http://<your-host-addr>:20410/",
|
||||
apiVersion: "v1",
|
||||
apiKey: "",
|
||||
};
|
||||
};
|
||||
@@ -27,6 +28,7 @@ const AccessForm1PanelConfig = ({ form: formInst, formName, disabled, initialVal
|
||||
|
||||
const formSchema = z.object({
|
||||
apiUrl: z.string().url(t("common.errmsg.url_invalid")),
|
||||
apiVersion: z.string().nonempty(t("access.form.1panel_api_version.placeholder")),
|
||||
apiKey: z
|
||||
.string()
|
||||
.min(1, t("access.form.1panel_api_key.placeholder"))
|
||||
@@ -53,6 +55,10 @@ const AccessForm1PanelConfig = ({ form: formInst, formName, disabled, initialVal
|
||||
<Input placeholder={t("access.form.1panel_api_url.placeholder")} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item name="apiVersion" label={t("access.form.1panel_api_version.label")} rules={[formRule]}>
|
||||
<Select options={["v1", "v2"].map((s) => ({ label: s, value: s }))} placeholder={t("access.form.1panel_api_version.placeholder")} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
name="apiKey"
|
||||
label={t("access.form.1panel_api_key.label")}
|
||||
|
@@ -69,6 +69,7 @@ export interface AccessModel extends BaseModel {
|
||||
// #region AccessConfig
|
||||
export type AccessConfigFor1Panel = {
|
||||
apiUrl: string;
|
||||
apiVersion: string;
|
||||
apiKey: string;
|
||||
allowInsecureConnections?: boolean;
|
||||
};
|
||||
|
@@ -36,6 +36,8 @@
|
||||
"access.form.notification_channel.placeholder": "Please select a notification channel",
|
||||
"access.form.1panel_api_url.label": "1Panel URL",
|
||||
"access.form.1panel_api_url.placeholder": "Please enter 1Panel URL",
|
||||
"access.form.1panel_api_version.label": "1Panel version",
|
||||
"access.form.1panel_api_version.placeholder": "Please select 1Panel version",
|
||||
"access.form.1panel_api_key.label": "1Panel API key",
|
||||
"access.form.1panel_api_key.placeholder": "Please enter 1Panel API key",
|
||||
"access.form.1panel_api_key.tooltip": "For more information, see <a href=\"https://docs.1panel.pro/dev_manual/api_manual/\" target=\"_blank\">https://docs.1panel.pro/dev_manual/api_manual/</a>",
|
||||
@@ -262,8 +264,8 @@
|
||||
"access.form.namesilo_api_key.label": "NameSilo API key",
|
||||
"access.form.namesilo_api_key.placeholder": "Please enter NameSilo API key",
|
||||
"access.form.namesilo_api_key.tooltip": "For more information, see <a href=\"https://www.namesilo.com/support/v2/articles/account-options/api-manager\" target=\"_blank\">https://www.namesilo.com/support/v2/articles/account-options/api-manager</a>",
|
||||
"access.form.netlify_api_token.label": "netlify API token",
|
||||
"access.form.netlify_api_token.placeholder": "Please enter netlify API token",
|
||||
"access.form.netlify_api_token.label": "Netlify API token",
|
||||
"access.form.netlify_api_token.placeholder": "Please enter Netlify API token",
|
||||
"access.form.netlify_api_token.tooltip": "For more information, see <a href=\"https://docs.netlify.com/api/get-started/#authentication\" target=\"_blank\">https://docs.netlify.com/api/get-started/#authentication</a>",
|
||||
"access.form.netcup_customer_number.label": "netcup customer number",
|
||||
"access.form.netcup_customer_number.placeholder": "Please enter netcup customer number",
|
||||
|
@@ -91,8 +91,8 @@
|
||||
"provider.namedotcom": "Name.com",
|
||||
"provider.namesilo": "NameSilo",
|
||||
"provider.netcup": "netcup",
|
||||
"provider.netlify": "netlify",
|
||||
"provider.netlify.site": "netlify - Site",
|
||||
"provider.netlify": "Netlify",
|
||||
"provider.netlify.site": "Netlify - Site",
|
||||
"provider.ns1": "NS1 (IBM NS1 Connect)",
|
||||
"provider.porkbun": "Porkbun",
|
||||
"provider.powerdns": "PowerDNS",
|
||||
|
@@ -489,8 +489,8 @@
|
||||
"workflow_node.deploy.form.local_preset_scripts.option.ps_binding_iis.label": "PowerShell - Binding IIS",
|
||||
"workflow_node.deploy.form.local_preset_scripts.option.ps_binding_netsh.label": "PowerShell - Binding netsh",
|
||||
"workflow_node.deploy.form.local_preset_scripts.option.ps_.label": "PowerShell - Binding RDP",
|
||||
"workflow_node.deploy.form.netlify_site_id.label": "netlify site ID",
|
||||
"workflow_node.deploy.form.netlify_site_id.placeholder": "Please enter netlify site ID",
|
||||
"workflow_node.deploy.form.netlify_site_id.label": "Netlify site ID",
|
||||
"workflow_node.deploy.form.netlify_site_id.placeholder": "Please enter Netlify site ID",
|
||||
"workflow_node.deploy.form.netlify_site_id.tooltip": "For more information, see <a href=\"https://docs.netlify.com/api/get-started/#get-site\" target=\"_blank\">https://docs.netlify.com/api/get-started/#get-site</a>",
|
||||
"workflow_node.deploy.form.proxmoxve_node_name.label": "Proxmox VE cluster node name",
|
||||
"workflow_node.deploy.form.proxmoxve_node_name.placeholder": "Please enter Proxmox VE cluster node name",
|
||||
|
@@ -36,6 +36,8 @@
|
||||
"access.form.notification_channel.placeholder": "请选择通知渠道",
|
||||
"access.form.1panel_api_url.label": "1Panel URL",
|
||||
"access.form.1panel_api_url.placeholder": "请输入 1Panel URL",
|
||||
"access.form.1panel_api_version.label": "1Panel 版本",
|
||||
"access.form.1panel_api_version.placeholder": "请选择 1Panel 版本",
|
||||
"access.form.1panel_api_key.label": "1Panel 接口密钥",
|
||||
"access.form.1panel_api_key.placeholder": "请输入 1Panel 接口密钥",
|
||||
"access.form.1panel_api_key.tooltip": "这是什么?请参阅 <a href=\"https://1panel.cn/docs/dev_manual/api_manual/\" target=\"_blank\">https://1panel.cn/docs/dev_manual/api_manual/</a>",
|
||||
@@ -256,8 +258,8 @@
|
||||
"access.form.namesilo_api_key.label": "NameSilo API Key",
|
||||
"access.form.namesilo_api_key.placeholder": "请输入 NameSilo API Key",
|
||||
"access.form.namesilo_api_key.tooltip": "这是什么?请参阅 <a href=\"https://www.namesilo.com/support/v2/articles/account-options/api-manager\" target=\"_blank\">https://www.namesilo.com/support/v2/articles/account-options/api-manager</a>",
|
||||
"access.form.netlify_api_token.label": "netlify API Token",
|
||||
"access.form.netlify_api_token.placeholder": "请输入 netlify API Token",
|
||||
"access.form.netlify_api_token.label": "Netlify API Token",
|
||||
"access.form.netlify_api_token.placeholder": "请输入 Netlify API Token",
|
||||
"access.form.netlify_api_token.tooltip": "这是什么?请参阅 <a href=\"https://docs.netlify.com/api/get-started/#authentication\" target=\"_blank\">https://docs.netlify.com/api/get-started/#authentication</a>",
|
||||
"access.form.netcup_customer_number.label": "netcup 客户编号",
|
||||
"access.form.netcup_customer_number.placeholder": "请输入 netcup 客户编号",
|
||||
|
@@ -91,8 +91,8 @@
|
||||
"provider.namedotcom": "Name.com",
|
||||
"provider.namesilo": "NameSilo",
|
||||
"provider.netcup": "netcup",
|
||||
"provider.netlify": "netlify",
|
||||
"provider.netlify.site": "netlify - Site",
|
||||
"provider.netlify": "Netlify",
|
||||
"provider.netlify.site": "Netlify - Site",
|
||||
"provider.ns1": "NS1 (IBM NS1 Connect)",
|
||||
"provider.porkbun": "Porkbun",
|
||||
"provider.powerdns": "PowerDNS",
|
||||
|
@@ -488,7 +488,7 @@
|
||||
"workflow_node.deploy.form.local_preset_scripts.option.ps_binding_iis.label": "PowerShell - 导入并绑定到 IIS",
|
||||
"workflow_node.deploy.form.local_preset_scripts.option.ps_binding_netsh.label": "PowerShell - 导入并绑定到 netsh",
|
||||
"workflow_node.deploy.form.local_preset_scripts.option.ps_binding_rdp.label": "PowerShell - 导入并绑定到 RDP",
|
||||
"workflow_node.deploy.form.netlify_site_id.label": "netlify 网站 ID",
|
||||
"workflow_node.deploy.form.netlify_site_id.label": "Netlify 网站 ID",
|
||||
"workflow_node.deploy.form.netlify_site_id.placeholder": "请输入 netlify 网站 ID",
|
||||
"workflow_node.deploy.form.netlify_site_id.tooltip": "这是什么?请参阅 <a href=\"https://docs.netlify.com/api/get-started/#get-site\" target=\"_blank\">https://docs.netlify.com/api/get-started/#get-site</a>",
|
||||
"workflow_node.deploy.form.proxmoxve_node_name.label": "Proxmox VE 集群节点名称",
|
||||
|
Reference in New Issue
Block a user