Commit 530e1b35 by bergquist

Merge branch 'master' into adrianlzt-bug/show_multiple_tags_with_influxdb

parents ce4e7136 5ec7dea8
...@@ -10,51 +10,50 @@ ...@@ -10,51 +10,50 @@
"url": "http://github.com/grafana/grafana.git" "url": "http://github.com/grafana/grafana.git"
}, },
"devDependencies": { "devDependencies": {
"zone.js": "^0.6.6",
"autoprefixer": "^6.4.0", "autoprefixer": "^6.4.0",
"es6-promise": "^3.0.2", "es6-promise": "^3.0.2",
"es6-shim": "^0.35.1", "es6-shim": "^0.35.1",
"expect.js": "~0.2.0", "expect.js": "~0.2.0",
"glob": "~7.1.1", "glob": "~7.0.0",
"grunt": "~0.4.0", "grunt": "^0.4.5",
"grunt-angular-templates": "^0.5.5", "grunt-angular-templates": "^1.1.0",
"grunt-cli": "~0.1.13", "grunt-cli": "~1.2.0",
"grunt-contrib-clean": "~0.7.0", "grunt-contrib-clean": "~1.0.0",
"grunt-contrib-compress": "^1.3.0", "grunt-contrib-compress": "^1.3.0",
"grunt-contrib-concat": "^0.5.1", "grunt-contrib-concat": "^1.0.1",
"grunt-contrib-copy": "~0.8.2", "grunt-contrib-copy": "~1.0.0",
"grunt-contrib-cssmin": "~0.14.0", "grunt-contrib-cssmin": "~1.0.2",
"grunt-contrib-htmlmin": "~0.6.0", "grunt-contrib-htmlmin": "~2.0.0",
"grunt-contrib-jshint": "~1.0.0", "grunt-contrib-jshint": "~1.1.0",
"grunt-contrib-uglify": "~0.11.0", "grunt-contrib-uglify": "~2.0.0",
"grunt-contrib-watch": "^0.6.1", "grunt-contrib-watch": "^1.0.0",
"grunt-filerev": "^0.2.1", "grunt-exec": "^1.0.1",
"grunt-git-describe": "~2.3.2", "grunt-filerev": "^2.3.1",
"grunt-karma": "~0.12.2", "grunt-git-describe": "~2.4.2",
"grunt-ng-annotate": "^1.0.1", "grunt-karma": "~2.0.0",
"grunt-notify": "^0.4.3", "grunt-ng-annotate": "^3.0.0",
"grunt-notify": "^0.4.5",
"grunt-postcss": "^0.8.0", "grunt-postcss": "^0.8.0",
"grunt-sass": "^1.1.0", "grunt-sass": "^1.2.1",
"grunt-string-replace": "~1.2.1", "grunt-string-replace": "~1.3.1",
"grunt-systemjs-builder": "^0.2.6", "grunt-systemjs-builder": "^0.2.7",
"grunt-tslint": "^3.0.2", "grunt-usemin": "3.1.1",
"grunt-typescript": "^0.8.0", "jshint-stylish": "~2.2.1",
"grunt-usemin": "3.0.0", "karma": "1.3.0",
"jshint-stylish": "~2.1.0", "karma-chrome-launcher": "~2.0.0",
"karma": "0.13.22", "karma-coverage": "1.1.1",
"karma-chrome-launcher": "~0.2.2",
"karma-coverage": "0.5.3",
"karma-coveralls": "1.1.2", "karma-coveralls": "1.1.2",
"karma-expect": "~1.1.0", "karma-expect": "~1.1.3",
"karma-mocha": "~0.2.1", "karma-mocha": "~1.3.0",
"karma-phantomjs-launcher": "1.0.0", "karma-phantomjs-launcher": "1.0.2",
"load-grunt-tasks": "3.4.0", "load-grunt-tasks": "3.5.2",
"mocha": "2.3.4", "mocha": "3.2.0",
"phantomjs-prebuilt": "^2.1.7", "phantomjs-prebuilt": "^2.1.13",
"reflect-metadata": "0.1.2", "reflect-metadata": "0.1.8",
"rxjs": "5.0.0-beta.4", "rxjs": "^5.0.0-rc.5",
"sass-lint": "^1.7.0", "sass-lint": "^1.10.2",
"systemjs": "0.19.24" "systemjs": "0.19.41",
"zone.js": "^0.7.2"
}, },
"engines": { "engines": {
"node": "4.x", "node": "4.x",
...@@ -67,21 +66,21 @@ ...@@ -67,21 +66,21 @@
}, },
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"eventemitter3": "^1.2.0", "eventemitter3": "^2.0.2",
"gaze": "^1.1.2", "gaze": "^1.1.2",
"grunt-jscs": "~1.5.x", "grunt-jscs": "3.0.1",
"grunt-sass-lint": "^0.2.0", "grunt-sass-lint": "^0.2.2",
"grunt-sync": "^0.4.1", "grunt-sync": "^0.6.2",
"karma-sinon": "^1.0.3", "karma-sinon": "^1.0.5",
"lodash": "^2.4.1", "lodash": "^4.17.2",
"mousetrap": "^1.6.0", "mousetrap": "^1.6.0",
"remarkable": "^1.6.2", "remarkable": "^1.7.1",
"sinon": "1.16.1", "sinon": "1.17.6",
"systemjs-builder": "^0.15.13", "systemjs-builder": "^0.15.34",
"tether": "^1.2.0", "tether": "^1.4.0",
"tether-drop": "^1.4.2", "tether-drop": "^1.4.2",
"tslint": "^3.4.0", "tslint": "^4.0.2",
"typescript": "^1.7.5", "typescript": "^2.1.4",
"virtual-scroll": "^1.1.1" "virtual-scroll": "^1.1.1"
} }
} }
...@@ -11,6 +11,7 @@ import ( ...@@ -11,6 +11,7 @@ import (
func TestSimpleReducer(t *testing.T) { func TestSimpleReducer(t *testing.T) {
Convey("Test simple reducer by calculating", t, func() { Convey("Test simple reducer by calculating", t, func() {
Convey("sum", func() { Convey("sum", func() {
result := testReducer("sum", 1, 2, 3) result := testReducer("sum", 1, 2, 3)
So(result, ShouldEqual, float64(6)) So(result, ShouldEqual, float64(6))
......
...@@ -175,17 +175,17 @@ function (angular, _, coreModule) { ...@@ -175,17 +175,17 @@ function (angular, _, coreModule) {
// Foreach keys in label (split on +) // Foreach keys in label (split on +)
for (var i = 0, l = keys.length; k = keys[i], i < l; i++) { for (var i = 0, l = keys.length; k = keys[i], i < l; i++) {
switch (k) { switch (k) {
case 'ctrl': case 'ctrl':
case 'control': case 'control':
kp++; kp++;
modifiers.ctrl.wanted = true; modifiers.ctrl.wanted = true;
break; break;
case 'shift': case 'shift':
case 'alt': case 'alt':
case 'meta': case 'meta':
kp++; kp++;
modifiers[k].wanted = true; modifiers[k].wanted = true;
break; break;
} }
if (k.length > 1) { // If it is a special key if (k.length > 1) { // If it is a special key
......
...@@ -16,95 +16,95 @@ function($, _) { ...@@ -16,95 +16,95 @@ function($, _) {
kbn.round_interval = function(interval) { kbn.round_interval = function(interval) {
switch (true) { switch (true) {
// 0.015s // 0.015s
case (interval <= 15): case (interval <= 15):
return 10; // 0.01s return 10; // 0.01s
// 0.035s // 0.035s
case (interval <= 35): case (interval <= 35):
return 20; // 0.02s return 20; // 0.02s
// 0.075s // 0.075s
case (interval <= 75): case (interval <= 75):
return 50; // 0.05s return 50; // 0.05s
// 0.15s // 0.15s
case (interval <= 150): case (interval <= 150):
return 100; // 0.1s return 100; // 0.1s
// 0.35s // 0.35s
case (interval <= 350): case (interval <= 350):
return 200; // 0.2s return 200; // 0.2s
// 0.75s // 0.75s
case (interval <= 750): case (interval <= 750):
return 500; // 0.5s return 500; // 0.5s
// 1.5s // 1.5s
case (interval <= 1500): case (interval <= 1500):
return 1000; // 1s return 1000; // 1s
// 3.5s // 3.5s
case (interval <= 3500): case (interval <= 3500):
return 2000; // 2s return 2000; // 2s
// 7.5s // 7.5s
case (interval <= 7500): case (interval <= 7500):
return 5000; // 5s return 5000; // 5s
// 12.5s // 12.5s
case (interval <= 12500): case (interval <= 12500):
return 10000; // 10s return 10000; // 10s
// 17.5s // 17.5s
case (interval <= 17500): case (interval <= 17500):
return 15000; // 15s return 15000; // 15s
// 25s // 25s
case (interval <= 25000): case (interval <= 25000):
return 20000; // 20s return 20000; // 20s
// 45s // 45s
case (interval <= 45000): case (interval <= 45000):
return 30000; // 30s return 30000; // 30s
// 1.5m // 1.5m
case (interval <= 90000): case (interval <= 90000):
return 60000; // 1m return 60000; // 1m
// 3.5m // 3.5m
case (interval <= 210000): case (interval <= 210000):
return 120000; // 2m return 120000; // 2m
// 7.5m // 7.5m
case (interval <= 450000): case (interval <= 450000):
return 300000; // 5m return 300000; // 5m
// 12.5m // 12.5m
case (interval <= 750000): case (interval <= 750000):
return 600000; // 10m return 600000; // 10m
// 12.5m // 12.5m
case (interval <= 1050000): case (interval <= 1050000):
return 900000; // 15m return 900000; // 15m
// 25m // 25m
case (interval <= 1500000): case (interval <= 1500000):
return 1200000; // 20m return 1200000; // 20m
// 45m // 45m
case (interval <= 2700000): case (interval <= 2700000):
return 1800000; // 30m return 1800000; // 30m
// 1.5h // 1.5h
case (interval <= 5400000): case (interval <= 5400000):
return 3600000; // 1h return 3600000; // 1h
// 2.5h // 2.5h
case (interval <= 9000000): case (interval <= 9000000):
return 7200000; // 2h return 7200000; // 2h
// 4.5h // 4.5h
case (interval <= 16200000): case (interval <= 16200000):
return 10800000; // 3h return 10800000; // 3h
// 9h // 9h
case (interval <= 32400000): case (interval <= 32400000):
return 21600000; // 6h return 21600000; // 6h
// 24h // 24h
case (interval <= 86400000): case (interval <= 86400000):
return 43200000; // 12h return 43200000; // 12h
// 48h // 48h
case (interval <= 172800000): case (interval <= 172800000):
return 86400000; // 24h return 86400000; // 24h
// 1w // 1w
case (interval <= 604800000): case (interval <= 604800000):
return 86400000; // 24h return 86400000; // 24h
// 3w // 3w
case (interval <= 1814400000): case (interval <= 1814400000):
return 604800000; // 1w return 604800000; // 1w
// 2y // 2y
case (interval < 3628800000): case (interval < 3628800000):
return 2592000000; // 30d return 2592000000; // 30d
default: default:
return 31536000000; // 1y return 31536000000; // 1y
} }
}; };
...@@ -650,7 +650,7 @@ function($, _) { ...@@ -650,7 +650,7 @@ function($, _) {
size *= kbn.intervals_in_seconds[units.find(function(e) { return e.long === timeScale; }).short] * 1000; size *= kbn.intervals_in_seconds[units.find(function(e) { return e.long === timeScale; }).short] * 1000;
var string = []; var string = [];
// after first value >= 1 print only $decimals more // after first value >= 1 print only $decimals more
var decrementDecimals = false; var decrementDecimals = false;
for (var i = 0; i < units.length && decimals >= 0; i++) { for (var i = 0; i < units.length && decimals >= 0; i++) {
var interval = kbn.intervals_in_seconds[units[i].short] * 1000; var interval = kbn.intervals_in_seconds[units[i].short] * 1000;
......
...@@ -15,7 +15,6 @@ export class SubmenuCtrl { ...@@ -15,7 +15,6 @@ export class SubmenuCtrl {
private $location) { private $location) {
this.annotations = this.dashboard.templating.list; this.annotations = this.dashboard.templating.list;
this.variables = this.variableSrv.variables; this.variables = this.variableSrv.variables;
console.log(this.variables);
} }
annotationStateChanged() { annotationStateChanged() {
......
define([ define([
'angular', 'angular',
'app/core/config', 'app/core/config',
'lodash' 'lodash'
......
...@@ -89,8 +89,10 @@ function (angular, _, moment, kbn, ElasticQueryBuilder, IndexPattern, ElasticRes ...@@ -89,8 +89,10 @@ function (angular, _, moment, kbn, ElasticQueryBuilder, IndexPattern, ElasticRes
"bool": { "bool": {
"must": [ "must": [
{ "range": range }, { "range": range },
{ "query_string": { {
"query": queryInterpolated } "query_string": {
"query": queryInterpolated
}
} }
] ]
} }
......
...@@ -135,9 +135,10 @@ function (queryDef) { ...@@ -135,9 +135,10 @@ function (queryDef) {
"bool": { "bool": {
"must": [ "must": [
{"range": this.getRangeFilter()}, {"range": this.getRangeFilter()},
{"query_string": { {
"analyze_wildcard": true, "query_string": {
"query": '$lucene_query' "analyze_wildcard": true,
"query": '$lucene_query'
} }
} }
] ]
......
...@@ -36,7 +36,7 @@ export class AxesEditorCtrl { ...@@ -36,7 +36,7 @@ export class AxesEditorCtrl {
this.xAxisStatOptions = [ this.xAxisStatOptions = [
{text: 'Avg', value: 'avg'}, {text: 'Avg', value: 'avg'},
{text: 'Min', value: 'min'}, {text: 'Min', value: 'min'},
{text: 'Max', value: 'min'}, {text: 'Max', value: 'max'},
{text: 'Total', value: 'total'}, {text: 'Total', value: 'total'},
{text: 'Count', value: 'count'}, {text: 'Count', value: 'count'},
{text: 'Current', value: 'current'}, {text: 'Current', value: 'current'},
......
...@@ -130,14 +130,8 @@ export class DataProcessor { ...@@ -130,14 +130,8 @@ export class DataProcessor {
let fields = []; let fields = [];
var firstItem = dataList[0]; var firstItem = dataList[0];
if (firstItem.type === 'docs'){ let fieldParts = [];
if (firstItem.datapoints.length === 0) { function getPropertiesRecursive(obj) {
return [];
}
let fieldParts = [];
function getPropertiesRecursive(obj) {
_.forEach(obj, (value, key) => { _.forEach(obj, (value, key) => {
if (_.isObject(value)) { if (_.isObject(value)) {
fieldParts.push(key); fieldParts.push(key);
...@@ -150,8 +144,11 @@ export class DataProcessor { ...@@ -150,8 +144,11 @@ export class DataProcessor {
} }
}); });
fieldParts.pop(); fieldParts.pop();
}
if (firstItem.type === 'docs'){
if (firstItem.datapoints.length === 0) {
return [];
} }
getPropertiesRecursive(firstItem.datapoints[0]); getPropertiesRecursive(firstItem.datapoints[0]);
return fields; return fields;
} }
...@@ -166,7 +163,7 @@ export class DataProcessor { ...@@ -166,7 +163,7 @@ export class DataProcessor {
return [ return [
{text: 'Avg', value: 'avg'}, {text: 'Avg', value: 'avg'},
{text: 'Min', value: 'min'}, {text: 'Min', value: 'min'},
{text: 'Max', value: 'min'}, {text: 'Max', value: 'max'},
{text: 'Total', value: 'total'}, {text: 'Total', value: 'total'},
{text: 'Count', value: 'count'}, {text: 'Count', value: 'count'},
]; ];
......
...@@ -6,11 +6,11 @@ module.exports = function(grunt) { ...@@ -6,11 +6,11 @@ module.exports = function(grunt) {
'jshint:source', 'jshint:source',
'jshint:tests', 'jshint:tests',
'jscs', 'jscs',
'tslint', 'exec:tslint',
'clean:release', 'clean:release',
'copy:node_modules', 'copy:node_modules',
'copy:public_to_gen', 'copy:public_to_gen',
'typescript:build', 'exec:tscompile',
'karma:test', 'karma:test',
'phantomjs', 'phantomjs',
'css', 'css',
......
...@@ -16,13 +16,13 @@ module.exports = function(grunt) { ...@@ -16,13 +16,13 @@ module.exports = function(grunt) {
grunt.registerTask('default', [ grunt.registerTask('default', [
'jscs', 'jscs',
'jshint', 'jshint',
'tslint', 'exec:tslint',
'clean:gen', 'clean:gen',
'copy:node_modules', 'copy:node_modules',
'copy:public_to_gen', 'copy:public_to_gen',
'phantomjs', 'phantomjs',
'css', 'css',
'typescript:build' 'exec:tscompile'
]); ]);
grunt.registerTask('test', ['default', 'karma:test', 'no-only-tests']); grunt.registerTask('test', ['default', 'karma:test', 'no-only-tests']);
......
module.exports = function(config) {
'use strict'
return {
tslint : "node ./node_modules/tslint/lib/tslint-cli.js -c tslint.json --project ./tsconfig.json",
tscompile: "node ./node_modules/typescript/lib/tsc.js -p tsconfig.json --diagnostics"
};
};
module.exports = function(config) {
return {
source: {
files: {
src: ['<%= srcDir %>/app/**/*.ts', '!<%= srcDir %>/app/**/*.d.ts'],
}
},
options: {
configuration: 'tslint.json'
// {
// rules: {
// curly: true,
// align: [true, "parameters", "statements"],
// indent: [true, "spaces"],
// "class-name": true,
// "interface-name": true,
// "semicolon": true,
// "use-strict": [false, "check-module", "check-function"],
// "whitespace": [true, "check-branch", "check-decl", "check-type"],
// }
// }
}
};
};
module.exports = function() {
'use strict';
return {
build: {
src: ['public/**/*.ts', "!public/vendor/**/*", "!**/*.d.ts"],
dest: 'public_gen/',
options: {
module: 'system', //or commonjs
target: 'es5', //or es3
rootDir: 'public/',
sourceRoot: 'public/',
declaration: true,
emitDecoratorMetadata: true,
experimentalDecorators: true,
sourceMap: true,
noImplicitAny: false,
}
},
// build2: {
// src: ['public/app/alerting#<{(||)}>#*.ts'],
// dest: 'public/.app_gen/alerting/all.js',
// options: {
// target: 'es5', //or es3
// declaration: true,
// sourceMap: true,
// }
// },
watch: {
src: ['public/app/**/*.ts'],
dest: 'public/app_gen',
options: {
module: 'amd', //or commonjs
target: 'es5', //or es3
rootDir: 'public/app',
declaration: true,
sourceMap: true,
watch: true,
}
}
};
};
...@@ -64,8 +64,8 @@ module.exports = function(config, grunt) { ...@@ -64,8 +64,8 @@ module.exports = function(config, grunt) {
grunt.config('typescript.build.src', filepath); grunt.config('typescript.build.src', filepath);
grunt.config('tslint.source.files.src', filepath); grunt.config('tslint.source.files.src', filepath);
grunt.task.run('typescript:build'); grunt.task.run('exec:tscompile');
grunt.task.run('tslint'); grunt.task.run('exec:tslint');
} }
done(); done();
......
...@@ -6,13 +6,22 @@ ...@@ -6,13 +6,22 @@
"noImplicitAny": false, "noImplicitAny": false,
"target": "es5", "target": "es5",
"rootDir": "public/", "rootDir": "public/",
"sourceRoot": "public/",
"module": "system", "module": "system",
"noEmitOnError": true, "noEmitOnError": true,
"emitDecoratorMetadata": true, "emitDecoratorMetadata": true,
"experimentalDecorators": true "experimentalDecorators": true,
"noImplicitReturns":false,
"noImplicitThis":false,
"noImplicitUseStrict":false,
"noUnusedLocals":false,
"moduleResolution": "classic"
}, },
"files": [ "include": [
"public/app/**/*.ts" "public/app/**/*.ts"
],
"exclude": [
"public/vendor/**/*",
"public/**/*.d.ts"
] ]
} }
{
"version": "v4",
"repo": "angular/DefinitelyTyped",
"ref": "master",
"path": "public/app/headers",
"bundle": "public/app/headers/tsd.d.ts",
"installed": {
"es6-promise/es6-promise.d.ts": {
"commit": "31e7317c9a0793857109236ef7c7f223305a8aa9"
},
"mocha/mocha.d.ts": {
"commit": "055b3172e8eb374a75826710c4d08677872620d3"
},
"zone/zone.d.ts": {
"commit": "055b3172e8eb374a75826710c4d08677872620d3"
},
"rx/rx.d.ts": {
"commit": "31e7317c9a0793857109236ef7c7f223305a8aa9"
},
"rx/rx-lite.d.ts": {
"commit": "31e7317c9a0793857109236ef7c7f223305a8aa9"
},
"angular2/angular2.d.ts": {
"commit": "31e7317c9a0793857109236ef7c7f223305a8aa9"
},
"es6-shim/es6-shim.d.ts": {
"commit": "31e7317c9a0793857109236ef7c7f223305a8aa9"
},
"jquery/jquery.d.ts": {
"commit": "31e7317c9a0793857109236ef7c7f223305a8aa9"
}
}
}
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
"forin": false, "forin": false,
"indent": [true, "spaces"], "indent": [true, "spaces"],
"label-position": true, "label-position": true,
"label-undefined": true,
"max-line-length": [true, 140], "max-line-length": [true, 140],
"member-access": false, "member-access": false,
"no-arg": true, "no-arg": true,
...@@ -21,7 +20,6 @@ ...@@ -21,7 +20,6 @@
], ],
"no-construct": true, "no-construct": true,
"no-debugger": true, "no-debugger": true,
"no-duplicate-key": true,
"no-duplicate-variable": true, "no-duplicate-variable": true,
"no-empty": false, "no-empty": false,
"no-eval": true, "no-eval": true,
...@@ -31,8 +29,6 @@ ...@@ -31,8 +29,6 @@
"no-switch-case-fall-through": false, "no-switch-case-fall-through": false,
"no-trailing-whitespace": true, "no-trailing-whitespace": true,
"no-unused-expression": false, "no-unused-expression": false,
"no-unused-variable": false,
"no-unreachable": true,
"no-use-before-declare": true, "no-use-before-declare": true,
"no-var-keyword": false, "no-var-keyword": false,
"object-literal-sort-keys": false, "object-literal-sort-keys": false,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment