mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-07-24 19:52:56 +03:00
Client page adjustment
This commit is contained in:
parent
9169e75e88
commit
e3fac242bb
4 changed files with 164 additions and 55 deletions
|
@ -92,6 +92,21 @@ func WireGuardClients() echo.HandlerFunc {
|
|||
}
|
||||
}
|
||||
|
||||
// GetClients handler return a list of Wireguard client data
|
||||
func GetClients() echo.HandlerFunc {
|
||||
return func(c echo.Context) error {
|
||||
// access validation
|
||||
validSession(c)
|
||||
|
||||
clientDataList, err := util.GetClients(true)
|
||||
if err != nil {
|
||||
return c.JSON(http.StatusInternalServerError, jsonHTTPResponse{false, fmt.Sprintf("Cannot get client list: %v", err)})
|
||||
}
|
||||
|
||||
return c.JSON(http.StatusOK, clientDataList)
|
||||
}
|
||||
}
|
||||
|
||||
// NewClient handler
|
||||
func NewClient() echo.HandlerFunc {
|
||||
return func(c echo.Context) error {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue