mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 10:25:52 +02:00
fix: config not sync when add #685
This commit is contained in:
parent
b21eb85a1a
commit
0e3489d174
4 changed files with 12 additions and 32 deletions
|
@ -76,12 +76,20 @@ func AddConfig(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
err = q.Create(&model.Config{
|
||||
cfg := &model.Config{
|
||||
Name: name,
|
||||
Filepath: path,
|
||||
SyncNodeIds: json.SyncNodeIds,
|
||||
SyncOverwrite: json.Overwrite,
|
||||
})
|
||||
}
|
||||
|
||||
err = q.Create(cfg)
|
||||
if err != nil {
|
||||
api.ErrHandler(c, err)
|
||||
return
|
||||
}
|
||||
|
||||
err = config.SyncToRemoteServer(cfg, json.NewFilepath)
|
||||
if err != nil {
|
||||
api.ErrHandler(c, err)
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue