mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
custom login hints via config file
This commit is contained in:
parent
abd7c15ba8
commit
235bbc9c7e
@ -130,6 +130,9 @@
|
|||||||
# Default role new users will be automatically assigned (if disabled above is set to true)
|
# Default role new users will be automatically assigned (if disabled above is set to true)
|
||||||
;auto_assign_org_role = Viewer
|
;auto_assign_org_role = Viewer
|
||||||
|
|
||||||
|
# Background text for the user field on the login page
|
||||||
|
;login_hint = email or username
|
||||||
|
|
||||||
#################################### Anonymous Auth ##########################
|
#################################### Anonymous Auth ##########################
|
||||||
[auth.anonymous]
|
[auth.anonymous]
|
||||||
# enable anonymous access
|
# enable anonymous access
|
||||||
|
@ -28,6 +28,7 @@ func LoginView(c *middleware.Context) {
|
|||||||
settings["googleAuthEnabled"] = setting.OAuthService.Google
|
settings["googleAuthEnabled"] = setting.OAuthService.Google
|
||||||
settings["githubAuthEnabled"] = setting.OAuthService.GitHub
|
settings["githubAuthEnabled"] = setting.OAuthService.GitHub
|
||||||
settings["disableUserSignUp"] = !setting.AllowUserSignUp
|
settings["disableUserSignUp"] = !setting.AllowUserSignUp
|
||||||
|
settings["loginHint"] = setting.LoginHint
|
||||||
|
|
||||||
if !tryLoginUsingRememberCookie(c) {
|
if !tryLoginUsingRememberCookie(c) {
|
||||||
c.HTML(200, VIEW_INDEX)
|
c.HTML(200, VIEW_INDEX)
|
||||||
|
@ -79,6 +79,7 @@ var (
|
|||||||
AllowUserOrgCreate bool
|
AllowUserOrgCreate bool
|
||||||
AutoAssignOrg bool
|
AutoAssignOrg bool
|
||||||
AutoAssignOrgRole string
|
AutoAssignOrgRole string
|
||||||
|
LoginHint string
|
||||||
|
|
||||||
// Http auth
|
// Http auth
|
||||||
AdminUser string
|
AdminUser string
|
||||||
@ -392,6 +393,7 @@ func NewConfigContext(args *CommandLineArgs) {
|
|||||||
AllowUserOrgCreate = users.Key("allow_org_create").MustBool(true)
|
AllowUserOrgCreate = users.Key("allow_org_create").MustBool(true)
|
||||||
AutoAssignOrg = users.Key("auto_assign_org").MustBool(true)
|
AutoAssignOrg = users.Key("auto_assign_org").MustBool(true)
|
||||||
AutoAssignOrgRole = users.Key("auto_assign_org_role").In("Editor", []string{"Editor", "Admin", "Read Only Editor", "Viewer"})
|
AutoAssignOrgRole = users.Key("auto_assign_org_role").In("Editor", []string{"Editor", "Admin", "Read Only Editor", "Viewer"})
|
||||||
|
LoginHint = users.Key("login_hint").String()
|
||||||
|
|
||||||
// anonymous access
|
// anonymous access
|
||||||
AnonymousEnabled = Cfg.Section("auth.anonymous").Key("enabled").MustBool(false)
|
AnonymousEnabled = Cfg.Section("auth.anonymous").Key("enabled").MustBool(false)
|
||||||
|
@ -19,6 +19,7 @@ function (angular, config) {
|
|||||||
$scope.googleAuthEnabled = config.googleAuthEnabled;
|
$scope.googleAuthEnabled = config.googleAuthEnabled;
|
||||||
$scope.githubAuthEnabled = config.githubAuthEnabled;
|
$scope.githubAuthEnabled = config.githubAuthEnabled;
|
||||||
$scope.disableUserSignUp = config.disableUserSignUp;
|
$scope.disableUserSignUp = config.disableUserSignUp;
|
||||||
|
$scope.loginHint = config.loginHint;
|
||||||
|
|
||||||
$scope.loginMode = true;
|
$scope.loginMode = true;
|
||||||
$scope.submitBtnText = 'Log in';
|
$scope.submitBtnText = 'Log in';
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
<strong>User</strong>
|
<strong>User</strong>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<input type="text" name="username" class="tight-form-input last" required ng-model='formModel.user' placeholder="email or username" style="width: 253px">
|
<input type="text" name="username" class="tight-form-input last" required ng-model='formModel.user' placeholder={{loginHint}} style="width: 253px">
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
|
Loading…
Reference in New Issue
Block a user