mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-10-03 07:46:18 +00:00
Update AmneziaWireguardConfiguration.py
This commit is contained in:
@@ -52,6 +52,7 @@ class AmneziaWireguardConfiguration(WireguardConfiguration):
|
||||
"ConnectedPeers": len(list(filter(lambda x: x.status == "running", self.Peers))),
|
||||
"TotalPeers": len(self.Peers),
|
||||
"Protocol": self.Protocol,
|
||||
"Table": self.Table,
|
||||
"Jc": self.Jc,
|
||||
"Jmin": self.Jmin,
|
||||
"Jmax": self.Jmax,
|
||||
@@ -227,20 +228,10 @@ class AmneziaWireguardConfiguration(WireguardConfiguration):
|
||||
"remote_endpoint": self.DashboardConfig.GetConfig("Peers", "remote_endpoint")[1],
|
||||
"preshared_key": i["PresharedKey"] if "PresharedKey" in i.keys() else ""
|
||||
}
|
||||
# sqlUpdate(
|
||||
# """
|
||||
# INSERT INTO '%s'
|
||||
# VALUES (:id, :private_key, :DNS, :advanced_security, :endpoint_allowed_ip, :name, :total_receive, :total_sent,
|
||||
# :total_data, :endpoint, :status, :latest_handshake, :allowed_ip, :cumu_receive, :cumu_sent,
|
||||
# :cumu_data, :mtu, :keepalive, :remote_endpoint, :preshared_key);
|
||||
# """ % self.Name
|
||||
# , newPeer)
|
||||
conn.execute(
|
||||
self.peersTable.insert().values(tempPeer)
|
||||
)
|
||||
else:
|
||||
# sqlUpdate("UPDATE '%s' SET allowed_ip = ? WHERE id = ?" % self.Name,
|
||||
# (i.get("AllowedIPs", "N/A"), i['PublicKey'],))
|
||||
conn.execute(
|
||||
self.peersTable.update().values({
|
||||
"allowed_ip": i.get("AllowedIPs", "N/A")
|
||||
|
Reference in New Issue
Block a user