updated map config

This commit is contained in:
casperlamboo 2015-07-16 13:55:13 +02:00
parent 5fcbc29ca6
commit 4b6ccdebed
4 changed files with 96 additions and 72 deletions

View File

@ -1,11 +1,14 @@
import $ from 'jquery';
import Doodle3DAPI from 'doodle3d-API';
import rest from 'rest-API';
var api = "http://connect.doodle3d.com/api/";
var known = [];
function addBox (boxData) {
if (know.indexOf(boxData.localip) === -1) {
known.push(boxData.localip);
var row = document.createElement('tr');
row.style.color = "gray";
@ -62,9 +65,11 @@ function addBox (boxData) {
}
};
doodle3DAPI.startUpdateLoop();
}
}
rest.get(api + "list.php", function (error, boxes) {
function searchBoxes () {
rest.get(api + "list.php", function (error, boxes) {
if (error) {
return;
console.warn(error);
@ -75,6 +80,15 @@ rest.get(api + "list.php", function (error, boxes) {
addBox(box);
}
});
}
setInterval(searchBoxes, 5000);
searchBoxes();
addBox({
localip: window.location.host + ":3000",
wifiboxid: "Node Server"
});
addBox({

View File

@ -12,6 +12,16 @@
"babel": "npm:babel-core@^5.1.13",
"babel-runtime": "npm:babel-runtime@^5.1.13",
"core-js": "npm:core-js@^0.9.4"
},
"map": {
"config-API": "src/configapi",
"info-API": "src/infoapi",
"network-API": "src/networkapi",
"printer-API": "src/printerapi",
"rest-API": "src/restapi",
"sketch-API": "src/sketchapi",
"system-API": "src/systemapi",
"update-API": "src/updateapi"
}
}
}