mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-04-19 19:59:13 +03:00
Update helper.js (#66)
This commit is contained in:
parent
4093722926
commit
93e3e847f2
2 changed files with 3 additions and 6 deletions
|
@ -27,11 +27,8 @@ function renderClientList(data) {
|
||||||
<img src="${obj.QRCode}" />
|
<img src="${obj.QRCode}" />
|
||||||
<div class="info-box-content">
|
<div class="info-box-content">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button onclick="location.href='/download?clientid=${obj.Client.id}'" type="button"
|
<a href="/download?clientid=${obj.Client.id}"
|
||||||
class="btn btn-outline-success btn-sm">Download</button>
|
class="btn btn-outline-success btn-sm">Download</a>
|
||||||
<button type="button" class="btn btn-outline-warning btn-sm" data-toggle="modal"
|
|
||||||
data-target="#modal_email_client" data-clientid="${obj.Client.id}"
|
|
||||||
data-clientname="${obj.Client.name}">Email</button>
|
|
||||||
<button type="button" class="btn btn-outline-primary btn-sm" data-toggle="modal"
|
<button type="button" class="btn btn-outline-primary btn-sm" data-toggle="modal"
|
||||||
data-target="#modal_edit_client" data-clientid="${obj.Client.id}"
|
data-target="#modal_edit_client" data-clientid="${obj.Client.id}"
|
||||||
data-clientname="${obj.Client.name}">Edit</button>
|
data-clientname="${obj.Client.name}">Edit</button>
|
||||||
|
|
|
@ -346,7 +346,7 @@ func DownloadClient(db store.IStore) echo.HandlerFunc {
|
||||||
reader := strings.NewReader(config)
|
reader := strings.NewReader(config)
|
||||||
|
|
||||||
// set response header for downloading
|
// set response header for downloading
|
||||||
c.Response().Header().Set(echo.HeaderContentDisposition, "attachment; filename=wg0.conf")
|
c.Response().Header().Set(echo.HeaderContentDisposition, fmt.Sprintf("attachment; filename=%s.conf", clientData.Client.Name))
|
||||||
return c.Stream(http.StatusOK, "text/plain", reader)
|
return c.Stream(http.StatusOK, "text/plain", reader)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue