mirror of
https://github.com/usual2970/certimate.git
synced 2025-06-07 21:19:51 +00:00
Merge branch 'main' into feat/providers
This commit is contained in:
commit
b139139f50
@ -476,7 +476,7 @@ func createApplicantProvider(options *applicantProviderOptions) (challenge.Provi
|
||||
}
|
||||
|
||||
applicant, err := pPowerDNS.NewChallengeProvider(&pPowerDNS.ChallengeProviderConfig{
|
||||
ApiUrl: access.ApiUrl,
|
||||
ServerUrl: access.ServerUrl,
|
||||
ApiKey: access.ApiKey,
|
||||
AllowInsecureConnections: access.AllowInsecureConnections,
|
||||
DnsPropagationTimeout: options.DnsPropagationTimeout,
|
||||
|
@ -119,7 +119,7 @@ func createDeployerProvider(options *deployerProviderOptions) (deployer.Deployer
|
||||
switch options.Provider {
|
||||
case domain.DeploymentProviderType1PanelConsole:
|
||||
deployer, err := p1PanelConsole.NewDeployer(&p1PanelConsole.DeployerConfig{
|
||||
ApiUrl: access.ApiUrl,
|
||||
ServerUrl: access.ServerUrl,
|
||||
ApiVersion: access.ApiVersion,
|
||||
ApiKey: access.ApiKey,
|
||||
AllowInsecureConnections: access.AllowInsecureConnections,
|
||||
@ -129,7 +129,7 @@ func createDeployerProvider(options *deployerProviderOptions) (deployer.Deployer
|
||||
|
||||
case domain.DeploymentProviderType1PanelSite:
|
||||
deployer, err := p1PanelSite.NewDeployer(&p1PanelSite.DeployerConfig{
|
||||
ApiUrl: access.ApiUrl,
|
||||
ServerUrl: access.ServerUrl,
|
||||
ApiVersion: access.ApiVersion,
|
||||
ApiKey: access.ApiKey,
|
||||
AllowInsecureConnections: access.AllowInsecureConnections,
|
||||
@ -454,7 +454,7 @@ func createDeployerProvider(options *deployerProviderOptions) (deployer.Deployer
|
||||
switch options.Provider {
|
||||
case domain.DeploymentProviderTypeBaotaPanelConsole:
|
||||
deployer, err := pBaotaPanelConsole.NewDeployer(&pBaotaPanelConsole.DeployerConfig{
|
||||
ApiUrl: access.ApiUrl,
|
||||
ServerUrl: access.ServerUrl,
|
||||
ApiKey: access.ApiKey,
|
||||
AllowInsecureConnections: access.AllowInsecureConnections,
|
||||
AutoRestart: maputil.GetBool(options.ProviderServiceConfig, "autoRestart"),
|
||||
@ -463,7 +463,7 @@ func createDeployerProvider(options *deployerProviderOptions) (deployer.Deployer
|
||||
|
||||
case domain.DeploymentProviderTypeBaotaPanelSite:
|
||||
deployer, err := pBaotaPanelSite.NewDeployer(&pBaotaPanelSite.DeployerConfig{
|
||||
ApiUrl: access.ApiUrl,
|
||||
ServerUrl: access.ServerUrl,
|
||||
ApiKey: access.ApiKey,
|
||||
AllowInsecureConnections: access.AllowInsecureConnections,
|
||||
SiteType: maputil.GetOrDefaultString(options.ProviderServiceConfig, "siteType", "other"),
|
||||
@ -487,7 +487,7 @@ func createDeployerProvider(options *deployerProviderOptions) (deployer.Deployer
|
||||
switch options.Provider {
|
||||
case domain.DeploymentProviderTypeBaotaWAFConsole:
|
||||
deployer, err := pBaotaWAFConsole.NewDeployer(&pBaotaWAFConsole.DeployerConfig{
|
||||
ApiUrl: access.ApiUrl,
|
||||
ServerUrl: access.ServerUrl,
|
||||
ApiKey: access.ApiKey,
|
||||
AllowInsecureConnections: access.AllowInsecureConnections,
|
||||
})
|
||||
@ -495,7 +495,7 @@ func createDeployerProvider(options *deployerProviderOptions) (deployer.Deployer
|
||||
|
||||
case domain.DeploymentProviderTypeBaotaWAFSite:
|
||||
deployer, err := pBaotaWAFSite.NewDeployer(&pBaotaWAFSite.DeployerConfig{
|
||||
ApiUrl: access.ApiUrl,
|
||||
ServerUrl: access.ServerUrl,
|
||||
ApiKey: access.ApiKey,
|
||||
AllowInsecureConnections: access.AllowInsecureConnections,
|
||||
SiteName: maputil.GetString(options.ProviderServiceConfig, "siteName"),
|
||||
@ -565,7 +565,7 @@ func createDeployerProvider(options *deployerProviderOptions) (deployer.Deployer
|
||||
}
|
||||
|
||||
deployer, err := pCdnfly.NewDeployer(&pCdnfly.DeployerConfig{
|
||||
ApiUrl: access.ApiUrl,
|
||||
ServerUrl: access.ServerUrl,
|
||||
ApiKey: access.ApiKey,
|
||||
ApiSecret: access.ApiSecret,
|
||||
AllowInsecureConnections: access.AllowInsecureConnections,
|
||||
@ -614,7 +614,7 @@ func createDeployerProvider(options *deployerProviderOptions) (deployer.Deployer
|
||||
}
|
||||
|
||||
deployer, err := pFlexCDN.NewDeployer(&pFlexCDN.DeployerConfig{
|
||||
ApiUrl: access.ApiUrl,
|
||||
ServerUrl: access.ServerUrl,
|
||||
ApiRole: access.ApiRole,
|
||||
AccessKeyId: access.AccessKeyId,
|
||||
AccessKey: access.AccessKey,
|
||||
@ -654,7 +654,7 @@ func createDeployerProvider(options *deployerProviderOptions) (deployer.Deployer
|
||||
}
|
||||
|
||||
deployer, err := pGoEdge.NewDeployer(&pGoEdge.DeployerConfig{
|
||||
ApiUrl: access.ApiUrl,
|
||||
ServerUrl: access.ServerUrl,
|
||||
ApiRole: access.ApiRole,
|
||||
AccessKeyId: access.AccessKeyId,
|
||||
AccessKey: access.AccessKey,
|
||||
@ -773,7 +773,7 @@ func createDeployerProvider(options *deployerProviderOptions) (deployer.Deployer
|
||||
}
|
||||
|
||||
deployer, err := pLeCDN.NewDeployer(&pLeCDN.DeployerConfig{
|
||||
ApiUrl: access.ApiUrl,
|
||||
ServerUrl: access.ServerUrl,
|
||||
ApiVersion: access.ApiVersion,
|
||||
ApiRole: access.ApiRole,
|
||||
Username: access.Username,
|
||||
@ -845,7 +845,7 @@ func createDeployerProvider(options *deployerProviderOptions) (deployer.Deployer
|
||||
}
|
||||
|
||||
deployer, err := pProxmoxVE.NewDeployer(&pProxmoxVE.DeployerConfig{
|
||||
ApiUrl: access.ApiUrl,
|
||||
ServerUrl: access.ServerUrl,
|
||||
ApiToken: access.ApiToken,
|
||||
ApiTokenSecret: access.ApiTokenSecret,
|
||||
AllowInsecureConnections: access.AllowInsecureConnections,
|
||||
@ -916,7 +916,7 @@ func createDeployerProvider(options *deployerProviderOptions) (deployer.Deployer
|
||||
switch options.Provider {
|
||||
case domain.DeploymentProviderTypeRatPanelConsole:
|
||||
deployer, err := pRatPanelConsole.NewDeployer(&pRatPanelConsole.DeployerConfig{
|
||||
ApiUrl: access.ApiUrl,
|
||||
ServerUrl: access.ServerUrl,
|
||||
AccessTokenId: access.AccessTokenId,
|
||||
AccessToken: access.AccessToken,
|
||||
AllowInsecureConnections: access.AllowInsecureConnections,
|
||||
@ -925,7 +925,7 @@ func createDeployerProvider(options *deployerProviderOptions) (deployer.Deployer
|
||||
|
||||
case domain.DeploymentProviderTypeRatPanelSite:
|
||||
deployer, err := pRatPanelSite.NewDeployer(&pRatPanelSite.DeployerConfig{
|
||||
ApiUrl: access.ApiUrl,
|
||||
ServerUrl: access.ServerUrl,
|
||||
AccessTokenId: access.AccessTokenId,
|
||||
AccessToken: access.AccessToken,
|
||||
AllowInsecureConnections: access.AllowInsecureConnections,
|
||||
@ -946,7 +946,7 @@ func createDeployerProvider(options *deployerProviderOptions) (deployer.Deployer
|
||||
}
|
||||
|
||||
deployer, err := pSafeLine.NewDeployer(&pSafeLine.DeployerConfig{
|
||||
ApiUrl: access.ApiUrl,
|
||||
ServerUrl: access.ServerUrl,
|
||||
ApiToken: access.ApiToken,
|
||||
AllowInsecureConnections: access.AllowInsecureConnections,
|
||||
ResourceType: pSafeLine.ResourceType(maputil.GetString(options.ProviderServiceConfig, "resourceType")),
|
||||
|
@ -16,7 +16,7 @@ type Access struct {
|
||||
}
|
||||
|
||||
type AccessConfigFor1Panel struct {
|
||||
ApiUrl string `json:"apiUrl"`
|
||||
ServerUrl string `json:"serverUrl"`
|
||||
ApiVersion string `json:"apiVersion"`
|
||||
ApiKey string `json:"apiKey"`
|
||||
AllowInsecureConnections bool `json:"allowInsecureConnections,omitempty"`
|
||||
@ -62,13 +62,13 @@ type AccessConfigForBaishan struct {
|
||||
}
|
||||
|
||||
type AccessConfigForBaotaPanel struct {
|
||||
ApiUrl string `json:"apiUrl"`
|
||||
ServerUrl string `json:"serverUrl"`
|
||||
ApiKey string `json:"apiKey"`
|
||||
AllowInsecureConnections bool `json:"allowInsecureConnections,omitempty"`
|
||||
}
|
||||
|
||||
type AccessConfigForBaotaWAF struct {
|
||||
ApiUrl string `json:"apiUrl"`
|
||||
ServerUrl string `json:"serverUrl"`
|
||||
ApiKey string `json:"apiKey"`
|
||||
AllowInsecureConnections bool `json:"allowInsecureConnections,omitempty"`
|
||||
}
|
||||
@ -87,7 +87,7 @@ type AccessConfigForCacheFly struct {
|
||||
}
|
||||
|
||||
type AccessConfigForCdnfly struct {
|
||||
ApiUrl string `json:"apiUrl"`
|
||||
ServerUrl string `json:"serverUrl"`
|
||||
ApiKey string `json:"apiKey"`
|
||||
ApiSecret string `json:"apiSecret"`
|
||||
AllowInsecureConnections bool `json:"allowInsecureConnections,omitempty"`
|
||||
@ -147,7 +147,7 @@ type AccessConfigForEmail struct {
|
||||
}
|
||||
|
||||
type AccessConfigForFlexCDN struct {
|
||||
ApiUrl string `json:"apiUrl"`
|
||||
ServerUrl string `json:"serverUrl"`
|
||||
ApiRole string `json:"apiRole"`
|
||||
AccessKeyId string `json:"accessKeyId"`
|
||||
AccessKey string `json:"accessKey"`
|
||||
@ -169,7 +169,7 @@ type AccessConfigForGoDaddy struct {
|
||||
}
|
||||
|
||||
type AccessConfigForGoEdge struct {
|
||||
ApiUrl string `json:"apiUrl"`
|
||||
ServerUrl string `json:"serverUrl"`
|
||||
ApiRole string `json:"apiRole"`
|
||||
AccessKeyId string `json:"accessKeyId"`
|
||||
AccessKey string `json:"accessKey"`
|
||||
@ -200,7 +200,7 @@ type AccessConfigForLarkBot struct {
|
||||
}
|
||||
|
||||
type AccessConfigForLeCDN struct {
|
||||
ApiUrl string `json:"apiUrl"`
|
||||
ServerUrl string `json:"serverUrl"`
|
||||
ApiVersion string `json:"apiVersion"`
|
||||
ApiRole string `json:"apiRole"`
|
||||
Username string `json:"username"`
|
||||
@ -249,13 +249,13 @@ type AccessConfigForPorkbun struct {
|
||||
}
|
||||
|
||||
type AccessConfigForPowerDNS struct {
|
||||
ApiUrl string `json:"apiUrl"`
|
||||
ServerUrl string `json:"serverUrl"`
|
||||
ApiKey string `json:"apiKey"`
|
||||
AllowInsecureConnections bool `json:"allowInsecureConnections,omitempty"`
|
||||
}
|
||||
|
||||
type AccessConfigForProxmoxVE struct {
|
||||
ApiUrl string `json:"apiUrl"`
|
||||
ServerUrl string `json:"serverUrl"`
|
||||
ApiToken string `json:"apiToken"`
|
||||
ApiTokenSecret string `json:"apiTokenSecret,omitempty"`
|
||||
AllowInsecureConnections bool `json:"allowInsecureConnections,omitempty"`
|
||||
@ -271,14 +271,14 @@ type AccessConfigForRainYun struct {
|
||||
}
|
||||
|
||||
type AccessConfigForRatPanel struct {
|
||||
ApiUrl string `json:"apiUrl"`
|
||||
ServerUrl string `json:"serverUrl"`
|
||||
AccessTokenId int32 `json:"accessTokenId"`
|
||||
AccessToken string `json:"accessToken"`
|
||||
AllowInsecureConnections bool `json:"allowInsecureConnections,omitempty"`
|
||||
}
|
||||
|
||||
type AccessConfigForSafeLine struct {
|
||||
ApiUrl string `json:"apiUrl"`
|
||||
ServerUrl string `json:"serverUrl"`
|
||||
ApiToken string `json:"apiToken"`
|
||||
AllowInsecureConnections bool `json:"allowInsecureConnections,omitempty"`
|
||||
}
|
||||
|
@ -102,9 +102,10 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error {
|
||||
return fmt.Errorf("alicloud-esa: could not find zone for domain %q: %w", domain, err)
|
||||
}
|
||||
|
||||
siteId, err := d.getSiteId(strings.TrimRight(authZone, "."))
|
||||
siteName := strings.TrimRight(authZone, ".")
|
||||
siteId, err := d.getSiteId(siteName)
|
||||
if err != nil {
|
||||
return fmt.Errorf("alicloud-esa: could not find site for zone %q: %w", authZone, err)
|
||||
return fmt.Errorf("alicloud-esa: could not find site for zone %q: %w", siteName, err)
|
||||
}
|
||||
|
||||
if err := d.addOrUpdateDNSRecord(siteId, strings.TrimRight(info.EffectiveFQDN, "."), info.Value); err != nil {
|
||||
@ -122,9 +123,10 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error {
|
||||
return fmt.Errorf("alicloud-esa: could not find zone for domain %q: %w", domain, err)
|
||||
}
|
||||
|
||||
siteId, err := d.getSiteId(strings.TrimRight(authZone, "."))
|
||||
siteName := strings.TrimRight(authZone, ".")
|
||||
siteId, err := d.getSiteId(siteName)
|
||||
if err != nil {
|
||||
return fmt.Errorf("alicloud-esa: could not find site for zone %q: %w", authZone, err)
|
||||
return fmt.Errorf("alicloud-esa: could not find site for zone %q: %w", siteName, err)
|
||||
}
|
||||
|
||||
if err := d.removeDNSRecord(siteId, strings.TrimRight(info.EffectiveFQDN, ".")); err != nil {
|
||||
|
@ -11,7 +11,7 @@ import (
|
||||
)
|
||||
|
||||
type ChallengeProviderConfig struct {
|
||||
ApiUrl string `json:"apiUrl"`
|
||||
ServerUrl string `json:"serverUrl"`
|
||||
ApiKey string `json:"apiKey"`
|
||||
AllowInsecureConnections bool `json:"allowInsecureConnections,omitempty"`
|
||||
DnsPropagationTimeout int32 `json:"dnsPropagationTimeout,omitempty"`
|
||||
@ -23,9 +23,9 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (challenge.Provider,
|
||||
panic("config is nil")
|
||||
}
|
||||
|
||||
host, _ := url.Parse(config.ApiUrl)
|
||||
serverUrl, _ := url.Parse(config.ServerUrl)
|
||||
providerConfig := pdns.NewDefaultConfig()
|
||||
providerConfig.Host = host
|
||||
providerConfig.Host = serverUrl
|
||||
providerConfig.APIKey = config.ApiKey
|
||||
if config.AllowInsecureConnections {
|
||||
providerConfig.HTTPClient.Transport = &http.Transport{
|
||||
|
@ -13,8 +13,8 @@ import (
|
||||
)
|
||||
|
||||
type DeployerConfig struct {
|
||||
// 1Panel 地址。
|
||||
ApiUrl string `json:"apiUrl"`
|
||||
// 1Panel 服务地址。
|
||||
ServerUrl string `json:"serverUrl"`
|
||||
// 1Panel 版本。
|
||||
// 可取值 "v1"、"v2"。
|
||||
ApiVersion string `json:"apiVersion"`
|
||||
@ -39,7 +39,7 @@ func NewDeployer(config *DeployerConfig) (*DeployerProvider, error) {
|
||||
panic("config is nil")
|
||||
}
|
||||
|
||||
client, err := createSdkClient(config.ApiUrl, config.ApiVersion, config.ApiKey, config.AllowInsecureConnections)
|
||||
client, err := createSdkClient(config.ServerUrl, config.ApiVersion, config.ApiKey, config.AllowInsecureConnections)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to create sdk client: %w", err)
|
||||
}
|
||||
@ -82,9 +82,9 @@ func (d *DeployerProvider) Deploy(ctx context.Context, certPEM string, privkeyPE
|
||||
return &deployer.DeployResult{}, nil
|
||||
}
|
||||
|
||||
func createSdkClient(apiUrl, apiVersion, apiKey string, skipTlsVerify bool) (*onepanelsdk.Client, error) {
|
||||
if _, err := url.Parse(apiUrl); err != nil {
|
||||
return nil, errors.New("invalid 1panel api url")
|
||||
func createSdkClient(serverUrl, apiVersion, apiKey string, skipTlsVerify bool) (*onepanelsdk.Client, error) {
|
||||
if _, err := url.Parse(serverUrl); err != nil {
|
||||
return nil, errors.New("invalid 1panel server url")
|
||||
}
|
||||
|
||||
if apiVersion == "" {
|
||||
@ -95,7 +95,7 @@ func createSdkClient(apiUrl, apiVersion, apiKey string, skipTlsVerify bool) (*on
|
||||
return nil, errors.New("invalid 1panel api key")
|
||||
}
|
||||
|
||||
client := onepanelsdk.NewClient(apiUrl, apiVersion, apiKey)
|
||||
client := onepanelsdk.NewClient(serverUrl, apiVersion, apiKey)
|
||||
if skipTlsVerify {
|
||||
client.WithTLSConfig(&tls.Config{InsecureSkipVerify: true})
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ import (
|
||||
var (
|
||||
fInputCertPath string
|
||||
fInputKeyPath string
|
||||
fApiUrl string
|
||||
fServerUrl string
|
||||
fApiVersion string
|
||||
fApiKey string
|
||||
)
|
||||
@ -24,7 +24,7 @@ func init() {
|
||||
|
||||
flag.StringVar(&fInputCertPath, argsPrefix+"INPUTCERTPATH", "", "")
|
||||
flag.StringVar(&fInputKeyPath, argsPrefix+"INPUTKEYPATH", "", "")
|
||||
flag.StringVar(&fApiUrl, argsPrefix+"APIURL", "", "")
|
||||
flag.StringVar(&fServerUrl, argsPrefix+"SERVERURL", "", "")
|
||||
flag.StringVar(&fApiVersion, argsPrefix+"APIVERSION", "v1", "")
|
||||
flag.StringVar(&fApiKey, argsPrefix+"APIKEY", "", "")
|
||||
}
|
||||
@ -35,7 +35,7 @@ Shell command to run this test:
|
||||
go test -v ./1panel_console_test.go -args \
|
||||
--CERTIMATE_DEPLOYER_1PANELCONSOLE_INPUTCERTPATH="/path/to/your-input-cert.pem" \
|
||||
--CERTIMATE_DEPLOYER_1PANELCONSOLE_INPUTKEYPATH="/path/to/your-input-key.pem" \
|
||||
--CERTIMATE_DEPLOYER_1PANELCONSOLE_APIURL="http://127.0.0.1:20410" \
|
||||
--CERTIMATE_DEPLOYER_1PANELCONSOLE_SERVERURL="http://127.0.0.1:20410" \
|
||||
--CERTIMATE_DEPLOYER_1PANELCONSOLE_APIVERSION="v1" \
|
||||
--CERTIMATE_DEPLOYER_1PANELCONSOLE_APIKEY="your-api-key"
|
||||
*/
|
||||
@ -47,13 +47,13 @@ func TestDeploy(t *testing.T) {
|
||||
"args:",
|
||||
fmt.Sprintf("INPUTCERTPATH: %v", fInputCertPath),
|
||||
fmt.Sprintf("INPUTKEYPATH: %v", fInputKeyPath),
|
||||
fmt.Sprintf("APIURL: %v", fApiUrl),
|
||||
fmt.Sprintf("SERVERURL: %v", fServerUrl),
|
||||
fmt.Sprintf("APIVERSION: %v", fApiVersion),
|
||||
fmt.Sprintf("APIKEY: %v", fApiKey),
|
||||
}, "\n"))
|
||||
|
||||
deployer, err := provider.NewDeployer(&provider.DeployerConfig{
|
||||
ApiUrl: fApiUrl,
|
||||
ServerUrl: fServerUrl,
|
||||
ApiVersion: fApiVersion,
|
||||
ApiKey: fApiKey,
|
||||
AllowInsecureConnections: true,
|
||||
|
@ -16,8 +16,8 @@ import (
|
||||
)
|
||||
|
||||
type DeployerConfig struct {
|
||||
// 1Panel 地址。
|
||||
ApiUrl string `json:"apiUrl"`
|
||||
// 1Panel 服务地址。
|
||||
ServerUrl string `json:"serverUrl"`
|
||||
// 1Panel 版本。
|
||||
// 可取值 "v1"、"v2"。
|
||||
ApiVersion string `json:"apiVersion"`
|
||||
@ -49,13 +49,13 @@ func NewDeployer(config *DeployerConfig) (*DeployerProvider, error) {
|
||||
panic("config is nil")
|
||||
}
|
||||
|
||||
client, err := createSdkClient(config.ApiUrl, config.ApiVersion, config.ApiKey, config.AllowInsecureConnections)
|
||||
client, err := createSdkClient(config.ServerUrl, config.ApiVersion, config.ApiKey, config.AllowInsecureConnections)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to create sdk client: %w", err)
|
||||
}
|
||||
|
||||
uploader, err := uploadersp.NewUploader(&uploadersp.UploaderConfig{
|
||||
ApiUrl: config.ApiUrl,
|
||||
ServerUrl: config.ServerUrl,
|
||||
ApiVersion: config.ApiVersion,
|
||||
ApiKey: config.ApiKey,
|
||||
AllowInsecureConnections: config.AllowInsecureConnections,
|
||||
@ -178,9 +178,9 @@ func (d *DeployerProvider) deployToCertificate(ctx context.Context, certPEM stri
|
||||
return nil
|
||||
}
|
||||
|
||||
func createSdkClient(apiUrl, apiVersion, apiKey string, skipTlsVerify bool) (*onepanelsdk.Client, error) {
|
||||
if _, err := url.Parse(apiUrl); err != nil {
|
||||
return nil, errors.New("invalid 1panel api url")
|
||||
func createSdkClient(serverUrl, apiVersion, apiKey string, skipTlsVerify bool) (*onepanelsdk.Client, error) {
|
||||
if _, err := url.Parse(serverUrl); err != nil {
|
||||
return nil, errors.New("invalid 1panel server url")
|
||||
}
|
||||
|
||||
if apiVersion == "" {
|
||||
@ -191,7 +191,7 @@ func createSdkClient(apiUrl, apiVersion, apiKey string, skipTlsVerify bool) (*on
|
||||
return nil, errors.New("invalid 1panel api key")
|
||||
}
|
||||
|
||||
client := onepanelsdk.NewClient(apiUrl, apiVersion, apiKey)
|
||||
client := onepanelsdk.NewClient(serverUrl, apiVersion, apiKey)
|
||||
if skipTlsVerify {
|
||||
client.WithTLSConfig(&tls.Config{InsecureSkipVerify: true})
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ import (
|
||||
var (
|
||||
fInputCertPath string
|
||||
fInputKeyPath string
|
||||
fApiUrl string
|
||||
fServerUrl string
|
||||
fApiVersion string
|
||||
fApiKey string
|
||||
fWebsiteId int64
|
||||
@ -25,7 +25,7 @@ func init() {
|
||||
|
||||
flag.StringVar(&fInputCertPath, argsPrefix+"INPUTCERTPATH", "", "")
|
||||
flag.StringVar(&fInputKeyPath, argsPrefix+"INPUTKEYPATH", "", "")
|
||||
flag.StringVar(&fApiUrl, argsPrefix+"APIURL", "", "")
|
||||
flag.StringVar(&fServerUrl, argsPrefix+"SERVERURL", "", "")
|
||||
flag.StringVar(&fApiVersion, argsPrefix+"APIVERSION", "v1", "")
|
||||
flag.StringVar(&fApiKey, argsPrefix+"APIKEY", "", "")
|
||||
flag.Int64Var(&fWebsiteId, argsPrefix+"WEBSITEID", 0, "")
|
||||
@ -37,7 +37,7 @@ Shell command to run this test:
|
||||
go test -v ./1panel_site_test.go -args \
|
||||
--CERTIMATE_DEPLOYER_1PANELSITE_INPUTCERTPATH="/path/to/your-input-cert.pem" \
|
||||
--CERTIMATE_DEPLOYER_1PANELSITE_INPUTKEYPATH="/path/to/your-input-key.pem" \
|
||||
--CERTIMATE_DEPLOYER_1PANELSITE_APIURL="http://127.0.0.1:20410" \
|
||||
--CERTIMATE_DEPLOYER_1PANELSITE_SERVERURL="http://127.0.0.1:20410" \
|
||||
--CERTIMATE_DEPLOYER_1PANELSITE_APIVERSION="v1" \
|
||||
--CERTIMATE_DEPLOYER_1PANELSITE_APIKEY="your-api-key" \
|
||||
--CERTIMATE_DEPLOYER_1PANELSITE_WEBSITEID="your-website-id"
|
||||
@ -50,14 +50,14 @@ func TestDeploy(t *testing.T) {
|
||||
"args:",
|
||||
fmt.Sprintf("INPUTCERTPATH: %v", fInputCertPath),
|
||||
fmt.Sprintf("INPUTKEYPATH: %v", fInputKeyPath),
|
||||
fmt.Sprintf("APIURL: %v", fApiUrl),
|
||||
fmt.Sprintf("SERVERURL: %v", fServerUrl),
|
||||
fmt.Sprintf("APIVERSION: %v", fApiVersion),
|
||||
fmt.Sprintf("APIKEY: %v", fApiKey),
|
||||
fmt.Sprintf("WEBSITEID: %v", fWebsiteId),
|
||||
}, "\n"))
|
||||
|
||||
deployer, err := provider.NewDeployer(&provider.DeployerConfig{
|
||||
ApiUrl: fApiUrl,
|
||||
ServerUrl: fServerUrl,
|
||||
ApiVersion: fApiVersion,
|
||||
ApiKey: fApiKey,
|
||||
AllowInsecureConnections: true,
|
||||
|
@ -13,8 +13,8 @@ import (
|
||||
)
|
||||
|
||||
type DeployerConfig struct {
|
||||
// 宝塔面板地址。
|
||||
ApiUrl string `json:"apiUrl"`
|
||||
// 宝塔面板服务地址。
|
||||
ServerUrl string `json:"serverUrl"`
|
||||
// 宝塔面板接口密钥。
|
||||
ApiKey string `json:"apiKey"`
|
||||
// 是否允许不安全的连接。
|
||||
@ -36,7 +36,7 @@ func NewDeployer(config *DeployerConfig) (*DeployerProvider, error) {
|
||||
panic("config is nil")
|
||||
}
|
||||
|
||||
client, err := createSdkClient(config.ApiUrl, config.ApiKey, config.AllowInsecureConnections)
|
||||
client, err := createSdkClient(config.ServerUrl, config.ApiKey, config.AllowInsecureConnections)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to create sdk client: %w", err)
|
||||
}
|
||||
@ -82,16 +82,16 @@ func (d *DeployerProvider) Deploy(ctx context.Context, certPEM string, privkeyPE
|
||||
return &deployer.DeployResult{}, nil
|
||||
}
|
||||
|
||||
func createSdkClient(apiUrl, apiKey string, skipTlsVerify bool) (*btsdk.Client, error) {
|
||||
if _, err := url.Parse(apiUrl); err != nil {
|
||||
return nil, errors.New("invalid baota api url")
|
||||
func createSdkClient(serverUrl, apiKey string, skipTlsVerify bool) (*btsdk.Client, error) {
|
||||
if _, err := url.Parse(serverUrl); err != nil {
|
||||
return nil, errors.New("invalid baota server url")
|
||||
}
|
||||
|
||||
if apiKey == "" {
|
||||
return nil, errors.New("invalid baota api key")
|
||||
}
|
||||
|
||||
client := btsdk.NewClient(apiUrl, apiKey)
|
||||
client := btsdk.NewClient(serverUrl, apiKey)
|
||||
if skipTlsVerify {
|
||||
client.WithTLSConfig(&tls.Config{InsecureSkipVerify: true})
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ import (
|
||||
var (
|
||||
fInputCertPath string
|
||||
fInputKeyPath string
|
||||
fApiUrl string
|
||||
fServerUrl string
|
||||
fApiKey string
|
||||
)
|
||||
|
||||
@ -23,7 +23,7 @@ func init() {
|
||||
|
||||
flag.StringVar(&fInputCertPath, argsPrefix+"INPUTCERTPATH", "", "")
|
||||
flag.StringVar(&fInputKeyPath, argsPrefix+"INPUTKEYPATH", "", "")
|
||||
flag.StringVar(&fApiUrl, argsPrefix+"APIURL", "", "")
|
||||
flag.StringVar(&fServerUrl, argsPrefix+"SERVERURL", "", "")
|
||||
flag.StringVar(&fApiKey, argsPrefix+"APIKEY", "", "")
|
||||
}
|
||||
|
||||
@ -33,7 +33,7 @@ Shell command to run this test:
|
||||
go test -v ./baotapanel_console_test.go -args \
|
||||
--CERTIMATE_DEPLOYER_BAOTAPANELCONSOLE_INPUTCERTPATH="/path/to/your-input-cert.pem" \
|
||||
--CERTIMATE_DEPLOYER_BAOTAPANELCONSOLE_INPUTKEYPATH="/path/to/your-input-key.pem" \
|
||||
--CERTIMATE_DEPLOYER_BAOTAPANELCONSOLE_APIURL="http://127.0.0.1:8888" \
|
||||
--CERTIMATE_DEPLOYER_BAOTAPANELCONSOLE_SERVERURL="http://127.0.0.1:8888" \
|
||||
--CERTIMATE_DEPLOYER_BAOTAPANELCONSOLE_APIKEY="your-api-key"
|
||||
*/
|
||||
func TestDeploy(t *testing.T) {
|
||||
@ -44,12 +44,12 @@ func TestDeploy(t *testing.T) {
|
||||
"args:",
|
||||
fmt.Sprintf("INPUTCERTPATH: %v", fInputCertPath),
|
||||
fmt.Sprintf("INPUTKEYPATH: %v", fInputKeyPath),
|
||||
fmt.Sprintf("APIURL: %v", fApiUrl),
|
||||
fmt.Sprintf("SERVERURL: %v", fServerUrl),
|
||||
fmt.Sprintf("APIKEY: %v", fApiKey),
|
||||
}, "\n"))
|
||||
|
||||
deployer, err := provider.NewDeployer(&provider.DeployerConfig{
|
||||
ApiUrl: fApiUrl,
|
||||
ServerUrl: fServerUrl,
|
||||
ApiKey: fApiKey,
|
||||
AllowInsecureConnections: true,
|
||||
AutoRestart: true,
|
||||
|
@ -14,8 +14,8 @@ import (
|
||||
)
|
||||
|
||||
type DeployerConfig struct {
|
||||
// 宝塔面板地址。
|
||||
ApiUrl string `json:"apiUrl"`
|
||||
// 宝塔面板服务地址。
|
||||
ServerUrl string `json:"serverUrl"`
|
||||
// 宝塔面板接口密钥。
|
||||
ApiKey string `json:"apiKey"`
|
||||
// 是否允许不安全的连接。
|
||||
@ -41,7 +41,7 @@ func NewDeployer(config *DeployerConfig) (*DeployerProvider, error) {
|
||||
panic("config is nil")
|
||||
}
|
||||
|
||||
client, err := createSdkClient(config.ApiUrl, config.ApiKey, config.AllowInsecureConnections)
|
||||
client, err := createSdkClient(config.ServerUrl, config.ApiKey, config.AllowInsecureConnections)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to create sdk client: %w", err)
|
||||
}
|
||||
@ -124,16 +124,16 @@ func (d *DeployerProvider) Deploy(ctx context.Context, certPEM string, privkeyPE
|
||||
return &deployer.DeployResult{}, nil
|
||||
}
|
||||
|
||||
func createSdkClient(apiUrl, apiKey string, skipTlsVerify bool) (*btsdk.Client, error) {
|
||||
if _, err := url.Parse(apiUrl); err != nil {
|
||||
return nil, errors.New("invalid baota api url")
|
||||
func createSdkClient(serverUrl, apiKey string, skipTlsVerify bool) (*btsdk.Client, error) {
|
||||
if _, err := url.Parse(serverUrl); err != nil {
|
||||
return nil, errors.New("invalid baota server url")
|
||||
}
|
||||
|
||||
if apiKey == "" {
|
||||
return nil, errors.New("invalid baota api key")
|
||||
}
|
||||
|
||||
client := btsdk.NewClient(apiUrl, apiKey)
|
||||
client := btsdk.NewClient(serverUrl, apiKey)
|
||||
if skipTlsVerify {
|
||||
client.WithTLSConfig(&tls.Config{InsecureSkipVerify: true})
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ import (
|
||||
var (
|
||||
fInputCertPath string
|
||||
fInputKeyPath string
|
||||
fApiUrl string
|
||||
fServerUrl string
|
||||
fApiKey string
|
||||
fSiteType string
|
||||
fSiteName string
|
||||
@ -25,7 +25,7 @@ func init() {
|
||||
|
||||
flag.StringVar(&fInputCertPath, argsPrefix+"INPUTCERTPATH", "", "")
|
||||
flag.StringVar(&fInputKeyPath, argsPrefix+"INPUTKEYPATH", "", "")
|
||||
flag.StringVar(&fApiUrl, argsPrefix+"APIURL", "", "")
|
||||
flag.StringVar(&fServerUrl, argsPrefix+"SERVERURL", "", "")
|
||||
flag.StringVar(&fApiKey, argsPrefix+"APIKEY", "", "")
|
||||
flag.StringVar(&fSiteType, argsPrefix+"SITETYPE", "", "")
|
||||
flag.StringVar(&fSiteName, argsPrefix+"SITENAME", "", "")
|
||||
@ -37,7 +37,7 @@ Shell command to run this test:
|
||||
go test -v ./baotapanel_site_test.go -args \
|
||||
--CERTIMATE_DEPLOYER_BAOTAPANELSITE_INPUTCERTPATH="/path/to/your-input-cert.pem" \
|
||||
--CERTIMATE_DEPLOYER_BAOTAPANELSITE_INPUTKEYPATH="/path/to/your-input-key.pem" \
|
||||
--CERTIMATE_DEPLOYER_BAOTAPANELSITE_APIURL="http://127.0.0.1:8888" \
|
||||
--CERTIMATE_DEPLOYER_BAOTAPANELSITE_SERVERURL="http://127.0.0.1:8888" \
|
||||
--CERTIMATE_DEPLOYER_BAOTAPANELSITE_APIKEY="your-api-key" \
|
||||
--CERTIMATE_DEPLOYER_BAOTAPANELSITE_SITETYPE="php" \
|
||||
--CERTIMATE_DEPLOYER_BAOTAPANELSITE_SITENAME="your-site-name"
|
||||
@ -50,14 +50,14 @@ func TestDeploy(t *testing.T) {
|
||||
"args:",
|
||||
fmt.Sprintf("INPUTCERTPATH: %v", fInputCertPath),
|
||||
fmt.Sprintf("INPUTKEYPATH: %v", fInputKeyPath),
|
||||
fmt.Sprintf("APIURL: %v", fApiUrl),
|
||||
fmt.Sprintf("SERVERURL: %v", fServerUrl),
|
||||
fmt.Sprintf("APIKEY: %v", fApiKey),
|
||||
fmt.Sprintf("SITETYPE: %v", fSiteType),
|
||||
fmt.Sprintf("SITENAME: %v", fSiteName),
|
||||
}, "\n"))
|
||||
|
||||
deployer, err := provider.NewDeployer(&provider.DeployerConfig{
|
||||
ApiUrl: fApiUrl,
|
||||
ServerUrl: fServerUrl,
|
||||
ApiKey: fApiKey,
|
||||
AllowInsecureConnections: true,
|
||||
SiteType: fSiteType,
|
||||
|
@ -13,8 +13,8 @@ import (
|
||||
)
|
||||
|
||||
type DeployerConfig struct {
|
||||
// 堡塔云 WAF 地址。
|
||||
ApiUrl string `json:"apiUrl"`
|
||||
// 堡塔云 WAF 服务地址。
|
||||
ServerUrl string `json:"serverUrl"`
|
||||
// 堡塔云 WAF 接口密钥。
|
||||
ApiKey string `json:"apiKey"`
|
||||
// 是否允许不安全的连接。
|
||||
@ -34,7 +34,7 @@ func NewDeployer(config *DeployerConfig) (*DeployerProvider, error) {
|
||||
panic("config is nil")
|
||||
}
|
||||
|
||||
client, err := createSdkClient(config.ApiUrl, config.ApiKey, config.AllowInsecureConnections)
|
||||
client, err := createSdkClient(config.ServerUrl, config.ApiKey, config.AllowInsecureConnections)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to create sdk client: %w", err)
|
||||
}
|
||||
@ -70,16 +70,16 @@ func (d *DeployerProvider) Deploy(ctx context.Context, certPEM string, privkeyPE
|
||||
return &deployer.DeployResult{}, nil
|
||||
}
|
||||
|
||||
func createSdkClient(apiUrl, apiKey string, skipTlsVerify bool) (*btsdk.Client, error) {
|
||||
if _, err := url.Parse(apiUrl); err != nil {
|
||||
return nil, errors.New("invalid baota api url")
|
||||
func createSdkClient(serverUrl, apiKey string, skipTlsVerify bool) (*btsdk.Client, error) {
|
||||
if _, err := url.Parse(serverUrl); err != nil {
|
||||
return nil, errors.New("invalid baota server url")
|
||||
}
|
||||
|
||||
if apiKey == "" {
|
||||
return nil, errors.New("invalid baota api key")
|
||||
}
|
||||
|
||||
client := btsdk.NewClient(apiUrl, apiKey)
|
||||
client := btsdk.NewClient(serverUrl, apiKey)
|
||||
if skipTlsVerify {
|
||||
client.WithTLSConfig(&tls.Config{InsecureSkipVerify: true})
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ import (
|
||||
var (
|
||||
fInputCertPath string
|
||||
fInputKeyPath string
|
||||
fApiUrl string
|
||||
fServerUrl string
|
||||
fApiKey string
|
||||
fSiteName string
|
||||
fSitePort int64
|
||||
@ -25,7 +25,7 @@ func init() {
|
||||
|
||||
flag.StringVar(&fInputCertPath, argsPrefix+"INPUTCERTPATH", "", "")
|
||||
flag.StringVar(&fInputKeyPath, argsPrefix+"INPUTKEYPATH", "", "")
|
||||
flag.StringVar(&fApiUrl, argsPrefix+"APIURL", "", "")
|
||||
flag.StringVar(&fServerUrl, argsPrefix+"SERVERURL", "", "")
|
||||
flag.StringVar(&fApiKey, argsPrefix+"APIKEY", "", "")
|
||||
}
|
||||
|
||||
@ -35,7 +35,7 @@ Shell command to run this test:
|
||||
go test -v ./baotawaf_console_test.go -args \
|
||||
--CERTIMATE_DEPLOYER_BAOTAWAFCONSOLE_INPUTCERTPATH="/path/to/your-input-cert.pem" \
|
||||
--CERTIMATE_DEPLOYER_BAOTAWAFCONSOLE_INPUTKEYPATH="/path/to/your-input-key.pem" \
|
||||
--CERTIMATE_DEPLOYER_BAOTAWAFCONSOLE_APIURL="http://127.0.0.1:8888" \
|
||||
--CERTIMATE_DEPLOYER_BAOTAWAFCONSOLE_SERVERURL="http://127.0.0.1:8888" \
|
||||
--CERTIMATE_DEPLOYER_BAOTAWAFCONSOLE_APIKEY="your-api-key"
|
||||
*/
|
||||
func TestDeploy(t *testing.T) {
|
||||
@ -46,12 +46,12 @@ func TestDeploy(t *testing.T) {
|
||||
"args:",
|
||||
fmt.Sprintf("INPUTCERTPATH: %v", fInputCertPath),
|
||||
fmt.Sprintf("INPUTKEYPATH: %v", fInputKeyPath),
|
||||
fmt.Sprintf("APIURL: %v", fApiUrl),
|
||||
fmt.Sprintf("SERVERURL: %v", fServerUrl),
|
||||
fmt.Sprintf("APIKEY: %v", fApiKey),
|
||||
}, "\n"))
|
||||
|
||||
deployer, err := provider.NewDeployer(&provider.DeployerConfig{
|
||||
ApiUrl: fApiUrl,
|
||||
ServerUrl: fServerUrl,
|
||||
ApiKey: fApiKey,
|
||||
AllowInsecureConnections: true,
|
||||
})
|
||||
|
@ -14,8 +14,8 @@ import (
|
||||
)
|
||||
|
||||
type DeployerConfig struct {
|
||||
// 堡塔云 WAF 地址。
|
||||
ApiUrl string `json:"apiUrl"`
|
||||
// 堡塔云 WAF 服务地址。
|
||||
ServerUrl string `json:"serverUrl"`
|
||||
// 堡塔云 WAF 接口密钥。
|
||||
ApiKey string `json:"apiKey"`
|
||||
// 是否允许不安全的连接。
|
||||
@ -40,7 +40,7 @@ func NewDeployer(config *DeployerConfig) (*DeployerProvider, error) {
|
||||
panic("config is nil")
|
||||
}
|
||||
|
||||
client, err := createSdkClient(config.ApiUrl, config.ApiKey, config.AllowInsecureConnections)
|
||||
client, err := createSdkClient(config.ServerUrl, config.ApiKey, config.AllowInsecureConnections)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to create sdk client: %w", err)
|
||||
}
|
||||
@ -133,16 +133,16 @@ func (d *DeployerProvider) Deploy(ctx context.Context, certPEM string, privkeyPE
|
||||
return &deployer.DeployResult{}, nil
|
||||
}
|
||||
|
||||
func createSdkClient(apiUrl, apiKey string, skipTlsVerify bool) (*btsdk.Client, error) {
|
||||
if _, err := url.Parse(apiUrl); err != nil {
|
||||
return nil, errors.New("invalid baota api url")
|
||||
func createSdkClient(serverUrl, apiKey string, skipTlsVerify bool) (*btsdk.Client, error) {
|
||||
if _, err := url.Parse(serverUrl); err != nil {
|
||||
return nil, errors.New("invalid baota server url")
|
||||
}
|
||||
|
||||
if apiKey == "" {
|
||||
return nil, errors.New("invalid baota api key")
|
||||
}
|
||||
|
||||
client := btsdk.NewClient(apiUrl, apiKey)
|
||||
client := btsdk.NewClient(serverUrl, apiKey)
|
||||
if skipTlsVerify {
|
||||
client.WithTLSConfig(&tls.Config{InsecureSkipVerify: true})
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ import (
|
||||
var (
|
||||
fInputCertPath string
|
||||
fInputKeyPath string
|
||||
fApiUrl string
|
||||
fServerUrl string
|
||||
fApiKey string
|
||||
fSiteName string
|
||||
fSitePort int64
|
||||
@ -25,7 +25,7 @@ func init() {
|
||||
|
||||
flag.StringVar(&fInputCertPath, argsPrefix+"INPUTCERTPATH", "", "")
|
||||
flag.StringVar(&fInputKeyPath, argsPrefix+"INPUTKEYPATH", "", "")
|
||||
flag.StringVar(&fApiUrl, argsPrefix+"APIURL", "", "")
|
||||
flag.StringVar(&fServerUrl, argsPrefix+"SERVERURL", "", "")
|
||||
flag.StringVar(&fApiKey, argsPrefix+"APIKEY", "", "")
|
||||
flag.StringVar(&fSiteName, argsPrefix+"SITENAME", "", "")
|
||||
flag.Int64Var(&fSitePort, argsPrefix+"SITEPORT", 0, "")
|
||||
@ -37,7 +37,7 @@ Shell command to run this test:
|
||||
go test -v ./baotawaf_site_test.go -args \
|
||||
--CERTIMATE_DEPLOYER_BAOTAWAFSITE_INPUTCERTPATH="/path/to/your-input-cert.pem" \
|
||||
--CERTIMATE_DEPLOYER_BAOTAWAFSITE_INPUTKEYPATH="/path/to/your-input-key.pem" \
|
||||
--CERTIMATE_DEPLOYER_BAOTAWAFSITE_APIURL="http://127.0.0.1:8888" \
|
||||
--CERTIMATE_DEPLOYER_BAOTAWAFSITE_SERVERURL="http://127.0.0.1:8888" \
|
||||
--CERTIMATE_DEPLOYER_BAOTAWAFSITE_APIKEY="your-api-key" \
|
||||
--CERTIMATE_DEPLOYER_BAOTAWAFSITE_SITENAME="your-site-name"\
|
||||
--CERTIMATE_DEPLOYER_BAOTAWAFSITE_SITEPORT=443
|
||||
@ -50,14 +50,14 @@ func TestDeploy(t *testing.T) {
|
||||
"args:",
|
||||
fmt.Sprintf("INPUTCERTPATH: %v", fInputCertPath),
|
||||
fmt.Sprintf("INPUTKEYPATH: %v", fInputKeyPath),
|
||||
fmt.Sprintf("APIURL: %v", fApiUrl),
|
||||
fmt.Sprintf("SERVERURL: %v", fServerUrl),
|
||||
fmt.Sprintf("APIKEY: %v", fApiKey),
|
||||
fmt.Sprintf("SITENAME: %v", fSiteName),
|
||||
fmt.Sprintf("SITEPORT: %v", fSitePort),
|
||||
}, "\n"))
|
||||
|
||||
deployer, err := provider.NewDeployer(&provider.DeployerConfig{
|
||||
ApiUrl: fApiUrl,
|
||||
ServerUrl: fServerUrl,
|
||||
ApiKey: fApiKey,
|
||||
AllowInsecureConnections: true,
|
||||
SiteName: fSiteName,
|
||||
|
@ -15,8 +15,8 @@ import (
|
||||
)
|
||||
|
||||
type DeployerConfig struct {
|
||||
// Cdnfly 地址。
|
||||
ApiUrl string `json:"apiUrl"`
|
||||
// Cdnfly 服务地址。
|
||||
ServerUrl string `json:"serverUrl"`
|
||||
// Cdnfly 用户端 API Key。
|
||||
ApiKey string `json:"apiKey"`
|
||||
// Cdnfly 用户端 API Secret。
|
||||
@ -46,7 +46,7 @@ func NewDeployer(config *DeployerConfig) (*DeployerProvider, error) {
|
||||
panic("config is nil")
|
||||
}
|
||||
|
||||
client, err := createSdkClient(config.ApiUrl, config.ApiKey, config.ApiSecret, config.AllowInsecureConnections)
|
||||
client, err := createSdkClient(config.ServerUrl, config.ApiKey, config.ApiSecret, config.AllowInsecureConnections)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to create sdk client: %w", err)
|
||||
}
|
||||
@ -160,9 +160,9 @@ func (d *DeployerProvider) deployToCertificate(ctx context.Context, certPEM stri
|
||||
return nil
|
||||
}
|
||||
|
||||
func createSdkClient(apiUrl, apiKey, apiSecret string, skipTlsVerify bool) (*cfsdk.Client, error) {
|
||||
if _, err := url.Parse(apiUrl); err != nil {
|
||||
return nil, errors.New("invalid cachefly api url")
|
||||
func createSdkClient(serverUrl, apiKey, apiSecret string, skipTlsVerify bool) (*cfsdk.Client, error) {
|
||||
if _, err := url.Parse(serverUrl); err != nil {
|
||||
return nil, errors.New("invalid cachefly server url")
|
||||
}
|
||||
|
||||
if apiKey == "" {
|
||||
@ -173,7 +173,7 @@ func createSdkClient(apiUrl, apiKey, apiSecret string, skipTlsVerify bool) (*cfs
|
||||
return nil, errors.New("invalid cachefly api secret")
|
||||
}
|
||||
|
||||
client := cfsdk.NewClient(apiUrl, apiKey, apiSecret)
|
||||
client := cfsdk.NewClient(serverUrl, apiKey, apiSecret)
|
||||
if skipTlsVerify {
|
||||
client.WithTLSConfig(&tls.Config{InsecureSkipVerify: true})
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ import (
|
||||
var (
|
||||
fInputCertPath string
|
||||
fInputKeyPath string
|
||||
fApiUrl string
|
||||
fServerUrl string
|
||||
fApiKey string
|
||||
fApiSecret string
|
||||
fCertificateId string
|
||||
@ -25,7 +25,7 @@ func init() {
|
||||
|
||||
flag.StringVar(&fInputCertPath, argsPrefix+"INPUTCERTPATH", "", "")
|
||||
flag.StringVar(&fInputKeyPath, argsPrefix+"INPUTKEYPATH", "", "")
|
||||
flag.StringVar(&fApiUrl, argsPrefix+"APIURL", "", "")
|
||||
flag.StringVar(&fServerUrl, argsPrefix+"SERVERURL", "", "")
|
||||
flag.StringVar(&fApiKey, argsPrefix+"APIKEY", "", "")
|
||||
flag.StringVar(&fApiSecret, argsPrefix+"APISECRET", "", "")
|
||||
flag.StringVar(&fCertificateId, argsPrefix+"CERTIFICATEID", "", "")
|
||||
@ -37,7 +37,7 @@ Shell command to run this test:
|
||||
go test -v ./cdnfly_test.go -args \
|
||||
--CERTIMATE_DEPLOYER_CDNFLY_INPUTCERTPATH="/path/to/your-input-cert.pem" \
|
||||
--CERTIMATE_DEPLOYER_CDNFLY_INPUTKEYPATH="/path/to/your-input-key.pem" \
|
||||
--CERTIMATE_DEPLOYER_CDNFLY_APIURL="http://127.0.0.1:88" \
|
||||
--CERTIMATE_DEPLOYER_CDNFLY_SERVERURL="http://127.0.0.1:88" \
|
||||
--CERTIMATE_DEPLOYER_CDNFLY_APIKEY="your-api-key" \
|
||||
--CERTIMATE_DEPLOYER_CDNFLY_APISECRET="your-api-secret" \
|
||||
--CERTIMATE_DEPLOYER_CDNFLY_CERTIFICATEID="your-cert-id"
|
||||
@ -50,14 +50,14 @@ func TestDeploy(t *testing.T) {
|
||||
"args:",
|
||||
fmt.Sprintf("INPUTCERTPATH: %v", fInputCertPath),
|
||||
fmt.Sprintf("INPUTKEYPATH: %v", fInputKeyPath),
|
||||
fmt.Sprintf("APIURL: %v", fApiUrl),
|
||||
fmt.Sprintf("SERVERURL: %v", fServerUrl),
|
||||
fmt.Sprintf("APIKEY: %v", fApiKey),
|
||||
fmt.Sprintf("APISECRET: %v", fApiSecret),
|
||||
fmt.Sprintf("CERTIFICATEID: %v", fCertificateId),
|
||||
}, "\n"))
|
||||
|
||||
deployer, err := provider.NewDeployer(&provider.DeployerConfig{
|
||||
ApiUrl: fApiUrl,
|
||||
ServerUrl: fServerUrl,
|
||||
ApiKey: fApiKey,
|
||||
ApiSecret: fApiSecret,
|
||||
AllowInsecureConnections: true,
|
||||
|
@ -16,8 +16,8 @@ import (
|
||||
)
|
||||
|
||||
type DeployerConfig struct {
|
||||
// FlexCDN URL。
|
||||
ApiUrl string `json:"apiUrl"`
|
||||
// FlexCDN 服务地址。
|
||||
ServerUrl string `json:"serverUrl"`
|
||||
// FlexCDN 用户角色。
|
||||
// 可取值 "user"、"admin"。
|
||||
ApiRole string `json:"apiRole"`
|
||||
@ -47,7 +47,7 @@ func NewDeployer(config *DeployerConfig) (*DeployerProvider, error) {
|
||||
panic("config is nil")
|
||||
}
|
||||
|
||||
client, err := createSdkClient(config.ApiUrl, config.ApiRole, config.AccessKeyId, config.AccessKey, config.AllowInsecureConnections)
|
||||
client, err := createSdkClient(config.ServerUrl, config.ApiRole, config.AccessKeyId, config.AccessKey, config.AllowInsecureConnections)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to create sdk client: %w", err)
|
||||
}
|
||||
@ -119,9 +119,9 @@ func (d *DeployerProvider) deployToCertificate(ctx context.Context, certPEM stri
|
||||
return nil
|
||||
}
|
||||
|
||||
func createSdkClient(apiUrl, apiRole, accessKeyId, accessKey string, skipTlsVerify bool) (*flexcdnsdk.Client, error) {
|
||||
if _, err := url.Parse(apiUrl); err != nil {
|
||||
return nil, errors.New("invalid flexcdn api url")
|
||||
func createSdkClient(serverUrl, apiRole, accessKeyId, accessKey string, skipTlsVerify bool) (*flexcdnsdk.Client, error) {
|
||||
if _, err := url.Parse(serverUrl); err != nil {
|
||||
return nil, errors.New("invalid flexcdn server url")
|
||||
}
|
||||
|
||||
if apiRole != "user" && apiRole != "admin" {
|
||||
@ -136,7 +136,7 @@ func createSdkClient(apiUrl, apiRole, accessKeyId, accessKey string, skipTlsVeri
|
||||
return nil, errors.New("invalid flexcdn access key")
|
||||
}
|
||||
|
||||
client := flexcdnsdk.NewClient(apiUrl, apiRole, accessKeyId, accessKey)
|
||||
client := flexcdnsdk.NewClient(serverUrl, apiRole, accessKeyId, accessKey)
|
||||
if skipTlsVerify {
|
||||
client.WithTLSConfig(&tls.Config{InsecureSkipVerify: true})
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ import (
|
||||
var (
|
||||
fInputCertPath string
|
||||
fInputKeyPath string
|
||||
fApiUrl string
|
||||
fServerUrl string
|
||||
fAccessKeyId string
|
||||
fAccessKey string
|
||||
fCertificateId int64
|
||||
@ -25,7 +25,7 @@ func init() {
|
||||
|
||||
flag.StringVar(&fInputCertPath, argsPrefix+"INPUTCERTPATH", "", "")
|
||||
flag.StringVar(&fInputKeyPath, argsPrefix+"INPUTKEYPATH", "", "")
|
||||
flag.StringVar(&fApiUrl, argsPrefix+"APIURL", "", "")
|
||||
flag.StringVar(&fServerUrl, argsPrefix+"SERVERURL", "", "")
|
||||
flag.StringVar(&fAccessKeyId, argsPrefix+"ACCESSKEYID", "", "")
|
||||
flag.StringVar(&fAccessKey, argsPrefix+"ACCESSKEY", "", "")
|
||||
flag.Int64Var(&fCertificateId, argsPrefix+"CERTIFICATEID", 0, "")
|
||||
@ -37,7 +37,7 @@ Shell command to run this test:
|
||||
go test -v ./flexcdn_test.go -args \
|
||||
--CERTIMATE_DEPLOYER_FLEXCDN_INPUTCERTPATH="/path/to/your-input-cert.pem" \
|
||||
--CERTIMATE_DEPLOYER_FLEXCDN_INPUTKEYPATH="/path/to/your-input-key.pem" \
|
||||
--CERTIMATE_DEPLOYER_FLEXCDN_APIURL="http://127.0.0.1:7788" \
|
||||
--CERTIMATE_DEPLOYER_FLEXCDN_SERVERURL="http://127.0.0.1:7788" \
|
||||
--CERTIMATE_DEPLOYER_FLEXCDN_ACCESSKEYID="your-access-key-id" \
|
||||
--CERTIMATE_DEPLOYER_FLEXCDN_ACCESSKEY="your-access-key" \
|
||||
--CERTIMATE_DEPLOYER_FLEXCDN_CERTIFICATEID="your-cerficiate-id"
|
||||
@ -50,14 +50,14 @@ func TestDeploy(t *testing.T) {
|
||||
"args:",
|
||||
fmt.Sprintf("INPUTCERTPATH: %v", fInputCertPath),
|
||||
fmt.Sprintf("INPUTKEYPATH: %v", fInputKeyPath),
|
||||
fmt.Sprintf("APIURL: %v", fApiUrl),
|
||||
fmt.Sprintf("SERVERURL: %v", fServerUrl),
|
||||
fmt.Sprintf("ACCESSKEYID: %v", fAccessKeyId),
|
||||
fmt.Sprintf("ACCESSKEY: %v", fAccessKey),
|
||||
fmt.Sprintf("CERTIFICATEID: %v", fCertificateId),
|
||||
}, "\n"))
|
||||
|
||||
deployer, err := provider.NewDeployer(&provider.DeployerConfig{
|
||||
ApiUrl: fApiUrl,
|
||||
ServerUrl: fServerUrl,
|
||||
ApiRole: "user",
|
||||
AccessKeyId: fAccessKeyId,
|
||||
AccessKey: fAccessKey,
|
||||
|
@ -16,8 +16,8 @@ import (
|
||||
)
|
||||
|
||||
type DeployerConfig struct {
|
||||
// GoEdge URL。
|
||||
ApiUrl string `json:"apiUrl"`
|
||||
// GoEdge 服务地址。
|
||||
ServerUrl string `json:"serverUrl"`
|
||||
// GoEdge 用户角色。
|
||||
// 可取值 "user"、"admin"。
|
||||
ApiRole string `json:"apiRole"`
|
||||
@ -47,7 +47,7 @@ func NewDeployer(config *DeployerConfig) (*DeployerProvider, error) {
|
||||
panic("config is nil")
|
||||
}
|
||||
|
||||
client, err := createSdkClient(config.ApiUrl, config.ApiRole, config.AccessKeyId, config.AccessKey, config.AllowInsecureConnections)
|
||||
client, err := createSdkClient(config.ServerUrl, config.ApiRole, config.AccessKeyId, config.AccessKey, config.AllowInsecureConnections)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to create sdk client: %w", err)
|
||||
}
|
||||
@ -119,9 +119,9 @@ func (d *DeployerProvider) deployToCertificate(ctx context.Context, certPEM stri
|
||||
return nil
|
||||
}
|
||||
|
||||
func createSdkClient(apiUrl, apiRole, accessKeyId, accessKey string, skipTlsVerify bool) (*goedgesdk.Client, error) {
|
||||
if _, err := url.Parse(apiUrl); err != nil {
|
||||
return nil, errors.New("invalid goedge api url")
|
||||
func createSdkClient(serverUrl, apiRole, accessKeyId, accessKey string, skipTlsVerify bool) (*goedgesdk.Client, error) {
|
||||
if _, err := url.Parse(serverUrl); err != nil {
|
||||
return nil, errors.New("invalid goedge server url")
|
||||
}
|
||||
|
||||
if apiRole != "user" && apiRole != "admin" {
|
||||
@ -136,7 +136,7 @@ func createSdkClient(apiUrl, apiRole, accessKeyId, accessKey string, skipTlsVeri
|
||||
return nil, errors.New("invalid goedge access key")
|
||||
}
|
||||
|
||||
client := goedgesdk.NewClient(apiUrl, apiRole, accessKeyId, accessKey)
|
||||
client := goedgesdk.NewClient(serverUrl, apiRole, accessKeyId, accessKey)
|
||||
if skipTlsVerify {
|
||||
client.WithTLSConfig(&tls.Config{InsecureSkipVerify: true})
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ import (
|
||||
var (
|
||||
fInputCertPath string
|
||||
fInputKeyPath string
|
||||
fApiUrl string
|
||||
fServerUrl string
|
||||
fAccessKeyId string
|
||||
fAccessKey string
|
||||
fCertificateId int64
|
||||
@ -25,7 +25,7 @@ func init() {
|
||||
|
||||
flag.StringVar(&fInputCertPath, argsPrefix+"INPUTCERTPATH", "", "")
|
||||
flag.StringVar(&fInputKeyPath, argsPrefix+"INPUTKEYPATH", "", "")
|
||||
flag.StringVar(&fApiUrl, argsPrefix+"APIURL", "", "")
|
||||
flag.StringVar(&fServerUrl, argsPrefix+"SERVERURL", "", "")
|
||||
flag.StringVar(&fAccessKeyId, argsPrefix+"ACCESSKEYID", "", "")
|
||||
flag.StringVar(&fAccessKey, argsPrefix+"ACCESSKEY", "", "")
|
||||
flag.Int64Var(&fCertificateId, argsPrefix+"CERTIFICATEID", 0, "")
|
||||
@ -37,7 +37,7 @@ Shell command to run this test:
|
||||
go test -v ./goedge_test.go -args \
|
||||
--CERTIMATE_DEPLOYER_GOEDGE_INPUTCERTPATH="/path/to/your-input-cert.pem" \
|
||||
--CERTIMATE_DEPLOYER_GOEDGE_INPUTKEYPATH="/path/to/your-input-key.pem" \
|
||||
--CERTIMATE_DEPLOYER_GOEDGE_APIURL="http://127.0.0.1:7788" \
|
||||
--CERTIMATE_DEPLOYER_GOEDGE_SERVERURL="http://127.0.0.1:7788" \
|
||||
--CERTIMATE_DEPLOYER_GOEDGE_ACCESSKEYID="your-access-key-id" \
|
||||
--CERTIMATE_DEPLOYER_GOEDGE_ACCESSKEY="your-access-key" \
|
||||
--CERTIMATE_DEPLOYER_GOEDGE_CERTIFICATEID="your-cerficiate-id"
|
||||
@ -50,14 +50,14 @@ func TestDeploy(t *testing.T) {
|
||||
"args:",
|
||||
fmt.Sprintf("INPUTCERTPATH: %v", fInputCertPath),
|
||||
fmt.Sprintf("INPUTKEYPATH: %v", fInputKeyPath),
|
||||
fmt.Sprintf("APIURL: %v", fApiUrl),
|
||||
fmt.Sprintf("SERVERURL: %v", fServerUrl),
|
||||
fmt.Sprintf("ACCESSKEYID: %v", fAccessKeyId),
|
||||
fmt.Sprintf("ACCESSKEY: %v", fAccessKey),
|
||||
fmt.Sprintf("CERTIFICATEID: %v", fCertificateId),
|
||||
}, "\n"))
|
||||
|
||||
deployer, err := provider.NewDeployer(&provider.DeployerConfig{
|
||||
ApiUrl: fApiUrl,
|
||||
ServerUrl: fServerUrl,
|
||||
ApiRole: "user",
|
||||
AccessKeyId: fAccessKeyId,
|
||||
AccessKey: fAccessKey,
|
||||
|
@ -15,8 +15,8 @@ import (
|
||||
)
|
||||
|
||||
type DeployerConfig struct {
|
||||
// LeCDN URL。
|
||||
ApiUrl string `json:"apiUrl"`
|
||||
// LeCDN 服务地址。
|
||||
ServerUrl string `json:"serverUrl"`
|
||||
// LeCDN 版本。
|
||||
// 可取值 "v3"。
|
||||
ApiVersion string `json:"apiVersion"`
|
||||
@ -59,7 +59,7 @@ func NewDeployer(config *DeployerConfig) (*DeployerProvider, error) {
|
||||
panic("config is nil")
|
||||
}
|
||||
|
||||
client, err := createSdkClient(config.ApiUrl, config.ApiVersion, config.ApiRole, config.Username, config.Password, config.AllowInsecureConnections)
|
||||
client, err := createSdkClient(config.ServerUrl, config.ApiVersion, config.ApiRole, config.Username, config.Password, config.AllowInsecureConnections)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to create sdk client: %w", err)
|
||||
}
|
||||
@ -141,9 +141,9 @@ func (d *DeployerProvider) deployToCertificate(ctx context.Context, certPEM stri
|
||||
return nil
|
||||
}
|
||||
|
||||
func createSdkClient(apiUrl, apiVersion, apiRole, username, password string, skipTlsVerify bool) (interface{}, error) {
|
||||
if _, err := url.Parse(apiUrl); err != nil {
|
||||
return nil, errors.New("invalid lecdn api url")
|
||||
func createSdkClient(serverUrl, apiVersion, apiRole, username, password string, skipTlsVerify bool) (interface{}, error) {
|
||||
if _, err := url.Parse(serverUrl); err != nil {
|
||||
return nil, errors.New("invalid lecdn server url")
|
||||
}
|
||||
|
||||
if username == "" {
|
||||
@ -156,7 +156,7 @@ func createSdkClient(apiUrl, apiVersion, apiRole, username, password string, ski
|
||||
|
||||
if apiVersion == apiVersionV3 && apiRole == apiRoleClient {
|
||||
// v3 版客户端
|
||||
client := leclientsdkv3.NewClient(apiUrl, username, password)
|
||||
client := leclientsdkv3.NewClient(serverUrl, username, password)
|
||||
if skipTlsVerify {
|
||||
client.WithTLSConfig(&tls.Config{InsecureSkipVerify: true})
|
||||
}
|
||||
@ -164,7 +164,7 @@ func createSdkClient(apiUrl, apiVersion, apiRole, username, password string, ski
|
||||
return client, nil
|
||||
} else if apiVersion == apiVersionV3 && apiRole == apiRoleMaster {
|
||||
// v3 版主控端
|
||||
client := lemastersdkv3.NewClient(apiUrl, username, password)
|
||||
client := lemastersdkv3.NewClient(serverUrl, username, password)
|
||||
if skipTlsVerify {
|
||||
client.WithTLSConfig(&tls.Config{InsecureSkipVerify: true})
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ import (
|
||||
var (
|
||||
fInputCertPath string
|
||||
fInputKeyPath string
|
||||
fApiUrl string
|
||||
fServerUrl string
|
||||
fApiVersion string
|
||||
fUsername string
|
||||
fPassword string
|
||||
@ -26,7 +26,7 @@ func init() {
|
||||
|
||||
flag.StringVar(&fInputCertPath, argsPrefix+"INPUTCERTPATH", "", "")
|
||||
flag.StringVar(&fInputKeyPath, argsPrefix+"INPUTKEYPATH", "", "")
|
||||
flag.StringVar(&fApiUrl, argsPrefix+"APIURL", "", "")
|
||||
flag.StringVar(&fServerUrl, argsPrefix+"SERVERURL", "", "")
|
||||
flag.StringVar(&fApiVersion, argsPrefix+"APIVERSION", "v3", "")
|
||||
flag.StringVar(&fUsername, argsPrefix+"USERNAME", "", "")
|
||||
flag.StringVar(&fPassword, argsPrefix+"PASSWORD", "", "")
|
||||
@ -39,7 +39,7 @@ Shell command to run this test:
|
||||
go test -v ./lecdn_test.go -args \
|
||||
--CERTIMATE_DEPLOYER_LECDN_INPUTCERTPATH="/path/to/your-input-cert.pem" \
|
||||
--CERTIMATE_DEPLOYER_LECDN_INPUTKEYPATH="/path/to/your-input-key.pem" \
|
||||
--CERTIMATE_DEPLOYER_LECDN_APIURL="http://127.0.0.1:5090" \
|
||||
--CERTIMATE_DEPLOYER_LECDN_SERVERURL="http://127.0.0.1:5090" \
|
||||
--CERTIMATE_DEPLOYER_LECDN_USERNAME="your-username" \
|
||||
--CERTIMATE_DEPLOYER_LECDN_PASSWORD="your-password" \
|
||||
--CERTIMATE_DEPLOYER_LECDN_CERTIFICATEID="your-cerficiate-id"
|
||||
@ -52,7 +52,7 @@ func TestDeploy(t *testing.T) {
|
||||
"args:",
|
||||
fmt.Sprintf("INPUTCERTPATH: %v", fInputCertPath),
|
||||
fmt.Sprintf("INPUTKEYPATH: %v", fInputKeyPath),
|
||||
fmt.Sprintf("APIURL: %v", fApiUrl),
|
||||
fmt.Sprintf("SERVERURL: %v", fServerUrl),
|
||||
fmt.Sprintf("APIVERSION: %v", fApiVersion),
|
||||
fmt.Sprintf("USERNAME: %v", fUsername),
|
||||
fmt.Sprintf("PASSWORD: %v", fPassword),
|
||||
@ -60,7 +60,7 @@ func TestDeploy(t *testing.T) {
|
||||
}, "\n"))
|
||||
|
||||
deployer, err := provider.NewDeployer(&provider.DeployerConfig{
|
||||
ApiUrl: fApiUrl,
|
||||
ServerUrl: fServerUrl,
|
||||
ApiVersion: fApiVersion,
|
||||
ApiRole: "user",
|
||||
Username: fUsername,
|
||||
|
@ -16,8 +16,8 @@ import (
|
||||
)
|
||||
|
||||
type DeployerConfig struct {
|
||||
// Proxmox VE 地址。
|
||||
ApiUrl string `json:"apiUrl"`
|
||||
// Proxmox VE 服务地址。
|
||||
ServerUrl string `json:"serverUrl"`
|
||||
// Proxmox VE API Token。
|
||||
ApiToken string `json:"apiToken"`
|
||||
// Proxmox VE API Token Secret。
|
||||
@ -43,7 +43,7 @@ func NewDeployer(config *DeployerConfig) (*DeployerProvider, error) {
|
||||
panic("config is nil")
|
||||
}
|
||||
|
||||
client, err := createSdkClient(config.ApiUrl, config.ApiToken, config.ApiTokenSecret, config.AllowInsecureConnections)
|
||||
client, err := createSdkClient(config.ServerUrl, config.ApiToken, config.ApiTokenSecret, config.AllowInsecureConnections)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to create sdk client: %w", err)
|
||||
}
|
||||
@ -91,9 +91,9 @@ func (d *DeployerProvider) Deploy(ctx context.Context, certPEM string, privkeyPE
|
||||
return &deployer.DeployResult{}, nil
|
||||
}
|
||||
|
||||
func createSdkClient(apiUrl, apiToken, apiTokenSecret string, skipTlsVerify bool) (*proxmox.Client, error) {
|
||||
if _, err := url.Parse(apiUrl); err != nil {
|
||||
return nil, errors.New("invalid pve api url")
|
||||
func createSdkClient(serverUrl, apiToken, apiTokenSecret string, skipTlsVerify bool) (*proxmox.Client, error) {
|
||||
if _, err := url.Parse(serverUrl); err != nil {
|
||||
return nil, errors.New("invalid pve server url")
|
||||
}
|
||||
|
||||
if apiToken == "" {
|
||||
@ -112,7 +112,7 @@ func createSdkClient(apiUrl, apiToken, apiTokenSecret string, skipTlsVerify bool
|
||||
}
|
||||
}
|
||||
client := proxmox.NewClient(
|
||||
strings.TrimRight(apiUrl, "/")+"/api2/json",
|
||||
strings.TrimRight(serverUrl, "/")+"/api2/json",
|
||||
proxmox.WithHTTPClient(httpClient),
|
||||
proxmox.WithAPIToken(apiToken, apiTokenSecret),
|
||||
)
|
||||
|
@ -14,7 +14,7 @@ import (
|
||||
var (
|
||||
fInputCertPath string
|
||||
fInputKeyPath string
|
||||
fApiUrl string
|
||||
fServerUrl string
|
||||
fApiToken string
|
||||
fApiTokenSecret string
|
||||
fNodeName string
|
||||
@ -25,7 +25,7 @@ func init() {
|
||||
|
||||
flag.StringVar(&fInputCertPath, argsPrefix+"INPUTCERTPATH", "", "")
|
||||
flag.StringVar(&fInputKeyPath, argsPrefix+"INPUTKEYPATH", "", "")
|
||||
flag.StringVar(&fApiUrl, argsPrefix+"APIURL", "", "")
|
||||
flag.StringVar(&fServerUrl, argsPrefix+"SERVERURL", "", "")
|
||||
flag.StringVar(&fApiToken, argsPrefix+"APITOKEN", "", "")
|
||||
flag.StringVar(&fApiTokenSecret, argsPrefix+"APITOKENSECRET", "", "")
|
||||
flag.StringVar(&fNodeName, argsPrefix+"NODENAME", "", "")
|
||||
@ -37,7 +37,7 @@ Shell command to run this test:
|
||||
go test -v ./proxmoxve_test.go -args \
|
||||
--CERTIMATE_DEPLOYER_PROXMOXVE_INPUTCERTPATH="/path/to/your-input-cert.pem" \
|
||||
--CERTIMATE_DEPLOYER_PROXMOXVE_INPUTKEYPATH="/path/to/your-input-key.pem" \
|
||||
--CERTIMATE_DEPLOYER_PROXMOXVE_APIURL="http://127.0.0.1:8006" \
|
||||
--CERTIMATE_DEPLOYER_PROXMOXVE_SERVERURL="http://127.0.0.1:8006" \
|
||||
--CERTIMATE_DEPLOYER_PROXMOXVE_APITOKEN="your-api-token" \
|
||||
--CERTIMATE_DEPLOYER_PROXMOXVE_APITOKENSECRET="your-api-token-secret" \
|
||||
--CERTIMATE_DEPLOYER_PROXMOXVE_NODENAME="your-cluster-node-name"
|
||||
@ -50,14 +50,14 @@ func TestDeploy(t *testing.T) {
|
||||
"args:",
|
||||
fmt.Sprintf("INPUTCERTPATH: %v", fInputCertPath),
|
||||
fmt.Sprintf("INPUTKEYPATH: %v", fInputKeyPath),
|
||||
fmt.Sprintf("APIURL: %v", fApiUrl),
|
||||
fmt.Sprintf("SERVERURL: %v", fServerUrl),
|
||||
fmt.Sprintf("APITOKEN: %v", fApiToken),
|
||||
fmt.Sprintf("APITOKENSECRET: %v", fApiTokenSecret),
|
||||
fmt.Sprintf("NODENAME: %v", fNodeName),
|
||||
}, "\n"))
|
||||
|
||||
deployer, err := provider.NewDeployer(&provider.DeployerConfig{
|
||||
ApiUrl: fApiUrl,
|
||||
ServerUrl: fServerUrl,
|
||||
ApiToken: fApiToken,
|
||||
ApiTokenSecret: fApiTokenSecret,
|
||||
AllowInsecureConnections: true,
|
||||
|
@ -13,8 +13,8 @@ import (
|
||||
)
|
||||
|
||||
type DeployerConfig struct {
|
||||
// 耗子面板地址。
|
||||
ApiUrl string `json:"apiUrl"`
|
||||
// 耗子面板服务地址。
|
||||
ServerUrl string `json:"serverUrl"`
|
||||
// 耗子面板访问令牌 ID。
|
||||
AccessTokenId int32 `json:"accessTokenId"`
|
||||
// 耗子面板访问令牌。
|
||||
@ -36,7 +36,7 @@ func NewDeployer(config *DeployerConfig) (*DeployerProvider, error) {
|
||||
panic("config is nil")
|
||||
}
|
||||
|
||||
client, err := createSdkClient(config.ApiUrl, config.AccessTokenId, config.AccessToken, config.AllowInsecureConnections)
|
||||
client, err := createSdkClient(config.ServerUrl, config.AccessTokenId, config.AccessToken, config.AllowInsecureConnections)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to create sdk client: %w", err)
|
||||
}
|
||||
@ -72,9 +72,9 @@ func (d *DeployerProvider) Deploy(ctx context.Context, certPEM string, privkeyPE
|
||||
return &deployer.DeployResult{}, nil
|
||||
}
|
||||
|
||||
func createSdkClient(apiUrl string, accessTokenId int32, accessToken string, skipTlsVerify bool) (*rpsdk.Client, error) {
|
||||
if _, err := url.Parse(apiUrl); err != nil {
|
||||
return nil, errors.New("invalid ratpanel api url")
|
||||
func createSdkClient(serverUrl string, accessTokenId int32, accessToken string, skipTlsVerify bool) (*rpsdk.Client, error) {
|
||||
if _, err := url.Parse(serverUrl); err != nil {
|
||||
return nil, errors.New("invalid ratpanel server url")
|
||||
}
|
||||
|
||||
if accessTokenId == 0 {
|
||||
@ -85,7 +85,7 @@ func createSdkClient(apiUrl string, accessTokenId int32, accessToken string, ski
|
||||
return nil, errors.New("invalid ratpanel access token")
|
||||
}
|
||||
|
||||
client := rpsdk.NewClient(apiUrl, accessTokenId, accessToken)
|
||||
client := rpsdk.NewClient(serverUrl, accessTokenId, accessToken)
|
||||
if skipTlsVerify {
|
||||
client.WithTLSConfig(&tls.Config{InsecureSkipVerify: true})
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ import (
|
||||
var (
|
||||
fInputCertPath string
|
||||
fInputKeyPath string
|
||||
fApiUrl string
|
||||
fServerUrl string
|
||||
fAccessTokenId int64
|
||||
fAccessToken string
|
||||
)
|
||||
@ -24,7 +24,7 @@ func init() {
|
||||
|
||||
flag.StringVar(&fInputCertPath, argsPrefix+"INPUTCERTPATH", "", "")
|
||||
flag.StringVar(&fInputKeyPath, argsPrefix+"INPUTKEYPATH", "", "")
|
||||
flag.StringVar(&fApiUrl, argsPrefix+"APIURL", "", "")
|
||||
flag.StringVar(&fServerUrl, argsPrefix+"SERVERURL", "", "")
|
||||
flag.Int64Var(&fAccessTokenId, argsPrefix+"ACCESSTOKENID", 0, "")
|
||||
flag.StringVar(&fAccessToken, argsPrefix+"ACCESSTOKEN", "", "")
|
||||
}
|
||||
@ -35,7 +35,7 @@ Shell command to run this test:
|
||||
go test -v ./ratpanel_console_test.go -args \
|
||||
--CERTIMATE_DEPLOYER_RATPANELCONSOLE_INPUTCERTPATH="/path/to/your-input-cert.pem" \
|
||||
--CERTIMATE_DEPLOYER_RATPANELCONSOLE_INPUTKEYPATH="/path/to/your-input-key.pem" \
|
||||
--CERTIMATE_DEPLOYER_RATPANELCONSOLE_APIURL="http://127.0.0.1:8888" \
|
||||
--CERTIMATE_DEPLOYER_RATPANELCONSOLE_SERVERURL="http://127.0.0.1:8888" \
|
||||
--CERTIMATE_DEPLOYER_RATPANELCONSOLE_ACCESSTOKENID="your-access-token-id" \
|
||||
--CERTIMATE_DEPLOYER_RATPANELCONSOLE_ACCESSTOKEN="your-access-token"
|
||||
*/
|
||||
@ -47,13 +47,13 @@ func TestDeploy(t *testing.T) {
|
||||
"args:",
|
||||
fmt.Sprintf("INPUTCERTPATH: %v", fInputCertPath),
|
||||
fmt.Sprintf("INPUTKEYPATH: %v", fInputKeyPath),
|
||||
fmt.Sprintf("APIURL: %v", fApiUrl),
|
||||
fmt.Sprintf("SERVERURL: %v", fServerUrl),
|
||||
fmt.Sprintf("ACCESSTOKENID: %v", fAccessTokenId),
|
||||
fmt.Sprintf("ACCESSTOKEN: %v", fAccessToken),
|
||||
}, "\n"))
|
||||
|
||||
deployer, err := provider.NewDeployer(&provider.DeployerConfig{
|
||||
ApiUrl: fApiUrl,
|
||||
ServerUrl: fServerUrl,
|
||||
AccessTokenId: int32(fAccessTokenId),
|
||||
AccessToken: fAccessToken,
|
||||
AllowInsecureConnections: true,
|
||||
|
@ -13,8 +13,8 @@ import (
|
||||
)
|
||||
|
||||
type DeployerConfig struct {
|
||||
// 耗子面板地址。
|
||||
ApiUrl string `json:"apiUrl"`
|
||||
// 耗子面板服务地址。
|
||||
ServerUrl string `json:"serverUrl"`
|
||||
// 耗子面板访问令牌 ID。
|
||||
AccessTokenId int32 `json:"accessTokenId"`
|
||||
// 耗子面板访问令牌。
|
||||
@ -38,7 +38,7 @@ func NewDeployer(config *DeployerConfig) (*DeployerProvider, error) {
|
||||
panic("config is nil")
|
||||
}
|
||||
|
||||
client, err := createSdkClient(config.ApiUrl, config.AccessTokenId, config.AccessToken, config.AllowInsecureConnections)
|
||||
client, err := createSdkClient(config.ServerUrl, config.AccessTokenId, config.AccessToken, config.AllowInsecureConnections)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to create sdk client: %w", err)
|
||||
}
|
||||
@ -79,9 +79,9 @@ func (d *DeployerProvider) Deploy(ctx context.Context, certPEM string, privkeyPE
|
||||
return &deployer.DeployResult{}, nil
|
||||
}
|
||||
|
||||
func createSdkClient(apiUrl string, accessTokenId int32, accessToken string, skipTlsVerify bool) (*rpsdk.Client, error) {
|
||||
if _, err := url.Parse(apiUrl); err != nil {
|
||||
return nil, errors.New("invalid ratpanel api url")
|
||||
func createSdkClient(serverUrl string, accessTokenId int32, accessToken string, skipTlsVerify bool) (*rpsdk.Client, error) {
|
||||
if _, err := url.Parse(serverUrl); err != nil {
|
||||
return nil, errors.New("invalid ratpanel server url")
|
||||
}
|
||||
|
||||
if accessTokenId == 0 {
|
||||
@ -92,7 +92,7 @@ func createSdkClient(apiUrl string, accessTokenId int32, accessToken string, ski
|
||||
return nil, errors.New("invalid ratpanel access token")
|
||||
}
|
||||
|
||||
client := rpsdk.NewClient(apiUrl, accessTokenId, accessToken)
|
||||
client := rpsdk.NewClient(serverUrl, accessTokenId, accessToken)
|
||||
if skipTlsVerify {
|
||||
client.WithTLSConfig(&tls.Config{InsecureSkipVerify: true})
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ import (
|
||||
var (
|
||||
fInputCertPath string
|
||||
fInputKeyPath string
|
||||
fApiUrl string
|
||||
fServerUrl string
|
||||
fAccessTokenId int64
|
||||
fAccessToken string
|
||||
fSiteName string
|
||||
@ -25,7 +25,7 @@ func init() {
|
||||
|
||||
flag.StringVar(&fInputCertPath, argsPrefix+"INPUTCERTPATH", "", "")
|
||||
flag.StringVar(&fInputKeyPath, argsPrefix+"INPUTKEYPATH", "", "")
|
||||
flag.StringVar(&fApiUrl, argsPrefix+"APIURL", "", "")
|
||||
flag.StringVar(&fServerUrl, argsPrefix+"SERVERURL", "", "")
|
||||
flag.Int64Var(&fAccessTokenId, argsPrefix+"ACCESSTOKENID", 0, "")
|
||||
flag.StringVar(&fAccessToken, argsPrefix+"ACCESSTOKEN", "", "")
|
||||
flag.StringVar(&fSiteName, argsPrefix+"SITENAME", "", "")
|
||||
@ -37,7 +37,7 @@ Shell command to run this test:
|
||||
go test -v ./ratpanel_site_test.go -args \
|
||||
--CERTIMATE_DEPLOYER_RATPANELSITE_INPUTCERTPATH="/path/to/your-input-cert.pem" \
|
||||
--CERTIMATE_DEPLOYER_RATPANELSITE_INPUTKEYPATH="/path/to/your-input-key.pem" \
|
||||
--CERTIMATE_DEPLOYER_RATPANELSITE_APIURL="http://127.0.0.1:8888" \
|
||||
--CERTIMATE_DEPLOYER_RATPANELSITE_SERVERURL="http://127.0.0.1:8888" \
|
||||
--CERTIMATE_DEPLOYER_RATPANELSITE_ACCESSTOKENID="your-access-token-id" \
|
||||
--CERTIMATE_DEPLOYER_RATPANELSITE_ACCESSTOKEN="your-access-token" \
|
||||
--CERTIMATE_DEPLOYER_RATPANELSITE_SITENAME="your-site-name"
|
||||
@ -50,14 +50,14 @@ func TestDeploy(t *testing.T) {
|
||||
"args:",
|
||||
fmt.Sprintf("INPUTCERTPATH: %v", fInputCertPath),
|
||||
fmt.Sprintf("INPUTKEYPATH: %v", fInputKeyPath),
|
||||
fmt.Sprintf("APIURL: %v", fApiUrl),
|
||||
fmt.Sprintf("SERVERURL: %v", fServerUrl),
|
||||
fmt.Sprintf("ACCESSTOKENID: %v", fAccessTokenId),
|
||||
fmt.Sprintf("ACCESSTOKEN: %v", fAccessToken),
|
||||
fmt.Sprintf("SITENAME: %v", fSiteName),
|
||||
}, "\n"))
|
||||
|
||||
deployer, err := provider.NewDeployer(&provider.DeployerConfig{
|
||||
ApiUrl: fApiUrl,
|
||||
ServerUrl: fServerUrl,
|
||||
AccessTokenId: int32(fAccessTokenId),
|
||||
AccessToken: fAccessToken,
|
||||
AllowInsecureConnections: true,
|
||||
|
@ -13,8 +13,8 @@ import (
|
||||
)
|
||||
|
||||
type DeployerConfig struct {
|
||||
// 雷池 URL。
|
||||
ApiUrl string `json:"apiUrl"`
|
||||
// 雷池服务地址。
|
||||
ServerUrl string `json:"serverUrl"`
|
||||
// 雷池 API Token。
|
||||
ApiToken string `json:"apiToken"`
|
||||
// 是否允许不安全的连接。
|
||||
@ -39,7 +39,7 @@ func NewDeployer(config *DeployerConfig) (*DeployerProvider, error) {
|
||||
panic("config is nil")
|
||||
}
|
||||
|
||||
client, err := createSdkClient(config.ApiUrl, config.ApiToken, config.AllowInsecureConnections)
|
||||
client, err := createSdkClient(config.ServerUrl, config.ApiToken, config.AllowInsecureConnections)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to create sdk client: %w", err)
|
||||
}
|
||||
@ -98,16 +98,16 @@ func (d *DeployerProvider) deployToCertificate(ctx context.Context, certPEM stri
|
||||
return nil
|
||||
}
|
||||
|
||||
func createSdkClient(apiUrl, apiToken string, skipTlsVerify bool) (*safelinesdk.Client, error) {
|
||||
if _, err := url.Parse(apiUrl); err != nil {
|
||||
return nil, errors.New("invalid safeline api url")
|
||||
func createSdkClient(serverUrl, apiToken string, skipTlsVerify bool) (*safelinesdk.Client, error) {
|
||||
if _, err := url.Parse(serverUrl); err != nil {
|
||||
return nil, errors.New("invalid safeline server url")
|
||||
}
|
||||
|
||||
if apiToken == "" {
|
||||
return nil, errors.New("invalid safeline api token")
|
||||
}
|
||||
|
||||
client := safelinesdk.NewClient(apiUrl, apiToken)
|
||||
client := safelinesdk.NewClient(serverUrl, apiToken)
|
||||
if skipTlsVerify {
|
||||
client.WithTLSConfig(&tls.Config{InsecureSkipVerify: true})
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ import (
|
||||
var (
|
||||
fInputCertPath string
|
||||
fInputKeyPath string
|
||||
fApiUrl string
|
||||
fServerUrl string
|
||||
fApiToken string
|
||||
fCertificateId int64
|
||||
)
|
||||
@ -24,7 +24,7 @@ func init() {
|
||||
|
||||
flag.StringVar(&fInputCertPath, argsPrefix+"INPUTCERTPATH", "", "")
|
||||
flag.StringVar(&fInputKeyPath, argsPrefix+"INPUTKEYPATH", "", "")
|
||||
flag.StringVar(&fApiUrl, argsPrefix+"APIURL", "", "")
|
||||
flag.StringVar(&fServerUrl, argsPrefix+"SERVERURL", "", "")
|
||||
flag.StringVar(&fApiToken, argsPrefix+"APITOKEN", "", "")
|
||||
flag.Int64Var(&fCertificateId, argsPrefix+"CERTIFICATEID", 0, "")
|
||||
}
|
||||
@ -35,7 +35,7 @@ Shell command to run this test:
|
||||
go test -v ./safeline_test.go -args \
|
||||
--CERTIMATE_DEPLOYER_SAFELINE_INPUTCERTPATH="/path/to/your-input-cert.pem" \
|
||||
--CERTIMATE_DEPLOYER_SAFELINE_INPUTKEYPATH="/path/to/your-input-key.pem" \
|
||||
--CERTIMATE_DEPLOYER_SAFELINE_APIURL="http://127.0.0.1:9443" \
|
||||
--CERTIMATE_DEPLOYER_SAFELINE_SERVERURL="http://127.0.0.1:9443" \
|
||||
--CERTIMATE_DEPLOYER_SAFELINE_APITOKEN="your-api-token" \
|
||||
--CERTIMATE_DEPLOYER_SAFELINE_CERTIFICATEID="your-cerficiate-id"
|
||||
*/
|
||||
@ -47,13 +47,13 @@ func TestDeploy(t *testing.T) {
|
||||
"args:",
|
||||
fmt.Sprintf("INPUTCERTPATH: %v", fInputCertPath),
|
||||
fmt.Sprintf("INPUTKEYPATH: %v", fInputKeyPath),
|
||||
fmt.Sprintf("APIURL: %v", fApiUrl),
|
||||
fmt.Sprintf("SERVERURL: %v", fServerUrl),
|
||||
fmt.Sprintf("APITOKEN: %v", fApiToken),
|
||||
fmt.Sprintf("CERTIFICATEID: %v", fCertificateId),
|
||||
}, "\n"))
|
||||
|
||||
deployer, err := provider.NewDeployer(&provider.DeployerConfig{
|
||||
ApiUrl: fApiUrl,
|
||||
ServerUrl: fServerUrl,
|
||||
ApiToken: fApiToken,
|
||||
AllowInsecureConnections: true,
|
||||
ResourceType: provider.RESOURCE_TYPE_CERTIFICATE,
|
||||
|
@ -12,13 +12,13 @@ import (
|
||||
)
|
||||
|
||||
type NotifierConfig struct {
|
||||
// 服务地址。
|
||||
// Mattermost 服务地址。
|
||||
ServerUrl string `json:"serverUrl"`
|
||||
// 用户名。
|
||||
// Mattermost 用户名。
|
||||
Username string `json:"username"`
|
||||
// 密码。
|
||||
// Mattermost 密码。
|
||||
Password string `json:"password"`
|
||||
// 频道 ID。
|
||||
// Mattermost 频道 ID。
|
||||
ChannelId string `json:"channelId"`
|
||||
}
|
||||
|
||||
|
@ -15,8 +15,8 @@ import (
|
||||
)
|
||||
|
||||
type UploaderConfig struct {
|
||||
// 1Panel 地址。
|
||||
ApiUrl string `json:"apiUrl"`
|
||||
// 1Panel 服务地址。
|
||||
ServerUrl string `json:"serverUrl"`
|
||||
// 1Panel 版本。
|
||||
ApiVersion string `json:"apiVersion"`
|
||||
// 1Panel 接口密钥。
|
||||
@ -38,7 +38,7 @@ func NewUploader(config *UploaderConfig) (*UploaderProvider, error) {
|
||||
panic("config is nil")
|
||||
}
|
||||
|
||||
client, err := createSdkClient(config.ApiUrl, config.ApiVersion, config.ApiKey, config.AllowInsecureConnections)
|
||||
client, err := createSdkClient(config.ServerUrl, config.ApiVersion, config.ApiKey, config.AllowInsecureConnections)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to create sdk client: %w", err)
|
||||
}
|
||||
@ -135,9 +135,9 @@ func (u *UploaderProvider) getCertIfExists(ctx context.Context, certPEM string,
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func createSdkClient(apiUrl, apiVersion, apiKey string, skipTlsVerify bool) (*onepanelsdk.Client, error) {
|
||||
if _, err := url.Parse(apiUrl); err != nil {
|
||||
return nil, errors.New("invalid 1panel api url")
|
||||
func createSdkClient(serverUrl, apiVersion, apiKey string, skipTlsVerify bool) (*onepanelsdk.Client, error) {
|
||||
if _, err := url.Parse(serverUrl); err != nil {
|
||||
return nil, errors.New("invalid 1panel server url")
|
||||
}
|
||||
|
||||
if apiVersion == "" {
|
||||
@ -148,7 +148,7 @@ func createSdkClient(apiUrl, apiVersion, apiKey string, skipTlsVerify bool) (*on
|
||||
return nil, errors.New("invalid 1panel api key")
|
||||
}
|
||||
|
||||
client := onepanelsdk.NewClient(apiUrl, apiVersion, apiKey)
|
||||
client := onepanelsdk.NewClient(serverUrl, apiVersion, apiKey)
|
||||
if skipTlsVerify {
|
||||
client.WithTLSConfig(&tls.Config{InsecureSkipVerify: true})
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ import (
|
||||
var (
|
||||
fInputCertPath string
|
||||
fInputKeyPath string
|
||||
fApiUrl string
|
||||
fServerUrl string
|
||||
fApiVersion string
|
||||
fApiKey string
|
||||
)
|
||||
@ -25,7 +25,7 @@ func init() {
|
||||
|
||||
flag.StringVar(&fInputCertPath, argsPrefix+"INPUTCERTPATH", "", "")
|
||||
flag.StringVar(&fInputKeyPath, argsPrefix+"INPUTKEYPATH", "", "")
|
||||
flag.StringVar(&fApiUrl, argsPrefix+"APIURL", "", "")
|
||||
flag.StringVar(&fServerUrl, argsPrefix+"SERVERURL", "", "")
|
||||
flag.StringVar(&fApiVersion, argsPrefix+"APIVERSION", "v1", "")
|
||||
flag.StringVar(&fApiKey, argsPrefix+"APIKEY", "", "")
|
||||
}
|
||||
@ -36,7 +36,7 @@ Shell command to run this test:
|
||||
go test -v ./1panel_ssl_test.go -args \
|
||||
--CERTIMATE_UPLOADER_1PANELSSL_INPUTCERTPATH="/path/to/your-input-cert.pem" \
|
||||
--CERTIMATE_UPLOADER_1PANELSSL_INPUTKEYPATH="/path/to/your-input-key.pem" \
|
||||
--CERTIMATE_UPLOADER_1PANELSSL_APIURL="http://127.0.0.1:20410" \
|
||||
--CERTIMATE_UPLOADER_1PANELSSL_SERVERURL="http://127.0.0.1:20410" \
|
||||
--CERTIMATE_UPLOADER_1PANELSSL_APIVERSION="v1" \
|
||||
--CERTIMATE_UPLOADER_1PANELSSL_APIKEY="your-api-key"
|
||||
*/
|
||||
@ -48,13 +48,13 @@ func TestDeploy(t *testing.T) {
|
||||
"args:",
|
||||
fmt.Sprintf("INPUTCERTPATH: %v", fInputCertPath),
|
||||
fmt.Sprintf("INPUTKEYPATH: %v", fInputKeyPath),
|
||||
fmt.Sprintf("APIURL: %v", fApiUrl),
|
||||
fmt.Sprintf("SERVERURL: %v", fServerUrl),
|
||||
fmt.Sprintf("APIVERSION: %v", fApiVersion),
|
||||
fmt.Sprintf("APIKEY: %v", fApiKey),
|
||||
}, "\n"))
|
||||
|
||||
uploader, err := provider.NewUploader(&provider.UploaderConfig{
|
||||
ApiUrl: fApiUrl,
|
||||
ServerUrl: fServerUrl,
|
||||
ApiVersion: fApiVersion,
|
||||
ApiKey: fApiKey,
|
||||
})
|
||||
|
@ -19,13 +19,13 @@ type Client struct {
|
||||
client *resty.Client
|
||||
}
|
||||
|
||||
func NewClient(apiHost, apiVersion, apiKey string) *Client {
|
||||
func NewClient(serverUrl, apiVersion, apiKey string) *Client {
|
||||
if apiVersion == "" {
|
||||
apiVersion = "v1"
|
||||
}
|
||||
|
||||
client := resty.New().
|
||||
SetBaseURL(strings.TrimRight(apiHost, "/") + "/api/" + apiVersion).
|
||||
SetBaseURL(strings.TrimRight(serverUrl, "/") + "/api/" + apiVersion).
|
||||
SetPreRequestHook(func(c *resty.Client, req *http.Request) error {
|
||||
timestamp := fmt.Sprintf("%d", time.Now().Unix())
|
||||
tokenMd5 := md5.Sum([]byte("1panel" + apiKey + timestamp))
|
||||
|
@ -19,9 +19,9 @@ type Client struct {
|
||||
client *resty.Client
|
||||
}
|
||||
|
||||
func NewClient(apiHost, apiKey string) *Client {
|
||||
func NewClient(serverUrl, apiKey string) *Client {
|
||||
client := resty.New().
|
||||
SetBaseURL(strings.TrimRight(apiHost, "/"))
|
||||
SetBaseURL(strings.TrimRight(serverUrl, "/"))
|
||||
|
||||
return &Client{
|
||||
apiKey: apiKey,
|
||||
|
@ -17,9 +17,9 @@ type Client struct {
|
||||
client *resty.Client
|
||||
}
|
||||
|
||||
func NewClient(apiHost, apiKey string) *Client {
|
||||
func NewClient(serverUrl, apiKey string) *Client {
|
||||
client := resty.New().
|
||||
SetBaseURL(strings.TrimRight(apiHost, "/") + "/api").
|
||||
SetBaseURL(strings.TrimRight(serverUrl, "/") + "/api").
|
||||
SetPreRequestHook(func(c *resty.Client, req *http.Request) error {
|
||||
timestamp := fmt.Sprintf("%d", time.Now().Unix())
|
||||
keyMd5 := md5.Sum([]byte(apiKey))
|
||||
|
@ -15,9 +15,9 @@ type Client struct {
|
||||
client *resty.Client
|
||||
}
|
||||
|
||||
func NewClient(apiHost, apiKey, apiSecret string) *Client {
|
||||
func NewClient(serverUrl, apiKey, apiSecret string) *Client {
|
||||
client := resty.New().
|
||||
SetBaseURL(strings.TrimRight(apiHost, "/")).
|
||||
SetBaseURL(strings.TrimRight(serverUrl, "/")).
|
||||
SetHeader("api-key", apiKey).
|
||||
SetHeader("api-secret", apiSecret)
|
||||
|
||||
|
@ -24,14 +24,14 @@ type Client struct {
|
||||
client *resty.Client
|
||||
}
|
||||
|
||||
func NewClient(apiHost, apiRole, accessKeyId, accessKey string) *Client {
|
||||
func NewClient(serverUrl, apiRole, accessKeyId, accessKey string) *Client {
|
||||
client := &Client{
|
||||
apiRole: apiRole,
|
||||
accessKeyId: accessKeyId,
|
||||
accessKey: accessKey,
|
||||
}
|
||||
client.client = resty.New().
|
||||
SetBaseURL(strings.TrimRight(apiHost, "/")).
|
||||
SetBaseURL(strings.TrimRight(serverUrl, "/")).
|
||||
SetPreRequestHook(func(c *resty.Client, req *http.Request) error {
|
||||
if client.accessToken != "" {
|
||||
req.Header.Set("X-Cloud-Access-Token", client.accessToken)
|
||||
|
@ -24,14 +24,14 @@ type Client struct {
|
||||
client *resty.Client
|
||||
}
|
||||
|
||||
func NewClient(apiHost, apiRole, accessKeyId, accessKey string) *Client {
|
||||
func NewClient(serverUrl, apiRole, accessKeyId, accessKey string) *Client {
|
||||
client := &Client{
|
||||
apiRole: apiRole,
|
||||
accessKeyId: accessKeyId,
|
||||
accessKey: accessKey,
|
||||
}
|
||||
client.client = resty.New().
|
||||
SetBaseURL(strings.TrimRight(apiHost, "/")).
|
||||
SetBaseURL(strings.TrimRight(serverUrl, "/")).
|
||||
SetPreRequestHook(func(c *resty.Client, req *http.Request) error {
|
||||
if client.accessToken != "" {
|
||||
req.Header.Set("X-Edge-Access-Token", client.accessToken)
|
||||
|
@ -22,13 +22,13 @@ type Client struct {
|
||||
client *resty.Client
|
||||
}
|
||||
|
||||
func NewClient(apiHost, username, password string) *Client {
|
||||
func NewClient(serverUrl, username, password string) *Client {
|
||||
client := &Client{
|
||||
username: username,
|
||||
password: password,
|
||||
}
|
||||
client.client = resty.New().
|
||||
SetBaseURL(strings.TrimRight(apiHost, "/") + "/prod-api").
|
||||
SetBaseURL(strings.TrimRight(serverUrl, "/") + "/prod-api").
|
||||
SetPreRequestHook(func(c *resty.Client, req *http.Request) error {
|
||||
if client.accessToken != "" {
|
||||
req.Header.Set("Authorization", "Bearer "+client.accessToken)
|
||||
|
@ -22,13 +22,13 @@ type Client struct {
|
||||
client *resty.Client
|
||||
}
|
||||
|
||||
func NewClient(apiHost, username, password string) *Client {
|
||||
func NewClient(serverUrl, username, password string) *Client {
|
||||
client := &Client{
|
||||
username: username,
|
||||
password: password,
|
||||
}
|
||||
client.client = resty.New().
|
||||
SetBaseURL(strings.TrimRight(apiHost, "/") + "/prod-api").
|
||||
SetBaseURL(strings.TrimRight(serverUrl, "/") + "/prod-api").
|
||||
SetPreRequestHook(func(c *resty.Client, req *http.Request) error {
|
||||
if client.accessToken != "" {
|
||||
req.Header.Set("Authorization", "Bearer "+client.accessToken)
|
||||
|
@ -20,9 +20,9 @@ type Client struct {
|
||||
client *resty.Client
|
||||
}
|
||||
|
||||
func NewClient(apiHost string, accessTokenId int32, accessToken string) *Client {
|
||||
func NewClient(serverUrl string, accessTokenId int32, accessToken string) *Client {
|
||||
client := resty.New().
|
||||
SetBaseURL(strings.TrimRight(apiHost, "/")+"/api").
|
||||
SetBaseURL(strings.TrimRight(serverUrl, "/")+"/api").
|
||||
SetHeader("Accept", "application/json").
|
||||
SetHeader("Content-Type", "application/json").
|
||||
SetPreRequestHook(func(c *resty.Client, req *http.Request) error {
|
||||
|
@ -14,9 +14,9 @@ type Client struct {
|
||||
client *resty.Client
|
||||
}
|
||||
|
||||
func NewClient(apiHost, apiToken string) *Client {
|
||||
func NewClient(serverUrl, apiToken string) *Client {
|
||||
client := resty.New().
|
||||
SetBaseURL(strings.TrimRight(apiHost, "/")).
|
||||
SetBaseURL(strings.TrimRight(serverUrl, "/")).
|
||||
SetHeader("X-SLCE-API-TOKEN", apiToken)
|
||||
|
||||
return &Client{
|
||||
|
60
migrations/1748178000_upgrade.go
Normal file
60
migrations/1748178000_upgrade.go
Normal file
@ -0,0 +1,60 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"slices"
|
||||
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(app core.App) error {
|
||||
// migrate data
|
||||
{
|
||||
accesses, err := app.FindAllRecords("access")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
providersToUpdate := []string{
|
||||
"1panel",
|
||||
"baotapanel",
|
||||
"baotawaf",
|
||||
"cdnfly",
|
||||
"flexcdn",
|
||||
"goedge",
|
||||
"lecdn",
|
||||
"powerdns",
|
||||
"proxmoxve",
|
||||
"ratpanel",
|
||||
"safeline",
|
||||
}
|
||||
for _, access := range accesses {
|
||||
changed := false
|
||||
|
||||
if slices.Contains(providersToUpdate, access.GetString("provider")) {
|
||||
config := make(map[string]any)
|
||||
if err := access.UnmarshalJSONField("config", &config); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
config["serverUrl"] = config["apiUrl"]
|
||||
delete(config, "apiUrl")
|
||||
access.Set("config", config)
|
||||
changed = true
|
||||
}
|
||||
|
||||
if changed {
|
||||
err = app.Save(access)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}, func(app core.App) error {
|
||||
return nil
|
||||
})
|
||||
}
|
108
ui/src/components/MultipleSplitValueInput.tsx
Normal file
108
ui/src/components/MultipleSplitValueInput.tsx
Normal file
@ -0,0 +1,108 @@
|
||||
import { type ChangeEvent, useEffect } from "react";
|
||||
import { FormOutlined as FormOutlinedIcon } from "@ant-design/icons";
|
||||
import { nanoid } from "@ant-design/pro-components";
|
||||
import { useControllableValue } from "ahooks";
|
||||
import { Button, Form, Input, type InputProps, Space } from "antd";
|
||||
|
||||
import { useAntdForm } from "@/hooks";
|
||||
import ModalForm from "./ModalForm";
|
||||
import MultipleInput from "./MultipleInput";
|
||||
|
||||
type SplitOptions = {
|
||||
removeEmpty?: boolean;
|
||||
trim?: boolean;
|
||||
};
|
||||
|
||||
export type MultipleSplitValueInputProps = Omit<InputProps, "count" | "defaultValue" | "showCount" | "value" | "onChange"> & {
|
||||
defaultValue?: string;
|
||||
delimiter?: string;
|
||||
maxCount?: number;
|
||||
minCount?: number;
|
||||
modalTitle?: string;
|
||||
modalWidth?: number;
|
||||
placeholderInModal?: string;
|
||||
showSortButton?: boolean;
|
||||
splitOptions?: SplitOptions;
|
||||
value?: string[];
|
||||
onChange?: (value: string) => void;
|
||||
};
|
||||
|
||||
const DEFAULT_DELIMITER = ";";
|
||||
|
||||
const MultipleSplitValueInput = ({
|
||||
className,
|
||||
style,
|
||||
delimiter = DEFAULT_DELIMITER,
|
||||
disabled,
|
||||
maxCount,
|
||||
minCount,
|
||||
modalTitle,
|
||||
modalWidth = 480,
|
||||
placeholder,
|
||||
placeholderInModal,
|
||||
showSortButton = true,
|
||||
splitOptions = {},
|
||||
onClear,
|
||||
...props
|
||||
}: MultipleSplitValueInputProps) => {
|
||||
const [value, setValue] = useControllableValue<string>(props, {
|
||||
valuePropName: "value",
|
||||
defaultValuePropName: "defaultValue",
|
||||
trigger: "onChange",
|
||||
});
|
||||
|
||||
const { form: formInst, formProps } = useAntdForm({
|
||||
name: "componentMultipleSplitValueInput_" + nanoid(),
|
||||
initialValues: { value: value?.split(delimiter) },
|
||||
onSubmit: (values) => {
|
||||
const temp = values.value ?? [];
|
||||
if (splitOptions.trim) {
|
||||
temp.map((e) => e.trim());
|
||||
}
|
||||
if (splitOptions.removeEmpty) {
|
||||
temp.filter((e) => !!e);
|
||||
}
|
||||
|
||||
setValue(temp.join(delimiter));
|
||||
},
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
formInst.setFieldValue("value", value?.split(delimiter));
|
||||
}, [delimiter, value]);
|
||||
|
||||
const handleChange = (e: ChangeEvent<HTMLInputElement>) => {
|
||||
setValue(e.target.value);
|
||||
};
|
||||
|
||||
const handleClear = () => {
|
||||
setValue("");
|
||||
onClear?.();
|
||||
};
|
||||
|
||||
return (
|
||||
<Space.Compact className={className} style={{ width: "100%", ...style }}>
|
||||
<Input {...props} disabled={disabled} placeholder={placeholder} value={value} onChange={handleChange} onClear={handleClear} />
|
||||
<ModalForm
|
||||
{...formProps}
|
||||
layout="vertical"
|
||||
form={formInst}
|
||||
modalProps={{ destroyOnHidden: true }}
|
||||
title={modalTitle}
|
||||
trigger={
|
||||
<Button disabled={disabled}>
|
||||
<FormOutlinedIcon />
|
||||
</Button>
|
||||
}
|
||||
validateTrigger="onSubmit"
|
||||
width={modalWidth}
|
||||
>
|
||||
<Form.Item name="value" noStyle>
|
||||
<MultipleInput minCount={minCount} maxCount={maxCount} placeholder={placeholderInModal ?? placeholder} showSortButton={showSortButton} />
|
||||
</Form.Item>
|
||||
</ModalForm>
|
||||
</Space.Compact>
|
||||
);
|
||||
};
|
||||
|
||||
export default MultipleSplitValueInput;
|
@ -17,7 +17,7 @@ export type AccessForm1PanelConfigProps = {
|
||||
|
||||
const initFormModel = (): AccessForm1PanelConfigFieldValues => {
|
||||
return {
|
||||
apiUrl: "http://<your-host-addr>:20410/",
|
||||
serverUrl: "http://<your-host-addr>:20410/",
|
||||
apiVersion: "v1",
|
||||
apiKey: "",
|
||||
};
|
||||
@ -27,7 +27,7 @@ const AccessForm1PanelConfig = ({ form: formInst, formName, disabled, initialVal
|
||||
const { t } = useTranslation();
|
||||
|
||||
const formSchema = z.object({
|
||||
apiUrl: z.string().url(t("common.errmsg.url_invalid")),
|
||||
serverUrl: z.string().url(t("common.errmsg.url_invalid")),
|
||||
apiVersion: z.string().nonempty(t("access.form.1panel_api_version.placeholder")),
|
||||
apiKey: z
|
||||
.string()
|
||||
@ -51,8 +51,8 @@ const AccessForm1PanelConfig = ({ form: formInst, formName, disabled, initialVal
|
||||
name={formName}
|
||||
onValuesChange={handleFormChange}
|
||||
>
|
||||
<Form.Item name="apiUrl" label={t("access.form.1panel_api_url.label")} rules={[formRule]}>
|
||||
<Input placeholder={t("access.form.1panel_api_url.placeholder")} />
|
||||
<Form.Item name="serverUrl" label={t("access.form.1panel_server_url.label")} rules={[formRule]}>
|
||||
<Input placeholder={t("access.form.1panel_server_url.placeholder")} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item name="apiVersion" label={t("access.form.1panel_api_version.label")} rules={[formRule]}>
|
||||
@ -68,10 +68,10 @@ const AccessForm1PanelConfig = ({ form: formInst, formName, disabled, initialVal
|
||||
<Input.Password autoComplete="new-password" placeholder={t("access.form.1panel_api_key.placeholder")} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item name="allowInsecureConnections" label={t("access.form.1panel_allow_insecure_conns.label")} rules={[formRule]}>
|
||||
<Form.Item name="allowInsecureConnections" label={t("access.form.common_allow_insecure_conns.label")} rules={[formRule]}>
|
||||
<Switch
|
||||
checkedChildren={t("access.form.1panel_allow_insecure_conns.switch.on")}
|
||||
unCheckedChildren={t("access.form.1panel_allow_insecure_conns.switch.off")}
|
||||
checkedChildren={t("access.form.common_allow_insecure_conns.switch.on")}
|
||||
unCheckedChildren={t("access.form.common_allow_insecure_conns.switch.off")}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
|
@ -17,7 +17,7 @@ export type AccessFormBaotaPanelConfigProps = {
|
||||
|
||||
const initFormModel = (): AccessFormBaotaPanelConfigFieldValues => {
|
||||
return {
|
||||
apiUrl: "http://<your-host-addr>:8888/",
|
||||
serverUrl: "http://<your-host-addr>:8888/",
|
||||
apiKey: "",
|
||||
};
|
||||
};
|
||||
@ -26,7 +26,7 @@ const AccessFormBaotaPanelConfig = ({ form: formInst, formName, disabled, initia
|
||||
const { t } = useTranslation();
|
||||
|
||||
const formSchema = z.object({
|
||||
apiUrl: z.string().url(t("common.errmsg.url_invalid")),
|
||||
serverUrl: z.string().url(t("common.errmsg.url_invalid")),
|
||||
apiKey: z.string().nonempty(t("access.form.baotapanel_api_key.placeholder")).trim(),
|
||||
allowInsecureConnections: z.boolean().nullish(),
|
||||
});
|
||||
@ -45,8 +45,8 @@ const AccessFormBaotaPanelConfig = ({ form: formInst, formName, disabled, initia
|
||||
name={formName}
|
||||
onValuesChange={handleFormChange}
|
||||
>
|
||||
<Form.Item name="apiUrl" label={t("access.form.baotapanel_api_url.label")} rules={[formRule]}>
|
||||
<Input placeholder={t("access.form.baotapanel_api_url.placeholder")} />
|
||||
<Form.Item name="serverUrl" label={t("access.form.baotapanel_server_url.label")} rules={[formRule]}>
|
||||
<Input placeholder={t("access.form.baotapanel_server_url.placeholder")} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
@ -58,10 +58,10 @@ const AccessFormBaotaPanelConfig = ({ form: formInst, formName, disabled, initia
|
||||
<Input.Password autoComplete="new-password" placeholder={t("access.form.baotapanel_api_key.placeholder")} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item name="allowInsecureConnections" label={t("access.form.baotapanel_allow_insecure_conns.label")} rules={[formRule]}>
|
||||
<Form.Item name="allowInsecureConnections" label={t("access.form.common_allow_insecure_conns.label")} rules={[formRule]}>
|
||||
<Switch
|
||||
checkedChildren={t("access.form.baotapanel_allow_insecure_conns.switch.on")}
|
||||
unCheckedChildren={t("access.form.baotapanel_allow_insecure_conns.switch.off")}
|
||||
checkedChildren={t("access.form.common_allow_insecure_conns.switch.on")}
|
||||
unCheckedChildren={t("access.form.common_allow_insecure_conns.switch.off")}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
|
@ -17,7 +17,7 @@ export type AccessFormBaotaWAFConfigProps = {
|
||||
|
||||
const initFormModel = (): AccessFormBaotaWAFConfigFieldValues => {
|
||||
return {
|
||||
apiUrl: "http://<your-host-addr>:8379/",
|
||||
serverUrl: "http://<your-host-addr>:8379/",
|
||||
apiKey: "",
|
||||
};
|
||||
};
|
||||
@ -26,7 +26,7 @@ const AccessFormBaotaWAFConfig = ({ form: formInst, formName, disabled, initialV
|
||||
const { t } = useTranslation();
|
||||
|
||||
const formSchema = z.object({
|
||||
apiUrl: z.string().url(t("common.errmsg.url_invalid")),
|
||||
serverUrl: z.string().url(t("common.errmsg.url_invalid")),
|
||||
apiKey: z.string().nonempty(t("access.form.baotawaf_api_key.placeholder")).trim(),
|
||||
allowInsecureConnections: z.boolean().nullish(),
|
||||
});
|
||||
@ -45,8 +45,8 @@ const AccessFormBaotaWAFConfig = ({ form: formInst, formName, disabled, initialV
|
||||
name={formName}
|
||||
onValuesChange={handleFormChange}
|
||||
>
|
||||
<Form.Item name="apiUrl" label={t("access.form.baotawaf_api_url.label")} rules={[formRule]}>
|
||||
<Input placeholder={t("access.form.baotawaf_api_url.placeholder")} />
|
||||
<Form.Item name="serverUrl" label={t("access.form.baotawaf_server_url.label")} rules={[formRule]}>
|
||||
<Input placeholder={t("access.form.baotawaf_server_url.placeholder")} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
@ -58,10 +58,10 @@ const AccessFormBaotaWAFConfig = ({ form: formInst, formName, disabled, initialV
|
||||
<Input.Password autoComplete="new-password" placeholder={t("access.form.baotawaf_api_key.placeholder")} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item name="allowInsecureConnections" label={t("access.form.baotawaf_allow_insecure_conns.label")} rules={[formRule]}>
|
||||
<Form.Item name="allowInsecureConnections" label={t("access.form.common_allow_insecure_conns.label")} rules={[formRule]}>
|
||||
<Switch
|
||||
checkedChildren={t("access.form.baotawaf_allow_insecure_conns.switch.on")}
|
||||
unCheckedChildren={t("access.form.baotawaf_allow_insecure_conns.switch.off")}
|
||||
checkedChildren={t("access.form.common_allow_insecure_conns.switch.on")}
|
||||
unCheckedChildren={t("access.form.common_allow_insecure_conns.switch.off")}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
|
@ -17,7 +17,7 @@ export type AccessFormCdnflyConfigProps = {
|
||||
|
||||
const initFormModel = (): AccessFormCdnflyConfigFieldValues => {
|
||||
return {
|
||||
apiUrl: "http://<your-host-addr>:88/",
|
||||
serverUrl: "http://<your-host-addr>:88/",
|
||||
apiKey: "",
|
||||
apiSecret: "",
|
||||
};
|
||||
@ -27,7 +27,7 @@ const AccessFormCdnflyConfig = ({ form: formInst, formName, disabled, initialVal
|
||||
const { t } = useTranslation();
|
||||
|
||||
const formSchema = z.object({
|
||||
apiUrl: z.string().url(t("common.errmsg.url_invalid")),
|
||||
serverUrl: z.string().url(t("common.errmsg.url_invalid")),
|
||||
apiKey: z
|
||||
.string()
|
||||
.min(1, t("access.form.cdnfly_api_key.placeholder"))
|
||||
@ -55,8 +55,8 @@ const AccessFormCdnflyConfig = ({ form: formInst, formName, disabled, initialVal
|
||||
name={formName}
|
||||
onValuesChange={handleFormChange}
|
||||
>
|
||||
<Form.Item name="apiUrl" label={t("access.form.cdnfly_api_url.label")} rules={[formRule]}>
|
||||
<Input placeholder={t("access.form.cdnfly_api_url.placeholder")} />
|
||||
<Form.Item name="serverUrl" label={t("access.form.cdnfly_server_url.label")} rules={[formRule]}>
|
||||
<Input placeholder={t("access.form.cdnfly_server_url.placeholder")} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
@ -77,10 +77,10 @@ const AccessFormCdnflyConfig = ({ form: formInst, formName, disabled, initialVal
|
||||
<Input.Password autoComplete="new-password" placeholder={t("access.form.cdnfly_api_secret.placeholder")} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item name="allowInsecureConnections" label={t("access.form.cdnfly_allow_insecure_conns.label")} rules={[formRule]}>
|
||||
<Form.Item name="allowInsecureConnections" label={t("access.form.common_allow_insecure_conns.label")} rules={[formRule]}>
|
||||
<Switch
|
||||
checkedChildren={t("access.form.cdnfly_allow_insecure_conns.switch.on")}
|
||||
unCheckedChildren={t("access.form.cdnfly_allow_insecure_conns.switch.off")}
|
||||
checkedChildren={t("access.form.common_allow_insecure_conns.switch.on")}
|
||||
unCheckedChildren={t("access.form.common_allow_insecure_conns.switch.off")}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
|
@ -17,7 +17,7 @@ export type AccessFormFlexCDNConfigProps = {
|
||||
|
||||
const initFormModel = (): AccessFormFlexCDNConfigFieldValues => {
|
||||
return {
|
||||
apiUrl: "http://<your-host-addr>:8000/",
|
||||
serverUrl: "http://<your-host-addr>:8000/",
|
||||
apiRole: "user",
|
||||
accessKeyId: "",
|
||||
accessKey: "",
|
||||
@ -28,7 +28,7 @@ const AccessFormFlexCDNConfig = ({ form: formInst, formName, disabled, initialVa
|
||||
const { t } = useTranslation();
|
||||
|
||||
const formSchema = z.object({
|
||||
apiUrl: z.string().url(t("common.errmsg.url_invalid")),
|
||||
serverUrl: z.string().url(t("common.errmsg.url_invalid")),
|
||||
role: z.union([z.literal("user"), z.literal("admin")], {
|
||||
message: t("access.form.flexcdn_api_role.placeholder"),
|
||||
}),
|
||||
@ -51,8 +51,8 @@ const AccessFormFlexCDNConfig = ({ form: formInst, formName, disabled, initialVa
|
||||
name={formName}
|
||||
onValuesChange={handleFormChange}
|
||||
>
|
||||
<Form.Item name="apiUrl" label={t("access.form.flexcdn_api_url.label")} rules={[formRule]}>
|
||||
<Input placeholder={t("access.form.flexcdn_api_url.placeholder")} />
|
||||
<Form.Item name="serverUrl" label={t("access.form.flexcdn_server_url.label")} rules={[formRule]}>
|
||||
<Input placeholder={t("access.form.flexcdn_server_url.placeholder")} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item name="apiRole" label={t("access.form.flexcdn_api_role.label")} rules={[formRule]}>
|
||||
@ -77,10 +77,10 @@ const AccessFormFlexCDNConfig = ({ form: formInst, formName, disabled, initialVa
|
||||
<Input.Password autoComplete="new-password" placeholder={t("access.form.flexcdn_access_key.placeholder")} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item name="allowInsecureConnections" label={t("access.form.flexcdn_allow_insecure_conns.label")} rules={[formRule]}>
|
||||
<Form.Item name="allowInsecureConnections" label={t("access.form.common_allow_insecure_conns.label")} rules={[formRule]}>
|
||||
<Switch
|
||||
checkedChildren={t("access.form.flexcdn_allow_insecure_conns.switch.on")}
|
||||
unCheckedChildren={t("access.form.flexcdn_allow_insecure_conns.switch.off")}
|
||||
checkedChildren={t("access.form.common_allow_insecure_conns.switch.on")}
|
||||
unCheckedChildren={t("access.form.common_allow_insecure_conns.switch.off")}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
|
@ -17,7 +17,7 @@ export type AccessFormGoEdgeConfigProps = {
|
||||
|
||||
const initFormModel = (): AccessFormGoEdgeConfigFieldValues => {
|
||||
return {
|
||||
apiUrl: "http://<your-host-addr>:7788/",
|
||||
serverUrl: "http://<your-host-addr>:7788/",
|
||||
apiRole: "user",
|
||||
accessKeyId: "",
|
||||
accessKey: "",
|
||||
@ -28,7 +28,7 @@ const AccessFormGoEdgeConfig = ({ form: formInst, formName, disabled, initialVal
|
||||
const { t } = useTranslation();
|
||||
|
||||
const formSchema = z.object({
|
||||
apiUrl: z.string().url(t("common.errmsg.url_invalid")),
|
||||
serverUrl: z.string().url(t("common.errmsg.url_invalid")),
|
||||
role: z.union([z.literal("user"), z.literal("admin")], {
|
||||
message: t("access.form.goedge_api_role.placeholder"),
|
||||
}),
|
||||
@ -51,8 +51,8 @@ const AccessFormGoEdgeConfig = ({ form: formInst, formName, disabled, initialVal
|
||||
name={formName}
|
||||
onValuesChange={handleFormChange}
|
||||
>
|
||||
<Form.Item name="apiUrl" label={t("access.form.goedge_api_url.label")} rules={[formRule]}>
|
||||
<Input placeholder={t("access.form.goedge_api_url.placeholder")} />
|
||||
<Form.Item name="serverUrl" label={t("access.form.goedge_server_url.label")} rules={[formRule]}>
|
||||
<Input placeholder={t("access.form.goedge_server_url.placeholder")} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item name="apiRole" label={t("access.form.goedge_api_role.label")} rules={[formRule]}>
|
||||
@ -77,10 +77,10 @@ const AccessFormGoEdgeConfig = ({ form: formInst, formName, disabled, initialVal
|
||||
<Input.Password autoComplete="new-password" placeholder={t("access.form.goedge_access_key.placeholder")} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item name="allowInsecureConnections" label={t("access.form.goedge_allow_insecure_conns.label")} rules={[formRule]}>
|
||||
<Form.Item name="allowInsecureConnections" label={t("access.form.common_allow_insecure_conns.label")} rules={[formRule]}>
|
||||
<Switch
|
||||
checkedChildren={t("access.form.goedge_allow_insecure_conns.switch.on")}
|
||||
unCheckedChildren={t("access.form.goedge_allow_insecure_conns.switch.off")}
|
||||
checkedChildren={t("access.form.common_allow_insecure_conns.switch.on")}
|
||||
unCheckedChildren={t("access.form.common_allow_insecure_conns.switch.off")}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
|
@ -17,7 +17,7 @@ export type AccessFormLeCDNConfigProps = {
|
||||
|
||||
const initFormModel = (): AccessFormLeCDNConfigFieldValues => {
|
||||
return {
|
||||
apiUrl: "http://<your-host-addr>:5090/",
|
||||
serverUrl: "http://<your-host-addr>:5090/",
|
||||
apiVersion: "v3",
|
||||
apiRole: "user",
|
||||
username: "",
|
||||
@ -29,7 +29,7 @@ const AccessFormLeCDNConfig = ({ form: formInst, formName, disabled, initialValu
|
||||
const { t } = useTranslation();
|
||||
|
||||
const formSchema = z.object({
|
||||
apiUrl: z.string().url(t("common.errmsg.url_invalid")),
|
||||
serverUrl: z.string().url(t("common.errmsg.url_invalid")),
|
||||
role: z.union([z.literal("client"), z.literal("master")], {
|
||||
message: t("access.form.lecdn_api_role.placeholder"),
|
||||
}),
|
||||
@ -52,8 +52,8 @@ const AccessFormLeCDNConfig = ({ form: formInst, formName, disabled, initialValu
|
||||
name={formName}
|
||||
onValuesChange={handleFormChange}
|
||||
>
|
||||
<Form.Item name="apiUrl" label={t("access.form.lecdn_api_url.label")} rules={[formRule]}>
|
||||
<Input placeholder={t("access.form.lecdn_api_url.placeholder")} />
|
||||
<Form.Item name="serverUrl" label={t("access.form.lecdn_server_url.label")} rules={[formRule]}>
|
||||
<Input placeholder={t("access.form.lecdn_server_url.placeholder")} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item name="apiVersion" label={t("access.form.lecdn_api_version.label")} rules={[formRule]}>
|
||||
@ -72,10 +72,10 @@ const AccessFormLeCDNConfig = ({ form: formInst, formName, disabled, initialValu
|
||||
<Input.Password autoComplete="new-password" placeholder={t("access.form.lecdn_password.placeholder")} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item name="allowInsecureConnections" label={t("access.form.lecdn_allow_insecure_conns.label")} rules={[formRule]}>
|
||||
<Form.Item name="allowInsecureConnections" label={t("access.form.common_allow_insecure_conns.label")} rules={[formRule]}>
|
||||
<Switch
|
||||
checkedChildren={t("access.form.lecdn_allow_insecure_conns.switch.on")}
|
||||
unCheckedChildren={t("access.form.lecdn_allow_insecure_conns.switch.off")}
|
||||
checkedChildren={t("access.form.common_allow_insecure_conns.switch.on")}
|
||||
unCheckedChildren={t("access.form.common_allow_insecure_conns.switch.off")}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
|
@ -17,7 +17,7 @@ export type AccessFormPowerDNSConfigProps = {
|
||||
|
||||
const initFormModel = (): AccessFormPowerDNSConfigFieldValues => {
|
||||
return {
|
||||
apiUrl: "http://<your-host-addr>:8082/",
|
||||
serverUrl: "http://<your-host-addr>:8082/",
|
||||
apiKey: "",
|
||||
};
|
||||
};
|
||||
@ -26,7 +26,7 @@ const AccessFormPowerDNSConfig = ({ form: formInst, formName, disabled, initialV
|
||||
const { t } = useTranslation();
|
||||
|
||||
const formSchema = z.object({
|
||||
apiUrl: z.string().url(t("common.errmsg.url_invalid")),
|
||||
serverUrl: z.string().url(t("common.errmsg.url_invalid")),
|
||||
apiKey: z
|
||||
.string()
|
||||
.min(1, t("access.form.powerdns_api_key.placeholder"))
|
||||
@ -49,8 +49,8 @@ const AccessFormPowerDNSConfig = ({ form: formInst, formName, disabled, initialV
|
||||
name={formName}
|
||||
onValuesChange={handleFormChange}
|
||||
>
|
||||
<Form.Item name="apiUrl" label={t("access.form.powerdns_api_url.label")} rules={[formRule]}>
|
||||
<Input placeholder={t("access.form.powerdns_api_url.placeholder")} />
|
||||
<Form.Item name="serverUrl" label={t("access.form.powerdns_server_url.label")} rules={[formRule]}>
|
||||
<Input placeholder={t("access.form.powerdns_server_url.placeholder")} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
@ -62,10 +62,10 @@ const AccessFormPowerDNSConfig = ({ form: formInst, formName, disabled, initialV
|
||||
<Input.Password autoComplete="new-password" placeholder={t("access.form.powerdns_api_key.placeholder")} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item name="allowInsecureConnections" label={t("access.form.powerdns_allow_insecure_conns.label")} rules={[formRule]}>
|
||||
<Form.Item name="allowInsecureConnections" label={t("access.form.common_allow_insecure_conns.label")} rules={[formRule]}>
|
||||
<Switch
|
||||
checkedChildren={t("access.form.powerdns_allow_insecure_conns.switch.on")}
|
||||
unCheckedChildren={t("access.form.powerdns_allow_insecure_conns.switch.off")}
|
||||
checkedChildren={t("access.form.common_allow_insecure_conns.switch.on")}
|
||||
unCheckedChildren={t("access.form.common_allow_insecure_conns.switch.off")}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
|
@ -17,7 +17,7 @@ export type AccessFormProxmoxVEConfigProps = {
|
||||
|
||||
const initFormModel = (): AccessFormProxmoxVEConfigFieldValues => {
|
||||
return {
|
||||
apiUrl: "http://<your-host-addr>:8006/",
|
||||
serverUrl: "http://<your-host-addr>:8006/",
|
||||
apiToken: "",
|
||||
};
|
||||
};
|
||||
@ -26,7 +26,7 @@ const AccessFormProxmoxVEConfig = ({ form: formInst, formName, disabled, initial
|
||||
const { t } = useTranslation();
|
||||
|
||||
const formSchema = z.object({
|
||||
apiUrl: z.string().url(t("common.errmsg.url_invalid")),
|
||||
serverUrl: z.string().url(t("common.errmsg.url_invalid")),
|
||||
apiToken: z.string().nonempty(t("access.form.proxmoxve_api_token.placeholder")).trim(),
|
||||
apiTokenSecret: z.string().nullish(),
|
||||
allowInsecureConnections: z.boolean().nullish(),
|
||||
@ -46,8 +46,8 @@ const AccessFormProxmoxVEConfig = ({ form: formInst, formName, disabled, initial
|
||||
name={formName}
|
||||
onValuesChange={handleFormChange}
|
||||
>
|
||||
<Form.Item name="apiUrl" label={t("access.form.proxmoxve_api_url.label")} rules={[formRule]}>
|
||||
<Input placeholder={t("access.form.proxmoxve_api_url.placeholder")} />
|
||||
<Form.Item name="serverUrl" label={t("access.form.proxmoxve_server_url.label")} rules={[formRule]}>
|
||||
<Input placeholder={t("access.form.proxmoxve_server_url.placeholder")} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
@ -68,10 +68,10 @@ const AccessFormProxmoxVEConfig = ({ form: formInst, formName, disabled, initial
|
||||
<Input.Password allowClear autoComplete="new-password" placeholder={t("access.form.proxmoxve_api_token_secret.placeholder")} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item name="allowInsecureConnections" label={t("access.form.proxmoxve_allow_insecure_conns.label")} rules={[formRule]}>
|
||||
<Form.Item name="allowInsecureConnections" label={t("access.form.common_allow_insecure_conns.label")} rules={[formRule]}>
|
||||
<Switch
|
||||
checkedChildren={t("access.form.proxmoxve_allow_insecure_conns.switch.on")}
|
||||
unCheckedChildren={t("access.form.proxmoxve_allow_insecure_conns.switch.off")}
|
||||
checkedChildren={t("access.form.common_allow_insecure_conns.switch.on")}
|
||||
unCheckedChildren={t("access.form.common_allow_insecure_conns.switch.off")}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
|
@ -17,7 +17,7 @@ export type AccessFormRatPanelConfigProps = {
|
||||
|
||||
const initFormModel = (): AccessFormRatPanelConfigFieldValues => {
|
||||
return {
|
||||
apiUrl: "http://<your-host-addr>:8888/",
|
||||
serverUrl: "http://<your-host-addr>:8888/",
|
||||
accessTokenId: 1,
|
||||
accessToken: "",
|
||||
};
|
||||
@ -27,7 +27,7 @@ const AccessFormRatPanelConfig = ({ form: formInst, formName, disabled, initialV
|
||||
const { t } = useTranslation();
|
||||
|
||||
const formSchema = z.object({
|
||||
apiUrl: z.string().url(t("common.errmsg.url_invalid")),
|
||||
serverUrl: z.string().url(t("common.errmsg.url_invalid")),
|
||||
accessTokenId: z.preprocess((v) => Number(v), z.number().positive(t("access.form.ratpanel_access_token_id.placeholder"))),
|
||||
accessToken: z.string().nonempty(t("access.form.ratpanel_access_token.placeholder")).trim(),
|
||||
allowInsecureConnections: z.boolean().nullish(),
|
||||
@ -47,8 +47,8 @@ const AccessFormRatPanelConfig = ({ form: formInst, formName, disabled, initialV
|
||||
name={formName}
|
||||
onValuesChange={handleFormChange}
|
||||
>
|
||||
<Form.Item name="apiUrl" label={t("access.form.ratpanel_api_url.label")} rules={[formRule]}>
|
||||
<Input placeholder={t("access.form.ratpanel_api_url.placeholder")} />
|
||||
<Form.Item name="serverUrl" label={t("access.form.ratpanel_server_url.label")} rules={[formRule]}>
|
||||
<Input placeholder={t("access.form.ratpanel_server_url.placeholder")} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
@ -69,10 +69,10 @@ const AccessFormRatPanelConfig = ({ form: formInst, formName, disabled, initialV
|
||||
<Input.Password autoComplete="new-password" placeholder={t("access.form.ratpanel_access_token.placeholder")} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item name="allowInsecureConnections" label={t("access.form.ratpanel_allow_insecure_conns.label")} rules={[formRule]}>
|
||||
<Form.Item name="allowInsecureConnections" label={t("access.form.common_allow_insecure_conns.label")} rules={[formRule]}>
|
||||
<Switch
|
||||
checkedChildren={t("access.form.ratpanel_allow_insecure_conns.switch.on")}
|
||||
unCheckedChildren={t("access.form.ratpanel_allow_insecure_conns.switch.off")}
|
||||
checkedChildren={t("access.form.common_allow_insecure_conns.switch.on")}
|
||||
unCheckedChildren={t("access.form.common_allow_insecure_conns.switch.off")}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
|
@ -17,7 +17,7 @@ export type AccessFormSafeLineConfigProps = {
|
||||
|
||||
const initFormModel = (): AccessFormSafeLineConfigFieldValues => {
|
||||
return {
|
||||
apiUrl: "http://<your-host-addr>:9443/",
|
||||
serverUrl: "http://<your-host-addr>:9443/",
|
||||
apiToken: "",
|
||||
};
|
||||
};
|
||||
@ -26,7 +26,7 @@ const AccessFormSafeLineConfig = ({ form: formInst, formName, disabled, initialV
|
||||
const { t } = useTranslation();
|
||||
|
||||
const formSchema = z.object({
|
||||
apiUrl: z.string().url(t("common.errmsg.url_invalid")),
|
||||
serverUrl: z.string().url(t("common.errmsg.url_invalid")),
|
||||
apiToken: z
|
||||
.string()
|
||||
.min(1, t("access.form.safeline_api_token.placeholder"))
|
||||
@ -49,8 +49,8 @@ const AccessFormSafeLineConfig = ({ form: formInst, formName, disabled, initialV
|
||||
name={formName}
|
||||
onValuesChange={handleFormChange}
|
||||
>
|
||||
<Form.Item name="apiUrl" label={t("access.form.safeline_api_url.label")} rules={[formRule]}>
|
||||
<Input placeholder={t("access.form.safeline_api_url.placeholder")} />
|
||||
<Form.Item name="serverUrl" label={t("access.form.safeline_server_url.label")} rules={[formRule]}>
|
||||
<Input placeholder={t("access.form.safeline_server_url.placeholder")} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
@ -62,10 +62,10 @@ const AccessFormSafeLineConfig = ({ form: formInst, formName, disabled, initialV
|
||||
<Input.Password autoComplete="new-password" placeholder={t("access.form.safeline_api_token.placeholder")} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item name="allowInsecureConnections" label={t("access.form.safeline_allow_insecure_conns.label")} rules={[formRule]}>
|
||||
<Form.Item name="allowInsecureConnections" label={t("access.form.common_allow_insecure_conns.label")} rules={[formRule]}>
|
||||
<Switch
|
||||
checkedChildren={t("access.form.safeline_allow_insecure_conns.switch.on")}
|
||||
unCheckedChildren={t("access.form.safeline_allow_insecure_conns.switch.off")}
|
||||
checkedChildren={t("access.form.common_allow_insecure_conns.switch.on")}
|
||||
unCheckedChildren={t("access.form.common_allow_insecure_conns.switch.off")}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
|
@ -362,10 +362,10 @@ const AccessFormWebhookConfig = ({ form: formInst, formName, disabled, initialVa
|
||||
</Form.Item>
|
||||
</Show>
|
||||
|
||||
<Form.Item name="allowInsecureConnections" label={t("access.form.webhook_allow_insecure_conns.label")} rules={[formRule]}>
|
||||
<Form.Item name="allowInsecureConnections" label={t("access.form.common_allow_insecure_conns.label")} rules={[formRule]}>
|
||||
<Switch
|
||||
checkedChildren={t("access.form.webhook_allow_insecure_conns.switch.on")}
|
||||
unCheckedChildren={t("access.form.webhook_allow_insecure_conns.switch.off")}
|
||||
checkedChildren={t("access.form.common_allow_insecure_conns.switch.on")}
|
||||
unCheckedChildren={t("access.form.common_allow_insecure_conns.switch.off")}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
|
@ -1,12 +1,7 @@
|
||||
import { forwardRef, memo, useEffect, useImperativeHandle, useMemo, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Link } from "react-router";
|
||||
import {
|
||||
FormOutlined as FormOutlinedIcon,
|
||||
PlusOutlined as PlusOutlinedIcon,
|
||||
QuestionCircleOutlined as QuestionCircleOutlinedIcon,
|
||||
RightOutlined as RightOutlinedIcon,
|
||||
} from "@ant-design/icons";
|
||||
import { PlusOutlined as PlusOutlinedIcon, QuestionCircleOutlined as QuestionCircleOutlinedIcon, RightOutlined as RightOutlinedIcon } from "@ant-design/icons";
|
||||
import { useControllableValue } from "ahooks";
|
||||
import {
|
||||
AutoComplete,
|
||||
@ -19,7 +14,6 @@ import {
|
||||
Input,
|
||||
InputNumber,
|
||||
Select,
|
||||
Space,
|
||||
Switch,
|
||||
Tooltip,
|
||||
Typography,
|
||||
@ -29,8 +23,7 @@ import { z } from "zod";
|
||||
|
||||
import AccessEditModal from "@/components/access/AccessEditModal";
|
||||
import AccessSelect from "@/components/access/AccessSelect";
|
||||
import ModalForm from "@/components/ModalForm";
|
||||
import MultipleInput from "@/components/MultipleInput";
|
||||
import MultipleSplitValueInput from "@/components/MultipleSplitValueInput";
|
||||
import ACMEDns01ProviderSelect from "@/components/provider/ACMEDns01ProviderSelect";
|
||||
import CAProviderSelect from "@/components/provider/CAProviderSelect";
|
||||
import Show from "@/components/Show";
|
||||
@ -152,11 +145,9 @@ const ApplyNodeConfigForm = forwardRef<ApplyNodeConfigFormInstance, ApplyNodeCon
|
||||
initialValues: initialValues ?? initFormModel(),
|
||||
});
|
||||
|
||||
const fieldDomains = Form.useWatch<string>("domains", formInst);
|
||||
const fieldProvider = Form.useWatch<string>("provider", { form: formInst, preserve: true });
|
||||
const fieldProviderAccessId = Form.useWatch<string>("providerAccessId", formInst);
|
||||
const fieldCAProvider = Form.useWatch<string>("caProvider", formInst);
|
||||
const fieldNameservers = Form.useWatch<string>("nameservers", formInst);
|
||||
|
||||
const [showProvider, setShowProvider] = useState(false);
|
||||
useEffect(() => {
|
||||
@ -294,25 +285,17 @@ const ApplyNodeConfigForm = forwardRef<ApplyNodeConfigFormInstance, ApplyNodeCon
|
||||
<Form.Provider onFormChange={handleFormProviderChange}>
|
||||
<Form className={className} style={style} {...formProps} disabled={disabled} layout="vertical" scrollToFirstError onValuesChange={handleFormChange}>
|
||||
<Form.Item
|
||||
name="domains"
|
||||
label={t("workflow_node.apply.form.domains.label")}
|
||||
rules={[formRule]}
|
||||
tooltip={<span dangerouslySetInnerHTML={{ __html: t("workflow_node.apply.form.domains.tooltip") }}></span>}
|
||||
>
|
||||
<Space.Compact style={{ width: "100%" }}>
|
||||
<Form.Item name="domains" noStyle rules={[formRule]}>
|
||||
<Input placeholder={t("workflow_node.apply.form.domains.placeholder")} />
|
||||
</Form.Item>
|
||||
<DomainsModalInput
|
||||
value={fieldDomains}
|
||||
trigger={
|
||||
<Button disabled={disabled}>
|
||||
<FormOutlinedIcon />
|
||||
</Button>
|
||||
}
|
||||
onChange={(v) => {
|
||||
formInst.setFieldValue("domains", v);
|
||||
}}
|
||||
/>
|
||||
</Space.Compact>
|
||||
<MultipleSplitValueInput
|
||||
modalTitle={t("workflow_node.apply.form.domains.multiple_input_modal.title")}
|
||||
placeholder={t("workflow_node.apply.form.domains.placeholder")}
|
||||
placeholderInModal={t("workflow_node.apply.form.domains.multiple_input_modal.placeholder")}
|
||||
splitOptions={{ trim: true, removeEmpty: true }}
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
@ -497,36 +480,17 @@ const ApplyNodeConfigForm = forwardRef<ApplyNodeConfigFormInstance, ApplyNodeCon
|
||||
|
||||
<Form className={className} style={style} {...formProps} disabled={disabled} layout="vertical" scrollToFirstError onValuesChange={handleFormChange}>
|
||||
<Form.Item
|
||||
name="nameservers"
|
||||
label={t("workflow_node.apply.form.nameservers.label")}
|
||||
rules={[formRule]}
|
||||
tooltip={<span dangerouslySetInnerHTML={{ __html: t("workflow_node.apply.form.nameservers.tooltip") }}></span>}
|
||||
>
|
||||
<Space.Compact style={{ width: "100%" }}>
|
||||
<Form.Item name="nameservers" noStyle rules={[formRule]}>
|
||||
<Input
|
||||
allowClear
|
||||
disabled={disabled}
|
||||
value={fieldNameservers}
|
||||
placeholder={t("workflow_node.apply.form.nameservers.placeholder")}
|
||||
onChange={(e) => {
|
||||
formInst.setFieldValue("nameservers", e.target.value);
|
||||
}}
|
||||
onClear={() => {
|
||||
formInst.setFieldValue("nameservers", undefined);
|
||||
}}
|
||||
/>
|
||||
</Form.Item>
|
||||
<NameserversModalInput
|
||||
value={fieldNameservers}
|
||||
trigger={
|
||||
<Button disabled={disabled}>
|
||||
<FormOutlinedIcon />
|
||||
</Button>
|
||||
}
|
||||
onChange={(value) => {
|
||||
formInst.setFieldValue("nameservers", value);
|
||||
}}
|
||||
/>
|
||||
</Space.Compact>
|
||||
<MultipleSplitValueInput
|
||||
modalTitle={t("workflow_node.apply.form.nameservers.multiple_input_modal.title")}
|
||||
placeholder={t("workflow_node.apply.form.nameservers.placeholder")}
|
||||
placeholderInModal={t("workflow_node.apply.form.nameservers.multiple_input_modal.placeholder")}
|
||||
splitOptions={{ trim: true, removeEmpty: true }}
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
@ -678,84 +642,4 @@ const EmailInput = memo(
|
||||
}
|
||||
);
|
||||
|
||||
const DomainsModalInput = memo(({ value, trigger, onChange }: { value?: string; trigger?: React.ReactNode; onChange?: (value: string) => void }) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const formSchema = z.object({
|
||||
domains: z.array(z.string()).refine((v) => {
|
||||
return v.every((e) => !e?.trim() || validDomainName(e.trim(), { allowWildcard: true }));
|
||||
}, t("common.errmsg.domain_invalid")),
|
||||
});
|
||||
const formRule = createSchemaFieldRule(formSchema);
|
||||
const { form: formInst, formProps } = useAntdForm({
|
||||
name: "workflowNodeApplyConfigFormDomainsModalInput",
|
||||
initialValues: { domains: value?.split(MULTIPLE_INPUT_DELIMITER) },
|
||||
onSubmit: (values) => {
|
||||
onChange?.(
|
||||
values.domains
|
||||
.map((e) => e.trim())
|
||||
.filter((e) => !!e)
|
||||
.join(MULTIPLE_INPUT_DELIMITER)
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
return (
|
||||
<ModalForm
|
||||
{...formProps}
|
||||
layout="vertical"
|
||||
form={formInst}
|
||||
modalProps={{ destroyOnHidden: true }}
|
||||
title={t("workflow_node.apply.form.domains.multiple_input_modal.title")}
|
||||
trigger={trigger}
|
||||
validateTrigger="onSubmit"
|
||||
width={480}
|
||||
>
|
||||
<Form.Item name="domains" rules={[formRule]}>
|
||||
<MultipleInput placeholder={t("workflow_node.apply.form.domains.multiple_input_modal.placeholder")} />
|
||||
</Form.Item>
|
||||
</ModalForm>
|
||||
);
|
||||
});
|
||||
|
||||
const NameserversModalInput = memo(({ trigger, value, onChange }: { trigger?: React.ReactNode; value?: string; onChange?: (value: string) => void }) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const formSchema = z.object({
|
||||
nameservers: z.array(z.string()).refine((v) => {
|
||||
return v.every((e) => !e?.trim() || validIPv4Address(e) || validIPv6Address(e) || validDomainName(e));
|
||||
}, t("common.errmsg.domain_invalid")),
|
||||
});
|
||||
const formRule = createSchemaFieldRule(formSchema);
|
||||
const { form: formInst, formProps } = useAntdForm({
|
||||
name: "workflowNodeApplyConfigFormNameserversModalInput",
|
||||
initialValues: { nameservers: value?.split(MULTIPLE_INPUT_DELIMITER) },
|
||||
onSubmit: (values) => {
|
||||
onChange?.(
|
||||
values.nameservers
|
||||
.map((e) => e.trim())
|
||||
.filter((e) => !!e)
|
||||
.join(MULTIPLE_INPUT_DELIMITER)
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
return (
|
||||
<ModalForm
|
||||
{...formProps}
|
||||
layout="vertical"
|
||||
form={formInst}
|
||||
modalProps={{ destroyOnHidden: true }}
|
||||
title={t("workflow_node.apply.form.nameservers.multiple_input_modal.title")}
|
||||
trigger={trigger}
|
||||
validateTrigger="onSubmit"
|
||||
width={480}
|
||||
>
|
||||
<Form.Item name="nameservers" rules={[formRule]}>
|
||||
<MultipleInput placeholder={t("workflow_node.apply.form.nameservers.multiple_input_modal.placeholder")} />
|
||||
</Form.Item>
|
||||
</ModalForm>
|
||||
);
|
||||
});
|
||||
|
||||
export default memo(ApplyNodeConfigForm);
|
||||
|
@ -1,13 +1,9 @@
|
||||
import { memo } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { FormOutlined as FormOutlinedIcon } from "@ant-design/icons";
|
||||
import { Alert, Button, Form, type FormInstance, Input, Space } from "antd";
|
||||
import { Alert, Form, type FormInstance, Input } from "antd";
|
||||
import { createSchemaFieldRule } from "antd-zod";
|
||||
import { z } from "zod";
|
||||
|
||||
import ModalForm from "@/components/ModalForm";
|
||||
import MultipleInput from "@/components/MultipleInput";
|
||||
import { useAntdForm } from "@/hooks";
|
||||
import MultipleSplitValueInput from "@/components/MultipleSplitValueInput";
|
||||
|
||||
type DeployNodeConfigFormAliyunCASDeployConfigFieldValues = Nullish<{
|
||||
region: string;
|
||||
@ -61,9 +57,6 @@ const DeployNodeConfigFormAliyunCASDeployConfig = ({
|
||||
});
|
||||
const formRule = createSchemaFieldRule(formSchema);
|
||||
|
||||
const fieldResourceIds = Form.useWatch<string>("resourceIds", formInst);
|
||||
const fieldContactIds = Form.useWatch<string>("contactIds", formInst);
|
||||
|
||||
const handleFormChange = (_: unknown, values: z.infer<typeof formSchema>) => {
|
||||
onValuesChange?.(values);
|
||||
};
|
||||
@ -87,69 +80,31 @@ const DeployNodeConfigFormAliyunCASDeployConfig = ({
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
name="resourceIds"
|
||||
label={t("workflow_node.deploy.form.aliyun_cas_deploy_resource_ids.label")}
|
||||
rules={[formRule]}
|
||||
tooltip={<span dangerouslySetInnerHTML={{ __html: t("workflow_node.deploy.form.aliyun_cas_deploy_resource_ids.tooltip") }}></span>}
|
||||
>
|
||||
<Space.Compact style={{ width: "100%" }}>
|
||||
<Form.Item name="resourceIds" noStyle rules={[formRule]}>
|
||||
<Input
|
||||
allowClear
|
||||
disabled={disabled}
|
||||
value={fieldResourceIds}
|
||||
placeholder={t("workflow_node.deploy.form.aliyun_cas_deploy_resource_ids.placeholder")}
|
||||
onChange={(e) => {
|
||||
formInst.setFieldValue("resourceIds", e.target.value);
|
||||
}}
|
||||
onClear={() => {
|
||||
formInst.setFieldValue("resourceIds", "");
|
||||
}}
|
||||
/>
|
||||
</Form.Item>
|
||||
<ResourceIdsModalInput
|
||||
value={fieldResourceIds}
|
||||
trigger={
|
||||
<Button disabled={disabled}>
|
||||
<FormOutlinedIcon />
|
||||
</Button>
|
||||
}
|
||||
onChange={(value) => {
|
||||
formInst.setFieldValue("resourceIds", value);
|
||||
}}
|
||||
/>
|
||||
</Space.Compact>
|
||||
<MultipleSplitValueInput
|
||||
modalTitle={t("workflow_node.deploy.form.aliyun_cas_deploy_resource_ids.multiple_input_modal.title")}
|
||||
placeholder={t("workflow_node.deploy.form.aliyun_cas_deploy_resource_ids.placeholder")}
|
||||
placeholderInModal={t("workflow_node.deploy.form.aliyun_cas_deploy_resource_ids.multiple_input_modal.placeholder")}
|
||||
splitOptions={{ trim: true, removeEmpty: true }}
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
name="contactIds"
|
||||
label={t("workflow_node.deploy.form.aliyun_cas_deploy_contact_ids.label")}
|
||||
rules={[formRule]}
|
||||
tooltip={<span dangerouslySetInnerHTML={{ __html: t("workflow_node.deploy.form.aliyun_cas_deploy_contact_ids.tooltip") }}></span>}
|
||||
>
|
||||
<Space.Compact style={{ width: "100%" }}>
|
||||
<Form.Item name="contactIds" noStyle rules={[formRule]}>
|
||||
<Input
|
||||
allowClear
|
||||
disabled={disabled}
|
||||
value={fieldContactIds}
|
||||
placeholder={t("workflow_node.deploy.form.aliyun_cas_deploy_contact_ids.placeholder")}
|
||||
onChange={(e) => {
|
||||
formInst.setFieldValue("contactIds", e.target.value);
|
||||
}}
|
||||
onClear={() => {
|
||||
formInst.setFieldValue("contactIds", "");
|
||||
}}
|
||||
/>
|
||||
</Form.Item>
|
||||
<ContactIdsModalInput
|
||||
value={fieldContactIds}
|
||||
trigger={
|
||||
<Button disabled={disabled}>
|
||||
<FormOutlinedIcon />
|
||||
</Button>
|
||||
}
|
||||
onChange={(value) => {
|
||||
formInst.setFieldValue("contactIds", value);
|
||||
}}
|
||||
/>
|
||||
</Space.Compact>
|
||||
<MultipleSplitValueInput
|
||||
modalTitle={t("workflow_node.deploy.form.aliyun_cas_deploy_contact_ids.multiple_input_modal.title")}
|
||||
placeholder={t("workflow_node.deploy.form.aliyun_cas_deploy_contact_ids.placeholder")}
|
||||
placeholderInModal={t("workflow_node.deploy.form.aliyun_cas_deploy_contact_ids.multiple_input_modal.placeholder")}
|
||||
splitOptions={{ trim: true, removeEmpty: true }}
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item>
|
||||
@ -159,84 +114,4 @@ const DeployNodeConfigFormAliyunCASDeployConfig = ({
|
||||
);
|
||||
};
|
||||
|
||||
const ResourceIdsModalInput = memo(({ value, trigger, onChange }: { value?: string; trigger?: React.ReactNode; onChange?: (value: string) => void }) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const formSchema = z.object({
|
||||
resourceIds: z.array(z.string()).refine((v) => {
|
||||
return v.every((e) => !e?.trim() || /^[1-9]\d*$/.test(e));
|
||||
}, t("workflow_node.deploy.form.aliyun_cas_deploy_resource_ids.errmsg.invalid")),
|
||||
});
|
||||
const formRule = createSchemaFieldRule(formSchema);
|
||||
const { form: formInst, formProps } = useAntdForm({
|
||||
name: "workflowNodeDeployConfigFormAliyunCASResourceIdsModalInput",
|
||||
initialValues: { resourceIds: value?.split(MULTIPLE_INPUT_DELIMITER) },
|
||||
onSubmit: (values) => {
|
||||
onChange?.(
|
||||
values.resourceIds
|
||||
.map((e) => e.trim())
|
||||
.filter((e) => !!e)
|
||||
.join(MULTIPLE_INPUT_DELIMITER)
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
return (
|
||||
<ModalForm
|
||||
{...formProps}
|
||||
layout="vertical"
|
||||
form={formInst}
|
||||
modalProps={{ destroyOnHidden: true }}
|
||||
title={t("workflow_node.deploy.form.aliyun_cas_deploy_resource_ids.multiple_input_modal.title")}
|
||||
trigger={trigger}
|
||||
validateTrigger="onSubmit"
|
||||
width={480}
|
||||
>
|
||||
<Form.Item name="resourceIds" rules={[formRule]}>
|
||||
<MultipleInput placeholder={t("workflow_node.deploy.form.aliyun_cas_deploy_resource_ids.multiple_input_modal.placeholder")} />
|
||||
</Form.Item>
|
||||
</ModalForm>
|
||||
);
|
||||
});
|
||||
|
||||
const ContactIdsModalInput = memo(({ value, trigger, onChange }: { value?: string; trigger?: React.ReactNode; onChange?: (value: string) => void }) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const formSchema = z.object({
|
||||
contactIds: z.array(z.string()).refine((v) => {
|
||||
return v.every((e) => !e?.trim() || /^[1-9]\d*$/.test(e));
|
||||
}, t("workflow_node.deploy.form.aliyun_cas_deploy_contact_ids.errmsg.invalid")),
|
||||
});
|
||||
const formRule = createSchemaFieldRule(formSchema);
|
||||
const { form: formInst, formProps } = useAntdForm({
|
||||
name: "workflowNodeDeployConfigFormAliyunCASDeploymentJobContactIdsModalInput",
|
||||
initialValues: { contactIds: value?.split(MULTIPLE_INPUT_DELIMITER) },
|
||||
onSubmit: (values) => {
|
||||
onChange?.(
|
||||
values.contactIds
|
||||
.map((e) => e.trim())
|
||||
.filter((e) => !!e)
|
||||
.join(MULTIPLE_INPUT_DELIMITER)
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
return (
|
||||
<ModalForm
|
||||
{...formProps}
|
||||
layout="vertical"
|
||||
form={formInst}
|
||||
modalProps={{ destroyOnHidden: true }}
|
||||
title={t("workflow_node.deploy.form.aliyun_cas_deploy_contact_ids.multiple_input_modal.title")}
|
||||
trigger={trigger}
|
||||
validateTrigger="onSubmit"
|
||||
width={480}
|
||||
>
|
||||
<Form.Item name="contactIds" rules={[formRule]}>
|
||||
<MultipleInput placeholder={t("workflow_node.deploy.form.aliyun_cas_deploy_contact_ids.multiple_input_modal.placeholder")} />
|
||||
</Form.Item>
|
||||
</ModalForm>
|
||||
);
|
||||
});
|
||||
|
||||
export default DeployNodeConfigFormAliyunCASDeployConfig;
|
||||
|
@ -1,14 +1,10 @@
|
||||
import { memo } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { FormOutlined as FormOutlinedIcon } from "@ant-design/icons";
|
||||
import { Button, Form, type FormInstance, Input, Select, Space } from "antd";
|
||||
import { Form, type FormInstance, Input, Select } from "antd";
|
||||
import { createSchemaFieldRule } from "antd-zod";
|
||||
import { z } from "zod";
|
||||
|
||||
import ModalForm from "@/components/ModalForm";
|
||||
import MultipleInput from "@/components/MultipleInput";
|
||||
import MultipleSplitValueInput from "@/components/MultipleSplitValueInput";
|
||||
import Show from "@/components/Show";
|
||||
import { useAntdForm } from "@/hooks";
|
||||
|
||||
type DeployNodeConfigFormBaotaPanelSiteConfigFieldValues = Nullish<{
|
||||
siteType: string;
|
||||
@ -71,7 +67,6 @@ const DeployNodeConfigFormBaotaPanelSiteConfig = ({
|
||||
const formRule = createSchemaFieldRule(formSchema);
|
||||
|
||||
const fieldSiteType = Form.useWatch<string>("siteType", formInst);
|
||||
const fieldSiteNames = Form.useWatch<string>("siteNames", formInst);
|
||||
|
||||
const handleFormChange = (_: unknown, values: z.infer<typeof formSchema>) => {
|
||||
onValuesChange?.(values);
|
||||
@ -110,80 +105,21 @@ const DeployNodeConfigFormBaotaPanelSiteConfig = ({
|
||||
|
||||
<Show when={fieldSiteType === SITE_TYPE_OTHER}>
|
||||
<Form.Item
|
||||
name="siteNames"
|
||||
label={t("workflow_node.deploy.form.baotapanel_site_names.label")}
|
||||
rules={[formRule]}
|
||||
tooltip={<span dangerouslySetInnerHTML={{ __html: t("workflow_node.deploy.form.baotapanel_site_names.tooltip") }}></span>}
|
||||
>
|
||||
<Space.Compact style={{ width: "100%" }}>
|
||||
<Form.Item name="siteNames" noStyle rules={[formRule]}>
|
||||
<Input
|
||||
allowClear
|
||||
disabled={disabled}
|
||||
value={fieldSiteNames}
|
||||
placeholder={t("workflow_node.deploy.form.baotapanel_site_names.placeholder")}
|
||||
onChange={(e) => {
|
||||
formInst.setFieldValue("siteNames", e.target.value);
|
||||
}}
|
||||
onClear={() => {
|
||||
formInst.setFieldValue("siteNames", "");
|
||||
}}
|
||||
/>
|
||||
</Form.Item>
|
||||
<SiteNamesModalInput
|
||||
value={fieldSiteNames}
|
||||
trigger={
|
||||
<Button disabled={disabled}>
|
||||
<FormOutlinedIcon />
|
||||
</Button>
|
||||
}
|
||||
onChange={(value) => {
|
||||
formInst.setFieldValue("siteNames", value);
|
||||
}}
|
||||
/>
|
||||
</Space.Compact>
|
||||
<MultipleSplitValueInput
|
||||
modalTitle={t("workflow_node.deploy.form.baotapanel_site_names.multiple_input_modal.title")}
|
||||
placeholder={t("workflow_node.deploy.form.baotapanel_site_names.placeholder")}
|
||||
placeholderInModal={t("workflow_node.deploy.form.baotapanel_site_names.multiple_input_modal.placeholder")}
|
||||
splitOptions={{ trim: true, removeEmpty: true }}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Show>
|
||||
</Form>
|
||||
);
|
||||
};
|
||||
|
||||
const SiteNamesModalInput = memo(({ value, trigger, onChange }: { value?: string; trigger?: React.ReactNode; onChange?: (value: string) => void }) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const formSchema = z.object({
|
||||
siteNames: z.array(z.string()).refine((v) => {
|
||||
return v.every((e) => !!e?.trim());
|
||||
}, t("workflow_node.deploy.form.baotapanel_site_names.errmsg.invalid")),
|
||||
});
|
||||
const formRule = createSchemaFieldRule(formSchema);
|
||||
const { form: formInst, formProps } = useAntdForm({
|
||||
name: "workflowNodeDeployConfigFormBaotaPanelSiteNamesModalInput",
|
||||
initialValues: { siteNames: value?.split(MULTIPLE_INPUT_DELIMITER) },
|
||||
onSubmit: (values) => {
|
||||
onChange?.(
|
||||
values.siteNames
|
||||
.map((e) => e.trim())
|
||||
.filter((e) => !!e)
|
||||
.join(MULTIPLE_INPUT_DELIMITER)
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
return (
|
||||
<ModalForm
|
||||
{...formProps}
|
||||
layout="vertical"
|
||||
form={formInst}
|
||||
modalProps={{ destroyOnHidden: true }}
|
||||
title={t("workflow_node.deploy.form.baotapanel_site_names.multiple_input_modal.title")}
|
||||
trigger={trigger}
|
||||
validateTrigger="onSubmit"
|
||||
width={480}
|
||||
>
|
||||
<Form.Item name="siteNames" rules={[formRule]}>
|
||||
<MultipleInput placeholder={t("workflow_node.deploy.form.baotapanel_site_names.multiple_input_modal.placeholder")} />
|
||||
</Form.Item>
|
||||
</ModalForm>
|
||||
);
|
||||
});
|
||||
|
||||
export default DeployNodeConfigFormBaotaPanelSiteConfig;
|
||||
|
@ -1,13 +1,9 @@
|
||||
import { memo } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { FormOutlined as FormOutlinedIcon } from "@ant-design/icons";
|
||||
import { Alert, AutoComplete, Button, Form, type FormInstance, Input, Space } from "antd";
|
||||
import { Alert, AutoComplete, Form, type FormInstance, Input } from "antd";
|
||||
import { createSchemaFieldRule } from "antd-zod";
|
||||
import { z } from "zod";
|
||||
|
||||
import ModalForm from "@/components/ModalForm";
|
||||
import MultipleInput from "@/components/MultipleInput";
|
||||
import { useAntdForm } from "@/hooks";
|
||||
import MultipleSplitValueInput from "@/components/MultipleSplitValueInput";
|
||||
|
||||
type DeployNodeConfigFormTencentCloudSSLDeployConfigFieldValues = Nullish<{
|
||||
region: string;
|
||||
@ -56,8 +52,6 @@ const DeployNodeConfigFormTencentCloudSSLDeployConfig = ({
|
||||
});
|
||||
const formRule = createSchemaFieldRule(formSchema);
|
||||
|
||||
const fieldResourceIds = Form.useWatch<string>("resourceIds", formInst);
|
||||
|
||||
const handleFormChange = (_: unknown, values: z.infer<typeof formSchema>) => {
|
||||
onValuesChange?.(values);
|
||||
};
|
||||
@ -94,36 +88,17 @@ const DeployNodeConfigFormTencentCloudSSLDeployConfig = ({
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
name="resourceIds"
|
||||
label={t("workflow_node.deploy.form.tencentcloud_ssl_deploy_resource_ids.label")}
|
||||
rules={[formRule]}
|
||||
tooltip={<span dangerouslySetInnerHTML={{ __html: t("workflow_node.deploy.form.tencentcloud_ssl_deploy_resource_ids.tooltip") }}></span>}
|
||||
>
|
||||
<Space.Compact style={{ width: "100%" }}>
|
||||
<Form.Item name="resourceIds" noStyle rules={[formRule]}>
|
||||
<Input
|
||||
allowClear
|
||||
disabled={disabled}
|
||||
value={fieldResourceIds}
|
||||
placeholder={t("workflow_node.deploy.form.tencentcloud_ssl_deploy_resource_ids.placeholder")}
|
||||
onChange={(e) => {
|
||||
formInst.setFieldValue("resourceIds", e.target.value);
|
||||
}}
|
||||
onClear={() => {
|
||||
formInst.setFieldValue("resourceIds", "");
|
||||
}}
|
||||
/>
|
||||
</Form.Item>
|
||||
<ResourceIdsModalInput
|
||||
value={fieldResourceIds}
|
||||
trigger={
|
||||
<Button disabled={disabled}>
|
||||
<FormOutlinedIcon />
|
||||
</Button>
|
||||
}
|
||||
onChange={(value) => {
|
||||
formInst.setFieldValue("resourceIds", value);
|
||||
}}
|
||||
/>
|
||||
</Space.Compact>
|
||||
<MultipleSplitValueInput
|
||||
modalTitle={t("workflow_node.deploy.form.tencentcloud_ssl_deploy_resource_ids.multiple_input_modal.title")}
|
||||
placeholder={t("workflow_node.deploy.form.tencentcloud_ssl_deploy_resource_ids.placeholder")}
|
||||
placeholderInModal={t("workflow_node.deploy.form.tencentcloud_ssl_deploy_resource_ids.multiple_input_modal.placeholder")}
|
||||
splitOptions={{ trim: true, removeEmpty: true }}
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item>
|
||||
@ -133,44 +108,4 @@ const DeployNodeConfigFormTencentCloudSSLDeployConfig = ({
|
||||
);
|
||||
};
|
||||
|
||||
const ResourceIdsModalInput = memo(({ value, trigger, onChange }: { value?: string; trigger?: React.ReactNode; onChange?: (value: string) => void }) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const formSchema = z.object({
|
||||
resourceIds: z.array(z.string()).refine((v) => {
|
||||
return v.every((e) => !e?.trim() || /^[A-Za-z0-9*._-|]+$/.test(e));
|
||||
}, t("workflow_node.deploy.form.tencentcloud_ssl_deploy_resource_ids.errmsg.invalid")),
|
||||
});
|
||||
const formRule = createSchemaFieldRule(formSchema);
|
||||
const { form: formInst, formProps } = useAntdForm({
|
||||
name: "workflowNodeDeployConfigFormTencentCloudSSLDeployResourceIdsModalInput",
|
||||
initialValues: { resourceIds: value?.split(MULTIPLE_INPUT_DELIMITER) },
|
||||
onSubmit: (values) => {
|
||||
onChange?.(
|
||||
values.resourceIds
|
||||
.map((e) => e.trim())
|
||||
.filter((e) => !!e)
|
||||
.join(MULTIPLE_INPUT_DELIMITER)
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
return (
|
||||
<ModalForm
|
||||
{...formProps}
|
||||
layout="vertical"
|
||||
form={formInst}
|
||||
modalProps={{ destroyOnHidden: true }}
|
||||
title={t("workflow_node.deploy.form.tencentcloud_ssl_deploy_resource_ids.multiple_input_modal.title")}
|
||||
trigger={trigger}
|
||||
validateTrigger="onSubmit"
|
||||
width={480}
|
||||
>
|
||||
<Form.Item name="resourceIds" rules={[formRule]}>
|
||||
<MultipleInput placeholder={t("workflow_node.deploy.form.tencentcloud_ssl_deploy_resource_ids.multiple_input_modal.placeholder")} />
|
||||
</Form.Item>
|
||||
</ModalForm>
|
||||
);
|
||||
});
|
||||
|
||||
export default DeployNodeConfigFormTencentCloudSSLDeployConfig;
|
||||
|
@ -1,13 +1,9 @@
|
||||
import { memo } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { FormOutlined as FormOutlinedIcon } from "@ant-design/icons";
|
||||
import { Button, Form, type FormInstance, Input, Space } from "antd";
|
||||
import { Form, type FormInstance } from "antd";
|
||||
import { createSchemaFieldRule } from "antd-zod";
|
||||
import { z } from "zod";
|
||||
|
||||
import ModalForm from "@/components/ModalForm";
|
||||
import MultipleInput from "@/components/MultipleInput";
|
||||
import { useAntdForm } from "@/hooks";
|
||||
import MultipleSplitValueInput from "@/components/MultipleSplitValueInput";
|
||||
import { validDomainName } from "@/utils/validators";
|
||||
|
||||
type DeployNodeConfigFormWangsuCDNConfigFieldValues = Nullish<{
|
||||
@ -52,8 +48,6 @@ const DeployNodeConfigFormWangsuCDNConfig = ({
|
||||
});
|
||||
const formRule = createSchemaFieldRule(formSchema);
|
||||
|
||||
const fieldDomains = Form.useWatch<string>("domains", formInst);
|
||||
|
||||
const handleFormChange = (_: unknown, values: z.infer<typeof formSchema>) => {
|
||||
onValuesChange?.(values);
|
||||
};
|
||||
@ -68,79 +62,20 @@ const DeployNodeConfigFormWangsuCDNConfig = ({
|
||||
onValuesChange={handleFormChange}
|
||||
>
|
||||
<Form.Item
|
||||
name="domains"
|
||||
label={t("workflow_node.deploy.form.wangsu_cdn_domains.label")}
|
||||
rules={[formRule]}
|
||||
tooltip={<span dangerouslySetInnerHTML={{ __html: t("workflow_node.deploy.form.wangsu_cdn_domains.tooltip") }}></span>}
|
||||
>
|
||||
<Space.Compact style={{ width: "100%" }}>
|
||||
<Form.Item name="domains" noStyle rules={[formRule]}>
|
||||
<Input
|
||||
allowClear
|
||||
disabled={disabled}
|
||||
value={fieldDomains}
|
||||
placeholder={t("workflow_node.deploy.form.wangsu_cdn_domains.placeholder")}
|
||||
onChange={(e) => {
|
||||
formInst.setFieldValue("domains", e.target.value);
|
||||
}}
|
||||
onClear={() => {
|
||||
formInst.setFieldValue("domains", "");
|
||||
}}
|
||||
/>
|
||||
</Form.Item>
|
||||
<SiteNamesModalInput
|
||||
value={fieldDomains}
|
||||
trigger={
|
||||
<Button disabled={disabled}>
|
||||
<FormOutlinedIcon />
|
||||
</Button>
|
||||
}
|
||||
onChange={(value) => {
|
||||
formInst.setFieldValue("domains", value);
|
||||
}}
|
||||
/>
|
||||
</Space.Compact>
|
||||
<MultipleSplitValueInput
|
||||
modalTitle={t("workflow_node.deploy.form.wangsu_cdn_domains.multiple_input_modal.title")}
|
||||
placeholder={t("workflow_node.deploy.form.wangsu_cdn_domains.placeholder")}
|
||||
placeholderInModal={t("workflow_node.deploy.form.wangsu_cdn_domains.multiple_input_modal.placeholder")}
|
||||
splitOptions={{ trim: true, removeEmpty: true }}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
);
|
||||
};
|
||||
|
||||
const SiteNamesModalInput = memo(({ value, trigger, onChange }: { value?: string; trigger?: React.ReactNode; onChange?: (value: string) => void }) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const formSchema = z.object({
|
||||
domains: z.array(z.string()).refine((v) => {
|
||||
return v.every((e) => validDomainName(e));
|
||||
}, t("workflow_node.deploy.form.wangsu_cdn_domains.errmsg.invalid")),
|
||||
});
|
||||
const formRule = createSchemaFieldRule(formSchema);
|
||||
const { form: formInst, formProps } = useAntdForm({
|
||||
name: "workflowNodeDeployConfigFormWangsuCDNNamesModalInput",
|
||||
initialValues: { domains: value?.split(MULTIPLE_INPUT_DELIMITER) },
|
||||
onSubmit: (values) => {
|
||||
onChange?.(
|
||||
values.domains
|
||||
.map((e) => e.trim())
|
||||
.filter((e) => !!e)
|
||||
.join(MULTIPLE_INPUT_DELIMITER)
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
return (
|
||||
<ModalForm
|
||||
{...formProps}
|
||||
layout="vertical"
|
||||
form={formInst}
|
||||
modalProps={{ destroyOnHidden: true }}
|
||||
title={t("workflow_node.deploy.form.wangsu_cdn_domains.multiple_input_modal.title")}
|
||||
trigger={trigger}
|
||||
validateTrigger="onSubmit"
|
||||
width={480}
|
||||
>
|
||||
<Form.Item name="domains" rules={[formRule]}>
|
||||
<MultipleInput placeholder={t("workflow_node.deploy.form.wangsu_cdn_domains.multiple_input_modal.placeholder")} />
|
||||
</Form.Item>
|
||||
</ModalForm>
|
||||
);
|
||||
});
|
||||
|
||||
export default DeployNodeConfigFormWangsuCDNConfig;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { memo, useRef } from "react";
|
||||
import { memo, useMemo, useRef } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import {
|
||||
CloseCircleOutlined as CloseCircleOutlinedIcon,
|
||||
@ -7,7 +7,7 @@ import {
|
||||
MoreOutlined as MoreOutlinedIcon,
|
||||
} from "@ant-design/icons";
|
||||
import { useControllableValue } from "ahooks";
|
||||
import { Button, Card, Drawer, Dropdown, Input, type InputRef, Modal, Popover, Space } from "antd";
|
||||
import { Button, Card, Drawer, Dropdown, Input, type InputRef, type MenuProps, Modal, Popover, Space } from "antd";
|
||||
import { produce } from "immer";
|
||||
import { isEqual } from "radash";
|
||||
|
||||
@ -59,12 +59,13 @@ const SharedNodeTitle = ({ className, style, node, disabled }: SharedNodeTitlePr
|
||||
type SharedNodeMenuProps = SharedNodeProps & {
|
||||
branchId?: string;
|
||||
branchIndex?: number;
|
||||
menus?: Array<"rename" | "duplicate" | "remove">;
|
||||
trigger: React.ReactNode;
|
||||
afterUpdate?: () => void;
|
||||
afterDelete?: () => void;
|
||||
};
|
||||
|
||||
const isBranchingNode = (node: WorkflowNode) => {
|
||||
const isNodeBranchLike = (node: WorkflowNode) => {
|
||||
return (
|
||||
node.type === WorkflowNodeType.Branch ||
|
||||
node.type === WorkflowNodeType.Condition ||
|
||||
@ -74,7 +75,11 @@ const isBranchingNode = (node: WorkflowNode) => {
|
||||
);
|
||||
};
|
||||
|
||||
const SharedNodeMenu = ({ trigger, node, disabled, branchId, branchIndex, afterUpdate, afterDelete }: SharedNodeMenuProps) => {
|
||||
const isNodeReadOnly = (node: WorkflowNode) => {
|
||||
return node.type === WorkflowNodeType.Start || node.type === WorkflowNodeType.End;
|
||||
};
|
||||
|
||||
const SharedNodeMenu = ({ menus, trigger, node, disabled, branchId, branchIndex, afterUpdate, afterDelete }: SharedNodeMenuProps) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const { updateNode, removeNode, removeBranch } = useWorkflowStore(useZustandShallowSelector(["updateNode", "removeNode", "removeBranch"]));
|
||||
@ -101,7 +106,7 @@ const SharedNodeMenu = ({ trigger, node, disabled, branchId, branchIndex, afterU
|
||||
};
|
||||
|
||||
const handleDeleteClick = async () => {
|
||||
if (isBranchingNode(node)) {
|
||||
if (isNodeBranchLike(node)) {
|
||||
await removeBranch(branchId!, branchIndex!);
|
||||
} else {
|
||||
await removeNode(node.id);
|
||||
@ -110,56 +115,76 @@ const SharedNodeMenu = ({ trigger, node, disabled, branchId, branchIndex, afterU
|
||||
afterDelete?.();
|
||||
};
|
||||
|
||||
const menuItems = useMemo(() => {
|
||||
let temp = [
|
||||
{
|
||||
key: "rename",
|
||||
disabled: disabled,
|
||||
label: isNodeBranchLike(node) ? t("workflow_node.action.rename_branch") : t("workflow_node.action.rename_node"),
|
||||
icon: <FormOutlinedIcon />,
|
||||
onClick: () => {
|
||||
nameRef.current = node.name;
|
||||
|
||||
const dialog = modalApi.confirm({
|
||||
title: isNodeBranchLike(node) ? t("workflow_node.action.rename_branch") : t("workflow_node.action.rename_node"),
|
||||
content: (
|
||||
<div className="pb-2 pt-4">
|
||||
<Input
|
||||
ref={nameInputRef}
|
||||
autoFocus
|
||||
defaultValue={node.name}
|
||||
onChange={(e) => (nameRef.current = e.target.value)}
|
||||
onPressEnter={async () => {
|
||||
await handleRenameConfirm();
|
||||
dialog.destroy();
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
),
|
||||
icon: null,
|
||||
okText: t("common.button.save"),
|
||||
onOk: handleRenameConfirm,
|
||||
});
|
||||
setTimeout(() => nameInputRef.current?.focus(), 1);
|
||||
},
|
||||
},
|
||||
{
|
||||
type: "divider",
|
||||
},
|
||||
{
|
||||
key: "remove",
|
||||
disabled: disabled || isNodeReadOnly(node),
|
||||
label: isNodeBranchLike(node) ? t("workflow_node.action.remove_branch") : t("workflow_node.action.remove_node"),
|
||||
icon: <CloseCircleOutlinedIcon />,
|
||||
danger: true,
|
||||
onClick: handleDeleteClick,
|
||||
},
|
||||
] satisfies MenuProps["items"];
|
||||
|
||||
if (menus) {
|
||||
temp = temp.filter((item) => item.type === "divider" || menus.includes(item.key as "rename" | "remove"));
|
||||
temp = temp.filter((item, index, array) => {
|
||||
if (item.type !== "divider") return true;
|
||||
return index === 0 || array[index - 1].type !== "divider";
|
||||
});
|
||||
if (temp[0]?.type === "divider") {
|
||||
temp.shift();
|
||||
}
|
||||
if (temp[temp.length - 1]?.type === "divider") {
|
||||
temp.pop();
|
||||
}
|
||||
}
|
||||
|
||||
return temp;
|
||||
}, [disabled, node]);
|
||||
|
||||
return (
|
||||
<>
|
||||
{ModelContextHolder}
|
||||
|
||||
<Dropdown
|
||||
menu={{
|
||||
items: [
|
||||
{
|
||||
key: "rename",
|
||||
disabled: disabled,
|
||||
label: isBranchingNode(node) ? t("workflow_node.action.rename_branch") : t("workflow_node.action.rename_node"),
|
||||
icon: <FormOutlinedIcon />,
|
||||
onClick: () => {
|
||||
nameRef.current = node.name;
|
||||
|
||||
const dialog = modalApi.confirm({
|
||||
title: isBranchingNode(node) ? t("workflow_node.action.rename_branch") : t("workflow_node.action.rename_node"),
|
||||
content: (
|
||||
<div className="pb-2 pt-4">
|
||||
<Input
|
||||
ref={nameInputRef}
|
||||
autoFocus
|
||||
defaultValue={node.name}
|
||||
onChange={(e) => (nameRef.current = e.target.value)}
|
||||
onPressEnter={async () => {
|
||||
await handleRenameConfirm();
|
||||
dialog.destroy();
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
),
|
||||
icon: null,
|
||||
okText: t("common.button.save"),
|
||||
onOk: handleRenameConfirm,
|
||||
});
|
||||
setTimeout(() => nameInputRef.current?.focus(), 1);
|
||||
},
|
||||
},
|
||||
{
|
||||
type: "divider",
|
||||
},
|
||||
{
|
||||
key: "remove",
|
||||
disabled: disabled || node.type === WorkflowNodeType.Start,
|
||||
label: isBranchingNode(node) ? t("workflow_node.action.remove_branch") : t("workflow_node.action.remove_node"),
|
||||
icon: <CloseCircleOutlinedIcon />,
|
||||
danger: true,
|
||||
onClick: handleDeleteClick,
|
||||
},
|
||||
],
|
||||
items: menuItems,
|
||||
}}
|
||||
trigger={["click"]}
|
||||
>
|
||||
@ -264,7 +289,6 @@ const SharedNodeConfigDrawer = ({
|
||||
|
||||
const { promise, resolve, reject } = Promise.withResolvers();
|
||||
if (changed) {
|
||||
console.log(oldValues, newValues);
|
||||
modalApi.confirm({
|
||||
title: t("common.text.operation_confirm"),
|
||||
content: t("workflow_node.unsaved_changes.confirm"),
|
||||
@ -288,6 +312,7 @@ const SharedNodeConfigDrawer = ({
|
||||
destroyOnHidden
|
||||
extra={
|
||||
<SharedNodeMenu
|
||||
menus={["rename", "remove"]}
|
||||
node={node}
|
||||
disabled={disabled}
|
||||
trigger={<Button icon={<EllipsisOutlinedIcon />} type="text" />}
|
||||
|
@ -73,7 +73,7 @@ export interface AccessModel extends BaseModel {
|
||||
|
||||
// #region AccessConfig
|
||||
export type AccessConfigFor1Panel = {
|
||||
apiUrl: string;
|
||||
serverUrl: string;
|
||||
apiVersion: string;
|
||||
apiKey: string;
|
||||
allowInsecureConnections?: boolean;
|
||||
@ -119,13 +119,13 @@ export type AccessConfigForBaishan = {
|
||||
};
|
||||
|
||||
export type AccessConfigForBaotaPanel = {
|
||||
apiUrl: string;
|
||||
serverUrl: string;
|
||||
apiKey: string;
|
||||
allowInsecureConnections?: boolean;
|
||||
};
|
||||
|
||||
export type AccessConfigForBaotaWAF = {
|
||||
apiUrl: string;
|
||||
serverUrl: string;
|
||||
apiKey: string;
|
||||
allowInsecureConnections?: boolean;
|
||||
};
|
||||
@ -144,7 +144,7 @@ export type AccessConfigForCacheFly = {
|
||||
};
|
||||
|
||||
export type AccessConfigForCdnfly = {
|
||||
apiUrl: string;
|
||||
serverUrl: string;
|
||||
apiKey: string;
|
||||
apiSecret: string;
|
||||
allowInsecureConnections?: boolean;
|
||||
@ -204,7 +204,7 @@ export type AccessConfigForEmail = {
|
||||
};
|
||||
|
||||
export type AccessConfigForFlexCDN = {
|
||||
apiUrl: string;
|
||||
serverUrl: string;
|
||||
apiRole: string;
|
||||
accessKeyId: string;
|
||||
accessKey: string;
|
||||
@ -226,7 +226,7 @@ export type AccessConfigForGoDaddy = {
|
||||
};
|
||||
|
||||
export type AccessConfigForGoEdge = {
|
||||
apiUrl: string;
|
||||
serverUrl: string;
|
||||
apiRole: string;
|
||||
accessKeyId: string;
|
||||
accessKey: string;
|
||||
@ -257,7 +257,7 @@ export type AccessConfigForLarkBot = {
|
||||
};
|
||||
|
||||
export type AccessConfigForLeCDN = {
|
||||
apiUrl: string;
|
||||
serverUrl: string;
|
||||
apiVersion: string;
|
||||
apiRole: string;
|
||||
username: string;
|
||||
@ -306,13 +306,13 @@ export type AccessConfigForPorkbun = {
|
||||
};
|
||||
|
||||
export type AccessConfigForPowerDNS = {
|
||||
apiUrl: string;
|
||||
serverUrl: string;
|
||||
apiKey: string;
|
||||
allowInsecureConnections?: boolean;
|
||||
};
|
||||
|
||||
export type AccessConfigForProxmoxVE = {
|
||||
apiUrl: string;
|
||||
serverUrl: string;
|
||||
apiToken: string;
|
||||
apiTokenSecret?: string;
|
||||
allowInsecureConnections?: boolean;
|
||||
@ -328,14 +328,14 @@ export type AccessConfigForRainYun = {
|
||||
};
|
||||
|
||||
export type AccessConfigForRatPanel = {
|
||||
apiUrl: string;
|
||||
serverUrl: string;
|
||||
accessTokenId: number;
|
||||
accessToken: string;
|
||||
allowInsecureConnections?: boolean;
|
||||
};
|
||||
|
||||
export type AccessConfigForSafeLine = {
|
||||
apiUrl: string;
|
||||
serverUrl: string;
|
||||
apiToken: string;
|
||||
allowInsecureConnections?: boolean;
|
||||
};
|
||||
|
@ -34,16 +34,16 @@
|
||||
"access.form.certificate_authority.placeholder": "Please select a certificate authority",
|
||||
"access.form.notification_channel.label": "Notification channel",
|
||||
"access.form.notification_channel.placeholder": "Please select a notification channel",
|
||||
"access.form.1panel_api_url.label": "1Panel URL",
|
||||
"access.form.1panel_api_url.placeholder": "Please enter 1Panel URL",
|
||||
"access.form.1panel_server_url.label": "1Panel server URL",
|
||||
"access.form.1panel_server_url.placeholder": "Please enter 1Panel server URL",
|
||||
"access.form.1panel_api_version.label": "1Panel version",
|
||||
"access.form.1panel_api_version.placeholder": "Please select 1Panel version",
|
||||
"access.form.1panel_api_key.label": "1Panel API key",
|
||||
"access.form.1panel_api_key.placeholder": "Please enter 1Panel API key",
|
||||
"access.form.1panel_api_key.tooltip": "For more information, see <a href=\"https://docs.1panel.pro/dev_manual/api_manual/\" target=\"_blank\">https://docs.1panel.pro/dev_manual/api_manual/</a>",
|
||||
"access.form.1panel_allow_insecure_conns.label": "Insecure SSL/TLS connections",
|
||||
"access.form.1panel_allow_insecure_conns.switch.on": "Allow",
|
||||
"access.form.1panel_allow_insecure_conns.switch.off": "Disallow",
|
||||
"access.form.common_allow_insecure_conns.label": "Insecure SSL/TLS connections",
|
||||
"access.form.common_allow_insecure_conns.switch.on": "Allow",
|
||||
"access.form.common_allow_insecure_conns.switch.off": "Disallow",
|
||||
"access.form.acmeca_endpoint.label": "Endpoint",
|
||||
"access.form.acmeca_endpoint.placeholder": "Please enter endpoint",
|
||||
"access.form.acmeca_endpoint.tooltip": "For more information, see <a href=\"https://datatracker.ietf.org/doc/html/rfc8555#section-7.1.1\" target=\"_blank\">https://datatracker.ietf.org/doc/html/rfc8555#section-7.1.1</a>",
|
||||
@ -104,22 +104,16 @@
|
||||
"access.form.upyun_password.tooltip": "For more information, see <a href=\"https://console.upyun.com/account/subaccount/\" target=\"_blank\">https://console.upyun.com/account/subaccount/</a>",
|
||||
"access.form.baishan_api_token.label": "Baishan Cloud API token",
|
||||
"access.form.baishan_api_token.placeholder": "Please enter Baishan Cloud API token",
|
||||
"access.form.baotapanel_api_url.label": "aaPanel URL",
|
||||
"access.form.baotapanel_api_url.placeholder": "Please enter aaPanel URL",
|
||||
"access.form.baotapanel_server_url.label": "aaPanel server URL",
|
||||
"access.form.baotapanel_server_url.placeholder": "Please enter aaPanel server URL",
|
||||
"access.form.baotapanel_api_key.label": "aaPanel API key",
|
||||
"access.form.baotapanel_api_key.placeholder": "Please enter aaPanel API key",
|
||||
"access.form.baotapanel_api_key.tooltip": "For more information, see <a href=\"https://www.bt.cn/bbs/thread-20376-1-1.html\" target=\"_blank\">https://www.bt.cn/bbs/thread-20376-1-1.html</a>",
|
||||
"access.form.baotapanel_allow_insecure_conns.label": "Insecure SSL/TLS connections",
|
||||
"access.form.baotapanel_allow_insecure_conns.switch.on": "Allow",
|
||||
"access.form.baotapanel_allow_insecure_conns.switch.off": "Disallow",
|
||||
"access.form.baotawaf_api_url.label": "aaWAF URL",
|
||||
"access.form.baotawaf_api_url.placeholder": "Please enter aaWAF URL",
|
||||
"access.form.baotawaf_server_url.label": "aaWAF server URL",
|
||||
"access.form.baotawaf_server_url.placeholder": "Please enter aaWAF server URL",
|
||||
"access.form.baotawaf_api_key.label": "aaWAF API key",
|
||||
"access.form.baotawaf_api_key.placeholder": "Please enter aaWAF API key",
|
||||
"access.form.baotawaf_api_key.tooltip": "For more information, see <a href=\"https://github.com/aaPanel/aaWAF/blob/main/API.md\" target=\"_blank\">https://github.com/aaPanel/aaWAF/blob/main/API.md</a>",
|
||||
"access.form.baotawaf_allow_insecure_conns.label": "Insecure SSL/TLS connections",
|
||||
"access.form.baotawaf_allow_insecure_conns.switch.on": "Allow",
|
||||
"access.form.baotawaf_allow_insecure_conns.switch.off": "Disallow",
|
||||
"access.form.byteplus_access_key.label": "BytePlus AccessKey",
|
||||
"access.form.byteplus_access_key.placeholder": "Please enter BytePlus AccessKey",
|
||||
"access.form.byteplus_access_key.tooltip": "For more information, see <a href=\"https://docs.byteplus.com/en/docs/byteplus-platform/docs-managing-keys\" target=\"_blank\">https://docs.byteplus.com/en/docs/byteplus-platform/docs-managing-keys</a>",
|
||||
@ -129,17 +123,14 @@
|
||||
"access.form.cachefly_api_token.label": "CacheFly API token",
|
||||
"access.form.cachefly_api_token.placeholder": "Please enter CacheFly API token",
|
||||
"access.form.cachefly_api_token.tooltip": "For more information, see <a href=\"https://kb.cachefly.com/kb/guide/en/generating-tokens-and-keys-Oll9Irt5TI/Steps/2460228\" target=\"_blank\">https://kb.cachefly.com/kb/guide/en/generating-tokens-and-keys-Oll9Irt5TI/Steps/2460228</a>",
|
||||
"access.form.cdnfly_api_url.label": "Cdnfly URL",
|
||||
"access.form.cdnfly_api_url.placeholder": "Please enter Cdnfly URL",
|
||||
"access.form.cdnfly_server_url.label": "Cdnfly server URL",
|
||||
"access.form.cdnfly_server_url.placeholder": "Please enter Cdnfly server URL",
|
||||
"access.form.cdnfly_api_key.label": "Cdnfly user API key",
|
||||
"access.form.cdnfly_api_key.placeholder": "Please enter Cdnfly user API key",
|
||||
"access.form.cdnfly_api_key.tooltip": "For more information, see <a href=\"https://doc.cdnfly.cn/shiyongjieshao.html\" target=\"_blank\">https://doc.cdnfly.cn/shiyongjieshao.html</a>",
|
||||
"access.form.cdnfly_api_secret.label": "Cdnfly user API secret",
|
||||
"access.form.cdnfly_api_secret.placeholder": "Please enter Cdnfly user API secret",
|
||||
"access.form.cdnfly_api_secret.tooltip": "For more information, see <a href=\"https://doc.cdnfly.cn/shiyongjieshao.html\" target=\"_blank\">https://doc.cdnfly.cn/shiyongjieshao.html</a>",
|
||||
"access.form.cdnfly_allow_insecure_conns.label": "Insecure SSL/TLS connections",
|
||||
"access.form.cdnfly_allow_insecure_conns.switch.on": "Allow",
|
||||
"access.form.cdnfly_allow_insecure_conns.switch.off": "Disallow",
|
||||
"access.form.cloudflare_dns_api_token.label": "Cloudflare DNS API token",
|
||||
"access.form.cloudflare_dns_api_token.placeholder": "Please enter Cloudflare DNS API token",
|
||||
"access.form.cloudflare_dns_api_token.tooltip": "For more information, see <a href=\"https://developers.cloudflare.com/fundamentals/api/get-started/create-token/\" target=\"_blank\">https://developers.cloudflare.com/fundamentals/api/get-started/create-token/</a>",
|
||||
@ -201,8 +192,8 @@
|
||||
"access.form.email_default_sender_address.placeholder": "Please enter default sender email address",
|
||||
"access.form.email_default_receiver_address.label": "Default receiver email address (Optional)",
|
||||
"access.form.email_default_receiver_address.placeholder": "Please enter default receiver email address",
|
||||
"access.form.flexcdn_api_url.label": "FlexCDN URL",
|
||||
"access.form.flexcdn_api_url.placeholder": "Please enter FlexCDN URL",
|
||||
"access.form.flexcdn_server_url.label": "FlexCDN server URL",
|
||||
"access.form.flexcdn_server_url.placeholder": "Please enter FlexCDN server URL",
|
||||
"access.form.flexcdn_api_role.label": "FlexCDN user role",
|
||||
"access.form.flexcdn_api_role.placeholder": "Please select FlexCDN user role",
|
||||
"access.form.flexcdn_api_role.option.user.label": "Platform user",
|
||||
@ -213,9 +204,6 @@
|
||||
"access.form.flexcdn_access_key.label": "FlexCDN AccessKey",
|
||||
"access.form.flexcdn_access_key.placeholder": "Please enter FlexCDN AccessKey",
|
||||
"access.form.flexcdn_access_key.tooltip": "For more information, see <a href=\"https://flexcdn.cn/docs/api/auth\" target=\"_blank\">https://flexcdn.cn/docs/api/auth</a>",
|
||||
"access.form.flexcdn_allow_insecure_conns.label": "Insecure SSL/TLS connections",
|
||||
"access.form.flexcdn_allow_insecure_conns.switch.on": "Allow",
|
||||
"access.form.flexcdn_allow_insecure_conns.switch.off": "Disallow",
|
||||
"access.form.gcore_api_token.label": "Gcore API token",
|
||||
"access.form.gcore_api_token.placeholder": "Please enter Gcore API token",
|
||||
"access.form.gcore_api_token.tooltip": "For more information, see <a href=\"https://api.gcore.com/docs/iam#section/Authentication\" target=\"_blank\">https://api.gcore.com/docs/iam#section/Authentication</a>",
|
||||
@ -231,8 +219,8 @@
|
||||
"access.form.godaddy_api_secret.label": "GoDaddy API secret",
|
||||
"access.form.godaddy_api_secret.placeholder": "Please enter GoDaddy API secret",
|
||||
"access.form.godaddy_api_secret.tooltip": "For more information, see <a href=\"https://developer.godaddy.com/\" target=\"_blank\">https://developer.godaddy.com/</a>",
|
||||
"access.form.goedge_api_url.label": "GoEdge URL",
|
||||
"access.form.goedge_api_url.placeholder": "Please enter GoEdge URL",
|
||||
"access.form.goedge_server_url.label": "GoEdge server URL",
|
||||
"access.form.goedge_server_url.placeholder": "Please enter GoEdge server URL",
|
||||
"access.form.goedge_api_role.label": "GoEdge user role",
|
||||
"access.form.goedge_api_role.placeholder": "Please select GoEdge user role",
|
||||
"access.form.goedge_api_role.option.user.label": "Platform user",
|
||||
@ -243,9 +231,6 @@
|
||||
"access.form.goedge_access_key.label": "GoEdge AccessKey",
|
||||
"access.form.goedge_access_key.placeholder": "Please enter GoEdge AccessKey",
|
||||
"access.form.goedge_access_key.tooltip": "For more information, see <a href=\"https://goedge.cloud/docs/API/Auth.md\" target=\"_blank\">https://goedge.cloud/docs/API/Auth.md</a>",
|
||||
"access.form.goedge_allow_insecure_conns.label": "Insecure SSL/TLS connections",
|
||||
"access.form.goedge_allow_insecure_conns.switch.on": "Allow",
|
||||
"access.form.goedge_allow_insecure_conns.switch.off": "Disallow",
|
||||
"access.form.googletrustservices_eab_kid.label": "ACME EAB KID",
|
||||
"access.form.googletrustservices_eab_kid.placeholder": "Please enter ACME EAB KID",
|
||||
"access.form.googletrustservices_eab_kid.tooltip": "For more information, see <a href=\"https://cloud.google.com/certificate-manager/docs/public-ca-tutorial\" target=\"_blank\">https://cloud.google.com/certificate-manager/docs/public-ca-tutorial</a>",
|
||||
@ -270,8 +255,8 @@
|
||||
"access.form.larkbot_webhook_url.label": "Lark bot Webhook URL",
|
||||
"access.form.larkbot_webhook_url.placeholder": "Please enter Lark bot Webhook URL",
|
||||
"access.form.larkbot_webhook_url.tooltip": "For more information, see <a href=\"https://www.feishu.cn/hc/en-US/articles/807992406756\" target=\"_blank\">https://www.feishu.cn/hc/en-US/articles/807992406756</a>",
|
||||
"access.form.lecdn_api_url.label": "LeCDN URL",
|
||||
"access.form.lecdn_api_url.placeholder": "Please enter LeCDN URL",
|
||||
"access.form.lecdn_server_url.label": "LeCDN server URL",
|
||||
"access.form.lecdn_server_url.placeholder": "Please enter LeCDN server URL",
|
||||
"access.form.lecdn_api_version.label": "LeCDN version",
|
||||
"access.form.lecdn_api_version.placeholder": "Please select LeCDN version",
|
||||
"access.form.lecdn_api_role.label": "LeCDN user role",
|
||||
@ -282,9 +267,6 @@
|
||||
"access.form.lecdn_username.placeholder": "Please enter LeCDN username",
|
||||
"access.form.lecdn_password.label": "LeCDN password",
|
||||
"access.form.lecdn_password.placeholder": "Please enter GoEdge password",
|
||||
"access.form.lecdn_allow_insecure_conns.label": "Insecure SSL/TLS connections",
|
||||
"access.form.lecdn_allow_insecure_conns.switch.on": "Allow",
|
||||
"access.form.lecdn_allow_insecure_conns.switch.off": "Disallow",
|
||||
"access.form.mattermost_server_url.label": "Mattermost server URL",
|
||||
"access.form.mattermost_server_url.placeholder": "Please enter Mattermost server URL",
|
||||
"access.form.mattermost_username.label": "Mattermost username",
|
||||
@ -330,25 +312,19 @@
|
||||
"access.form.porkbun_secret_api_key.label": "Porkbun secret API key",
|
||||
"access.form.porkbun_secret_api_key.placeholder": "Please enter Porkbun secret API key",
|
||||
"access.form.porkbun_secret_api_key.tooltip": "For more information, see <a href=\"https://porkbun.com/api/json/v3/documentation#Authentication\" target=\"_blank\">https://porkbun.com/api/json/v3/documentation</a>",
|
||||
"access.form.powerdns_api_url.label": "PowerDNS URL",
|
||||
"access.form.powerdns_api_url.placeholder": "Please enter PowerDNS URL",
|
||||
"access.form.powerdns_server_url.label": "PowerDNS server URL",
|
||||
"access.form.powerdns_server_url.placeholder": "Please enter PowerDNS server URL",
|
||||
"access.form.powerdns_api_key.label": "PowerDNS API key",
|
||||
"access.form.powerdns_api_key.placeholder": "Please enter PowerDNS API key",
|
||||
"access.form.powerdns_api_key.tooltip": "For more information, see <a href=\"https://doc.powerdns.com/authoritative/http-api/index.html#enabling-the-api\" target=\"_blank\">https://doc.powerdns.com/authoritative/http-api/index.html#enabling-the-api</a>",
|
||||
"access.form.powerdns_allow_insecure_conns.label": "Insecure SSL/TLS connections",
|
||||
"access.form.powerdns_allow_insecure_conns.switch.on": "Allow",
|
||||
"access.form.powerdns_allow_insecure_conns.switch.off": "Disallow",
|
||||
"access.form.proxmoxve_api_url.label": "Proxmox VE URL",
|
||||
"access.form.proxmoxve_api_url.placeholder": "Please enter Proxmox VE URL",
|
||||
"access.form.proxmoxve_server_url.label": "Proxmox VE server URL",
|
||||
"access.form.proxmoxve_server_url.placeholder": "Please enter Proxmox VE server URL",
|
||||
"access.form.proxmoxve_api_token.label": "Proxmox VE API token",
|
||||
"access.form.proxmoxve_api_token.placeholder": "Please enter Proxmox VE API token",
|
||||
"access.form.proxmoxve_api_token.tooltip": "For more information, see <a href=\"https://pve.proxmox.com/pve-docs/pve-admin-guide.html#pveum_tokens\" target=\"_blank\">https://pve.proxmox.com/pve-docs/pve-admin-guide.html#pveum_tokens</a>",
|
||||
"access.form.proxmoxve_api_token_secret.label": "Proxmox VE API token secret (Optional)",
|
||||
"access.form.proxmoxve_api_token_secret.placeholder": "Please enter Proxmox VE API token secret",
|
||||
"access.form.proxmoxve_api_token_secret.tooltip": "For more information, see <a href=\"https://pve.proxmox.com/pve-docs/pve-admin-guide.html#pveum_tokens\" target=\"_blank\">https://pve.proxmox.com/pve-docs/pve-admin-guide.html#pveum_tokens</a>",
|
||||
"access.form.proxmoxve_allow_insecure_conns.label": "Insecure SSL/TLS connections",
|
||||
"access.form.proxmoxve_allow_insecure_conns.switch.on": "Allow",
|
||||
"access.form.proxmoxve_allow_insecure_conns.switch.off": "Disallow",
|
||||
"access.form.qiniu_access_key.label": "Qiniu AccessKey",
|
||||
"access.form.qiniu_access_key.placeholder": "Please enter Qiniu AccessKey",
|
||||
"access.form.qiniu_access_key.tooltip": "For more information, see <a href=\"https://portal.qiniu.com/\" target=\"_blank\">https://portal.qiniu.com/</a>",
|
||||
@ -358,25 +334,19 @@
|
||||
"access.form.rainyun_api_key.label": "Rain Yun API key",
|
||||
"access.form.rainyun_api_key.placeholder": "Please enter Rain Yun API key",
|
||||
"access.form.rainyun_api_key.tooltip": "For more information, see <a href=\"https://app.rainyun.com/account/settings/api-key\" target=\"_blank\">https://app.rainyun.com/account/settings/api-key</a>",
|
||||
"access.form.ratpanel_api_url.label": "RatPanel URL",
|
||||
"access.form.ratpanel_api_url.placeholder": "Please enter RatPanel URL",
|
||||
"access.form.ratpanel_server_url.label": "RatPanel server URL",
|
||||
"access.form.ratpanel_server_url.placeholder": "Please enter RatPanel server URL",
|
||||
"access.form.ratpanel_access_token_id.label": "RatPanel access token ID",
|
||||
"access.form.ratpanel_access_token_id.placeholder": "Please enter RatPanel access token ID",
|
||||
"access.form.ratpanel_access_token_id.tooltip": "For more information, see <a href=\"https://ratpanel.github.io/advanced/api.html\" target=\"_blank\">https://ratpanel.github.io/advanced/api.html</a>",
|
||||
"access.form.ratpanel_access_token.label": "RatPanel access token",
|
||||
"access.form.ratpanel_access_token.placeholder": "Please enter RatPanel access token",
|
||||
"access.form.ratpanel_access_token.tooltip": "For more information, see <a href=\"https://ratpanel.github.io/advanced/api.html\" target=\"_blank\">https://ratpanel.github.io/advanced/api.html</a>",
|
||||
"access.form.ratpanel_allow_insecure_conns.label": "Insecure SSL/TLS connections",
|
||||
"access.form.ratpanel_allow_insecure_conns.switch.on": "Allow",
|
||||
"access.form.ratpanel_allow_insecure_conns.switch.off": "Disallow",
|
||||
"access.form.safeline_api_url.label": "SafeLine URL",
|
||||
"access.form.safeline_api_url.placeholder": "Please enter SafeLine URL",
|
||||
"access.form.safeline_server_url.label": "SafeLine server URL",
|
||||
"access.form.safeline_server_url.placeholder": "Please enter SafeLine server URL",
|
||||
"access.form.safeline_api_token.label": "SafeLine API token",
|
||||
"access.form.safeline_api_token.placeholder": "Please enter SafeLine API token",
|
||||
"access.form.safeline_api_token.tooltip": "For more information, see <a href=\"https://docs.waf.chaitin.com/en/reference/articles/openapi\" target=\"_blank\">https://docs.waf.chaitin.com/en/reference/articles/openapi</a>",
|
||||
"access.form.safeline_allow_insecure_conns.label": "Insecure SSL/TLS connections",
|
||||
"access.form.safeline_allow_insecure_conns.switch.on": "Allow",
|
||||
"access.form.safeline_allow_insecure_conns.switch.off": "Disallow",
|
||||
"access.form.ssh_host.label": "Server host",
|
||||
"access.form.ssh_host.placeholder": "Please enter server host",
|
||||
"access.form.ssh_port.label": "Server port",
|
||||
@ -466,9 +436,6 @@
|
||||
"access.form.webhook_preset_data.option.pushplus.label": "PushPlus",
|
||||
"access.form.webhook_preset_data.option.serverchan.label": "ServerChan",
|
||||
"access.form.webhook_preset_data.option.common.label": "General template",
|
||||
"access.form.webhook_allow_insecure_conns.label": "Insecure SSL/TLS connections",
|
||||
"access.form.webhook_allow_insecure_conns.switch.on": "Allow",
|
||||
"access.form.webhook_allow_insecure_conns.switch.off": "Disallow",
|
||||
"access.form.wecombot_webhook_url.label": "WeCom bot Webhook URL",
|
||||
"access.form.wecombot_webhook_url.placeholder": "Please enter WeCom bot Webhook URL",
|
||||
"access.form.wecombot_webhook_url.tooltip": "For more information, see <a href=\"https://open.work.weixin.qq.com/help2/pc/18401#%E5%85%AD%E3%80%81%E7%BE%A4%E6%9C%BA%E5%99%A8%E4%BA%BAWebhook%E5%9C%B0%E5%9D%80\" target=\"_blank\">https://open.work.weixin.qq.com/help2/pc/18401</a>",
|
||||
|
@ -34,16 +34,16 @@
|
||||
"access.form.certificate_authority.placeholder": "请选择证书颁发机构",
|
||||
"access.form.notification_channel.label": "通知渠道",
|
||||
"access.form.notification_channel.placeholder": "请选择通知渠道",
|
||||
"access.form.1panel_api_url.label": "1Panel URL",
|
||||
"access.form.1panel_api_url.placeholder": "请输入 1Panel URL",
|
||||
"access.form.common_allow_insecure_conns.label": "忽略 SSL/TLS 证书错误",
|
||||
"access.form.common_allow_insecure_conns.switch.on": "允许",
|
||||
"access.form.common_allow_insecure_conns.switch.off": "不允许",
|
||||
"access.form.1panel_server_url.label": "1Panel 服务地址",
|
||||
"access.form.1panel_server_url.placeholder": "请输入 1Panel 服务地址",
|
||||
"access.form.1panel_api_version.label": "1Panel 版本",
|
||||
"access.form.1panel_api_version.placeholder": "请选择 1Panel 版本",
|
||||
"access.form.1panel_api_key.label": "1Panel 接口密钥",
|
||||
"access.form.1panel_api_key.placeholder": "请输入 1Panel 接口密钥",
|
||||
"access.form.1panel_api_key.tooltip": "这是什么?请参阅 <a href=\"https://1panel.cn/docs/dev_manual/api_manual/\" target=\"_blank\">https://1panel.cn/docs/dev_manual/api_manual/</a>",
|
||||
"access.form.1panel_allow_insecure_conns.label": "忽略 SSL/TLS 证书错误",
|
||||
"access.form.1panel_allow_insecure_conns.switch.on": "允许",
|
||||
"access.form.1panel_allow_insecure_conns.switch.off": "不允许",
|
||||
"access.form.acmeca_endpoint.label": "服务端点",
|
||||
"access.form.acmeca_endpoint.placeholder": "请输入服务端点",
|
||||
"access.form.acmeca_endpoint.tooltip": "这是什么?请参阅 <a href=\"https://datatracker.ietf.org/doc/html/rfc8555#section-7.1.1\" target=\"_blank\">https://datatracker.ietf.org/doc/html/rfc8555#section-7.1.1</a>",
|
||||
@ -95,22 +95,16 @@
|
||||
"access.form.baiducloud_secret_access_key.tooltip": "这是什么?请参阅 <a href=\"https://cloud.baidu.com/doc/Reference/s/jjwvz2e3p\" target=\"_blank\">https://cloud.baidu.com/doc/Reference/s/jjwvz2e3p</a>",
|
||||
"access.form.baishan_api_token.label": "白山云 API Token",
|
||||
"access.form.baishan_api_token.placeholder": "请输入白山云 API Token",
|
||||
"access.form.baotapanel_api_url.label": "宝塔面板 URL",
|
||||
"access.form.baotapanel_api_url.placeholder": "请输入宝塔面板 URL",
|
||||
"access.form.baotapanel_server_url.label": "宝塔面板服务地址",
|
||||
"access.form.baotapanel_server_url.placeholder": "请输入宝塔面板服务地址",
|
||||
"access.form.baotapanel_api_key.label": "宝塔面板接口密钥",
|
||||
"access.form.baotapanel_api_key.placeholder": "请输入宝塔面板接口密钥",
|
||||
"access.form.baotapanel_api_key.tooltip": "这是什么?请参阅 <a href=\"https://www.bt.cn/bbs/thread-113890-1-1.html\" target=\"_blank\">https://www.bt.cn/bbs/thread-113890-1-1.html</a>",
|
||||
"access.form.baotapanel_allow_insecure_conns.label": "忽略 SSL/TLS 证书错误",
|
||||
"access.form.baotapanel_allow_insecure_conns.switch.on": "允许",
|
||||
"access.form.baotapanel_allow_insecure_conns.switch.off": "不允许",
|
||||
"access.form.baotawaf_api_url.label": "堡塔云 WAF URL",
|
||||
"access.form.baotawaf_api_url.placeholder": "请输入堡塔云 WAF URL",
|
||||
"access.form.baotawaf_server_url.label": "堡塔云 WAF 服务地址",
|
||||
"access.form.baotawaf_server_url.placeholder": "请输入堡塔云 WAF 服务地址",
|
||||
"access.form.baotawaf_api_key.label": "堡塔云 WAF 接口密钥",
|
||||
"access.form.baotawaf_api_key.placeholder": "请输入 堡塔云 WAF 接口密钥",
|
||||
"access.form.baotawaf_api_key.tooltip": "这是什么?请参阅 <a href=\"https://github.com/aaPanel/aaWAF/blob/main/API.md\" target=\"_blank\">https://github.com/aaPanel/aaWAF/blob/main/API.md</a>",
|
||||
"access.form.baotawaf_allow_insecure_conns.label": "忽略 SSL/TLS 证书错误",
|
||||
"access.form.baotawaf_allow_insecure_conns.switch.on": "允许",
|
||||
"access.form.baotawaf_allow_insecure_conns.switch.off": "不允许",
|
||||
"access.form.bunny_api_key.label": "Bunny API Key",
|
||||
"access.form.bunny_api_key.placeholder": "请输入 Bunny API Key",
|
||||
"access.form.bunny_api_key.tooltip": "这是什么?请参阅 <a href=\"https://docs.bunny.net/reference/bunnynet-api-overview\" target=\"_blank\">https://docs.bunny.net/reference/bunnynet-api-overview</a>",
|
||||
@ -123,17 +117,14 @@
|
||||
"access.form.cachefly_api_token.label": "CacheFly API Token",
|
||||
"access.form.cachefly_api_token.placeholder": "请输入 CacheFly API Token",
|
||||
"access.form.cachefly_api_token.tooltip": "这是什么?请参阅 <a href=\"https://kb.cachefly.com/kb/guide/en/generating-tokens-and-keys-Oll9Irt5TI/Steps/2460228\" target=\"_blank\">https://kb.cachefly.com/kb/guide/en/generating-tokens-and-keys-Oll9Irt5TI/Steps/2460228</a>",
|
||||
"access.form.cdnfly_api_url.label": "Cdnfly URL",
|
||||
"access.form.cdnfly_api_url.placeholder": "请输入 Cdnfly URL",
|
||||
"access.form.cdnfly_server_url.label": "Cdnfly 服务地址",
|
||||
"access.form.cdnfly_server_url.placeholder": "请输入 Cdnfly 服务地址",
|
||||
"access.form.cdnfly_api_key.label": "Cdnfly 用户端 API Key",
|
||||
"access.form.cdnfly_api_key.placeholder": "请输入 Cdnfly 用户端 API Key",
|
||||
"access.form.cdnfly_api_key.tooltip": "这是什么?请参阅 <a href=\"https://doc.cdnfly.cn/shiyongjieshao.html\" target=\"_blank\">https://doc.cdnfly.cn/shiyongjieshao.html</a>",
|
||||
"access.form.cdnfly_api_secret.label": "Cdnfly 用户端 API Secret",
|
||||
"access.form.cdnfly_api_secret.placeholder": "请输入 Cdnfly 用户端 API Secret",
|
||||
"access.form.cdnfly_api_secret.tooltip": "这是什么?请参阅 <a href=\"https://doc.cdnfly.cn/shiyongjieshao.html\" target=\"_blank\">https://doc.cdnfly.cn/shiyongjieshao.html</a>",
|
||||
"access.form.cdnfly_allow_insecure_conns.label": "忽略 SSL/TLS 证书错误",
|
||||
"access.form.cdnfly_allow_insecure_conns.switch.on": "允许",
|
||||
"access.form.cdnfly_allow_insecure_conns.switch.off": "不允许",
|
||||
"access.form.cloudflare_dns_api_token.label": "Cloudflare DNS API 令牌",
|
||||
"access.form.cloudflare_dns_api_token.placeholder": "请输入 Cloudflare DNS API 令牌",
|
||||
"access.form.cloudflare_dns_api_token.tooltip": "这是什么?请参阅 <a href=\"https://developers.cloudflare.com/fundamentals/api/get-started/create-token/\" target=\"_blank\">https://developers.cloudflare.com/fundamentals/api/get-started/create-token/</a>",
|
||||
@ -195,8 +186,8 @@
|
||||
"access.form.email_default_sender_address.placeholder": "请输入默认的发送邮箱地址",
|
||||
"access.form.email_default_receiver_address.label": "默认的接收邮箱地址(可选)",
|
||||
"access.form.email_default_receiver_address.placeholder": "请输入默认的接收邮箱地址",
|
||||
"access.form.flexcdn_api_url.label": "FlexCDN URL",
|
||||
"access.form.flexcdn_api_url.placeholder": "请输入 FlexCDN URL",
|
||||
"access.form.flexcdn_server_url.label": "FlexCDN 服务地址",
|
||||
"access.form.flexcdn_server_url.placeholder": "请输入 FlexCDN 服务地址",
|
||||
"access.form.flexcdn_api_role.label": "FlexCDN 用户角色",
|
||||
"access.form.flexcdn_api_role.placeholder": "请选择 FlexCDN 用户角色",
|
||||
"access.form.flexcdn_api_role.option.user.label": "平台用户",
|
||||
@ -207,9 +198,6 @@
|
||||
"access.form.flexcdn_access_key.label": "FlexCDN AccessKey",
|
||||
"access.form.flexcdn_access_key.placeholder": "请输入 FlexCDN AccessKey",
|
||||
"access.form.flexcdn_access_key.tooltip": "这是什么?请参阅 <a href=\"https://flexcdn.cn/docs/api/auth\" target=\"_blank\">https://flexcdn.cn/docs/api/auth</a>",
|
||||
"access.form.flexcdn_allow_insecure_conns.label": "忽略 SSL/TLS 证书错误",
|
||||
"access.form.flexcdn_allow_insecure_conns.switch.on": "允许",
|
||||
"access.form.flexcdn_allow_insecure_conns.switch.off": "不允许",
|
||||
"access.form.gcore_api_token.label": "Gcore API Token",
|
||||
"access.form.gcore_api_token.placeholder": "请输入 Gcore API Token",
|
||||
"access.form.gcore_api_token.tooltip": "这是什么?请参阅 <a href=\"https://api.gcore.com/docs/iam#section/Authentication\" target=\"_blank\">https://api.gcore.com/docs/iam#section/Authentication</a>",
|
||||
@ -225,8 +213,8 @@
|
||||
"access.form.godaddy_api_secret.label": "GoDaddy API Secret",
|
||||
"access.form.godaddy_api_secret.placeholder": "请输入 GoDaddy API Secret",
|
||||
"access.form.godaddy_api_secret.tooltip": "这是什么?请参阅 <a href=\"https://developer.godaddy.com/\" target=\"_blank\">https://developer.godaddy.com/</a>",
|
||||
"access.form.goedge_api_url.label": "GoEdge URL",
|
||||
"access.form.goedge_api_url.placeholder": "请输入 GoEdge URL",
|
||||
"access.form.goedge_server_url.label": "GoEdge 服务地址",
|
||||
"access.form.goedge_server_url.placeholder": "请输入 GoEdge 服务地址",
|
||||
"access.form.goedge_api_role.label": "GoEdge 用户角色",
|
||||
"access.form.goedge_api_role.placeholder": "请选择 GoEdge 用户角色",
|
||||
"access.form.goedge_api_role.option.user.label": "平台用户",
|
||||
@ -237,9 +225,6 @@
|
||||
"access.form.goedge_access_key.label": "GoEdge AccessKey",
|
||||
"access.form.goedge_access_key.placeholder": "请输入 GoEdge AccessKey",
|
||||
"access.form.goedge_access_key.tooltip": "这是什么?请参阅 <a href=\"https://goedge.cloud/docs/API/Auth.md\" target=\"_blank\">https://goedge.cloud/docs/API/Auth.md</a>",
|
||||
"access.form.goedge_allow_insecure_conns.label": "忽略 SSL/TLS 证书错误",
|
||||
"access.form.goedge_allow_insecure_conns.switch.on": "允许",
|
||||
"access.form.goedge_allow_insecure_conns.switch.off": "不允许",
|
||||
"access.form.googletrustservices_eab_kid.label": "ACME EAB KID",
|
||||
"access.form.googletrustservices_eab_kid.placeholder": "请输入 ACME EAB KID",
|
||||
"access.form.googletrustservices_eab_kid.tooltip": "这是什么?请参阅 <a href=\"https://cloud.google.com/certificate-manager/docs/public-ca-tutorial\" target=\"_blank\">https://cloud.google.com/certificate-manager/docs/public-ca-tutorial</a>",
|
||||
@ -264,8 +249,8 @@
|
||||
"access.form.larkbot_webhook_url.label": "飞书群机器人 Webhook 地址",
|
||||
"access.form.larkbot_webhook_url.placeholder": "请输入飞书群机器人 Webhook 地址",
|
||||
"access.form.larkbot_webhook_url.tooltip": "这是什么?请参阅 <a href=\"https://www.feishu.cn/hc/zh-CN/articles/807992406756\" target=\"_blank\">https://www.feishu.cn/hc/zh-CN/articles/807992406756</a>",
|
||||
"access.form.lecdn_api_url.label": "LeCDN URL",
|
||||
"access.form.lecdn_api_url.placeholder": "请输入 LeCDN URL",
|
||||
"access.form.lecdn_server_url.label": "LeCDN 服务地址",
|
||||
"access.form.lecdn_server_url.placeholder": "请输入 LeCDN 服务地址",
|
||||
"access.form.lecdn_api_version.label": "LeCDN 版本",
|
||||
"access.form.lecdn_api_version.placeholder": "请选择 LeCDN 版本",
|
||||
"access.form.lecdn_api_role.label": "LeCDN 用户角色",
|
||||
@ -276,9 +261,6 @@
|
||||
"access.form.lecdn_username.placeholder": "请输入 LeCDN 用户名",
|
||||
"access.form.lecdn_password.label": "LeCDN 用户密码",
|
||||
"access.form.lecdn_password.placeholder": "请输入 LeCDN 用户密码",
|
||||
"access.form.lecdn_allow_insecure_conns.label": "忽略 SSL/TLS 证书错误",
|
||||
"access.form.lecdn_allow_insecure_conns.switch.on": "允许",
|
||||
"access.form.lecdn_allow_insecure_conns.switch.off": "不允许",
|
||||
"access.form.mattermost_server_url.label": "Mattermost 服务地址",
|
||||
"access.form.mattermost_server_url.placeholder": "请输入 Mattermost 服务地址",
|
||||
"access.form.mattermost_username.label": "Mattermost 用户名",
|
||||
@ -324,25 +306,19 @@
|
||||
"access.form.porkbun_secret_api_key.label": "Porkbun Secret API Key",
|
||||
"access.form.porkbun_secret_api_key.placeholder": "请输入 Porkbun Secret API Key",
|
||||
"access.form.porkbun_secret_api_key.tooltip": "这是什么?请参阅 <a href=\"https://porkbun.com/api/json/v3/documentation#Authentication\" target=\"_blank\">https://porkbun.com/api/json/v3/documentation</a>",
|
||||
"access.form.powerdns_api_url.label": "PowerDNS URL",
|
||||
"access.form.powerdns_api_url.placeholder": "请输入 PowerDNS URL",
|
||||
"access.form.powerdns_server_url.label": "PowerDNS 服务地址",
|
||||
"access.form.powerdns_server_url.placeholder": "请输入 PowerDNS 服务地址",
|
||||
"access.form.powerdns_api_key.label": "PowerDNS API Key",
|
||||
"access.form.powerdns_api_key.placeholder": "请输入 PowerDNS API Key",
|
||||
"access.form.powerdns_api_key.tooltip": "这是什么?请参阅 <a href=\"https://doc.powerdns.com/authoritative/http-api/index.html#enabling-the-api\" target=\"_blank\">https://doc.powerdns.com/authoritative/http-api/index.html#enabling-the-api</a>",
|
||||
"access.form.powerdns_allow_insecure_conns.label": "忽略 SSL/TLS 证书错误",
|
||||
"access.form.powerdns_allow_insecure_conns.switch.on": "允许",
|
||||
"access.form.powerdns_allow_insecure_conns.switch.off": "不允许",
|
||||
"access.form.proxmoxve_api_url.label": "Proxmox VE URL",
|
||||
"access.form.proxmoxve_api_url.placeholder": "请输入 Proxmox VE URL",
|
||||
"access.form.proxmoxve_server_url.label": "Proxmox VE 服务地址",
|
||||
"access.form.proxmoxve_server_url.placeholder": "请输入 Proxmox VE 服务地址",
|
||||
"access.form.proxmoxve_api_token.label": "Proxmox VE API Token",
|
||||
"access.form.proxmoxve_api_token.placeholder": "请输入 Proxmox VE API Token",
|
||||
"access.form.proxmoxve_api_token.tooltip": "这是什么?请参阅 <a href=\"https://pve.proxmox.com/pve-docs/pve-admin-guide.html#pveum_tokens\" target=\"_blank\">https://pve.proxmox.com/pve-docs/pve-admin-guide.html#pveum_tokens</a>",
|
||||
"access.form.proxmoxve_api_token_secret.label": "Proxmox VE API Token Secret(可选)",
|
||||
"access.form.proxmoxve_api_token_secret.placeholder": "请输入 Proxmox VE API Token Secret",
|
||||
"access.form.proxmoxve_api_token_secret.tooltip": "这是什么?请参阅 <a href=\"https://pve.proxmox.com/pve-docs/pve-admin-guide.html#pveum_tokens\" target=\"_blank\">https://pve.proxmox.com/pve-docs/pve-admin-guide.html#pveum_tokens</a>",
|
||||
"access.form.proxmoxve_allow_insecure_conns.label": "忽略 SSL/TLS 证书错误",
|
||||
"access.form.proxmoxve_allow_insecure_conns.switch.on": "允许",
|
||||
"access.form.proxmoxve_allow_insecure_conns.switch.off": "不允许",
|
||||
"access.form.qiniu_access_key.label": "七牛云 AccessKey",
|
||||
"access.form.qiniu_access_key.placeholder": "请输入七牛云 AccessKey",
|
||||
"access.form.qiniu_access_key.tooltip": "这是什么?请参阅 <a href=\"https://portal.qiniu.com/\" target=\"_blank\">https://portal.qiniu.com/</a>",
|
||||
@ -352,25 +328,19 @@
|
||||
"access.form.rainyun_api_key.label": "雨云 API 密钥",
|
||||
"access.form.rainyun_api_key.placeholder": "请输入雨云 API 密钥",
|
||||
"access.form.rainyun_api_key.tooltip": "这是什么?请参阅 <a href=\"https://app.rainyun.com/account/settings/api-key\" target=\"_blank\">https://app.rainyun.com/account/settings/api-key</a>",
|
||||
"access.form.ratpanel_api_url.label": "耗子面板 URL",
|
||||
"access.form.ratpanel_api_url.placeholder": "请输入耗子面板 URL",
|
||||
"access.form.ratpanel_server_url.label": "耗子面板服务地址",
|
||||
"access.form.ratpanel_server_url.placeholder": "请输入耗子面板服务地址",
|
||||
"access.form.ratpanel_access_token_id.label": "耗子面板 AccessToken ID",
|
||||
"access.form.ratpanel_access_token_id.placeholder": "请输入耗子面板 AccessToken ID",
|
||||
"access.form.ratpanel_access_token_id.tooltip": "这是什么?请参阅 <a href=\"https://ratpanel.github.io/advanced/api.html\" target=\"_blank\">https://ratpanel.github.io/advanced/api.html</a>",
|
||||
"access.form.ratpanel_access_token.label": "耗子面板 AccessToken",
|
||||
"access.form.ratpanel_access_token.placeholder": "请输入耗子面板 AccessToken",
|
||||
"access.form.ratpanel_access_token.tooltip": "这是什么?请参阅 <a href=\"https://ratpanel.github.io/advanced/api.html\" target=\"_blank\">https://ratpanel.github.io/advanced/api.html</a>",
|
||||
"access.form.ratpanel_allow_insecure_conns.label": "忽略 SSL/TLS 证书错误",
|
||||
"access.form.ratpanel_allow_insecure_conns.switch.on": "允许",
|
||||
"access.form.ratpanel_allow_insecure_conns.switch.off": "不允许",
|
||||
"access.form.safeline_api_url.label": "雷池 URL",
|
||||
"access.form.safeline_api_url.placeholder": "请输入雷池 URL",
|
||||
"access.form.safeline_server_url.label": "雷池服务地址",
|
||||
"access.form.safeline_server_url.placeholder": "请输入雷池服务地址",
|
||||
"access.form.safeline_api_token.label": "雷池 API Token",
|
||||
"access.form.safeline_api_token.placeholder": "请输入雷池 API Token",
|
||||
"access.form.safeline_api_token.tooltip": "这是什么?请参阅 <a href=\"https://docs.waf-ce.chaitin.cn/zh/%E6%9B%B4%E5%A4%9A%E6%8A%80%E6%9C%AF%E6%96%87%E6%A1%A3/OPENAPI\" target=\"_blank\">https://docs.waf-ce.chaitin.cn/zh/更多技术文档/OPENAPI</a>",
|
||||
"access.form.safeline_allow_insecure_conns.label": "忽略 SSL/TLS 证书错误",
|
||||
"access.form.safeline_allow_insecure_conns.switch.on": "允许",
|
||||
"access.form.safeline_allow_insecure_conns.switch.off": "不允许",
|
||||
"access.form.ssh_host.label": "服务器地址",
|
||||
"access.form.ssh_host.placeholder": "请输入服务器地址",
|
||||
"access.form.ssh_port.label": "服务器端口",
|
||||
@ -466,9 +436,6 @@
|
||||
"access.form.webhook_preset_data.option.pushplus.label": "PushPlus 推送加",
|
||||
"access.form.webhook_preset_data.option.serverchan.label": "Server 酱",
|
||||
"access.form.webhook_preset_data.option.common.label": "通用模板",
|
||||
"access.form.webhook_allow_insecure_conns.label": "忽略 SSL/TLS 证书错误",
|
||||
"access.form.webhook_allow_insecure_conns.switch.on": "允许",
|
||||
"access.form.webhook_allow_insecure_conns.switch.off": "不允许",
|
||||
"access.form.wecombot_webhook_url.label": "企业微信群机器人 Webhook 地址",
|
||||
"access.form.wecombot_webhook_url.placeholder": "请输入企业微信群机器人 Webhook 地址",
|
||||
"access.form.wecombot_webhook_url.tooltip": "这是什么?请参阅 <a href=\"https://open.work.weixin.qq.com/help2/pc/18401#%E5%85%AD%E3%80%81%E7%BE%A4%E6%9C%BA%E5%99%A8%E4%BA%BAWebhook%E5%9C%B0%E5%9D%80\" target=\"_blank\">https://open.work.weixin.qq.com/help2/pc/18401</a>",
|
||||
|
@ -28,8 +28,8 @@
|
||||
"settings.notification.channel.switch.off": "停用",
|
||||
"settings.notification.push_test.button": "推送测试消息",
|
||||
"settings.notification.push_test.pushed": "已推送",
|
||||
"settings.notification.channel.form.bark_server_url.label": "服务器地址",
|
||||
"settings.notification.channel.form.bark_server_url.placeholder": "请输入服务器地址",
|
||||
"settings.notification.channel.form.bark_server_url.label": "服务地址",
|
||||
"settings.notification.channel.form.bark_server_url.placeholder": "请输入服务地址",
|
||||
"settings.notification.channel.form.bark_server_url.tooltip": "这是什么?请参阅 <a href=\"https://bark.day.app/\" target=\"_blank\">https://bark.day.app/</a><br><br>为空时,将使用 Bark 默认服务器。",
|
||||
"settings.notification.channel.form.bark_device_key.label": "设备密钥",
|
||||
"settings.notification.channel.form.bark_device_key.placeholder": "请输入设备密钥",
|
||||
|
Loading…
x
Reference in New Issue
Block a user