Skip to content

Commit

Permalink
Merge pull request jettro#13 from dnephin/master
Browse files Browse the repository at this point in the history
some style
  • Loading branch information
ENuge committed Jul 25, 2014
2 parents 54d0a19 + 139bea5 commit 9cd295f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
13 changes: 7 additions & 6 deletions js/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ function SearchCtrl($scope, $sce, $routeParams, $location, elastic, configuratio
$scope.currentPage = 1;
$scope.maxSize = 5;
$scope.numPages = 0;
$scope.pageSize = 100;
$scope.pageSize = 10;
$scope.totalItems = 0;

$scope.changePage = function () {
$scope.doSearch();
};

$scope.getDescription = function (response) {
return $sce.trustAsHtml(response.description);
return $sce.trustAsHtml(response.description.replace(/\\n/g, ' '));
};

$scope.init = function () {
Expand All @@ -102,7 +102,7 @@ function SearchCtrl($scope, $sce, $routeParams, $location, elastic, configuratio
$scope.restartSearch = function () {
$scope.currentPage = 1;
$scope.numPages = 0;
$scope.pageSize = 100;
$scope.pageSize = 10;
$scope.totalItems = 0;
$scope.tokensPerField = [];
$scope.doSearch();
Expand Down Expand Up @@ -154,7 +154,7 @@ function SearchCtrl($scope, $sce, $routeParams, $location, elastic, configuratio
$scope.metaResults.totalShards = results._shards.total;
angular.forEach(results.hits.hits, function (hit) {
if (hit.highlight) {
hit.description = hit.highlight.text.join('... ');
hit.description = hit.highlight.text.join(' ... ');
} else {
hit.description = hit._source.text;
}
Expand Down Expand Up @@ -567,6 +567,7 @@ function QueryCtrl($scope, $modal, elastic, aggregateBuilder, queryStorage) {
$scope.fields = [];
$scope.types = [];
$scope.createdQuery = "";
$scope.serverUrl = elastic.obtainServerAddress();

$scope.queryResults = [];
$scope.aggsResults = [];
Expand All @@ -583,7 +584,7 @@ function QueryCtrl($scope, $modal, elastic, aggregateBuilder, queryStorage) {
$scope.currentPage = 1;
$scope.maxSize = 5;
$scope.numPages = 0;
$scope.pageSize = 100;
$scope.pageSize = 10;
$scope.totalItems = 0;

$scope.$watchCollection('query', function () {
Expand All @@ -597,7 +598,7 @@ function QueryCtrl($scope, $modal, elastic, aggregateBuilder, queryStorage) {
$scope.restartSearch = function () {
$scope.currentPage = 1;
$scope.numPages = 0;
$scope.pageSize = 100;
$scope.pageSize = 10;
$scope.totalItems = 0;
$scope.executeQuery();
};
Expand Down
2 changes: 1 addition & 1 deletion partials/query.html
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ <h3 class="panel-title">Results</h3>
<div class="row" ng-click="doc.showDetails = !doc.showDetails" style="cursor:pointer;">
<div class="col-md-2">{{doc._index}}</div>
<div class="col-md-2">{{doc._type}}</div>
<div class="col-md-3">{{doc._id}}</div>
<div class="col-md-3"><a href="{{serverUrl}}/{{doc._index}}/{{doc._type}}/{{doc._id}}">{{doc._id}}</a></div>
<div class="col-md-1">{{doc._score}}</div>
<div class="col-md-2">{{doc._shard}}</div>
<div class="col-md-1">{{doc._node}}</div>
Expand Down
12 changes: 4 additions & 8 deletions partials/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@
<form class="form-inline">
<span>
<input class="form-control" type="search" ng-model="search.simple" autofocus="true"
placeholder=""/>
placeholder="Search"/>
</span>

<button class="btn btn-primary" ng-click="redirectSearch()"><span class="glyphicon glyphicon-search glyphicon-white"></span> Search</button>

<button class="btn btn-primary" ng-click="redirectSearch()">
<span class="glyphicon glyphicon-search glyphicon-white"></span> Search</button>

<select multiple class="form-control" ng-model="search.advanced.newSource"
ng-options="type for type in types">
<option value="">-- choose source --</option>
Expand Down Expand Up @@ -55,11 +56,6 @@
</div>
</form>
</div>

<div class="col-sm-2">
<button class="btn btn-sm btn-default pull-right" ng-click="loadQuery()"><span class="glyphicon glyphicon-download-alt"></span> load</button>
<button class="btn btn-sm btn-default pull-right" ng-click="saveQuery()"><span class="glyphicon glyphicon-share"></span> save</button>
</div>
</div>

<div class="row" ng-show="metaResults.failedShards">
Expand Down

0 comments on commit 9cd295f

Please sign in to comment.