Просмотр исходного кода

Fixed grafana version in dash settings footer, Fixes #1699

Torkel Ödegaard 10 лет назад
Родитель
Сommit
776f15055a
3 измененных файлов с 8 добавлено и 8 удалено
  1. 1 2
      latest.json
  2. 3 3
      public/app/directives/grafanaVersionCheck.js
  3. 4 3
      public/app/services/contextSrv.js

+ 1 - 2
latest.json

@@ -1,4 +1,3 @@
 {
-	"version": "1.9.1",
-	"url": "https://grafanarel.s3.amazonaws.com/grafana-1.9.1.tar.gz"
+	"version": "2.0.0-beta1",
 }

+ 3 - 3
public/app/directives/grafanaVersionCheck.js

@@ -6,11 +6,11 @@ function (angular) {
 
   angular
     .module('grafana.directives')
-    .directive('grafanaVersionCheck', function($http, grafanaVersion) {
+    .directive('grafanaVersionCheck', function($http, contextSrv) {
       return {
         restrict: 'A',
         link: function(scope, elem) {
-          if (grafanaVersion[0] === '@') {
+          if (contextSrv.version === 'master') {
             return;
           }
 
@@ -20,7 +20,7 @@ function (angular) {
                 return;
               }
 
-              if (grafanaVersion !== response.data.version) {
+              if (contextSrv.version !== response.data.version) {
                 elem.append('<i class="icon-info-sign"></i> ' +
                             '<a href="http://grafana.org/download" target="_blank"> ' +
                                 'New version available: ' + response.data.version +

+ 4 - 3
public/app/services/contextSrv.js

@@ -2,13 +2,14 @@ define([
   'angular',
   'lodash',
   'store',
+  'config',
 ],
-function (angular, _, store) {
+function (angular, _, store, config) {
   'use strict';
 
   var module = angular.module('grafana.services');
 
-  module.service('contextSrv', function(grafanaVersion, $rootScope, $timeout) {
+  module.service('contextSrv', function($rootScope, $timeout) {
     var self = this;
 
     function User() {
@@ -17,7 +18,7 @@ function (angular, _, store) {
       }
     }
 
-    this.version = grafanaVersion;
+    this.version = config.buildInfo.version;
     this.lightTheme = false;
     this.user = new User();
     this.isSignedIn = this.user.isSignedIn;