mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-04-21 20:12:33 +03:00
Update routes.go
This commit is contained in:
parent
e89dfab469
commit
102581cfde
1 changed files with 19 additions and 0 deletions
|
@ -805,6 +805,25 @@ func ApplyServerConfig(db store.IStore, tmplBox *rice.Box) echo.HandlerFunc {
|
|||
})
|
||||
}
|
||||
|
||||
err = util.UpdateHashes(db)
|
||||
if err != nil {
|
||||
log.Error("Cannot update hashes: ", err)
|
||||
return c.JSON(http.StatusInternalServerError, jsonHTTPResponse{
|
||||
false, fmt.Sprintf("Cannot update hashes: %v", err),
|
||||
})
|
||||
}
|
||||
|
||||
return c.JSON(http.StatusOK, jsonHTTPResponse{true, "Applied server config successfully"})
|
||||
}
|
||||
}
|
||||
|
||||
// GetHashesChanges handler returns if database hashes have changed
|
||||
func GetHashesChanges(db store.IStore) echo.HandlerFunc {
|
||||
return func(c echo.Context) error {
|
||||
if util.HashesChanged(db) {
|
||||
return c.JSON(http.StatusOK, jsonHTTPResponse{true, "Hashes changed"})
|
||||
} else {
|
||||
return c.JSON(http.StatusOK, jsonHTTPResponse{false, "Hashes not changed"})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue