mirror of
https://github.com/simon-ding/polaris.git
synced 2026-05-27 04:57:42 +08:00
fix: save setting
This commit is contained in:
@@ -190,12 +190,13 @@ func (s *Server) GetAllIndexers(c *gin.Context) (interface{}, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type downloadClientIn struct {
|
type downloadClientIn struct {
|
||||||
Name string `json:"name" binding:"required"`
|
Name string `json:"name" binding:"required"`
|
||||||
URL string `json:"url" binding:"required"`
|
URL string `json:"url" binding:"required"`
|
||||||
User string `json:"user"`
|
User string `json:"user"`
|
||||||
Password string `json:"password"`
|
Password string `json:"password"`
|
||||||
Implementation string `json:"implementation" binding:"required"`
|
Implementation string `json:"implementation" binding:"required"`
|
||||||
Priority int `json:"priority"`
|
Priority int `json:"priority"`
|
||||||
|
UseNatTraversal bool `json:"use_nat_traversal"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Server) AddDownloadClient(c *gin.Context) (interface{}, error) {
|
func (s *Server) AddDownloadClient(c *gin.Context) (interface{}, error) {
|
||||||
@@ -225,12 +226,13 @@ func (s *Server) AddDownloadClient(c *gin.Context) (interface{}, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if err := s.db.SaveDownloader(&ent.DownloadClients{
|
if err := s.db.SaveDownloader(&ent.DownloadClients{
|
||||||
Name: in.Name,
|
Name: in.Name,
|
||||||
Implementation: downloadclients.Implementation(in.Implementation),
|
Implementation: downloadclients.Implementation(in.Implementation),
|
||||||
Priority1: in.Priority,
|
Priority1: in.Priority,
|
||||||
URL: in.URL,
|
URL: in.URL,
|
||||||
User: in.User,
|
User: in.User,
|
||||||
Password: in.Password,
|
Password: in.Password,
|
||||||
|
UseNatTraversal: in.UseNatTraversal,
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
return nil, errors.Wrap(err, "save downloader")
|
return nil, errors.Wrap(err, "save downloader")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user