Updated the claims so we can support more users.

Added a user management section (not yet complete)
Added the api to the solution and a api key in the settings (currently only gets the requests).
This commit is contained in:
TidusJar 2016-05-15 21:51:20 -04:00
commit 98eadc9cc6
12 changed files with 217 additions and 1 deletions

View file

@ -42,6 +42,17 @@
</div>
<small class="control-label">You will have to restart after changing the url base.</small>
<div class="form-group">
<label for="ApiKey" class="control-label">Api Key</label>
<div class="input-group">
<input type="text" disabled="disabled" class="form-control form-control-custom" id="apiKey" name="ApiKey" value="@Model.ApiKey">
<div class="input-group-addon">
<div id="refreshKey" class="fa fa-refresh" title="Reset API Key"></div>
</div>
</div>
</div>
<div class="form-group">
<div class="checkbox">
<label>
@ -202,5 +213,27 @@ $(function() {
}
});
});
$('#refreshKey').click(function (e) {
e.preventDefault();
var base = '@Html.GetBaseUrl()';
var url = createBaseUrl(base, '/admin/createapikey');
$.ajax({
type: "post",
url: url,
dataType: "json",
success: function (response) {
if (response) {
generateNotify("Success!", "success");
$('#apiKey').val(response);
}
},
error: function (e) {
console.log(e);
generateNotify("Something went wrong!", "danger");
}
});
});
});
</script>

View file

@ -0,0 +1,14 @@
@using PlexRequests.UI.Helpers
@{
var baseUrl = Html.GetBaseUrl().ToHtmlString();
var url = string.Empty;
if (!string.IsNullOrEmpty(baseUrl))
{
url = "/" + baseUrl;
}
}
<h2>User Management</h2>
<button class="btn btn-success-outline" type="submit">Create User <div class="fa fa-plus"/></button>