@using Zap.BI.Portal.Pages.Diagnostics
@model Zap.BI.Portal.Models.Diagnostics.ADDiagnostic

@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=100" />
    <title>@DiagnosticText.ADDiagnostics_Header</title>

    <link rel="stylesheet" href="@Url.Action("File", "Content", new { path = "Zap.BI.Portal/Styles/External/Diagnostics.css" })" />

    <script src="@Url.Action("Script", "ActiveDirectory")" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            var diagnostics = new ActiveDirectoryDiagnostics('@Url.Action("ClearCache", "ActiveDirectory")', 'clearCacheResult');
            $('#clearCacheButton').click(function () {
                diagnostics.clearCache();
            });
        });
    </script>

</head>
<body>
    <h1>@DiagnosticText.ADDiagnostics_Header</h1>
    <p>@DiagnosticText.ADDiagnostics_Instructions</p>

    @using (Html.BeginForm("Diagnose", "ActiveDirectory", FormMethod.Post))
    {
        <p>
            @DiagnosticText.ADDiagnostics_User: @Html.TextBox("UserName")
            @DiagnosticText.ADDiagnostics_Group: @Html.TextBox("GroupName")
            <input type="submit" value="@DiagnosticText.ADDiagnostics_Execute" />
            <input id="clearCacheButton" type="button" value="@DiagnosticText.ADDiagnostics_ClearCache" />
            <b><span id="clearCacheResult" class="goodMessage"></span></b>
        </p><hr />
    }

    @{
        Html.RenderPartial("AdDiagnosticResult", Model);
    }

</body>
</html>
