mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-04-20 20:03:39 +03:00
Merge 510ba54a21
into 2fdafd34ca
This commit is contained in:
commit
860b53ffbb
1 changed files with 4 additions and 4 deletions
|
@ -509,7 +509,7 @@ func NewClient(db store.IStore) echo.HandlerFunc {
|
||||||
false, err.Error(),
|
false, err.Error(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
log.Infof("Created wireguard client: %v", client)
|
log.Infof("Created wireguard client: %v", client.Name)
|
||||||
|
|
||||||
return c.JSON(http.StatusOK, client)
|
return c.JSON(http.StatusOK, client)
|
||||||
}
|
}
|
||||||
|
@ -726,7 +726,7 @@ func UpdateClient(db store.IStore) echo.HandlerFunc {
|
||||||
if err := db.SaveClient(client); err != nil {
|
if err := db.SaveClient(client); err != nil {
|
||||||
return c.JSON(http.StatusInternalServerError, jsonHTTPResponse{false, err.Error()})
|
return c.JSON(http.StatusInternalServerError, jsonHTTPResponse{false, err.Error()})
|
||||||
}
|
}
|
||||||
log.Infof("Updated client information successfully => %v", client)
|
log.Infof("Updated client information successfully => %v", client.Name)
|
||||||
|
|
||||||
return c.JSON(http.StatusOK, jsonHTTPResponse{true, "Updated client successfully"})
|
return c.JSON(http.StatusOK, jsonHTTPResponse{true, "Updated client successfully"})
|
||||||
}
|
}
|
||||||
|
@ -821,7 +821,7 @@ func RemoveClient(db store.IStore) echo.HandlerFunc {
|
||||||
return c.JSON(http.StatusInternalServerError, jsonHTTPResponse{false, "Cannot delete client from database"})
|
return c.JSON(http.StatusInternalServerError, jsonHTTPResponse{false, "Cannot delete client from database"})
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Infof("Removed wireguard client: %v", client)
|
log.Infof("Removed wireguard client: %v", client.ID)
|
||||||
return c.JSON(http.StatusOK, jsonHTTPResponse{true, "Client removed"})
|
return c.JSON(http.StatusOK, jsonHTTPResponse{true, "Client removed"})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -885,7 +885,7 @@ func WireGuardServerKeyPair(db store.IStore) echo.HandlerFunc {
|
||||||
if err := db.SaveServerKeyPair(serverKeyPair); err != nil {
|
if err := db.SaveServerKeyPair(serverKeyPair); err != nil {
|
||||||
return c.JSON(http.StatusInternalServerError, jsonHTTPResponse{false, "Cannot generate Wireguard key pair"})
|
return c.JSON(http.StatusInternalServerError, jsonHTTPResponse{false, "Cannot generate Wireguard key pair"})
|
||||||
}
|
}
|
||||||
log.Infof("Updated wireguard server interfaces settings: %v", serverKeyPair)
|
log.Infof("Updated wireguard server keypairs")
|
||||||
|
|
||||||
return c.JSON(http.StatusOK, serverKeyPair)
|
return c.JSON(http.StatusOK, serverKeyPair)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue