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
500e0006
Commit
500e0006
authored
Jan 16, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add collaborator now handles roles, added macaron-binding for binding and validation
parent
4c73d970
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
51 additions
and
23 deletions
+51
-23
src/app/features/account/collaboratorsCtrl.js
+5
-3
src/app/features/account/partials/account.html
+12
-14
src/app/features/account/partials/collaborators.html
+25
-6
src/app/services/backendSrv.js
+5
-0
src/css/less/tightform.less
+4
-0
No files found.
src/app/features/account/collaboratorsCtrl.js
View file @
500e0006
...
...
@@ -8,7 +8,10 @@ function (angular) {
module
.
controller
(
'CollaboratorsCtrl'
,
function
(
$scope
,
$http
,
backendSrv
)
{
$scope
.
collaborator
=
{};
$scope
.
collaborator
=
{
loginOrEmail
:
''
,
role
:
'Viewer'
,
};
$scope
.
init
=
function
()
{
$scope
.
get
();
...
...
@@ -17,7 +20,6 @@ function (angular) {
$scope
.
get
=
function
()
{
backendSrv
.
get
(
'/api/account/collaborators'
).
then
(
function
(
collaborators
)
{
$scope
.
collaborators
=
collaborators
;
console
.
log
(
collaborators
);
});
};
...
...
@@ -30,7 +32,7 @@ function (angular) {
};
$scope
.
addCollaborator
=
function
()
{
if
(
!
$scope
.
addCollaboratorF
orm
.
$valid
)
{
if
(
!
$scope
.
f
orm
.
$valid
)
{
return
;
}
...
...
src/app/features/account/partials/account.html
View file @
500e0006
...
...
@@ -16,41 +16,39 @@
<form
name=
"accountForm"
>
<div
class=
"grafana-target"
>
<div
class=
"grafana-target-inner"
>
<ul
class=
"grafana-segment-list"
>
<li
class=
"grafana-target-segment"
style=
"width: 80px"
>
<div
class=
"tight-form"
>
<ul
class=
"tight-form-list"
>
<li
class=
"tight-form-item"
style=
"width: 80px"
>
<strong>
Name
</strong>
</li>
<li>
<input
type=
"text"
ng-model=
"account.name"
class=
"input-xxlarge grafana-target-segment
-input last"
>
<input
type=
"text"
ng-model=
"account.name"
class=
"input-xxlarge tight-form
-input last"
>
</li>
</ul>
<div
class=
"clearfix"
></div>
</div>
<div
class=
"grafana-target-inner
"
style=
"margin-top: 10px"
>
<ul
class=
"grafana-segment
-list"
>
<li
class=
"grafana-target-segment
"
style=
"width: 80px"
>
<div
class=
"tight-form
"
style=
"margin-top: 10px"
>
<ul
class=
"tight-form
-list"
>
<li
class=
"tight-form-item
"
style=
"width: 80px"
>
<strong>
Email
</strong>
</li>
<li>
<input
type=
"text"
ng-model=
"account.email"
class=
"input-xxlarge grafana-target-segment
-input last"
>
<input
type=
"text"
ng-model=
"account.email"
class=
"input-xxlarge tight-form
-input last"
>
</li>
</ul>
<div
class=
"clearfix"
></div>
</div>
<div
class=
"grafana-target-inner
"
style=
"margin-top: 10px"
>
<ul
class=
"grafana-segment
-list"
>
<li
class=
"grafana-target-segment
"
style=
"width: 80px"
>
<div
class=
"tight-form
"
style=
"margin-top: 10px"
>
<ul
class=
"tight-form
-list"
>
<li
class=
"tight-form-item
"
style=
"width: 80px"
>
<strong>
Username
</strong>
</li>
<li>
<input
type=
"text"
ng-model=
"account.login"
class=
"input-xxlarge grafana-target-segment
-input last"
>
<input
type=
"text"
ng-model=
"account.login"
class=
"input-xxlarge tight-form
-input last"
>
</li>
</ul>
<div
class=
"clearfix"
></div>
</div>
</div>
<br>
<button
type=
"submit"
class=
"btn btn-success"
ng-click=
"update()"
>
Update
</button>
...
...
src/app/features/account/partials/collaborators.html
View file @
500e0006
<div
ng-include=
"'app/partials/navbar.html'"
ng-init=
"pageTitle='Account > Collaborators'"
></div>
<div
class=
"dashboard-edit-view"
>
<div
class=
"dashboard-edit-view"
style=
"min-height: 500px"
>
<div
class=
"dashboard-editor-header"
>
<div
class=
"dashboard-editor-title"
>
...
...
@@ -12,15 +12,34 @@
<div
class=
"dashboard-editor-body"
>
<div
class=
"editor-row"
>
<div
class=
"editor-option"
>
<form
name=
"addCollaboratorForm"
class=
"form-inline"
>
<label
class=
"small"
>
Add a collaborator
</label>
<input
type=
"text"
class=
"input-xxlarge"
ng-model=
'collaborator.email'
placeholder=
"collaborator@email.com"
></input>
<button
class=
"btn btn-success"
ng-click=
"addCollaborator()"
>
Add
</button>
<div
class=
"section"
>
<form
name=
"form"
>
<div
class=
"tight-form"
>
<ul
class=
"tight-form-list"
>
<li
class=
"tight-form-item"
style=
"width: 160px"
>
<strong>
Username or Email
</strong>
</li>
<li>
<input
type=
"text"
ng-model=
"collaborator.loginOrEmail"
required
class=
"input-xlarge tight-form-input"
placeholder=
"collaborator@email.com"
>
</li>
<li
class=
"tight-form-item"
>
Role
</li>
<li>
<select
type=
"text"
ng-model=
"collaborator.role"
class=
"input-small tight-form-input"
ng-options=
"f for f in ['Viewer', 'Editor2', 'Admin']"
>
</select>
</li>
<li>
<button
class=
"btn btn-success tight-form-btn"
ng-click=
"addCollaborator()"
>
Add
</button>
</li>
</ul>
<div
class=
"clearfix"
></div>
</div>
</form>
</div>
</div>
<div
class=
"editor-row row"
>
<table
class=
"grafana-options-table span5"
>
<tr
ng-repeat=
"collaborator in collaborators"
>
...
...
src/app/services/backendSrv.js
View file @
500e0006
...
...
@@ -42,6 +42,11 @@ function (angular, _, config) {
}
return
results
.
data
;
},
function
(
err
)
{
if
(
err
.
status
===
422
)
{
alertSrv
.
set
(
"Validation failed"
,
""
,
"warning"
,
4000
);
throw
err
.
data
;
}
var
data
=
err
.
data
||
{
message
:
'Unexpected error'
};
if
(
_
.
isString
(
data
))
{
...
...
src/css/less/tightform.less
View file @
500e0006
...
...
@@ -23,6 +23,10 @@
}
}
.tight-form-btn {
padding: 8px 12px;
}
// old graphite-segment-list
.tight-form-list {
list-style: none;
...
...
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