fixed make file and added an example database
This commit is contained in:
1 parent
32c9730321
commit
4ad71dd240
8 files changed
+61
-75
No files matched your search
@@ -7,6 +7,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
"gopkg.in/mgo.v2"
|
"gopkg.in/mgo.v2"
|
||||||
@@ -63,9 +64,10 @@ func (this *VultureBackend) GetDataBases() ([]string, error) {
|
|||||||
dbs, err := this.Client.DatabaseNames()
|
dbs, err := this.Client.DatabaseNames()
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return dbs, nil
|
return dbs, nil
|
||||||
} else if err.Error() == "unauthorized" {
|
} else if strings.Contains(err.Error(), "authorized") {
|
||||||
return this.getDatabaseFromMongoURL()
|
return this.getDatabaseFromMongoURL()
|
||||||
} else {
|
} else {
|
||||||
|
fmt.Println(">>> ", err.Error())
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,57 +0,0 @@
|
|||||||
module.exports = (grunt) ->
|
|
||||||
|
|
||||||
# Project configuration.
|
|
||||||
grunt.initConfig(
|
|
||||||
packagekg: grunt.file.readJSON('package.json')
|
|
||||||
bower:
|
|
||||||
install:{}
|
|
||||||
shell:
|
|
||||||
bower:
|
|
||||||
command: "node_modules/.bin/bower install"
|
|
||||||
connect:
|
|
||||||
server:
|
|
||||||
options:
|
|
||||||
port: 4506
|
|
||||||
base: '.'
|
|
||||||
keepalive: true
|
|
||||||
|
|
||||||
clean:
|
|
||||||
compiledFiles: ["js"]
|
|
||||||
prod: [
|
|
||||||
"node_modules",
|
|
||||||
"bower_components/fontawesome/src",
|
|
||||||
]
|
|
||||||
|
|
||||||
coffee:
|
|
||||||
compile:
|
|
||||||
expand: true
|
|
||||||
cwd: 'coffee'
|
|
||||||
src: ['**/*.coffee']
|
|
||||||
dest: 'js'
|
|
||||||
ext: '.js'
|
|
||||||
|
|
||||||
watch:
|
|
||||||
coffee:
|
|
||||||
files: ['**/*.coffee']
|
|
||||||
tasks: ['coffee']
|
|
||||||
options:
|
|
||||||
spawn: false
|
|
||||||
|
|
||||||
concurrent:
|
|
||||||
target: ['watch', 'connect'],
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
# Plugins
|
|
||||||
grunt.loadNpmTasks('grunt-bower-task')
|
|
||||||
grunt.loadNpmTasks('grunt-contrib-connect')
|
|
||||||
grunt.loadNpmTasks('grunt-contrib-coffee')
|
|
||||||
grunt.loadNpmTasks('grunt-contrib-watch')
|
|
||||||
grunt.loadNpmTasks('grunt-concurrent')
|
|
||||||
grunt.loadNpmTasks('grunt-contrib-clean')
|
|
||||||
grunt.loadNpmTasks('grunt-shell')
|
|
||||||
|
|
||||||
# tasks
|
|
||||||
grunt.registerTask('default', ['bower', 'clean:compiledFiles', 'coffee:compile'])
|
|
||||||
grunt.registerTask('prod', ['shell:bower', 'clean:compiledFiles', 'coffee:compile', 'clean:prod'])
|
|
||||||
grunt.registerTask('dev', ['default', 'concurrent:target'])
|
|
||||||
+4
-1
@@ -11,7 +11,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"underscore": "~1.6.0",
|
"underscore": "~1.6.0",
|
||||||
"foundation": "~5.2.1",
|
"foundation": "~5.2.1",
|
||||||
"angular": "~1.2.14",
|
"angular": "1.3.x",
|
||||||
"angular-route": "~1.2.14",
|
"angular-route": "~1.2.14",
|
||||||
"angular-local-storage": "~0.0.1",
|
"angular-local-storage": "~0.0.1",
|
||||||
"qunit": "~1.14.0",
|
"qunit": "~1.14.0",
|
||||||
@@ -25,5 +25,8 @@
|
|||||||
"angular-spinner": "~0.4.0",
|
"angular-spinner": "~0.4.0",
|
||||||
"highcharts-ng": "~0.0.6",
|
"highcharts-ng": "~0.0.6",
|
||||||
"highcharts": "~3.0.7"
|
"highcharts": "~3.0.7"
|
||||||
|
},
|
||||||
|
"resolutions": {
|
||||||
|
"angular": "1.3.x"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
var bower = require('gulp-bower');
|
||||||
|
var gulp = require('gulp');
|
||||||
|
var coffee = require('gulp-coffee');
|
||||||
|
var help = require('gulp-task-listing');
|
||||||
|
var clean = require('gulp-clean');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
gulp.task('help', help);
|
||||||
|
|
||||||
|
gulp.task('bower', function() {
|
||||||
|
return bower()
|
||||||
|
.pipe(gulp.dest('bower_components/'))
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('coffee', function() {
|
||||||
|
gulp.src('coffee/**/*.coffee')
|
||||||
|
.pipe(coffee({bare: true}))
|
||||||
|
.pipe(gulp.dest('./js/'))
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('clean', function(){
|
||||||
|
return gulp.src(["js/", "bower_components/"], {read: false})
|
||||||
|
.pipe(clean())
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
gulp.task('default', ['bower', 'coffee']);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
gulp.task('dev', ['bower', 'coffee'], function(){
|
||||||
|
gulp.watch('coffee/**/*.coffee', ['coffee']);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
+2
-2
@@ -10,7 +10,7 @@
|
|||||||
<link rel="stylesheet" href="bower_components/foundation/css/foundation.css">
|
<link rel="stylesheet" href="bower_components/foundation/css/foundation.css">
|
||||||
<link rel="stylesheet" href="bower_components/foundation/css/normalize.css">
|
<link rel="stylesheet" href="bower_components/foundation/css/normalize.css">
|
||||||
<link rel="stylesheet" href="bower_components/fontawesome/css/font-awesome.min.css">
|
<link rel="stylesheet" href="bower_components/fontawesome/css/font-awesome.min.css">
|
||||||
<link rel="stylesheet" href="bower_components/leaflet-dist/leaflet.css">
|
<link rel="stylesheet" href="bower_components/leaflet/dist/leaflet.css">
|
||||||
<link rel="stylesheet" type="text/css" href="bower_components/codemirror/lib/codemirror.css">
|
<link rel="stylesheet" type="text/css" href="bower_components/codemirror/lib/codemirror.css">
|
||||||
|
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
<div ng-view></div>
|
<div ng-view></div>
|
||||||
|
|
||||||
<script src="bower_components/leaflet-dist/leaflet.js"></script>
|
<script src="bower_components/leaflet/dist/leaflet.js"></script>
|
||||||
<script type="text/javascript" src="bower_components/codemirror/lib/codemirror.js"></script>
|
<script type="text/javascript" src="bower_components/codemirror/lib/codemirror.js"></script>
|
||||||
<script type="text/javascript" src="bower_components/codemirror/mode/javascript/javascript.js"></script>
|
<script type="text/javascript" src="bower_components/codemirror/mode/javascript/javascript.js"></script>
|
||||||
<script src="bower_components/underscore/underscore.js"></script>
|
<script src="bower_components/underscore/underscore.js"></script>
|
||||||
|
|||||||
+6
-10
@@ -1,13 +1,9 @@
|
|||||||
{
|
{
|
||||||
"devDependencies": {
|
"dependencies": {
|
||||||
"grunt": "^0.4.4",
|
"gulp-task-listing": "~0.3.0",
|
||||||
"grunt-contrib-connect": "^0.7.1",
|
"gulp-clean": "~0.3.1",
|
||||||
"grunt-contrib-coffee": "^0.10.1",
|
"gulp-coffee": "~2.2.0",
|
||||||
"grunt-contrib-watch": "^0.6.1",
|
"gulp": "~3.8.9",
|
||||||
"grunt-concurrent": "^0.5.0",
|
"gulp-bower": "0.0.7"
|
||||||
"grunt-contrib-clean": "^0.5.0",
|
|
||||||
"bower": "~1.3.0",
|
|
||||||
"grunt-bower-task": "^0.3.4",
|
|
||||||
"grunt-shell": "~0.7.0"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,13 +1,15 @@
|
|||||||
prod:
|
prod:
|
||||||
cd client; npm install
|
cd client; npm install
|
||||||
cd client; grunt prod
|
cd client; node_modules/.bin/gulp
|
||||||
goxc
|
goxc
|
||||||
cd client; npm install
|
|
||||||
cd client; grunt
|
|
||||||
|
|
||||||
dev:
|
dev:
|
||||||
go get
|
go get
|
||||||
go test
|
go test
|
||||||
go build
|
go build
|
||||||
cd client; npm install
|
cd client; npm install
|
||||||
cd client; grunt
|
cd client; node_modules/.bin/gulp
|
||||||
|
|
||||||
|
clean:
|
||||||
|
cd client; node_modules/.bin/gulp clean
|
||||||
|
rm -rf client/node_modules
|
||||||
@@ -18,3 +18,7 @@ MongoServers:
|
|||||||
-
|
-
|
||||||
name: localhost
|
name: localhost
|
||||||
url: localhost:27017
|
url: localhost:27017
|
||||||
|
|
||||||
|
-
|
||||||
|
name: vulture example
|
||||||
|
url: mongodb://vulture:vulture_example@ds047800.mongolab.com:47800/vulture_example
|
||||||
Reference in new issue
Block a user