Commit 0f7a55d0 by Torkel Ödegaard

improved asset (css/js) build pipeline, added revision to css and js. Will…

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)
parent 62af7797
...@@ -5,6 +5,8 @@ vNext ...@@ -5,6 +5,8 @@ vNext
- New config for playlist feature. Set playlist_timespan to set default playlist interval (Issue #445) - thx @rmca - New config for playlist feature. Set playlist_timespan to set default playlist interval (Issue #445) - thx @rmca
- New InfluxDB function difference add to function dropdown (PR #455) - New InfluxDB function difference add to function dropdown (PR #455)
- Added parameter to keepLastValue graphite function definition (default 100), Closes #459 - 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 # Fixes
- Filter option loading when having muliple nested filters now works better. - Filter option loading when having muliple nested filters now works better.
......
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
...@@ -2,7 +2,7 @@ module.exports = function(config) { ...@@ -2,7 +2,7 @@ module.exports = function(config) {
return { return {
grafana: { grafana: {
cwd: '<%= tempDir %>', cwd: '<%= tempDir %>',
src: 'app/partials/**/*.html', src: ['app/**/*.html', '!app/panels/*/module.html'],
dest: '<%= tempDir %>/app/components/partials.js', dest: '<%= tempDir %>/app/components/partials.js',
options: { options: {
bootstrap: function(module, script) { bootstrap: function(module, script) {
......
...@@ -61,9 +61,6 @@ module.exports = function(config,grunt) { ...@@ -61,9 +61,6 @@ module.exports = function(config,grunt) {
'jquery.flot.pie', 'jquery.flot.pie',
'angular-sanitize', 'angular-sanitize',
'angular-dragdrop', 'angular-dragdrop',
'panels/graphite/module',
'panels/text/module',
'panels/timepicker/module'
] ]
} }
]; ];
...@@ -73,19 +70,8 @@ module.exports = function(config,grunt) { ...@@ -73,19 +70,8 @@ module.exports = function(config,grunt) {
// create a module for each directory in src/app/panels/ // create a module for each directory in src/app/panels/
fs.readdirSync(panelPath).forEach(function (panelName) { fs.readdirSync(panelPath).forEach(function (panelName) {
if(!grunt.file.exists(panelPath+'/'+panelName+'/module.js')) { requireModules[0].include.push('panels/'+panelName+'/module');
fs.readdirSync(panelPath+"/"+panelName).forEach(function (subName) { requireModules[0].include.push('text!panels/'+panelName+'/module.html');
requireModules.push({
name: 'panels/'+panelName+'/'+subName+'/module',
exclude: ['app']
});
})
} else {
requireModules.push({
name: 'panels/'+panelName+'/module',
exclude: ['app']
});
}
}); });
// exclude the literal config definition from all modules // exclude the literal config definition from all modules
......
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