Commit 3264f707 authored by Eryk Leniart's avatar Eryk Leniart
parents ce0b9320 918354da
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style>
body {
background: #FFFFFF;
font-size: 1rem;
font-family: "Open Sans","Arial","sans-serif";
color: #003f65;
width: 370px;
padding: 1px;
}
#main-box {
height: 100%;
width: 100%;
padding: 1px;
}
#left-side {
width: 100%;
height: 70%;
float: left;
padding: 1px;
}
#right-side {
width: 100%;
height: 30%;
float: right;
padding: 1px;
}
</style>
<body>
<div id="main-box">
</div>
<div id="left-side" style="float: center;">
Aktualny stan powietrza:
</div>
<div id="right-side">
<img src="http://www.free-icons-download.net/images/building-icons-68722.png" width="10%" height="10%">
<select id="select-station" style="float: right; display: center; font-weight: normal;">
<option value="1">ul. Bujaka</option>
<option value="2">ul. Bulwarowa</option>
<option value="3">ul. Złoty Róg</option>
<option value="4">Al. Krasińskiego</option>
<option value="5">os. Piastów</option>
<option value="6">ul. Dietla</option>
</select>
<div id="value-id" style="padding: center;font-size: 0.7rem">
µg/m³
</div>
</div>
</body>
</html>
<script>
function getParams() {
var vars = [];
if (window.location.href.indexOf('?') !== -1){
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&')
for (var i = 0; i < hashes.length; i++) {
var hash = hashes[i].split('=');
vars[hash[0]] = hash[1];
}
}
return vars;
}
document.addEventListener('DOMContentLoaded', function(){
var xhr = new XMLHttpRequest();
parameters = getParams();
console.debug(parameters);
xhr.onreadystatechange = function() {
if (xhr.readyState == XMLHttpRequest.DONE) {
console.debug(xhr);
document.getElementById('widget').innerHTML = xhr.response;
}
}
//xhr.open('GET', 'http://localhost:8090/view', true);
xhr.open('GET', 'http://smog.telemabk.pl/view', true);
xhr.send(null);
});
</script>
\ No newline at end of file
......@@ -61,6 +61,7 @@ class MainHandler(tornado.web.RequestHandler):
def make_app():
return tornado.web.Application([
(r"/view", MainHandler),
(r'/()', tornado.web.StaticFileHandler, {'path': 'index.html'})
])
if __name__ == "__main__":
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment