mirror of
https://github.com/donaldzou/WGDashboard
synced 2025-02-26 05:58:47 +00:00
Update dashboard.py
Minor issue
This commit is contained in:
parent
409e6d49b2
commit
2ed49abb1b
@ -467,6 +467,9 @@ class WireguardConfiguration:
|
|||||||
self.Name = name
|
self.Name = name
|
||||||
self.__configPath = os.path.join(DashboardConfig.GetConfig("Server", "wg_conf_path")[1], f'{self.Name}.conf')
|
self.__configPath = os.path.join(DashboardConfig.GetConfig("Server", "wg_conf_path")[1], f'{self.Name}.conf')
|
||||||
|
|
||||||
|
if not os.path.exists(os.path.join(DashboardConfig.GetConfig("Server", "wg_conf_path")[1], 'WGDashboard_Backup')):
|
||||||
|
os.mkdir(os.path.join(DashboardConfig.GetConfig("Server", "wg_conf_path")[1], 'WGDashboard_Backup'))
|
||||||
|
|
||||||
if name is not None:
|
if name is not None:
|
||||||
if data is not None and "Backup" in data.keys():
|
if data is not None and "Backup" in data.keys():
|
||||||
db = self.__importDatabase(
|
db = self.__importDatabase(
|
||||||
@ -480,8 +483,6 @@ class WireguardConfiguration:
|
|||||||
self.__parseConfigurationFile()
|
self.__parseConfigurationFile()
|
||||||
self.__initPeersList()
|
self.__initPeersList()
|
||||||
|
|
||||||
if not os.path.exists(os.path.join(DashboardConfig.GetConfig("Server", "wg_conf_path")[1], 'WGDashboard_Backup')):
|
|
||||||
os.mkdir(os.path.join(DashboardConfig.GetConfig("Server", "wg_conf_path")[1], 'WGDashboard_Backup'))
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self.Name = data["ConfigurationName"]
|
self.Name = data["ConfigurationName"]
|
||||||
@ -2434,8 +2435,7 @@ def API_traceroute_execute():
|
|||||||
data=json.dumps([x['ip'] for x in result]))
|
data=json.dumps([x['ip'] for x in result]))
|
||||||
d = r.json()
|
d = r.json()
|
||||||
for i in range(len(result)):
|
for i in range(len(result)):
|
||||||
result[i]['geo'] = d[i]
|
result[i]['geo'] = d[i]
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
return ResponseObject(data=result)
|
return ResponseObject(data=result)
|
||||||
|
Loading…
Reference in New Issue
Block a user