From 099a6e5cb3416642dc3ec6e369481bef8e537ca3 Mon Sep 17 00:00:00 2001 From: raluca-elena Date: Mon, 4 Aug 2014 22:06:31 -0700 Subject: [PATCH] workflow vers 1 --- directory_server/directory.js | 42 ++++++++++++++++++++++++ directory_server/index.html | 19 +++++++++++ directory_server/index.js | 27 +++++++--------- frontend/app.js | 1 + frontend/dir.js | 8 ++--- frontend/index.html | 13 ++++++-- frontend/registerTags.html | 60 ----------------------------------- slave/config.json | 3 +- slave/public/config.html | 25 +++++++-------- slave/server.js | 6 ++-- slave/speakerServer.js | 4 +-- 11 files changed, 106 insertions(+), 102 deletions(-) create mode 100644 directory_server/directory.js create mode 100644 directory_server/index.html delete mode 100644 frontend/registerTags.html diff --git a/directory_server/directory.js b/directory_server/directory.js new file mode 100644 index 0000000..e8a5982 --- /dev/null +++ b/directory_server/directory.js @@ -0,0 +1,42 @@ +var baseurl = "http://10.0.0.3:8080"; +var url = "10.0.0.3"; +$.ajax({"url":baseurl + "/lsall"}).done(function (data) { + var things = JSON.parse(data)["10.0.0.3"]; + console.log("THINGS: ", things); + + for (var key in things) { + var pl =JSON.parse(things[key].payload); + if (things.hasOwnProperty(key)) { + console.log("key is ", key); + constructButton(key, Object.keys(pl.features)); + } + } + + function constructButton(thingId, features) { + console.log("thingId: ", thingId); + + $(' - @@ -15,8 +14,16 @@ -
- +
+
+ +
+
diff --git a/frontend/registerTags.html b/frontend/registerTags.html deleted file mode 100644 index 0602d46..0000000 --- a/frontend/registerTags.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - -
UUIDFeatureTags
- - - \ No newline at end of file diff --git a/slave/config.json b/slave/config.json index adb0e53..28647c3 100755 --- a/slave/config.json +++ b/slave/config.json @@ -7,7 +7,8 @@ "features": { "factory-name-for-led1-C00FF33": {"url": "localhost:1234"}, "useless-device-MQYOK7N1WA*#22": {"url": "localhost:7777"}, - "raspberry-cam": {"url": "localhost:8090"} + "raspberry-cam": {"url": "localhost:8090"}, + "speaker": {"url":"localhost:3333"} } } diff --git a/slave/public/config.html b/slave/public/config.html index f6db8c0..ee9cfeb 100644 --- a/slave/public/config.html +++ b/slave/public/config.html @@ -7,15 +7,12 @@ - - - - - - - - -
FeatureTags
+ + + + + +
FeatureTags