From aa8bd044c5410cc857ca553ef6e4c46156217592 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 5 Feb 2016 11:05:47 +0100 Subject: [PATCH] fix(): various fixes to snapshots --- .../features/dashboard/dashnav/dashnav.html | 4 +- public/app/features/panel/panel_directive.ts | 51 ++++++++++++++++++- public/app/plugins/panel/singlestat/module.ts | 10 ++-- public/less/navbar.less | 23 +++------ 4 files changed, 64 insertions(+), 24 deletions(-) diff --git a/public/app/features/dashboard/dashnav/dashnav.html b/public/app/features/dashboard/dashnav/dashnav.html index 89f9f301729..3edafc1f96f 100644 --- a/public/app/features/dashboard/dashnav/dashnav.html +++ b/public/app/features/dashboard/dashnav/dashnav.html @@ -8,8 +8,8 @@ -
- +
+ {{dashboard.title}} diff --git a/public/app/features/panel/panel_directive.ts b/public/app/features/panel/panel_directive.ts index 757f9f8e43d..2497732928b 100644 --- a/public/app/features/panel/panel_directive.ts +++ b/public/app/features/panel/panel_directive.ts @@ -5,10 +5,59 @@ import $ from 'jquery'; var module = angular.module('grafana.directives'); +var panelTemplate = ` +
+
+ + + + + + + + + + +
+
+ +
+ +
+ +
+ +
+
+
+
+ + {{ctrl.name}} +
+ +
+
+
+
+ + +
+ +
+
+ +
+
+
+
+`; + module.directive('grafanaPanel', function() { return { restrict: 'E', - templateUrl: 'public/app/features/panel/partials/panel.html', + template: panelTemplate, transclude: true, scope: { ctrl: "=" }, link: function(scope, elem) { diff --git a/public/app/plugins/panel/singlestat/module.ts b/public/app/plugins/panel/singlestat/module.ts index 24d6af46c26..b161cd1d8ed 100644 --- a/public/app/plugins/panel/singlestat/module.ts +++ b/public/app/plugins/panel/singlestat/module.ts @@ -59,7 +59,7 @@ class SingleStatCtrl extends MetricsPanelCtrl { super.initEditMode(); this.icon = "fa fa-dashboard"; this.fontSizes = ['20%', '30%','50%','70%','80%','100%', '110%', '120%', '150%', '170%', '200%']; - this.addEditorTab('Options', 'app/plugins/panel/singlestat/editor.html', 2); + this.addEditorTab('Options', 'public/app/plugins/panel/singlestat/editor.html', 2); this.unitFormats = kbn.getUnitFormats(); } @@ -172,11 +172,11 @@ class SingleStatCtrl extends MetricsPanelCtrl { data.flotpairs = []; if (this.series.length > 1) { - this.inspector.error = new Error(); - this.inspector.error.message = 'Multiple Series Error'; - this.inspector.error.data = 'Metric query returns ' + this.series.length + + var error: any = new Error(); + error.message = 'Multiple Series Error'; + error.data = 'Metric query returns ' + this.series.length + ' series. Single Stat Panel expects a single series.\n\nResponse:\n'+JSON.stringify(this.series); - throw this.inspector.error; + throw error; } if (this.series && this.series.length > 0) { diff --git a/public/less/navbar.less b/public/less/navbar.less index 19c6b7d9a75..8dd78e95b14 100644 --- a/public/less/navbar.less +++ b/public/less/navbar.less @@ -83,6 +83,13 @@ position: relative; top: 2px; } + + .icon-gf { + position: relative; + top: 5px; + font-size: 27px; + line-height: 8px; + } } .dashboard-title { @@ -114,20 +121,4 @@ color: @linkColor; } -.top-nav-snapshot-title { - .gf-icon { - position: relative; - top: 3px; - font-size: 27px; - } - a { - display: inline-block; - padding: 0px 15px 5px 10px; - } - display: block; - float: left; - font-size: 1.4em; - margin: 9px 18px 5px 14px; - color: @linkColor; -}