add client ideas, add checks for data override
This commit is contained in:
parent
1af37a8d8a
commit
66848e0bf5
3 changed files with 23 additions and 4 deletions
8
client_ideas.md
Normal file
8
client_ideas.md
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
- morse sound + microfoon
|
||||||
|
- qr code -> 1 camera en een scherm
|
||||||
|
- file upload via tfp + file watcher
|
||||||
|
- ?? excel file ??
|
||||||
|
- simple http request or netcat
|
||||||
|
- licht sensor
|
||||||
|
- andere sensors (vochtigheid, ...)
|
||||||
|
|
|
@ -35,8 +35,12 @@ def link_start(run, index):
|
||||||
if db["current_run"] != run:
|
if db["current_run"] != run:
|
||||||
return "Wrong run number, you are probably behind.", 404
|
return "Wrong run number, you are probably behind.", 404
|
||||||
else:
|
else:
|
||||||
db["run_data"][run]["data"][index]["start"] = datetime.datetime.now()
|
link_data = db["run_data"][run]["data"][index]
|
||||||
return "Success."
|
if link_data["start"]:
|
||||||
|
return "you already started in this run. Ignoring this request."
|
||||||
|
else:
|
||||||
|
link_data["start"] = datetime.datetime.now()
|
||||||
|
return "Success."
|
||||||
|
|
||||||
|
|
||||||
@app.route("/link/handoff/<run>/<index>")
|
@app.route("/link/handoff/<run>/<index>")
|
||||||
|
@ -44,8 +48,12 @@ def link_handoff(run, index):
|
||||||
if db["current_run"] != run:
|
if db["current_run"] != run:
|
||||||
return "Wrong run number, you are probably behind.", 404
|
return "Wrong run number, you are probably behind.", 404
|
||||||
else:
|
else:
|
||||||
db["run_data"][run]["data"][index]["handoff"] = datetime.datetime.now()
|
link_data = db["run_data"][run]["data"][index]
|
||||||
return "Success."
|
if link_data["handoff"]:
|
||||||
|
return "you already handed off control during this run. Ignoring this request"
|
||||||
|
else:
|
||||||
|
link_data["handoff"] = datetime.datetime.now()
|
||||||
|
return "Success."
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
3
watcher/static/index.js
Normal file
3
watcher/static/index.js
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
const io = require('socket.io-client');
|
||||||
|
// or with import syntax
|
||||||
|
import io from 'socket.io-client';
|
Loading…
Reference in a new issue