Users: show badges for each auth provider (#17869)

* Users: show badges for each auth provider

* Chore: don't use functions in angular bindings

* Users: minor style changes to labels

* Chore: convert auth labels on the backed side, deduplicate frontend code

* Users: use authLabels everywhere instead of authModule

* User: fix edit user page style

* Users: minor fixes after review
This commit is contained in:
Alexander Zobnin
2019-07-10 12:06:51 +03:00
committed by GitHub
parent ebff883016
commit 5f0a7f43c3
7 changed files with 99 additions and 60 deletions

View File

@@ -118,48 +118,52 @@
<h3 class="page-heading">Sessions</h3>
<div class="gf-form-group">
<table class="filter-table form-inline">
<thead>
<tr>
<th>Last seen</th>
<th>Logged on</th>
<th>IP address</th>
<th>Browser &amp; OS</th>
<th></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="session in sessions">
<td ng-if="session.isActive">Now</td>
<td ng-if="!session.isActive">{{session.seenAt}}</td>
<td>{{session.createdAt}}</td>
<td>{{session.clientIp}}</td>
<td>{{session.browser}} on {{session.os}} {{session.osVersion}}</td>
<td>
<button class="btn btn-danger btn-small" ng-click="revokeUserSession(session.id)">
<i class="fa fa-power-off"></i>
</button>
</td>
</tr>
</tbody>
</table>
<div class="gf-form">
<table class="filter-table form-inline">
<thead>
<tr>
<th>Last seen</th>
<th>Logged on</th>
<th>IP address</th>
<th>Browser &amp; OS</th>
<th></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="session in sessions">
<td ng-if="session.isActive">Now</td>
<td ng-if="!session.isActive">{{session.seenAt}}</td>
<td>{{session.createdAt}}</td>
<td>{{session.clientIp}}</td>
<td>{{session.browser}} on {{session.os}} {{session.osVersion}}</td>
<td>
<button class="btn btn-danger btn-small" ng-click="revokeUserSession(session.id)">
<i class="fa fa-power-off"></i>
</button>
</td>
</tr>
</tbody>
</table>
</div>
<div class="gf-form-button-row">
<button ng-if="sessions.length" class="btn btn-danger" ng-click="revokeAllUserSessions()">
Logout user from all devices
</button>
</div>
</div>
<button ng-if="sessions.length" class="btn btn-danger" ng-click="revokeAllUserSessions()">
Logout user from all devices
</button>
<h3 class="page-heading">User status</h3>
<div class="gf-form-group">
<h3 class="page-heading">User status</h3>
<div class="gf-form-button-row">
<button
type="submit"
class="btn btn-danger"
ng-if="!user.isDisabled"
ng-click="disableUser($event)"
bs-tooltip="user.authModule ? 'External user cannot be activated or deactivated' : ''"
ng-class="{'disabled': user.authModule}"
bs-tooltip="user.isExternal ? 'External user cannot be enabled or disabled' : ''"
ng-class="{'disabled': user.isExternal}"
>
Disable
</button>
@@ -168,8 +172,8 @@
class="btn btn-primary"
ng-if="user.isDisabled"
ng-click="disableUser($event)"
bs-tooltip="user.authModule ? 'External user cannot be activated or deactivated' : ''"
ng-class="{'disabled': user.authModule}"
bs-tooltip="user.isExternal ? 'External user cannot be enabled or disabled' : ''"
ng-class="{'disabled': user.isExternal}"
>
Enable
</button>

View File

@@ -55,7 +55,9 @@
</a>
</td>
<td class="text-right">
<span class="label label-tag" ng-class="{'muted': user.isDisabled}" ng-if="ctrl.getAuthModule(user) === 'ldap'">LDAP</span>
<span class="label label-tag" ng-style="user.authLabelStyle" ng-if="user.authLabel">
{{user.authLabel}}
</span>
</td>
<td class="text-right">
<span class="label label-tag label-tag--gray" ng-if="user.isDisabled">Disabled</span>