mirror of https://github.com/grafana/grafana
Closes #333, New version availability check will now checks http://grafanarel.s3.amazonaws.com/latest.json if there is a new version. And the link now points to http://grafana.org/download
parent
2f58aa280c
commit
827e1846a8
@ -0,0 +1,33 @@ |
||||
define([ |
||||
'angular' |
||||
], |
||||
function (angular) { |
||||
'use strict'; |
||||
|
||||
angular |
||||
.module('kibana.directives') |
||||
.directive('grafanaVersionCheck', function($http, grafanaVersion) { |
||||
return { |
||||
restrict: 'A', |
||||
link: function(scope, elem) { |
||||
if (grafanaVersion[0] === '@') { |
||||
return; |
||||
} |
||||
|
||||
$http({ method: 'GET', url: 'http://grafanarel.s3.amazonaws.com/latest.json' }) |
||||
.then(function(response) { |
||||
if (!response.data || !response.data.version) { |
||||
return; |
||||
} |
||||
|
||||
if (grafanaVersion !== 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 + |
||||
'</a>'); |
||||
} |
||||
}); |
||||
} |
||||
}; |
||||
}); |
||||
}); |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue