From ee0e95cfd02bc1d1a622ee33d02e117a776a4666 Mon Sep 17 00:00:00 2001 From: cubernetes Date: Fri, 14 Apr 2023 08:49:49 +0200 Subject: [PATCH] Fix error to break the counter --- webserver/main.py | 3 +-- webserver/templates/main/dashboard_main1.html | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/webserver/main.py b/webserver/main.py index 5cc892a..93d6386 100755 --- a/webserver/main.py +++ b/webserver/main.py @@ -245,7 +245,6 @@ def cpdashy_startsim(): f.write(str(int(time.time()))) with open('./database/temp/sim_running.txt', 'w') as f: f.write('True') - else: clear_session_full() with open('./database/temp/sim_start.txt', 'w') as f: @@ -294,7 +293,7 @@ def api_red_logs(): temp_json_n['data'] = remote_addr + ': ' + temp_json_n['data'] if STARTED: - if temp_json_n['data'].lower() == 'start of attack': + if 'start of attack' in temp_json_n['data'].lower(): with open('./database/temp/attack_start.txt', 'w') as f: f.write(str(temp_json_n['timestamp'])) diff --git a/webserver/templates/main/dashboard_main1.html b/webserver/templates/main/dashboard_main1.html index 76ca2b2..52d1f71 100644 --- a/webserver/templates/main/dashboard_main1.html +++ b/webserver/templates/main/dashboard_main1.html @@ -1609,7 +1609,7 @@ const iid = setInterval(() => { let start = parseInt(document.getElementById("simstart").getAttribute("data-start")); let end = ~~(Date.now()/1e3); - if (start === -1 || document.getElementById('start_stop_sim_btn').innerHTML === 'Start Simulation' || document.getElementById("attackstart").getAttribute("data-start") === "-1") { + if (start === -1 || document.getElementById('start_stop_sim_btn').innerHTML === 'Start Simulation') { document.getElementById("simstart").innerHTML = "0"; } else { document.getElementById("simstart").innerHTML = end - start;