Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
e2041247
Unverified
Commit
e2041247
authored
Aug 27, 2018
by
Marcus Efraimsson
Committed by
GitHub
Aug 27, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12939 from grafana/12865-login-loading-animation
animation during slow login
parents
e1beaaa0
1a2ab532
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
11 deletions
+54
-11
public/app/core/controllers/login_ctrl.ts
+18
-10
public/app/partials/login.html
+4
-1
public/sass/components/_buttons.scss
+32
-0
No files found.
public/app/core/controllers/login_ctrl.ts
View file @
e2041247
...
...
@@ -13,6 +13,7 @@ export class LoginCtrl {
$scope
.
command
=
{};
$scope
.
result
=
''
;
$scope
.
loggingIn
=
false
;
contextSrv
.
sidemenu
=
false
;
...
...
@@ -105,16 +106,23 @@ export class LoginCtrl {
if
(
!
$scope
.
loginForm
.
$valid
)
{
return
;
}
backendSrv
.
post
(
'/login'
,
$scope
.
formModel
).
then
(
function
(
result
)
{
$scope
.
result
=
result
;
if
(
$scope
.
formModel
.
password
!==
'admin'
||
$scope
.
ldapEnabled
||
$scope
.
authProxyEnabled
)
{
$scope
.
toGrafana
();
return
;
}
$scope
.
changeView
();
});
$scope
.
loggingIn
=
true
;
backendSrv
.
post
(
'/login'
,
$scope
.
formModel
)
.
then
(
function
(
result
)
{
$scope
.
result
=
result
;
if
(
$scope
.
formModel
.
password
!==
'admin'
||
$scope
.
ldapEnabled
||
$scope
.
authProxyEnabled
)
{
$scope
.
toGrafana
();
return
;
}
else
{
$scope
.
changeView
();
}
})
.
catch
(()
=>
{
$scope
.
loggingIn
=
false
;
});
};
$scope
.
toGrafana
=
function
()
{
...
...
public/app/partials/login.html
View file @
e2041247
...
...
@@ -16,9 +16,12 @@
placeholder=
"password"
>
</div>
<div
class=
"login-button-group"
>
<button
type=
"submit"
class=
"btn btn-large p-x-2"
ng-click=
"submit();"
ng-class=
"{'btn-inverse': !loginForm.$valid, 'btn-primary': loginForm.$valid}"
>
<button
type=
"submit"
class=
"btn btn-large p-x-2"
ng-
if=
"!loggingIn"
ng-
click=
"submit();"
ng-class=
"{'btn-inverse': !loginForm.$valid, 'btn-primary': loginForm.$valid}"
>
Log In
</button>
<button
type=
"submit"
class=
"btn btn-large p-x-2 btn-inverse btn-loading"
ng-if=
"loggingIn"
>
Logging In
<span>
.
</span><span>
.
</span><span>
.
</span>
</button>
<div
class=
"small login-button-forgot-password"
>
<a
href=
"user/password/send-reset-email"
>
Forgot your password?
...
...
public/sass/components/_buttons.scss
View file @
e2041247
...
...
@@ -220,3 +220,35 @@ $btn-service-icon-width: 35px;
background-size
:
60%
;
}
}
//Button animations
.btn-loading
span
{
animation-name
:
blink
;
animation-duration
:
1
.4s
;
animation-iteration-count
:
infinite
;
animation-fill-mode
:
both
;
}
.btn-loading
span
:nth-child
(
2
)
{
animation-delay
:
0
.2s
;
}
.btn-loading
span
:nth-child
(
3
)
{
animation-delay
:
0
.4s
;
}
@keyframes
blink
{
0
%
{
opacity
:
0
.2
;
font-size
:
14
;
}
20
%
{
opacity
:
1
;
font-size
:
18
;
}
100
%
{
opacity
:
0
.2
;
font-size
:
14
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment