Commit 4ce386c6 by Torkel Ödegaard

updated changelog - merge

parents 8911da83 a3384d51
......@@ -4,12 +4,17 @@ vNext
- Refactoring of filterSrv (Issue #428), thx @Tetha
- New config for playlist feature. Set playlist_timespan to set default playlist interval (Issue #445) - thx @rmca
- New graphite function definition added isNonNull (PR #461), - thx @tmonk42
- New InfluxDB function difference add to function dropdown (PR #455)
- Added parameter to keepLastValue graphite function definition (default 100), Closes #459
- improved asset (css/js) build pipeline, added revision to css and js. Will remove issues related
to the browser cache when upgrading grafana and improve load performance (Fixes #418)
# Fixes
- Filter option loading when having muliple nested filters now works better.
Options are now reloaded correctly and there are no multiple renders/refresh inbetween (#447),
After an option is changed and a nested template param is also reloaded, if the current value
exists after the options are reloaded the current selected value is kept (Closes #447, Closes #412)
- Legend Current value did not display when value was zero, Fixes #460
# 1.5.4 (2014-05-13)
### New features and improvements
......
......@@ -44,7 +44,11 @@
"karma-mocha": "~0.1.1",
"karma-expect": "~1.0.0",
"grunt-cli": "~0.1.13",
"jshint-stylish": "~0.1.5"
"jshint-stylish": "~0.1.5",
"grunt-contrib-concat": "^0.4.0",
"grunt-angular-templates": "^0.5.5",
"grunt-usemin": "^2.1.1",
"grunt-filerev": "^0.2.1"
},
"engines": {
"node": "0.10.x",
......@@ -55,6 +59,6 @@
},
"license": "Apache License",
"dependencies": {
"grunt-contrib-concat": "^0.4.0"
}
}
......@@ -98,8 +98,9 @@ function (angular, $, _, appLevelRequire) {
'pasvaz.bindonce'
];
_.each('controllers directives factories services services.dashboard filters'.split(' '),
function (type) {
var module_types = ['controllers', 'directives', 'factories', 'services', 'services.dashboard', 'filters'];
_.each(module_types, function (type) {
var module_name = 'kibana.'+type;
// create the module
app.useModule(angular.module(module_name, []));
......@@ -117,7 +118,8 @@ function (angular, $, _, appLevelRequire) {
require([
'controllers/all',
'directives/all',
'filters/all'
'filters/all',
'components/partials',
], function () {
// bootstrap the app
......
define([
], function () {});
......@@ -47,6 +47,7 @@ require.config({
elasticjs: '../vendor/elasticjs/elastic-angular-client',
'bootstrap-tagsinput': '../vendor/tagsinput/bootstrap-tagsinput',
},
shim: {
underscore: {
......
......@@ -17,7 +17,10 @@ function (angular) {
$scope.rawQuery = false;
$scope.functions = ['count', 'mean', 'sum', 'min', 'max', 'mode', 'distinct', 'median', 'derivative', 'stddev', 'first', 'last'];
$scope.functions = ['count', 'mean', 'sum', 'min',
'max', 'mode', 'distinct', 'median',
'derivative', 'stddev', 'first', 'last',
'difference'];
$scope.operators = ['=', '=~', '>', '<', '!~', '<>'];
$scope.oldSeries = $scope.target.series;
$scope.$on('typeahead-updated', function(){
......
define([
'kbn'
],
function (kbn) {
'use strict';
/**
* manages the interval logic
* @param {[type]} interval_string An interval string in the format '1m', '1y', etc
*/
function Interval(interval_string) {
this.string = interval_string;
var info = kbn.describe_interval(interval_string);
this.type = info.type;
this.ms = info.sec * 1000 * info.count;
// does the length of the interval change based on the current time?
if (this.type === 'y' || this.type === 'M') {
// we will just modify this time object rather that create a new one constantly
this.get = this.get_complex;
this.date = new Date(0);
} else {
this.get = this.get_simple;
}
}
Interval.prototype = {
toString: function () {
return this.string;
},
after: function(current_ms) {
return this.get(current_ms, 1);
},
before: function (current_ms) {
return this.get(current_ms, -1);
},
get_complex: function (current, delta) {
this.date.setTime(current);
switch(this.type) {
case 'M':
this.date.setUTCMonth(this.date.getUTCMonth() + delta);
break;
case 'y':
this.date.setUTCFullYear(this.date.getUTCFullYear() + delta);
break;
}
return this.date.getTime();
},
get_simple: function (current, delta) {
return current + (delta * this.ms);
}
};
return Interval;
});
\ No newline at end of file
......@@ -60,11 +60,11 @@ function (_, kbn) {
this.info.current = result[result.length-1][1];
var formater = kbn.getFormatFunction(yFormats[this.yaxis - 1], 2);
this.info.avg = this.info.avg ? formater(this.info.avg) : null;
this.info.current = this.info.current ? formater(this.info.current) : null;
this.info.min = this.info.min ? formater(this.info.min) : null;
this.info.max = this.info.max ? formater(this.info.max) : null;
this.info.total = this.info.total ? formater(this.info.total) : null;
this.info.avg = this.info.avg != null ? formater(this.info.avg) : null;
this.info.current = this.info.current != null ? formater(this.info.current) : null;
this.info.min = this.info.min != null ? formater(this.info.min) : null;
this.info.max = this.info.max != null ? formater(this.info.max) : null;
this.info.total = this.info.total != null ? formater(this.info.total) : null;
}
return result;
......
......@@ -70,6 +70,11 @@ function (_) {
});
addFuncDef({
name: 'isNonNull',
category: categories.Combine,
});
addFuncDef({
name: 'rangeOfSeries',
category: categories.Combine
});
......@@ -231,6 +236,8 @@ function (_) {
addFuncDef({
name: 'keepLastValue',
category: categories.Special,
params: [ { name: "n", type: "int", } ],
defaultParams: [100]
});
addFuncDef({
......
......@@ -7,17 +7,20 @@
<meta name="viewport" content="width=device-width">
<title>Grafana</title>
<link rel="stylesheet" href="css/default.min.css" title="Light">
<!-- load the root require context -->
<link rel="stylesheet" href="css/default.min.css" title="Dark">
<!-- build:js app/app.js -->
<script src="vendor/require/require.js"></script>
<script src="app/components/require.config.js"></script>
<!-- endbuild -->
<script>require(['app'], function () {})</script>
</head>
<body ng-cloak body-class>
<link rel="stylesheet" ng-href="css/bootstrap.{{dashboard.current.style||'dark'}}.min.css">
<link rel="stylesheet" href="css/bootstrap.light.min.css" ng-if="dashboard.current.style === 'light'">
<link rel="stylesheet" href="css/bootstrap-responsive.min.css">
<link rel="stylesheet" href="css/font-awesome.min.css">
......
......@@ -6,11 +6,16 @@ module.exports = function(grunt) {
'jshint:tests',
'clean:on_start',
'less:src',
'concat:css',
'copy:everything_but_less_to_temp',
'htmlmin:build',
'ngtemplates',
'cssmin:build',
'ngmin:build',
'requirejs:build',
'concat:js',
'filerev',
'usemin',
'clean:temp',
'build:write_revision',
'uglify:dest'
......@@ -19,6 +24,7 @@ module.exports = function(grunt) {
// run a string replacement on the require config, using the latest revision number as the cache buster
grunt.registerTask('build:write_revision', function() {
grunt.event.once('git-describe', function (desc) {
grunt.config('string-replace.config', {
files: {
'<%= destDir %>/app/components/require.config.js': '<%= destDir %>/app/components/require.config.js',
......
// Lint and build CSS
module.exports = function(grunt) {
grunt.registerTask('default', ['jshint:source', 'jshint:tests', 'less:src', 'concat']);
grunt.registerTask('default', ['jshint:source', 'jshint:tests', 'less:src', 'concat:css']);
grunt.registerTask('test', ['default', 'karma:test']);
};
......@@ -5,10 +5,18 @@ module.exports = function(config) {
'<%= srcDir %>/css/normalize.min.css',
'<%= srcDir %>/css/bootstrap.dark.min.css',
'<%= srcDir %>/css/timepicker.css',
'<%= srcDir &>/css/spectrum.css',
'<%= srcDir &>/css/animate.min.css'
'<%= srcDir %>/css/spectrum.css',
'<%= srcDir %>/css/animate.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'
},
};
};
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'
}
};
};
......@@ -8,7 +8,7 @@ module.exports = function(config) {
expand: true,
cwd: '<%= tempDir %>',
src: [
'index.html',
//'index.html',
'app/panels/**/*.html',
'app/partials/**/*.html'
],
......
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('kibana').run(['$templateCache', function($templateCache) { \n" +
script +
'\n}]);' +
'\n});';
}
}
}
};
};
\ No newline at end of file
......@@ -60,7 +60,7 @@ module.exports = function(config,grunt) {
'directives/all',
'jquery.flot.pie',
'angular-sanitize',
'angular-dragdrop'
'angular-dragdrop',
]
}
];
......@@ -70,18 +70,8 @@ module.exports = function(config,grunt) {
// create a module for each directory in src/app/panels/
fs.readdirSync(panelPath).forEach(function (panelName) {
if(!grunt.file.exists(panelPath+'/'+panelName+'/module.js')) {
fs.readdirSync(panelPath+"/"+panelName).forEach(function (subName) {
requireModules.push({
name: 'panels/'+panelName+'/'+subName+'/module',
exclude: ['app']
}); })
} else {
requireModules.push({
name: 'panels/'+panelName+'/module',
exclude: ['app']
});
}
requireModules[0].include.push('panels/'+panelName+'/module');
requireModules[0].include.push('text!panels/'+panelName+'/module.html');
});
// exclude the literal config definition from all modules
......
module.exports = function(config) {
return {
html: '<%= destDir %>/index.html',
};
};
module.exports = function(config) {
return {
html: 'tmp/index.html',
};
};
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