Skip to content

Commit 2fbe8cd

Browse files
committed
Merge branch 'master' of github.com:grafana/grafana into dash-edit-mode
2 parents e170e47 + 658fc1a commit 2fbe8cd

File tree

9 files changed

+20
-4
lines changed

9 files changed

+20
-4
lines changed

conf/defaults.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ auth_url = https://accounts.google.com/o/oauth2/auth
229229
token_url = https://accounts.google.com/o/oauth2/token
230230
api_url = https://www.googleapis.com/oauth2/v1/userinfo
231231
allowed_domains =
232+
hosted_domain =
232233

233234
#################################### Grafana.net Auth ####################
234235
[auth.grafananet]

docker/production/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ All options defined in conf/grafana.ini can be overridden using environment vari
2323
```
2424
docker run -i -p 3000:3000 \
2525
-e "GF_SERVER_ROOT_URL=http://grafana.server.name" \
26-
-e "GF_SECURITY_ADMIN_PASSWORD=secret \
26+
-e "GF_SECURITY_ADMIN_PASSWORD=secret" \
2727
grafana/grafana:develop
2828
```
2929

pkg/api/cloudwatch/metrics.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func init() {
7878
"AWS/ML": {"PredictCount", "PredictFailureCount"},
7979
"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"},
8080
"AWS/Redshift": {"CPUUtilization", "DatabaseConnections", "HealthStatus", "MaintenanceMode", "NetworkReceiveThroughput", "NetworkTransmitThroughput", "PercentageDiskSpaceUsed", "ReadIOPS", "ReadLatency", "ReadThroughput", "WriteIOPS", "WriteLatency", "WriteThroughput"},
81-
"AWS/RDS": {"BinLogDiskUsage", "CPUUtilization", "CPUCreditUsage", "CPUCreditBalance", "DatabaseConnections", "DiskQueueDepth", "FreeableMemory", "FreeStorageSpace", "ReplicaLag", "SwapUsage", "ReadIOPS", "WriteIOPS", "ReadLatency", "WriteLatency", "ReadThroughput", "WriteThroughput", "NetworkReceiveThroughput", "NetworkTransmitThroughput"},
81+
"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"},
8282
"AWS/Route53": {"HealthCheckStatus", "HealthCheckPercentageHealthy", "ConnectionTime", "SSLHandshakeTime", "TimeToFirstByte"},
8383
"AWS/S3": {"BucketSizeBytes", "NumberOfObjects"},
8484
"AWS/SNS": {"NumberOfMessagesPublished", "PublishSize", "NumberOfNotificationsDelivered", "NumberOfNotificationsFailed"},

pkg/api/login_oauth.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ func OAuthLogin(ctx *middleware.Context) {
5353
if code == "" {
5454
state := GenStateString()
5555
ctx.Session.Set(middleware.SESS_KEY_OAUTH_STATE, state)
56-
ctx.Redirect(connect.AuthCodeURL(state, oauth2.AccessTypeOnline))
56+
if setting.OAuthService.OAuthInfos[name].HostedDomain == "" {
57+
ctx.Redirect(connect.AuthCodeURL(state, oauth2.AccessTypeOnline))
58+
}else{
59+
ctx.Redirect(connect.AuthCodeURL(state, oauth2.SetParam("hd", setting.OAuthService.OAuthInfos[name].HostedDomain), oauth2.AccessTypeOnline));
60+
}
5761
return
5862
}
5963

pkg/services/sqlstore/migrator/mysql_dialect.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ func (db *Mysql) AutoIncrStr() string {
3030
}
3131

3232
func (db *Mysql) BooleanStr(value bool) string {
33-
return strconv.FormatBool(value)
33+
if value {
34+
return "1"
35+
}
36+
return "0"
3437
}
3538

3639
func (db *Mysql) SqlType(c *Column) string {

pkg/setting/setting_oauth.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ type OAuthInfo struct {
66
AuthUrl, TokenUrl string
77
Enabled bool
88
AllowedDomains []string
9+
HostedDomain string
910
ApiUrl string
1011
AllowSignup bool
1112
Name string

pkg/social/google_oauth.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
type SocialGoogle struct {
1313
*oauth2.Config
1414
allowedDomains []string
15+
hostedDomain string
1516
apiUrl string
1617
allowSignup bool
1718
}

pkg/social/social.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ func NewOAuthService() {
5151
ApiUrl: sec.Key("api_url").String(),
5252
Enabled: sec.Key("enabled").MustBool(),
5353
AllowedDomains: sec.Key("allowed_domains").Strings(" "),
54+
HostedDomain: sec.Key("hosted_domain").String(),
5455
AllowSignup: sec.Key("allow_sign_up").MustBool(),
5556
Name: sec.Key("name").MustString(name),
5657
TlsClientCert: sec.Key("tls_client_cert").String(),
@@ -92,6 +93,7 @@ func NewOAuthService() {
9293
SocialMap["google"] = &SocialGoogle{
9394
Config: &config,
9495
allowedDomains: info.AllowedDomains,
96+
hostedDomain: info.HostedDomain,
9597
apiUrl: info.ApiUrl,
9698
allowSignup: info.AllowSignup,
9799
}

public/app/features/dashboard/dashboard_srv.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ export class DashboardSrv {
2828
return Promise.resolve();
2929
}
3030

31+
if (this.dash.title === 'New dashboard') {
32+
return this.saveDashboardAs();
33+
}
34+
3135
var clone = this.dash.getSaveModelClone();
3236

3337
return this.backendSrv.saveDashboard(clone, options).then(data => {

0 commit comments

Comments
 (0)