Kaynağa Gözat

Merge pull request #1 from grafana/master

sync from upstream
Lichun Wei 10 yıl önce
ebeveyn
işleme
bc4584d9fe

+ 6 - 0
CHANGELOG.md

@@ -1,3 +1,9 @@
+# 2.0.0 (unreleased)
+
+**Fixes**
+- [Issue #1782](https://github.com/grafana/grafana/issues/1782). Github OAuth: Now works with Github for Enterprise, thanks @williamjoy
+- [Issue #1780](https://github.com/grafana/grafana/issues/1780). Dashboard snapshot: Should not require login to view snapshot, Fixes #1780
+
 # 2.0.0-Beta3 (2015-04-12)
 # 2.0.0-Beta3 (2015-04-12)
 
 
 **RPM / DEB Package changes (to follow HFS)**
 **RPM / DEB Package changes (to follow HFS)**

+ 1 - 2
conf/defaults.ini

@@ -142,8 +142,7 @@ scopes = user:email
 auth_url = https://github.com/login/oauth/authorize
 auth_url = https://github.com/login/oauth/authorize
 token_url = https://github.com/login/oauth/access_token
 token_url = https://github.com/login/oauth/access_token
 api_url = https://api.github.com/user
 api_url = https://api.github.com/user
-# Uncomment bellow to only allow specific email domains
-; allowed_domains = mycompany.com othercompany.com
+allowed_domains =
 
 
 #################################### Google Auth ##########################
 #################################### Google Auth ##########################
 [auth.google]
 [auth.google]

+ 1 - 1
pkg/api/api.go

@@ -43,7 +43,7 @@ func Register(r *macaron.Macaron) {
 
 
 	// dashboard snapshots
 	// dashboard snapshots
 	r.Post("/api/snapshots/", bind(m.CreateDashboardSnapshotCommand{}), CreateDashboardSnapshot)
 	r.Post("/api/snapshots/", bind(m.CreateDashboardSnapshotCommand{}), CreateDashboardSnapshot)
-	r.Get("/dashboard/snapshots/*", Index)
+	r.Get("/dashboard/snapshot/*", Index)
 
 
 	r.Get("/api/snapshots/:key", GetDashboardSnapshot)
 	r.Get("/api/snapshots/:key", GetDashboardSnapshot)
 	r.Get("/api/snapshots-delete/:key", DeleteDashboardSnapshot)
 	r.Get("/api/snapshots-delete/:key", DeleteDashboardSnapshot)

+ 1 - 0
pkg/setting/setting_oauth.go

@@ -6,6 +6,7 @@ type OAuthInfo struct {
 	AuthUrl, TokenUrl      string
 	AuthUrl, TokenUrl      string
 	Enabled                bool
 	Enabled                bool
 	AllowedDomains         []string
 	AllowedDomains         []string
+	ApiUrl                 string
 }
 }
 
 
 type OAuther struct {
 type OAuther struct {

+ 4 - 4
pkg/social/social.go

@@ -49,7 +49,7 @@ func NewOAuthService() {
 			Scopes:         sec.Key("scopes").Strings(" "),
 			Scopes:         sec.Key("scopes").Strings(" "),
 			AuthUrl:        sec.Key("auth_url").String(),
 			AuthUrl:        sec.Key("auth_url").String(),
 			TokenUrl:       sec.Key("token_url").String(),
 			TokenUrl:       sec.Key("token_url").String(),
-			APIUrl:         sec.Key("api_url").String(),
+			ApiUrl:         sec.Key("api_url").String(),
 			Enabled:        sec.Key("enabled").MustBool(),
 			Enabled:        sec.Key("enabled").MustBool(),
 			AllowedDomains: sec.Key("allowed_domains").Strings(" "),
 			AllowedDomains: sec.Key("allowed_domains").Strings(" "),
 		}
 		}
@@ -73,7 +73,7 @@ func NewOAuthService() {
 		// GitHub.
 		// GitHub.
 		if name == "github" {
 		if name == "github" {
 			setting.OAuthService.GitHub = true
 			setting.OAuthService.GitHub = true
-			SocialMap["github"] = &SocialGithub{Config: &config, allowedDomains: info.AllowedDomains, APIUrl: info.APIUrl}
+			SocialMap["github"] = &SocialGithub{Config: &config, allowedDomains: info.AllowedDomains, ApiUrl: info.ApiUrl}
 		}
 		}
 
 
 		// Google.
 		// Google.
@@ -101,7 +101,7 @@ func isEmailAllowed(email string, allowedDomains []string) bool {
 type SocialGithub struct {
 type SocialGithub struct {
 	*oauth2.Config
 	*oauth2.Config
 	allowedDomains []string
 	allowedDomains []string
-	APIUrl []string
+	ApiUrl         string
 }
 }
 
 
 func (s *SocialGithub) Type() int {
 func (s *SocialGithub) Type() int {
@@ -121,7 +121,7 @@ func (s *SocialGithub) UserInfo(token *oauth2.Token) (*BasicUserInfo, error) {
 
 
 	var err error
 	var err error
 	client := s.Client(oauth2.NoContext, token)
 	client := s.Client(oauth2.NoContext, token)
-	r, err := client.Get(s.APIUrl)
+	r, err := client.Get(s.ApiUrl)
 	if err != nil {
 	if err != nil {
 		return nil, err
 		return nil, err
 	}
 	}

+ 1 - 1
public/app/partials/roweditor.html

@@ -18,7 +18,7 @@
 
 
 	<div class="editor-row" ng-if="editor.index == 0">
 	<div class="editor-row" ng-if="editor.index == 0">
 		<div class="editor-option">
 		<div class="editor-option">
-			<label class="small">Title</label><input type="text" class="input-medium" ng-model='row.title'></input>
+			<label class="small">Title</label><input type="text" class="input-xlarge" ng-model='row.title'></input>
 		</div>
 		</div>
 		<div class="editor-option">
 		<div class="editor-option">
 			<label class="small">Height</label><input type="text" class="input-mini" ng-model='row.height'></input>
 			<label class="small">Height</label><input type="text" class="input-mini" ng-model='row.height'></input>