mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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
This commit is contained in:
@@ -38,7 +38,7 @@ function (angular, $, config, _) {
|
||||
index: 0
|
||||
};
|
||||
|
||||
$scope.grafanaVersion = grafanaVersion[0] === '@' ? 'version: master' : grafanaVersion;
|
||||
$scope.grafanaVersion = grafanaVersion[0] === '@' ? 'master' : grafanaVersion;
|
||||
|
||||
// For moving stuff around the dashboard.
|
||||
$scope.panelMoveDrop = panelMove.onDrop;
|
||||
|
||||
@@ -14,5 +14,6 @@ define([
|
||||
'./bootstrap-tagsinput',
|
||||
'./bodyClass',
|
||||
'./addGraphiteFunc',
|
||||
'./graphiteFuncEditor'
|
||||
'./graphiteFuncEditor',
|
||||
'./grafanaVersionCheck'
|
||||
], function () {});
|
||||
33
src/app/directives/grafanaVersionCheck.js
Normal file
33
src/app/directives/grafanaVersionCheck.js
Normal file
@@ -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>');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
});
|
||||
});
|
||||
@@ -148,11 +148,12 @@
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<div class="pull-left" style="padding-top: 15px;" ng-if="editor.index == 0">
|
||||
<div class="pull-left grafana-version-footer" ng-if="editor.index == 0">
|
||||
<span class="editor-option small">
|
||||
Grafana {{grafanaVersion}}
|
||||
Grafana version: {{grafanaVersion}}
|
||||
</span>
|
||||
(<a class="small" href="https://github.com/torkelo/grafana/releases" target="_blank">check for updates</a>)
|
||||
<div class="small" grafana-version-check>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button ng-click="add_row(dashboard.current,row); reset_row();" class="btn btn-success" ng-show="editor.index == 1">Create Row</button>
|
||||
|
||||
2
src/css/bootstrap.dark.min.css
vendored
2
src/css/bootstrap.dark.min.css
vendored
File diff suppressed because one or more lines are too long
2
src/css/bootstrap.light.min.css
vendored
2
src/css/bootstrap.light.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -510,4 +510,9 @@ select.grafana-target-segment-input {
|
||||
cursor: auto;
|
||||
//background: rgba(50,50,50,0.8);
|
||||
padding: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.grafana-version-footer {
|
||||
padding-top: 15px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ module.exports = function(grunt) {
|
||||
},
|
||||
{
|
||||
pattern: /@grafanaVersion@/g,
|
||||
replacement: 'v<%= pkg.version %>'
|
||||
replacement: '<%= pkg.version %>'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user