Commit 827e1846 by Torkel Ödegaard

Closes #333, New version availability check will now checks…

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 2f58aa28
......@@ -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 () {});
\ No newline at end of file
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>');
}
});
}
};
});
});
\ No newline at end of file
......@@ -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>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -510,4 +510,9 @@ select.grafana-target-segment-input {
cursor: auto;
//background: rgba(50,50,50,0.8);
padding: 10px;
}
\ No newline at end of file
}
.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 %>'
}
]
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment