|
@@ -11,13 +11,18 @@
|
|
|
<table class="actions">
|
|
|
@foreach (var apiKey in Model)
|
|
|
{
|
|
|
- <tr>
|
|
|
+ <tr class="@(apiKey.Enabled ?"green":"red")">
|
|
|
<td>@apiKey.Name</td>
|
|
|
<td class="stretch"><pre>@apiKey.Key</pre></td>
|
|
|
<td><img src="/images/copy.svg" alt="Copy" title="Copy" onclick="navigator.clipboard.writeText('@apiKey.Key')" /></td>
|
|
|
- <td>@(apiKey.Enabled?"Enabled":"Disabled")</td>
|
|
|
- <td><a asp-action="EnableApiKey" asp-route-key="@apiKey.Key"><img src="/images/enable.svg" alt="Enable" title="Enable" onclick="return confirm('Are you sure?')"/></a></td>
|
|
|
- <td><a asp-action="DisableApiKey" asp-route-key="@apiKey.Key"><img src="/images/disable.svg" alt="Disable" title="Disable" onclick="return confirm('Are you sure?')"/></a></td>
|
|
|
+ @if (apiKey.Enabled)
|
|
|
+ {
|
|
|
+ <td><a asp-action="DisableApiKey" asp-route-key="@apiKey.Key"><img src="/images/disable.svg" alt="Disable" title="Disable" onclick="return confirm('Are you sure?')"/></a></td>
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ <td><a asp-action="EnableApiKey" asp-route-key="@apiKey.Key"><img src="/images/enable.svg" alt="Enable" title="Enable" onclick="return confirm('Are you sure?')"/></a></td>
|
|
|
+ }
|
|
|
<td><a asp-action="DeleteApiKey" asp-route-key="@apiKey.Key"><img src="/images/delete.svg" alt="Delete" title="Delete" onclick="return confirm('Are you sure?')"/></a></td>
|
|
|
</tr>
|
|
|
}
|