diff --git a/src/dashboard.py b/src/dashboard.py index 53f268b0..df62fa50 100644 --- a/src/dashboard.py +++ b/src/dashboard.py @@ -1546,29 +1546,30 @@ def gunicornConfig(): return app_ip, app_port -def runGunicorn(): - sqldb = sqlite3.connect(os.path.join(CONFIGURATION_PATH, 'db', 'wgdashboard.db'), check_same_thread=False) - sqldb.row_factory = sqlite3.Row - cursor = sqldb.cursor() - _, app_ip = DashboardConfig.GetConfig("Server", "app_ip") - _, app_port = DashboardConfig.GetConfig("Server", "app_port") - WireguardConfigurations = _getConfigurationList() - bgThread = threading.Thread(target=backGroundThread) - bgThread.daemon = True - bgThread.start() - return app +# def runGunicorn(): +# sqldb = sqlite3.connect(os.path.join(CONFIGURATION_PATH, 'db', 'wgdashboard.db'), check_same_thread=False) +# sqldb.row_factory = sqlite3.Row +# cursor = sqldb.cursor() +# _, app_ip = DashboardConfig.GetConfig("Server", "app_ip") +# _, app_port = DashboardConfig.GetConfig("Server", "app_port") +# WireguardConfigurations = _getConfigurationList() +# bgThread = threading.Thread(target=backGroundThread) +# bgThread.daemon = True +# bgThread.start() +# return app +sqldb = sqlite3.connect(os.path.join(CONFIGURATION_PATH, 'db', 'wgdashboard.db'), check_same_thread=False) +sqldb.row_factory = sqlite3.Row +cursor = sqldb.cursor() +_, app_ip = DashboardConfig.GetConfig("Server", "app_ip") +_, app_port = DashboardConfig.GetConfig("Server", "app_port") +_, WG_CONF_PATH = DashboardConfig.GetConfig("Server", "wg_conf_path") +WireguardConfigurations = _getConfigurationList() +bgThread = threading.Thread(target=backGroundThread) +bgThread.daemon = True +bgThread.start() + if __name__ == "__main__": - sqldb = sqlite3.connect(os.path.join(CONFIGURATION_PATH, 'db', 'wgdashboard.db'), check_same_thread=False) - sqldb.row_factory = sqlite3.Row - cursor = sqldb.cursor() - _, app_ip = DashboardConfig.GetConfig("Server", "app_ip") - _, app_port = DashboardConfig.GetConfig("Server", "app_port") - _, WG_CONF_PATH = DashboardConfig.GetConfig("Server", "wg_conf_path") - WireguardConfigurations = _getConfigurationList() - bgThread = threading.Thread(target=backGroundThread) - bgThread.daemon = True - bgThread.start() - app.run(host=app_ip, debug=True, port=app_port) + diff --git a/src/gunicorn.conf.py b/src/gunicorn.conf.py index 5f18f8e1..a6277255 100644 --- a/src/gunicorn.conf.py +++ b/src/gunicorn.conf.py @@ -4,8 +4,8 @@ import dashboard app_host, app_port = dashboard.gunicornConfig() worker_class = 'gthread' -workers = multiprocessing.cpu_count() * 2 + 1 +workers = 4 threads = 2 bind = f"{app_host}:{app_port}" daemon = True -pidfile = './gunicorn.pid' +pidfile = './gunicorn.pid' \ No newline at end of file diff --git a/src/static/app/src/components/configurationComponents/peerJobs.vue b/src/static/app/src/components/configurationComponents/peerJobs.vue index 0d9d003d..812fef7a 100644 --- a/src/static/app/src/components/configurationComponents/peerJobs.vue +++ b/src/static/app/src/components/configurationComponents/peerJobs.vue @@ -16,19 +16,26 @@ export default { Field: [ { display: "Total Received", - value: "total_receive" + value: "total_receive", + unit: "GB", + type: 'number' }, { display: "Total Sent", - value: "total_sent" + value: "total_sent", + unit: "GB", + type: 'number' }, { display: "Total Data", - value: "total_data" + value: "total_data", + unit: "GB", + type: 'number' }, { display: "Date", - value: "date" + value: "date", + type: 'date' } ], Operator: [ @@ -62,8 +69,7 @@ export default { }, } - }, - + } } @@ -78,22 +84,15 @@ export default {