mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-10-04 08:16:17 +00:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
99fb07c6b3 | ||
|
eaad971c0a | ||
|
377abd87fd |
23
README.md
23
README.md
@@ -348,10 +348,29 @@ Endpoint = 0.0.0.0:51820
|
|||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
|
#### Update Method 1 (For `v3.0` or above)
|
||||||
|
|
||||||
|
1. Change your directory to `wgdashboard/src`
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd wgdashboard/src
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Update the dashboard with the following
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./wgd.sh update
|
||||||
|
```
|
||||||
|
|
||||||
|
> If this doesn't work, please use the method below. Sorry about that :(
|
||||||
|
|
||||||
|
#### Update Method 2
|
||||||
|
|
||||||
|
|
||||||
1. Change your directory to `wgdashboard`
|
1. Change your directory to `wgdashboard`
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
cd wgdashboard
|
cd wgdashboard/src
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Update the dashboard
|
2. Update the dashboard
|
||||||
@@ -365,6 +384,8 @@ Endpoint = 0.0.0.0:51820
|
|||||||
./wgd.sh install
|
./wgd.sh install
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Starting with `v3.0`, you can simply do `./wgd.sh update` !! (I hope, lol)
|
Starting with `v3.0`, you can simply do `./wgd.sh update` !! (I hope, lol)
|
||||||
|
|
||||||
## 🥘 Experimental Functions
|
## 🥘 Experimental Functions
|
||||||
|
@@ -171,6 +171,17 @@
|
|||||||
return String.fromCharCode.apply(null, base64);
|
return String.fromCharCode.apply(null, base64);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function base64ToKey(base64) {
|
||||||
|
let binary_string = window.atob(base64);
|
||||||
|
let len = binary_string.length;
|
||||||
|
let bytes = new Uint8Array(len);
|
||||||
|
for (let i = 0; i < len; i++) {
|
||||||
|
bytes[i] = binary_string.charCodeAt(i);
|
||||||
|
}
|
||||||
|
let uint8 = new Uint8Array(bytes.buffer);
|
||||||
|
return uint8;
|
||||||
|
}
|
||||||
|
|
||||||
function putU32(b, n)
|
function putU32(b, n)
|
||||||
{
|
{
|
||||||
b.push(n & 0xff, (n >>> 8) & 0xff, (n >>> 16) & 0xff, (n >>> 24) & 0xff);
|
b.push(n & 0xff, (n >>> 8) & 0xff, (n >>> 16) & 0xff, (n >>> 24) & 0xff);
|
||||||
@@ -282,7 +293,8 @@
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
generatePublicKey: function (privateKey){
|
generatePublicKey: function (privateKey){
|
||||||
return keyToBase64(generatePublicKey(privateKey))
|
privateKey = base64ToKey(privateKey);
|
||||||
|
return keyToBase64(generatePublicKey(privateKey));
|
||||||
},
|
},
|
||||||
|
|
||||||
generateZipFiles: function(res){
|
generateZipFiles: function(res){
|
||||||
|
2
src/static/js/wireguard.min.js
vendored
2
src/static/js/wireguard.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -37,18 +37,20 @@
|
|||||||
{% include "footer.html" %}
|
{% include "footer.html" %}
|
||||||
<script>
|
<script>
|
||||||
$("button").on("click", function(e){
|
$("button").on("click", function(e){
|
||||||
let req = $("input[required]");
|
e.preventDefault();
|
||||||
|
let $password = $("#password");
|
||||||
|
let $username = $("#username");
|
||||||
|
let req = [$password, $username];
|
||||||
let check = true
|
let check = true
|
||||||
for (let i = 0; i < req.length; i++){
|
for (let i = 0; i < req.length; i++){
|
||||||
if ($(req[i]).val().length === 0){
|
if ($(req[i]).val().length === 0){
|
||||||
$("button").html("Sign In");
|
$("button").html("Sign In");
|
||||||
check = false;
|
check = false;
|
||||||
$("input[required]").addClass("is-invalid");
|
$(req[i]).addClass("is-invalid");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (check){
|
if (check){
|
||||||
e.preventDefault();
|
|
||||||
$(this).html("Signing In...").attr("disabled", "disabled");
|
$(this).html("Signing In...").attr("disabled", "disabled");
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "/auth",
|
url: "/auth",
|
||||||
|
Reference in New Issue
Block a user