mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-07-07 17:23:14 +03:00
add client postup & postdown
This commit is contained in:
parent
a89fb34555
commit
03428646e1
5 changed files with 37 additions and 5 deletions
|
@ -3,11 +3,12 @@ package handler
|
|||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
rice "github.com/GeertJohan/go.rice"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
rice "github.com/GeertJohan/go.rice"
|
||||
|
||||
"github.com/gorilla/sessions"
|
||||
"github.com/labstack/echo-contrib/session"
|
||||
"github.com/labstack/echo/v4"
|
||||
|
@ -192,7 +193,6 @@ func NewClient() echo.HandlerFunc {
|
|||
client.HasPrivateSubnet = true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// write client to the database
|
||||
db.Write("clients", client.ID, client)
|
||||
|
@ -256,6 +256,8 @@ func UpdateClient() echo.HandlerFunc {
|
|||
client.AllocatedIPs = _client.AllocatedIPs
|
||||
client.AllowedIPs = _client.AllowedIPs
|
||||
client.PrivateSubnets = _client.PrivateSubnets
|
||||
client.PostUp = _client.PostUp
|
||||
client.PostDown = _client.PostDown
|
||||
client.UpdatedAt = time.Now().UTC()
|
||||
|
||||
client.HasPrivateSubnet = false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue