Added resources to the platform description, fixed link in querytable for the init_ke...
[myslice.git] / plugins / querytable / static / js / querytable.js
index 19ecd6c..15ee6f1 100644 (file)
                     else
                         line.push(record['hostname']);
 
                     else
                         line.push(record['hostname']);
 
-                } else if (colnames[j] == 'hrn' && typeof(record) != 'undefined') {
-                    line.push('<a href="../resource/'+record['urn']+'"><span class="glyphicon glyphicon-search"></span></a> '+record['hrn']);
+                } else if (colnames[j] == this.init_key && typeof(record) != 'undefined') {
+                    obj = this.object
+                    o = obj.split(':');
+                    if(o.length>1){
+                        obj = o[1];
+                    }else{
+                        obj = o[0];
+                    }
+                    /* XXX TODO: Remove this and have something consistant */
+                    if(obj=='resource'){
+                        line.push('<a href="../'+obj+'/'+record['urn']+'"><span class="glyphicon glyphicon-search"></span></a> '+record[this.init_key]);
+                    }else{
+                        line.push('<a href="../'+obj+'/'+record[this.init_key]+'"><span class="glyphicon glyphicon-search"></span></a> '+record[this.init_key]);
+                    }
                 } else {
                     if (record[colnames[j]])
                         line.push(record[colnames[j]]);
                 } else {
                     if (record[colnames[j]])
                         line.push(record[colnames[j]]);