mirror of
https://github.com/Doodle3D/Doodle3D-API
synced 2025-01-03 10:03:48 +01:00
updated map config
This commit is contained in:
parent
5fcbc29ca6
commit
4b6ccdebed
@ -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({
|
||||
|
10
package.json
10
package.json
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user