many improvments

This commit is contained in:
didier.amyot committed 2014-07-03 09:41:25 -04:00
1 parent 0e3fcb0cc2
commit 759aecd425
14 files changed
+92 -32

No files matched your search

@@ -49,6 +49,7 @@ root.controllers.controller('geojsonmapCtrl', ['$scope', '$routeParams', '$locat
$scope.geojsonData = {}
$scope.idx = Number($routeParams.idx)
$scope.center = getLocalStorageCenter()
$scope.queryObject = $routeParams.query or "{}"
$scope.$watch 'center', () ->
localStorage.setItem("mapCenter", JSON.stringify($scope.center))
@@ -113,5 +114,11 @@ root.controllers.controller('geojsonmapCtrl', ['$scope', '$routeParams', '$locat
else
$scope.mode = 'all'
$scope.initAllDocuments()
$scope.changeQuery = (query) ->
if query == ""
return ""
r = $routeParams
$location.path "/#{ r.server }/#{ r.database }/#{ r.collection }/idx/1/query/#{query}/geojson/#{r.key}"
])
+10 -3
View File
@@ -19,11 +19,12 @@ findHistogramMax = (stats) ->
getAxisLabel = (min, stepSize, numberOfBins) ->
return (min + 0.5 * stepSize + i * stepSize for i in [0... numberOfBins])
root.controllers.controller('keyStatCtrl', ['$scope', '$routeParams', 'util', ($scope, $routeParams, util) ->
root.controllers.controller('keyStatCtrl', ['$scope', '$routeParams', '$location', 'util', ($scope, $routeParams, $location, util) ->
$scope.name = $routeParams.key
$scope.stats = []
base_url = "/api/#{ $routeParams.server }/#{ $routeParams.database }/#{ $routeParams.collection }"
$scope.queryObject = $routeParams.query or '{}'
base_url = "/api/#{ $routeParams.server }/#{ $routeParams.database }/#{ $routeParams.collection }/query/#{$scope.queryObject}"
stat_url = "#{ base_url }/stats/#{$routeParams.key}"
$scope.alert=alert
@@ -47,6 +48,12 @@ root.controllers.controller('keyStatCtrl', ['$scope', '$routeParams', 'util', ($
name: $routeParams.key
color: '#008CBA'
}]
$scope.changeQuery = (query) ->
if query == ""
return ""
r = $routeParams
$location.path "/#{ r.server }/#{ r.database }/#{ r.collection }/stats/#{ r.key }/query/#{query}"
util.get(stat_url).then((res) ->