2020-03-19 19:11:15 +09:00
|
|
|
@namespace BTCPayServer.Client
|
2020-02-24 14:36:15 +01:00
|
|
|
@model BTCPayServer.Controllers.ManageController.ApiKeysViewModel
|
|
|
|
@{
|
|
|
|
ViewData.SetActivePageAndTitle(ManageNavPages.APIKeys, "Manage your API Keys");
|
|
|
|
}
|
|
|
|
|
|
|
|
<partial name="_StatusMessage"/>
|
2020-07-08 19:20:24 +02:00
|
|
|
|
2020-02-24 14:36:15 +01:00
|
|
|
<table class="table table-lg">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
2020-02-25 14:43:53 +01:00
|
|
|
<th>Label</th>
|
|
|
|
<th>Key</th>
|
|
|
|
<th>Permissions</th>
|
2020-02-24 14:36:15 +01:00
|
|
|
<th class="text-right">Actions</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
@foreach (var keyData in Model.ApiKeyDatas)
|
|
|
|
{
|
|
|
|
<tr>
|
2020-02-25 14:43:53 +01:00
|
|
|
<td>@keyData.Label</td>
|
2020-07-08 19:20:24 +02:00
|
|
|
<td><code>@keyData.Id</code></td>
|
2020-02-24 14:36:15 +01:00
|
|
|
<td>
|
2020-04-02 08:59:20 +02:00
|
|
|
@{
|
|
|
|
var permissions = keyData.GetBlob().Permissions;
|
|
|
|
}
|
|
|
|
@if (!permissions.Any())
|
2020-02-24 14:36:15 +01:00
|
|
|
{
|
2020-07-08 19:20:24 +02:00
|
|
|
<span class="text-warning">No permissions</span>
|
2020-02-24 14:36:15 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-07-08 19:20:24 +02:00
|
|
|
<ul>
|
|
|
|
@foreach (var permission in Permission.ToPermissions(permissions).Select(c => c.ToString()).Distinct().ToArray())
|
|
|
|
{
|
2020-09-17 11:37:49 +02:00
|
|
|
<li><code>@permission</code></li>
|
2020-07-08 19:20:24 +02:00
|
|
|
}
|
|
|
|
</ul>
|
2020-02-24 14:36:15 +01:00
|
|
|
}
|
|
|
|
</td>
|
|
|
|
<td class="text-right">
|
2020-02-26 10:26:38 +01:00
|
|
|
<a asp-action="RemoveAPIKey" asp-route-id="@keyData.Id" asp-controller="Manage">Remove</a>
|
2020-02-24 14:36:15 +01:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
}
|
|
|
|
@if (!Model.ApiKeyDatas.Any())
|
|
|
|
{
|
|
|
|
<tr>
|
2020-02-26 17:34:32 +09:00
|
|
|
<td colspan="4" class="text-center h5 py-2">
|
2020-02-24 14:36:15 +01:00
|
|
|
No API keys
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2020-07-08 19:20:24 +02:00
|
|
|
<a class="btn btn-primary" asp-action="AddApiKey" id="AddApiKey">
|
|
|
|
<span class="fa fa-plus"></span>
|
|
|
|
Generate new key
|
|
|
|
</a>
|