diff --git a/public/js/app.js b/public/js/app.js index ba2cf1aa..6113e6af 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -1478,7 +1478,7 @@ angular.module('cerebro').controller('RestController', ['$scope', '$http', $scope.mappings = undefined; $scope.host = undefined; - $scope.method = 'POST'; + $scope.method = 'GET'; $scope.path = ''; $scope.options = []; @@ -1543,6 +1543,12 @@ angular.module('cerebro').controller('RestController', ['$scope', '$http', } }; + $scope.sendQuery = function(event) { + if (event.ctrlKey && (event.keyCode === 10 || event.keyCode === 13)) { + $scope.execute(); + } + }; + $scope.copyAsCURLCommand = function() { var method = $scope.method; var path = encodeURI($scope.path); diff --git a/public/rest/index.html b/public/rest/index.html index 7519838f..e6e2a7fd 100644 --- a/public/rest/index.html +++ b/public/rest/index.html @@ -27,15 +27,17 @@ placeholder="path (eg: indexName/_search)" ng-change="updateOptions(path)" typeahead-wait-ms="20" + + ng-keypress="sendQuery($event)" uib-typeahead="url for url in options | startsWith:$viewValue | limitTo:10" typeahead-popup-template-url="customPopupTemplate.html" typeahead-template-url="customTemplate.html">
@@ -62,7 +64,7 @@
-
+