Working
This commit is contained in:
4
Pipfile
4
Pipfile
@@ -9,10 +9,6 @@ flask_wtf = "*"
|
|||||||
flask-login = "*"
|
flask-login = "*"
|
||||||
flask-sqlalchemy = "*"
|
flask-sqlalchemy = "*"
|
||||||
flask-migrate = "*"
|
flask-migrate = "*"
|
||||||
flask_table = "*"
|
|
||||||
cffi = "*"
|
|
||||||
cryptography = "*"
|
|
||||||
pyopenssl = "*"
|
|
||||||
|
|
||||||
[dev-packages]
|
[dev-packages]
|
||||||
pylint = "*"
|
pylint = "*"
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
from flask_login import UserMixin
|
from flask_login import UserMixin
|
||||||
from flask_table import Col, Table, LinkCol
|
|
||||||
|
|
||||||
# from sqlalchemy.ext.declarative.api import instrument_declarative
|
# from sqlalchemy.ext.declarative.api import instrument_declarative
|
||||||
from werkzeug.security import check_password_hash, generate_password_hash
|
from werkzeug.security import check_password_hash, generate_password_hash
|
||||||
@@ -26,19 +25,3 @@ class User(UserMixin, db.Model):
|
|||||||
@login.user_loader
|
@login.user_loader
|
||||||
def load_user(id):
|
def load_user(id):
|
||||||
return User.query.get(int(id))
|
return User.query.get(int(id))
|
||||||
|
|
||||||
|
|
||||||
class Networks(Table):
|
|
||||||
ssid = Col("SSID")
|
|
||||||
signal = Col("Signal Strength")
|
|
||||||
inuse = Col("Connected")
|
|
||||||
security = Col("Security")
|
|
||||||
connect = LinkCol("Connect", "connect", url_kwargs=dict(ssid="ssid", security="security"))
|
|
||||||
|
|
||||||
|
|
||||||
class Network(object):
|
|
||||||
def __init__(self, ssid, signal, inuse, security):
|
|
||||||
self.ssid = ssid
|
|
||||||
self.signal = signal
|
|
||||||
self.inuse = inuse
|
|
||||||
self.security = security
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ from flask_login import current_user, login_required, login_user, logout_user
|
|||||||
|
|
||||||
from app import app
|
from app import app
|
||||||
from app.forms import LoginForm, WPAForm
|
from app.forms import LoginForm, WPAForm
|
||||||
from app.models import Network, Networks, User
|
from app.models import User
|
||||||
|
|
||||||
CMD_SCAN = "sudo nmcli -t -f SSID,SIGNAL,IN-USE,SECURITY -e yes -m tab device wifi list ifname wlxf81a6719febb --rescan yes"
|
CMD_SCAN = "sudo nmcli -t -f SSID,SIGNAL,IN-USE,SECURITY -e yes -m tab device wifi list ifname wlxf81a6719febb --rescan yes"
|
||||||
CMD_JOIN = "sudo nmcli device wifi connect *SSID* ifname wlxf81a6719febb"
|
CMD_JOIN = "sudo nmcli device wifi connect *SSID* ifname wlxf81a6719febb"
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="tg-0lax">SSID</th>
|
<th class="tg-0lax">SSID</th>
|
||||||
<th class="tg-0lax">Signle</th>
|
<th class="tg-0lax">Signal</th>
|
||||||
<th class="tg-0lax">Connected</th>
|
<th class="tg-0lax">Connected</th>
|
||||||
<th class="tg-0lax">Security</th>
|
<th class="tg-0lax">Security</th>
|
||||||
<th class="tg-0lax">Action</th>
|
<th class="tg-0lax">Action</th>
|
||||||
|
|||||||
Reference in New Issue
Block a user