fixed naming for facility_name and testbed_name in QueryTable plugin
[myslice.git] / plugins / querytable / static / js / querytable.js
index 15477a4..7ddf300 100644 (file)
@@ -12,7 +12,8 @@ QUERYTABLE_BGCOLOR_REMOVED = 2;
 
     
     var QUERYTABLE_MAP = {
-        'Testbed': 'network_hrn',
+        'Facility': 'facility_name',
+        'Testbed': 'testbed_name',
         'Resource name': 'hostname',
         'Type': 'type',
     };
@@ -97,7 +98,7 @@ QUERYTABLE_BGCOLOR_REMOVED = 2;
                 sPaginationType: 'bootstrap',
                 // Handle the null values & the error : Datatables warning Requested unknown parameter
                 // http://datatables.net/forums/discussion/5331/datatables-warning-...-requested-unknown-parameter/p2
-                aoColumnDefs: [{sDefaultContent: '',aTargets: [ '_all' ]}],
+                aoColumnDefs: [{sDefaultContent: '', aTargets: [ '_all' ]}],
                 // WARNING: this one causes tables in a 'tabs' that are not exposed at the time this is run to show up empty
                 // sScrollX: '100%',       /* Horizontal scrolling */
                 bProcessing: true,      /* Loading */
@@ -455,26 +456,26 @@ QUERYTABLE_BGCOLOR_REMOVED = 2;
 
             switch(data.state) {
                 case STATE_SET:
-                    switch(data.value) {
+                    switch(data.op) {
                         case STATE_SET_IN:
                         case STATE_SET_IN_SUCCESS:
                         case STATE_SET_OUT_FAILURE:
-                            this.set_checkbox_from_data(data.key, true);
-                            this.set_bgcolor(data.key, QUERYTABLE_BGCOLOR_RESET);
+                            this.set_checkbox_from_data(data.value, true);
+                            this.set_bgcolor(data.value, QUERYTABLE_BGCOLOR_RESET);
                             break;  
                         case STATE_SET_OUT:
                         case STATE_SET_OUT_SUCCESS:
                         case STATE_SET_IN_FAILURE:
-                            this.set_checkbox_from_data(data.key, false);
-                            this.set_bgcolor(data.key, QUERYTABLE_BGCOLOR_RESET);
+                            this.set_checkbox_from_data(data.value, false);
+                            this.set_bgcolor(data.value, QUERYTABLE_BGCOLOR_RESET);
                             break;
                         case STATE_SET_IN_PENDING:
                             this.set_checkbox_from_data(data.key, true);
-                            this.set_bgcolor(data.key, QUERYTABLE_BGCOLOR_ADDED);
+                            this.set_bgcolor(data.value, QUERYTABLE_BGCOLOR_ADDED);
                             break;  
                         case STATE_SET_OUT_PENDING:
                             this.set_checkbox_from_data(data.key, false);
-                            this.set_bgcolor(data.key, QUERYTABLE_BGCOLOR_REMOVED);
+                            this.set_bgcolor(data.value, QUERYTABLE_BGCOLOR_REMOVED);
                             break;
                     }
                     break;