Search: disabling UI on disconnect

This commit is contained in:
Alexander Bezzubov 2015-11-19 19:44:58 +09:00
parent 78802372e1
commit 3900b60c76
3 changed files with 5 additions and 4 deletions

View file

@ -388,13 +388,14 @@ public class NotebookRestApi {
}
/**
* Search for a Note
* Search for a Notes
*/
@GET
@Path("search")
public Response search(@QueryParam("q") String query) {
logger.info("Searching notebooks for {}", query);
Map<String, String> notebooksFound = searchNotebooks(query);
logger.info("Notbooks {} found", notebooksFound.size());
return new JsonResponse<>(Status.OK, notebooksFound).build();
}

View file

@ -50,10 +50,10 @@ limitations under the License.
ng-submit="search()">
<div class="form-group">
<input type="text" ng-model="searchTerm"
<input type="text" ng-model="searchTerm" ng-disabled="!navbar.connected"
class="form-control" placeholder="Search your notebooks">
</div>
<button type="submit" class="btn btn-default">
<button type="submit" class="btn btn-default" ng-disabled="!navbar.connected">
Search
</button>
</form>

View file

@ -24,7 +24,7 @@ angular.module('zeppelinWebApp').service('searchService', function($http, baseUr
$http
.get(baseUrlSrv.getRestApiBase() + '/notebook/search?q=' + encQuery)
.then(function successCallback(response) {
console.log('Found: %o', response);
console.log('Found: %o', response.data.body);
//TODO(bzz): navigate to SearchResult page/controller
}, function errorCallback(response) {
console.log('Error: %o', response);