Просмотр исходного кода

Closes #82, dashboard search/load now sorts in alfabetical order

Torkel Odegaard 12 лет назад
Родитель
Сommit
e574314472
2 измененных файлов с 3 добавлено и 11 удалено
  1. 0 10
      src/app/controllers/dashLoader.js
  2. 3 1
      src/app/controllers/search.js

+ 0 - 10
src/app/controllers/dashLoader.js

@@ -103,16 +103,6 @@ function (angular, _, moment) {
       );
     };
 
-    $scope.elasticsearch_dblist = function(query) {
-      dashboard.elasticsearch_list(query,$scope.loader.load_elasticsearch_size).then(
-        function(result) {
-        if(!_.isUndefined(result.hits)) {
-          $scope.hits = result.hits.total;
-          $scope.elasticsearch.dashboards = result.hits.hits;
-        }
-      });
-    };
-
     $scope.save_gist = function() {
       dashboard.save_gist($scope.gist.title).then(
         function(link) {

+ 3 - 1
src/app/controllers/search.js

@@ -47,7 +47,9 @@ function (angular, _, config, $) {
           return;
         }
 
-        $scope.search_results = { dashboards: results.hits.hits };
+        var hits = _.sortBy(results.hits.hits, '_id');
+
+        $scope.search_results = { dashboards: hits };
       });
     };