mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-05-24 00:24:06 +03:00
Add download button
This commit is contained in:
parent
6f0d7bf69f
commit
91f06914d4
4 changed files with 50 additions and 3 deletions
17
util/db.go
17
util/db.go
|
@ -224,3 +224,20 @@ func GetClients(hasQRCode bool) ([]model.ClientData, error) {
|
|||
|
||||
return clients, nil
|
||||
}
|
||||
|
||||
// GetClientByID func to query a client from the database
|
||||
func GetClientByID(clientID string) (model.Client, error) {
|
||||
client := model.Client{}
|
||||
|
||||
db, err := DBConn()
|
||||
if err != nil {
|
||||
return client, err
|
||||
}
|
||||
|
||||
// read client information
|
||||
if err := db.Read("clients", clientID, &client); err != nil {
|
||||
return client, err
|
||||
}
|
||||
|
||||
return client, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue