diff --git a/CHANGELOG.md b/CHANGELOG.md index 68a50c5e56c..8e427f63198 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ vNext - 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) - 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. diff --git a/src/app/panels/graphite/interval.js b/src/app/panels/graphite/interval.js deleted file mode 100644 index 673371fcf4c..00000000000 --- a/src/app/panels/graphite/interval.js +++ /dev/null @@ -1,57 +0,0 @@ -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 diff --git a/tasks/options/ngtemplates.js b/tasks/options/ngtemplates.js index 12104cd1609..49f3b9cb4f7 100644 --- a/tasks/options/ngtemplates.js +++ b/tasks/options/ngtemplates.js @@ -2,7 +2,7 @@ module.exports = function(config) { return { grafana: { cwd: '<%= tempDir %>', - src: 'app/partials/**/*.html', + src: ['app/**/*.html', '!app/panels/*/module.html'], dest: '<%= tempDir %>/app/components/partials.js', options: { bootstrap: function(module, script) { diff --git a/tasks/options/requirejs.js b/tasks/options/requirejs.js index a5d0083c49a..41789be2da0 100644 --- a/tasks/options/requirejs.js +++ b/tasks/options/requirejs.js @@ -61,9 +61,6 @@ module.exports = function(config,grunt) { 'jquery.flot.pie', 'angular-sanitize', 'angular-dragdrop', - 'panels/graphite/module', - 'panels/text/module', - 'panels/timepicker/module' ] } ]; @@ -73,19 +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