Update dashboard.py

This commit is contained in:
Donald Zou 2025-04-24 18:22:15 +08:00
parent 6beddaebfd
commit dbbcfe957b

View File

@ -362,10 +362,10 @@ class WireguardConfiguration:
"PrivateKey": self.PrivateKey, "PrivateKey": self.PrivateKey,
"Address": self.Address, "Address": self.Address,
"ListenPort": self.ListenPort, "ListenPort": self.ListenPort,
"PreUp": f"{self.PreUp}", "PreUp": f"",
"PreDown": f"{self.PreDown}", "PreDown": f"",
"PostUp": f"{self.PostUp}", "PostUp": f"",
"PostDown": f"{self.PostDown}", "PostDown": f"",
"SaveConfig": "true" "SaveConfig": "true"
} }
@ -1047,7 +1047,7 @@ class WireguardConfiguration:
dataChanged = False dataChanged = False
with open(self.configPath, 'r') as f: with open(self.configPath, 'r') as f:
original = [l.rstrip("\n") for l in f.readlines()] original = [l.rstrip("\n") for l in f.readlines()]
allowEdit = ["Address", "PreUp", "PostUp", "PreDown", "PostDown", "ListenPort"] allowEdit = ["Address", "ListenPort"]
if self.Protocol == 'awg': if self.Protocol == 'awg':
allowEdit += ["Jc", "Jmin", "Jmax", "S1", "S2", "H1", "H2", "H3", "H4"] allowEdit += ["Jc", "Jmin", "Jmax", "S1", "S2", "H1", "H2", "H3", "H4"]
start = original.index("[Interface]") start = original.index("[Interface]")