1
0
mirror of https://github.com/donaldzou/WGDashboard.git synced 2024-11-22 07:10:09 +01:00
This commit is contained in:
donaldzou 2020-10-18 01:52:53 -04:00
parent 9146e60c3c
commit 5e230793e0
4 changed files with 11 additions and 5 deletions

View File

@ -8,7 +8,6 @@ conf_location = "/etc/wireguard"
app = Flask("Wireguard Dashboard") app = Flask("Wireguard Dashboard")
app.config['TEMPLATES_AUTO_RELOAD'] = True app.config['TEMPLATES_AUTO_RELOAD'] = True
# app.config['STATIC_AUTO_RELOAD'] = True
css = "" css = ""
def get_conf_peers_data(config_name): def get_conf_peers_data(config_name):
@ -115,7 +114,7 @@ def get_conf_list():
for i in os.listdir(conf_location): for i in os.listdir(conf_location):
if ".conf" in i: if ".conf" in i:
i = i.replace('.conf','') i = i.replace('.conf','')
temp = {"conf":i, "status":get_conf_status(i)} temp = {"conf":i, "status":get_conf_status(i), "public_key": get_conf_pub_key(i)}
conf.append(temp) conf.append(temp)
return conf return conf

BIN
static/conf.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 KiB

BIN
static/index.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 455 KiB

View File

@ -43,9 +43,16 @@
<a href="/configuration/{{i['conf']}}"> <a href="/configuration/{{i['conf']}}">
<h5 class="card-title">{{i['conf']}}</h5> <h5 class="card-title">{{i['conf']}}</h5>
</a> </a>
<h6 class="card-subtitle mb-2 text-muted">Status: {{i['status']}} <div class="row">
<span class="dot dot-{{i['status']}}"></span> <div class="col-sm">
</h6> <small class="text-muted"><strong>STATUS</strong></small>
<h6 style="text-transform: uppercase;">{{i['status']}}<span class="dot dot-{{i['status']}}"></span></h6>
</div>
<div class="col-sm">
<small class="text-muted"><strong>PUBLIC KEY</strong></small>
<h6 style="text-transform: uppercase;"><samp>{{i['public_key']}}</samp></h6>
</div>
</div>
</div> </div>
</div> </div>
{%endfor%} {%endfor%}