feat: add jdcloud live video deployer

This commit is contained in:
Fu Diwei
2025-02-20 10:13:02 +08:00
parent 5139198691
commit 22d971db4b
16 changed files with 247 additions and 10 deletions

View File

@@ -14,7 +14,7 @@ export type VersionProps = {
const Version = ({ className, style }: VersionProps) => {
const { t } = useTranslation();
const { data: hasNewVersions } = useVersionChecker();
const { hasNewVersion } = useVersionChecker();
return (
<Space className={className} style={style} size={4}>
@@ -27,7 +27,7 @@ const Version = ({ className, style }: VersionProps) => {
<Divider type="vertical" />
<Badge styles={{ indicator: { transform: "scale(0.75) translate(50%, -50%)" } }} count={hasNewVersions ? "NEW" : 0}>
<Badge styles={{ indicator: { transform: "scale(0.75) translate(50%, -50%)" } }} count={hasNewVersion ? "NEW" : undefined}>
<Typography.Link type="secondary" href="https://github.com/usual2970/certimate/releases" target="_blank">
{version}
</Typography.Link>

View File

@@ -39,6 +39,7 @@ import DeployNodeConfigFormHuaweiCloudCDNConfig from "./DeployNodeConfigFormHuaw
import DeployNodeConfigFormHuaweiCloudELBConfig from "./DeployNodeConfigFormHuaweiCloudELBConfig";
import DeployNodeConfigFormHuaweiCloudWAFConfig from "./DeployNodeConfigFormHuaweiCloudWAFConfig";
import DeployNodeConfigFormJDCloudCDNConfig from "./DeployNodeConfigFormJDCloudCDNConfig";
import DeployNodeConfigFormJDCloudLiveConfig from "./DeployNodeConfigFormJDCloudLiveConfig";
import DeployNodeConfigFormKubernetesSecretConfig from "./DeployNodeConfigFormKubernetesSecretConfig";
import DeployNodeConfigFormLocalConfig from "./DeployNodeConfigFormLocalConfig";
import DeployNodeConfigFormQiniuCDNConfig from "./DeployNodeConfigFormQiniuCDNConfig";
@@ -181,6 +182,8 @@ const DeployNodeConfigForm = forwardRef<DeployNodeConfigFormInstance, DeployNode
return <DeployNodeConfigFormHuaweiCloudWAFConfig {...nestedFormProps} />;
case DEPLOY_PROVIDERS.JDCLOUD_CDN:
return <DeployNodeConfigFormJDCloudCDNConfig {...nestedFormProps} />;
case DEPLOY_PROVIDERS.JDCLOUD_LIVE:
return <DeployNodeConfigFormJDCloudLiveConfig {...nestedFormProps} />;
case DEPLOY_PROVIDERS.KUBERNETES_SECRET:
return <DeployNodeConfigFormKubernetesSecretConfig {...nestedFormProps} />;
case DEPLOY_PROVIDERS.LOCAL:

View File

@@ -0,0 +1,65 @@
import { useTranslation } from "react-i18next";
import { Form, type FormInstance, Input } from "antd";
import { createSchemaFieldRule } from "antd-zod";
import { z } from "zod";
import { validDomainName } from "@/utils/validators";
type DeployNodeConfigFormJDCloudLiveConfigFieldValues = Nullish<{
domain: string;
}>;
export type DeployNodeConfigFormJDCloudLiveConfigProps = {
form: FormInstance;
formName: string;
disabled?: boolean;
initialValues?: DeployNodeConfigFormJDCloudLiveConfigFieldValues;
onValuesChange?: (values: DeployNodeConfigFormJDCloudLiveConfigFieldValues) => void;
};
const initFormModel = (): DeployNodeConfigFormJDCloudLiveConfigFieldValues => {
return {};
};
const DeployNodeConfigFormJDCloudLiveConfig = ({
form: formInst,
formName,
disabled,
initialValues,
onValuesChange,
}: DeployNodeConfigFormJDCloudLiveConfigProps) => {
const { t } = useTranslation();
const formSchema = z.object({
domain: z
.string({ message: t("workflow_node.deploy.form.jdcloud_live_domain.placeholder") })
.refine((v) => validDomainName(v), t("common.errmsg.domain_invalid")),
});
const formRule = createSchemaFieldRule(formSchema);
const handleFormChange = (_: unknown, values: z.infer<typeof formSchema>) => {
onValuesChange?.(values);
};
return (
<Form
form={formInst}
disabled={disabled}
initialValues={initialValues ?? initFormModel()}
layout="vertical"
name={formName}
onValuesChange={handleFormChange}
>
<Form.Item
name="domain"
label={t("workflow_node.deploy.form.jdcloud_live_domain.label")}
rules={[formRule]}
tooltip={<span dangerouslySetInnerHTML={{ __html: t("workflow_node.deploy.form.jdcloud_live_domain.tooltip") }}></span>}
>
<Input placeholder={t("workflow_node.deploy.form.jdcloud_live_domain.placeholder")} />
</Form.Item>
</Form>
);
};
export default DeployNodeConfigFormJDCloudLiveConfig;

View File

@@ -222,6 +222,7 @@ export const DEPLOY_PROVIDERS = Object.freeze({
HUAWEICLOUD_ELB: `${ACCESS_PROVIDERS.HUAWEICLOUD}-elb`,
HUAWEICLOUD_WAF: `${ACCESS_PROVIDERS.HUAWEICLOUD}-waf`,
JDCLOUD_CDN: `${ACCESS_PROVIDERS.JDCLOUD}-cdn`,
JDCLOUD_LIVE: `${ACCESS_PROVIDERS.JDCLOUD}-live`,
KUBERNETES_SECRET: `${ACCESS_PROVIDERS.KUBERNETES}-secret`,
LOCAL: `${ACCESS_PROVIDERS.LOCAL}`,
QINIU_CDN: `${ACCESS_PROVIDERS.QINIU}-cdn`,
@@ -309,6 +310,7 @@ export const deployProvidersMap: Map<DeployProvider["type"] | string, DeployProv
[DEPLOY_PROVIDERS.VOLCENGINE_IMAGEX, "provider.volcengine.imagex", DEPLOY_CATEGORIES.STORAGE],
[DEPLOY_PROVIDERS.VOLCENGINE_LIVE, "provider.volcengine.live", DEPLOY_CATEGORIES.LIVE],
[DEPLOY_PROVIDERS.JDCLOUD_CDN, "provider.jdcloud.cdn", DEPLOY_CATEGORIES.CDN],
[DEPLOY_PROVIDERS.JDCLOUD_LIVE, "provider.jdcloud.live", DEPLOY_CATEGORIES.LIVE],
[DEPLOY_PROVIDERS.QINIU_CDN, "provider.qiniu.cdn", DEPLOY_CATEGORIES.CDN],
[DEPLOY_PROVIDERS.QINIU_PILI, "provider.qiniu.pili", DEPLOY_CATEGORIES.LIVE],
[DEPLOY_PROVIDERS.BAISHAN_CDN, "provider.baishan.cdn", DEPLOY_CATEGORIES.CDN],

View File

@@ -3,7 +3,7 @@
import { version } from "@/domain/version";
export type UseVersionCheckerReturns = {
data: boolean;
hasNewVersion: boolean;
check: () => void;
};
@@ -62,7 +62,7 @@ const useVersionChecker = () => {
);
return {
data: !!data,
hasNewVersion: !!data,
check: refresh,
};
};

View File

@@ -56,6 +56,7 @@
"provider.jdcloud": "JD Cloud",
"provider.jdcloud.cdn": "JD Cloud - CDN (Content Delivery Network)",
"provider.jdcloud.dns": "JD Cloud - DNS",
"provider.jdcloud.live": "JD Cloud - Live Video",
"provider.kubernetes": "Kubernetes",
"provider.kubernetes.secret": "Kubernetes - Secret",
"provider.local": "Local deployment",

View File

@@ -270,6 +270,9 @@
"workflow_node.deploy.form.jdcloud_cdn_domain.label": "JD Cloud CDN domain",
"workflow_node.deploy.form.jdcloud_cdn_domain.placeholder": "Please enter JD Cloud CDN domain name",
"workflow_node.deploy.form.jdcloud_cdn_domain.tooltip": "For more information, see <a href=\"https://cdn-console.jdcloud.com/\" target=\"_blank\">https://cdn-console.jdcloud.com/</a>",
"workflow_node.deploy.form.jdcloud_live_domain.label": "JD Cloud Live Video play domain",
"workflow_node.deploy.form.jdcloud_live_domain.placeholder": "Please enter JD Cloud Live Video play domain name",
"workflow_node.deploy.form.jdcloud_live_domain.tooltip": "For more information, see <a href=\"https://docs.jdcloud.com/en/live-video/domain-management\" target=\"_blank\">https://docs.jdcloud.com/en/live-video/domain-management</a>",
"workflow_node.deploy.form.k8s_namespace.label": "Kubernetes Namespace",
"workflow_node.deploy.form.k8s_namespace.placeholder": "Please enter Kubernetes Namespace",
"workflow_node.deploy.form.k8s_namespace.tooltip": "For more information, see <a href=\"https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/\" target=\"_blank\">https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/</a>",
@@ -401,8 +404,8 @@
"workflow_node.deploy.form.tencentcloud_cos_domain.label": "Tencent Cloud COS domain",
"workflow_node.deploy.form.tencentcloud_cos_domain.placeholder": "Please enter Tencent Cloud COS domain name",
"workflow_node.deploy.form.tencentcloud_cos_domain.tooltip": "For more information, see <a href=\"https://console.tencentcloud.com/cos\" target=\"_blank\">https://console.tencentcloud.com/cos</a>",
"workflow_node.deploy.form.tencentcloud_css_domain.label": "Tencent Cloud CSS playing domain",
"workflow_node.deploy.form.tencentcloud_css_domain.placeholder": "Please enter Tencent Cloud CSS playing domain name",
"workflow_node.deploy.form.tencentcloud_css_domain.label": "Tencent Cloud CSS play domain",
"workflow_node.deploy.form.tencentcloud_css_domain.placeholder": "Please enter Tencent Cloud CSS play domain name",
"workflow_node.deploy.form.tencentcloud_css_domain.tooltip": "For more information, see <a href=\"https://console.cloud.tencent.com/live/livestat\" target=\"_blank\">https://console.cloud.tencent.com/live/livestat</a>",
"workflow_node.deploy.form.tencentcloud_ecdn_domain.label": "Tencent Cloud ECDN domain",
"workflow_node.deploy.form.tencentcloud_ecdn_domain.placeholder": "Please enter Tencent Cloud ECDN domain name",

View File

@@ -56,6 +56,7 @@
"provider.jdcloud": "京东云",
"provider.jdcloud.cdn": "京东云 - 内容分发网络 CDN",
"provider.jdcloud.dns": "京东云 - 云解析 DNS",
"provider.jdcloud.live": "京东云 - 视频直播",
"provider.kubernetes": "Kubernetes",
"provider.kubernetes.secret": "Kubernetes - Secret",
"provider.local": "本地部署",

View File

@@ -270,6 +270,9 @@
"workflow_node.deploy.form.jdcloud_cdn_domain.label": "京东云 CDN 加速域名",
"workflow_node.deploy.form.jdcloud_cdn_domain.placeholder": "请输入京东云 CDN 加速域名(支持泛域名)",
"workflow_node.deploy.form.jdcloud_cdn_domain.tooltip": "这是什么?请参阅 <a href=\"https://cdn-console.jdcloud.com/\" target=\"_blank\">https://cdn-console.jdcloud.com/</a>",
"workflow_node.deploy.form.jdcloud_live_domain.label": "京东云视频直播播放域名",
"workflow_node.deploy.form.jdcloud_live_domain.placeholder": "请输入京东云视频直播播放域名",
"workflow_node.deploy.form.jdcloud_live_domain.tooltip": "这是什么?请参阅 <a href=\"https://docs.jdcloud.com/cn/live-video/domain-management\" target=\"_blank\">https://docs.jdcloud.com/cn/live-video/domain-management</a>",
"workflow_node.deploy.form.k8s_namespace.label": "Kubernetes 命名空间",
"workflow_node.deploy.form.k8s_namespace.placeholder": "请输入 Kubernetes 命名空间",
"workflow_node.deploy.form.k8s_namespace.tooltip": "这是什么?请参阅 <a href=\"https://kubernetes.io/zh-cn/docs/concepts/overview/working-with-objects/namespaces/\" target=\"_blank\">https://kubernetes.io/zh-cn/docs/concepts/overview/working-with-objects/namespaces/</a>",