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
908bf8e8
Commit
908bf8e8
authored
Oct 02, 2018
by
Peter Holmberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
deleting obsolete things
parent
cc579950
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
194 deletions
+0
-194
public/app/features/org/all.ts
+0
-2
public/app/features/org/org_users_ctrl.ts
+0
-87
public/app/features/org/partials/orgUsers.html
+0
-105
No files found.
public/app/features/org/all.ts
View file @
908bf8e8
import
'./org_users_ctrl'
;
import
'./profile_ctrl'
;
import
'./org_users_ctrl'
;
import
'./select_org_ctrl'
;
import
'./change_password_ctrl'
;
import
'./new_org_ctrl'
;
...
...
public/app/features/org/org_users_ctrl.ts
deleted
100644 → 0
View file @
cc579950
import
config
from
'app/core/config'
;
import
coreModule
from
'app/core/core_module'
;
import
Remarkable
from
'remarkable'
;
import
_
from
'lodash'
;
export
class
OrgUsersCtrl
{
unfiltered
:
any
;
users
:
any
;
pendingInvites
:
any
;
editor
:
any
;
navModel
:
any
;
externalUserMngLinkUrl
:
string
;
externalUserMngLinkName
:
string
;
externalUserMngInfo
:
string
;
canInvite
:
boolean
;
searchQuery
:
string
;
showInvites
:
boolean
;
/** @ngInject */
constructor
(
private
$scope
,
private
backendSrv
,
navModelSrv
,
$sce
)
{
this
.
navModel
=
navModelSrv
.
getNav
(
'cfg'
,
'users'
,
0
);
this
.
get
();
this
.
externalUserMngLinkUrl
=
config
.
externalUserMngLinkUrl
;
this
.
externalUserMngLinkName
=
config
.
externalUserMngLinkName
;
this
.
canInvite
=
!
config
.
disableLoginForm
&&
!
config
.
externalUserMngLinkName
;
// render external user management info markdown
if
(
config
.
externalUserMngInfo
)
{
this
.
externalUserMngInfo
=
new
Remarkable
({
linkTarget
:
'__blank'
,
}).
render
(
config
.
externalUserMngInfo
);
}
}
get
()
{
this
.
backendSrv
.
get
(
'/api/org/users'
).
then
(
users
=>
{
this
.
users
=
users
;
this
.
unfiltered
=
users
;
});
this
.
backendSrv
.
get
(
'/api/org/invites'
).
then
(
pendingInvites
=>
{
this
.
pendingInvites
=
pendingInvites
;
});
}
onQueryUpdated
()
{
const
regex
=
new
RegExp
(
this
.
searchQuery
,
'ig'
);
this
.
users
=
_
.
filter
(
this
.
unfiltered
,
item
=>
{
return
regex
.
test
(
item
.
email
)
||
regex
.
test
(
item
.
login
);
});
}
updateOrgUser
(
user
)
{
this
.
backendSrv
.
patch
(
'/api/org/users/'
+
user
.
userId
,
user
);
}
removeUser
(
user
)
{
this
.
$scope
.
appEvent
(
'confirm-modal'
,
{
title
:
'Delete'
,
text
:
'Are you sure you want to delete user '
+
user
.
login
+
'?'
,
yesText
:
'Delete'
,
icon
:
'fa-warning'
,
onConfirm
:
()
=>
{
this
.
removeUserConfirmed
(
user
);
},
});
}
removeUserConfirmed
(
user
)
{
this
.
backendSrv
.
delete
(
'/api/org/users/'
+
user
.
userId
).
then
(
this
.
get
.
bind
(
this
));
}
revokeInvite
(
invite
,
evt
)
{
evt
.
stopPropagation
();
this
.
backendSrv
.
patch
(
'/api/org/invites/'
+
invite
.
code
+
'/revoke'
).
then
(
this
.
get
.
bind
(
this
));
}
copyInviteToClipboard
(
evt
)
{
evt
.
stopPropagation
();
}
getInviteUrl
(
invite
)
{
return
invite
.
url
;
}
}
coreModule
.
controller
(
'OrgUsersCtrl'
,
OrgUsersCtrl
);
public/app/features/org/partials/orgUsers.html
deleted
100644 → 0
View file @
cc579950
<page-header
model=
"ctrl.navModel"
></page-header>
<div
class=
"page-container page-body"
>
<div
class=
"page-action-bar"
>
<label
class=
"gf-form gf-form--has-input-icon"
>
<input
type=
"text"
class=
"gf-form-input width-20"
ng-model=
"ctrl.searchQuery"
ng-change=
"ctrl.onQueryUpdated()"
placeholder=
"Filter by username or email"
/>
<i
class=
"gf-form-input-icon fa fa-search"
></i>
</label>
<div
ng-if=
"ctrl.pendingInvites.length"
style=
"margin-left: 1rem"
>
<button
class=
"btn toggle-btn active"
ng-if=
"!ctrl.showInvites"
>
Users
</button><button
class=
"btn toggle-btn"
ng-if=
"!ctrl.showInvites"
ng-click=
"ctrl.showInvites = true"
>
Pending Invites ({{ctrl.pendingInvites.length}})
</button>
<button
class=
"btn toggle-btn"
ng-if=
"ctrl.showInvites"
ng-click=
"ctrl.showInvites = false"
>
Users
</button><button
class=
"btn toggle-btn active"
ng-if=
"ctrl.showInvites"
>
Pending Invites ({{ctrl.pendingInvites.length}})
</button>
</div>
<div
class=
"page-action-bar__spacer"
></div>
<a
class=
"btn btn-success"
href=
"org/users/invite"
ng-show=
"ctrl.canInvite"
>
<i
class=
"fa fa-plus"
></i>
<span>
Invite
</span>
</a>
<a
class=
"btn btn-success"
ng-href=
"{{ctrl.externalUserMngLinkUrl}}"
target=
"_blank"
ng-if=
"ctrl.externalUserMngLinkUrl"
>
<i
class=
"fa fa-external-link-square"
></i>
{{ctrl.externalUserMngLinkName}}
</a>
</div>
<div
class=
"grafana-info-box"
ng-if=
"ctrl.externalUserMngInfo"
>
<span
ng-bind-html=
"ctrl.externalUserMngInfo"
></span>
</div>
<div
ng-hide=
"ctrl.showInvites"
>
<table
class=
"filter-table form-inline"
>
<thead>
<tr>
<th></th>
<th>
Login
</th>
<th>
Email
</th>
<th>
Seen
<tip>
Time since user was seen using Grafana
</tip>
</th>
<th>
Role
</th>
<th
style=
"width: 34px;"
></th>
</tr>
</thead>
<tr
ng-repeat=
"user in ctrl.users"
>
<td
class=
"width-4 text-center"
>
<img
class=
"filter-table__avatar"
ng-src=
"{{user.avatarUrl}}"
></img>
</td>
<td>
{{user.login}}
</td>
<td><span
class=
"ellipsis"
>
{{user.email}}
</span></td>
<td>
{{user.lastSeenAtAge}}
</td>
<td>
<div
class=
"gf-form-select-wrapper width-12"
>
<select
type=
"text"
ng-model=
"user.role"
class=
"gf-form-input"
ng-options=
"f for f in ['Viewer', 'Editor', 'Admin']"
ng-change=
"ctrl.updateOrgUser(user)"
>
</select>
</div>
</td>
<td>
<a
ng-click=
"ctrl.removeUser(user)"
class=
"btn btn-danger btn-mini"
>
<i
class=
"fa fa-remove"
></i>
</a>
</td>
</tr>
</table>
</div>
<div
ng-if=
"ctrl.showInvites"
>
<table
class=
"filter-table form-inline"
>
<thead>
<tr>
<th>
Email
</th>
<th>
Name
</th>
<th></th>
<th
style=
"width: 34px;"
></th>
</tr>
</thead>
<tr
ng-repeat=
"invite in ctrl.pendingInvites"
>
<td>
{{invite.email}}
</td>
<td>
{{invite.name}}
</td>
<td
class=
"text-right"
>
<button
class=
"btn btn-inverse btn-mini"
clipboard-button=
"ctrl.getInviteUrl(invite)"
ng-click=
"ctrl.copyInviteToClipboard($event)"
>
<i
class=
"fa fa-clipboard"
></i>
Copy Invite
</button>
</td>
<td>
<button
class=
"btn btn-danger btn-mini"
ng-click=
"ctrl.revokeInvite(invite, $event)"
>
<i
class=
"fa fa-remove"
></i>
</button>
</td>
</tr>
</table>
</div>
</div>
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