This commit is contained in:
SiloDS
2021-07-30 13:27:35 +01:00
parent e362086ffe
commit ab9b2aa44b
3 changed files with 43 additions and 2 deletions

View File

@@ -4,14 +4,14 @@ from flask_login import current_user, login_required, login_user, logout_user
from app import app
from app.forms import LoginForm, WPAForm
from app.models import Passwords, User
from app.network_utils import scan_networks, connect_network, disconnect_network
from app.network_utils import scan_networks, connect_network, disconnect_network, vpn_connected, vpn_connect, vpn_disconnect
@app.route("/")
@app.route("/index")
@login_required
def index():
return render_template("index.html", networks=scan_networks())
return render_template("index.html", networks=scan_networks(), vpn=vpn_connected())
@app.route("/login", methods=["GET", "POST"])
@@ -69,3 +69,21 @@ def disconnect(ssid):
return render_template("message.html", message="Sucessfully disconnected from {}".format(ssid))
return render_template("message.html", message="Failt to disconnect from {}".format(ssid))
@app.route("/vpndconnect/", methods=["GET", "POST"])
@login_required
def vpnconnect():
if vpn_connect():
return render_template("message.html", message="Sucessfully Connected to VPN")
return render_template("message.html", message="Failed to Connect to VPN")
@app.route("/vpndisconnect/", methods=["GET", "POST"])
@login_required
def vpndisconnect():
if vpn_disconnect():
return render_template("message.html", message="Sucessfully disconnected from VPN")
return render_template("message.html", message="Failed to disconnect from VPN")