This commit is contained in:
Rich
2021-08-05 16:54:25 +01:00
parent 34464fd461
commit 9933954deb
3 changed files with 65 additions and 10 deletions

View File

@@ -4,14 +4,24 @@ 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 ConfigTable, Passwords, User
from app.network_utils import connect_network, disconnect_network, scan_networks, vpn_connect, vpn_connected, vpn_disconnect
from app.network_utils import (
connect_network,
disconnect_network,
killswich_disaable,
killswich_enable,
killswitch_status,
scan_networks,
vpn_connect,
vpn_connected,
vpn_disconnect,
)
@app.route("/")
@app.route("/index")
@login_required
def index():
return render_template("index.html", networks=scan_networks(), vpn=vpn_connected())
return render_template("index.html", networks=scan_networks(), vpn=vpn_connected(), killswitch=killswitch_status())
@app.route("/login", methods=["GET", "POST"])
@@ -87,3 +97,21 @@ def vpndisconnect():
return render_template("message.html", message="Sucessfully disconnected from VPN")
return render_template("message.html", message="Failed to disconnect from VPN")
@app.route("/ksenable/", methods=["GET", "POST"])
@login_required
def ksenable():
if killswich_enable():
return render_template("message.html", message="Sucessfully Enabled KillSwitch")
return render_template("message.html", message="Failed to Enable KillSwitch")
@app.route("/ksdisable/", methods=["GET", "POST"])
@login_required
def ksdisable():
if killswich_disaable():
return render_template("message.html", message="Sucessfully Disabled KillSwitch")
return render_template("message.html", message="Failed to Disable KillSwitch")