|
|
@ -1,3 +1,7 @@ |
|
|
|
<!-- |
|
|
|
#Authors: Oulis Evangelos, Oulis Nikolaos, Drosos Katsibras |
|
|
|
#=================================================================== |
|
|
|
--> |
|
|
|
<!DOCTYPE html> |
|
|
|
<html> |
|
|
|
<head> |
|
|
@ -7,9 +11,9 @@ |
|
|
|
</script> |
|
|
|
|
|
|
|
<script> |
|
|
|
function getParkingStatus() { |
|
|
|
function getParkingStatus(ip, port) { |
|
|
|
jQuery.ajax({ |
|
|
|
url: "http://192.168.1.13:8080/", |
|
|
|
url: "http://" + ip + ":" + port + "8080/", |
|
|
|
type: "GET", |
|
|
|
|
|
|
|
contentType: "application/json; charset=utf-8", |
|
|
@ -29,13 +33,40 @@ function getParkingStatus() { |
|
|
|
}); |
|
|
|
} |
|
|
|
$(document).ready(function(){ |
|
|
|
setInterval(getParkingStatus, 1000); |
|
|
|
$("#approve").click(function() { |
|
|
|
server_ip = $("#server_ip").val(); |
|
|
|
server_port = $("#server_port").val(); |
|
|
|
$("#msg").empty(); |
|
|
|
if (server_ip !== "" && server_ip !== null && server_port !== "" && server_port !== null) { |
|
|
|
$("#msg").html("<font color='red'>ok!</font>"); |
|
|
|
setInterval(getParkingStatus(server_ip, server_port), 1000); |
|
|
|
} else { |
|
|
|
$("#msg").html("<font color='red'>Something went wrong. Try again</font>"); |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
</script> |
|
|
|
</head> |
|
|
|
<body> |
|
|
|
|
|
|
|
<h1>Parking</h1> |
|
|
|
<h3>Server Settings</h3> |
|
|
|
<table> |
|
|
|
<tr> |
|
|
|
<td>Server IP:</td> |
|
|
|
<td><input type="text" id="server_ip" placeholder="xxx.xxx.xxx.xxx"/></td> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
|
<td>Server PORT:</td> |
|
|
|
<td><input type="text" id="server_port" placeholder="xxxx"/></td> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
|
<td><div id="msg"></div></td> |
|
|
|
<td><input type="button" id="approve" value="ok"/></td> |
|
|
|
</tr> |
|
|
|
</table> |
|
|
|
|
|
|
|
<h3>Parking Diagram</h3> |
|
|
|
<table width="100%"> |
|
|
|
<tr> |
|
|
|
<td id="park4" width="30%">No4<div id="4" class="full"></div></td> |
|
|
|