senslabmap: clean code
[myslice.git] / plugins / senslabmap / static / js / senslabmap.js
index 3303c3a..2945e0d 100644 (file)
@@ -4,8 +4,10 @@
       this._super(options, element);
       
       this.elmt().on('show', this, this.on_show);
-      
+
+      var query = manifold.query_store.find_analyzed_query(options.query_uuid);
       this.method = query.object;
+      this.key = manifold.metadata.get_key(this.method);
       
       /* Setup query and record handlers */
       this.listen_query(options.query_uuid);
@@ -20,7 +22,7 @@
     },
     
     on_all_new_record: function(node) {
-      Senslab.normalize(node);
+      Senslab.normalize(node, this.key);
       if (node.normalized) {
         var site = node.site;
         if ($.inArray(site, this.sites) == -1) {
@@ -41,7 +43,7 @@
       Senslab.notify = function(node) {
         manifold.raise_event(self.options.query_uuid,
                              node.boot_state == "Alive" ? SET_REMOVED : SET_ADD,
-                             node.component_id
+                             node[self.key]
                             );
       }
     }