Refactor acme.sh dns providers

- updated chakra and typescript
- added locales for dns provider configs
This commit is contained in:
Jamie Curnow
2023-01-12 16:25:43 +10:00
parent 1d5d3ecd7a
commit 5d3bc0fabd
57 changed files with 2204 additions and 2161 deletions

View File

@ -133,8 +133,7 @@ func DeleteDNSProvider() func(http.ResponseWriter, *http.Request) {
// Route: GET /dns-providers/acmesh
func GetAcmeshProviders() func(http.ResponseWriter, *http.Request) {
return func(w http.ResponseWriter, r *http.Request) {
items := dnsproviders.List()
h.ResultResponseJSON(w, r, http.StatusOK, items)
h.ResultResponseJSON(w, r, http.StatusOK, dnsproviders.List())
}
}

View File

@ -5,6 +5,7 @@ import (
"strings"
"npm/internal/dnsproviders"
"npm/internal/logger"
"npm/internal/util"
)
@ -15,7 +16,12 @@ func CreateDNSProvider() string {
allSchemasWrapped := make([]string, 0)
for providerName, provider := range allProviders {
allSchemasWrapped = append(allSchemasWrapped, createDNSProviderType(providerName, provider.Schema))
schema, err := provider.GetJsonSchema()
if err != nil {
logger.Error("ProviderSchemaError", fmt.Errorf("Invalid Provider Schema for %s: %v", provider.Title, err))
} else {
allSchemasWrapped = append(allSchemasWrapped, createDNSProviderType(providerName, schema))
}
}
return fmt.Sprintf(fmtStr, util.ConvertStringSliceToInterface(allSchemasWrapped)...)