Browse Source

added grafana version info to dashboard settings, and link to releases.

Torkel Ödegaard 12 years ago
parent
commit
4a1c9ac390
4 changed files with 15 additions and 2 deletions
  1. 1 1
      src/app/app.js
  2. 3 1
      src/app/controllers/dash.js
  3. 7 0
      src/app/partials/dasheditor.html
  4. 4 0
      tasks/build_task.js

+ 1 - 1
src/app/app.js

@@ -27,7 +27,7 @@ function (angular, $, _, appLevelRequire) {
     register_fns = {};
     register_fns = {};
 
 
   // This stores the Kibana revision number, @REV@ is replaced by grunt.
   // This stores the Kibana revision number, @REV@ is replaced by grunt.
-  app.constant('kbnVersion',"@REV@");
+  app.constant('grafanaVersion',"@grafanaVersion@");
 
 
   // Use this for cache busting partials
   // Use this for cache busting partials
   app.constant('cacheBust',"cache-bust="+Date.now());
   app.constant('cacheBust',"cache-bust="+Date.now());

+ 3 - 1
src/app/controllers/dash.js

@@ -30,7 +30,7 @@ function (angular, $, config, _) {
   var module = angular.module('kibana.controllers');
   var module = angular.module('kibana.controllers');
 
 
   module.controller('DashCtrl', function(
   module.controller('DashCtrl', function(
-    $scope, $rootScope, $route, ejsResource, dashboard, alertSrv, panelMove, keyboardManager) {
+    $scope, $rootScope, $route, ejsResource, dashboard, alertSrv, panelMove, keyboardManager, grafanaVersion) {
 
 
     $scope.requiredElasticSearchVersion = ">=0.90.3";
     $scope.requiredElasticSearchVersion = ">=0.90.3";
 
 
@@ -38,6 +38,8 @@ function (angular, $, config, _) {
       index: 0
       index: 0
     };
     };
 
 
+    $scope.grafanaVersion = grafanaVersion[0] === '@' ? 'version: master' : grafanaVersion;
+
     // For moving stuff around the dashboard.
     // For moving stuff around the dashboard.
     $scope.panelMoveDrop = panelMove.onDrop;
     $scope.panelMoveDrop = panelMove.onDrop;
     $scope.panelMoveStart = panelMove.onStart;
     $scope.panelMoveStart = panelMove.onStart;

+ 7 - 0
src/app/partials/dasheditor.html

@@ -141,6 +141,13 @@
 </div>
 </div>
 
 
 <div class="modal-footer">
 <div class="modal-footer">
+  <div class="pull-left" style="padding-top: 15px;" ng-if="editor.index == 0">
+    <span class="editor-option small">
+      Grafana {{grafanaVersion}}
+    </span>
+    (<a class="small" href="https://github.com/torkelo/grafana/releases" target="_blank">check for updates</a>)
+  </div>
+
   <button ng-click="add_row(dashboard.current,row); reset_row();" class="btn btn-success" ng-show="editor.index == 1">Create Row</button>
   <button ng-click="add_row(dashboard.current,row); reset_row();" class="btn btn-success" ng-show="editor.index == 1">Create Row</button>
   <button type="button" class="btn btn-danger" ng-click="editor.index=0;dismiss();reset_panel();dashboard.refresh()">Close</button>
   <button type="button" class="btn btn-danger" ng-click="editor.index=0;dismiss();reset_panel();dashboard.refresh()">Close</button>
 </div>
 </div>

+ 4 - 0
tasks/build_task.js

@@ -32,6 +32,10 @@ module.exports = function(grunt) {
             {
             {
               pattern: /@REV@/,
               pattern: /@REV@/,
               replacement: desc.object
               replacement: desc.object
+            },
+            {
+              pattern: /@grafanaVersion@/,
+              replacement: 'v<%= pkg.version %>'
             }
             }
           ]
           ]
         }
         }