mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-10-03 15:56:17 +00:00
Merge pull request #710 from reloadlife/feat/route-table
feat: Supporting "table" directive in the configuration
This commit is contained in:
@@ -945,7 +945,8 @@ class WireguardConfiguration:
|
||||
},
|
||||
"ConnectedPeers": len(list(filter(lambda x: x.status == "running", self.Peers))),
|
||||
"TotalPeers": len(self.Peers),
|
||||
"Protocol": self.Protocol
|
||||
"Protocol": self.Protocol,
|
||||
"Table": self.Table,
|
||||
}
|
||||
|
||||
def backupConfigurationFile(self) -> tuple[bool, dict[str, str]]:
|
||||
@@ -1047,7 +1048,7 @@ class WireguardConfiguration:
|
||||
dataChanged = False
|
||||
with open(self.configPath, 'r') as f:
|
||||
original = [l.rstrip("\n") for l in f.readlines()]
|
||||
allowEdit = ["Address", "PreUp", "PostUp", "PreDown", "PostDown", "ListenPort"]
|
||||
allowEdit = ["Address", "PreUp", "PostUp", "PreDown", "PostDown", "ListenPort", "Table"]
|
||||
if self.Protocol == 'awg':
|
||||
allowEdit += ["Jc", "Jmin", "Jmax", "S1", "S2", "H1", "H2", "H3", "H4"]
|
||||
start = original.index("[Interface]")
|
||||
@@ -3191,4 +3192,4 @@ def startThreads():
|
||||
|
||||
if __name__ == "__main__":
|
||||
startThreads()
|
||||
app.run(host=app_ip, debug=False, port=app_port)
|
||||
app.run(host=app_ip, debug=False, port=app_port)
|
||||
|
Reference in New Issue
Block a user