Skip to content

Commit

Permalink
fixed stopwatch
Browse files Browse the repository at this point in the history
  • Loading branch information
EliasB-NU committed Jun 22, 2024
1 parent 2527292 commit 318d76c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -57,7 +57,7 @@ services:
ports:
- 8080:80
volumes:
- ./data:/var/lib/pgadmin/data
- ./data-pq:/var/lib/pgadmin/data

networks:
showmaster-network:
Expand Down
5 changes: 1 addition & 4 deletions config/config.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,5 @@
"Website": {
"Host": "0.0.0.0",
"Port": 80
},

// Corresponding to the tablename in the database
"Project": "yourproject"
}
}
17 changes: 7 additions & 10 deletions public/rowSite/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -171,8 +169,7 @@ document.addEventListener("DOMContentLoaded", () => {

resetBtn.addEventListener("click", () => {
const data = {
RUNNING: false,
RESET: true,
'update': 'reset'
};

// Make the POST request
Expand Down

0 comments on commit 318d76c

Please sign in to comment.