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

Merge branch 'master' of github.com:grafana/grafana

Torkel Ödegaard 11 лет назад
Родитель
Сommit
94d2ae2a6a

+ 6 - 1
CHANGELOG.md

@@ -1,5 +1,10 @@
 # 1.8.0 (unreleased)
 
+**Fixes**
+- [Issue #802](https://github.com/grafana/grafana/issues/802). Annotations: Fix when using InfluxDB datasource
+
+# 1.8.0-RC1 (2014-09-12)
+
 **UI polish / changes**
 - [Issue #725](https://github.com/grafana/grafana/issues/725). UI: All modal editors are removed and replaced by an edit pane under menu. The look of editors is also updated and polished. Search dropdown is also shown as pane under menu and has seen some UI polish.
 
@@ -239,7 +244,7 @@ Read this for more info:
 - More graphite function definitions
 - Make "ms" axis format include hour, day, weeks, month and year ([Issue #149](https://github.com/grafana/grafana/issues/149))
 - Microsecond axis format ([Issue #146](https://github.com/grafana/grafana/issues/146))
-- Specify template paramaters in URL ([Issue #123](https://github.com/grafana/grafana/issues/123))
+- Specify template parameters in URL ([Issue #123](https://github.com/grafana/grafana/issues/123))
 
 ### Fixes
 - Basic Auth fix ([Issue #152](https://github.com/grafana/grafana/issues/152))

+ 2 - 2
latest.json

@@ -1,4 +1,4 @@
 {
-	"version": "1.7.0",
-	"url": "http://grafanarel.s3.amazonaws.com/grafana-1.7.0"
+	"version": "1.8.0-rc1",
+	"url": "http://grafanarel.s3.amazonaws.com/grafana-1.8.0-rc1"
 }

+ 4 - 6
src/app/dashboards/scripted_async.js

@@ -35,11 +35,9 @@ return function(callback) {
 
   // Set a title
   dashboard.title = 'Scripted dash';
-  dashboard.services.filter = {
-    time: {
-      from: "now-" + (ARGS.from || timspan),
-      to: "now"
-    }
+  dashboard.time = {
+    from: "now-" + (ARGS.from || timspan),
+    to: "now"
   };
 
   var rows = 1;
@@ -78,4 +76,4 @@ return function(callback) {
     callback(dashboard);
 
   });
-}
+}

+ 4 - 1
src/app/partials/dashboard_topnav.html

@@ -1,7 +1,10 @@
 <div class="navbar navbar-static-top">
 	<div class="navbar-inner">
 		<div class="container-fluid">
-			<span class="brand"><img src="img/small.png" bs-tooltip="'Grafana'" data-placement="bottom"> {{dashboard.title}}</span>
+			<span class="brand">
+				<img class="logo-icon" src="img/fav32.png" bs-tooltip="'Grafana'" data-placement="bottom"></img>
+				<span class="page-title">{{dashboard.title}}</span>
+			</span>
 			<ul class="nav pull-right" ng-controller='DashboardNavCtrl' ng-init="init()">
 
 				<li ng-show="dashboardViewState.fullscreen">

+ 1 - 1
src/app/partials/graphite/editor.html

@@ -108,7 +108,7 @@
 				</li>
 				<li class="grafana-target-segment">
 					<a ng-click="toggleEditorHelp(2);" bs-tooltip="'click to show helpful info'" data-placement="bottom">
-						series as paramaters
+						series as parameters
 					</a>
 				</li>
 				<li class="grafana-target-segment">

+ 1 - 1
src/app/services/dashboard/dashboardSrv.js

@@ -131,7 +131,7 @@ function (angular, $, kbn, _, moment) {
         if (old.services) {
           if (old.services.filter) {
             this.time = old.services.filter.time;
-            this.templating.list = old.services.filter.list;
+            this.templating.list = old.services.filter.list || [];
           }
           delete this.services;
         }

+ 1 - 1
src/app/services/influxdb/influxdbDatasource.js

@@ -64,7 +64,7 @@ function (angular, _, kbn, InfluxSeries, InfluxQueryBuilder) {
     InfluxDatasource.prototype.annotationQuery = function(annotation, rangeUnparsed) {
       var timeFilter = getTimeFilter({ range: rangeUnparsed });
       var query = annotation.query.replace('$timeFilter', timeFilter);
-      query = templateSrv.replace(annotation.query);
+      query = templateSrv.replace(query);
 
       return this._seriesQuery(query).then(function(results) {
         return new InfluxSeries({ seriesList: results, annotation: annotation }).getAnnotations();

+ 1 - 1
src/css/less/bootswatch.dark.less

@@ -56,7 +56,7 @@ hr {
 	}
 
 	.brand {
-		padding: 15px 20px 15px;
+		padding: 0px 15px;
 		color: @grayLighter;
 		font-weight: normal;
 		text-shadow: none;

+ 13 - 0
src/css/less/grafana.less

@@ -35,6 +35,19 @@
   }
 }
 
+.logo-icon {
+  width: 26px;
+  padding: 12px 11px 0 0;
+  display: block;
+  float: left;
+}
+
+.page-title {
+ padding: 15px 0;
+ display: block;
+ float: left;
+}
+
 .row-button {
   width: 24px;
 }

BIN
src/favicon.ico


BIN
src/img/fav16.png


BIN
src/img/fav32.png


BIN
src/img/fav_dark_16.png


BIN
src/img/fav_dark_32.png


+ 2 - 0
src/index.html

@@ -5,9 +5,11 @@
     <meta charset="utf-8">
     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
     <meta name="viewport" content="width=device-width">
+    <meta name="google" value="notranslate">
 
     <title>Grafana</title>
     <link rel="stylesheet" href="css/grafana.dark.min.css" title="Dark">
+    <link rel="icon" type="image/png" href="img/fav_dark_16.png">
 
     <!-- build:js app/app.js -->
     <script src="vendor/require/require.js"></script>

+ 25 - 1
src/test/specs/influxdb-datasource-specs.js

@@ -8,7 +8,7 @@ define([
     var ctx = new helpers.ServiceTestContext();
 
     beforeEach(module('grafana.services'));
-    beforeEach(ctx.providePhase());
+    beforeEach(ctx.providePhase(['templateSrv']));
     beforeEach(ctx.createService('InfluxDatasource'));
     beforeEach(function() {
       ctx.ds = new ctx.service({ urls: [''], user: 'test', password: 'mupp' });
@@ -70,6 +70,30 @@ define([
 
     });
 
+    describe('When issuing annotation query', function() {
+      var results;
+      var urlExpected = "/series?p=mupp&q=select+title+from+events.backend_01"+
+                        "+where+time+%3E+now()+-+1h&time_precision=s";
+
+      var range = { from: 'now-1h', to: 'now' };
+      var annotation = { query: 'select title from events.$server where $timeFilter' };
+      var response = [];
+
+      beforeEach(function() {
+        ctx.templateSrv.replace = function(str) {
+          return str.replace('$server', 'backend_01');
+        };
+        ctx.$httpBackend.expect('GET', urlExpected).respond(response);
+        ctx.ds.annotationQuery(annotation, range).then(function(data) { results = data; });
+        ctx.$httpBackend.flush();
+      });
+
+      it('should generate the correct query', function() {
+        ctx.$httpBackend.verifyNoOutstandingExpectation();
+      });
+
+    });
+
   });
 
 });