From 9b84b8851810c181f588bb5b92690696ca999809 Mon Sep 17 00:00:00 2001 From: Lucas Costa Date: Thu, 28 Apr 2016 19:23:45 -0300 Subject: [PATCH 01/20] Add support to Elasticsearch precision_threshold --- public/app/plugins/datasource/elasticsearch/metric_agg.js | 5 +++++ .../datasource/elasticsearch/partials/metric_agg.html | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/public/app/plugins/datasource/elasticsearch/metric_agg.js b/public/app/plugins/datasource/elasticsearch/metric_agg.js index 7fb227ab5b5..ecf4e16378e 100644 --- a/public/app/plugins/datasource/elasticsearch/metric_agg.js +++ b/public/app/plugins/datasource/elasticsearch/metric_agg.js @@ -68,6 +68,11 @@ function (angular, _, queryDef) { } switch($scope.agg.type) { + case 'cardinality': { + var precision_threshold = $scope.agg.settings.precision_threshold || ''; + $scope.settingsLinkText = 'Precision threshold: ' + precision_threshold; + break; + } case 'percentiles': { $scope.agg.settings.percents = $scope.agg.settings.percents || [25,50,75,95,99]; $scope.settingsLinkText = 'Values: ' + $scope.agg.settings.percents.join(','); diff --git a/public/app/plugins/datasource/elasticsearch/partials/metric_agg.html b/public/app/plugins/datasource/elasticsearch/partials/metric_agg.html index 24582baf8d1..faa12b5693d 100644 --- a/public/app/plugins/datasource/elasticsearch/partials/metric_agg.html +++ b/public/app/plugins/datasource/elasticsearch/partials/metric_agg.html @@ -58,6 +58,11 @@ +
+ + +
+
From eb35f8cb8900a6ef0c25c497423fcf4c2b23c81c Mon Sep 17 00:00:00 2001 From: stuart nelson Date: Thu, 30 Jun 2016 11:29:02 +0200 Subject: [PATCH 02/20] [prometheus] Use `panelId` and `target.refId` for requestId Using these two values ties requests to a particular query position within a panel, ensuring that requests are canceled if: - Duplicate requests with the same query are sent - Requests from the same query position (but a different query) are sent The last point is important as it identifies queries by a physical location in the dashboard instead of with the query expression. If a different query from the same position in a panel is sent, the previous request should be canceled. --- public/app/plugins/datasource/prometheus/datasource.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/app/plugins/datasource/prometheus/datasource.ts b/public/app/plugins/datasource/prometheus/datasource.ts index 4284ce78e8f..cbde594b6b1 100644 --- a/public/app/plugins/datasource/prometheus/datasource.ts +++ b/public/app/plugins/datasource/prometheus/datasource.ts @@ -77,7 +77,7 @@ export function PrometheusDatasource(instanceSettings, $q, backendSrv, templateS var query: any = {}; query.expr = templateSrv.replace(target.expr, options.scopedVars, self.interpolateQueryExpr); - query.requestId = target.expr; + query.requestId = options.panelId + target.refId; var interval = target.interval || options.interval; var intervalFactor = target.intervalFactor || 1; From 81af8f072cf8c2324bba06cd85f3774fec11aea5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 11 Jul 2016 19:07:16 +0200 Subject: [PATCH 03/20] feat(links): updated links to grafana.net --- public/app/core/components/search/search.html | 4 +- .../plugins/partials/plugin_list.html | 66 ++++++++++--------- public/img/grafana_net_logo.svg | 1 + public/sass/components/_search.scss | 17 ++++- public/sass/pages/_plugins.scss | 39 ++++------- 5 files changed, 68 insertions(+), 59 deletions(-) create mode 100644 public/img/grafana_net_logo.svg diff --git a/public/app/core/components/search/search.html b/public/app/core/components/search/search.html index b66eeffdc36..e8e2179ce5c 100644 --- a/public/app/core/components/search/search.html +++ b/public/app/core/components/search/search.html @@ -72,8 +72,8 @@ Import - - Explore ready made dashboards on Grafana.net + + Find dashboards on
diff --git a/public/app/features/plugins/partials/plugin_list.html b/public/app/features/plugins/partials/plugin_list.html index f4ee2b57815..c276faae93a 100644 --- a/public/app/features/plugins/partials/plugin_list.html +++ b/public/app/features/plugins/partials/plugin_list.html @@ -5,9 +5,9 @@ -
+ + Find plugins on + +
+ + +
-
    -
  1. - -
    -
    - - {{plugin.type}} -
    -
    - Update available! -
    -
    -
    -
    - -
    -
    -
    {{plugin.name}}
    -
    By {{plugin.info.author.name}}
    -
    -
    -
    -
  2. -
-
+
    +
  1. + +
    +
    + + {{plugin.type}} +
    +
    + Update available! +
    +
    +
    +
    + +
    +
    +
    {{plugin.name}}
    +
    By {{plugin.info.author.name}}
    +
    +
    +
    +
  2. +
+ diff --git a/public/img/grafana_net_logo.svg b/public/img/grafana_net_logo.svg new file mode 100644 index 00000000000..d73b9b944a8 --- /dev/null +++ b/public/img/grafana_net_logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/sass/components/_search.scss b/public/sass/components/_search.scss index ad48b29f512..563f89919e5 100644 --- a/public/sass/components/_search.scss +++ b/public/sass/components/_search.scss @@ -101,9 +101,24 @@ .search-button-row { padding-top: 20px; - line-height: 2.5rem; + button, a { margin-right: 10px; } + + .search-button-row-explore-link { + color: $text-muted; + font-size: $font-size-sm; + padding-right: 7rem; + background: url(../img/grafana_net_logo.svg); + background-size: 6.5rem 3rem; + background-repeat: no-repeat; + background-position: right; + position: relative; + top: 0.8rem; + &:hover { + color: $link-hover-color; + } + } } diff --git a/public/sass/pages/_plugins.scss b/public/sass/pages/_plugins.scss index 970d048cce3..f473a52ec94 100644 --- a/public/sass/pages/_plugins.scss +++ b/public/sass/pages/_plugins.scss @@ -63,28 +63,17 @@ } } -// .app-edit-logo-box { -// padding: 1.2rem; -// background: $panel-bg; -// text-align: center; -// img { -// max-width: 7rem; -// } -// margin-right: 2rem; -// } -// -// .app-edit-links { -// list-style: none; -// margin: 0 0 0 2rem; -// -// li { -// background: $panel-bg; -// margin-top: 4px; -// padding: 0.2rem 1rem; -// } -// } -// -// .app-edit-description { -// font-style: italic; -// margin-bottom: 1.5rem; -// } +.get-more-plugins-link { + color: $text-muted; + font-size: $font-size-sm; + padding-right: 7rem; + background: url(../img/grafana_net_logo.svg); + background-size: 6.5rem 3rem; + background-repeat: no-repeat; + background-position: right; + position: relative; + top: 1.2rem; + &:hover { + color: $link-hover-color; + } +} From f3db2fa262f818d43878ac623d31b2219aa09de9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 11 Jul 2016 19:16:35 +0200 Subject: [PATCH 04/20] feat(plugins): hide link on small screens --- public/sass/pages/_plugins.scss | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/public/sass/pages/_plugins.scss b/public/sass/pages/_plugins.scss index f473a52ec94..ed4d39d316f 100644 --- a/public/sass/pages/_plugins.scss +++ b/public/sass/pages/_plugins.scss @@ -77,3 +77,9 @@ color: $link-hover-color; } } + +@include media-breakpoint-down(sm) { + .get-more-plugins-link { + display: none; + } +} From b2acac3a41fbef7bd6bb918849cbfc2ddf5dbba0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Tue, 12 Jul 2016 08:41:56 +0200 Subject: [PATCH 05/20] feat(apps): more polish on app dashboard save warning, #5529 --- pkg/api/dashboard.go | 4 ++-- public/app/core/services/alert_srv.ts | 2 ++ public/app/features/dashboard/dashnav/dashnav.ts | 8 ++++++-- public/app/partials/confirm_modal.html | 3 ++- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/pkg/api/dashboard.go b/pkg/api/dashboard.go index a6bf96da876..041f2a7f8cf 100644 --- a/pkg/api/dashboard.go +++ b/pkg/api/dashboard.go @@ -139,10 +139,10 @@ func PostDashboard(c *middleware.Context, cmd m.SaveDashboardCommand) Response { return Json(412, util.DynMap{"status": "version-mismatch", "message": err.Error()}) } if pluginErr, ok := err.(m.UpdatePluginDashboardError); ok { - message := "Dashboard is belongs to plugin " + pluginErr.PluginId + "." + message := "The dashboard belongs to plugin " + pluginErr.PluginId + "." // look up plugin name if pluginDef, exist := plugins.Plugins[pluginErr.PluginId]; exist { - message = "Dashboard is belongs to plugin " + pluginDef.Name + "." + message = "The dashboard belongs to plugin " + pluginDef.Name + "." } return Json(412, util.DynMap{"status": "plugin-dashboard", "message": message}) } diff --git a/public/app/core/services/alert_srv.ts b/public/app/core/services/alert_srv.ts index 3003e59c74b..edfff2e8d00 100644 --- a/public/app/core/services/alert_srv.ts +++ b/public/app/core/services/alert_srv.ts @@ -73,6 +73,8 @@ export class AlertSrv { scope.text = payload.text; scope.text2 = payload.text2; scope.onConfirm = payload.onConfirm; + scope.onAltAction = payload.onAltAction; + scope.altActionText = payload.altActionText; scope.icon = payload.icon || "fa-check"; scope.yesText = payload.yesText || "Yes"; scope.noText = payload.noText || "Cancel"; diff --git a/public/app/features/dashboard/dashnav/dashnav.ts b/public/app/features/dashboard/dashnav/dashnav.ts index 601be4d7eea..7d25e352e9e 100644 --- a/public/app/features/dashboard/dashnav/dashnav.ts +++ b/public/app/features/dashboard/dashnav/dashnav.ts @@ -141,9 +141,13 @@ export class DashNavCtrl { $scope.appEvent('confirm-modal', { title: 'Plugin Dashboard', text: err.data.message, - text2: 'Your changes will be overwritten next time you update the plugin. Use Save As to create custom version.', - yesText: "Save & Overwrite", + text2: 'Your changes will be lost when you update the plugin. Use Save As to create custom version.', + yesText: "Overwrite", icon: "fa-warning", + altActionText: "Save As", + onAltAction: function() { + $scope.saveDashboardAs(); + }, onConfirm: function() { $scope.saveDashboard({overwrite: true}); } diff --git a/public/app/partials/confirm_modal.html b/public/app/partials/confirm_modal.html index d9da8bdacc4..6ab4a6b32c5 100644 --- a/public/app/partials/confirm_modal.html +++ b/public/app/partials/confirm_modal.html @@ -1,4 +1,4 @@ -