From 272ef33ceecce136d3f2faf39718be60bdb973fb Mon Sep 17 00:00:00 2001 From: Marcus Furlong Date: Tue, 1 Sep 2020 22:15:07 -0400 Subject: [PATCH] make maps height configurable --- openvpn-monitor.conf.example | 1 + openvpn-monitor.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/openvpn-monitor.conf.example b/openvpn-monitor.conf.example index f9d4e76..82f201b 100644 --- a/openvpn-monitor.conf.example +++ b/openvpn-monitor.conf.example @@ -4,6 +4,7 @@ site=Example #latitude=40.72 #longitude=-74 maps=True +maps_height=500 geoip_data=/var/lib/GeoIP/GeoLite2-City.mmdb datetime_format=%d/%m/%Y %H:%M:%S diff --git a/openvpn-monitor.py b/openvpn-monitor.py index 123a752..32d4b07 100755 --- a/openvpn-monitor.py +++ b/openvpn-monitor.py @@ -521,6 +521,10 @@ def init_vars(self, settings, monitor): self.maps = False if 'maps' in settings and settings['maps'] == 'True': self.maps = True + if 'maps_height' in settings: + self.maps_height = settings['maps_height'] + else: + self.maps_height = 500 self.latitude = 40.72 self.longitude = -74 @@ -800,7 +804,7 @@ def print_session_table(self, vpn_id, vpn_mode, sessions, show_disconnect): def print_maps_html(self): output('
') output('

Map View

') - output('
') + output('
'.format(self.maps_height)) output('