From 68d3233401828dd121e316445e040ea7d61bbeef Mon Sep 17 00:00:00 2001 From: Rashid Khan Date: Fri, 13 Dec 2013 16:02:34 -0700 Subject: [PATCH] Added revision constant for future use --- src/app/app.js | 3 ++- src/app/services/dashboard.js | 4 ++++ tasks/build_task.js | 12 +++++++++--- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/app/app.js b/src/app/app.js index 973765c4f52..8ce947a33ec 100644 --- a/src/app/app.js +++ b/src/app/app.js @@ -26,7 +26,8 @@ function (angular, $, _, appLevelRequire) { // features if we define them after boot time register_fns = {}; - app.constant('version',"3.0.0pre5"); + // This stores the Kibana revision number, @REV@ is replaced by grunt. + app.constant('kbnVersion',"@REV@"); // Use this for cache busting partials app.constant('cacheBust',"cache-bust="+Date.now()); diff --git a/src/app/services/dashboard.js b/src/app/services/dashboard.js index 4731d0bb928..bf04823fabc 100644 --- a/src/app/services/dashboard.js +++ b/src/app/services/dashboard.js @@ -215,9 +215,13 @@ function (angular, $, kbn, _, config, moment, Modernizr) { self.set_interval(dashboard.refresh); } + // Set the available panels for the "Add Panel" drop down self.availablePanels = _.difference(config.panel_names, _.pluck(_.union(self.current.nav,self.current.pulldowns),'type')); + // Take out any that we're not allowed to add from the gui. + self.availablePanels = _.difference(self.availablePanels,config.hidden_panels); + return true; }; diff --git a/tasks/build_task.js b/tasks/build_task.js index 31bae6e1721..1da41026714 100644 --- a/tasks/build_task.js +++ b/tasks/build_task.js @@ -19,13 +19,19 @@ module.exports = function(grunt) { grunt.registerTask('build:write_revision', function() { grunt.event.once('git-describe', function (desc) { grunt.config('string-replace.config', { - src: '<%= destDir %>/app/components/require.config.js', - dest: '<%= destDir %>/app/components/require.config.js', + files: { + '<%= destDir %>/app/components/require.config.js': '<%= destDir %>/app/components/require.config.js', + '<%= destDir %>/app/app.js': '<%= destDir %>/app/app.js' + }, options: { replacements: [ { pattern: /(?:^|\/\/)(.*)@REV@/, replacement: '$1'+desc.object + }, + { + pattern: /@REV@/, + replacement: desc.object } ] } @@ -34,4 +40,4 @@ module.exports = function(grunt) { }); grunt.task.run('git-describe'); }); -} \ No newline at end of file +}; \ No newline at end of file