diff --git a/.jshintrc b/.jshintrc deleted file mode 100644 index e8f044e1da9..00000000000 --- a/.jshintrc +++ /dev/null @@ -1,35 +0,0 @@ -{ - "browser": true, - - "bitwise":false, - "curly": true, - "eqnull": true, - "globalstrict": true, - "devel": true, - "eqeqeq": true, - "forin": false, - "immed": true, - "supernew": true, - "expr": true, - "indent": 2, - "latedef": true, - "newcap": true, - "noarg": true, - "noempty": true, - "undef": true, - "boss": true, - "trailing": true, - "laxbreak": true, - "laxcomma": true, - "sub": true, - "unused": true, - "maxdepth": 5, - "maxlen": 140, - - "globals": { - "define": true, - "require": true, - "Chromath": false, - "setImmediate": true - } -} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0ce3be24b19..00000000000 --- a/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - "0.10" -before_script: - - npm install -g grunt-cli \ No newline at end of file diff --git a/Gruntfile.js b/Gruntfile.js deleted file mode 100644 index 2a16428867d..00000000000 --- a/Gruntfile.js +++ /dev/null @@ -1,38 +0,0 @@ -/* jshint node:true */ -'use strict'; -module.exports = function (grunt) { - - var config = { - pkg: grunt.file.readJSON('package.json'), - baseDir: '.', - srcDir: 'public', - destDir: 'dist', - tempDir: 'tmp', - docsDir: 'docs/' - }; - - // load plugins - require('load-grunt-tasks')(grunt); - - // load task definitions - grunt.loadTasks('tasks'); - - // Utility function to load plugin settings into config - function loadConfig(config,path) { - require('glob').sync('*', {cwd: path}).forEach(function(option) { - var key = option.replace(/\.js$/,''); - // If key already exists, extend it. It is your responsibility to avoid naming collisions - config[key] = config[key] || {}; - grunt.util._.extend(config[key], require(path + option)(config,grunt)); - }); - // technically not required - return config; - } - - // Merge that object with what with whatever we have here - loadConfig(config,'./tasks/options/'); - - // pass the config to grunt - grunt.initConfig(config); - -}; \ No newline at end of file diff --git a/grafana b/grafana index 1bc277fd874..8699dec5716 160000 --- a/grafana +++ b/grafana @@ -1 +1 @@ -Subproject commit 1bc277fd87469b1deb0e1b1571d7010f0f396d5a +Subproject commit 8699dec57162ed419da47e7206ea58f8ec3250a3 diff --git a/grafana-pro.sublime-project b/grafana-pro.sublime-project deleted file mode 100644 index c5bb4a23c20..00000000000 --- a/grafana-pro.sublime-project +++ /dev/null @@ -1,18 +0,0 @@ -{ - "folders": - [ - { - "follow_symlinks": true, - "path": ".", - "folder_exclude_patterns": [ - "node_modules", - "grafana" - ] - } - ], - "settings": - { - "tab_size": 2, - "trim_trailing_white_space_on_save": true - } -} diff --git a/package.json b/package.json deleted file mode 100644 index e95428e903e..00000000000 --- a/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "author": { - "name": "Torkel Ödegaard", - "company": "Coding Instinct AB" - }, - "name": "grafana", - "version": "1.7.0-rc1", - "repository": { - "type": "git", - "url": "http://github.com/torkelo/grafana.git" - }, - "devDependencies": { - "expect.js": "~0.2.0", - "glob": "~3.2.7", - "grunt": "~0.4.0", - "grunt-angular-templates": "^0.5.5", - "grunt-cli": "~0.1.13", - "grunt-contrib-clean": "~0.5.0", - "grunt-contrib-compress": "~0.5.2", - "grunt-contrib-concat": "^0.4.0", - "grunt-contrib-connect": "~0.5.0", - "grunt-contrib-copy": "~0.5.0", - "grunt-contrib-cssmin": "~0.6.1", - "grunt-contrib-htmlmin": "~0.1.3", - "grunt-contrib-jshint": "~0.10.0", - "grunt-contrib-less": "~0.7.0", - "grunt-contrib-requirejs": "~0.4.1", - "grunt-contrib-uglify": "~0.2.4", - "grunt-filerev": "^0.2.1", - "grunt-git-describe": "~2.3.2", - "grunt-karma": "~0.8.3", - "grunt-ngmin": "0.0.3", - "grunt-string-replace": "~0.2.4", - "grunt-usemin": "^2.1.1", - "jshint-stylish": "~0.1.5", - "karma": "~0.12.16", - "karma-chrome-launcher": "~0.1.4", - "karma-coffee-preprocessor": "~0.1.2", - "karma-coverage": "^0.2.5", - "karma-coveralls": "^0.1.4", - "karma-expect": "~1.1.0", - "karma-firefox-launcher": "~0.1.3", - "karma-html2js-preprocessor": "~0.1.0", - "karma-jasmine": "~0.2.2", - "karma-mocha": "~0.1.4", - "karma-phantomjs-launcher": "~0.1.1", - "karma-requirejs": "~0.2.1", - "karma-script-launcher": "~0.1.0", - "load-grunt-tasks": "~0.2.0", - "mocha": "~1.16.1", - "requirejs": "~2.1.14", - "rjs-build-analysis": "0.0.3" - }, - "engines": { - "node": "0.10.x", - "npm": "1.2.x" - }, - "scripts": { - "test": "grunt test", - "coveralls": "grunt karma:coveralls && rm -rf ./coverage" - }, - "license": "Apache License", - "dependencies": { - "grunt-jscs-checker": "^0.4.4", - "karma-sinon": "^1.0.3", - "sinon": "^1.10.3" - } -} diff --git a/tasks/build_task.js b/tasks/build_task.js deleted file mode 100644 index 3a96c5bf985..00000000000 --- a/tasks/build_task.js +++ /dev/null @@ -1,37 +0,0 @@ -module.exports = function(grunt) { - - // Concat and Minify the src directory into dist - grunt.registerTask('build', [ - 'jshint:source', - 'jshint:tests', - 'clean:on_start', - 'less:src', - 'concat:css', - 'copy:everything_but_less_to_temp', - 'htmlmin:build', - 'ngtemplates', - 'cssmin:build', - 'build:grafanaVersion', - 'ngmin:build', - 'requirejs:build', - 'concat:js', - 'filerev', - 'usemin', - 'clean:temp', - 'uglify:dest' - ]); - - - grunt.registerTask('build:grafanaVersion', function() { - grunt.config('string-replace.config', { - files: { - '<%= tempDir %>/app/app.js': '<%= tempDir %>/app/app.js' - }, - options: { - replacements: [{ pattern: /@grafanaVersion@/g, replacement: '<%= pkg.version %>' }] - } - }); - grunt.task.run('string-replace:config'); - }); - -}; diff --git a/tasks/default_task.js b/tasks/default_task.js deleted file mode 100644 index 14b483fb2ca..00000000000 --- a/tasks/default_task.js +++ /dev/null @@ -1,5 +0,0 @@ -// Lint and build CSS -module.exports = function(grunt) { - grunt.registerTask('default', ['jscs', 'jshint', 'less:src', 'concat:css']); - grunt.registerTask('test', ['default', 'karma:test']); -}; diff --git a/tasks/distribute_task.js b/tasks/distribute_task.js deleted file mode 100644 index 7cff5efb897..00000000000 --- a/tasks/distribute_task.js +++ /dev/null @@ -1,31 +0,0 @@ -module.exports = function(grunt) { - - // build, then zip and upload to s3 - grunt.registerTask('distribute', [ - 'distribute:load_s3_config', - 'build', - 'compress:zip', - 'compress:tgz', - 's3:dist', - 'clean:temp' - ]); - - // build, then zip and upload to s3 - grunt.registerTask('release', [ - // 'distribute:load_s3_config', - 'build', - 'compress:zip_release', - 'compress:tgz_release', - //'s3:release', - //'clean:temp' - ]); - - // collect the key and secret from the .aws-config.json file, finish configuring the s3 task - grunt.registerTask('distribute:load_s3_config', function () { - var config = grunt.file.readJSON('.aws-config.json'); - grunt.config('s3.options', { - key: config.key, - secret: config.secret - }); - }); -} \ No newline at end of file diff --git a/tasks/options/clean.js b/tasks/options/clean.js deleted file mode 100644 index 7db6ef22f26..00000000000 --- a/tasks/options/clean.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = function(config) { - return { - on_start: ['<%= destDir %>', '<%= tempDir %>'], - temp: ['<%= tempDir %>'], - docs: ['<%= docsDir %>'] - }; -}; \ No newline at end of file diff --git a/tasks/options/compress.js b/tasks/options/compress.js deleted file mode 100644 index 7a03cff052f..00000000000 --- a/tasks/options/compress.js +++ /dev/null @@ -1,76 +0,0 @@ -module.exports = function(config) { - return { - zip: { - options: { - archive: '<%= tempDir %>/<%= pkg.name %>-latest.zip' - }, - files : [ - { - expand: true, - cwd: '<%= destDir %>', - src: ['**/*'], - dest: '<%= pkg.name %>/', - }, - { - expand: true, - dest: '<%= pkg.name %>/', - src: ['LICENSE.md', 'README.md', 'NOTICE.md'], - } - ] - }, - tgz: { - options: { - archive: '<%= tempDir %>/<%= pkg.name %>-latest.tar.gz' - }, - files : [ - { - expand: true, - cwd: '<%= destDir %>', - src: ['**/*'], - dest: '<%= pkg.name %>/', - }, - { - expand: true, - src: ['LICENSE.md', 'README.md', 'NOTICE.md'], - dest: '<%= pkg.name %>/', - } - ] - }, - zip_release: { - options: { - archive: '<%= tempDir %>/<%= pkg.name %>-<%= pkg.version %>.zip' - }, - files : [ - { - expand: true, - cwd: '<%= destDir %>', - src: ['**/*'], - dest: '<%= pkg.name %>-<%= pkg.version %>/', - }, - { - expand: true, - src: ['LICENSE.md', 'README.md', 'NOTICE.md'], - dest: '<%= pkg.name %>-<%= pkg.version %>/', - } - ] - }, - tgz_release: { - options: { - archive: '<%= tempDir %>/<%= pkg.name %>-<%= pkg.version %>.tar.gz' - }, - files : [ - { - expand: true, - cwd: '<%= destDir %>', - src: ['**/*'], - dest: '<%= pkg.name %>-<%= pkg.version %>/', - }, - { - expand: true, - src: ['LICENSE.md', 'README.md', 'NOTICE.md'], - dest: '<%= pkg.name %>-<%= pkg.version %>/', - } - ] - } - }; -}; \ No newline at end of file diff --git a/tasks/options/concat.js b/tasks/options/concat.js deleted file mode 100644 index 2251435ef51..00000000000 --- a/tasks/options/concat.js +++ /dev/null @@ -1,22 +0,0 @@ -module.exports = function(config) { - return { - css: { - src: [ - '<%= srcDir %>/css/normalize.min.css', - '<%= srcDir %>/css/timepicker.css', - '<%= srcDir %>/css/spectrum.css', - '<%= srcDir %>/css/animate.min.css', - '<%= srcDir %>/css/bootstrap.dark.min.css' - ], - dest: '<%= srcDir %>/css/default.min.css' - }, - js: { - src: [ - '<%= destDir %>/vendor/require/require.js', - '<%= destDir %>/app/components/require.config.js', - '<%= destDir %>/app/app.js', - ], - dest: '<%= destDir %>/app/app.js' - }, - }; -}; diff --git a/tasks/options/connect.js b/tasks/options/connect.js deleted file mode 100644 index a2b70e02f96..00000000000 --- a/tasks/options/connect.js +++ /dev/null @@ -1,20 +0,0 @@ -module.exports = function(config) { - return { - dev: { - options: { - port: 5601, - hostname: '*', - base: config.srcDir, - keepalive: true - } - }, - dist: { - options: { - port: 5605, - hostname: '*', - base: config.destDir, - keepalive: true - } - }, - } -}; diff --git a/tasks/options/copy.js b/tasks/options/copy.js deleted file mode 100644 index a76466c5417..00000000000 --- a/tasks/options/copy.js +++ /dev/null @@ -1,11 +0,0 @@ -module.exports = function(config) { - return { - // copy source to temp, we will minify in place for the dist build - everything_but_less_to_temp: { - cwd: '<%= srcDir %>', - expand: true, - src: ['**/*', '!**/*.less', '!config.js'], - dest: '<%= tempDir %>' - } - }; -}; \ No newline at end of file diff --git a/tasks/options/cssmin.js b/tasks/options/cssmin.js deleted file mode 100644 index b049a383fca..00000000000 --- a/tasks/options/cssmin.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = function(config) { - return { - build: { - expand: true, - cwd: '<%= tempDir %>', - src: '**/*.css', - dest: '<%= tempDir %>' - } - }; -}; \ No newline at end of file diff --git a/tasks/options/filerev.js b/tasks/options/filerev.js deleted file mode 100644 index cd9ca020500..00000000000 --- a/tasks/options/filerev.js +++ /dev/null @@ -1,17 +0,0 @@ -module.exports = function(config) { - return { - options: { - encoding: 'utf8', - algorithm: 'md5', - length: 8, - }, - css: { - src: '<%= destDir %>/css/default.min.css', - dest: '<%= destDir %>/css' - }, - js: { - src: '<%= destDir %>/app/app.js', - dest: '<%= destDir %>/app' - } - }; -}; diff --git a/tasks/options/git-describe.js b/tasks/options/git-describe.js deleted file mode 100644 index 44df7ac5f74..00000000000 --- a/tasks/options/git-describe.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = function(config) { - return { - me: { - // Target-specific file lists and/or options go here. - } - }; -}; \ No newline at end of file diff --git a/tasks/options/htmlmin.js b/tasks/options/htmlmin.js deleted file mode 100644 index b5d36b89e77..00000000000 --- a/tasks/options/htmlmin.js +++ /dev/null @@ -1,18 +0,0 @@ -module.exports = function(config) { - return { - build: { - options:{ - removeComments: true, - collapseWhitespace: true - }, - expand: true, - cwd: '<%= tempDir %>', - src: [ - //'index.html', - 'app/panels/**/*.html', - 'app/partials/**/*.html' - ], - dest: '<%= tempDir %>' - } - }; -}; \ No newline at end of file diff --git a/tasks/options/jscs.js b/tasks/options/jscs.js deleted file mode 100644 index 313893b440d..00000000000 --- a/tasks/options/jscs.js +++ /dev/null @@ -1,22 +0,0 @@ -module.exports = function(config) { - return { - src: [ - 'Gruntfile.js', - '<%= srcDir %>/app/**/*.js', - '!<%= srcDir %>/app/panels/*/{lib,leaflet}/*', - '!<%= srcDir %>/app/dashboards/*' - ], - options: { - config: ".jscs.json", - }, - }; -}; - -/* - "requireCurlyBraces": ["if", "else", "for", "while", "do", "try", "catch"], - "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"], - "disallowLeftStickedOperators": ["?", "+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="], - "disallowRightStickedOperators": ["?", "+", "/", "*", ":", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="], - "requireRightStickedOperators": ["!"], - "requireLeftStickedOperators": [","], - */ \ No newline at end of file diff --git a/tasks/options/jshint.js b/tasks/options/jshint.js deleted file mode 100644 index 60c212e785d..00000000000 --- a/tasks/options/jshint.js +++ /dev/null @@ -1,26 +0,0 @@ -module.exports = function(config) { - return { - source: { - files: { - src: ['Gruntfile.js', '<%= srcDir %>/app/**/*.js'], - } - }, - tests: { - files: { - src: ['<%= srcDir %>/test/**/*.js'], - } - }, - options: { - jshintrc: true, - reporter: require('jshint-stylish'), - ignores: [ - 'node_modules/*', - 'dist/*', - 'sample/*', - '<%= srcDir %>/vendor/*', - '<%= srcDir %>/app/panels/*/{lib,leaflet}/*', - '<%= srcDir %>/app/dashboards/*' - ] - } - }; -}; \ No newline at end of file diff --git a/tasks/options/karma.js b/tasks/options/karma.js deleted file mode 100644 index 0318741a329..00000000000 --- a/tasks/options/karma.js +++ /dev/null @@ -1,27 +0,0 @@ -module.exports = function(config) { - return { - dev: { - configFile: 'src/test/karma.conf.js', - singleRun: false, - }, - debug: { - configFile: 'src/test/karma.conf.js', - singleRun: false, - browsers: ['Chrome'] - }, - test: { - configFile: 'src/test/karma.conf.js', - }, - coveralls: { - configFile: 'src/test/karma.conf.js', - reporters: ['dots','coverage','coveralls'], - preprocessors: { - 'src/app/**/*.js': ['coverage'] - }, - coverageReporter: { - type: 'lcov', - dir: 'coverage/' - } - } - }; -}; diff --git a/tasks/options/less.js b/tasks/options/less.js deleted file mode 100644 index 4d9fe764e03..00000000000 --- a/tasks/options/less.js +++ /dev/null @@ -1,25 +0,0 @@ -module.exports = function(config) { - return { - // this is the only task, other than copy, that runs on the src directory, since we don't really need - // the less files in the dist. Everything else runs from on temp, and require copys everything - // from temp -> dist - dist:{ - expand: true, - cwd:'<%= srcDir %>/vendor/bootstrap/less/', - src: ['bootstrap.dark.less', 'bootstrap.light.less'], - dest: '<%= tempDir %>/css/', - }, - // Compile in place when not building - src:{ - options: { - paths: ["<%= srcDir %>/vendor/bootstrap/less", "<%= srcDir %>/css/less"], - yuicompress:true - }, - files: { - "<%= srcDir %>/css/bootstrap.dark.min.css": "<%= srcDir %>/css/less/bootstrap.dark.less", - "<%= srcDir %>/css/bootstrap.light.min.css": "<%= srcDir %>/css/less/bootstrap.light.less", - "<%= srcDir %>/css/bootstrap-responsive.min.css": "<%= srcDir %>/css/less/grafana-responsive.less" - } - } - }; -}; \ No newline at end of file diff --git a/tasks/options/meta.js b/tasks/options/meta.js deleted file mode 100644 index 3792f116faa..00000000000 --- a/tasks/options/meta.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = function(config) { - return { - banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' + - '<%= grunt.template.today("yyyy-mm-dd") %>\n' + - '<%= pkg.homepage ? " * " + pkg.homepage + "\\n" : "" %>' + - ' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' + - ' Licensed <%= pkg.license %> */\n\n' - }; -}; \ No newline at end of file diff --git a/tasks/options/ngmin.js b/tasks/options/ngmin.js deleted file mode 100644 index 39dbb7a540a..00000000000 --- a/tasks/options/ngmin.js +++ /dev/null @@ -1,19 +0,0 @@ -module.exports = function(config) { - return { - build: { - expand:true, - cwd:'<%= tempDir %>', - src: [ - 'app/controllers/**/*.js', - 'app/directives/**/*.js', - 'app/services/**/*.js', - 'app/filters/**/*.js', - 'app/panels/**/*.js', - 'app/routes/**/*.js', - 'app/app.js', - 'vendor/angular/**/*.js', - ], - dest: '<%= tempDir %>' - } - }; -}; diff --git a/tasks/options/ngtemplates.js b/tasks/options/ngtemplates.js deleted file mode 100644 index 7971a102e6c..00000000000 --- a/tasks/options/ngtemplates.js +++ /dev/null @@ -1,18 +0,0 @@ -module.exports = function(config) { - return { - grafana: { - cwd: '<%= tempDir %>', - src: ['app/**/*.html', '!app/panels/*/module.html'], - dest: '<%= tempDir %>/app/components/partials.js', - options: { - bootstrap: function(module, script) { - return "define('components/partials', ['angular'], function(angular) { \n" + - "angular.module('grafana').run(['$templateCache', function($templateCache) { \n" + - script + - '\n}]);' + - '\n});'; - } - } - } - }; -}; \ No newline at end of file diff --git a/tasks/options/requirejs.js b/tasks/options/requirejs.js deleted file mode 100644 index 1d4f04c0606..00000000000 --- a/tasks/options/requirejs.js +++ /dev/null @@ -1,83 +0,0 @@ -module.exports = function(config,grunt) { - var _c = { - build: { - options: { - appDir: '<%= tempDir %>', - dir: '<%= destDir %>', - - mainConfigFile: '<%= tempDir %>/app/components/require.config.js', - modules: [], // populated below - - optimize: 'none', - optimizeCss: 'none', - optimizeAllPluginResources: false, - - paths: { config: '../config.sample' }, // fix, fallbacks need to be specified - - removeCombined: true, - findNestedDependencies: true, - normalizeDirDefines: 'all', - inlineText: true, - skipPragmas: true, - - done: function (done, output) { - var duplicates = require('rjs-build-analysis').duplicates(output); - - if (duplicates.length > 0) { - grunt.log.subhead('Duplicates found in requirejs build:'); - grunt.log.warn(duplicates); - done(new Error('r.js built duplicate modules, please check the excludes option.')); - } - - done(); - } - } - } - }; - - // setup the modules require will build - var requireModules = _c.build.options.modules = [ - { - // main/common module - name: 'app', - include: [ - 'css', - 'kbn', - 'text', - 'jquery', - 'angular', - 'settings', - 'bootstrap', - 'modernizr', - 'timepicker', - 'datepicker', - 'underscore', - 'filters/all', - 'jquery.flot', - 'services/all', - 'angular-strap', - 'directives/all', - 'jquery.flot.pie', - 'angular-dragdrop', - ] - } - ]; - - var fs = require('fs'); - var panelPath = config.srcDir+'/app/panels' - - // create a module for each directory in src/app/panels/ - fs.readdirSync(panelPath).forEach(function (panelName) { - requireModules[0].include.push('panels/'+panelName+'/module'); - requireModules[0].include.push('text!panels/'+panelName+'/module.html'); - }); - - // exclude the literal config definition from all modules - requireModules - .forEach(function (module) { - module.excludeShallow = module.excludeShallow || []; - module.excludeShallow.push('config'); - }); - - return _c; -}; diff --git a/tasks/options/uglify.js b/tasks/options/uglify.js deleted file mode 100644 index 1ca15b06957..00000000000 --- a/tasks/options/uglify.js +++ /dev/null @@ -1,16 +0,0 @@ -module.exports = function(config) { - return { - dest: { - expand: true, - src: ['**/*.js', '!config.sample.js', '!app/dashboards/*.js', '!app/dashboards/**/*.js',], - dest: '<%= destDir %>', - cwd: '<%= destDir %>', - options: { - quite: true, - compress: true, - preserveComments: false, - banner: '<%= meta.banner %>' - } - } - }; -}; \ No newline at end of file diff --git a/tasks/options/usemin.js b/tasks/options/usemin.js deleted file mode 100644 index 0abd8ed4ec5..00000000000 --- a/tasks/options/usemin.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = function(config) { - return { - html: '<%= destDir %>/index.html', - }; -}; diff --git a/tasks/options/useminPrepare.js b/tasks/options/useminPrepare.js deleted file mode 100644 index 23bab7e3f22..00000000000 --- a/tasks/options/useminPrepare.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = function(config) { - return { - html: 'tmp/index.html', - }; -}; diff --git a/tasks/server_task.js b/tasks/server_task.js deleted file mode 100644 index e6fee262a14..00000000000 --- a/tasks/server_task.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function(grunt) { - grunt.registerTask('server', ['connect:dev']); -}; \ No newline at end of file diff --git a/views/index.html b/views/index.html index d8747d1d7a8..41689dfab64 100644 --- a/views/index.html +++ b/views/index.html @@ -7,7 +7,7 @@ Grafana - + @@ -20,9 +20,7 @@ - - - +