This commit is contained in:
Rich
2021-07-10 09:24:42 +01:00
parent 3087e564bc
commit 60fac4f814
4 changed files with 2 additions and 23 deletions

View File

@@ -1,5 +1,4 @@
from flask_login import UserMixin
from flask_table import Col, Table, LinkCol
# from sqlalchemy.ext.declarative.api import instrument_declarative
from werkzeug.security import check_password_hash, generate_password_hash
@@ -26,19 +25,3 @@ class User(UserMixin, db.Model):
@login.user_loader
def load_user(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

View File

@@ -6,7 +6,7 @@ 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 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_JOIN = "sudo nmcli device wifi connect *SSID* ifname wlxf81a6719febb"

View File

@@ -6,7 +6,7 @@
<thead>
<tr>
<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">Security</th>
<th class="tg-0lax">Action</th>