
@model isnd.Data.ApiKeys.DetailModel

@{
    ViewData["Title"] = "Details";
}

<h2>Details</h2>

<div>
    <h4>ApiKey</h4>
    <hr />
    <dl class="dl-horizontal">
        <dt>
            @Html.DisplayNameFor(model => model.ApiKey.User)
        </dt>
        <dd>
            @Html.DisplayFor(model => model.ApiKey.User.Id)
        </dd>
        <dt>
            @Html.DisplayNameFor(model => model.ApiKey.Name)
        </dt>
        <dd>
            @Html.DisplayFor(model => model.ApiKey.Name)
        </dd>
        <dt>
            @Html.DisplayNameFor(model => model.ApiKey.CreationDate)
        </dt>
        <dd>
            @Html.DisplayFor(model => model.ApiKey.CreationDate)
        </dd>
        <dt>
            @Html.DisplayNameFor(model => model.ApiKey.ValidityPeriodInDays)
        </dt>
        <dd>
            @Html.DisplayFor(model => model.ApiKey.ValidityPeriodInDays)
        </dd>
        <dt>
            @Html.DisplayNameFor(model => model.ProtectedValue)
            
        </dt>
        <dd>
            <code>
            <input id="key" value="@Model.ProtectedValue" readonly/></code>
            <button type="button" 
            class="btn btn-success" autocomplete="off"
            onclick="$('#key').select();document.execCommand('copy');"
            >Copy</button>
        </dd>
        <dt>
            @Html.DisplayNameFor(model => model.ApiKey.IsValid)
        </dt>
        <dd>
            @Html.DisplayFor(model => model.ApiKey.IsValid)
        </dd>
    </dl>
</div>
<div>
    <a asp-controller="ApiKeys" asp-action="Edit" asp-route-id="@Model.ApiKey.Id">Edit</a> |
    <a asp-controller="ApiKeys" asp-action="Index">Back to List</a>
</div>
