mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-04-21 20:12:33 +03:00
fix QCCode bug
This commit is contained in:
parent
03428646e1
commit
a53a85618f
2 changed files with 15 additions and 9 deletions
|
@ -29,9 +29,11 @@ function renderClientList(data) {
|
|||
<div class="info-box">
|
||||
<div class="overlay" id="paused_${obj.Client.id}"` + clientStatusHtml
|
||||
+ `<i class="paused-client fas fa-3x fa-play" onclick="resumeClient('${obj.Client.id}')"></i>
|
||||
</div>
|
||||
<img src="${obj.QRCode}" />
|
||||
<div class="info-box-content">
|
||||
</div>`
|
||||
if (obj.Client.hasPrivateSubnet == false) {
|
||||
html = html + `<img src="${obj.QRCode}" />`
|
||||
}
|
||||
html = html + `<div class="info-box-content">
|
||||
<div class="btn-group">
|
||||
<button onclick="location.href='/download?clientid=${obj.Client.id}'" type="button"
|
||||
class="btn btn-outline-success btn-sm">Download</button>
|
||||
|
|
16
util/util.go
16
util/util.go
|
@ -22,8 +22,6 @@ func BuildClientConfig(client model.Client, server model.Server, setting model.G
|
|||
clientAddress := fmt.Sprintf("Address = %s", strings.Join(client.AllocatedIPs, ","))
|
||||
clientPrivateKey := fmt.Sprintf("PrivateKey = %s", client.PrivateKey)
|
||||
clientDNS := fmt.Sprintf("DNS = %s", strings.Join(setting.DNSServers, ","))
|
||||
clientPostUp := fmt.Sprintf("PostUp = %s", client.PostUp)
|
||||
clientPostDown := fmt.Sprintf("PostDown = %s", client.PostDown)
|
||||
|
||||
// Peer section
|
||||
peerPublicKey := fmt.Sprintf("PublicKey = %s", server.KeyPair.PublicKey)
|
||||
|
@ -36,10 +34,16 @@ func BuildClientConfig(client model.Client, server model.Server, setting model.G
|
|||
strConfig := "[Interface]\n" +
|
||||
clientAddress + "\n" +
|
||||
clientPrivateKey + "\n" +
|
||||
clientDNS + "\n" +
|
||||
clientPostUp + "\n" +
|
||||
clientPostDown + "\n\n" +
|
||||
"[Peer]" + "\n" +
|
||||
clientDNS + "\n\n"
|
||||
|
||||
if client.HasPrivateSubnet {
|
||||
clientPostUp := fmt.Sprintf("PostUp = %s", client.PostUp)
|
||||
clientPostDown := fmt.Sprintf("PostDown = %s", client.PostDown)
|
||||
strConfig += clientPostUp + "\n" +
|
||||
clientPostDown + "\n\n"
|
||||
}
|
||||
|
||||
strConfig += "[Peer]" + "\n" +
|
||||
peerPublicKey + "\n" +
|
||||
peerPresharedKey + "\n" +
|
||||
peerAllowedIPs + "\n" +
|
||||
|
|
Loading…
Add table
Reference in a new issue