add user view
This commit is contained in:
@@ -102,6 +102,7 @@
|
||||
<script src="scripts/controllers/about.js"></script>
|
||||
<script src="scripts/controllers/new_server.js"></script>
|
||||
<script src="scripts/controllers/settings.js"></script>
|
||||
<script src="scripts/controllers/new_user.js"></script>
|
||||
<!-- endbuild -->
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -38,6 +38,9 @@ angular.module('xoWebApp', [
|
||||
.when '/settings',
|
||||
templateUrl: 'views/settings.html'
|
||||
controller: 'SettingsCtrl'
|
||||
.when '/user/new',
|
||||
templateUrl: 'views/new_user.html'
|
||||
controller: 'NewUserCtrl'
|
||||
.otherwise
|
||||
redirectTo: '/'
|
||||
|
||||
|
||||
9
app/scripts/controllers/new_user.coffee
Normal file
9
app/scripts/controllers/new_user.coffee
Normal file
@@ -0,0 +1,9 @@
|
||||
'use strict'
|
||||
|
||||
angular.module('xoWebApp')
|
||||
.controller 'NewUserCtrl', ($scope) ->
|
||||
$scope.awesomeThings = [
|
||||
'HTML5 Boilerplate'
|
||||
'AngularJS'
|
||||
'Karma'
|
||||
]
|
||||
39
app/views/new_user.html
Normal file
39
app/views/new_user.html
Normal file
@@ -0,0 +1,39 @@
|
||||
<!-- TODO: lots of stuff. -->
|
||||
<div class="grid">
|
||||
<div class="grid-cell flat-panel">
|
||||
<p class="page-title"><i class="fa fa-plus-circle"></i> Add user</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Add server panel -->
|
||||
<div class="grid">
|
||||
<div class="grid-cell flat-panel">
|
||||
<p class="flat-panel-title"><i class="fa fa-user" style="color: #e25440;"></i> User info</p>
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><i class="fa fa-user fa-fw"></i></span>
|
||||
<input class="form-control" name="username" placeholder="Enter user" type="text">
|
||||
</div>
|
||||
<br/>
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><i class="fa fa-key fa-fw"></i></span>
|
||||
<input class="form-control" name="password" placeholder="Enter password" type="password">
|
||||
</div>
|
||||
<br/>
|
||||
<select class="form-control input-sm">
|
||||
<option>Admin</option>
|
||||
<option>Write</option>
|
||||
<option>Read</option>
|
||||
</select>
|
||||
<br/>
|
||||
<p class="text-center"><a class="btn btn-primary big"><i class="fa fa-times"></i> Clear</a> <a class="btn btn-success big"><i class="fa fa-save"></i> Save</a></p>
|
||||
</div>
|
||||
<div class="grid-cell flat-panel">
|
||||
<p class="flat-panel-title"><i class="fa fa-lightbulb-o" style="color: #e25440;"></i> Notice</p>
|
||||
<ul>
|
||||
<li>Users are only created in Xen Orchestra, not in XAPI</li>
|
||||
<li>"Admin" user can do everything (add/remove/edit other users, add or remove servers etc.)</li>
|
||||
<li>"Write" permissions are the same as "Admin" without the possibily to modify other users</li>
|
||||
<li>"Read" allows to see everything without any rights to modify</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
19
test/spec/controllers/new_user.coffee
Normal file
19
test/spec/controllers/new_user.coffee
Normal file
@@ -0,0 +1,19 @@
|
||||
'use strict'
|
||||
|
||||
describe 'Controller: NewUserCtrl', () ->
|
||||
|
||||
# load the controller's module
|
||||
beforeEach module 'xoWebApp'
|
||||
|
||||
NewUserCtrl = {}
|
||||
scope = {}
|
||||
|
||||
# Initialize the controller and a mock scope
|
||||
beforeEach inject ($controller, $rootScope) ->
|
||||
scope = $rootScope.$new()
|
||||
NewUserCtrl = $controller 'NewUserCtrl', {
|
||||
$scope: scope
|
||||
}
|
||||
|
||||
it 'should attach a list of awesomeThings to the scope', () ->
|
||||
expect(scope.awesomeThings.length).toBe 3
|
||||
Reference in New Issue
Block a user