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
9667f324
Commit
9667f324
authored
Jan 20, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added ability to create accounts from profile page
parent
d9a33680
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
9 deletions
+40
-9
src/app/features/profile/partials/profile.html
+32
-3
src/app/features/profile/profileCtrl.js
+7
-5
src/css/less/bootswatch.dark.less
+1
-1
No files found.
src/app/features/profile/partials/profile.html
View file @
9667f324
...
...
@@ -58,8 +58,8 @@
<div
class=
"section"
>
<div
class=
"dashboard-editor-header"
>
<div
class=
"dashboard-editor-title"
>
<i
class=
"fa fa-
eye
"
></i>
Active account
<i
class=
"fa fa-
cubes
"
></i>
Your accounts
</div>
</div>
<br>
...
...
@@ -69,7 +69,9 @@
<td>
Name: {{ac.name}}
</td>
<td>
Role: {{ac.role}}
</td>
<td
ng-show=
"ac.isUsing"
>
currently using this account
<span
class=
"label label-info"
>
active now
</span>
</td>
<td
ng-show=
"!ac.isUsing"
>
<a
ng-click=
"setUsingAccount(ac)"
class=
"btn btn-success btn-mini"
>
...
...
@@ -78,7 +80,34 @@
</td>
</tr>
</table>
</div>
<div
class=
"section"
>
<div
class=
"dashboard-editor-header"
>
<div
class=
"dashboard-editor-title"
>
<i
class=
"fa fa-plus-square"
></i>
Add account
</div>
</div>
<br>
<form
name=
"form"
>
<div
class=
"tight-form"
>
<ul
class=
"tight-form-list"
>
<li
class=
"tight-form-item"
>
<strong>
Account name
</strong>
</li>
<li>
<input
type=
"text"
ng-model=
"newAccount.name"
required
class=
"input-xlarge tight-form-input"
placeholder=
"account name"
>
</li>
<li>
<button
class=
"btn btn-success tight-form-btn"
ng-click=
"createAccount()"
>
Create
</button>
</li>
</ul>
<div
class=
"clearfix"
></div>
</div>
</form>
</div>
</div>
</div>
...
...
src/app/features/profile/profileCtrl.js
View file @
9667f324
...
...
@@ -8,6 +8,8 @@ function (angular) {
module
.
controller
(
'ProfileCtrl'
,
function
(
$scope
,
$http
,
backendSrv
)
{
$scope
.
newAccount
=
{
name
:
''
};
$scope
.
init
=
function
()
{
$scope
.
getUser
();
$scope
.
getUserAccounts
();
...
...
@@ -26,11 +28,7 @@ function (angular) {
};
$scope
.
setUsingAccount
=
function
(
account
)
{
backendSrv
.
request
({
method
:
'POST'
,
url
:
'/api/user/using/'
+
account
.
accountId
,
desc
:
'Change active account'
,
}).
then
(
$scope
.
getUserAccounts
);
backendSrv
.
post
(
'/api/user/using/'
+
account
.
accountId
).
then
(
$scope
.
getUserAccounts
);
};
$scope
.
update
=
function
()
{
...
...
@@ -39,6 +37,10 @@ function (angular) {
backendSrv
.
post
(
'/api/user/'
,
$scope
.
user
);
};
$scope
.
createAccount
=
function
()
{
backendSrv
.
put
(
'/api/account/'
,
$scope
.
newAccount
).
then
(
$scope
.
getUserAccounts
);
};
$scope
.
init
();
});
...
...
src/css/less/bootswatch.dark.less
View file @
9667f324
...
...
@@ -486,7 +486,7 @@ legend, label {
}
.label {
color: @
grayLighter
;
color: @
white
;
}
.badge {
...
...
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