mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-04 04:30:05 +00:00
ddns: add listProviders api (#446)
* ddns: add listProviders api * fix swagger
This commit is contained in:
@@ -71,6 +71,7 @@ func routers(r *gin.Engine) {
|
||||
auth.POST("/batch-delete/server", commonHandler(batchDeleteServer))
|
||||
|
||||
auth.GET("/ddns", commonHandler(listDDNS))
|
||||
auth.GET("/ddns/providers", commonHandler(listProviders))
|
||||
auth.POST("/ddns", commonHandler(newDDNS))
|
||||
auth.PATCH("/ddns/:id", commonHandler(editDDNS))
|
||||
auth.POST("/batch-delete/ddns", commonHandler(batchDeleteDDNS))
|
||||
|
||||
@@ -227,3 +227,20 @@ func listDDNS(c *gin.Context) error {
|
||||
})
|
||||
return nil
|
||||
}
|
||||
|
||||
// List DDNS Providers
|
||||
// @Summary List DDNS providers
|
||||
// @Schemes
|
||||
// @Description List DDNS providers
|
||||
// @Security BearerAuth
|
||||
// @Tags auth required
|
||||
// @Produce json
|
||||
// @Success 200 {object} model.CommonResponse[[]string]
|
||||
// @Router /ddns/providers [get]
|
||||
func listProviders(c *gin.Context) error {
|
||||
c.JSON(http.StatusOK, model.CommonResponse[[]string]{
|
||||
Success: true,
|
||||
Data: model.ProviderList,
|
||||
})
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -720,7 +720,7 @@ type ddnsForm struct {
|
||||
EnableIPv4 string
|
||||
EnableIPv6 string
|
||||
Name string
|
||||
Provider uint8
|
||||
Provider string
|
||||
DomainsRaw string
|
||||
AccessID string
|
||||
AccessSecret string
|
||||
|
||||
@@ -82,9 +82,9 @@ func (mp *memberPage) ddns(c *gin.Context) {
|
||||
singleton.DB.Find(&data)
|
||||
c.HTML(http.StatusOK, "dashboard-", gin.H{
|
||||
// "Title": singleton.Localizer.MustLocalize(&i18n.LocalizeConfig{MessageID: "DDNS"}),
|
||||
"DDNS": data,
|
||||
"ProviderMap": model.ProviderMap,
|
||||
"ProviderList": model.ProviderList,
|
||||
"DDNS": data,
|
||||
//"ProviderMap": model.ProviderMap,
|
||||
//"ProviderList": model.ProviderList,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user