From b45bd070324153c205560744dce2e5effae9da65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Tue, 25 Oct 2016 11:11:21 +0200 Subject: [PATCH 1/5] ux(dashboard): when saving dashbord with default new dashboard title show Save As Dialog, #6099 --- public/app/features/dashboard/dashboard_srv.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/app/features/dashboard/dashboard_srv.ts b/public/app/features/dashboard/dashboard_srv.ts index b6e92f64fee..5939ff83a15 100644 --- a/public/app/features/dashboard/dashboard_srv.ts +++ b/public/app/features/dashboard/dashboard_srv.ts @@ -28,6 +28,10 @@ export class DashboardSrv { return Promise.resolve(); } + if (this.dash.title === 'New dashboard') { + return this.saveDashboardAs(); + } + var clone = this.dash.getSaveModelClone(); return this.backendSrv.saveDashboard(clone, options).then(data => { From b382d17e3495b1a36d6045af80b22713279e6d2a Mon Sep 17 00:00:00 2001 From: Utkarsh Bhatnagar Date: Tue, 25 Oct 2016 05:52:20 -0700 Subject: [PATCH 2/5] Fixed alerting bug for mysql (#6375) --- pkg/services/sqlstore/migrator/mysql_dialect.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/services/sqlstore/migrator/mysql_dialect.go b/pkg/services/sqlstore/migrator/mysql_dialect.go index fc64842bd07..c36baa3afbf 100644 --- a/pkg/services/sqlstore/migrator/mysql_dialect.go +++ b/pkg/services/sqlstore/migrator/mysql_dialect.go @@ -30,7 +30,10 @@ func (db *Mysql) AutoIncrStr() string { } func (db *Mysql) BooleanStr(value bool) string { - return strconv.FormatBool(value) + if value { + return "1" + } + return "0" } func (db *Mysql) SqlType(c *Column) string { From b5eaa5ea59cdc559bd3301c2e095669ab284d6c7 Mon Sep 17 00:00:00 2001 From: Hans Kristian Flaatten Date: Fri, 28 Oct 2016 11:55:47 +0200 Subject: [PATCH 3/5] Add missing closing " in Docker README (#6413) --- docker/production/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/production/README.md b/docker/production/README.md index 9b0e23baf75..9c25c48adc2 100644 --- a/docker/production/README.md +++ b/docker/production/README.md @@ -23,7 +23,7 @@ All options defined in conf/grafana.ini can be overridden using environment vari ``` docker run -i -p 3000:3000 \ -e "GF_SERVER_ROOT_URL=http://grafana.server.name" \ - -e "GF_SECURITY_ADMIN_PASSWORD=secret \ + -e "GF_SECURITY_ADMIN_PASSWORD=secret" \ grafana/grafana:develop ``` From 7acdbde8f0c4122d5a64ba941beb156dbbb546af Mon Sep 17 00:00:00 2001 From: seanclerkin Date: Fri, 28 Oct 2016 11:00:22 +0100 Subject: [PATCH 4/5] Cloudwatch: add support for Aurora specific RDS metrics (#6378) --- pkg/api/cloudwatch/metrics.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/api/cloudwatch/metrics.go b/pkg/api/cloudwatch/metrics.go index 23814407182..5f87eccc87b 100644 --- a/pkg/api/cloudwatch/metrics.go +++ b/pkg/api/cloudwatch/metrics.go @@ -78,7 +78,7 @@ func init() { "AWS/ML": {"PredictCount", "PredictFailureCount"}, "AWS/OpsWorks": {"cpu_idle", "cpu_nice", "cpu_system", "cpu_user", "cpu_waitio", "load_1", "load_5", "load_15", "memory_buffers", "memory_cached", "memory_free", "memory_swap", "memory_total", "memory_used", "procs"}, "AWS/Redshift": {"CPUUtilization", "DatabaseConnections", "HealthStatus", "MaintenanceMode", "NetworkReceiveThroughput", "NetworkTransmitThroughput", "PercentageDiskSpaceUsed", "ReadIOPS", "ReadLatency", "ReadThroughput", "WriteIOPS", "WriteLatency", "WriteThroughput"}, - "AWS/RDS": {"BinLogDiskUsage", "CPUUtilization", "CPUCreditUsage", "CPUCreditBalance", "DatabaseConnections", "DiskQueueDepth", "FreeableMemory", "FreeStorageSpace", "ReplicaLag", "SwapUsage", "ReadIOPS", "WriteIOPS", "ReadLatency", "WriteLatency", "ReadThroughput", "WriteThroughput", "NetworkReceiveThroughput", "NetworkTransmitThroughput"}, + "AWS/RDS": {"ActiveTransactions", "AuroraBinlogReplicaLag", "AuroraReplicaLag", "AuroraReplicaLagMaximum", "AuroraReplicaLagMinimum", "BinLogDiskUsage", "BlockedTransactions", "BufferCacheHitRatio", "CommitLatency", "CommitThroughput", "CPUCreditBalance", "CPUCreditUsage", "CPUUtilization", "DatabaseConnections", "DDLLatency", "DDLThroughput", "Deadlocks", "DiskQueueDepth", "DMLLatency", "DMLThroughput", "FailedSqlStatements", "FreeableMemory", "FreeStorageSpace", "LoginFailures", "NetworkReceiveThroughput", "NetworkTransmitThroughput", "ReadIOPS", "ReadLatency", "ReadThroughput", "ReplicaLag", "ResultSetCacheHitRatio", "SelectLatency", "SelectThroughput", "SwapUsage", "TotalConnections", "VolumeReadIOPS", "VolumeWriteIOPS", "WriteIOPS", "WriteLatency", "WriteThroughput"}, "AWS/Route53": {"HealthCheckStatus", "HealthCheckPercentageHealthy", "ConnectionTime", "SSLHandshakeTime", "TimeToFirstByte"}, "AWS/S3": {"BucketSizeBytes", "NumberOfObjects"}, "AWS/SNS": {"NumberOfMessagesPublished", "PublishSize", "NumberOfNotificationsDelivered", "NumberOfNotificationsFailed"}, From 658fc1a67a6a3600b92f8daf3ef5b9b72438aca9 Mon Sep 17 00:00:00 2001 From: Eric Uldall Date: Fri, 28 Oct 2016 03:00:47 -0700 Subject: [PATCH 5/5] added hosted domain suppport to google oauth login (#6372) --- conf/defaults.ini | 1 + pkg/api/login_oauth.go | 6 +++++- pkg/setting/setting_oauth.go | 1 + pkg/social/google_oauth.go | 1 + pkg/social/social.go | 2 ++ 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/conf/defaults.ini b/conf/defaults.ini index cbc239937c6..b25f3ab6f28 100644 --- a/conf/defaults.ini +++ b/conf/defaults.ini @@ -229,6 +229,7 @@ auth_url = https://accounts.google.com/o/oauth2/auth token_url = https://accounts.google.com/o/oauth2/token api_url = https://www.googleapis.com/oauth2/v1/userinfo allowed_domains = +hosted_domain = #################################### Grafana.net Auth #################### [auth.grafananet] diff --git a/pkg/api/login_oauth.go b/pkg/api/login_oauth.go index bf280776575..b174f88d649 100644 --- a/pkg/api/login_oauth.go +++ b/pkg/api/login_oauth.go @@ -53,7 +53,11 @@ func OAuthLogin(ctx *middleware.Context) { if code == "" { state := GenStateString() ctx.Session.Set(middleware.SESS_KEY_OAUTH_STATE, state) - ctx.Redirect(connect.AuthCodeURL(state, oauth2.AccessTypeOnline)) + if setting.OAuthService.OAuthInfos[name].HostedDomain == "" { + ctx.Redirect(connect.AuthCodeURL(state, oauth2.AccessTypeOnline)) + }else{ + ctx.Redirect(connect.AuthCodeURL(state, oauth2.SetParam("hd", setting.OAuthService.OAuthInfos[name].HostedDomain), oauth2.AccessTypeOnline)); + } return } diff --git a/pkg/setting/setting_oauth.go b/pkg/setting/setting_oauth.go index e652310a621..bc52d2336c3 100644 --- a/pkg/setting/setting_oauth.go +++ b/pkg/setting/setting_oauth.go @@ -6,6 +6,7 @@ type OAuthInfo struct { AuthUrl, TokenUrl string Enabled bool AllowedDomains []string + HostedDomain string ApiUrl string AllowSignup bool Name string diff --git a/pkg/social/google_oauth.go b/pkg/social/google_oauth.go index 21543902a86..847cbb75c6d 100644 --- a/pkg/social/google_oauth.go +++ b/pkg/social/google_oauth.go @@ -12,6 +12,7 @@ import ( type SocialGoogle struct { *oauth2.Config allowedDomains []string + hostedDomain string apiUrl string allowSignup bool } diff --git a/pkg/social/social.go b/pkg/social/social.go index f70bdd70843..46a2d76b7f1 100644 --- a/pkg/social/social.go +++ b/pkg/social/social.go @@ -51,6 +51,7 @@ func NewOAuthService() { ApiUrl: sec.Key("api_url").String(), Enabled: sec.Key("enabled").MustBool(), AllowedDomains: sec.Key("allowed_domains").Strings(" "), + HostedDomain: sec.Key("hosted_domain").String(), AllowSignup: sec.Key("allow_sign_up").MustBool(), Name: sec.Key("name").MustString(name), TlsClientCert: sec.Key("tls_client_cert").String(), @@ -92,6 +93,7 @@ func NewOAuthService() { SocialMap["google"] = &SocialGoogle{ Config: &config, allowedDomains: info.AllowedDomains, + hostedDomain: info.HostedDomain, apiUrl: info.ApiUrl, allowSignup: info.AllowSignup, }