Edit wireguard client (#19)

* Add the ability to modify an existing client
* Update client page using Ajax
This commit is contained in:
Khanh Ngo 2020-06-02 11:20:50 +07:00 committed by GitHub
parent 9169e75e88
commit cd7f6e500a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 445 additions and 76 deletions

View file

@ -49,6 +49,7 @@ func main() {
app.POST("/login", handler.Login())
app.GET("/logout", handler.Logout())
app.POST("/new-client", handler.NewClient())
app.POST("/update-client", handler.UpdateClient())
app.POST("/client/set-status", handler.SetClientStatus())
app.POST("/remove-client", handler.RemoveClient())
app.GET("/download", handler.DownloadClient())
@ -57,6 +58,8 @@ func main() {
app.POST("wg-server/keypair", handler.WireGuardServerKeyPair())
app.GET("/global-settings", handler.GlobalSettings())
app.POST("/global-settings", handler.GlobalSettingSubmit())
app.GET("/api/clients", handler.GetClients())
app.GET("/api/client/:id", handler.GetClient())
app.GET("/api/machine-ips", handler.MachineIPAddresses())
app.GET("/api/suggest-client-ips", handler.SuggestIPAllocation())
app.GET("/api/apply-wg-config", handler.ApplyServerConfig(tmplBox))