329 lines
21 KiB
HTML
329 lines
21 KiB
HTML
<!-- Modal add user -->
|
|
<div class="modal fade" id="userAddModal" tabindex="-1" role="dialog">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h4 class="modal-title">Add User</h4>
|
|
</div>
|
|
<div class="modal-body">
|
|
<form name="useradd_form" role="form" ng-submit="doAdd()" autocomplete="off">
|
|
<input type="password" style="display: none;">
|
|
<div class="form-group" ng-class="{ 'has-error': (useradd_form.email.$dirty && useradd_form.email.$invalid) || (!useradd_form.email.$dirty && useradd.error.email) }">
|
|
<label class="control-label">Email</label>
|
|
<div class="control-label" ng-show="(!useradd_form.email.$dirty && useradd.error.email) || (useradd_form.email.$dirty && useradd_form.email.$invalid) || (!useradd_form.email.$dirty && useradd.error.email)">
|
|
<small ng-show="useradd_form.email.$error.required">An email is required</small>
|
|
<small ng-show="useradd_form.email.$error.email">This is not a valid email</small>
|
|
<small ng-show="!useradd_form.email.$dirty && useradd.error.email">{{ useradd.error.email }}</small>
|
|
</div>
|
|
<input type="email" class="form-control" ng-model="useradd.email" name="email" id="inputUserAddEmail" required autofocus>
|
|
</div>
|
|
|
|
<div class="form-group" ng-class="{ 'has-error': (useradd_form.username.$dirty && useradd_form.username.$invalid) || (!useradd_form.username.$dirty && useradd.error.username) }">
|
|
<label class="control-label">Username (optional)</label>
|
|
<div class="control-label" ng-show="(!useradd_form.username.$dirty && useradd.error.username) || (useradd_form.username.$dirty && useradd_form.username.$invalid) || (!useradd_form.username.$dirty && useradd.error.username)">
|
|
<small ng-show="useradd_form.username.$error.username">This is not a valid username</small>
|
|
<small ng-show="!useradd_form.username.$dirty && useradd.error.username">{{ useradd.error.username }}</small>
|
|
</div>
|
|
<input type="text" class="form-control" ng-model="useradd.username" name="username" id="inputUserAddUsername" placeholder="If empty, the user can choose on his own">
|
|
</div>
|
|
|
|
<div class="form-group" ng-class="{ 'has-error': (useradd_form.displayName.$dirty && useradd_form.displayName.$invalid) || (!useradd_form.displayName.$dirty && useradd.error.displayName) }">
|
|
<label class="control-label">Display Name (optional)</label>
|
|
<div class="control-label" ng-show="(!useradd_form.displayName.$dirty && useradd.error.displayName) || (useradd_form.displayName.$dirty && useradd_form.displayName.$invalid) || (!useradd_form.displayName.$dirty && useradd.error.displayName)">
|
|
<small ng-show="useradd_form.displayName.$error.displayName">This is not a valid displayName</small>
|
|
<small ng-show="!useradd_form.displayName.$dirty && useradd.error.displayName">{{ useradd.error.displayName }}</small>
|
|
</div>
|
|
<input type="text" class="form-control" ng-model="useradd.displayName" name="displayName" id="inputUserAddDisplayName" placeholder="If empty, the user can choose on his own">
|
|
</div>
|
|
|
|
<div class="checkbox">
|
|
<label>
|
|
<input type="checkbox" ng-model="useradd.sendInvite" id="inputUserAddSendInvite"> Send invite
|
|
</label>
|
|
</div>
|
|
<input class="ng-hide" type="submit" ng-disabled="useradd_form.$invalid || useradd.busy"/>
|
|
</form>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
|
|
<button type="button" class="btn btn-success" ng-click="doAdd()" ng-disabled="useradd_form.$invalid || useradd.busy"><i class="fa fa-spinner fa-pulse" ng-show="useradd.busy"></i> Add User</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Modal remove user -->
|
|
<div class="modal fade" id="userRemoveModal" tabindex="-1" role="dialog">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h4 class="modal-title">Delete user {{ userremove.userInfo.username }}</h4>
|
|
</div>
|
|
<div class="modal-body">
|
|
<form name="userremove_form" role="form" ng-submit="doUserRemove()" autocomplete="off">
|
|
<input type="password" style="display: none;">
|
|
<div class="form-group" ng-class="{ 'has-error': (userremove_form.username.$dirty && userremove_form.username.$invalid) || (!userremove_form.username.$dirty && userremove.error.username) }">
|
|
<label class="control-label">Just to be sure you really want to delete this user, please type the username or email</label>
|
|
<div class="control-label" ng-show="(!userremove_form.username.$dirty && userremove.error.username) || (userremove_form.username.$dirty && userremove_form.username.$invalid)">
|
|
<small ng-show="userremove_form.username.$dirty && userremove_form.username.$error.required">A username is required</small>
|
|
<small ng-show="!userremove_form.username.$dirty && userremove.error.username">Username or Email does not match</small>
|
|
</div>
|
|
<input type="text" class="form-control" ng-model="userremove.username" id="inputUserRemoveUsername" name="username" placeholder="Username or Email" required autofocus>
|
|
</div>
|
|
<div class="form-group" ng-class="{ 'has-error': (userremove_form.password.$dirty && userremove_form.password.$invalid) || (!userremove_form.password.$dirty && userremove.error.password)}">
|
|
<label class="control-label">Give your password to verify that you are performing that action</label>
|
|
<div class="control-label" ng-show="(!userremove_form.password.$dirty && userremove.error.password) || (userremove_form.password.$dirty && userremove_form.password.$invalid)">
|
|
<small ng-show="userremove_form.password.$error.required && !userremove.error.password">A password is required</small>
|
|
<small ng-show="!useradd_form.email.$dirty && userremove.error.password">{{ userremove.error.password }}</small>
|
|
</div>
|
|
<input type="password" class="form-control" ng-model="userremove.password" id="inputUserRemovePassword" name="password" placeholder="Password" required>
|
|
</div>
|
|
<input class="hide" type="submit" ng-disabled="userremove_form.$invalid || userremove.busy"/>
|
|
</form>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
|
<button type="button" class="btn btn-danger" ng-click="doUserRemove()" ng-disabled="userremove_form.$invalid || userremove.busy"><i class="fa fa-spinner fa-pulse" ng-show="userremove.busy"></i> Delete</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Modal edit user -->
|
|
<div class="modal fade" id="userEditModal" tabindex="-1" role="dialog">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h4 class="modal-title">Edit user {{ useredit.userInfo.username }}</h4>
|
|
</div>
|
|
<div class="modal-body">
|
|
<form name="useredit_form" role="form" ng-submit="doUserEdit()" autocomplete="off">
|
|
<input type="password" style="display: none;">
|
|
<div class="form-group" ng-class="{ 'has-error': (useredit_form.email.$dirty && useredit_form.email.$invalid) || (!useredit_form.email.$dirty && useredit.error.email) }">
|
|
<label class="control-label">Email</label>
|
|
<div class="control-label" ng-show="(!useredit_form.email.$dirty && useredit.error.email) || (useredit_form.email.$dirty && useredit_form.email.$invalid) || (!useredit_form.email.$dirty && useredit.error.email)">
|
|
<small ng-show="useredit_form.email.$error.required">An email is required</small>
|
|
<small ng-show="useredit_form.email.$error.email">This is not a valid email</small>
|
|
<small ng-show="!useredit_form.email.$dirty && useredit.error.email">{{ useredit.error.email }}</small>
|
|
</div>
|
|
<input type="email" class="form-control" ng-model="useredit.email" name="email" required>
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="control-label">Groups</label>
|
|
<div>
|
|
<span ng-repeat="group in groups | ignoreAdminGroup" ng-show="group.id !== 'admin'">
|
|
<button class="btn btn-default" type="button" ng-click="userEditToggleGroup(group);" ng-class="{ 'btn-primary': (useredit.groupIds.indexOf(group.id) !== -1) }">{{ group.name }}</button>
|
|
</span>
|
|
</div>
|
|
<div ng-show="groups.length <= 1">No groups available.</div>
|
|
</div>
|
|
<div class="form-group" ng-show="useredit.userInfo.username && (config.isDev || config.isCustomDomain)">
|
|
<label class="control-label">Email aliases</label>
|
|
|
|
<div class="input-group form-inline">
|
|
<tag-input class="form-group form-control" placeholder='Separate aliases by comma' taglist='useredit.aliases'></tag-input>
|
|
<div class="input-group-addon">
|
|
@{{ config.fqdn }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<br/>
|
|
<div class="form-group" ng-hide="isMe(useredit.userInfo)">
|
|
<div class="checkbox">
|
|
<label>
|
|
<input type="checkbox" ng-model="useredit.superuser"> Allow this user to manage apps, groups and other users
|
|
</label>
|
|
</div>
|
|
</div>
|
|
<input class="hide" type="submit" ng-disabled="useredit_form.$invalid || useredit.busy"/>
|
|
</form>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
|
<button type="button" class="btn btn-success" ng-click="doUserEdit()" ng-disabled="useredit_form.$invalid || useredit.busy"><i class="fa fa-spinner fa-pulse" ng-show="useredit.busy"></i> Save</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Modal add group -->
|
|
<div class="modal fade" id="groupAddModal" tabindex="-1" role="dialog">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h4 class="modal-title">Add Group</h4>
|
|
</div>
|
|
<div class="modal-body">
|
|
<form name="groupAddForm" role="form" novalidate ng-submit="groupAdd.submit()" autocomplete="off">
|
|
<div class="form-group" ng-class="{ 'has-error': (groupAddForm.name.$dirty && groupAddForm.name.$invalid) || (!groupAddForm.name.$dirty && groupAdd.error.name) }">
|
|
<label class="control-label" for="groupAddName">Name</label>
|
|
<div class="control-label" ng-show="(!groupAddForm.name.$dirty && groupAdd.error.name) || (groupAddForm.name.$dirty && groupAddForm.name.$invalid) || (!groupAddForm.name.$dirty && groupAdd.error.name)">
|
|
<small ng-show="groupAddForm.name.$error.required">A name is required</small>
|
|
<small ng-show="groupAddForm.name.$error.minlength">The name is too short</small>
|
|
<small ng-show="groupAddForm.name.$error.maxlength">The name is too long</small>
|
|
<small ng-show="!groupAddForm.name.$dirty && groupAdd.error.name">{{ groupAdd.error.name }}</small>
|
|
</div>
|
|
<input type="text" class="form-control" ng-model="groupAdd.name" id="groupAddName" name="name" ng-maxlength="200" ng-minlength="2" required autofocus>
|
|
</div>
|
|
<input class="hide" type="submit" ng-disabled="groupAddForm.$invalid || groupAdd.busy"/>
|
|
</form>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
|
|
<button type="button" class="btn btn-success" ng-click="groupAdd.submit()" ng-disabled="groupAddForm.$invalid || groupAdd.busy"><i class="fa fa-spinner fa-pulse" ng-show="groupAdd.busy"></i> Add Group</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Modal remove group -->
|
|
<div class="modal fade" id="groupRemoveModal" tabindex="-1" role="dialog">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h4 class="modal-title">Delete group {{ groupRemove.group.name }}</h4>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div ng-show="groupRemove.memberCount" class="text-danger">
|
|
<b>This group still has {{ groupRemove.memberCount }} member(s). Are you sure this group is not used?</b>
|
|
<br/>
|
|
<br/>
|
|
</div>
|
|
|
|
<form name="groupRemoveForm" role="form" novalidate ng-submit="groupRemove.submit()" autocomplete="off">
|
|
<input type="password" style="display: none;">
|
|
<div class="form-group" ng-class="{ 'has-error': (groupRemoveForm.password.$dirty && groupRemoveForm.password.$invalid) || (!groupRemoveForm.password.$dirty && groupRemove.error.password)}">
|
|
<label class="control-label" for="groupRemovePasswordInput">Give your password to verify that you are performing that action</label>
|
|
<div class="control-label" ng-show="(!groupRemoveForm.password.$dirty && groupRemove.error.password) || (groupRemoveForm.password.$dirty && groupRemoveForm.password.$invalid)">
|
|
<small ng-show="groupRemoveForm.password.$error.required && !groupRemove.error.password">A password is required</small>
|
|
<small ng-show="!groupRemoveForm.password.$dirty && groupRemove.error.password">{{ groupRemove.error.password }}</small>
|
|
</div>
|
|
<input type="password" class="form-control" ng-model="groupRemove.password" id="groupRemovePasswordInput" name="password" placeholder="Password" required autofocus>
|
|
</div>
|
|
<input class="hide" type="submit" ng-disabled="groupRemoveForm.$invalid || groupRemove.busy"/>
|
|
</form>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
|
<button type="button" class="btn btn-danger" ng-click="groupRemove.submit()" ng-disabled="groupRemoveForm.$invalid || groupRemove.busy"><i class="fa fa-spinner fa-pulse" ng-show="groupRemove.busy"></i> Delete</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Modal invite sent -->
|
|
<div class="modal fade" id="inviteSentModal" tabindex="-1" role="dialog">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h4 class="modal-title">Invite Sent</h4>
|
|
</div>
|
|
<div class="modal-body">
|
|
<p>An email has been sent to <b>{{ inviteSent.email }}</b>.</p>
|
|
<p>You can also share this invite link directly.</p>
|
|
<p ng-click-select>{{ inviteSent.setupLink }}</p>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">Ok</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="content-large">
|
|
|
|
<br/>
|
|
|
|
<div>
|
|
<div class="text-left">
|
|
<h1>Users <button class="btn btn-primary btn-outline pull-right" ng-click="showUserAdd()"><i class="fa fa-user-plus"></i> New User</button></h1>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card card-large">
|
|
<div class="grid-item-top">
|
|
<div class="row ng-hide" ng-show="!ready">
|
|
<div class="col-lg-12 text-center">
|
|
<h2><i class="fa fa-spinner fa-pulse"></i></h2>
|
|
</div>
|
|
</div>
|
|
<div class="row animateMeOpacity ng-hide" ng-show="ready">
|
|
<div class="col-lg-12">
|
|
<table class="table table-hover">
|
|
<thead>
|
|
<tr>
|
|
<th style="width: 1px;"></th>
|
|
<th style="">User</th>
|
|
<th style="" class="text-left hidden-xs hidden-sm">Groups</th>
|
|
<th style="width: 100px" class="text-right">Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr ng-repeat="user in users">
|
|
<td>
|
|
<i class="fa fa-briefcase" ng-show="user.admin" data-toggle="tooltip" title="This user can manage apps, groups and other users" ng-init="initTooltip()"></i>
|
|
</td>
|
|
<td class="hand elide-table-cell" ng-click="showUserEdit(user)">
|
|
{{ user.username }}
|
|
<span class="text-muted">{{ user.email }}</span>
|
|
</td>
|
|
<td class="text-left hand elide-table-cell hidden-xs hidden-sm" ng-click="showUserEdit(user)">
|
|
<span class="group-badge" ng-repeat="groupId in user.groupIds | ignoreAdminGroup">{{ groupId }}</span>
|
|
</td>
|
|
<td class="text-right no-wrap" style="vertical-align: bottom">
|
|
<button ng-show="!isMe(user)" class="btn btn-xs btn-default" ng-click="sendInvite(user)" title="Send Invite"><i class="fa fa-paper-plane-o"></i></button>
|
|
<button class="btn btn-xs btn-default" ng-click="showUserEdit(user)" title="Edit User Profile"><i class="fa fa-pencil"></i></button>
|
|
<button ng-show="!isMe(user)" class="btn btn-xs btn-danger" ng-click="showUserRemove(user)" title="Remove User"><i class="fa fa-trash-o"></i></button>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<br/>
|
|
|
|
<div>
|
|
<div class="text-left">
|
|
<h1>Groups <button class="btn btn-primary btn-outline pull-right" ng-click="groupAdd.show()"><i class="fa fa-plus"></i> New Group</button></h1>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card card-large">
|
|
<div class="grid-item-top">
|
|
<div class="row ng-hide" ng-show="!ready">
|
|
<div class="col-lg-12 text-center">
|
|
<h2><i class="fa fa-spinner fa-pulse"></i></h2>
|
|
</div>
|
|
</div>
|
|
<div class="row animateMeOpacity ng-hide" ng-show="ready">
|
|
<div class="col-lg-12">
|
|
<table class="table table-hover">
|
|
<thead>
|
|
<tr>
|
|
<th style="">Name</th>
|
|
<th style="width: 300px" class="text-right">Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr ng-repeat="group in groups | ignoreAdminGroup">
|
|
<td class="text-overflow: ellipsis; white-space: nowrap;">
|
|
{{ group.name }}
|
|
</td>
|
|
<td class="text-right" style="vertical-align: bottom">
|
|
<button class="btn btn-xs btn-danger" ng-click="groupRemove.show(group)" title="Remove Group"><i class="fa fa-trash-o"></i></button>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Offset the footer -->
|
|
<br/><br/>
|