Fixed the results and query urls.
Change-Id: I9ef84b730875e968f6297c3225078bdc6e206b0b
diff --git a/client/query/query.js b/client/query/query.js
index f6b81ad..01b1fb2 100644
--- a/client/query/query.js
+++ b/client/query/query.js
@@ -1,7 +1,7 @@
//{@ @todo: this need to be configured before the document load
var catalog = "/catalog/myUniqueName";
var config = {
- host: "ndn-atmos.atmos.colostate.edu",
+ host: "atmos-csu.research-lan.colostate.edu",
port: 9696
};
@@ -55,17 +55,19 @@
this.resultTable.on('click', '.interest-button', function(){
var button = $(this);
+ if (button.is(':disabled')){
+ console.warn("Attempt to request again!");
+ }
+
var name = button.parent().prev().text();
var interest = new Interest(new Name('/retrieve' + name));
- scope.face.expressInterest(interest, function(){
- var message = $('<div class="success"><span class="glyphicon glyphicon-ok"></span> Success!</div>');
- message.insertAfter(button);
- message.fadeOut(5000);
- }, function(){
- var message = $('<div class="fail"><span class="glyphicon glyphicon-remove"></span> Failed!</div>');
- message.insertAfter(button);
- message.fadeOut(5000);
- });
+ scope.face.expressInterest(interest, function(){}, function(){});
+
+ button.text("Requested!")
+ .removeClass('btn-primary')
+ .addClass('btn-default')
+ .addClass('disabled')
+ .prop('disabled', true);
});
@@ -113,7 +115,9 @@
var scope = this;
- $.each(this.queryResults, function (queryResult, field) {
+ //TODO Fix paging.
+
+ $.each(queryResults, function (queryResult, field) {
if (queryResult == "next") {
scope.populateAutocomplete(field);
@@ -284,8 +288,8 @@
for (var i = startIndex; i < startIndex + 20 && i < this.results.length; ++i) {
- resultTable.append('<tr><td>' + this.results[i]
- + '</td><td><button class="interest-button btn btn-default btn-xs">Retrieve</button></td></tr>');
+ this.resultTable.append('<tr><td>' + this.results[i]
+ + '</td><td><button class="interest-button btn btn-primary btn-xs">Retrieve</button></td></tr>');
}
if (this.results.length <= 20) {
@@ -318,7 +322,7 @@
currentPage.append(' ' + i);
}
} else { // Need to skip ahead
- if (i == page + 6) {
+ if (i == this.page + 6) {
currentPage.append(' ... ');
currentPage.append(' <a href="#" onclick="getPage(this.id);" id=">">></a>')
@@ -420,7 +424,7 @@
/**
* Adds a filter to the list of filters.
- * There is no need to remove the filter, it is done via ui clicks.
+ * If a filter is already added, it will be removed instead.
*
* @param {string} filter
*/
@@ -457,6 +461,7 @@
return prev;
}, {});
console.log('Collected filters:', filters);
+ var scope = this;
this.query(this.catalog, filters, function(data){
scope.onData(data);
}, 1);