From 5c588ea01a08155fc20be5036010d922e59a64c2 Mon Sep 17 00:00:00 2001 From: Donald Cheng Hong Zou Date: Fri, 24 Dec 2021 00:20:44 -0500 Subject: [PATCH] Style adjustment Adjusted style and the status light: Added box-shadow and border for connected peer --- src/dashboard.py | 6 +---- src/static/css/dashboard.css | 50 +++++++++++++++++++++++++++++++++++- src/templates/get_conf.html | 34 ++++++++++++++---------- src/wgd.sh | 4 +-- 4 files changed, 73 insertions(+), 21 deletions(-) diff --git a/src/dashboard.py b/src/dashboard.py index 1d2b148..94cdd12 100644 --- a/src/dashboard.py +++ b/src/dashboard.py @@ -1122,9 +1122,7 @@ Dashboard Tools Related def get_ping_ip(): config = request.form['config'] sem.acquire() - - db = TinyDB('db/' + config_name + '.json') - + db = TinyDB('db/' + config + '.json') html = "" for i in db.all(): html += '' @@ -1158,8 +1156,6 @@ def ping_ip(): } if returnjson['package_loss'] == 1.0: returnjson['package_loss'] = returnjson['package_sent'] - - return jsonify(returnjson) except Exception: return "Error" diff --git a/src/static/css/dashboard.css b/src/static/css/dashboard.css index 80ed6ce..7f1ab27 100644 --- a/src/static/css/dashboard.css +++ b/src/static/css/dashboard.css @@ -117,22 +117,50 @@ body { .dot-running{ background-color: #28a745!important; + box-shadow: 0 0 0 0.2rem #28a74545; +} + +.h6-dot-running{ + margin-left: 0.3rem; } .dot-stopped{ background-color: #6c757d!important; } +.card-running{ + border-color: #28a745; +} .info h6{ line-break: anywhere; } +.info .row .col-sm{ + display: flex; + flex-direction: column; +} + +.info .row .col-sm small{ + display: flex; + +} + +.info .row .col-sm small strong:last-child(1){ + margin-left: auto !important; +} + .btn-control{ border: none !important; padding: 0 1rem 0 0; } +.btn-control:active, .btn-control:focus{ + background-color: transparent !important; + border: none !important; + box-shadow: none; +} + .share_peer_btn_group .btn-control{ padding: 0 0 0 1rem; } @@ -213,7 +241,7 @@ main{ bottom: 3rem; right: 2rem; z-index: 99; - border-radius: 100px; + border-radius: 100px !important; padding: 10px 20px; box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23); } @@ -274,4 +302,24 @@ main{ .key:hover{ color: #007bff; +} + +.card{ + border-radius: 10px; +} + +.peer_list .card .button-group{ + height: 22px; +} + +.form-control{ + border-radius: 10px; +} + +.btn{ + border-radius: 8px; +} + +.modal-content{ + border-radius: 10px; } \ No newline at end of file diff --git a/src/templates/get_conf.html b/src/templates/get_conf.html index 9581c5e..3e0adcd 100644 --- a/src/templates/get_conf.html +++ b/src/templates/get_conf.html @@ -109,7 +109,6 @@ Add Peer -
@@ -126,26 +125,35 @@ {% else %}
{% endif %} -
-
+
+{#
#} +{#
#} +{#
#} +{#
#} +{# {% if not i['name']%}#} +{# {{ "Untitled" }}#} +{# {% else %}#} +{# {{i['name']}}#} +{# {% endif %}#} +{#
#} +{#
#} +{#
#} +{#
#} +
-
-
+
+

{% if not i['name']%} {{ "Untitled" }} {% else %} {{i['name']}} {% endif %} -{# #} -

+
-
-
-
-
+
STATUS -
+
TRANSFER @@ -162,7 +170,7 @@ ALLOWED IP
{{i['allowed_ip']}}
-
+{#
#}
LATEST HANDSHAKE diff --git a/src/wgd.sh b/src/wgd.sh index a3636b0..eea9ece 100755 --- a/src/wgd.sh +++ b/src/wgd.sh @@ -33,9 +33,9 @@ _check_and_set_venv(){ install_wgd(){ # Check Python3 version - version_pass=$(python3 -c 'import sys; print("1") if (sys.version_info.major == 3 and sys.version_info.minor >= 7) else print("0");') + version_pass=$(python3 -c 'import sys; print("1") if (sys.version_info.major == 3 and sys.version_info.minor >= 8) else print("0");') if [ $version_pass == "0" ] - then printf "| WGDashboard required Python3.7+ |\n" + then printf "| WGDashboard required Python3.8+ |\n" printf "%s\n" "$dashes" exit 1 fi