diff --git a/client/bower.json b/client/bower.json index cc6e582..f656683 100644 --- a/client/bower.json +++ b/client/bower.json @@ -18,6 +18,8 @@ "zepto": "~1.1.3", "fontawesome": "~4.0.3", "angular-leaflet-directive": "~0.7.7", - "leaflet": "~0.7.2" + "leaflet": "~0.7.2", + "codemirror": "~3.19.0", + "angular-ui-codemirror": "~0.1.1" } } diff --git a/client/coffee/controllers/documentCtrl.coffee b/client/coffee/controllers/documentCtrl.coffee index eecea16..e440996 100644 --- a/client/coffee/controllers/documentCtrl.coffee +++ b/client/coffee/controllers/documentCtrl.coffee @@ -68,6 +68,12 @@ root.controllers.controller('documentCtrl', ['$scope', '$routeParams', '$http', $scope.idx = Number($routeParams.idx) or 1 $scope.meta = {} $scope.newQuery = $routeParams.query or "" + $scope.notfound = false + $scope.error = "" + $scope.codeMirrorOptions = + lineWrapping : true + lineNumbers: true + mode: 'text/typescript' url = "/api/#{ $routeParams.server }/#{ $routeParams.database }/#{ $routeParams.collection }" if $routeParams.query @@ -80,6 +86,11 @@ root.controllers.controller('documentCtrl', ['$scope', '$routeParams', '$http', $http.get(url).then((res) -> $scope.doc = res.data.document $scope.meta = res.data.meta + ).catch( (res) -> + if res.data.error == "not found" + $scope.notfound = true + else + $scope.error = res.data.error ) $scope.parseQueryToJSON = (query) -> diff --git a/client/coffee/vultureApp.coffee b/client/coffee/vultureApp.coffee index f7d02c2..ebeca96 100644 --- a/client/coffee/vultureApp.coffee +++ b/client/coffee/vultureApp.coffee @@ -3,6 +3,7 @@ root = this; angular.module('vulture', [ 'ngRoute' + 'ui.codemirror' 'leaflet-directive' 'vulture.filters' 'vulture.services' diff --git a/client/index.html b/client/index.html index 598a684..c0f86b2 100644 --- a/client/index.html +++ b/client/index.html @@ -11,6 +11,7 @@ + @@ -39,11 +40,15 @@
+ + + + diff --git a/client/partials/document.html b/client/partials/document.html index 8d6df95..d68728a 100644 --- a/client/partials/document.html +++ b/client/partials/document.html @@ -9,11 +9,25 @@ Query -