From 318d76c089523373968d19af5604638afd8257df Mon Sep 17 00:00:00 2001 From: Elias Braun Date: Sat, 22 Jun 2024 09:02:05 +0000 Subject: [PATCH] fixed stopwatch --- README.md | 4 ++-- config/config.example.json | 5 +---- public/rowSite/script.js | 17 +++++++---------- 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index e88bed9..cc71ff6 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ services: networks: - showmaster-network volumes: - - ./data:/var/lib/postgresql/data + - ./data-db:/var/lib/postgresql/data pgadmin: image: dpage/pgadmin4:latest @@ -57,7 +57,7 @@ services: ports: - 8080:80 volumes: - - ./data:/var/lib/pgadmin/data + - ./data-pq:/var/lib/pgadmin/data networks: showmaster-network: diff --git a/config/config.example.json b/config/config.example.json index 7e1b4ee..b9d184a 100644 --- a/config/config.example.json +++ b/config/config.example.json @@ -10,8 +10,5 @@ "Website": { "Host": "0.0.0.0", "Port": 80 - }, - - // Corresponding to the tablename in the database - "Project": "yourproject" + } } \ No newline at end of file diff --git a/public/rowSite/script.js b/public/rowSite/script.js index f00556b..3b44498 100644 --- a/public/rowSite/script.js +++ b/public/rowSite/script.js @@ -23,13 +23,13 @@ document.addEventListener("DOMContentLoaded", () => { ws.onmessage = function(event) { console.log(event.data); const msgs = JSON.parse(event.data); - if (msgs === cleanURL+":refresh") { + if (msgs === cleanURL+':refresh') { fetchData(); - } else if (msgs === cleanURL+":reset") { + } else if (msgs === cleanURL+':reset') { resetStopwatch(); - } else if (msgs === cleanURL+":start") { + } else if (msgs === cleanURL+':start') { startStopwatch(); - } else if (msgs === cleanURL+":stop") { + } else if (msgs === cleanURL+':stop') { stopStopwatch(); onStopUpdate(); } @@ -114,8 +114,7 @@ document.addEventListener("DOMContentLoaded", () => { startPauseBtn.addEventListener("click", () => { if (running) { // To stop const data = { - RUNNING: false, - RESET: false, + 'update': 'stop' }; // Make the POST request @@ -141,8 +140,7 @@ document.addEventListener("DOMContentLoaded", () => { startPauseBtn.textContent = "Start"; } else { // To start const data = { - RUNNING: true, - RESET: false, + 'update': 'start' }; // Make the POST request @@ -171,8 +169,7 @@ document.addEventListener("DOMContentLoaded", () => { resetBtn.addEventListener("click", () => { const data = { - RUNNING: false, - RESET: true, + 'update': 'reset' }; // Make the POST request