From 30fe82725306bf48128abab7f0e862fb08a0199b Mon Sep 17 00:00:00 2001 From: Mohammad Mahdi Afshar Date: Thu, 24 Apr 2025 18:51:26 +0330 Subject: [PATCH] feat: Supporting "table" directive in the configuration --- src/dashboard.py | 7 ++++--- .../configurationComponents/editConfiguration.vue | 11 +++++++++++ src/static/app/src/views/newConfiguration.vue | 14 ++++++++++++++ src/static/locale/language_template.json | 1 + 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/src/dashboard.py b/src/dashboard.py index 91d9444..42c9c53 100644 --- a/src/dashboard.py +++ b/src/dashboard.py @@ -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) \ No newline at end of file + app.run(host=app_ip, debug=False, port=app_port) diff --git a/src/static/app/src/components/configurationComponents/editConfiguration.vue b/src/static/app/src/components/configurationComponents/editConfiguration.vue index e41e2f0..6ed3562 100644 --- a/src/static/app/src/components/configurationComponents/editConfiguration.vue +++ b/src/static/app/src/components/configurationComponents/editConfiguration.vue @@ -171,6 +171,17 @@ const deleteConfigurationModal = ref(false) id="configuration_listen_port"> +
+ + +
+
+
+ +
+
+ +
+
{{this.errorMessage}}
+
+
+

diff --git a/src/static/locale/language_template.json b/src/static/locale/language_template.json index b1839c9..c6442e4 100644 --- a/src/static/locale/language_template.json +++ b/src/static/locale/language_template.json @@ -59,6 +59,7 @@ "Turning Off\\.\\.\\.": "", "Address": "", "Listen Port": "", + "Table": "", "Public Key": "", "Connected Peers": "", "Total Usage": "",