Compare commits
2 Commits
b9a599fc97
...
d3c0aba10a
Author | SHA1 | Date | |
---|---|---|---|
d3c0aba10a | |||
97fa628968 |
@ -7,7 +7,7 @@ db_file = db.json
|
|||||||
# List of people to be allowed, in .csv format (comma, no delimiters)
|
# List of people to be allowed, in .csv format (comma, no delimiters)
|
||||||
# Col1: First Name(s), Col2: Last Name(s), Col3 (optional): EMail
|
# Col1: First Name(s), Col2: Last Name(s), Col3 (optional): EMail
|
||||||
# Remove or leave empty for no check
|
# Remove or leave empty for no check
|
||||||
name_file = /root/namensliste.csv
|
name_file = namensliste.csv
|
||||||
|
|
||||||
|
|
||||||
# Username and password for data retrieval
|
# Username and password for data retrieval
|
||||||
|
@ -88,15 +88,11 @@
|
|||||||
function getParams() {
|
function getParams() {
|
||||||
var h = document.location.href
|
var h = document.location.href
|
||||||
var qparam = h.split('?')[1] || null
|
var qparam = h.split('?')[1] || null
|
||||||
if (qparam == null) {
|
if (qparam == null)
|
||||||
alert("Query parameter(s) missing")
|
|
||||||
return null
|
return null
|
||||||
}
|
|
||||||
var vals = qparam.split('=')
|
var vals = qparam.split('=')
|
||||||
if (vals.length < 2 || !cbt.hasOwnProperty(vals[0])) {
|
if (vals.length < 2 || !cbt.hasOwnProperty(vals[0]))
|
||||||
alert("Invalid query parameter")
|
|
||||||
return null
|
return null
|
||||||
}
|
|
||||||
return {
|
return {
|
||||||
action: vals[0],
|
action: vals[0],
|
||||||
room: vals[1]
|
room: vals[1]
|
||||||
@ -107,7 +103,10 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1><script>
|
<h1><script>
|
||||||
document.write(qp.action + "<br>Room " + qp.room)
|
if (qp)
|
||||||
|
document.write(qp.action + "<br>Room " + qp.room)
|
||||||
|
else
|
||||||
|
document.write('FTracker<br>V1')
|
||||||
</script></h1>
|
</script></h1>
|
||||||
<form id="mainform">
|
<form id="mainform">
|
||||||
<label>
|
<label>
|
||||||
@ -116,19 +115,39 @@
|
|||||||
</label>
|
</label>
|
||||||
<label id="agreelabel">
|
<label id="agreelabel">
|
||||||
<input type="checkbox" name="agree" id="agree" required>
|
<input type="checkbox" name="agree" id="agree" required>
|
||||||
<span><script>document.write(cbt[qp.action])</script></span>
|
<span><script>
|
||||||
|
document.write(qp ? cbt[qp.action] : '')
|
||||||
|
</script></span>
|
||||||
</label>
|
</label>
|
||||||
<input type="submit">
|
<input type="submit">
|
||||||
</form>
|
</form>
|
||||||
<script>
|
<script>
|
||||||
|
var mform = document.getElementById('mainform')
|
||||||
|
if (qp == null) {
|
||||||
|
mform.innerHTML = 'This is a web app to track which people\
|
||||||
|
were in the same rooms at which times in order to backtrace\
|
||||||
|
potential viral infections.<br><br>\
|
||||||
|
If you\'ve reached this page that either means your\'re\
|
||||||
|
testing things or something has gone quite wrong with the\
|
||||||
|
URL.<br>\
|
||||||
|
In the former case: Yay it works! In the latter you should\
|
||||||
|
probably contact an admin or a dev nearby :(<br><br>\
|
||||||
|
Here are a few links for testing:<br>\
|
||||||
|
<a href="/view">View Data</a>, \
|
||||||
|
<a href="/?arrival=42">Test Arrival</a>, \
|
||||||
|
<a href="/?departure=42">Test Departure</a><br><br>\
|
||||||
|
© 2020 made by <a target="_blank" href="mailto:o.winkels@fasttube.de">Oskar</a> \
|
||||||
|
for <a target="_blank" href="//fasttube.de">FaSTTUBe</a>. \
|
||||||
|
For source code & licensing see <a href="//git.fasttube.de/FaSTTUBe/ftracker">git repo</a>'
|
||||||
|
}
|
||||||
|
|
||||||
// Prefill the name field if it was successfully entered before
|
// Prefill the name field if it was successfully entered before
|
||||||
var savedName = localStorage.getItem('name')
|
var savedName = localStorage.getItem('name')
|
||||||
if (savedName)
|
if (savedName && qp)
|
||||||
document.getElementById('name').value = savedName
|
document.getElementById('name').value = savedName
|
||||||
|
|
||||||
// 2nd script, server API communication
|
// 2nd script, server API communication
|
||||||
var name, agreed
|
var name, agreed
|
||||||
var mform = document.getElementById('mainform')
|
|
||||||
mform.onsubmit = function(e) {
|
mform.onsubmit = function(e) {
|
||||||
|
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user