Compare commits

..

No commits in common. "37c8e13167bda158baa2039c5fd8eed1fedcd45a" and "35bb6dd5fc81327b5a8741ae98b1d263b3b8d37d" have entirely different histories.

6 changed files with 0 additions and 82 deletions

View File

@ -37,18 +37,3 @@ Go enjoy the dashboard @ *localhost:5000*
## The client
This is an example client and will also be used as first link in the machine.
### Requirements
A local http file server of some kind.
for ex the python http server.
### Running
Go into the correct directory with the code
cd watcher
with python's http server
python -m http.server

View File

@ -1,11 +0,0 @@
.input-group {
padding: 10px;
}
input {
padding: 5px;
}
label {
margin-right: 10px;
}

View File

@ -1,33 +0,0 @@
<html>
<head>
<link href="index.css" rel="stylesheet" />
<script src="index.js"></script>
</head>
<body>
<form name="link">
<div class="input-group">
<label for="url-field">Watch server url</label>
<input name="url-field" type="text" value="localhost:5000" required></input>
</div>
<div class="input-group">
<label for="run-field">Run id</label>
<input name="run-field" type="number" value="1" required></input>
</div>
<div class="input-group">
<label for="link-field"> Link id </label>
<input name="link-field" type="number" value="0" required></input>
</div>
<div class="input-group">
<input type="button" name="start" value="Start" onclick="call_backend()" />
<input type="button" name="handoff" value="Handoff" onclick="call_backend()" />
</div>
</form>
<p>Result: <span id="result" style="font-weight: bold;"></span></p>
</body>
</html>

View File

@ -1,20 +0,0 @@
let call_backend = function(e) {
type = event.target.getAttribute('name');
var url_base = document.forms["link"]["url-field"].value;
var run = document.forms["link"]["run-field"].value;
var link = document.forms["link"]["link-field"].value;
x = new XMLHttpRequest();
x.onreadystatechange = function() {
if (x.readyState === 4) {
console.log("response: " + x.responseText);
document.getElementById("result").innerHTML = x.responseText;
};
};
var url = "http://" + url_base + "/link/" + (type === "start" ? "start" : "handoff") + "/" + run + "/" + link;
// console.log(url);
x.open("GET", url, true);
x.send();
};

View File

@ -9,11 +9,9 @@ import matplotlib.pyplot as plt
import socketio
from apscheduler.schedulers.background import BackgroundScheduler
from flask import Flask, render_template, request
from flask_cors import CORS
sio = socketio.Server()
app = Flask(__name__)
cors = CORS(app)
app.wsgi_app = socketio.WSGIApp(sio, app.wsgi_app)
# We request users to send the run number to prevent accidentially getting old requests from a previous run

View File

@ -1,5 +1,4 @@
flask
flask-cors
python-socketio
apscheduler
matplotlib