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
477f66f5
Commit
477f66f5
authored
Aug 22, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashobard load/save work, and began register view
parent
359bca06
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
94 additions
and
2 deletions
+94
-2
src/app/partials/pro/login.html
+6
-0
src/app/partials/pro/register.html
+48
-0
src/app/routes/p_dashboard.js
+1
-1
src/app/routes/p_login.js
+38
-0
src/app/services/grafana/grafanaDatasource.js
+1
-1
No files found.
src/app/partials/pro/login.html
View file @
477f66f5
...
...
@@ -42,6 +42,12 @@
<strong>
Login failed:
</strong>
{{loginError}}
</div>
</form>
<div
class=
"register-box text-center"
>
<h3>
If you do not already have an account
<h3>
</a>
<a
href=
"/register"
class=
"btn btn-info btn-large"
>
Sign up now!
</a>
</div>
</div>
...
...
src/app/partials/pro/register.html
0 → 100644
View file @
477f66f5
<div
class=
"container"
>
<div
class=
"login-box"
>
<div
class=
"login-box-logo"
>
<img
src=
"/img/logo_transparent_200x75.png"
>
<h3>
Grafana account registration
</32>
</div>
<form
name=
"loginForm"
class=
"form-horizontal"
>
<div
class=
"row-fluid"
>
<div
class=
"span8"
>
<div
class=
"control-group"
>
<label
class=
"control-label"
for=
"inputEmail"
>
Email
</label>
<div
class=
"controls"
>
<input
type=
"text"
required
ng-model=
"loginModel.email"
id=
"inputEmail"
placeholder=
"Email"
>
</div>
</div>
<div
class=
"control-group"
>
<label
class=
"control-label"
for=
"inputPassword"
>
Password
</label>
<div
class=
"controls"
>
<input
type=
"password"
required
ng-model=
"loginModel.password"
id=
"inputPassword"
placeholder=
"Password"
>
</div>
</div>
<div
class=
"control-group"
>
<label
class=
"control-label"
for=
"inputPassword2"
>
Confirm password
</label>
<div
class=
"controls"
>
<input
type=
"password"
required
ng-model=
"loginModel.password2"
id=
"password2"
placeholder=
"Confirm password"
>
</div>
</div>
</div>
<div
class=
"span4"
>
<button
type=
"submit"
ng-click=
"login()"
class=
"btn btn-success btn-large"
>
<i
class=
"icon-lock"
></i>
Sign up
</button>
</div>
</div>
<div
class=
"alert alert-error"
ng-show=
"loginError"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"alert"
>
×
</button>
<strong>
Login failed:
</strong>
{{loginError}}
</div>
</form>
</div>
</div>
src/app/routes/p_dashboard.js
View file @
477f66f5
...
...
@@ -13,7 +13,7 @@ function (angular) {
controller
:
'DashFromDBProvider'
,
reloadOnSearch
:
false
,
})
.
when
(
'/dashboard/:id'
,
{
.
when
(
'/dashboard/
db/
:id'
,
{
templateUrl
:
'/app/partials/dashboard.html'
,
controller
:
'DashFromDBProvider'
,
reloadOnSearch
:
false
,
...
...
src/app/routes/p_login.js
View file @
477f66f5
...
...
@@ -11,9 +11,47 @@ function (angular) {
.
when
(
'/login'
,
{
templateUrl
:
'app/partials/pro/login.html'
,
controller
:
'LoginCtrl'
,
})
.
when
(
'/register'
,
{
templateUrl
:
'app/partials/pro/register.html'
,
controller
:
'RegisterCtrl'
,
});
});
module
.
controller
(
'RegisterCtrl'
,
function
(
$scope
,
$http
,
$location
,
$routeParams
)
{
$scope
.
loginModel
=
{};
$scope
.
init
=
function
()
{
if
(
$routeParams
.
logout
)
{
$scope
.
logout
();
}
};
$scope
.
register
=
function
()
{
delete
$scope
.
registerError
;
if
(
!
$scope
.
loginForm
.
$valid
)
{
return
;
}
$http
.
post
(
'/api/register/user'
,
$scope
.
loginModel
).
then
(
function
()
{
$scope
.
emitAppEvent
(
'logged-in'
);
$location
.
path
(
'/'
);
},
function
(
err
)
{
if
(
err
.
status
===
401
)
{
$scope
.
registerError
=
"Username or password is incorrect"
;
}
else
{
$scope
.
loginError
=
"Unexpected error"
;
}
});
};
$scope
.
init
();
});
module
.
controller
(
'LoginCtrl'
,
function
(
$scope
,
$http
,
$location
,
$routeParams
,
alertSrv
)
{
$scope
.
loginModel
=
{};
...
...
src/app/services/grafana/grafanaDatasource.js
View file @
477f66f5
...
...
@@ -49,7 +49,7 @@ function (angular) {
return
$http
.
post
(
'/api/dashboard/'
,
{
dashboard
:
dashboard
})
.
then
(
function
(
result
)
{
return
{
title
:
dashboard
.
title
,
url
:
'/dashboard/'
+
result
.
data
.
slug
};
return
{
title
:
dashboard
.
title
,
url
:
'/dashboard/
db/
'
+
result
.
data
.
slug
};
},
function
(
data
)
{
throw
"Failed to search: "
+
data
;
});
...
...
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