This commit is contained in:
tidusjar 2016-07-13 17:30:57 +01:00
commit c764d6557a
17 changed files with 765 additions and 513 deletions

View file

@ -1,4 +1,7 @@
@using PlexRequests.UI.Helpers
@inherits PlexRequests.UI.Helpers.AngularViewBase
@Html.LoadTableAssets()
@{
var baseUrl = Html.GetBaseUrl().ToHtmlString();
@ -8,41 +11,53 @@
url = "/" + baseUrl;
}
}
<h2>User Management</h2>
<button class="btn btn-success-outline" type="submit">Create User <div class="fa fa-plus"/></button>
<br>
<br>
<script src="/Content/app/controllers/userManagement/userManagementController.js"></script>
<script src="/Content/app/services/userManagement/userManagementService.js"></script>
<div ng-controller="userManagementController" ng-init="getUsers()">
<br>
<br>
<fieldset>
<table id="example" class="table table-striped table-hover table-responsive">
<table class="table table-striped table-hover table-responsive">
<thead>
<tr>
<th>Id</th>
<th>Username</th>
<th>Permissions</th>
</tr>
<tr>
<th>Id</th>
<th>Username</th>
<th>Email</th>
<th>User T</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="u in users">
<td>
{{u.username}}
</td>
<td>
{{u.emailAddress}}
</td>
<td>
{{u.claims}}
</td>
<td>
{{u.type == 0 ? 'Local User' : 'Plex User'}}
{{u.type}}
</td>
</tr>
</tbody>
</table>
<form ng-submit="addUser()">
<div class="form-group">
<input id="username" type="text" placeholder="user" ng-model="user.username" class="form-control-custom"/>
</div>
<div class="form-group">
<input id="password" type="password" placeholder="password" ng-model="user.password" class="form-control-custom"/>
</div>
<input type="submit" class="btn btn-success-outline" value="Add"/>
</form>
</fieldset>
</div>
<script>
var baseUrl = '@Html.GetBaseUrl()';
var url = createBaseUrl(baseUrl, "usermanagement/users");
$('#example').DataTable({
"ajax": url,
"columns": [
{ "data": "id" },
{ "data": "username" },
{ "data": "claims" },
//{ "data": "type" }
],
"order": [[1, "desc"]]
});
</script>