#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.42000
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace Disco.Web.Areas.Config.Views.Enrolment
{
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using System.Net;
    using System.Text;
    using System.Web;
    using System.Web.Helpers;
    using System.Web.Mvc;
    using System.Web.Mvc.Ajax;
    using System.Web.Mvc.Html;
    using System.Web.Routing;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.WebPages;
    using Disco;
    using Disco.Models.Repository;
    using Disco.Services;
    using Disco.Services.Authorization;
    using Disco.Services.Web;
    using Disco.Web;
    using Disco.Web.Extensions;
    
    [System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
    [System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/Enrolment/Status.cshtml")]
    public partial class Status : Disco.Services.Web.WebViewPage<dynamic>
    {
        public Status()
        {
        }
        public override void Execute()
        {
            
            #line 1 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
  
    Authorization.Require(Claims.Config.Enrolment.ShowStatus);

    ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Enrolment", MVC.Config.Enrolment.Index(), "Status");
    Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
    Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR");
    Html.BundleDeferred("~/ClientScripts/Modules/jQuery-Isotope");

            
            #line default
            #line hidden
WriteLiteral("\r\n<div");

WriteLiteral(" id=\"enrolStatus\"");

WriteLiteral(">\r\n");

WriteLiteral("    ");

            
            #line 10 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
Write(Html.AntiForgeryToken());

            
            #line default
            #line hidden
WriteLiteral("\r\n    <div");

WriteLiteral(" id=\"noSessions\"");

WriteLiteral(" data-bind=\"visible: noSessions\"");

WriteLiteral(">\r\n        <h2>No enrolment sessions today</h2>\r\n    </div>\r\n    <div");

WriteLiteral(" id=\"sessions\"");

WriteLiteral(" data-bind=\"visible: !noSessions(), foreach: { data: sessions, afterRender: sessi" +
"onRendered, afterAdd: sessionAdded }\"");

WriteLiteral(" style=\"display: none\"");

WriteLiteral(">\r\n        <div");

WriteLiteral(" class=\"session\"");

WriteLiteral(" data-bind=\"style: { backgroundImage: deviceModelImageUrl }, click: select\"");

WriteLiteral(">\r\n            <h3>\r\n                <span");

WriteLiteral(" data-bind=\"text: title\"");

WriteLiteral("></span>\r\n                <span");

WriteLiteral(" class=\"details\"");

WriteLiteral(" data-bind=\"text: \'(\' + deviceModelDescription() + \')\'\"");

WriteLiteral("></span>\r\n                <span");

WriteLiteral(" class=\"pending\"");

WriteLiteral(" data-bind=\"visible: isPending\"");

WriteLiteral("><code");

WriteLiteral(" data-bind=\"text: pendingIdentifier\"");

WriteLiteral("></code> <i");

WriteLiteral(" class=\"fa fa-exclamation-circle\"");

WriteLiteral("></i></span>\r\n\r\n            </h3>\r\n            <p");

WriteLiteral(" class=\"sessionStart\"");

WriteLiteral(" data-bind=\"text: startTime\"");

WriteLiteral("></p>\r\n            <p");

WriteLiteral(" class=\"sessionStatus\"");

WriteLiteral(" data-bind=\"text: progressStatus\"");

WriteLiteral("></p>\r\n            <div");

WriteLiteral(" data-bind=\"visible: !sessionEnded() && progressValue >= 0, progressValue: progre" +
"ssValue\"");

WriteLiteral(" class=\"sessionProgress\"");

WriteLiteral("></div>\r\n        </div>\r\n    </div>\r\n    <div");

WriteLiteral(" id=\"dialogSession\"");

WriteLiteral(" data-bind=\"with: currentSession\"");

WriteLiteral(">\r\n        <div");

WriteLiteral(" class=\"sessionProgress clearfix\"");

WriteLiteral(">\r\n            <p");

WriteLiteral(" class=\"sessionStart\"");

WriteLiteral(" data-bind=\"text: startTime\"");

WriteLiteral("></p>\r\n            <p");

WriteLiteral(" class=\"sessionStatus\"");

WriteLiteral(" data-bind=\"text: progressStatus\"");

WriteLiteral("></p>\r\n            <div");

WriteLiteral(" data-bind=\"visible: !sessionEnded() && progressValue >= 0, progressValue: progre" +
"ssValue\"");

WriteLiteral("></div>\r\n            <div");

WriteLiteral(" id=\"formResolveSessionPending\"");

WriteLiteral(" data-bind=\"visible: isPending\"");

WriteLiteral(">\r\n");

            
            #line 33 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
                
            
            #line default
            #line hidden
            
            #line 33 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
                 using (Html.BeginForm(MVC.API.Enrolment.ResolveSessionPending(), FormMethod.Post))
                {

            
            #line default
            #line hidden
WriteLiteral("                    <code");

WriteLiteral(" data-bind=\"text: pendingIdentifier\"");

WriteLiteral("></code>\r\n");

            
            #line 36 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
                    
            
            #line default
            #line hidden
            
            #line 36 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
               Write(Html.AntiForgeryToken());

            
            #line default
            #line hidden
            
            #line 36 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
                                            ;

            
            #line default
            #line hidden
WriteLiteral("                    <input");

WriteLiteral(" type=\"hidden\"");

WriteLiteral(" name=\"sessionId\"");

WriteLiteral(" data-bind=\"value: id\"");

WriteLiteral(" />\r\n");

WriteLiteral("                    <div");

WriteLiteral(" class=\"reason\"");

WriteLiteral(">\r\n                        <input");

WriteLiteral(" type=\"text\"");

WriteLiteral(" name=\"reason\"");

WriteLiteral(" placeholder=\"Reason (optional)\"");

WriteLiteral(" />\r\n                    </div>\r\n");

WriteLiteral("                    <div");

WriteLiteral(" class=\"buttons\"");

WriteLiteral(">\r\n                        <button");

WriteLiteral(" type=\"button\"");

WriteLiteral(" value=\"True\"");

WriteLiteral(" class=\"button\"");

WriteLiteral(">Approve</button>\r\n                        <button");

WriteLiteral(" type=\"button\"");

WriteLiteral(" value=\"False\"");

WriteLiteral(" class=\"button\"");

WriteLiteral(">Reject</button>\r\n                    </div>\r\n");

            
            #line 45 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
                }

            
            #line default
            #line hidden
WriteLiteral("            </div>\r\n        </div>\r\n        <div");

WriteLiteral(" class=\"sessionHeader clearfix\"");

WriteLiteral(" data-bind=\"style: { backgroundImage: deviceModelImageUrl }\"");

WriteLiteral(">\r\n            <h2><a");

WriteLiteral(" href=\"\"");

WriteLiteral(" target=\"_blank\"");

WriteLiteral(" data-bind=\"text: title, attr: { href: deviceUrl }\"");

WriteLiteral("></a></h2>\r\n            <h3");

WriteLiteral(" data-bind=\"text: deviceModelDescription\"");

WriteLiteral("></h3>\r\n            <table");

WriteLiteral(" data-bind=\"if: sessionDeviceInfo\"");

WriteLiteral(">\r\n                <tr>\r\n                    <th");

WriteLiteral(" style=\"width: 128px\"");

WriteLiteral(">Computer Name:</th>\r\n                    <td");

WriteLiteral(" data-bind=\"text: sessionDeviceInfo().Arguments[3]\"");

WriteLiteral("></td>\r\n                </tr>\r\n                <tr>\r\n                    <th");

WriteLiteral(" style=\"width: 128px\"");

WriteLiteral(">UUID:</th>\r\n                    <td");

WriteLiteral(" data-bind=\"text: sessionDeviceInfo().Arguments[2]\"");

WriteLiteral("></td>\r\n                </tr>\r\n                <tr>\r\n                    <th");

WriteLiteral(" style=\"width: 128px\"");

WriteLiteral(">LAN Mac Address:</th>\r\n                    <td");

WriteLiteral(" data-bind=\"text: sessionDeviceInfo().Arguments[4]\"");

WriteLiteral("></td>\r\n                </tr>\r\n                <tr>\r\n                    <th");

WriteLiteral(" style=\"width: 128px\"");

WriteLiteral(">WLAN Mac Address:</th>\r\n                    <td");

WriteLiteral(" data-bind=\"text: sessionDeviceInfo().Arguments[5]\"");

WriteLiteral("></td>\r\n                </tr>\r\n                <tr>\r\n                    <th");

WriteLiteral(" style=\"width: 128px\"");

WriteLiteral(">Manufacturer/Model:</th>\r\n                    <td");

WriteLiteral(" data-bind=\"text: sessionDeviceInfo().Arguments[6] + \' \' + sessionDeviceInfo().Ar" +
"guments[7]\"");

WriteLiteral("></td>\r\n                </tr>\r\n            </table>\r\n        </div>\r\n        <div" +
"");

WriteLiteral(" class=\"sessionInfoContainer clearfix\"");

WriteLiteral(">\r\n            <div");

WriteLiteral(" class=\"sessionInfoMessages\"");

WriteLiteral(">\r\n                <table");

WriteLiteral(" class=\"logEventsViewport\"");

WriteLiteral(">\r\n                    <thead>\r\n                        <tr>\r\n                   " +
"         <th");

WriteLiteral(" class=\"icon\"");

WriteLiteral(">&nbsp;</th>\r\n                            <th");

WriteLiteral(" class=\"message\"");

WriteLiteral(">Message</th>\r\n                        </tr>\r\n                    </thead>\r\n     " +
"           </table>\r\n                <div");

WriteLiteral(" class=\"logEventsViewportContainer\"");

WriteLiteral(">\r\n                    <div");

WriteLiteral(" class=\"logEventsViewportNoLogs\"");

WriteLiteral(" data-bind=\"visible: messages().length == 0\"");

WriteLiteral(" style=\"display: none\"");

WriteLiteral(">No logs</div>\r\n                    <table");

WriteLiteral(" class=\"logEventsViewport\"");

WriteLiteral(" data-bind=\"visible: messages().length > 0\"");

WriteLiteral(" style=\"display: none\"");

WriteLiteral(">\r\n                        <tbody");

WriteLiteral(" data-bind=\"foreach: messages\"");

WriteLiteral(">\r\n                            <tr>\r\n                                <td");

WriteLiteral(" class=\"icon\"");

WriteLiteral("><i");

WriteLiteral(" class=\"fa\"");

WriteLiteral(" data-bind=\"css: { \'fa-info-circle\': EventTypeSeverity == 0, \'fa-exclamation-tria" +
"ngle\': EventTypeSeverity == 1, \'fa-exclamation-circle\': EventTypeSeverity == 2 }" +
"\"");

WriteLiteral("></i></td>\r\n                                <td");

WriteLiteral(" class=\"message\"");

WriteLiteral(" data-bind=\"text: FormattedMessage, attr: { title: EventTypeName }\"");

WriteLiteral("></td>\r\n                            </tr>\r\n                        </tbody>\r\n    " +
"                </table>\r\n                </div>\r\n            </div>\r\n          " +
"  <div");

WriteLiteral(" class=\"sessionInfoConsole\"");

WriteLiteral(" data-bind=\"foreach: console\"");

WriteLiteral(">\r\n                <span");

WriteLiteral(" data-bind=\"text: Arguments[1]\"");

WriteLiteral("></span>\r\n            </div>\r\n        </div>\r\n    </div>\r\n</div>\r\n<script");

WriteLiteral(" type=\"text/javascript\"");

WriteLiteral(@">
    ko.bindingHandlers.progressValue = {
        update: function (element, valueAccessor, allBindingsAccessor, viewModel) {
            var v = ko.utils.unwrapObservable(valueAccessor());
            var vInt = parseInt(v);
            if (vInt >= 0) {
                $element = $(element);
                if (!$element.is('.ui-progressbar'))
                    $element.progressbar();
                $(element).progressbar('option', 'value', vInt);
            }
        }
    };
</script>
<script");

WriteLiteral(" type=\"text/javascript\"");

WriteLiteral(@">
    $(function () {
        var vm;
        var host = $('#enrolStatus');
        var hostSessions = $('#sessions');
        var hostDialogSessions = $('#dialogSession');
        //var hostDialogSessionsProgress = $('#dialogSession').find('.sessionProgress');
        var deviceModels = {};
        var logHub;
        var deviceBaseUrl = '");

            
            #line 125 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
                         Write(Url.Action(MVC.Device.Show()));

            
            #line default
            #line hidden
WriteLiteral("/\'\r\n        var deviceModelImageUrl = \'");

            
            #line 126 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
                               Write(Url.Action(MVC.API.DeviceModel.Image()));

            
            #line default
            #line hidden
WriteLiteral("/\'\r\n        var iconWarningUrl = \'url(");

            
            #line 127 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
                              Write(Links.ClientSource.Style.Images.Status.warning32_png);

            
            #line default
            #line hidden
WriteLiteral(")\';\r\n        var iconErrorUrl = \'url(");

            
            #line 128 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
                            Write(Links.ClientSource.Style.Images.Status.fail32_png);

            
            #line default
            #line hidden
WriteLiteral(")\';\r\n\r\n        function pageViewModel() {\r\n            var self = this;\r\n\r\n      " +
"      self.noSessions = ko.observable(true);\r\n            self.sessions = ko.obs" +
"ervableArray();\r\n            self.sessionIndex = {};\r\n\r\n            self.isotope" +
"Inited = false;\r\n\r\n            self.currentSession = ko.observable();\r\n\r\n       " +
"     self.sessionRendered = function (e, d) {\r\n                if (!d.sessionEnd" +
"ed()) {\r\n                    d.progressbar = $(e).find(\'.sessionProgress\').progr" +
"essbar();\r\n                }\r\n            };\r\n            self.sessionAdded = fu" +
"nction (e, d) {\r\n                if (self.isotopeInited) {\r\n                    " +
"hostSessions.isotope(\'reloadItems\').isotope({ sortBy: \'original-order\' });\r\n    " +
"            }\r\n            };\r\n        }\r\n        function sessionViewModel(id) " +
"{\r\n            var self = this;\r\n\r\n            self.id = id;\r\n            self.t" +
"itle = ko.observable(id);\r\n            self.isPending = ko.observable(false);\r\n " +
"           self.pendingIdentifier = ko.observable();\r\n            self.messages " +
"= ko.observableArray();\r\n            self.console = ko.observableArray();\r\n     " +
"       self.serialNumber = ko.observable();\r\n            self.sessionDeviceInfo " +
"= ko.observable();\r\n            self.progressStatus = ko.observable();\r\n        " +
"    self.progressValue = ko.observable();\r\n            self.startTime = ko.obser" +
"vable();\r\n            self.sessionEnded = ko.observable(false);\r\n            sel" +
"f.progressbar = null;\r\n            self.hasError = ko.observable(false);\r\n      " +
"      self.hasWarning = ko.observable(false);\r\n            self.deviceModelId = " +
"ko.observable();\r\n            self.deviceModelDescription = ko.computed(function" +
" () {\r\n                var deviceModelId = self.deviceModelId();\r\n              " +
"  var sessionDeviceInfo = self.sessionDeviceInfo();\r\n                if (deviceM" +
"odelId) {\r\n                    var dm = deviceModels[deviceModelId];\r\n          " +
"          if (dm) {\r\n                        if (dm.Description)\r\n              " +
"              return dm.Description;\r\n                        else\r\n            " +
"                return dm.Manufacturer + \' \' + dm.Model;\r\n                    }\r" +
"\n                }\r\n                if (sessionDeviceInfo) {\r\n                  " +
"  return sessionDeviceInfo.Arguments[6] + \' \' + sessionDeviceInfo.Arguments[7];\r" +
"\n                }\r\n            });\r\n            self.deviceUrl = ko.computed(fu" +
"nction () {\r\n                var serialNumber = self.serialNumber();\r\n          " +
"      if (serialNumber)\r\n                    return deviceBaseUrl + serialNumber" +
";\r\n                else\r\n                    return null;\r\n            });\r\n    " +
"        self.deviceModelImageUrl = ko.computed(function () {\r\n                va" +
"r deviceModelImage;\r\n                if (self.deviceModelId())\r\n                " +
"    deviceModelImage = \'url(\' + deviceModelImageUrl + self.deviceModelId() + \')\'" +
";\r\n                else\r\n                    deviceModelImage = \'url(\' + deviceM" +
"odelImageUrl + \')\';\r\n                if (self.hasError())\r\n                    r" +
"eturn iconErrorUrl + \', \' + deviceModelImage;\r\n                else\r\n           " +
"         if (self.hasWarning())\r\n                        return iconWarningUrl +" +
" \', \' + deviceModelImage;\r\n                    else\r\n                        ret" +
"urn \'none, \' + deviceModelImage;\r\n            });\r\n            self.select = fun" +
"ction (e, d) {\r\n                vm.currentSession(self);\r\n                hostDi" +
"alogSessions.dialog(\'open\');\r\n                hostDialogSessions.dialog(\'option\'" +
", \'title\', \'Device Enrolment: \' + self.title());\r\n            }\r\n        }\r\n\r\n  " +
"      function parseLog(log) {\r\n            if (log.ModuleId === 50 && log.Argum" +
"ents && log.Arguments.length > 0) {\r\n                // find session\r\n          " +
"      var sessionId = log.Arguments[0];\r\n                var session = vm.sessio" +
"nIndex[sessionId];\r\n                if (!session && log.EventTypeId === 10) { //" +
" Starting Session (Ignore \'partial\' sessions)\r\n                    session = new" +
" sessionViewModel(sessionId);\r\n                    vm.sessionIndex[sessionId] = " +
"session;\r\n                    vm.sessions.unshift(session);\r\n                   " +
" vm.noSessions(false);\r\n                }\r\n                if (session) {\r\n     " +
"               switch (log.EventTypeId) {\r\n                        case 10: // S" +
"essionStarting\r\n                            session.title(log.Arguments[1]);\r\n  " +
"                          session.startTime(log.FormattedTimestamp.substring(log" +
".FormattedTimestamp.indexOf(\' \') + 1));\r\n                            session.mes" +
"sages.unshift(log);\r\n                            break;\r\n                       " +
" case 11: // SessionProgress\r\n                            //session.progressbar." +
"progressbar(\'option\', \'value\', log.Arguments[1]);\r\n                            s" +
"ession.progressValue(log.Arguments[1]);\r\n                            session.pro" +
"gressStatus(log.Arguments[2]);\r\n                            break;\r\n            " +
"            case 12: // SessionDevice\r\n                            session.title" +
"(log.Arguments[1]);\r\n                            session.serialNumber(log.Argume" +
"nts[1]);\r\n                            if (log.Arguments.length >= 3 && log.Argum" +
"ents[2])\r\n                                session.deviceModelId(log.Arguments[2]" +
");\r\n                            break;\r\n                            break;\r\n    " +
"                    case 13: // SessionDeviceInfo\r\n                            s" +
"ession.title(log.Arguments[1]);\r\n                            session.serialNumbe" +
"r(log.Arguments[1]);\r\n                            session.sessionDeviceInfo(log)" +
";\r\n                            if (log.Arguments.length >= 10 && log.Arguments[9" +
"])\r\n                                session.deviceModelId(log.Arguments[9]);\r\n  " +
"                          break;\r\n                        case 14: // SessionPen" +
"ding\r\n                            session.isPending(true);\r\n                    " +
"        session.pendingIdentifier(log.Arguments[4]);\r\n                          " +
"  session.messages.unshift(log);\r\n                            session.progressVa" +
"lue(-1);\r\n                            session.progressStatus(\'Pending enrolment " +
"approval\');\r\n                            break;\r\n                        case 15" +
": // SessionPendingApproved\r\n                            session.isPending(false" +
");\r\n                            session.messages.unshift(log);\r\n                " +
"            session.progressValue(-1);\r\n                            session.prog" +
"ressStatus(\'Enrolment approval, waiting for client\');\r\n                         " +
"   break;\r\n                        case 16: // SessionPendingRejected\r\n         " +
"                   session.isPending(false);\r\n                            sessio" +
"n.messages.unshift(log);\r\n                            session.progressValue(-1);" +
"\r\n                            session.progressStatus(\'Enrolment rejected, waitin" +
"g for client\');\r\n                            break;\r\n                        cas" +
"e 17: // SessionContinuing\r\n                            session.isPending(false)" +
";\r\n                            session.messages.unshift(log);\r\n                 " +
"           break;\r\n                        case 20: // SessionFinished\r\n        " +
"                    session.sessionEnded(true);\r\n                            ses" +
"sion.isPending(false);\r\n                            if (session.hasError())\r\n   " +
"                             session.progressStatus(\'Enrolment Finished with an " +
"Error\');\r\n                            else\r\n                                if (" +
"session.hasWarning())\r\n                                    session.progressStatu" +
"s(\'Enrolment Finished with a Warning\');\r\n                                else\r\n " +
"                                   session.progressStatus(\'Enrolment Finished Su" +
"ccessfully\');\r\n                            session.messages.unshift(log);\r\n     " +
"                       break;\r\n                        case 21: // SessionDiagno" +
"sticInformation\r\n                            session.console.push(log);\r\n       " +
"                     break;\r\n                        case 22: // SessionWarning\r" +
"\n                            session.hasWarning(true);\r\n                        " +
"    session.messages.unshift(log);\r\n                            break;\r\n        " +
"                case 23: // SessionError\r\n                        case 24: // Se" +
"ssionErrorWithInner\r\n                        case 25: // SessionClientError\r\n   " +
"                         session.hasError(true);\r\n                            se" +
"ssion.messages.unshift(log);\r\n                            break;\r\n              " +
"          default:\r\n                            session.messages.unshift(log);\r\n" +
"                    }\r\n                }\r\n            }\r\n        }\r\n        func" +
"tion init() {\r\n            hostDialogSessions.dialog({\r\n                modal: t" +
"rue,\r\n                height: 574,\r\n                width: 900,\r\n               " +
" resizable: false,\r\n                autoOpen: false\r\n            });\r\n          " +
"  //hostDialogSessionsProgress.progressbar();\r\n\r\n            // Create View Mode" +
"l\r\n            vm = new pageViewModel();\r\n            $.ajax({\r\n                " +
"url: \'");

            
            #line 319 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
                  Write(Url.Action(MVC.API.DeviceModel.Index()));

            
            #line default
            #line hidden
WriteLiteral(@"',
                dataType: 'json',
                type: 'POST',
                success: init_loadedDeviceModels,
                error: function (jqXHR, textStatus, errorThrown) {
                    alert('Unable to retrieve device models: ' + errorThrown);
                }
            });
        }
        function init_loadedDeviceModels(models) {
            for (var i = 0; i < models.length; i++) {
                var m = models[i];
                deviceModels[m.Id] = m;
            }

            // Load Logs
            var d = new Date();
            var loadData = {
                Format: ""json"",
                Start: d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate(),
                End: null,
                ModuleId: 50,
                Take: 2000,
                '__RequestVerificationToken': host.find('input[name=""__RequestVerificationToken""]').val()
            };
            $.ajax({
                url: '");

            
            #line 345 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
                  Write(Url.Action(MVC.API.Logging.RetrieveEvents()));

            
            #line default
            #line hidden
WriteLiteral(@"',
                dataType: 'json',
                type: 'POST',
                traditional: true,
                data: loadData,
                success: init_loadedLogs,
                error: function (jqXHR, textStatus, errorThrown) {
                    alert('Unable to retrieve logs: ' + errorThrown);
                }
            });
        }
        function init_loadedLogs(logs) {
            logs.reverse();
            for (var i = 0; i < logs.length; i++) {
                parseLog(logs[i]);
            }
            // Bind
            ko.applyBindings(vm);

            // Isotope
            hostSessions.isotope({
                itemSelector: '.session',
                layoutMode: 'fitRows'
            });
            vm.isotopeInited = true;

            // Init Persistent Connection
            logHub = $.connection.logNotifications;
            logHub.client.receiveLog = parseLog

            $.connection.hub.qs = { LogModules: '");

            
            #line 375 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
                                             Write(Disco.Services.Devices.Enrolment.EnrolmentLog.Current.LiveLogGroupName);

            
            #line default
            #line hidden
WriteLiteral("\' };\r\n            $.connection.hub.error(onHubFailed);\r\n\r\n            $.connectio" +
"n.hub.start()\r\n                .done(function () { isLive = true; })\r\n          " +
"      .fail(onHubFailed);\r\n\r\n            function onHubFailed(error) {\r\n        " +
"        // Show Dialog Message\r\n                if ($(\'.disconnected-dialog\').le" +
"ngth == 0) {\r\n                    $(\'<div>\')\r\n                        .addClass(" +
"\'dialog disconnected-dialog\')\r\n                        .html(\'<h3><span class=\"f" +
"a-stack fa-lg\"><i class=\"fa fa-wifi fa-stack-1x\"></i><i class=\"fa fa-ban fa-stac" +
"k-2x error\"></i></span>Disconnected from the Disco ICT Server</h3><div>This page" +
" is not receiving live updates. Please ensure you are connected to the server, t" +
"hen refresh this page to enable features.</div>\')\r\n                        .dial" +
"og({\r\n                            resizable: false,\r\n                           " +
" title: \'Disconnected\',\r\n                            width: 400,\r\n              " +
"              modal: true,\r\n                            buttons: {\r\n            " +
"                    \'Refresh Now\': function () {\r\n                              " +
"      $(this).dialog(\'option\', \'buttons\', null);\r\n                              " +
"      window.location.reload(true);\r\n                                },\r\n       " +
"                         \'Close\': function () {\r\n                               " +
"     $(this).dialog(\'destroy\');\r\n                                }\r\n            " +
"                }\r\n                        });\r\n                }\r\n            }" +
"\r\n        }\r\n        $(\'#dialogSession\').on(\'click\', \'#formResolveSessionPending" +
" button\', function (e) {\r\n            const $button = $(this);\r\n            cons" +
"t $form = $button.closest(\'form\');\r\n            const body = new FormData($form[" +
"0]);\r\n            body.append(\'approve\', $button.val());\r\n            fetch($for" +
"m.attr(\'action\'), {\r\n                method: \'POST\',\r\n                body: body" +
"\r\n            }).then(function (response) {\r\n                if (!response.ok) {" +
"\r\n                    alert(\'Failed to resolve pending session: \' + response.sta" +
"tusText);\r\n                }\r\n            });\r\n        });\r\n        init();\r\n   " +
" });\r\n</script>\r\n");

        }
    }
}
#pragma warning restore 1591
