@model DashboardModel
@{
    Layout = "~/Views/Shared/Master.cshtml";
    this.SetPageTitle("Redis Dashboard");
    this.SetTopNodes(Module.Instances, "Redis Servers", Model.CurrentInstance);
}
@functions
{
    string TabLink(RedisViews view, string action, string name, bool includeParams = true)
    {
        <li class="@(Model.View == view ? "active" : null)">
            <a href="@Url.Action(action, includeParams && Model.CurrentInstance != null ? new { node = Model.CurrentInstance.HostAndPort } : null)">@name</a>
        </li>
        return null;
    }
}
@section head {
    <script>
        $(function() {
            Status.Dashboard.init({ refresh: @(Model.Refresh ? 5 : 0) });
            Status.Redis.init({ node: '@(Model.CurrentInstance?.Host.HostName ?? "")', port: '@(Model.CurrentInstance?.Port.ToString() ?? "")' });
        });
    </script>
}
<ul class="nav nav-tabs nav-tabs-right">
    @TabLink(RedisViews.All, nameof(RedisController.Dashboard), "dashboard", false)
    @TabLink(RedisViews.Instance, nameof(RedisController.Instance), "instance")
</ul>
<div>
    @if (Model.View == RedisViews.Instance && Model.CurrentInstance == null)
    {
        <partial name="Instance.Selector" />
    }
    @RenderBody()
</div>