1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-02 20:35:25 +02:00

feat(UX): UX/responsiveness enhancements

This commit is contained in:
Anthony Lapenna 2017-03-27 14:44:39 +02:00 committed by GitHub
parent 967286f45d
commit c243a02e7a
31 changed files with 710 additions and 509 deletions

View file

@ -51,21 +51,22 @@
<!-- !confirm-password-input -->
<!-- role-checkbox -->
<div class="form-group">
<label for="permissions" class="col-sm-2 control-label text-left">Permissions</label>
<div class="col-sm-8">
<div class="btn-group btn-group-sm">
<label class="btn btn-default" ng-model="formValues.Role" uib-btn-radio="2">
<i class="fa fa-user" aria-hidden="true"></i>
User
</label>
<label class="btn btn-default" ng-model="formValues.Role" uib-btn-radio="1">
<i class="fa fa-user-circle-o" aria-hidden="true"></i>
Administrator
</label>
</div>
<div class="col-sm-12">
<label for="permissions" class="control-label text-left">
Administrator
<portainer-tooltip position="bottom" message="Administrators have access to Portainer settings management as well as full control over all defined endpoints and their resources."></portainer-tooltip>
</label>
<label class="switch" style="margin-left: 20px;">
<input type="checkbox" ng-model="formValues.Administrator"><i></i>
</label>
</div>
</div>
<!-- !role-checkbox -->
<div class="form-group">
<div class="col-sm-12">
<span class="small text-muted">Note: non-administrator users do not have access to any endpoint by default. Head over the <a ui-sref="endpoints">endpoints view</a> to manage their accesses.</span>
</div>
</div>
<div class="form-group">
<div class="col-sm-12">
<button type="button" class="btn btn-primary btn-sm" ng-disabled="!state.validUsername || formValues.Username === '' || formValues.Password === '' || formValues.Password !== formValues.ConfirmPassword" ng-click="addUser()"><i class="fa fa-user-plus" aria-hidden="true"></i> Add user</button>

View file

@ -14,7 +14,7 @@ function ($scope, $state, UserService, ModalService, Messages, Pagination) {
Username: '',
Password: '',
ConfirmPassword: '',
Role: 2,
Administrator: false,
};
$scope.order = function(sortType) {
@ -59,7 +59,7 @@ function ($scope, $state, UserService, ModalService, Messages, Pagination) {
$scope.state.userCreationError = '';
var username = $scope.formValues.Username;
var password = $scope.formValues.Password;
var role = $scope.formValues.Role;
var role = $scope.formValues.Administrator ? 1 : 2;
UserService.createUser(username, password, role)
.then(function success(data) {
Messages.send("User created", username);