mirror of
https://github.com/usual2970/certimate.git
synced 2025-06-08 05:29:51 +00:00
feat: normalize provider names
This commit is contained in:
parent
70e6920288
commit
047b3bc079
@ -26,17 +26,23 @@ import (
|
||||
"github.com/pocketbase/pocketbase/models"
|
||||
)
|
||||
|
||||
/*
|
||||
提供商类型常量值。
|
||||
|
||||
注意:如果追加新的枚举值,请保持以 ASCII 排序。
|
||||
NOTICE: If you add new enum, please keep ASCII order.
|
||||
*/
|
||||
const (
|
||||
configTypeAliyun = "aliyun"
|
||||
configTypeTencent = "tencent"
|
||||
configTypeHuaweiCloud = "huaweicloud"
|
||||
configTypeAws = "aws"
|
||||
configTypeCloudflare = "cloudflare"
|
||||
configTypeNamesilo = "namesilo"
|
||||
configTypeGodaddy = "godaddy"
|
||||
configTypePdns = "pdns"
|
||||
configTypeHttpreq = "httpreq"
|
||||
configTypeVolcengine = "volcengine"
|
||||
configTypeACMEHttpReq = "acmehttpreq"
|
||||
configTypeAliyun = "aliyun"
|
||||
configTypeAWS = "aws"
|
||||
configTypeCloudflare = "cloudflare"
|
||||
configTypeGoDaddy = "godaddy"
|
||||
configTypeHuaweiCloud = "huaweicloud"
|
||||
configTypeNamesilo = "namesilo"
|
||||
configTypePowerDNS = "powerdns"
|
||||
configTypeTencentCloud = "tencentcloud"
|
||||
configTypeVolcEngine = "volcengine"
|
||||
)
|
||||
|
||||
const defaultSSLProvider = "letsencrypt"
|
||||
@ -205,23 +211,23 @@ func GetWithTypeOption(t string, option *ApplyOption) (Applicant, error) {
|
||||
switch t {
|
||||
case configTypeAliyun:
|
||||
return NewAliyun(option), nil
|
||||
case configTypeTencent:
|
||||
case configTypeTencentCloud:
|
||||
return NewTencent(option), nil
|
||||
case configTypeHuaweiCloud:
|
||||
return NewHuaweiCloud(option), nil
|
||||
case configTypeAws:
|
||||
case configTypeAWS:
|
||||
return NewAws(option), nil
|
||||
case configTypeCloudflare:
|
||||
return NewCloudflare(option), nil
|
||||
case configTypeNamesilo:
|
||||
return NewNamesilo(option), nil
|
||||
case configTypeGodaddy:
|
||||
case configTypeGoDaddy:
|
||||
return NewGodaddy(option), nil
|
||||
case configTypePdns:
|
||||
case configTypePowerDNS:
|
||||
return NewPdns(option), nil
|
||||
case configTypeHttpreq:
|
||||
case configTypeACMEHttpReq:
|
||||
return NewHttpreq(option), nil
|
||||
case configTypeVolcengine:
|
||||
case configTypeVolcEngine:
|
||||
return NewVolcengine(option), nil
|
||||
default:
|
||||
return nil, errors.New("unknown config type")
|
||||
|
@ -13,30 +13,36 @@ import (
|
||||
"github.com/usual2970/certimate/internal/repository"
|
||||
)
|
||||
|
||||
/*
|
||||
提供商部署目标常量值。
|
||||
|
||||
注意:如果追加新的枚举值,请保持以 ASCII 排序。
|
||||
NOTICE: If you add new enum, please keep ASCII order.
|
||||
*/
|
||||
const (
|
||||
targetAliyunOSS = "aliyun-oss"
|
||||
targetAliyunCDN = "aliyun-cdn"
|
||||
targetAliyunDCDN = "aliyun-dcdn"
|
||||
targetAliyunCLB = "aliyun-clb"
|
||||
targetAliyunALB = "aliyun-alb"
|
||||
targetAliyunNLB = "aliyun-nlb"
|
||||
targetTencentCDN = "tencent-cdn"
|
||||
targetTencentECDN = "tencent-ecdn"
|
||||
targetTencentCLB = "tencent-clb"
|
||||
targetTencentCOS = "tencent-cos"
|
||||
targetTencentTEO = "tencent-teo"
|
||||
targetHuaweiCloudCDN = "huaweicloud-cdn"
|
||||
targetHuaweiCloudELB = "huaweicloud-elb"
|
||||
targetBaiduCloudCDN = "baiducloud-cdn"
|
||||
targetVolcEngineLive = "volcengine-live"
|
||||
targetVolcEngineCDN = "volcengine-cdn"
|
||||
targetBytePlusCDN = "byteplus-cdn"
|
||||
targetQiniuCdn = "qiniu-cdn"
|
||||
targetDogeCloudCdn = "dogecloud-cdn"
|
||||
targetLocal = "local"
|
||||
targetSSH = "ssh"
|
||||
targetWebhook = "webhook"
|
||||
targetK8sSecret = "k8s-secret"
|
||||
targetAliyunALB = "aliyun-alb"
|
||||
targetAliyunCDN = "aliyun-cdn"
|
||||
targetAliyunCLB = "aliyun-clb"
|
||||
targetAliyunDCDN = "aliyun-dcdn"
|
||||
targetAliyunNLB = "aliyun-nlb"
|
||||
targetAliyunOSS = "aliyun-oss"
|
||||
targetBaiduCloudCDN = "baiducloud-cdn"
|
||||
targetBytePlusCDN = "byteplus-cdn"
|
||||
targetDogeCloudCDN = "dogecloud-cdn"
|
||||
targetHuaweiCloudCDN = "huaweicloud-cdn"
|
||||
targetHuaweiCloudELB = "huaweicloud-elb"
|
||||
targetK8sSecret = "k8s-secret"
|
||||
targetLocal = "local"
|
||||
targetQiniuCDN = "qiniu-cdn"
|
||||
targetSSH = "ssh"
|
||||
targetTencentCloudCDN = "tencentcloud-cdn"
|
||||
targetTencentCloudCLB = "tencentcloud-clb"
|
||||
targetTencentCloudCOS = "tencentcloud-cos"
|
||||
targetTencentCloudECDN = "tencentcloud-ecdn"
|
||||
targetTencentCloudEO = "tencentcloud-eo"
|
||||
targetVolcEngineCDN = "volcengine-cdn"
|
||||
targetVolcEngineLive = "volcengine-live"
|
||||
targetWebhook = "webhook"
|
||||
)
|
||||
|
||||
type DeployerOption struct {
|
||||
@ -128,15 +134,15 @@ func getWithTypeAndOption(deployType string, option *DeployerOption) (Deployer,
|
||||
return NewAliyunALBDeployer(option)
|
||||
case targetAliyunNLB:
|
||||
return NewAliyunNLBDeployer(option)
|
||||
case targetTencentCDN:
|
||||
case targetTencentCloudCDN:
|
||||
return NewTencentCDNDeployer(option)
|
||||
case targetTencentECDN:
|
||||
case targetTencentCloudECDN:
|
||||
return NewTencentECDNDeployer(option)
|
||||
case targetTencentCLB:
|
||||
case targetTencentCloudCLB:
|
||||
return NewTencentCLBDeployer(option)
|
||||
case targetTencentCOS:
|
||||
case targetTencentCloudCOS:
|
||||
return NewTencentCOSDeployer(option)
|
||||
case targetTencentTEO:
|
||||
case targetTencentCloudEO:
|
||||
return NewTencentTEODeployer(option)
|
||||
case targetHuaweiCloudCDN:
|
||||
return NewHuaweiCloudCDNDeployer(option)
|
||||
@ -144,9 +150,9 @@ func getWithTypeAndOption(deployType string, option *DeployerOption) (Deployer,
|
||||
return NewHuaweiCloudELBDeployer(option)
|
||||
case targetBaiduCloudCDN:
|
||||
return NewBaiduCloudCDNDeployer(option)
|
||||
case targetQiniuCdn:
|
||||
case targetQiniuCDN:
|
||||
return NewQiniuCDNDeployer(option)
|
||||
case targetDogeCloudCdn:
|
||||
case targetDogeCloudCDN:
|
||||
return NewDogeCloudCDNDeployer(option)
|
||||
case targetLocal:
|
||||
return NewLocalDeployer(option)
|
||||
|
@ -7,27 +7,27 @@ import (
|
||||
|
||||
"github.com/usual2970/certimate/internal/domain"
|
||||
"github.com/usual2970/certimate/internal/pkg/core/deployer"
|
||||
providerAliyunAlb "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/aliyun-alb"
|
||||
providerAliyunCdn "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/aliyun-cdn"
|
||||
providerAliyunClb "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/aliyun-clb"
|
||||
providerAliyunDcdn "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/aliyun-dcdn"
|
||||
providerAliyunNlb "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/aliyun-nlb"
|
||||
providerAliyunOss "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/aliyun-oss"
|
||||
providerBaiduCloudCdn "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/baiducloud-cdn"
|
||||
providerBytePlusCdn "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/byteplus-cdn"
|
||||
providerDogeCdn "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/dogecloud-cdn"
|
||||
providerHuaweiCloudCdn "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/huaweicloud-cdn"
|
||||
providerHuaweiCloudElb "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/huaweicloud-elb"
|
||||
providerAliyunALB "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/aliyun-alb"
|
||||
providerAliyunCDN "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/aliyun-cdn"
|
||||
providerAliyunCLB "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/aliyun-clb"
|
||||
providerAliyunDCDN "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/aliyun-dcdn"
|
||||
providerAliyunNLB "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/aliyun-nlb"
|
||||
providerAliyunOSS "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/aliyun-oss"
|
||||
providerBaiduCloudCDN "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/baiducloud-cdn"
|
||||
providerBytePlusCDN "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/byteplus-cdn"
|
||||
providerDogeCDN "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/dogecloud-cdn"
|
||||
providerHuaweiCloudCDN "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/huaweicloud-cdn"
|
||||
providerHuaweiCloudELB "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/huaweicloud-elb"
|
||||
providerK8sSecret "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/k8s-secret"
|
||||
providerLocal "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/local"
|
||||
providerQiniuCdn "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/qiniu-cdn"
|
||||
providerQiniuCDN "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/qiniu-cdn"
|
||||
providerSSH "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/ssh"
|
||||
providerTencentCloudCdn "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/tencentcloud-cdn"
|
||||
providerTencentCloudClb "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/tencentcloud-clb"
|
||||
providerTencentCloudCos "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/tencentcloud-cos"
|
||||
providerTencentCloudEcdn "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/tencentcloud-ecdn"
|
||||
providerTencentCloudTeo "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/tencentcloud-teo"
|
||||
providerVolcEngineCdn "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/volcengine-cdn"
|
||||
providerTencentCloudCDN "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/tencentcloud-cdn"
|
||||
providerTencentCloudCLB "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/tencentcloud-clb"
|
||||
providerTencentCloudCOD "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/tencentcloud-cos"
|
||||
providerTencentCloudECDN "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/tencentcloud-ecdn"
|
||||
providerTencentCloudEO "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/tencentcloud-eo"
|
||||
providerVolcEngineCDN "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/volcengine-cdn"
|
||||
providerVolcEngineLive "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/volcengine-live"
|
||||
providerWebhook "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/webhook"
|
||||
"github.com/usual2970/certimate/internal/pkg/utils/maps"
|
||||
@ -47,18 +47,18 @@ func createDeployer(target string, accessConfig string, deployConfig map[string]
|
||||
|
||||
switch target {
|
||||
case targetAliyunALB:
|
||||
deployer, err := providerAliyunAlb.NewWithLogger(&providerAliyunAlb.AliyunALBDeployerConfig{
|
||||
deployer, err := providerAliyunALB.NewWithLogger(&providerAliyunALB.AliyunALBDeployerConfig{
|
||||
AccessKeyId: access.AccessKeyId,
|
||||
AccessKeySecret: access.AccessKeySecret,
|
||||
Region: maps.GetValueAsString(deployConfig, "region"),
|
||||
ResourceType: providerAliyunAlb.DeployResourceType(maps.GetValueAsString(deployConfig, "resourceType")),
|
||||
ResourceType: providerAliyunALB.DeployResourceType(maps.GetValueAsString(deployConfig, "resourceType")),
|
||||
LoadbalancerId: maps.GetValueAsString(deployConfig, "loadbalancerId"),
|
||||
ListenerId: maps.GetValueAsString(deployConfig, "listenerId"),
|
||||
}, logger)
|
||||
return deployer, logger, err
|
||||
|
||||
case targetAliyunCDN:
|
||||
deployer, err := providerAliyunCdn.NewWithLogger(&providerAliyunCdn.AliyunCDNDeployerConfig{
|
||||
deployer, err := providerAliyunCDN.NewWithLogger(&providerAliyunCDN.AliyunCDNDeployerConfig{
|
||||
AccessKeyId: access.AccessKeyId,
|
||||
AccessKeySecret: access.AccessKeySecret,
|
||||
Domain: maps.GetValueAsString(deployConfig, "domain"),
|
||||
@ -66,18 +66,18 @@ func createDeployer(target string, accessConfig string, deployConfig map[string]
|
||||
return deployer, logger, err
|
||||
|
||||
case targetAliyunCLB:
|
||||
deployer, err := providerAliyunClb.NewWithLogger(&providerAliyunClb.AliyunCLBDeployerConfig{
|
||||
deployer, err := providerAliyunCLB.NewWithLogger(&providerAliyunCLB.AliyunCLBDeployerConfig{
|
||||
AccessKeyId: access.AccessKeyId,
|
||||
AccessKeySecret: access.AccessKeySecret,
|
||||
Region: maps.GetValueAsString(deployConfig, "region"),
|
||||
ResourceType: providerAliyunClb.DeployResourceType(maps.GetValueAsString(deployConfig, "resourceType")),
|
||||
ResourceType: providerAliyunCLB.DeployResourceType(maps.GetValueAsString(deployConfig, "resourceType")),
|
||||
LoadbalancerId: maps.GetValueAsString(deployConfig, "loadbalancerId"),
|
||||
ListenerPort: maps.GetValueAsInt32(deployConfig, "listenerPort"),
|
||||
}, logger)
|
||||
return deployer, logger, err
|
||||
|
||||
case targetAliyunDCDN:
|
||||
deployer, err := providerAliyunDcdn.NewWithLogger(&providerAliyunDcdn.AliyunDCDNDeployerConfig{
|
||||
deployer, err := providerAliyunDCDN.NewWithLogger(&providerAliyunDCDN.AliyunDCDNDeployerConfig{
|
||||
AccessKeyId: access.AccessKeyId,
|
||||
AccessKeySecret: access.AccessKeySecret,
|
||||
Domain: maps.GetValueAsString(deployConfig, "domain"),
|
||||
@ -85,18 +85,18 @@ func createDeployer(target string, accessConfig string, deployConfig map[string]
|
||||
return deployer, logger, err
|
||||
|
||||
case targetAliyunNLB:
|
||||
deployer, err := providerAliyunNlb.NewWithLogger(&providerAliyunNlb.AliyunNLBDeployerConfig{
|
||||
deployer, err := providerAliyunNLB.NewWithLogger(&providerAliyunNLB.AliyunNLBDeployerConfig{
|
||||
AccessKeyId: access.AccessKeyId,
|
||||
AccessKeySecret: access.AccessKeySecret,
|
||||
Region: maps.GetValueAsString(deployConfig, "region"),
|
||||
ResourceType: providerAliyunNlb.DeployResourceType(maps.GetValueAsString(deployConfig, "resourceType")),
|
||||
ResourceType: providerAliyunNLB.DeployResourceType(maps.GetValueAsString(deployConfig, "resourceType")),
|
||||
LoadbalancerId: maps.GetValueAsString(deployConfig, "loadbalancerId"),
|
||||
ListenerId: maps.GetValueAsString(deployConfig, "listenerId"),
|
||||
}, logger)
|
||||
return deployer, logger, err
|
||||
|
||||
case targetAliyunOSS:
|
||||
deployer, err := providerAliyunOss.NewWithLogger(&providerAliyunOss.AliyunOSSDeployerConfig{
|
||||
deployer, err := providerAliyunOSS.NewWithLogger(&providerAliyunOSS.AliyunOSSDeployerConfig{
|
||||
AccessKeyId: access.AccessKeyId,
|
||||
AccessKeySecret: access.AccessKeySecret,
|
||||
Region: maps.GetValueAsString(deployConfig, "region"),
|
||||
@ -117,7 +117,7 @@ func createDeployer(target string, accessConfig string, deployConfig map[string]
|
||||
return nil, nil, fmt.Errorf("failed to unmarshal access config: %w", err)
|
||||
}
|
||||
|
||||
deployer, err := providerBaiduCloudCdn.NewWithLogger(&providerBaiduCloudCdn.BaiduCloudCDNDeployerConfig{
|
||||
deployer, err := providerBaiduCloudCDN.NewWithLogger(&providerBaiduCloudCDN.BaiduCloudCDNDeployerConfig{
|
||||
AccessKeyId: access.AccessKeyId,
|
||||
SecretAccessKey: access.SecretAccessKey,
|
||||
Domain: maps.GetValueAsString(deployConfig, "domain"),
|
||||
@ -132,7 +132,7 @@ func createDeployer(target string, accessConfig string, deployConfig map[string]
|
||||
return nil, nil, fmt.Errorf("failed to unmarshal access config: %w", err)
|
||||
}
|
||||
|
||||
deployer, err := providerBytePlusCdn.NewWithLogger(&providerBytePlusCdn.BytePlusCDNDeployerConfig{
|
||||
deployer, err := providerBytePlusCDN.NewWithLogger(&providerBytePlusCDN.BytePlusCDNDeployerConfig{
|
||||
AccessKey: access.AccessKey,
|
||||
SecretKey: access.SecretKey,
|
||||
Domain: maps.GetValueAsString(deployConfig, "domain"),
|
||||
@ -140,14 +140,14 @@ func createDeployer(target string, accessConfig string, deployConfig map[string]
|
||||
return deployer, logger, err
|
||||
}
|
||||
|
||||
case targetDogeCloudCdn:
|
||||
case targetDogeCloudCDN:
|
||||
{
|
||||
access := &domain.DogeCloudAccess{}
|
||||
if err := json.Unmarshal([]byte(accessConfig), access); err != nil {
|
||||
return nil, nil, fmt.Errorf("failed to unmarshal access config: %w", err)
|
||||
}
|
||||
|
||||
deployer, err := providerDogeCdn.NewWithLogger(&providerDogeCdn.DogeCloudCDNDeployerConfig{
|
||||
deployer, err := providerDogeCDN.NewWithLogger(&providerDogeCDN.DogeCloudCDNDeployerConfig{
|
||||
AccessKey: access.AccessKey,
|
||||
SecretKey: access.SecretKey,
|
||||
Domain: maps.GetValueAsString(deployConfig, "domain"),
|
||||
@ -164,7 +164,7 @@ func createDeployer(target string, accessConfig string, deployConfig map[string]
|
||||
|
||||
switch target {
|
||||
case targetHuaweiCloudCDN:
|
||||
deployer, err := providerHuaweiCloudCdn.NewWithLogger(&providerHuaweiCloudCdn.HuaweiCloudCDNDeployerConfig{
|
||||
deployer, err := providerHuaweiCloudCDN.NewWithLogger(&providerHuaweiCloudCDN.HuaweiCloudCDNDeployerConfig{
|
||||
AccessKeyId: access.AccessKeyId,
|
||||
SecretAccessKey: access.SecretAccessKey,
|
||||
Region: maps.GetValueAsString(deployConfig, "region"),
|
||||
@ -173,11 +173,11 @@ func createDeployer(target string, accessConfig string, deployConfig map[string]
|
||||
return deployer, logger, err
|
||||
|
||||
case targetHuaweiCloudELB:
|
||||
deployer, err := providerHuaweiCloudElb.NewWithLogger(&providerHuaweiCloudElb.HuaweiCloudELBDeployerConfig{
|
||||
deployer, err := providerHuaweiCloudELB.NewWithLogger(&providerHuaweiCloudELB.HuaweiCloudELBDeployerConfig{
|
||||
AccessKeyId: access.AccessKeyId,
|
||||
SecretAccessKey: access.SecretAccessKey,
|
||||
Region: maps.GetValueAsString(deployConfig, "region"),
|
||||
ResourceType: providerHuaweiCloudElb.DeployResourceType(maps.GetValueAsString(deployConfig, "resourceType")),
|
||||
ResourceType: providerHuaweiCloudELB.DeployResourceType(maps.GetValueAsString(deployConfig, "resourceType")),
|
||||
CertificateId: maps.GetValueAsString(deployConfig, "certificateId"),
|
||||
LoadbalancerId: maps.GetValueAsString(deployConfig, "loadbalancerId"),
|
||||
ListenerId: maps.GetValueAsString(deployConfig, "listenerId"),
|
||||
@ -223,14 +223,14 @@ func createDeployer(target string, accessConfig string, deployConfig map[string]
|
||||
return deployer, logger, err
|
||||
}
|
||||
|
||||
case targetQiniuCdn:
|
||||
case targetQiniuCDN:
|
||||
{
|
||||
access := &domain.QiniuAccess{}
|
||||
if err := json.Unmarshal([]byte(accessConfig), access); err != nil {
|
||||
return nil, nil, fmt.Errorf("failed to unmarshal access config: %w", err)
|
||||
}
|
||||
|
||||
deployer, err := providerQiniuCdn.NewWithLogger(&providerQiniuCdn.QiniuCDNDeployerConfig{
|
||||
deployer, err := providerQiniuCDN.NewWithLogger(&providerQiniuCDN.QiniuCDNDeployerConfig{
|
||||
AccessKey: access.AccessKey,
|
||||
SecretKey: access.SecretKey,
|
||||
Domain: maps.GetValueAsString(deployConfig, "domain"),
|
||||
@ -266,7 +266,7 @@ func createDeployer(target string, accessConfig string, deployConfig map[string]
|
||||
return deployer, logger, err
|
||||
}
|
||||
|
||||
case targetTencentCDN, targetTencentCLB, targetTencentCOS, targetTencentECDN, targetTencentTEO:
|
||||
case targetTencentCloudCDN, targetTencentCloudCLB, targetTencentCloudCOS, targetTencentCloudECDN, targetTencentCloudEO:
|
||||
{
|
||||
access := &domain.TencentAccess{}
|
||||
if err := json.Unmarshal([]byte(accessConfig), access); err != nil {
|
||||
@ -274,28 +274,28 @@ func createDeployer(target string, accessConfig string, deployConfig map[string]
|
||||
}
|
||||
|
||||
switch target {
|
||||
case targetTencentCDN:
|
||||
deployer, err := providerTencentCloudCdn.NewWithLogger(&providerTencentCloudCdn.TencentCloudCDNDeployerConfig{
|
||||
case targetTencentCloudCDN:
|
||||
deployer, err := providerTencentCloudCDN.NewWithLogger(&providerTencentCloudCDN.TencentCloudCDNDeployerConfig{
|
||||
SecretId: access.SecretId,
|
||||
SecretKey: access.SecretKey,
|
||||
Domain: maps.GetValueAsString(deployConfig, "domain"),
|
||||
}, logger)
|
||||
return deployer, logger, err
|
||||
|
||||
case targetTencentCLB:
|
||||
deployer, err := providerTencentCloudClb.NewWithLogger(&providerTencentCloudClb.TencentCloudCLBDeployerConfig{
|
||||
case targetTencentCloudCLB:
|
||||
deployer, err := providerTencentCloudCLB.NewWithLogger(&providerTencentCloudCLB.TencentCloudCLBDeployerConfig{
|
||||
SecretId: access.SecretId,
|
||||
SecretKey: access.SecretKey,
|
||||
Region: maps.GetValueAsString(deployConfig, "region"),
|
||||
ResourceType: providerTencentCloudClb.DeployResourceType(maps.GetValueAsString(deployConfig, "resourceType")),
|
||||
ResourceType: providerTencentCloudCLB.DeployResourceType(maps.GetValueAsString(deployConfig, "resourceType")),
|
||||
LoadbalancerId: maps.GetValueAsString(deployConfig, "loadbalancerId"),
|
||||
ListenerId: maps.GetValueAsString(deployConfig, "listenerId"),
|
||||
Domain: maps.GetValueAsString(deployConfig, "domain"),
|
||||
}, logger)
|
||||
return deployer, logger, err
|
||||
|
||||
case targetTencentCOS:
|
||||
deployer, err := providerTencentCloudCos.NewWithLogger(&providerTencentCloudCos.TencentCloudCOSDeployerConfig{
|
||||
case targetTencentCloudCOS:
|
||||
deployer, err := providerTencentCloudCOD.NewWithLogger(&providerTencentCloudCOD.TencentCloudCOSDeployerConfig{
|
||||
SecretId: access.SecretId,
|
||||
SecretKey: access.SecretKey,
|
||||
Region: maps.GetValueAsString(deployConfig, "region"),
|
||||
@ -304,16 +304,16 @@ func createDeployer(target string, accessConfig string, deployConfig map[string]
|
||||
}, logger)
|
||||
return deployer, logger, err
|
||||
|
||||
case targetTencentECDN:
|
||||
deployer, err := providerTencentCloudEcdn.NewWithLogger(&providerTencentCloudEcdn.TencentCloudECDNDeployerConfig{
|
||||
case targetTencentCloudECDN:
|
||||
deployer, err := providerTencentCloudECDN.NewWithLogger(&providerTencentCloudECDN.TencentCloudECDNDeployerConfig{
|
||||
SecretId: access.SecretId,
|
||||
SecretKey: access.SecretKey,
|
||||
Domain: maps.GetValueAsString(deployConfig, "domain"),
|
||||
}, logger)
|
||||
return deployer, logger, err
|
||||
|
||||
case targetTencentTEO:
|
||||
deployer, err := providerTencentCloudTeo.NewWithLogger(&providerTencentCloudTeo.TencentCloudTEODeployerConfig{
|
||||
case targetTencentCloudEO:
|
||||
deployer, err := providerTencentCloudEO.NewWithLogger(&providerTencentCloudEO.TencentCloudEODeployerConfig{
|
||||
SecretId: access.SecretId,
|
||||
SecretKey: access.SecretKey,
|
||||
ZoneId: maps.GetValueAsString(deployConfig, "zoneId"),
|
||||
@ -335,7 +335,7 @@ func createDeployer(target string, accessConfig string, deployConfig map[string]
|
||||
|
||||
switch target {
|
||||
case targetVolcEngineCDN:
|
||||
deployer, err := providerVolcEngineCdn.NewWithLogger(&providerVolcEngineCdn.VolcEngineCDNDeployerConfig{
|
||||
deployer, err := providerVolcEngineCDN.NewWithLogger(&providerVolcEngineCDN.VolcEngineCDNDeployerConfig{
|
||||
AccessKey: access.AccessKey,
|
||||
SecretKey: access.SecretKey,
|
||||
Domain: maps.GetValueAsString(deployConfig, "domain"),
|
||||
|
@ -15,7 +15,7 @@ import (
|
||||
providerSsl "github.com/usual2970/certimate/internal/pkg/core/uploader/providers/tencentcloud-ssl"
|
||||
)
|
||||
|
||||
type TencentCloudTEODeployerConfig struct {
|
||||
type TencentCloudEODeployerConfig struct {
|
||||
// 腾讯云 SecretId。
|
||||
SecretId string `json:"secretId"`
|
||||
// 腾讯云 SecretKey。
|
||||
@ -26,25 +26,25 @@ type TencentCloudTEODeployerConfig struct {
|
||||
Domain string `json:"domain"`
|
||||
}
|
||||
|
||||
type TencentCloudTEODeployer struct {
|
||||
config *TencentCloudTEODeployerConfig
|
||||
type TencentCloudEODeployer struct {
|
||||
config *TencentCloudEODeployerConfig
|
||||
logger deployer.Logger
|
||||
sdkClients *wSdkClients
|
||||
sslUploader uploader.Uploader
|
||||
}
|
||||
|
||||
var _ deployer.Deployer = (*TencentCloudTEODeployer)(nil)
|
||||
var _ deployer.Deployer = (*TencentCloudEODeployer)(nil)
|
||||
|
||||
type wSdkClients struct {
|
||||
ssl *tcSsl.Client
|
||||
teo *tcTeo.Client
|
||||
}
|
||||
|
||||
func New(config *TencentCloudTEODeployerConfig) (*TencentCloudTEODeployer, error) {
|
||||
func New(config *TencentCloudEODeployerConfig) (*TencentCloudEODeployer, error) {
|
||||
return NewWithLogger(config, deployer.NewNilLogger())
|
||||
}
|
||||
|
||||
func NewWithLogger(config *TencentCloudTEODeployerConfig, logger deployer.Logger) (*TencentCloudTEODeployer, error) {
|
||||
func NewWithLogger(config *TencentCloudEODeployerConfig, logger deployer.Logger) (*TencentCloudEODeployer, error) {
|
||||
if config == nil {
|
||||
return nil, errors.New("config is nil")
|
||||
}
|
||||
@ -66,7 +66,7 @@ func NewWithLogger(config *TencentCloudTEODeployerConfig, logger deployer.Logger
|
||||
return nil, xerrors.Wrap(err, "failed to create ssl uploader")
|
||||
}
|
||||
|
||||
return &TencentCloudTEODeployer{
|
||||
return &TencentCloudEODeployer{
|
||||
logger: logger,
|
||||
config: config,
|
||||
sdkClients: clients,
|
||||
@ -74,7 +74,7 @@ func NewWithLogger(config *TencentCloudTEODeployerConfig, logger deployer.Logger
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (d *TencentCloudTEODeployer) Deploy(ctx context.Context, certPem string, privkeyPem string) (*deployer.DeployResult, error) {
|
||||
func (d *TencentCloudEODeployer) Deploy(ctx context.Context, certPem string, privkeyPem string) (*deployer.DeployResult, error) {
|
||||
if d.config.ZoneId == "" {
|
||||
return nil, xerrors.New("config `zoneId` is required")
|
||||
}
|
@ -8,7 +8,7 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
provider "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/tencentcloud-teo"
|
||||
provider "github.com/usual2970/certimate/internal/pkg/core/deployer/providers/tencentcloud-eo"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -21,7 +21,7 @@ var (
|
||||
)
|
||||
|
||||
func init() {
|
||||
argsPrefix := "CERTIMATE_DEPLOYER_TENCENTCLOUDETEO_"
|
||||
argsPrefix := "CERTIMATE_DEPLOYER_TENCENTCLOUDEEO_"
|
||||
|
||||
flag.StringVar(&fInputCertPath, argsPrefix+"INPUTCERTPATH", "", "")
|
||||
flag.StringVar(&fInputKeyPath, argsPrefix+"INPUTKEYPATH", "", "")
|
||||
@ -35,12 +35,12 @@ func init() {
|
||||
Shell command to run this test:
|
||||
|
||||
go test -v tencentcloud_cdn_test.go -args \
|
||||
--CERTIMATE_DEPLOYER_TENCENTCLOUDETEO_INPUTCERTPATH="/path/to/your-input-cert.pem" \
|
||||
--CERTIMATE_DEPLOYER_TENCENTCLOUDETEO_INPUTKEYPATH="/path/to/your-input-key.pem" \
|
||||
--CERTIMATE_DEPLOYER_TENCENTCLOUDETEO_SECRETID="your-secret-id" \
|
||||
--CERTIMATE_DEPLOYER_TENCENTCLOUDETEO_SECRETKEY="your-secret-key" \
|
||||
--CERTIMATE_DEPLOYER_TENCENTCLOUDETEO_ZONEID="your-zone-id" \
|
||||
--CERTIMATE_DEPLOYER_TENCENTCLOUDETEO_DOMAIN="example.com"
|
||||
--CERTIMATE_DEPLOYER_TENCENTCLOUDEEO_INPUTCERTPATH="/path/to/your-input-cert.pem" \
|
||||
--CERTIMATE_DEPLOYER_TENCENTCLOUDEEO_INPUTKEYPATH="/path/to/your-input-key.pem" \
|
||||
--CERTIMATE_DEPLOYER_TENCENTCLOUDEEO_SECRETID="your-secret-id" \
|
||||
--CERTIMATE_DEPLOYER_TENCENTCLOUDEEO_SECRETKEY="your-secret-key" \
|
||||
--CERTIMATE_DEPLOYER_TENCENTCLOUDEEO_ZONEID="your-zone-id" \
|
||||
--CERTIMATE_DEPLOYER_TENCENTCLOUDEEO_DOMAIN="example.com"
|
||||
*/
|
||||
func TestDeploy(t *testing.T) {
|
||||
flag.Parse()
|
||||
@ -56,7 +56,7 @@ func TestDeploy(t *testing.T) {
|
||||
fmt.Sprintf("DOMAIN: %v", fDomain),
|
||||
}, "\n"))
|
||||
|
||||
deployer, err := provider.New(&provider.TencentCloudTEODeployerConfig{
|
||||
deployer, err := provider.New(&provider.TencentCloudEODeployerConfig{
|
||||
SecretId: fSecretId,
|
||||
SecretKey: fSecretKey,
|
||||
ZoneId: fZoneId,
|
108
migrations/1734398918_updated_access.go
Normal file
108
migrations/1734398918_updated_access.go
Normal file
@ -0,0 +1,108 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/daos"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
"github.com/pocketbase/pocketbase/models/schema"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("4yzbv8urny5ja1e")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// update
|
||||
edit_configType := &schema.SchemaField{}
|
||||
if err := json.Unmarshal([]byte(`{
|
||||
"system": false,
|
||||
"id": "hwy7m03o",
|
||||
"name": "configType",
|
||||
"type": "select",
|
||||
"required": false,
|
||||
"presentable": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"maxSelect": 1,
|
||||
"values": [
|
||||
"aliyun",
|
||||
"acmehttpreq",
|
||||
"aws",
|
||||
"baiducloud",
|
||||
"byteplus",
|
||||
"cloudflare",
|
||||
"dogecloud",
|
||||
"godaddy",
|
||||
"huaweicloud",
|
||||
"k8s",
|
||||
"local",
|
||||
"namesilo",
|
||||
"powerdns",
|
||||
"qiniu",
|
||||
"ssh",
|
||||
"tencentcloud",
|
||||
"volcengine",
|
||||
"webhook"
|
||||
]
|
||||
}
|
||||
}`), edit_configType); err != nil {
|
||||
return err
|
||||
}
|
||||
collection.Schema.AddField(edit_configType)
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
}, func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("4yzbv8urny5ja1e")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// update
|
||||
edit_configType := &schema.SchemaField{}
|
||||
if err := json.Unmarshal([]byte(`{
|
||||
"system": false,
|
||||
"id": "hwy7m03o",
|
||||
"name": "configType",
|
||||
"type": "select",
|
||||
"required": false,
|
||||
"presentable": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"maxSelect": 1,
|
||||
"values": [
|
||||
"aliyun",
|
||||
"tencent",
|
||||
"huaweicloud",
|
||||
"qiniu",
|
||||
"aws",
|
||||
"cloudflare",
|
||||
"namesilo",
|
||||
"godaddy",
|
||||
"pdns",
|
||||
"httpreq",
|
||||
"local",
|
||||
"ssh",
|
||||
"webhook",
|
||||
"k8s",
|
||||
"baiducloud",
|
||||
"dogecloud",
|
||||
"volcengine",
|
||||
"byteplus"
|
||||
]
|
||||
}
|
||||
}`), edit_configType); err != nil {
|
||||
return err
|
||||
}
|
||||
collection.Schema.AddField(edit_configType)
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
})
|
||||
}
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 858 B After Width: | Height: | Size: 858 B |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
@ -8,7 +8,7 @@ import { Button } from "@/components/ui/button";
|
||||
import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from "@/components/ui/form";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { PbErrorData } from "@/domain/base";
|
||||
import { accessProvidersMap, accessTypeFormSchema, type AccessModel, type AliyunConfig } from "@/domain/access";
|
||||
import { accessProvidersMap, accessTypeFormSchema, type AccessModel, type AliyunAccessConfig } from "@/domain/access";
|
||||
import { save } from "@/repository/access";
|
||||
import { useAccessStore } from "@/stores/access";
|
||||
|
||||
@ -27,24 +27,24 @@ const AccessAliyunForm = ({ data, op, onAfterReq }: AccessAliyunFormProps) => {
|
||||
id: z.string().optional(),
|
||||
name: z
|
||||
.string()
|
||||
.min(1, "access.authorization.form.name.placeholder")
|
||||
.min(1, "access.form.name.placeholder")
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
configType: accessTypeFormSchema,
|
||||
accessKeyId: z
|
||||
.string()
|
||||
.min(1, "access.authorization.form.access_key_id.placeholder")
|
||||
.min(1, "access.form.access_key_id.placeholder")
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
accessSecretId: z
|
||||
.string()
|
||||
.min(1, "access.authorization.form.access_key_secret.placeholder")
|
||||
.min(1, "access.form.access_key_secret.placeholder")
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
});
|
||||
|
||||
let config: AliyunConfig = {
|
||||
let config: AliyunAccessConfig = {
|
||||
accessKeyId: "",
|
||||
accessKeySecret: "",
|
||||
};
|
||||
if (data) config = data.config as AliyunConfig;
|
||||
if (data) config = data.config as AliyunAccessConfig;
|
||||
|
||||
const form = useForm<z.infer<typeof formSchema>>({
|
||||
resolver: zodResolver(formSchema),
|
||||
@ -113,9 +113,9 @@ const AccessAliyunForm = ({ data, op, onAfterReq }: AccessAliyunFormProps) => {
|
||||
name="name"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.name.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.name.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.name.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.name.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -128,7 +128,7 @@ const AccessAliyunForm = ({ data, op, onAfterReq }: AccessAliyunFormProps) => {
|
||||
name="id"
|
||||
render={({ field }) => (
|
||||
<FormItem className="hidden">
|
||||
<FormLabel>{t("access.authorization.form.config.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.config.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
@ -143,7 +143,7 @@ const AccessAliyunForm = ({ data, op, onAfterReq }: AccessAliyunFormProps) => {
|
||||
name="configType"
|
||||
render={({ field }) => (
|
||||
<FormItem className="hidden">
|
||||
<FormLabel>{t("access.authorization.form.config.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.config.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
@ -158,9 +158,9 @@ const AccessAliyunForm = ({ data, op, onAfterReq }: AccessAliyunFormProps) => {
|
||||
name="accessKeyId"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.access_key_id.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.access_key_id.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.access_key_id.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.access_key_id.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -173,9 +173,9 @@ const AccessAliyunForm = ({ data, op, onAfterReq }: AccessAliyunFormProps) => {
|
||||
name="accessSecretId"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.access_key_secret.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.access_key_secret.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.access_key_secret.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.access_key_secret.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
|
@ -8,7 +8,7 @@ import { Input } from "@/components/ui/input";
|
||||
import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from "@/components/ui/form";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { PbErrorData } from "@/domain/base";
|
||||
import { AccessModel, accessProvidersMap, accessTypeFormSchema, type AwsConfig } from "@/domain/access";
|
||||
import { AccessModel, accessProvidersMap, accessTypeFormSchema, type AWSAccessConfig } from "@/domain/access";
|
||||
import { save } from "@/repository/access";
|
||||
import { useAccessStore } from "@/stores/access";
|
||||
|
||||
@ -27,34 +27,34 @@ const AccessAwsForm = ({ data, op, onAfterReq }: AccessAwsFormProps) => {
|
||||
id: z.string().optional(),
|
||||
name: z
|
||||
.string()
|
||||
.min(1, "access.authorization.form.name.placeholder")
|
||||
.min(1, "access.form.name.placeholder")
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
configType: accessTypeFormSchema,
|
||||
region: z
|
||||
.string()
|
||||
.min(1, "access.authorization.form.region.placeholder")
|
||||
.min(1, "access.form.region.placeholder")
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
accessKeyId: z
|
||||
.string()
|
||||
.min(1, "access.authorization.form.access_key_id.placeholder")
|
||||
.min(1, "access.form.access_key_id.placeholder")
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
secretAccessKey: z
|
||||
.string()
|
||||
.min(1, "access.authorization.form.secret_access_key.placeholder")
|
||||
.min(1, "access.form.secret_access_key.placeholder")
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
hostedZoneId: z
|
||||
.string()
|
||||
.min(0, "access.authorization.form.aws_hosted_zone_id.placeholder")
|
||||
.min(0, "access.form.aws_hosted_zone_id.placeholder")
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
});
|
||||
|
||||
let config: AwsConfig = {
|
||||
let config: AWSAccessConfig = {
|
||||
region: "cn-north-1",
|
||||
accessKeyId: "",
|
||||
secretAccessKey: "",
|
||||
hostedZoneId: "",
|
||||
};
|
||||
if (data) config = data.config as AwsConfig;
|
||||
if (data) config = data.config as AWSAccessConfig;
|
||||
|
||||
const form = useForm<z.infer<typeof formSchema>>({
|
||||
resolver: zodResolver(formSchema),
|
||||
@ -127,9 +127,9 @@ const AccessAwsForm = ({ data, op, onAfterReq }: AccessAwsFormProps) => {
|
||||
name="name"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.name.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.name.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.name.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.name.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -142,7 +142,7 @@ const AccessAwsForm = ({ data, op, onAfterReq }: AccessAwsFormProps) => {
|
||||
name="id"
|
||||
render={({ field }) => (
|
||||
<FormItem className="hidden">
|
||||
<FormLabel>{t("access.authorization.form.config.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.config.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
@ -157,7 +157,7 @@ const AccessAwsForm = ({ data, op, onAfterReq }: AccessAwsFormProps) => {
|
||||
name="configType"
|
||||
render={({ field }) => (
|
||||
<FormItem className="hidden">
|
||||
<FormLabel>{t("access.authorization.form.config.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.config.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
@ -172,9 +172,9 @@ const AccessAwsForm = ({ data, op, onAfterReq }: AccessAwsFormProps) => {
|
||||
name="region"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.region.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.region.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.region.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.region.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -187,9 +187,9 @@ const AccessAwsForm = ({ data, op, onAfterReq }: AccessAwsFormProps) => {
|
||||
name="accessKeyId"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.access_key_id.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.access_key_id.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.access_key_id.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.access_key_id.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -202,9 +202,9 @@ const AccessAwsForm = ({ data, op, onAfterReq }: AccessAwsFormProps) => {
|
||||
name="secretAccessKey"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.secret_access_key.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.secret_access_key.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.secret_access_key.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.secret_access_key.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -217,9 +217,9 @@ const AccessAwsForm = ({ data, op, onAfterReq }: AccessAwsFormProps) => {
|
||||
name="hostedZoneId"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.aws_hosted_zone_id.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.aws_hosted_zone_id.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.aws_hosted_zone_id.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.aws_hosted_zone_id.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
|
@ -8,7 +8,7 @@ import { Input } from "@/components/ui/input";
|
||||
import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from "@/components/ui/form";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { PbErrorData } from "@/domain/base";
|
||||
import { accessProvidersMap, accessTypeFormSchema, type AccessModel, type BaiduCloudConfig } from "@/domain/access";
|
||||
import { accessProvidersMap, accessTypeFormSchema, type AccessModel, type BaiduCloudAccessConfig } from "@/domain/access";
|
||||
import { save } from "@/repository/access";
|
||||
import { useAccessStore } from "@/stores/access";
|
||||
|
||||
@ -27,24 +27,24 @@ const AccessBaiduCloudForm = ({ data, op, onAfterReq }: AccessBaiduCloudFormProp
|
||||
id: z.string().optional(),
|
||||
name: z
|
||||
.string()
|
||||
.min(1, "access.authorization.form.name.placeholder")
|
||||
.min(1, "access.form.name.placeholder")
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
configType: accessTypeFormSchema,
|
||||
accessKeyId: z
|
||||
.string()
|
||||
.min(1, "access.authorization.form.access_key_id.placeholder")
|
||||
.min(1, "access.form.access_key_id.placeholder")
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
secretAccessKey: z
|
||||
.string()
|
||||
.min(1, "access.authorization.form.secret_access_key.placeholder")
|
||||
.min(1, "access.form.secret_access_key.placeholder")
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
});
|
||||
|
||||
let config: BaiduCloudConfig = {
|
||||
let config: BaiduCloudAccessConfig = {
|
||||
accessKeyId: "",
|
||||
secretAccessKey: "",
|
||||
};
|
||||
if (data) config = data.config as BaiduCloudConfig;
|
||||
if (data) config = data.config as BaiduCloudAccessConfig;
|
||||
|
||||
const form = useForm<z.infer<typeof formSchema>>({
|
||||
resolver: zodResolver(formSchema),
|
||||
@ -113,9 +113,9 @@ const AccessBaiduCloudForm = ({ data, op, onAfterReq }: AccessBaiduCloudFormProp
|
||||
name="name"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.name.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.name.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.name.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.name.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -128,7 +128,7 @@ const AccessBaiduCloudForm = ({ data, op, onAfterReq }: AccessBaiduCloudFormProp
|
||||
name="id"
|
||||
render={({ field }) => (
|
||||
<FormItem className="hidden">
|
||||
<FormLabel>{t("access.authorization.form.config.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.config.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
@ -143,7 +143,7 @@ const AccessBaiduCloudForm = ({ data, op, onAfterReq }: AccessBaiduCloudFormProp
|
||||
name="configType"
|
||||
render={({ field }) => (
|
||||
<FormItem className="hidden">
|
||||
<FormLabel>{t("access.authorization.form.config.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.config.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
@ -158,9 +158,9 @@ const AccessBaiduCloudForm = ({ data, op, onAfterReq }: AccessBaiduCloudFormProp
|
||||
name="accessKeyId"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.access_key_id.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.access_key_id.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.access_key_id.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.access_key_id.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -173,9 +173,9 @@ const AccessBaiduCloudForm = ({ data, op, onAfterReq }: AccessBaiduCloudFormProp
|
||||
name="secretAccessKey"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.secret_access_key.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.secret_access_key.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.secret_access_key.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.secret_access_key.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
|
@ -8,7 +8,7 @@ import { Input } from "@/components/ui/input";
|
||||
import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from "@/components/ui/form";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { PbErrorData } from "@/domain/base";
|
||||
import { accessProvidersMap, accessTypeFormSchema, type AccessModel, type ByteplusConfig } from "@/domain/access";
|
||||
import { accessProvidersMap, accessTypeFormSchema, type AccessModel, type BytePlusAccessConfig } from "@/domain/access";
|
||||
import { save } from "@/repository/access";
|
||||
import { useAccessStore } from "@/stores/access";
|
||||
|
||||
@ -25,24 +25,24 @@ const AccessByteplusForm = ({ data, op, onAfterReq }: AccessByteplusFormProps) =
|
||||
id: z.string().optional(),
|
||||
name: z
|
||||
.string()
|
||||
.min(1, "access.authorization.form.name.placeholder")
|
||||
.min(1, "access.form.name.placeholder")
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
configType: accessTypeFormSchema,
|
||||
accessKey: z
|
||||
.string()
|
||||
.min(1, "access.authorization.form.access_key.placeholder")
|
||||
.min(1, "access.form.access_key.placeholder")
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
secretKey: z
|
||||
.string()
|
||||
.min(1, "access.authorization.form.secret_key.placeholder")
|
||||
.min(1, "access.form.secret_key.placeholder")
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
});
|
||||
|
||||
let config: ByteplusConfig = {
|
||||
let config: BytePlusAccessConfig = {
|
||||
accessKey: "",
|
||||
secretKey: "",
|
||||
};
|
||||
if (data) config = data.config as ByteplusConfig;
|
||||
if (data) config = data.config as BytePlusAccessConfig;
|
||||
|
||||
const form = useForm<z.infer<typeof formSchema>>({
|
||||
resolver: zodResolver(formSchema),
|
||||
@ -110,9 +110,9 @@ const AccessByteplusForm = ({ data, op, onAfterReq }: AccessByteplusFormProps) =
|
||||
name="name"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.name.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.name.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.name.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.name.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -125,7 +125,7 @@ const AccessByteplusForm = ({ data, op, onAfterReq }: AccessByteplusFormProps) =
|
||||
name="id"
|
||||
render={({ field }) => (
|
||||
<FormItem className="hidden">
|
||||
<FormLabel>{t("access.authorization.form.config.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.config.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
@ -140,7 +140,7 @@ const AccessByteplusForm = ({ data, op, onAfterReq }: AccessByteplusFormProps) =
|
||||
name="configType"
|
||||
render={({ field }) => (
|
||||
<FormItem className="hidden">
|
||||
<FormLabel>{t("access.authorization.form.config.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.config.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
@ -155,9 +155,9 @@ const AccessByteplusForm = ({ data, op, onAfterReq }: AccessByteplusFormProps) =
|
||||
name="accessKey"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.access_key.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.access_key.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.access_key.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.access_key.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -170,9 +170,9 @@ const AccessByteplusForm = ({ data, op, onAfterReq }: AccessByteplusFormProps) =
|
||||
name="secretKey"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.secret_key.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.secret_key.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.secret_key.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.secret_key.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
|
@ -8,7 +8,7 @@ import { Button } from "@/components/ui/button";
|
||||
import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from "@/components/ui/form";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { PbErrorData } from "@/domain/base";
|
||||
import { accessProvidersMap, accessTypeFormSchema, type AccessModel, type CloudflareConfig } from "@/domain/access";
|
||||
import { accessProvidersMap, accessTypeFormSchema, type AccessModel, type CloudflareAccessConfig } from "@/domain/access";
|
||||
import { save } from "@/repository/access";
|
||||
import { useAccessStore } from "@/stores/access";
|
||||
|
||||
@ -25,19 +25,19 @@ const AccessCloudflareForm = ({ data, op, onAfterReq }: AccessCloudflareFormProp
|
||||
id: z.string().optional(),
|
||||
name: z
|
||||
.string()
|
||||
.min(1, "access.authorization.form.name.placeholder")
|
||||
.min(1, "access.form.name.placeholder")
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
configType: accessTypeFormSchema,
|
||||
dnsApiToken: z
|
||||
.string()
|
||||
.min(1, "access.authorization.form.cloud_dns_api_token.placeholder")
|
||||
.min(1, "access.form.cloud_dns_api_token.placeholder")
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
});
|
||||
|
||||
let config: CloudflareConfig = {
|
||||
let config: CloudflareAccessConfig = {
|
||||
dnsApiToken: "",
|
||||
};
|
||||
if (data) config = data.config as CloudflareConfig;
|
||||
if (data) config = data.config as CloudflareAccessConfig;
|
||||
|
||||
const form = useForm<z.infer<typeof formSchema>>({
|
||||
resolver: zodResolver(formSchema),
|
||||
@ -101,9 +101,9 @@ const AccessCloudflareForm = ({ data, op, onAfterReq }: AccessCloudflareFormProp
|
||||
name="name"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.name.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.name.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.name.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.name.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -116,7 +116,7 @@ const AccessCloudflareForm = ({ data, op, onAfterReq }: AccessCloudflareFormProp
|
||||
name="id"
|
||||
render={({ field }) => (
|
||||
<FormItem className="hidden">
|
||||
<FormLabel>{t("access.authorization.form.config.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.config.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
@ -131,7 +131,7 @@ const AccessCloudflareForm = ({ data, op, onAfterReq }: AccessCloudflareFormProp
|
||||
name="configType"
|
||||
render={({ field }) => (
|
||||
<FormItem className="hidden">
|
||||
<FormLabel>{t("access.authorization.form.config.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.config.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
@ -146,9 +146,9 @@ const AccessCloudflareForm = ({ data, op, onAfterReq }: AccessCloudflareFormProp
|
||||
name="dnsApiToken"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.cloud_dns_api_token.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.cloud_dns_api_token.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.cloud_dns_api_token.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.cloud_dns_api_token.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
|
@ -8,7 +8,7 @@ import { Button } from "@/components/ui/button";
|
||||
import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from "@/components/ui/form";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { PbErrorData } from "@/domain/base";
|
||||
import { accessProvidersMap, accessTypeFormSchema, type AccessModel, type DogeCloudConfig } from "@/domain/access";
|
||||
import { accessProvidersMap, accessTypeFormSchema, type AccessModel, type DogeCloudAccessConfig } from "@/domain/access";
|
||||
import { save } from "@/repository/access";
|
||||
import { useAccessStore } from "@/stores/access";
|
||||
|
||||
@ -25,18 +25,18 @@ const AccessDogeCloudForm = ({ data, op, onAfterReq }: AccessDogeCloudFormProps)
|
||||
id: z.string().optional(),
|
||||
name: z
|
||||
.string()
|
||||
.min(1, "access.authorization.form.name.placeholder")
|
||||
.min(1, "access.form.name.placeholder")
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
configType: accessTypeFormSchema,
|
||||
accessKey: z.string().min(1, "access.authorization.form.access_key.placeholder").max(64),
|
||||
secretKey: z.string().min(1, "access.authorization.form.secret_key.placeholder").max(64),
|
||||
accessKey: z.string().min(1, "access.form.access_key.placeholder").max(64),
|
||||
secretKey: z.string().min(1, "access.form.secret_key.placeholder").max(64),
|
||||
});
|
||||
|
||||
let config: DogeCloudConfig = {
|
||||
let config: DogeCloudAccessConfig = {
|
||||
accessKey: "",
|
||||
secretKey: "",
|
||||
};
|
||||
if (data) config = data.config as DogeCloudConfig;
|
||||
if (data) config = data.config as DogeCloudAccessConfig;
|
||||
|
||||
const form = useForm<z.infer<typeof formSchema>>({
|
||||
resolver: zodResolver(formSchema),
|
||||
@ -104,9 +104,9 @@ const AccessDogeCloudForm = ({ data, op, onAfterReq }: AccessDogeCloudFormProps)
|
||||
name="name"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.name.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.name.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.name.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.name.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -119,7 +119,7 @@ const AccessDogeCloudForm = ({ data, op, onAfterReq }: AccessDogeCloudFormProps)
|
||||
name="id"
|
||||
render={({ field }) => (
|
||||
<FormItem className="hidden">
|
||||
<FormLabel>{t("access.authorization.form.config.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.config.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
@ -134,7 +134,7 @@ const AccessDogeCloudForm = ({ data, op, onAfterReq }: AccessDogeCloudFormProps)
|
||||
name="configType"
|
||||
render={({ field }) => (
|
||||
<FormItem className="hidden">
|
||||
<FormLabel>{t("access.authorization.form.config.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.config.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
@ -149,9 +149,9 @@ const AccessDogeCloudForm = ({ data, op, onAfterReq }: AccessDogeCloudFormProps)
|
||||
name="accessKey"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.access_key.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.access_key.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.access_key.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.access_key.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -164,9 +164,9 @@ const AccessDogeCloudForm = ({ data, op, onAfterReq }: AccessDogeCloudFormProps)
|
||||
name="secretKey"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.secret_key.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.secret_key.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.secret_key.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.secret_key.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
|
@ -5,7 +5,6 @@ import { cn } from "@/components/ui/utils";
|
||||
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { ScrollArea } from "@/components/ui/scroll-area";
|
||||
import AccessEditForm from "@/components/access/AccessEditForm";
|
||||
import AccessTypeSelect from "@/components/access/AccessTypeSelect";
|
||||
import AccessAliyunForm from "./AccessAliyunForm";
|
||||
import AccessTencentForm from "./AccessTencentForm";
|
||||
@ -61,7 +60,7 @@ const AccessEditDialog = ({ trigger, op, data, className, outConfigType }: Acces
|
||||
/>
|
||||
);
|
||||
break;
|
||||
case "tencent":
|
||||
case "tencentcloud":
|
||||
childComponent = (
|
||||
<AccessTencentForm
|
||||
data={data}
|
||||
@ -160,7 +159,7 @@ const AccessEditDialog = ({ trigger, op, data, className, outConfigType }: Acces
|
||||
/>
|
||||
);
|
||||
break;
|
||||
case "pdns":
|
||||
case "powerdns":
|
||||
childComponent = (
|
||||
<AccessPdnsForm
|
||||
data={data}
|
||||
@ -171,7 +170,7 @@ const AccessEditDialog = ({ trigger, op, data, className, outConfigType }: Acces
|
||||
/>
|
||||
);
|
||||
break;
|
||||
case "httpreq":
|
||||
case "acmehttpreq":
|
||||
childComponent = (
|
||||
<AccessHttpreqForm
|
||||
data={data}
|
||||
@ -282,13 +281,12 @@ const AccessEditDialog = ({ trigger, op, data, className, outConfigType }: Acces
|
||||
</DialogTitle>
|
||||
</DialogHeader>
|
||||
<ScrollArea className="max-h-[80vh]">
|
||||
<AccessEditForm data={data} />
|
||||
<div className="container py-3">
|
||||
<div>
|
||||
<Label>{t("access.authorization.form.type.label")}</Label>
|
||||
<Label>{t("access.form.type.label")}</Label>
|
||||
<AccessTypeSelect
|
||||
className="w-full mt-3"
|
||||
placeholder={t("access.authorization.form.type.placeholder")}
|
||||
placeholder={t("access.form.type.placeholder")}
|
||||
value={configType}
|
||||
showSearch={true}
|
||||
onChange={(val) => {
|
||||
|
@ -8,7 +8,7 @@ import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from "@/components/ui/form";
|
||||
import { PbErrorData } from "@/domain/base";
|
||||
import { accessProvidersMap, accessTypeFormSchema, type AccessModel, type GodaddyConfig } from "@/domain/access";
|
||||
import { accessProvidersMap, accessTypeFormSchema, type AccessModel, type GoDaddyAccessConfig } from "@/domain/access";
|
||||
import { save } from "@/repository/access";
|
||||
import { useAccessStore } from "@/stores/access";
|
||||
|
||||
@ -25,24 +25,24 @@ const AccessGodaddyForm = ({ data, op, onAfterReq }: AccessGodaddyFormProps) =>
|
||||
id: z.string().optional(),
|
||||
name: z
|
||||
.string()
|
||||
.min(1, "access.authorization.form.name.placeholder")
|
||||
.min(1, "access.form.name.placeholder")
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
configType: accessTypeFormSchema,
|
||||
apiKey: z
|
||||
.string()
|
||||
.min(1, "access.authorization.form.godaddy_api_key.placeholder")
|
||||
.min(1, "access.form.godaddy_api_key.placeholder")
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
apiSecret: z
|
||||
.string()
|
||||
.min(1, "access.authorization.form.godaddy_api_secret.placeholder")
|
||||
.min(1, "access.form.godaddy_api_secret.placeholder")
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
});
|
||||
|
||||
let config: GodaddyConfig = {
|
||||
let config: GoDaddyAccessConfig = {
|
||||
apiKey: "",
|
||||
apiSecret: "",
|
||||
};
|
||||
if (data) config = data.config as GodaddyConfig;
|
||||
if (data) config = data.config as GoDaddyAccessConfig;
|
||||
|
||||
const form = useForm<z.infer<typeof formSchema>>({
|
||||
resolver: zodResolver(formSchema),
|
||||
@ -108,9 +108,9 @@ const AccessGodaddyForm = ({ data, op, onAfterReq }: AccessGodaddyFormProps) =>
|
||||
name="name"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.name.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.name.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.name.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.name.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -123,7 +123,7 @@ const AccessGodaddyForm = ({ data, op, onAfterReq }: AccessGodaddyFormProps) =>
|
||||
name="id"
|
||||
render={({ field }) => (
|
||||
<FormItem className="hidden">
|
||||
<FormLabel>{t("access.authorization.form.config.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.config.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
@ -138,7 +138,7 @@ const AccessGodaddyForm = ({ data, op, onAfterReq }: AccessGodaddyFormProps) =>
|
||||
name="configType"
|
||||
render={({ field }) => (
|
||||
<FormItem className="hidden">
|
||||
<FormLabel>{t("access.authorization.form.config.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.config.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
@ -153,9 +153,9 @@ const AccessGodaddyForm = ({ data, op, onAfterReq }: AccessGodaddyFormProps) =>
|
||||
name="apiKey"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.godaddy_api_key.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.godaddy_api_key.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.godaddy_api_key.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.godaddy_api_key.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -168,9 +168,9 @@ const AccessGodaddyForm = ({ data, op, onAfterReq }: AccessGodaddyFormProps) =>
|
||||
name="apiSecret"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.godaddy_api_secret.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.godaddy_api_secret.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.godaddy_api_secret.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.godaddy_api_secret.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
|
@ -8,7 +8,7 @@ import { Button } from "@/components/ui/button";
|
||||
import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from "@/components/ui/form";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { PbErrorData } from "@/domain/base";
|
||||
import { accessProvidersMap, accessTypeFormSchema, type AccessModel, type HttpreqConfig } from "@/domain/access";
|
||||
import { accessProvidersMap, accessTypeFormSchema, type AccessModel, type ACMEHttpReqAccessConfig } from "@/domain/access";
|
||||
import { save } from "@/repository/access";
|
||||
import { useAccessStore } from "@/stores/access";
|
||||
|
||||
@ -25,35 +25,35 @@ const AccessHttpreqForm = ({ data, op, onAfterReq }: AccessHttpreqFormProps) =>
|
||||
id: z.string().optional(),
|
||||
name: z
|
||||
.string()
|
||||
.min(1, "access.authorization.form.name.placeholder")
|
||||
.min(1, "access.form.name.placeholder")
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
configType: accessTypeFormSchema,
|
||||
endpoint: z.string().url("common.errmsg.url_invalid"),
|
||||
mode: z.enum(["RAW", ""]),
|
||||
username: z
|
||||
.string()
|
||||
.min(1, "access.authorization.form.access_key_secret.placeholder")
|
||||
.min(1, "access.form.access_key_secret.placeholder")
|
||||
.max(128, t("common.errmsg.string_max", { max: 128 })),
|
||||
password: z
|
||||
.string()
|
||||
.min(1, "access.authorization.form.access_key_secret.placeholder")
|
||||
.min(1, "access.form.access_key_secret.placeholder")
|
||||
.max(128, t("common.errmsg.string_max", { max: 128 })),
|
||||
});
|
||||
|
||||
let config: HttpreqConfig = {
|
||||
let config: ACMEHttpReqAccessConfig = {
|
||||
endpoint: "",
|
||||
mode: "",
|
||||
username: "",
|
||||
password: "",
|
||||
};
|
||||
if (data) config = data.config as HttpreqConfig;
|
||||
if (data) config = data.config as ACMEHttpReqAccessConfig;
|
||||
|
||||
const form = useForm<z.infer<typeof formSchema>>({
|
||||
resolver: zodResolver(formSchema),
|
||||
defaultValues: {
|
||||
id: data?.id,
|
||||
name: data?.name || "",
|
||||
configType: "httpreq",
|
||||
configType: "acmehttpreq",
|
||||
endpoint: config.endpoint,
|
||||
mode: config.mode === "RAW" ? "RAW" : "",
|
||||
username: config.username,
|
||||
@ -119,9 +119,9 @@ const AccessHttpreqForm = ({ data, op, onAfterReq }: AccessHttpreqFormProps) =>
|
||||
name="name"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.name.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.name.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.name.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.name.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -134,7 +134,7 @@ const AccessHttpreqForm = ({ data, op, onAfterReq }: AccessHttpreqFormProps) =>
|
||||
name="id"
|
||||
render={({ field }) => (
|
||||
<FormItem className="hidden">
|
||||
<FormLabel>{t("access.authorization.form.config.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.config.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
@ -149,7 +149,7 @@ const AccessHttpreqForm = ({ data, op, onAfterReq }: AccessHttpreqFormProps) =>
|
||||
name="configType"
|
||||
render={({ field }) => (
|
||||
<FormItem className="hidden">
|
||||
<FormLabel>{t("access.authorization.form.config.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.config.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
@ -164,9 +164,9 @@ const AccessHttpreqForm = ({ data, op, onAfterReq }: AccessHttpreqFormProps) =>
|
||||
name="endpoint"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.httpreq_endpoint.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.httpreq_endpoint.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.httpreq_endpoint.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.httpreq_endpoint.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -179,9 +179,9 @@ const AccessHttpreqForm = ({ data, op, onAfterReq }: AccessHttpreqFormProps) =>
|
||||
name="mode"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.httpreq_mode.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.httpreq_mode.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.httpreq_mode.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.httpreq_mode.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -194,9 +194,9 @@ const AccessHttpreqForm = ({ data, op, onAfterReq }: AccessHttpreqFormProps) =>
|
||||
name="username"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.username.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.username.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.username.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.username.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -209,9 +209,9 @@ const AccessHttpreqForm = ({ data, op, onAfterReq }: AccessHttpreqFormProps) =>
|
||||
name="password"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.password.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.password.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.password.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.password.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
|
@ -8,7 +8,7 @@ import { Input } from "@/components/ui/input";
|
||||
import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from "@/components/ui/form";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { PbErrorData } from "@/domain/base";
|
||||
import { accessProvidersMap, accessTypeFormSchema, type AccessModel, type HuaweiCloudConfig } from "@/domain/access";
|
||||
import { accessProvidersMap, accessTypeFormSchema, type AccessModel, type HuaweiCloudAccessConfig } from "@/domain/access";
|
||||
import { save } from "@/repository/access";
|
||||
import { useAccessStore } from "@/stores/access";
|
||||
|
||||
@ -25,29 +25,29 @@ const AccessHuaweiCloudForm = ({ data, op, onAfterReq }: AccessHuaweiCloudFormPr
|
||||
id: z.string().optional(),
|
||||
name: z
|
||||
.string()
|
||||
.min(1, "access.authorization.form.name.placeholder")
|
||||
.min(1, "access.form.name.placeholder")
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
configType: accessTypeFormSchema,
|
||||
region: z
|
||||
.string()
|
||||
.min(1, "access.authorization.form.region.placeholder")
|
||||
.min(1, "access.form.region.placeholder")
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
accessKeyId: z
|
||||
.string()
|
||||
.min(1, "access.authorization.form.access_key_id.placeholder")
|
||||
.min(1, "access.form.access_key_id.placeholder")
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
secretAccessKey: z
|
||||
.string()
|
||||
.min(1, "access.authorization.form.secret_access_key.placeholder")
|
||||
.min(1, "access.form.secret_access_key.placeholder")
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
});
|
||||
|
||||
let config: HuaweiCloudConfig = {
|
||||
let config: HuaweiCloudAccessConfig = {
|
||||
region: "cn-north-1",
|
||||
accessKeyId: "",
|
||||
secretAccessKey: "",
|
||||
};
|
||||
if (data) config = data.config as HuaweiCloudConfig;
|
||||
if (data) config = data.config as HuaweiCloudAccessConfig;
|
||||
|
||||
const form = useForm<z.infer<typeof formSchema>>({
|
||||
resolver: zodResolver(formSchema),
|
||||
@ -117,9 +117,9 @@ const AccessHuaweiCloudForm = ({ data, op, onAfterReq }: AccessHuaweiCloudFormPr
|
||||
name="name"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.name.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.name.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.name.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.name.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -132,7 +132,7 @@ const AccessHuaweiCloudForm = ({ data, op, onAfterReq }: AccessHuaweiCloudFormPr
|
||||
name="id"
|
||||
render={({ field }) => (
|
||||
<FormItem className="hidden">
|
||||
<FormLabel>{t("access.authorization.form.config.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.config.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
@ -147,7 +147,7 @@ const AccessHuaweiCloudForm = ({ data, op, onAfterReq }: AccessHuaweiCloudFormPr
|
||||
name="configType"
|
||||
render={({ field }) => (
|
||||
<FormItem className="hidden">
|
||||
<FormLabel>{t("access.authorization.form.config.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.config.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
@ -162,9 +162,9 @@ const AccessHuaweiCloudForm = ({ data, op, onAfterReq }: AccessHuaweiCloudFormPr
|
||||
name="region"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.region.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.region.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.region.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.region.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -177,9 +177,9 @@ const AccessHuaweiCloudForm = ({ data, op, onAfterReq }: AccessHuaweiCloudFormPr
|
||||
name="accessKeyId"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.access_key_id.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.access_key_id.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.access_key_id.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.access_key_id.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -192,9 +192,9 @@ const AccessHuaweiCloudForm = ({ data, op, onAfterReq }: AccessHuaweiCloudFormPr
|
||||
name="secretAccessKey"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.secret_access_key.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.secret_access_key.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.secret_access_key.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.secret_access_key.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
|
@ -10,7 +10,7 @@ import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from "
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { readFileContent } from "@/utils/file";
|
||||
import { PbErrorData } from "@/domain/base";
|
||||
import { accessProvidersMap, accessTypeFormSchema, type AccessModel, type KubernetesConfig } from "@/domain/access";
|
||||
import { accessProvidersMap, accessTypeFormSchema, type AccessModel, type KubernetesAccessConfig } from "@/domain/access";
|
||||
import { save } from "@/repository/access";
|
||||
import { useAccessStore } from "@/stores/access";
|
||||
|
||||
@ -32,17 +32,17 @@ const AccessKubernetesForm = ({ data, op, onAfterReq }: AccessKubernetesFormProp
|
||||
id: z.string().optional(),
|
||||
name: z
|
||||
.string()
|
||||
.min(1, "access.authorization.form.name.placeholder")
|
||||
.min(1, "access.form.name.placeholder")
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
configType: accessTypeFormSchema,
|
||||
kubeConfig: z
|
||||
.string()
|
||||
.min(0, "access.authorization.form.k8s_kubeconfig.placeholder")
|
||||
.min(0, "access.form.k8s_kubeconfig.placeholder")
|
||||
.max(20480, t("common.errmsg.string_max", { max: 20480 })),
|
||||
kubeConfigFile: z.any().optional(),
|
||||
});
|
||||
|
||||
let config: KubernetesConfig & { kubeConfigFile?: string } = {
|
||||
let config: KubernetesAccessConfig & { kubeConfigFile?: string } = {
|
||||
kubeConfig: "",
|
||||
kubeConfigFile: "",
|
||||
};
|
||||
@ -126,9 +126,9 @@ const AccessKubernetesForm = ({ data, op, onAfterReq }: AccessKubernetesFormProp
|
||||
name="name"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.name.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.name.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.name.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.name.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -141,9 +141,9 @@ const AccessKubernetesForm = ({ data, op, onAfterReq }: AccessKubernetesFormProp
|
||||
name="kubeConfig"
|
||||
render={({ field }) => (
|
||||
<FormItem hidden>
|
||||
<FormLabel>{t("access.authorization.form.k8s_kubeconfig.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.k8s_kubeconfig.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.k8s_kubeconfig.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.k8s_kubeconfig.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -156,14 +156,14 @@ const AccessKubernetesForm = ({ data, op, onAfterReq }: AccessKubernetesFormProp
|
||||
name="kubeConfigFile"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.k8s_kubeconfig.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.k8s_kubeconfig.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<div>
|
||||
<Button type={"button"} variant={"secondary"} size={"sm"} className="w-48" onClick={handleSelectFileClick}>
|
||||
{fileName ? fileName : t("access.authorization.form.k8s_kubeconfig_file.placeholder")}
|
||||
{fileName ? fileName : t("access.form.k8s_kubeconfig_file.placeholder")}
|
||||
</Button>
|
||||
<Input
|
||||
placeholder={t("access.authorization.form.k8s_kubeconfig.placeholder")}
|
||||
placeholder={t("access.form.k8s_kubeconfig.placeholder")}
|
||||
{...field}
|
||||
ref={fileInputRef}
|
||||
className="hidden"
|
||||
|
@ -26,7 +26,7 @@ const AccessLocalForm = ({ data, op, onAfterReq }: AccessLocalFormProps) => {
|
||||
id: z.string().optional(),
|
||||
name: z
|
||||
.string()
|
||||
.min(1, "access.authorization.form.name.placeholder")
|
||||
.min(1, "access.form.name.placeholder")
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
configType: accessTypeFormSchema,
|
||||
});
|
||||
@ -93,9 +93,9 @@ const AccessLocalForm = ({ data, op, onAfterReq }: AccessLocalFormProps) => {
|
||||
name="name"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.name.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.name.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.name.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.name.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -108,7 +108,7 @@ const AccessLocalForm = ({ data, op, onAfterReq }: AccessLocalFormProps) => {
|
||||
name="id"
|
||||
render={({ field }) => (
|
||||
<FormItem className="hidden">
|
||||
<FormLabel>{t("access.authorization.form.config.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.config.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
@ -123,7 +123,7 @@ const AccessLocalForm = ({ data, op, onAfterReq }: AccessLocalFormProps) => {
|
||||
name="configType"
|
||||
render={({ field }) => (
|
||||
<FormItem className="hidden">
|
||||
<FormLabel>{t("access.authorization.form.config.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.config.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
|
@ -8,36 +8,36 @@ import { Button } from "@/components/ui/button";
|
||||
import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from "@/components/ui/form";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { PbErrorData } from "@/domain/base";
|
||||
import { accessProvidersMap, accessTypeFormSchema, type AccessModel, type NamesiloConfig } from "@/domain/access";
|
||||
import { accessProvidersMap, accessTypeFormSchema, type AccessModel, type NameSiloAccessConfig } from "@/domain/access";
|
||||
import { save } from "@/repository/access";
|
||||
import { useAccessStore } from "@/stores/access";
|
||||
|
||||
type AccessNamesiloFormProps = {
|
||||
type AccessNameSiloFormProps = {
|
||||
op: "add" | "edit" | "copy";
|
||||
data?: AccessModel;
|
||||
onAfterReq: () => void;
|
||||
};
|
||||
|
||||
const AccessNamesiloForm = ({ data, op, onAfterReq }: AccessNamesiloFormProps) => {
|
||||
const AccessNameSiloForm = ({ data, op, onAfterReq }: AccessNameSiloFormProps) => {
|
||||
const { createAccess, updateAccess } = useAccessStore();
|
||||
const { t } = useTranslation();
|
||||
const formSchema = z.object({
|
||||
id: z.string().optional(),
|
||||
name: z
|
||||
.string()
|
||||
.min(1, "access.authorization.form.name.placeholder")
|
||||
.min(1, "access.form.name.placeholder")
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
configType: accessTypeFormSchema,
|
||||
apiKey: z
|
||||
.string()
|
||||
.min(1, "access.authorization.form.namesilo_api_key.placeholder")
|
||||
.min(1, "access.form.namesilo_api_key.placeholder")
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
});
|
||||
|
||||
let config: NamesiloConfig = {
|
||||
let config: NameSiloAccessConfig = {
|
||||
apiKey: "",
|
||||
};
|
||||
if (data) config = data.config as NamesiloConfig;
|
||||
if (data) config = data.config as NameSiloAccessConfig;
|
||||
|
||||
const form = useForm<z.infer<typeof formSchema>>({
|
||||
resolver: zodResolver(formSchema),
|
||||
@ -101,9 +101,9 @@ const AccessNamesiloForm = ({ data, op, onAfterReq }: AccessNamesiloFormProps) =
|
||||
name="name"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.name.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.name.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.name.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.name.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -116,7 +116,7 @@ const AccessNamesiloForm = ({ data, op, onAfterReq }: AccessNamesiloFormProps) =
|
||||
name="id"
|
||||
render={({ field }) => (
|
||||
<FormItem className="hidden">
|
||||
<FormLabel>{t("access.authorization.form.config.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.config.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
@ -131,7 +131,7 @@ const AccessNamesiloForm = ({ data, op, onAfterReq }: AccessNamesiloFormProps) =
|
||||
name="configType"
|
||||
render={({ field }) => (
|
||||
<FormItem className="hidden">
|
||||
<FormLabel>{t("access.authorization.form.config.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.config.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
@ -146,9 +146,9 @@ const AccessNamesiloForm = ({ data, op, onAfterReq }: AccessNamesiloFormProps) =
|
||||
name="apiKey"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.namesilo_api_key.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.namesilo_api_key.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.namesilo_api_key.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.namesilo_api_key.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -165,4 +165,4 @@ const AccessNamesiloForm = ({ data, op, onAfterReq }: AccessNamesiloFormProps) =
|
||||
);
|
||||
};
|
||||
|
||||
export default AccessNamesiloForm;
|
||||
export default AccessNameSiloForm;
|
||||
|
@ -8,7 +8,7 @@ import { Button } from "@/components/ui/button";
|
||||
import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from "@/components/ui/form";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { PbErrorData } from "@/domain/base";
|
||||
import { accessProvidersMap, accessTypeFormSchema, type AccessModel, type PdnsConfig } from "@/domain/access";
|
||||
import { accessProvidersMap, accessTypeFormSchema, type AccessModel, type PowerDNSAccessConfig } from "@/domain/access";
|
||||
import { save } from "@/repository/access";
|
||||
import { useAccessStore } from "@/stores/access";
|
||||
|
||||
@ -25,28 +25,28 @@ const AccessPdnsForm = ({ data, op, onAfterReq }: AccessPdnsFormProps) => {
|
||||
id: z.string().optional(),
|
||||
name: z
|
||||
.string()
|
||||
.min(1, "access.authorization.form.name.placeholder")
|
||||
.min(1, "access.form.name.placeholder")
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
configType: accessTypeFormSchema,
|
||||
apiUrl: z.string().url("common.errmsg.url_invalid"),
|
||||
apiKey: z
|
||||
.string()
|
||||
.min(1, "access.authorization.form.access_key_secret.placeholder")
|
||||
.min(1, "access.form.access_key_secret.placeholder")
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
});
|
||||
|
||||
let config: PdnsConfig = {
|
||||
let config: PowerDNSAccessConfig = {
|
||||
apiUrl: "",
|
||||
apiKey: "",
|
||||
};
|
||||
if (data) config = data.config as PdnsConfig;
|
||||
if (data) config = data.config as PowerDNSAccessConfig;
|
||||
|
||||
const form = useForm<z.infer<typeof formSchema>>({
|
||||
resolver: zodResolver(formSchema),
|
||||
defaultValues: {
|
||||
id: data?.id,
|
||||
name: data?.name || "",
|
||||
configType: "pdns",
|
||||
configType: "powerdns",
|
||||
apiUrl: config.apiUrl,
|
||||
apiKey: config.apiKey,
|
||||
},
|
||||
@ -108,9 +108,9 @@ const AccessPdnsForm = ({ data, op, onAfterReq }: AccessPdnsFormProps) => {
|
||||
name="name"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.name.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.name.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.name.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.name.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -123,7 +123,7 @@ const AccessPdnsForm = ({ data, op, onAfterReq }: AccessPdnsFormProps) => {
|
||||
name="id"
|
||||
render={({ field }) => (
|
||||
<FormItem className="hidden">
|
||||
<FormLabel>{t("access.authorization.form.config.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.config.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
@ -138,7 +138,7 @@ const AccessPdnsForm = ({ data, op, onAfterReq }: AccessPdnsFormProps) => {
|
||||
name="configType"
|
||||
render={({ field }) => (
|
||||
<FormItem className="hidden">
|
||||
<FormLabel>{t("access.authorization.form.config.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.config.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
@ -153,9 +153,9 @@ const AccessPdnsForm = ({ data, op, onAfterReq }: AccessPdnsFormProps) => {
|
||||
name="apiUrl"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.pdns_api_url.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.pdns_api_url.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.pdns_api_url.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.pdns_api_url.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -168,9 +168,9 @@ const AccessPdnsForm = ({ data, op, onAfterReq }: AccessPdnsFormProps) => {
|
||||
name="apiKey"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.pdns_api_key.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.pdns_api_key.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.pdns_api_key.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.pdns_api_key.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
|
@ -8,7 +8,7 @@ import { Button } from "@/components/ui/button";
|
||||
import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from "@/components/ui/form";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { PbErrorData } from "@/domain/base";
|
||||
import { accessProvidersMap, accessTypeFormSchema, type AccessModel, type QiniuConfig } from "@/domain/access";
|
||||
import { accessProvidersMap, accessTypeFormSchema, type AccessModel, type QiniuAccessConfig } from "@/domain/access";
|
||||
import { save } from "@/repository/access";
|
||||
import { useAccessStore } from "@/stores/access";
|
||||
|
||||
@ -25,18 +25,18 @@ const AccessQiniuForm = ({ data, op, onAfterReq }: AccessQiniuFormProps) => {
|
||||
id: z.string().optional(),
|
||||
name: z
|
||||
.string()
|
||||
.min(1, "access.authorization.form.name.placeholder")
|
||||
.min(1, "access.form.name.placeholder")
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
configType: accessTypeFormSchema,
|
||||
accessKey: z.string().min(1, "access.authorization.form.access_key.placeholder").max(64),
|
||||
secretKey: z.string().min(1, "access.authorization.form.secret_key.placeholder").max(64),
|
||||
accessKey: z.string().min(1, "access.form.access_key.placeholder").max(64),
|
||||
secretKey: z.string().min(1, "access.form.secret_key.placeholder").max(64),
|
||||
});
|
||||
|
||||
let config: QiniuConfig = {
|
||||
let config: QiniuAccessConfig = {
|
||||
accessKey: "",
|
||||
secretKey: "",
|
||||
};
|
||||
if (data) config = data.config as QiniuConfig;
|
||||
if (data) config = data.config as QiniuAccessConfig;
|
||||
|
||||
const form = useForm<z.infer<typeof formSchema>>({
|
||||
resolver: zodResolver(formSchema),
|
||||
@ -104,9 +104,9 @@ const AccessQiniuForm = ({ data, op, onAfterReq }: AccessQiniuFormProps) => {
|
||||
name="name"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.name.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.name.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.name.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.name.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -119,7 +119,7 @@ const AccessQiniuForm = ({ data, op, onAfterReq }: AccessQiniuFormProps) => {
|
||||
name="id"
|
||||
render={({ field }) => (
|
||||
<FormItem className="hidden">
|
||||
<FormLabel>{t("access.authorization.form.config.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.config.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
@ -134,7 +134,7 @@ const AccessQiniuForm = ({ data, op, onAfterReq }: AccessQiniuFormProps) => {
|
||||
name="configType"
|
||||
render={({ field }) => (
|
||||
<FormItem className="hidden">
|
||||
<FormLabel>{t("access.authorization.form.config.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.config.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
@ -149,9 +149,9 @@ const AccessQiniuForm = ({ data, op, onAfterReq }: AccessQiniuFormProps) => {
|
||||
name="accessKey"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.access_key.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.access_key.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.access_key.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.access_key.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -164,9 +164,9 @@ const AccessQiniuForm = ({ data, op, onAfterReq }: AccessQiniuFormProps) => {
|
||||
name="secretKey"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.secret_key.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.secret_key.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.secret_key.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.secret_key.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
|
@ -10,7 +10,7 @@ import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from "
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { readFileContent } from "@/utils/file";
|
||||
import { PbErrorData } from "@/domain/base";
|
||||
import { accessProvidersMap, accessTypeFormSchema, type AccessModel, type SSHConfig } from "@/domain/access";
|
||||
import { accessProvidersMap, accessTypeFormSchema, type AccessModel, type SSHAccessConfig } from "@/domain/access";
|
||||
import { save } from "@/repository/access";
|
||||
import { useAccessStore } from "@/stores/access";
|
||||
|
||||
@ -36,7 +36,7 @@ const AccessSSHForm = ({ data, op, onAfterReq }: AccessSSHFormProps) => {
|
||||
id: z.string().optional(),
|
||||
name: z
|
||||
.string()
|
||||
.min(1, "access.authorization.form.name.placeholder")
|
||||
.min(1, "access.form.name.placeholder")
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
configType: accessTypeFormSchema,
|
||||
host: z.string().refine(
|
||||
@ -50,28 +50,28 @@ const AccessSSHForm = ({ data, op, onAfterReq }: AccessSSHFormProps) => {
|
||||
group: z.string().optional(),
|
||||
port: z
|
||||
.string()
|
||||
.min(1, "access.authorization.form.ssh_port.placeholder")
|
||||
.min(1, "access.form.ssh_port.placeholder")
|
||||
.max(5, t("common.errmsg.string_max", { max: 5 })),
|
||||
username: z
|
||||
.string()
|
||||
.min(1, "access.authorization.form.ssh_username.placeholder")
|
||||
.min(1, "access.form.ssh_username.placeholder")
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
password: z
|
||||
.string()
|
||||
.min(0, "access.authorization.form.ssh_password.placeholder")
|
||||
.min(0, "access.form.ssh_password.placeholder")
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
key: z
|
||||
.string()
|
||||
.min(0, "access.authorization.form.ssh_key.placeholder")
|
||||
.min(0, "access.form.ssh_key.placeholder")
|
||||
.max(20480, t("common.errmsg.string_max", { max: 20480 })),
|
||||
keyFile: z.any().optional(),
|
||||
keyPassphrase: z
|
||||
.string()
|
||||
.min(0, "access.authorization.form.ssh_key_passphrase.placeholder")
|
||||
.min(0, "access.form.ssh_key_passphrase.placeholder")
|
||||
.max(2048, t("common.errmsg.string_max", { max: 2048 })),
|
||||
});
|
||||
|
||||
let config: SSHConfig = {
|
||||
let config: SSHAccessConfig = {
|
||||
host: "127.0.0.1",
|
||||
port: "22",
|
||||
username: "root",
|
||||
@ -80,7 +80,7 @@ const AccessSSHForm = ({ data, op, onAfterReq }: AccessSSHFormProps) => {
|
||||
keyFile: "",
|
||||
keyPassphrase: "",
|
||||
};
|
||||
if (data) config = data.config as SSHConfig;
|
||||
if (data) config = data.config as SSHAccessConfig;
|
||||
|
||||
const form = useForm<z.infer<typeof formSchema>>({
|
||||
resolver: zodResolver(formSchema),
|
||||
@ -175,9 +175,9 @@ const AccessSSHForm = ({ data, op, onAfterReq }: AccessSSHFormProps) => {
|
||||
name="name"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.name.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.name.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.name.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.name.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -190,7 +190,7 @@ const AccessSSHForm = ({ data, op, onAfterReq }: AccessSSHFormProps) => {
|
||||
name="id"
|
||||
render={({ field }) => (
|
||||
<FormItem className="hidden">
|
||||
<FormLabel>{t("access.authorization.form.config.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.config.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
@ -205,7 +205,7 @@ const AccessSSHForm = ({ data, op, onAfterReq }: AccessSSHFormProps) => {
|
||||
name="configType"
|
||||
render={({ field }) => (
|
||||
<FormItem className="hidden">
|
||||
<FormLabel>{t("access.authorization.form.config.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.config.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
@ -220,9 +220,9 @@ const AccessSSHForm = ({ data, op, onAfterReq }: AccessSSHFormProps) => {
|
||||
name="host"
|
||||
render={({ field }) => (
|
||||
<FormItem className="grow">
|
||||
<FormLabel>{t("access.authorization.form.ssh_host.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.ssh_host.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.ssh_host.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.ssh_host.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -235,9 +235,9 @@ const AccessSSHForm = ({ data, op, onAfterReq }: AccessSSHFormProps) => {
|
||||
name="port"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.ssh_port.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.ssh_port.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.ssh_port.placeholder")} {...field} type="number" />
|
||||
<Input placeholder={t("access.form.ssh_port.placeholder")} {...field} type="number" />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -251,9 +251,9 @@ const AccessSSHForm = ({ data, op, onAfterReq }: AccessSSHFormProps) => {
|
||||
name="username"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.ssh_username.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.ssh_username.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.ssh_username.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.ssh_username.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -266,9 +266,9 @@ const AccessSSHForm = ({ data, op, onAfterReq }: AccessSSHFormProps) => {
|
||||
name="password"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.ssh_password.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.ssh_password.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.ssh_password.placeholder")} {...field} type="password" />
|
||||
<Input placeholder={t("access.form.ssh_password.placeholder")} {...field} type="password" />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -281,9 +281,9 @@ const AccessSSHForm = ({ data, op, onAfterReq }: AccessSSHFormProps) => {
|
||||
name="key"
|
||||
render={({ field }) => (
|
||||
<FormItem hidden>
|
||||
<FormLabel>{t("access.authorization.form.ssh_key.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.ssh_key.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.ssh_key.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.ssh_key.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -296,14 +296,14 @@ const AccessSSHForm = ({ data, op, onAfterReq }: AccessSSHFormProps) => {
|
||||
name="keyFile"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.ssh_key.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.ssh_key.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<div>
|
||||
<Button type={"button"} variant={"secondary"} size={"sm"} className="w-48" onClick={handleSelectFileClick}>
|
||||
{fileName ? fileName : t("access.authorization.form.ssh_key_file.placeholder")}
|
||||
{fileName ? fileName : t("access.form.ssh_key_file.placeholder")}
|
||||
</Button>
|
||||
<Input
|
||||
placeholder={t("access.authorization.form.ssh_key.placeholder")}
|
||||
placeholder={t("access.form.ssh_key.placeholder")}
|
||||
{...field}
|
||||
ref={fileInputRef}
|
||||
className="hidden"
|
||||
@ -324,9 +324,9 @@ const AccessSSHForm = ({ data, op, onAfterReq }: AccessSSHFormProps) => {
|
||||
name="keyPassphrase"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.ssh_key_passphrase.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.ssh_key_passphrase.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.ssh_key_passphrase.placeholder")} {...field} type="password" />
|
||||
<Input placeholder={t("access.form.ssh_key_passphrase.placeholder")} {...field} type="password" />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
|
@ -8,7 +8,7 @@ import { Button } from "@/components/ui/button";
|
||||
import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from "@/components/ui/form";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { PbErrorData } from "@/domain/base";
|
||||
import { accessProvidersMap, accessTypeFormSchema, type AccessModel, type TencentConfig } from "@/domain/access";
|
||||
import { accessProvidersMap, accessTypeFormSchema, type AccessModel, type TencentCloudAccessConfig } from "@/domain/access";
|
||||
import { save } from "@/repository/access";
|
||||
import { useAccessStore } from "@/stores/access";
|
||||
|
||||
@ -25,31 +25,31 @@ const AccessTencentForm = ({ data, op, onAfterReq }: AccessTencentFormProps) =>
|
||||
id: z.string().optional(),
|
||||
name: z
|
||||
.string()
|
||||
.min(1, "access.authorization.form.name.placeholder")
|
||||
.min(1, "access.form.name.placeholder")
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
configType: accessTypeFormSchema,
|
||||
secretId: z
|
||||
.string()
|
||||
.min(1, "access.authorization.form.secret_id.placeholder")
|
||||
.min(1, "access.form.secret_id.placeholder")
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
secretKey: z
|
||||
.string()
|
||||
.min(1, "access.authorization.form.secret_key.placeholder")
|
||||
.min(1, "access.form.secret_key.placeholder")
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
});
|
||||
|
||||
let config: TencentConfig = {
|
||||
let config: TencentCloudAccessConfig = {
|
||||
secretId: "",
|
||||
secretKey: "",
|
||||
};
|
||||
if (data) config = data.config as TencentConfig;
|
||||
if (data) config = data.config as TencentCloudAccessConfig;
|
||||
|
||||
const form = useForm<z.infer<typeof formSchema>>({
|
||||
resolver: zodResolver(formSchema),
|
||||
defaultValues: {
|
||||
id: data?.id,
|
||||
name: data?.name || "",
|
||||
configType: "tencent",
|
||||
configType: "tencentcloud",
|
||||
secretId: config.secretId,
|
||||
secretKey: config.secretKey,
|
||||
},
|
||||
@ -108,9 +108,9 @@ const AccessTencentForm = ({ data, op, onAfterReq }: AccessTencentFormProps) =>
|
||||
name="name"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.name.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.name.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.name.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.name.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -123,7 +123,7 @@ const AccessTencentForm = ({ data, op, onAfterReq }: AccessTencentFormProps) =>
|
||||
name="id"
|
||||
render={({ field }) => (
|
||||
<FormItem className="hidden">
|
||||
<FormLabel>{t("access.authorization.form.config.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.config.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
@ -138,7 +138,7 @@ const AccessTencentForm = ({ data, op, onAfterReq }: AccessTencentFormProps) =>
|
||||
name="configType"
|
||||
render={({ field }) => (
|
||||
<FormItem className="hidden">
|
||||
<FormLabel>{t("access.authorization.form.config.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.config.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
@ -153,9 +153,9 @@ const AccessTencentForm = ({ data, op, onAfterReq }: AccessTencentFormProps) =>
|
||||
name="secretId"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.secret_id.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.secret_id.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.secret_id.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.secret_id.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -168,9 +168,9 @@ const AccessTencentForm = ({ data, op, onAfterReq }: AccessTencentFormProps) =>
|
||||
name="secretKey"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.secret_key.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.secret_key.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.secret_key.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.secret_key.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
|
@ -8,7 +8,7 @@ import { Input } from "@/components/ui/input";
|
||||
import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from "@/components/ui/form";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { PbErrorData } from "@/domain/base";
|
||||
import { accessProvidersMap, accessTypeFormSchema, type AccessModel, type VolcengineConfig } from "@/domain/access";
|
||||
import { accessProvidersMap, accessTypeFormSchema, type AccessModel, type VolcEngineAccessConfig } from "@/domain/access";
|
||||
import { save } from "@/repository/access";
|
||||
import { useAccessStore } from "@/stores/access";
|
||||
|
||||
@ -25,24 +25,24 @@ const AccessVolcengineForm = ({ data, op, onAfterReq }: AccessVolcengineFormProp
|
||||
id: z.string().optional(),
|
||||
name: z
|
||||
.string()
|
||||
.min(1, "access.authorization.form.name.placeholder")
|
||||
.min(1, "access.form.name.placeholder")
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
configType: accessTypeFormSchema,
|
||||
accessKeyId: z
|
||||
.string()
|
||||
.min(1, "access.authorization.form.access_key_id.placeholder")
|
||||
.min(1, "access.form.access_key_id.placeholder")
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
secretAccessKey: z
|
||||
.string()
|
||||
.min(1, "access.authorization.form.secret_access_key.placeholder")
|
||||
.min(1, "access.form.secret_access_key.placeholder")
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
});
|
||||
|
||||
let config: VolcengineConfig = {
|
||||
let config: VolcEngineAccessConfig = {
|
||||
accessKeyId: "",
|
||||
secretAccessKey: "",
|
||||
};
|
||||
if (data) config = data.config as VolcengineConfig;
|
||||
if (data) config = data.config as VolcEngineAccessConfig;
|
||||
|
||||
const form = useForm<z.infer<typeof formSchema>>({
|
||||
resolver: zodResolver(formSchema),
|
||||
@ -110,9 +110,9 @@ const AccessVolcengineForm = ({ data, op, onAfterReq }: AccessVolcengineFormProp
|
||||
name="name"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.name.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.name.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.name.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.name.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -125,7 +125,7 @@ const AccessVolcengineForm = ({ data, op, onAfterReq }: AccessVolcengineFormProp
|
||||
name="id"
|
||||
render={({ field }) => (
|
||||
<FormItem className="hidden">
|
||||
<FormLabel>{t("access.authorization.form.config.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.config.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
@ -140,7 +140,7 @@ const AccessVolcengineForm = ({ data, op, onAfterReq }: AccessVolcengineFormProp
|
||||
name="configType"
|
||||
render={({ field }) => (
|
||||
<FormItem className="hidden">
|
||||
<FormLabel>{t("access.authorization.form.config.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.config.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
@ -155,9 +155,9 @@ const AccessVolcengineForm = ({ data, op, onAfterReq }: AccessVolcengineFormProp
|
||||
name="accessKeyId"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.access_key_id.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.access_key_id.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.access_key_id.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.access_key_id.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -170,9 +170,9 @@ const AccessVolcengineForm = ({ data, op, onAfterReq }: AccessVolcengineFormProp
|
||||
name="secretAccessKey"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.secret_access_key.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.secret_access_key.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.secret_access_key.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.secret_access_key.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
|
@ -8,7 +8,7 @@ import { Button } from "@/components/ui/button";
|
||||
import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from "@/components/ui/form";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { PbErrorData } from "@/domain/base";
|
||||
import { AccessModel, accessProvidersMap, accessTypeFormSchema, WebhookConfig } from "@/domain/access";
|
||||
import { AccessModel, accessProvidersMap, accessTypeFormSchema, WebhookAccessConfig } from "@/domain/access";
|
||||
import { save } from "@/repository/access";
|
||||
import { useAccessStore } from "@/stores/access";
|
||||
|
||||
@ -25,16 +25,16 @@ const AccessWebhookForm = ({ data, op, onAfterReq }: AccessWebhookFormProps) =>
|
||||
id: z.string().optional(),
|
||||
name: z
|
||||
.string()
|
||||
.min(1, "access.authorization.form.name.placeholder")
|
||||
.min(1, "access.form.name.placeholder")
|
||||
.max(64, t("common.errmsg.string_max", { max: 64 })),
|
||||
configType: accessTypeFormSchema,
|
||||
url: z.string().url("common.errmsg.url_invalid"),
|
||||
});
|
||||
|
||||
let config: WebhookConfig = {
|
||||
let config: WebhookAccessConfig = {
|
||||
url: "",
|
||||
};
|
||||
if (data) config = data.config as WebhookConfig;
|
||||
if (data) config = data.config as WebhookAccessConfig;
|
||||
|
||||
const form = useForm<z.infer<typeof formSchema>>({
|
||||
resolver: zodResolver(formSchema),
|
||||
@ -98,9 +98,9 @@ const AccessWebhookForm = ({ data, op, onAfterReq }: AccessWebhookFormProps) =>
|
||||
name="name"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.name.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.name.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.name.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.name.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
@ -113,7 +113,7 @@ const AccessWebhookForm = ({ data, op, onAfterReq }: AccessWebhookFormProps) =>
|
||||
name="id"
|
||||
render={({ field }) => (
|
||||
<FormItem className="hidden">
|
||||
<FormLabel>{t("access.authorization.form.config.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.config.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
@ -128,7 +128,7 @@ const AccessWebhookForm = ({ data, op, onAfterReq }: AccessWebhookFormProps) =>
|
||||
name="configType"
|
||||
render={({ field }) => (
|
||||
<FormItem className="hidden">
|
||||
<FormLabel>{t("access.authorization.form.config.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.config.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
@ -143,9 +143,9 @@ const AccessWebhookForm = ({ data, op, onAfterReq }: AccessWebhookFormProps) =>
|
||||
name="url"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t("access.authorization.form.webhook_url.label")}</FormLabel>
|
||||
<FormLabel>{t("access.form.webhook_url.label")}</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder={t("access.authorization.form.webhook_url.placeholder")} {...field} />
|
||||
<Input placeholder={t("access.form.webhook_url.placeholder")} {...field} />
|
||||
</FormControl>
|
||||
|
||||
<FormMessage />
|
||||
|
@ -4,15 +4,16 @@ import { BookOpen as BookOpenIcon } from "lucide-react";
|
||||
|
||||
import { version } from "@/domain/version";
|
||||
|
||||
type VersionProps = {
|
||||
export type VersionProps = {
|
||||
className?: string;
|
||||
style?: React.CSSProperties;
|
||||
};
|
||||
|
||||
const Version = ({ className }: VersionProps) => {
|
||||
const Version = ({ className, style }: VersionProps) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<Space className={className} size={4}>
|
||||
<Space className={className} style={style} size={4}>
|
||||
<Typography.Link type="secondary" href="https://docs.certimate.me" target="_blank">
|
||||
<div className="flex items-center justify-center space-x-1">
|
||||
<BookOpenIcon size={16} />
|
||||
|
@ -60,14 +60,14 @@ const getForm = (data: WorkflowNode, defaultProivder?: string) => {
|
||||
return <DeployToQiniuCDN data={data} />;
|
||||
case "webhook":
|
||||
return <DeployToWebhook data={data} />;
|
||||
case "tencent-cdn":
|
||||
case "tencent-ecdn":
|
||||
case "tencentcloud-cdn":
|
||||
case "tencentcloud-ecdn":
|
||||
return <DeployToTencentCDN data={data} />;
|
||||
case "tencent-clb":
|
||||
case "tencentcloud-clb":
|
||||
return <DeployToTencentCLB data={data} />;
|
||||
case "tencent-cos":
|
||||
case "tencentcloud-cos":
|
||||
return <DeployToTencentCOS data={data} />;
|
||||
case "tencent-teo":
|
||||
case "tencentcloud-eo":
|
||||
return <DeployToTencentTEO data={data} />;
|
||||
case "ssh":
|
||||
return <DeployToSSH data={data} />;
|
||||
|
@ -56,7 +56,7 @@ const DeployToTencentCDN = ({ data }: DeployFormProps) => {
|
||||
const form = useForm<z.infer<typeof formSchema>>({
|
||||
resolver: zodResolver(formSchema),
|
||||
defaultValues: {
|
||||
providerType: "tencent-cdn",
|
||||
providerType: "tencentcloud-cdn",
|
||||
access: config.access as string,
|
||||
certificate: config.certificate as string,
|
||||
domain: config.domain as string,
|
||||
@ -94,7 +94,7 @@ const DeployToTencentCDN = ({ data }: DeployFormProps) => {
|
||||
</div>
|
||||
}
|
||||
op="add"
|
||||
outConfigType="tencent"
|
||||
outConfigType="tencentcloud"
|
||||
/>
|
||||
</FormLabel>
|
||||
<FormControl>
|
||||
@ -104,7 +104,7 @@ const DeployToTencentCDN = ({ data }: DeployFormProps) => {
|
||||
onValueChange={(value) => {
|
||||
form.setValue("access", value);
|
||||
}}
|
||||
providerType="tencent-cdn"
|
||||
providerType="tencentcloud-cdn"
|
||||
/>
|
||||
</FormControl>
|
||||
|
||||
|
@ -92,7 +92,7 @@ const DeployToTencentCLB = ({ data }: DeployFormProps) => {
|
||||
const form = useForm<z.infer<typeof formSchema>>({
|
||||
resolver: zodResolver(formSchema),
|
||||
defaultValues: {
|
||||
providerType: "tencent-clb",
|
||||
providerType: "tencentcloud-clb",
|
||||
access: config.access as string,
|
||||
certificate: config.certificate as string,
|
||||
region: config.region as string,
|
||||
@ -134,7 +134,7 @@ const DeployToTencentCLB = ({ data }: DeployFormProps) => {
|
||||
</div>
|
||||
}
|
||||
op="add"
|
||||
outConfigType="tencent"
|
||||
outConfigType="tencentcloud"
|
||||
/>
|
||||
</FormLabel>
|
||||
<FormControl>
|
||||
@ -144,7 +144,7 @@ const DeployToTencentCLB = ({ data }: DeployFormProps) => {
|
||||
onValueChange={(value) => {
|
||||
form.setValue("access", value);
|
||||
}}
|
||||
providerType="tencent-clb"
|
||||
providerType="tencentcloud-clb"
|
||||
/>
|
||||
</FormControl>
|
||||
|
||||
|
@ -60,7 +60,7 @@ const DeployToTencentCOS = ({ data }: DeployFormProps) => {
|
||||
const form = useForm<z.infer<typeof formSchema>>({
|
||||
resolver: zodResolver(formSchema),
|
||||
defaultValues: {
|
||||
providerType: "tencent-cos",
|
||||
providerType: "tencentcloud-cos",
|
||||
access: config.access as string,
|
||||
certificate: config.certificate as string,
|
||||
region: config.region as string,
|
||||
@ -100,7 +100,7 @@ const DeployToTencentCOS = ({ data }: DeployFormProps) => {
|
||||
</div>
|
||||
}
|
||||
op="add"
|
||||
outConfigType="tencent"
|
||||
outConfigType="tencentcloud"
|
||||
/>
|
||||
</FormLabel>
|
||||
<FormControl>
|
||||
@ -110,7 +110,7 @@ const DeployToTencentCOS = ({ data }: DeployFormProps) => {
|
||||
onValueChange={(value) => {
|
||||
form.setValue("access", value);
|
||||
}}
|
||||
providerType="tencent-cos"
|
||||
providerType="tencentcloud-cos"
|
||||
/>
|
||||
</FormControl>
|
||||
|
||||
|
@ -58,7 +58,7 @@ const DeployToTencentTEO = ({ data }: DeployFormProps) => {
|
||||
const form = useForm<z.infer<typeof formSchema>>({
|
||||
resolver: zodResolver(formSchema),
|
||||
defaultValues: {
|
||||
providerType: "tencent-teo",
|
||||
providerType: "tencentcloud-eo",
|
||||
access: config.access as string,
|
||||
certificate: config.certificate as string,
|
||||
zoneId: config.zoneId as string,
|
||||
@ -97,7 +97,7 @@ const DeployToTencentTEO = ({ data }: DeployFormProps) => {
|
||||
</div>
|
||||
}
|
||||
op="add"
|
||||
outConfigType="tencent"
|
||||
outConfigType="tencentcloud"
|
||||
/>
|
||||
</FormLabel>
|
||||
<FormControl>
|
||||
@ -107,7 +107,7 @@ const DeployToTencentTEO = ({ data }: DeployFormProps) => {
|
||||
onValueChange={(value) => {
|
||||
form.setValue("access", value);
|
||||
}}
|
||||
providerType="tencent-teo"
|
||||
providerType="tencentcloud-eo"
|
||||
/>
|
||||
</FormControl>
|
||||
|
||||
|
@ -1,153 +1,150 @@
|
||||
import { z } from "zod";
|
||||
import { type BaseModel } from "pocketbase";
|
||||
|
||||
type AccessUsages = "apply" | "deploy" | "all";
|
||||
|
||||
type AccessProvider = {
|
||||
type: string;
|
||||
name: string;
|
||||
icon: string;
|
||||
usage: AccessUsages;
|
||||
};
|
||||
|
||||
export const accessProvidersMap: Map<AccessProvider["type"], AccessProvider> = new Map(
|
||||
[
|
||||
["aliyun", "common.provider.aliyun", "/imgs/providers/aliyun.svg", "all"],
|
||||
["tencent", "common.provider.tencent", "/imgs/providers/tencent.svg", "all"],
|
||||
["huaweicloud", "common.provider.huaweicloud", "/imgs/providers/huaweicloud.svg", "all"],
|
||||
["baiducloud", "common.provider.baiducloud", "/imgs/providers/baiducloud.svg", "all"],
|
||||
["qiniu", "common.provider.qiniu", "/imgs/providers/qiniu.svg", "deploy"],
|
||||
["dogecloud", "common.provider.dogecloud", "/imgs/providers/dogecloud.svg", "deploy"],
|
||||
["volcengine", "common.provider.volcengine", "/imgs/providers/volcengine.svg", "all"],
|
||||
["byteplus", "common.provider.byteplus", "/imgs/providers/byteplus.svg", "all"],
|
||||
["aws", "common.provider.aws", "/imgs/providers/aws.svg", "apply"],
|
||||
["cloudflare", "common.provider.cloudflare", "/imgs/providers/cloudflare.svg", "apply"],
|
||||
["namesilo", "common.provider.namesilo", "/imgs/providers/namesilo.svg", "apply"],
|
||||
["godaddy", "common.provider.godaddy", "/imgs/providers/godaddy.svg", "apply"],
|
||||
["pdns", "common.provider.pdns", "/imgs/providers/pdns.svg", "apply"],
|
||||
["httpreq", "common.provider.httpreq", "/imgs/providers/httpreq.svg", "apply"],
|
||||
["local", "common.provider.local", "/imgs/providers/local.svg", "deploy"],
|
||||
["ssh", "common.provider.ssh", "/imgs/providers/ssh.svg", "deploy"],
|
||||
["webhook", "common.provider.webhook", "/imgs/providers/webhook.svg", "deploy"],
|
||||
["k8s", "common.provider.kubernetes", "/imgs/providers/k8s.svg", "deploy"],
|
||||
].map(([type, name, icon, usage]) => [type, { type, name, icon, usage: usage as AccessUsages }])
|
||||
);
|
||||
|
||||
export const accessTypeFormSchema = z.union(
|
||||
[
|
||||
z.literal("aliyun"),
|
||||
z.literal("tencent"),
|
||||
z.literal("huaweicloud"),
|
||||
z.literal("baiducloud"),
|
||||
z.literal("qiniu"),
|
||||
z.literal("dogecloud"),
|
||||
z.literal("aws"),
|
||||
z.literal("cloudflare"),
|
||||
z.literal("namesilo"),
|
||||
z.literal("godaddy"),
|
||||
z.literal("pdns"),
|
||||
z.literal("httpreq"),
|
||||
z.literal("local"),
|
||||
z.literal("ssh"),
|
||||
z.literal("webhook"),
|
||||
z.literal("k8s"),
|
||||
z.literal("volcengine"),
|
||||
z.literal("byteplus"),
|
||||
],
|
||||
{ message: "access.authorization.form.type.placeholder" }
|
||||
);
|
||||
/*
|
||||
注意:如果追加新的常量值,请保持以 ASCII 排序。
|
||||
NOTICE: If you add new constant, please keep ASCII order.
|
||||
*/
|
||||
export const ACCESS_PROVIDER_TYPE_ACMEHTTPREQ = "acmehttpreq" as const;
|
||||
export const ACCESS_PROVIDER_TYPE_ALIYUN = "aliyun" as const;
|
||||
export const ACCESS_PROVIDER_TYPE_AWS = "aws" as const;
|
||||
export const ACCESS_PROVIDER_TYPE_BAIDUCLOUD = "baiducloud" as const;
|
||||
export const ACCESS_PROVIDER_TYPE_BYTEPLUS = "byteplus" as const;
|
||||
export const ACCESS_PROVIDER_TYPE_CLOUDFLARE = "cloudflare" as const;
|
||||
export const ACCESS_PROVIDER_TYPE_DOGECLOUD = "dogecloud" as const;
|
||||
export const ACCESS_PROVIDER_TYPE_GODADDY = "godaddy" as const;
|
||||
export const ACCESS_PROVIDER_TYPE_HUAWEICLOUD = "huaweicloud" as const;
|
||||
export const ACCESS_PROVIDER_TYPE_KUBERNETES = "k8s" as const;
|
||||
export const ACCESS_PROVIDER_TYPE_LOCAL = "local" as const;
|
||||
export const ACCESS_PROVIDER_TYPE_NAMESILO = "namesilo" as const;
|
||||
export const ACCESS_PROVIDER_TYPE_POWERDNS = "powerdns" as const;
|
||||
export const ACCESS_PROVIDER_TYPE_QINIU = "qiniu" as const;
|
||||
export const ACCESS_PROVIDER_TYPE_SSH = "ssh" as const;
|
||||
export const ACCESS_PROVIDER_TYPE_TENCENTCLOUD = "tencentcloud" as const;
|
||||
export const ACCESS_PROVIDER_TYPE_VOLCENGINE = "volcengine" as const;
|
||||
export const ACCESS_PROVIDER_TYPE_WEBHOOK = "webhook" as const;
|
||||
export const ACCESS_PROVIDER_TYPES = Object.freeze({
|
||||
ACMEHTTPREQ: ACCESS_PROVIDER_TYPE_ACMEHTTPREQ,
|
||||
ALIYUN: ACCESS_PROVIDER_TYPE_ALIYUN,
|
||||
AWS: ACCESS_PROVIDER_TYPE_AWS,
|
||||
BAIDUCLOUD: ACCESS_PROVIDER_TYPE_BAIDUCLOUD,
|
||||
BYTEPLUS: ACCESS_PROVIDER_TYPE_BYTEPLUS,
|
||||
CLOUDFLARE: ACCESS_PROVIDER_TYPE_CLOUDFLARE,
|
||||
DOGECLOUD: ACCESS_PROVIDER_TYPE_DOGECLOUD,
|
||||
GODADDY: ACCESS_PROVIDER_TYPE_GODADDY,
|
||||
HUAWEICLOUD: ACCESS_PROVIDER_TYPE_HUAWEICLOUD,
|
||||
KUBERNETES: ACCESS_PROVIDER_TYPE_KUBERNETES,
|
||||
LOCAL: ACCESS_PROVIDER_TYPE_LOCAL,
|
||||
NAMESILO: ACCESS_PROVIDER_TYPE_NAMESILO,
|
||||
POWERDNS: ACCESS_PROVIDER_TYPE_POWERDNS,
|
||||
QINIU: ACCESS_PROVIDER_TYPE_QINIU,
|
||||
SSH: ACCESS_PROVIDER_TYPE_SSH,
|
||||
TENCENTCLOUD: ACCESS_PROVIDER_TYPE_TENCENTCLOUD,
|
||||
VOLCENGINE: ACCESS_PROVIDER_TYPE_VOLCENGINE,
|
||||
WEBHOOK: ACCESS_PROVIDER_TYPE_WEBHOOK,
|
||||
} as const);
|
||||
|
||||
export interface AccessModel extends Omit<BaseModel, "created" | "updated"> {
|
||||
name: string;
|
||||
configType: string;
|
||||
usage: AccessUsages;
|
||||
group?: string;
|
||||
config:
|
||||
| AliyunConfig
|
||||
| TencentConfig
|
||||
| HuaweiCloudConfig
|
||||
| QiniuConfig
|
||||
| DogeCloudConfig
|
||||
| AwsConfig
|
||||
| CloudflareConfig
|
||||
| NamesiloConfig
|
||||
| GodaddyConfig
|
||||
| PdnsConfig
|
||||
| HttpreqConfig
|
||||
| LocalConfig
|
||||
| SSHConfig
|
||||
| WebhookConfig
|
||||
| KubernetesConfig
|
||||
| VolcengineConfig
|
||||
| ByteplusConfig;
|
||||
config: /*
|
||||
注意:如果追加新的类型,请保持以 ASCII 排序。
|
||||
NOTICE: If you add new type, please keep ASCII order.
|
||||
*/
|
||||
Record<string, unknown> &
|
||||
(
|
||||
| ACMEHttpReqAccessConfig
|
||||
| AliyunAccessConfig
|
||||
| AWSAccessConfig
|
||||
| BaiduCloudAccessConfig
|
||||
| BytePlusAccessConfig
|
||||
| CloudflareAccessConfig
|
||||
| DogeCloudAccessConfig
|
||||
| GoDaddyAccessConfig
|
||||
| HuaweiCloudAccessConfig
|
||||
| KubernetesAccessConfig
|
||||
| LocalAccessConfig
|
||||
| NamesiloAccessConfig
|
||||
| PowerDNSAccessConfig
|
||||
| QiniuAccessConfig
|
||||
| SSHAccessConfig
|
||||
| TencentCloudAccessConfig
|
||||
| VolcEngineAccessConfig
|
||||
| WebhookAccessConfig
|
||||
);
|
||||
}
|
||||
|
||||
export type AliyunConfig = {
|
||||
export type ACMEHttpReqAccessConfig = {
|
||||
endpoint: string;
|
||||
mode?: string;
|
||||
username?: string;
|
||||
password?: string;
|
||||
};
|
||||
|
||||
export type AliyunAccessConfig = {
|
||||
accessKeyId: string;
|
||||
accessKeySecret: string;
|
||||
};
|
||||
|
||||
export type TencentConfig = {
|
||||
secretId: string;
|
||||
secretKey: string;
|
||||
};
|
||||
|
||||
export type HuaweiCloudConfig = {
|
||||
region: string;
|
||||
accessKeyId: string;
|
||||
secretAccessKey: string;
|
||||
};
|
||||
|
||||
export type BaiduCloudConfig = {
|
||||
accessKeyId: string;
|
||||
secretAccessKey: string;
|
||||
};
|
||||
|
||||
export type QiniuConfig = {
|
||||
accessKey: string;
|
||||
secretKey: string;
|
||||
};
|
||||
|
||||
export type DogeCloudConfig = {
|
||||
accessKey: string;
|
||||
secretKey: string;
|
||||
};
|
||||
|
||||
export type AwsConfig = {
|
||||
region: string;
|
||||
export type AWSAccessConfig = {
|
||||
accessKeyId: string;
|
||||
secretAccessKey: string;
|
||||
region?: string;
|
||||
hostedZoneId?: string;
|
||||
};
|
||||
|
||||
export type CloudflareConfig = {
|
||||
export type BaiduCloudAccessConfig = {
|
||||
accessKeyId: string;
|
||||
secretAccessKey: string;
|
||||
};
|
||||
|
||||
export type BytePlusAccessConfig = {
|
||||
accessKey: string;
|
||||
secretKey: string;
|
||||
};
|
||||
|
||||
export type CloudflareAccessConfig = {
|
||||
dnsApiToken: string;
|
||||
};
|
||||
|
||||
export type NamesiloConfig = {
|
||||
apiKey: string;
|
||||
export type DogeCloudAccessConfig = {
|
||||
accessKey: string;
|
||||
secretKey: string;
|
||||
};
|
||||
|
||||
export type GodaddyConfig = {
|
||||
export type GoDaddyAccessConfig = {
|
||||
apiKey: string;
|
||||
apiSecret: string;
|
||||
};
|
||||
|
||||
export type PdnsConfig = {
|
||||
export type HuaweiCloudAccessConfig = {
|
||||
region: string;
|
||||
accessKeyId: string;
|
||||
secretAccessKey: string;
|
||||
};
|
||||
|
||||
export type KubernetesAccessConfig = {
|
||||
kubeConfig: string;
|
||||
};
|
||||
|
||||
export type LocalAccessConfig = never;
|
||||
|
||||
export type NamesiloAccessConfig = {
|
||||
apiKey: string;
|
||||
};
|
||||
|
||||
export type PowerDNSAccessConfig = {
|
||||
apiUrl: string;
|
||||
apiKey: string;
|
||||
};
|
||||
|
||||
export type HttpreqConfig = {
|
||||
endpoint: string;
|
||||
mode: string;
|
||||
username: string;
|
||||
password: string;
|
||||
export type QiniuAccessConfig = {
|
||||
accessKey: string;
|
||||
secretKey: string;
|
||||
};
|
||||
|
||||
export type LocalConfig = Record<string, string>;
|
||||
|
||||
export type SSHConfig = {
|
||||
export type SSHAccessConfig = {
|
||||
host: string;
|
||||
port: string;
|
||||
username: string;
|
||||
@ -157,20 +154,78 @@ export type SSHConfig = {
|
||||
keyPassphrase?: string;
|
||||
};
|
||||
|
||||
export type WebhookConfig = {
|
||||
url: string;
|
||||
export type TencentCloudAccessConfig = {
|
||||
secretId: string;
|
||||
secretKey: string;
|
||||
};
|
||||
|
||||
export type KubernetesConfig = {
|
||||
kubeConfig: string;
|
||||
};
|
||||
|
||||
export type VolcengineConfig = {
|
||||
export type VolcEngineAccessConfig = {
|
||||
accessKeyId: string;
|
||||
secretAccessKey: string;
|
||||
};
|
||||
|
||||
export type ByteplusConfig = {
|
||||
accessKey: string;
|
||||
secretKey: string;
|
||||
export type WebhookAccessConfig = {
|
||||
url: string;
|
||||
};
|
||||
|
||||
type AccessTypes = (typeof ACCESS_PROVIDER_TYPES)[keyof typeof ACCESS_PROVIDER_TYPES];
|
||||
|
||||
type AccessUsages = "apply" | "deploy" | "all";
|
||||
|
||||
type AccessProvider = {
|
||||
type: AccessTypes;
|
||||
name: string;
|
||||
icon: string;
|
||||
usage: AccessUsages;
|
||||
};
|
||||
|
||||
export const accessProvidersMap: Map<AccessProvider["type"], AccessProvider> = new Map(
|
||||
/*
|
||||
注意:与定义常量值时不同,此处的顺序决定显示在前端的顺序。
|
||||
NOTICE: The following order determines the order displayed at the frontend.
|
||||
*/
|
||||
[
|
||||
[ACCESS_PROVIDER_TYPE_ALIYUN, "common.provider.aliyun", "/imgs/providers/aliyun.svg", "all"],
|
||||
[ACCESS_PROVIDER_TYPE_TENCENTCLOUD, "common.provider.tencentcloud", "/imgs/providers/tencentcloud.svg", "all"],
|
||||
[ACCESS_PROVIDER_TYPE_HUAWEICLOUD, "common.provider.huaweicloud", "/imgs/providers/huaweicloud.svg", "all"],
|
||||
[ACCESS_PROVIDER_TYPE_BAIDUCLOUD, "common.provider.baiducloud", "/imgs/providers/baiducloud.svg", "all"],
|
||||
[ACCESS_PROVIDER_TYPE_QINIU, "common.provider.qiniu", "/imgs/providers/qiniu.svg", "deploy"],
|
||||
[ACCESS_PROVIDER_TYPE_DOGECLOUD, "common.provider.dogecloud", "/imgs/providers/dogecloud.svg", "deploy"],
|
||||
[ACCESS_PROVIDER_TYPE_VOLCENGINE, "common.provider.volcengine", "/imgs/providers/volcengine.svg", "all"],
|
||||
[ACCESS_PROVIDER_TYPE_BYTEPLUS, "common.provider.byteplus", "/imgs/providers/byteplus.svg", "all"],
|
||||
[ACCESS_PROVIDER_TYPE_AWS, "common.provider.aws", "/imgs/providers/aws.svg", "apply"],
|
||||
[ACCESS_PROVIDER_TYPE_CLOUDFLARE, "common.provider.cloudflare", "/imgs/providers/cloudflare.svg", "apply"],
|
||||
[ACCESS_PROVIDER_TYPE_NAMESILO, "common.provider.namesilo", "/imgs/providers/namesilo.svg", "apply"],
|
||||
[ACCESS_PROVIDER_TYPE_GODADDY, "common.provider.godaddy", "/imgs/providers/godaddy.svg", "apply"],
|
||||
[ACCESS_PROVIDER_TYPE_POWERDNS, "common.provider.powerdns", "/imgs/providers/powerdns.svg", "apply"],
|
||||
[ACCESS_PROVIDER_TYPE_LOCAL, "common.provider.local", "/imgs/providers/local.svg", "deploy"],
|
||||
[ACCESS_PROVIDER_TYPE_SSH, "common.provider.ssh", "/imgs/providers/ssh.svg", "deploy"],
|
||||
[ACCESS_PROVIDER_TYPE_WEBHOOK, "common.provider.webhook", "/imgs/providers/webhook.svg", "deploy"],
|
||||
[ACCESS_PROVIDER_TYPE_KUBERNETES, "common.provider.kubernetes", "/imgs/providers/kubernetes.svg", "deploy"],
|
||||
[ACCESS_PROVIDER_TYPE_ACMEHTTPREQ, "common.provider.acmehttpreq", "/imgs/providers/acmehttpreq.svg", "apply"],
|
||||
].map(([type, name, icon, usage]) => [type as AccessTypes, { type: type as AccessTypes, name, icon, usage: usage as AccessUsages }])
|
||||
);
|
||||
|
||||
export const accessTypeFormSchema = z.union(
|
||||
[
|
||||
z.literal("aliyun"),
|
||||
z.literal("tencentcloud"),
|
||||
z.literal("huaweicloud"),
|
||||
z.literal("baiducloud"),
|
||||
z.literal("qiniu"),
|
||||
z.literal("dogecloud"),
|
||||
z.literal("aws"),
|
||||
z.literal("cloudflare"),
|
||||
z.literal("namesilo"),
|
||||
z.literal("godaddy"),
|
||||
z.literal("powerdns"),
|
||||
z.literal("acmehttpreq"),
|
||||
z.literal("local"),
|
||||
z.literal("ssh"),
|
||||
z.literal("webhook"),
|
||||
z.literal("k8s"),
|
||||
z.literal("volcengine"),
|
||||
z.literal("byteplus"),
|
||||
],
|
||||
{ message: "access.form.type.placeholder" }
|
||||
);
|
||||
|
@ -70,11 +70,11 @@ export const deployTargetList: string[][] = [
|
||||
["aliyun-clb", "common.provider.aliyun.clb", "/imgs/providers/aliyun.svg"],
|
||||
["aliyun-alb", "common.provider.aliyun.alb", "/imgs/providers/aliyun.svg"],
|
||||
["aliyun-nlb", "common.provider.aliyun.nlb", "/imgs/providers/aliyun.svg"],
|
||||
["tencent-cdn", "common.provider.tencent.cdn", "/imgs/providers/tencent.svg"],
|
||||
["tencent-ecdn", "common.provider.tencent.ecdn", "/imgs/providers/tencent.svg"],
|
||||
["tencent-clb", "common.provider.tencent.clb", "/imgs/providers/tencent.svg"],
|
||||
["tencent-cos", "common.provider.tencent.cos", "/imgs/providers/tencent.svg"],
|
||||
["tencent-teo", "common.provider.tencent.teo", "/imgs/providers/tencent.svg"],
|
||||
["tencentcloud-cdn", "common.provider.tencentcloud.cdn", "/imgs/providers/tencentcloud.svg"],
|
||||
["tencentcloud-ecdn", "common.provider.tencentcloud.ecdn", "/imgs/providers/tencentcloud.svg"],
|
||||
["tencentcloud-clb", "common.provider.tencentcloud.clb", "/imgs/providers/tencentcloud.svg"],
|
||||
["tencentcloud-cos", "common.provider.tencentcloud.cos", "/imgs/providers/tencentcloud.svg"],
|
||||
["tencentcloud-eo", "common.provider.tencentcloud.eo", "/imgs/providers/tencentcloud.svg"],
|
||||
["huaweicloud-cdn", "common.provider.huaweicloud.cdn", "/imgs/providers/huaweicloud.svg"],
|
||||
["huaweicloud-elb", "common.provider.huaweicloud.elb", "/imgs/providers/huaweicloud.svg"],
|
||||
["baiducloud-cdn", "common.provider.baiducloud.cdn", "/imgs/providers/baiducloud.svg"],
|
||||
@ -83,7 +83,7 @@ export const deployTargetList: string[][] = [
|
||||
["local", "common.provider.local", "/imgs/providers/local.svg"],
|
||||
["ssh", "common.provider.ssh", "/imgs/providers/ssh.svg"],
|
||||
["webhook", "common.provider.webhook", "/imgs/providers/webhook.svg"],
|
||||
["k8s-secret", "common.provider.kubernetes.secret", "/imgs/providers/k8s.svg"],
|
||||
["k8s-secret", "common.provider.kubernetes.secret", "/imgs/providers/kubernetes.svg"],
|
||||
["volcengine-live", "common.provider.volcengine.live", "/imgs/providers/volcengine.svg"],
|
||||
["volcengine-cdn", "common.provider.volcengine.cdn", "/imgs/providers/volcengine.svg"],
|
||||
["byteplus-cdn", "common.provider.byteplus.cdn", "/imgs/providers/byteplus.svg"],
|
||||
|
@ -16,67 +16,62 @@
|
||||
"access.props.created_at": "Created At",
|
||||
"access.props.updated_at": "Updated At",
|
||||
|
||||
"access.authorization.form.name.label": "Name",
|
||||
"access.authorization.form.name.placeholder": "Please enter authorization name",
|
||||
"access.authorization.form.type.label": "Provider",
|
||||
"access.authorization.form.type.placeholder": "Please select a provider",
|
||||
"access.authorization.form.type.search.notfound": "Provider not found",
|
||||
"access.authorization.form.type.list": "Authorization List",
|
||||
"access.authorization.form.config.label": "Configuration Type",
|
||||
"access.authorization.form.region.label": "Region",
|
||||
"access.authorization.form.region.placeholder": "Please enter Region",
|
||||
"access.authorization.form.access_key_id.label": "AccessKeyId",
|
||||
"access.authorization.form.access_key_id.placeholder": "Please enter AccessKeyId",
|
||||
"access.authorization.form.access_key_secret.label": "AccessKeySecret",
|
||||
"access.authorization.form.access_key_secret.placeholder": "Please enter AccessKeySecret",
|
||||
"access.authorization.form.access_key.label": "AccessKey",
|
||||
"access.authorization.form.access_key.placeholder": "Please enter AccessKey",
|
||||
"access.authorization.form.secret_id.label": "SecretId",
|
||||
"access.authorization.form.secret_id.placeholder": "Please enter SecretId",
|
||||
"access.authorization.form.secret_key.label": "SecretKey",
|
||||
"access.authorization.form.secret_key.placeholder": "Please enter SecretKey",
|
||||
"access.authorization.form.secret_access_key.label": "SecretAccessKey",
|
||||
"access.authorization.form.secret_access_key.placeholder": "Please enter SecretAccessKey",
|
||||
"access.authorization.form.aws_hosted_zone_id.label": "AWS Hosted Zone ID",
|
||||
"access.authorization.form.aws_hosted_zone_id.placeholder": "Please enter AWS Hosted Zone ID",
|
||||
"access.authorization.form.cloud_dns_api_token.label": "CLOUD_DNS_API_TOKEN",
|
||||
"access.authorization.form.cloud_dns_api_token.placeholder": "Please enter CLOUD_DNS_API_TOKEN",
|
||||
"access.authorization.form.godaddy_api_key.label": "GO_DADDY_API_KEY",
|
||||
"access.authorization.form.godaddy_api_key.placeholder": "Please enter GO_DADDY_API_KEY",
|
||||
"access.authorization.form.godaddy_api_secret.label": "GO_DADDY_API_SECRET",
|
||||
"access.authorization.form.godaddy_api_secret.placeholder": "Please enter GO_DADDY_API_SECRET",
|
||||
"access.authorization.form.namesilo_api_key.label": "NAMESILO_API_KEY",
|
||||
"access.authorization.form.namesilo_api_key.placeholder": "Please enter NAMESILO_API_KEY",
|
||||
"access.authorization.form.pdns_api_url.label": "PDNS_API_URL",
|
||||
"access.authorization.form.pdns_api_url.placeholder": "Please enter PDNS_API_URL",
|
||||
"access.authorization.form.pdns_api_key.label": "PDNS_API_KEY",
|
||||
"access.authorization.form.pdns_api_key.placeholder": "Please enter PDNS_API_KEY",
|
||||
"access.authorization.form.httpreq_endpoint.label": "HTTPREQ_ENDPOINT",
|
||||
"access.authorization.form.httpreq_endpoint.placeholder": "Please enter HTTPREQ_ENDPOINT",
|
||||
"access.authorization.form.httpreq_mode.label": "HTTPREQ_MODE",
|
||||
"access.authorization.form.httpreq_mode.placeholder": "Please enter HTTPREQ_MODE(RAW or '')",
|
||||
"access.authorization.form.username.label": "Username",
|
||||
"access.authorization.form.username.placeholder": "Please enter username",
|
||||
"access.authorization.form.password.label": "Password",
|
||||
"access.authorization.form.password.placeholder": "Please enter password",
|
||||
"access.authorization.form.access_group.placeholder": "Please select a group",
|
||||
"access.authorization.form.ssh_group.label": "Authorization Configuration Group (used to deploy a single domain certificate to multiple SSH hosts)",
|
||||
"access.authorization.form.ssh_host.label": "Server Host",
|
||||
"access.authorization.form.ssh_host.placeholder": "Please enter Host",
|
||||
"access.authorization.form.ssh_port.label": "SSH Port",
|
||||
"access.authorization.form.ssh_port.placeholder": "Please enter Port",
|
||||
"access.authorization.form.ssh_username.label": "Username",
|
||||
"access.authorization.form.ssh_username.placeholder": "Please enter username",
|
||||
"access.authorization.form.ssh_password.label": "Password (Log-in using password)",
|
||||
"access.authorization.form.ssh_password.placeholder": "Please enter password",
|
||||
"access.authorization.form.ssh_key.label": "Key (Log-in using private key)",
|
||||
"access.authorization.form.ssh_key.placeholder": "Please enter Key",
|
||||
"access.authorization.form.ssh_key_file.placeholder": "Please select file",
|
||||
"access.authorization.form.ssh_key_passphrase.label": "Key Passphrase (Log-in using private key)",
|
||||
"access.authorization.form.ssh_key_passphrase.placeholder": "Please enter Key Passphrase",
|
||||
"access.authorization.form.webhook_url.label": "Webhook URL",
|
||||
"access.authorization.form.webhook_url.placeholder": "Please enter Webhook URL",
|
||||
"access.authorization.form.k8s_kubeconfig.label": "KubeConfig (Null will use pod's ServiceAccount)",
|
||||
"access.authorization.form.k8s_kubeconfig.placeholder": "Please enter KubeConfig",
|
||||
"access.authorization.form.k8s_kubeconfig_file.placeholder": "Please select file (Null will use pod's ServiceAccount)"
|
||||
"access.form.name.label": "Name",
|
||||
"access.form.name.placeholder": "Please enter authorization name",
|
||||
"access.form.type.label": "Provider",
|
||||
"access.form.type.placeholder": "Please select a provider",
|
||||
"access.form.region.label": "Region",
|
||||
"access.form.region.placeholder": "Please enter Region",
|
||||
"access.form.access_key_id.label": "AccessKeyId",
|
||||
"access.form.access_key_id.placeholder": "Please enter AccessKeyId",
|
||||
"access.form.access_key_secret.label": "AccessKeySecret",
|
||||
"access.form.access_key_secret.placeholder": "Please enter AccessKeySecret",
|
||||
"access.form.access_key.label": "AccessKey",
|
||||
"access.form.access_key.placeholder": "Please enter AccessKey",
|
||||
"access.form.secret_id.label": "SecretId",
|
||||
"access.form.secret_id.placeholder": "Please enter SecretId",
|
||||
"access.form.secret_key.label": "SecretKey",
|
||||
"access.form.secret_key.placeholder": "Please enter SecretKey",
|
||||
"access.form.secret_access_key.label": "SecretAccessKey",
|
||||
"access.form.secret_access_key.placeholder": "Please enter SecretAccessKey",
|
||||
"access.form.cloud_dns_api_token.label": "CLOUD_DNS_API_TOKEN",
|
||||
"access.form.cloud_dns_api_token.placeholder": "Please enter CLOUD_DNS_API_TOKEN",
|
||||
"access.form.godaddy_api_key.label": "GO_DADDY_API_KEY",
|
||||
"access.form.godaddy_api_key.placeholder": "Please enter GO_DADDY_API_KEY",
|
||||
"access.form.godaddy_api_secret.label": "GO_DADDY_API_SECRET",
|
||||
"access.form.godaddy_api_secret.placeholder": "Please enter GO_DADDY_API_SECRET",
|
||||
"access.form.namesilo_api_key.label": "NAMESILO_API_KEY",
|
||||
"access.form.namesilo_api_key.placeholder": "Please enter NAMESILO_API_KEY",
|
||||
"access.form.pdns_api_url.label": "PDNS_API_URL",
|
||||
"access.form.pdns_api_url.placeholder": "Please enter PDNS_API_URL",
|
||||
"access.form.pdns_api_key.label": "PDNS_API_KEY",
|
||||
"access.form.pdns_api_key.placeholder": "Please enter PDNS_API_KEY",
|
||||
"access.form.httpreq_endpoint.label": "HTTPREQ_ENDPOINT",
|
||||
"access.form.httpreq_endpoint.placeholder": "Please enter HTTPREQ_ENDPOINT",
|
||||
"access.form.httpreq_mode.label": "HTTPREQ_MODE",
|
||||
"access.form.httpreq_mode.placeholder": "Please enter HTTPREQ_MODE(RAW or '')",
|
||||
"access.form.username.label": "Username",
|
||||
"access.form.username.placeholder": "Please enter username",
|
||||
"access.form.password.label": "Password",
|
||||
"access.form.password.placeholder": "Please enter password",
|
||||
"access.form.access_group.placeholder": "Please select a group",
|
||||
"access.form.ssh_group.label": "Authorization Configuration Group (used to deploy a single domain certificate to multiple SSH hosts)",
|
||||
"access.form.ssh_host.label": "Server Host",
|
||||
"access.form.ssh_host.placeholder": "Please enter Host",
|
||||
"access.form.ssh_port.label": "SSH Port",
|
||||
"access.form.ssh_port.placeholder": "Please enter Port",
|
||||
"access.form.ssh_username.label": "Username",
|
||||
"access.form.ssh_username.placeholder": "Please enter username",
|
||||
"access.form.ssh_password.label": "Password (Log-in using password)",
|
||||
"access.form.ssh_password.placeholder": "Please enter password",
|
||||
"access.form.ssh_key.label": "Key (Log-in using private key)",
|
||||
"access.form.ssh_key.placeholder": "Please enter Key",
|
||||
"access.form.ssh_key_file.placeholder": "Please select file",
|
||||
"access.form.ssh_key_passphrase.label": "Key Passphrase (Log-in using private key)",
|
||||
"access.form.ssh_key_passphrase.placeholder": "Please enter Key Passphrase",
|
||||
"access.form.webhook_url.label": "Webhook URL",
|
||||
"access.form.webhook_url.placeholder": "Please enter Webhook URL",
|
||||
"access.form.k8s_kubeconfig.label": "KubeConfig (Null will use pod's ServiceAccount)",
|
||||
"access.form.k8s_kubeconfig.placeholder": "Please enter KubeConfig",
|
||||
"access.form.k8s_kubeconfig_file.placeholder": "Please select file (Null will use pod's ServiceAccount)"
|
||||
}
|
||||
|
@ -51,27 +51,27 @@
|
||||
"common.provider.aliyun.clb": "Alibaba Cloud - CLB",
|
||||
"common.provider.aliyun.alb": "Alibaba Cloud - ALB",
|
||||
"common.provider.aliyun.nlb": "Alibaba Cloud - NLB",
|
||||
"common.provider.tencent": "Tencent Cloud",
|
||||
"common.provider.tencent.cdn": "Tencent Cloud - CDN",
|
||||
"common.provider.tencent.ecdn": "Tencent Cloud - ECDN",
|
||||
"common.provider.tencent.clb": "Tencent Cloud - CLB",
|
||||
"common.provider.tencent.cos": "Tencent Cloud - COS",
|
||||
"common.provider.tencent.teo": "Tencent Cloud - EdgeOne",
|
||||
"common.provider.tencentcloud": "Tencent Cloud",
|
||||
"common.provider.tencentcloud.cdn": "Tencent Cloud - CDN",
|
||||
"common.provider.tencentcloud.ecdn": "Tencent Cloud - ECDN",
|
||||
"common.provider.tencentcloud.clb": "Tencent Cloud - CLB",
|
||||
"common.provider.tencentcloud.cos": "Tencent Cloud - COS",
|
||||
"common.provider.tencentcloud.eo": "Tencent Cloud - EdgeOne",
|
||||
"common.provider.huaweicloud": "Huawei Cloud",
|
||||
"common.provider.huaweicloud.cdn": "Huawei Cloud - CDN",
|
||||
"common.provider.huaweicloud.elb": "Huawei Cloud - ELB",
|
||||
"common.provider.baiducloud": "Baidu Cloud",
|
||||
"common.provider.baiducloud.cdn": "Baidu Cloud - CDN",
|
||||
"common.provider.qiniu": "Qiniu Cloud",
|
||||
"common.provider.qiniu.cdn": "Qiniu Cloud - CDN",
|
||||
"common.provider.qiniu": "Qiniu",
|
||||
"common.provider.qiniu.cdn": "Qiniu - CDN",
|
||||
"common.provider.dogecloud": "Doge Cloud",
|
||||
"common.provider.dogecloud.cdn": "Doge Cloud - CDN",
|
||||
"common.provider.aws": "AWS",
|
||||
"common.provider.cloudflare": "Cloudflare",
|
||||
"common.provider.namesilo": "Namesilo",
|
||||
"common.provider.godaddy": "GoDaddy",
|
||||
"common.provider.pdns": "PowerDNS",
|
||||
"common.provider.httpreq": "Http Request",
|
||||
"common.provider.powerdns": "PowerDNS",
|
||||
"common.provider.acmehttpreq": "Http Request (ACME Proxy)",
|
||||
"common.provider.local": "Local Deployment",
|
||||
"common.provider.ssh": "SSH Deployment",
|
||||
"common.provider.webhook": "Webhook",
|
||||
|
@ -10,73 +10,68 @@
|
||||
"access.action.delete.confirm": "确定要删除此授权吗?",
|
||||
|
||||
"access.props.name": "名称",
|
||||
"access.props.provider": "服务商",
|
||||
"access.props.provider.usage.dns": "DNS 服务商",
|
||||
"access.props.provider.usage.host": "主机服务商",
|
||||
"access.props.provider": "提供商",
|
||||
"access.props.provider.usage.dns": "DNS 提供商",
|
||||
"access.props.provider.usage.host": "主机提供商",
|
||||
"access.props.created_at": "创建时间",
|
||||
"access.props.updated_at": "更新时间",
|
||||
|
||||
"access.authorization.form.type.label": "服务商",
|
||||
"access.authorization.form.type.placeholder": "请选择服务商",
|
||||
"access.authorization.form.type.search.notfound": "未找到服务商",
|
||||
"access.authorization.form.type.list": "服务商列表",
|
||||
"access.authorization.form.name.label": "名称",
|
||||
"access.authorization.form.name.placeholder": "请输入授权名称",
|
||||
"access.authorization.form.config.label": "配置类型",
|
||||
"access.authorization.form.region.label": "Region",
|
||||
"access.authorization.form.region.placeholder": "请输入区域",
|
||||
"access.authorization.form.access_key_id.label": "AccessKeyId",
|
||||
"access.authorization.form.access_key_id.placeholder": "请输入 AccessKeyId",
|
||||
"access.authorization.form.access_key_secret.label": "AccessKeySecret",
|
||||
"access.authorization.form.access_key_secret.placeholder": "请输入 AccessKeySecret",
|
||||
"access.authorization.form.access_key.label": "AccessKey",
|
||||
"access.authorization.form.access_key.placeholder": "请输入 AccessKey",
|
||||
"access.authorization.form.secret_id.label": "SecretId",
|
||||
"access.authorization.form.secret_id.placeholder": "请输入 SecretId",
|
||||
"access.authorization.form.secret_key.label": "SecretKey",
|
||||
"access.authorization.form.secret_key.placeholder": "请输入 SecretKey",
|
||||
"access.authorization.form.secret_access_key.label": "SecretAccessKey",
|
||||
"access.authorization.form.secret_access_key.placeholder": "请输入 SecretAccessKey",
|
||||
"access.authorization.form.aws_hosted_zone_id.label": "AWS 托管区域 ID",
|
||||
"access.authorization.form.aws_hosted_zone_id.placeholder": "请输入 AWS Hosted Zone ID",
|
||||
"access.authorization.form.cloud_dns_api_token.label": "CLOUD_DNS_API_TOKEN",
|
||||
"access.authorization.form.cloud_dns_api_token.placeholder": "请输入 CLOUD_DNS_API_TOKEN",
|
||||
"access.authorization.form.godaddy_api_key.label": "GO_DADDY_API_KEY",
|
||||
"access.authorization.form.godaddy_api_key.placeholder": "请输入 GO_DADDY_API_KEY",
|
||||
"access.authorization.form.godaddy_api_secret.label": "GO_DADDY_API_SECRET",
|
||||
"access.authorization.form.godaddy_api_secret.placeholder": "请输入 GO_DADDY_API_SECRET",
|
||||
"access.authorization.form.namesilo_api_key.label": "NAMESILO_API_KEY",
|
||||
"access.authorization.form.namesilo_api_key.placeholder": "请输入 NAMESILO_API_KEY",
|
||||
"access.authorization.form.pdns_api_url.label": "PDNS_API_URL",
|
||||
"access.authorization.form.pdns_api_url.placeholder": "请输入 PDNS_API_URL",
|
||||
"access.authorization.form.pdns_api_key.label": "PDNS_API_KEY",
|
||||
"access.authorization.form.pdns_api_key.placeholder": "请输入 PDNS_API_KEY",
|
||||
"access.authorization.form.httpreq_endpoint.label": "HTTP 请求端点",
|
||||
"access.authorization.form.httpreq_endpoint.placeholder": "请输入 请求端点",
|
||||
"access.authorization.form.httpreq_mode.label": "模式",
|
||||
"access.authorization.form.httpreq_mode.placeholder": "请输入模式( RAW or '')",
|
||||
"access.authorization.form.username.label": "用户名",
|
||||
"access.authorization.form.username.placeholder": "请输入用户名",
|
||||
"access.authorization.form.password.label": "密码",
|
||||
"access.authorization.form.password.placeholder": "请输入密码",
|
||||
"access.authorization.form.access_group.placeholder": "请选择分组",
|
||||
"access.authorization.form.ssh_group.label": "授权配置组(用于将一个域名证书部署到多个 SSH 主机)",
|
||||
"access.authorization.form.ssh_host.label": "服务器 Host",
|
||||
"access.authorization.form.ssh_host.placeholder": "请输入 Host",
|
||||
"access.authorization.form.ssh_port.label": "SSH 端口",
|
||||
"access.authorization.form.ssh_port.placeholder": "请输入 Port",
|
||||
"access.authorization.form.ssh_username.label": "用户名",
|
||||
"access.authorization.form.ssh_username.placeholder": "请输入用户名",
|
||||
"access.authorization.form.ssh_password.label": "密码(使用密码登录)",
|
||||
"access.authorization.form.ssh_password.placeholder": "请输入密码",
|
||||
"access.authorization.form.ssh_key.label": "Key(使用私钥登录)",
|
||||
"access.authorization.form.ssh_key.placeholder": "请输入 Key",
|
||||
"access.authorization.form.ssh_key_file.placeholder": "请选择文件",
|
||||
"access.authorization.form.ssh_key_passphrase.label": "Key 口令(使用私钥登录)",
|
||||
"access.authorization.form.ssh_key_passphrase.placeholder": "请输入 Key 口令",
|
||||
"access.authorization.form.webhook_url.label": "Webhook URL",
|
||||
"access.authorization.form.webhook_url.placeholder": "请输入 Webhook URL",
|
||||
"access.authorization.form.k8s_kubeconfig.label": "KubeConfig(不选将使用Pod的ServiceAccount)",
|
||||
"access.authorization.form.k8s_kubeconfig.placeholder": "请输入 KubeConfig",
|
||||
"access.authorization.form.k8s_kubeconfig_file.placeholder": "请选择文件"
|
||||
"access.form.name.label": "名称",
|
||||
"access.form.name.placeholder": "请输入授权名称",
|
||||
"access.form.type.label": "提供商",
|
||||
"access.form.type.placeholder": "请选择提供商",
|
||||
"access.form.region.label": "Region",
|
||||
"access.form.region.placeholder": "请输入区域",
|
||||
"access.form.access_key_id.label": "AccessKeyId",
|
||||
"access.form.access_key_id.placeholder": "请输入 AccessKeyId",
|
||||
"access.form.access_key_secret.label": "AccessKeySecret",
|
||||
"access.form.access_key_secret.placeholder": "请输入 AccessKeySecret",
|
||||
"access.form.access_key.label": "AccessKey",
|
||||
"access.form.access_key.placeholder": "请输入 AccessKey",
|
||||
"access.form.secret_id.label": "SecretId",
|
||||
"access.form.secret_id.placeholder": "请输入 SecretId",
|
||||
"access.form.secret_key.label": "SecretKey",
|
||||
"access.form.secret_key.placeholder": "请输入 SecretKey",
|
||||
"access.form.secret_access_key.label": "SecretAccessKey",
|
||||
"access.form.secret_access_key.placeholder": "请输入 SecretAccessKey",
|
||||
"access.form.cloud_dns_api_token.label": "CLOUD_DNS_API_TOKEN",
|
||||
"access.form.cloud_dns_api_token.placeholder": "请输入 CLOUD_DNS_API_TOKEN",
|
||||
"access.form.godaddy_api_key.label": "GO_DADDY_API_KEY",
|
||||
"access.form.godaddy_api_key.placeholder": "请输入 GO_DADDY_API_KEY",
|
||||
"access.form.godaddy_api_secret.label": "GO_DADDY_API_SECRET",
|
||||
"access.form.godaddy_api_secret.placeholder": "请输入 GO_DADDY_API_SECRET",
|
||||
"access.form.namesilo_api_key.label": "NAMESILO_API_KEY",
|
||||
"access.form.namesilo_api_key.placeholder": "请输入 NAMESILO_API_KEY",
|
||||
"access.form.pdns_api_url.label": "PDNS_API_URL",
|
||||
"access.form.pdns_api_url.placeholder": "请输入 PDNS_API_URL",
|
||||
"access.form.pdns_api_key.label": "PDNS_API_KEY",
|
||||
"access.form.pdns_api_key.placeholder": "请输入 PDNS_API_KEY",
|
||||
"access.form.httpreq_endpoint.label": "HTTP 请求端点",
|
||||
"access.form.httpreq_endpoint.placeholder": "请输入 请求端点",
|
||||
"access.form.httpreq_mode.label": "模式",
|
||||
"access.form.httpreq_mode.placeholder": "请输入模式( RAW or '')",
|
||||
"access.form.username.label": "用户名",
|
||||
"access.form.username.placeholder": "请输入用户名",
|
||||
"access.form.password.label": "密码",
|
||||
"access.form.password.placeholder": "请输入密码",
|
||||
"access.form.access_group.placeholder": "请选择分组",
|
||||
"access.form.ssh_group.label": "授权配置组(用于将一个域名证书部署到多个 SSH 主机)",
|
||||
"access.form.ssh_host.label": "服务器 Host",
|
||||
"access.form.ssh_host.placeholder": "请输入 Host",
|
||||
"access.form.ssh_port.label": "SSH 端口",
|
||||
"access.form.ssh_port.placeholder": "请输入 Port",
|
||||
"access.form.ssh_username.label": "用户名",
|
||||
"access.form.ssh_username.placeholder": "请输入用户名",
|
||||
"access.form.ssh_password.label": "密码(使用密码登录)",
|
||||
"access.form.ssh_password.placeholder": "请输入密码",
|
||||
"access.form.ssh_key.label": "Key(使用私钥登录)",
|
||||
"access.form.ssh_key.placeholder": "请输入 Key",
|
||||
"access.form.ssh_key_file.placeholder": "请选择文件",
|
||||
"access.form.ssh_key_passphrase.label": "Key 口令(使用私钥登录)",
|
||||
"access.form.ssh_key_passphrase.placeholder": "请输入 Key 口令",
|
||||
"access.form.webhook_url.label": "Webhook URL",
|
||||
"access.form.webhook_url.placeholder": "请输入 Webhook URL",
|
||||
"access.form.k8s_kubeconfig.label": "KubeConfig(不选将使用Pod的ServiceAccount)",
|
||||
"access.form.k8s_kubeconfig.placeholder": "请输入 KubeConfig",
|
||||
"access.form.k8s_kubeconfig_file.placeholder": "请选择文件"
|
||||
}
|
||||
|
@ -51,12 +51,12 @@
|
||||
"common.provider.aliyun.clb": "阿里云 - 传统型负载均衡 CLB",
|
||||
"common.provider.aliyun.alb": "阿里云 - 应用型负载均衡 ALB",
|
||||
"common.provider.aliyun.nlb": "阿里云 - 网络型负载均衡 NLB",
|
||||
"common.provider.tencent": "腾讯云",
|
||||
"common.provider.tencent.cos": "腾讯云 - 对象存储 COS",
|
||||
"common.provider.tencent.cdn": "腾讯云 - 内容分发网络 CDN",
|
||||
"common.provider.tencent.ecdn": "腾讯云 - 全站加速网络 ECDN",
|
||||
"common.provider.tencent.clb": "腾讯云 - 负载均衡 CLB",
|
||||
"common.provider.tencent.teo": "腾讯云 - 边缘安全加速平台 EdgeOne",
|
||||
"common.provider.tencentcloud": "腾讯云",
|
||||
"common.provider.tencentcloud.cos": "腾讯云 - 对象存储 COS",
|
||||
"common.provider.tencentcloud.cdn": "腾讯云 - 内容分发网络 CDN",
|
||||
"common.provider.tencentcloud.ecdn": "腾讯云 - 全站加速网络 ECDN",
|
||||
"common.provider.tencentcloud.clb": "腾讯云 - 负载均衡 CLB",
|
||||
"common.provider.tencentcloud.eo": "腾讯云 - 边缘安全加速平台 EdgeOne",
|
||||
"common.provider.huaweicloud": "华为云",
|
||||
"common.provider.huaweicloud.cdn": "华为云 - 内容分发网络 CDN",
|
||||
"common.provider.huaweicloud.elb": "华为云 - 弹性负载均衡 ELB",
|
||||
@ -70,8 +70,8 @@
|
||||
"common.provider.cloudflare": "Cloudflare",
|
||||
"common.provider.namesilo": "Namesilo",
|
||||
"common.provider.godaddy": "GoDaddy",
|
||||
"common.provider.pdns": "PowerDNS",
|
||||
"common.provider.httpreq": "Http Request",
|
||||
"common.provider.powerdns": "PowerDNS",
|
||||
"common.provider.acmehttpreq": "Http Request (ACME Proxy)",
|
||||
"common.provider.local": "本地部署",
|
||||
"common.provider.ssh": "SSH 部署",
|
||||
"common.provider.webhook": "Webhook",
|
||||
|
Loading…
x
Reference in New Issue
Block a user