#pragma warning disable 1591 //------------------------------------------------------------------------------ // // 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. // //------------------------------------------------------------------------------ namespace Disco.Web.Areas.Config.Views.DeviceProfile { 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; #line 2 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" using Disco.Services.Devices.ManagedGroups; #line default #line hidden using Disco.Services.Web; using Disco.Web; #line 3 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" using Disco.Web.Areas.Config.Models.Shared; #line default #line hidden using Disco.Web.Extensions; [System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")] [System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DeviceProfile/Show.cshtml")] public partial class Show : Disco.Services.Web.WebViewPage { public Show() { } public override void Execute() { #line 4 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Authorization.Require(Claims.Config.DeviceProfile.Show); ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Profiles", MVC.Config.DeviceProfile.Index(null), Model.DeviceProfile.ToString()); var canConfig = Authorization.Has(Claims.Config.DeviceProfile.Configure); var canConfigExpression = Authorization.Has(Claims.Config.DeviceProfile.ConfigureComputerNameTemplate); var canDelete = (Authorization.Has(Claims.Config.DeviceProfile.Delete) && Model.CanDelete); var canViewPlugins = Authorization.Has(Claims.Config.Plugin.Install); var hideAdvanced = Model.DeviceProfile.AssignedUsersLinkedGroup == null && Model.DeviceProfile.DevicesLinkedGroup == null; if (canConfig) { Html.BundleDeferred("~/Style/Fancytree"); Html.BundleDeferred("~/ClientScripts/Modules/jQuery-Fancytree"); Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers"); } #line default #line hidden WriteLiteral("\r\n(hideAdvanced ? " Config_HideAdvanced" : null #line default #line hidden , 1206), false) ); WriteLiteral(" style=\"width: 640px\""); WriteLiteral(">\r\n \r\n \r\n \r\n Id:\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n " + " \r\n \r\n \r\n \r\n
\r\n"); WriteLiteral(" "); #line 32 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(Html.DisplayFor(model => model.DeviceProfile.Id)); #line default #line hidden WriteLiteral("\r\n
\r\n " + " Name:\r\n \r\n"); #line 40 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden #line 40 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" if (canConfig) { #line default #line hidden #line 42 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(Html.TextBoxFor(model => model.DeviceProfile.Name)); #line default #line hidden #line 42 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden #line 43 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(AjaxHelpers.AjaxSave()); #line default #line hidden #line 43 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden #line 44 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden #line 44 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden WriteLiteral(" \r\n $(function () {\r\n document." + "DiscoFunctions.PropertyChangeHelper(\r\n $(\'#Device" + "Profile_Name\'),\r\n \'Name\',\r\n " + " \'"); #line 50 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(Url.Action(MVC.API.DeviceProfile.UpdateName(Model.DeviceProfile.Id))); #line default #line hidden WriteLiteral("\',\r\n \'ProfileName\'\r\n );" + "\r\n });\r\n \r\n"); #line 55 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" } else { #line default #line hidden #line 58 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(Model.DeviceProfile.Name); #line default #line hidden #line 58 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" } #line default #line hidden WriteLiteral("
\r\n " + " Short Name:\r\n \r\n"); #line 67 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden #line 67 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" if (canConfig) { #line default #line hidden #line 69 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(Html.TextBoxFor(model => model.DeviceProfile.ShortName)); #line default #line hidden #line 69 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden #line 70 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(AjaxHelpers.AjaxSave()); #line default #line hidden #line 70 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden #line 71 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden #line 71 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden WriteLiteral(" $(function () { document.DiscoFunctions.PropertyChangeHelper( $('#DeviceProfile_ShortName'), 'Short Name', '"); #line 77 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(Url.Action(MVC.API.DeviceProfile.UpdateShortName(Model.DeviceProfile.Id))); #line default #line hidden WriteLiteral("\',\r\n \'ShortName\'\r\n );\r\n" + " });\r\n \r\n"); #line 82 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" } else { #line default #line hidden #line 85 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(Model.DeviceProfile.ShortName); #line default #line hidden #line 85 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" } #line default #line hidden WriteLiteral("
\r\n " + " Description:\r\n \r\n"); #line 94 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden #line 94 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" if (canConfig) { #line default #line hidden #line 96 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(Html.EditorFor(model => model.DeviceProfile.Description)); #line default #line hidden #line 96 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden #line 97 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(AjaxHelpers.AjaxSave()); #line default #line hidden #line 97 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden #line 98 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden #line 98 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden WriteLiteral(" $(function () { document.DiscoFunctions.PropertyChangeHelper( $('#DeviceProfile_Description'), 'Description', '"); #line 104 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(Url.Action(MVC.API.DeviceProfile.UpdateDescription(Model.DeviceProfile.Id))); #line default #line hidden WriteLiteral("\',\r\n \'Description\'\r\n );" + "\r\n });\r\n \r\n"); #line 109 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" } else { #line default #line hidden #line 112 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(Model.DeviceProfile.Description); #line default #line hidden #line 112 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" } #line default #line hidden WriteLiteral("
Members\r\n
"); #line 119 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(Model.DeviceCount.ToString("n0")); #line default #line hidden WriteLiteral(" "); #line 119 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(Model.DeviceCount == 1 ? "devices is a member" : "devices are members"); #line default #line hidden WriteLiteral(" of this profile.
\r\n"); #line 120 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden #line 120 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" if (Model.DeviceDecommissionedCount > 0) { #line default #line hidden WriteLiteral(" "); #line 122 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(Model.DeviceDecommissionedCount.ToString("n0")); #line default #line hidden WriteLiteral(" "); #line 122 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(Model.DeviceDecommissionedCount == 1 ? "device is" : "devices are"); #line default #line hidden WriteLiteral(" decommissioned.\r\n"); #line 123 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" } #line default #line hidden WriteLiteral("
\r\n " + " Distribution Type:\r\n \r\n"); #line 131 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden #line 131 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" if (canConfig) { #line default #line hidden #line 133 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(Html.DropDownList("DeviceProfile_DistributionType", Model.DeviceProfileDistributionTypes)); #line default #line hidden #line 133 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden #line 134 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden #line 134 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden WriteLiteral(" $(function () { document.DiscoFunctions.PropertyChangeHelper( $('#DeviceProfile_DistributionType'), null, '"); #line 140 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(Url.Action(MVC.API.DeviceProfile.UpdateDistributionType(Model.DeviceProfile.Id))); #line default #line hidden WriteLiteral("\',\r\n \'DistributionType\'\r\n " + " );\r\n });\r\n \r\n"); #line 145 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" } else { #line default #line hidden #line 148 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(Model.DeviceProfile.DistributionType.ToString()); #line default #line hidden #line 148 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" } #line default #line hidden WriteLiteral(" \r\n \r\n One-to-many devices are typically shared. One-to-one devices are typically assigned to a user; enrolment with a one-to-one device isn't considered complete until it is assigned.

Address: "); #line 164 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden #line 164 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" if (canConfig) { #line default #line hidden #line 166 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(Html.DropDownListFor(m => m.DeviceProfile.DefaultOrganisationAddress, Model.OrganisationAddresses.ToSelectListItems(Model.DeviceProfile.DefaultOrganisationAddress, true, "None"))); #line default #line hidden #line 166 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden #line 167 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden #line 167 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden WriteLiteral(" $(function () { document.DiscoFunctions.PropertyChangeHelper( $('#DeviceProfile_DefaultOrganisationAddress'), null, '"); #line 173 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(Url.Action(MVC.API.DeviceProfile.UpdateDefaultOrganisationAddress(Model.DeviceProfile.Id))); #line default #line hidden WriteLiteral("\',\r\n \'DefaultOrganisationAddress\'\r\n " + " );\r\n });\r\n \r\n"); #line 178 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" } else { if (Model.DefaultOrganisationAddress == null) { #line default #line hidden WriteLiteral(" <None Specified>\r\n"); #line 184 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" } else { #line default #line hidden #line 187 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(Model.DefaultOrganisationAddress.ToString()); #line default #line hidden #line 187 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" } } #line default #line hidden WriteLiteral(" \r\n \r\n The profile address is used to separate jobs for (Url.Action(MVC.Config.Organisation.Index()) #line default #line hidden , 8103), false) ); WriteLiteral(@">multi-site mode. It is also suggested as the default address for warranty/repair actions.

Policies
"); #line 202 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden #line 202 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" if (canConfig) { #line default #line hidden WriteLiteral("
\r\n"); #line 233 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden #line 233 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" if (canConfig) { #line default #line hidden WriteLiteral("
Computer Name
Template Expression:
\r\n"); #line 328 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden #line 328 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" if (string.IsNullOrWhiteSpace(Model.DeviceProfile.ComputerNameTemplate)) { #line default #line hidden WriteLiteral(" <None Specified>\r\n"); #line 331 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" } else { #line default #line hidden #line 334 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(Model.DeviceProfile.ComputerNameTemplate); #line default #line hidden #line 334 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" } #line default #line hidden WriteLiteral(" \r\n"); #line 337 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden #line 337 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" if (canConfig && canConfigExpression) { #line default #line hidden WriteLiteral(" Change"); #line 339 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden #line 339 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden #line 339 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden WriteLiteral(" \r\n"); #line 341 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden #line 341 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" using (Html.BeginForm(MVC.API.DeviceProfile.UpdateComputerNameTemplate(Model.DeviceProfile.Id, null, false))) { #line default #line hidden #line 343 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(Html.AntiForgeryToken()); #line default #line hidden #line 343 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden #line 344 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(Html.TextArea("ComputerNameTemplate", Model.DeviceProfile.ComputerNameTemplate, new { spellcheck = "false", required = "required" })); #line default #line hidden #line 344 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n"); #line 349 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden #line 349 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" using (Html.BeginForm(MVC.API.DeviceProfile.TestComputerNameTemplate(Model.DeviceProfile.Id))) { #line default #line hidden #line 351 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(Html.AntiForgeryToken()); #line default #line hidden #line 351 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" ; #line default #line hidden WriteLiteral("
Serial Number Current Result
   
"); #line 370 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" } #line default #line hidden WriteLiteral(" \r\n Test Template"); #line 372 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden WriteLiteral("\r\n \r\n"); WriteLiteral(" $(() => { let $dialog = null; let $textarea = null; let currentValue = null; $('#changeComputerNameTemplate').click(e => { e.preventDefault(); if (!$dialog) { $textarea = $('#ComputerNameTemplate'); currentValue = $textarea.val(); $dialog = $('#dialogComputerNameTemplate').dialog({ autoOpen: false, buttons: null, draggable: false, modal: true, resizable: false, width: 700, buttons: { ""Cancel"": () => { $textarea.val(currentValue); $dialog.find('.error').addClass('hidden'); $dialog.dialog(""close""); }, ""Expression Browser"": () => { window.open('"); #line 400 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(Url.Action(MVC.Config.Expressions.Browser())); #line default #line hidden WriteLiteral("\', \'_blank\');\r\n },\r\n " + " \"Save\": () => {\r\n " + " const $form = $textarea.closest(\'form\');\r\n " + " $(this).find(\'.error\').addClass(\'hidden\');\r\n\r\n " + " if ($form[0].reportValidity()) {\r\n " + " const body = new FormData($form[0]);\r\n " + " const url = $form.attr(\'actio" + "n\');\r\n\r\n const $ajaxLoading =" + " $(\'#changeComputerNameTemplate\').nextAll(\'.ajaxLoading\').first();\r\n " + " $ajaxLoading.show();\r\n " + " $dialog.dialog(\'close\');\r\n\r\n " + " fetch(url, {\r\n " + " method: \'POST\',\r\n " + " body: body\r\n " + " }).then(response => {\r\n " + "if (response.ok) {\r\n " + "currentValue = $textarea.val();\r\n " + " const $display = $(\'#displayComputerNameTemplate\');\r\n " + " if (currentValue) {\r\n " + " $display.text(currentValue);\r" + "\n } else {\r\n " + " $display.html(\'<None Specified>\');\r\n " + " }\r\n " + " $ajaxLoading.hide().next(\'.ajaxOk\').show().delay(\'fast\').fadeOut(\'" + "slow\');\r\n } else if (resp" + "onse.status == 400) {\r\n " + " response.json().then(data => {\r\n " + " $ajaxLoading.hide();\r\n " + " $dialog.dialog(\'open\');\r\n " + " $dialog.find(\'.error\').text(data).removeClass(" + "\'hidden\');\r\n cons" + "ole.error(data);\r\n })" + "\r\n }\r\n " + " }).catch(error => {\r\n " + " alert(\'Unable to save computer name template\');\r\n " + " $ajaxLoading.hide();\r\n " + " $dialog.dialog(\'open\');\r\n " + " $dialog.find(\'.error\').tex" + "t(\'Unable to save computer name template: \' + error).removeClass(\'hidden\');\r\n " + " console.error(error);\r\n " + " });\r\n " + " }\r\n }\r\n " + " }\r\n });\r\n " + " const $buttonTest = $dialog.find(\'#ComputerNameTe" + "mplateTest\');\r\n $buttonTest.click(e => {\r\n " + " e.preventDefault();\r\n " + " const $test = $dialog.find(\'.test\');\r\n\r\n " + " const $ajaxLoading = $(e.currentTarget).nextAll(\'.ajaxLoading\'" + ").first();\r\n $ajaxLoading.show();\r\n\r\n " + " const $form = $test.find(\'form\');\r\n " + " const url = $form.attr(\'action\');\r\n " + " const body = new FormData($form[0]);\r\n " + " body.append(\'ComputerNameTemplate\', $textarea.val());\r\n\r" + "\n fetch(url, {\r\n " + " method: \'POST\',\r\n " + "body: body\r\n }).then(response => {\r\n " + " if (response.ok) {\r\n " + " response.json().then(data => {\r\n " + " const $table = $test.find(\'table tbody\');\r\n " + " if (data.UserSpecifiedResult) {\r\n " + " const result = data.UserS" + "pecifiedResult;\r\n const r" + "ow = $table.find(\'tr\').first();\r\n " + " row.find(\'input\').val(result.DeviceSerialNumber);\r\n " + " const columns = row.find(\'td\');\r\n " + " columns.eq(1).html(\'\');\r\n " + " $(\'\').text(resu" + "lt.DeviceComputerName)\r\n " + " .appendTo(columns.eq(1))\r\n " + " columns.eq(2).html(\'\');\r\n " + " $(\'\').text(result.RenderedComputerName)\r\n " + " .appendTo(columns.eq(2))\r\n " + " if (!result.Success) {\r\n " + " $(\'
\').text(result.ErrorMessage).appendTo(columns[2]);\r" + "\n }\r\n " + " }\r\n " + " if (data.RandomDeviceResults) {\r\n " + " $table.find(\'tr\').slice(1).remove();\r\n " + " for (var i = 0; i < data.RandomDeviceResults.lengt" + "h; i++) {\r\n const res" + "ult = data.RandomDeviceResults[i];\r\n " + " const row = $(\'\');\r\n " + " const columns = row.find(\'td" + "\');\r\n $(\'\').attr({" + "\r\n href: result.U" + "rl,\r\n target: \'_b" + "lank\'\r\n }).text(resul" + "t.DeviceSerialNumber)\r\n " + " .appendTo(columns.eq(0));\r\n " + " $(\'\').text(result.DeviceComputerName)\r\n " + " .appendTo(columns.eq(1))" + "\r\n $(\'\').text(result.RenderedComputerName)\r\n " + " .appendTo(columns.eq(2))\r\n " + " if (!result.Success) {\r\n " + " $(\'
\').text(result.ErrorMessage).appendTo(columns.eq(2));\r\n " + " }\r\n " + " row.appendTo($table);\r\n " + " }\r\n " + " }\r\n $test.removeClass" + "(\'hidden\');\r\n $ajaxLoading.hi" + "de().next(\'.ajaxOk\').show().delay(\'fast\').fadeOut(\'slow\');\r\n " + " });\r\n } e" + "lse if (response.status == 400) {\r\n " + " response.json().then(data => {\r\n " + " $ajaxLoading.hide();\r\n " + " $test.addClass(\'hidden\');\r\n " + "$dialog.find(\'.error\').text(data).removeClass(\'hidden\');\r\n " + " console.error(data);\r\n " + " })\r\n }\r\n " + " }).catch(error => {\r\n " + " $ajaxLoading.hide();\r\n " + " $test.addClass(\'hidden\');\r\n $dialog" + ".find(\'.error\').text(\'Unable to test computer name template: \' + error).removeCl" + "ass(\'hidden\');\r\n console.error(error)" + ";\r\n });\r\n\r\n " + " return false;\r\n })\r\n " + " const $testSearchText = $dialog.find(\'#ComputerNameTemplate" + "TestSearch\');\r\n $testSearchText.autocomplete(" + "{\r\n source: \'"); #line 524 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(Url.Action(MVC.API.Search.Devices())); #line default #line hidden WriteLiteral(@"', minLength: 2, focus: function (e, ui) { $testSearchText.val(ui.item.Id); return false; }, select: function (e, ui) { $testSearchText.val(ui.item.Id).blur(); $buttonTest.click(); return false; } }).data('ui-autocomplete')._renderItem = function (ul, item) { return $('
  • ') .data('item.autocomplete', item) .append($('').text(item.Description)) .appendTo(ul); }; } $dialog.dialog('open'); return false; }); }); "); #line 548 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" } #line default #line hidden WriteLiteral(" \r\n"); #line 550 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden #line 550 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" if (canConfig) { #line default #line hidden WriteLiteral("
  • \r\n \r\n \r\n Computer names are only changed when Active Directory accounts are provisioned. If the device has already joined the domain when enrolment occurs the name will remain the same unless Enforce Naming Convention is enabled.

    Organisational Unit: "); #line 586 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden #line 586 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" if (canConfig) { #line default #line hidden WriteLiteral("
    \r\n"); #line 857 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" } else { #line default #line hidden WriteLiteral("
      \r\n"); #line 861 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden #line 861 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" foreach (var certificateProvider in certificateProviders) { #line default #line hidden WriteLiteral("
    • "); #line 863 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(certificateProvider.Name); #line default #line hidden WriteLiteral("
    • \r\n"); #line 864 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" } #line default #line hidden WriteLiteral("
    \r\n"); #line 866 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" } } #line default #line hidden WriteLiteral(" Authority Certificates\r\n"); #line 869 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden #line 869 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" if (canConfig && Model.CertificateAuthorityProviders.Count > 0) { #line default #line hidden #line 871 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(CommonHelpers.CheckBoxList("DeviceProfile_CertificateAuthorityProviders", "DeviceProfile_CertificateAuthorityProviders", Model.CertificateAuthorityProviders.ToSelectListItems(Model.DeviceProfile.GetCertificateAuthorityProviders()))); #line default #line hidden #line 871 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" } else { var certificateProviders = Model.DeviceProfile.GetCertificateAuthorityProviders().ToList(); if (certificateProviders.Count == 0) { #line default #line hidden WriteLiteral(" <None Allocated>
    \r\n"); #line 880 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" } else { #line default #line hidden WriteLiteral("
      \r\n"); #line 884 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden #line 884 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" foreach (var certificateProvider in certificateProviders) { #line default #line hidden WriteLiteral("
    • "); #line 886 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(certificateProvider.Name); #line default #line hidden WriteLiteral("
    • \r\n"); #line 887 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" } #line default #line hidden WriteLiteral("
    \r\n"); #line 889 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" } } #line default #line hidden WriteLiteral(" "); #line 891 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" if (canViewPlugins) { #line default #line hidden WriteLiteral(" \r\n \r\n View the (Url.Action(MVC.Config.Plugins.Install()) #line default #line hidden , 51454), false) ); WriteLiteral(">Plugin Catalogue
    to discover and install certificate provider plugins.\r\n " + "

    \r\n \r\n"); #line 898 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n " + " Provision Wireless Profiles:\r\n"); #line 904 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden #line 904 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" if (canConfig && Model.WirelessProfileProviders.Count > 0) { #line default #line hidden WriteLiteral("
    \r\n"); #line 907 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden #line 907 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(AjaxHelpers.AjaxLoader("DeviceProfile_WirelessProfileProviders")); #line default #line hidden #line 907 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden WriteLiteral(" $(function () { var $container = $('#DeviceProfile_WirelessProfileProviders'); $container.on('change', 'input', function () { var $ajaxLoading = $('#DeviceProfile_WirelessProfileProviders_loading').show(); const body = new FormData(); body.append('__RequestVerificationToken', document.body.dataset.antiforgery); body.append('wirelessProfileProviders', $container.find('input:checked',).map(function () { return $(this).val() }).get().join(',')); fetch('"); #line 919 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(Url.Action(MVC.API.DeviceProfile.UpdateWirelessProfileProviders(Model.DeviceProfile.Id))); #line default #line hidden WriteLiteral(@"', { method: 'POST', body: body }).then(r => { if (r.ok) { $ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow'); } else { alert('Unable to change property ""WirelessProfileProviders"":\n' + r.statusText); $ajaxLoading.hide(); } }).catch(e => { alert('Unable to change property ""WirelessProfileProviders"":\n' + e); $ajaxLoading.hide(); }); }); }); "); #line 936 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" } #line default #line hidden WriteLiteral(" \r\n \r\n"); #line 939 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden #line 939 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" if (canConfig && Model.WirelessProfileProviders.Count > 0) { #line default #line hidden #line 941 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(CommonHelpers.CheckBoxList("DeviceProfile_WirelessProfileProviders", "DeviceProfile_WirelessProfileProviders", Model.WirelessProfileProviders.ToSelectListItems(Model.DeviceProfile.GetWirelessProfileProviders()))); #line default #line hidden #line 941 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" } else { var wirelessProfileProviders = Model.DeviceProfile.GetWirelessProfileProviders().ToList(); if (wirelessProfileProviders.Count == 0) { #line default #line hidden WriteLiteral(" <None Allocated>\r\n"); #line 950 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" } else { #line default #line hidden WriteLiteral("
      \r\n"); #line 954 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden #line 954 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" foreach (var wirelessProfileProvider in wirelessProfileProviders) { #line default #line hidden WriteLiteral("
    • "); #line 956 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(wirelessProfileProvider.Name); #line default #line hidden WriteLiteral("
    • \r\n"); #line 957 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" } #line default #line hidden WriteLiteral("
    \r\n"); #line 959 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" } } #line default #line hidden WriteLiteral(" "); #line 961 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" if (canViewPlugins) { #line default #line hidden WriteLiteral(" \r\n \r\n View the (Url.Action(MVC.Config.Plugins.Install()) #line default #line hidden , 55112), false) ); WriteLiteral(">Plugin Catalogue to discover and install wireless profile provider plugins.\r" + "\n

    \r\n \r\n"); #line 968 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" } #line default #line hidden WriteLiteral(" \r\n \r\n"); #line 971 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden #line 971 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" if (hideAdvanced) { #line default #line hidden WriteLiteral(" \r\n \r\n Show Advanced Options "); #line 987 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" } #line default #line hidden WriteLiteral(" \r\n \r\n Linked Groups:\r\n \r\n " + " \r\n
    \r\n"); WriteLiteral(" "); #line 994 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(Html.Partial(MVC.Config.Shared.Views.LinkedGroupInstance, new LinkedGroupModel() { CanConfigure = canConfig, CategoryDescription = DeviceProfileDevicesManagedGroup.GetCategoryDescription(Model.DeviceProfile), Description = DeviceProfileDevicesManagedGroup.GetDescription(Model.DeviceProfile), ManagedGroup = Model.DevicesLinkedGroup, UpdateUrl = Url.Action(MVC.API.DeviceProfile.UpdateDevicesLinkedGroup(Model.DeviceProfile.Id, redirect: true)) })); #line default #line hidden WriteLiteral("\r\n"); WriteLiteral(" "); #line 1002 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(Html.Partial(MVC.Config.Shared.Views.LinkedGroupInstance, new LinkedGroupModel() { CanConfigure = canConfig, CategoryDescription = DeviceProfileAssignedUsersManagedGroup.GetCategoryDescription(Model.DeviceProfile), Description = DeviceProfileAssignedUsersManagedGroup.GetDescription(Model.DeviceProfile), ManagedGroup = Model.AssignedUsersLinkedGroup, UpdateUrl = Url.Action(MVC.API.DeviceProfile.UpdateAssignedUsersLinkedGroup(Model.DeviceProfile.Id, redirect: true)) })); #line default #line hidden WriteLiteral("\r\n"); #line 1010 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden #line 1010 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" if (canConfig) { #line default #line hidden #line 1012 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(Html.Partial(MVC.Config.Shared.Views.LinkedGroupShared)); #line default #line hidden #line 1012 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" } #line default #line hidden WriteLiteral("
    \r\n \r\n \r\n \r\n\r\n"); #line 1019 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(Html.Partial(MVC.Config.Shared.Views._DeviceGroupDocumentBulkGenerate, Model)); #line default #line hidden WriteLiteral("\r\n\r\n"); #line 1021 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden #line 1021 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" if (Model.CanDecommission) { #line default #line hidden WriteLiteral(" Decommission All Devices\r\n"); WriteLiteral(" \r\n"); #line 1025 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden #line 1025 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" using (Html.BeginForm(MVC.API.Device.DeviceProfileDecommission(Model.DeviceProfile.Id))) { #line default #line hidden #line 1027 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(Html.AntiForgeryToken()); #line default #line hidden #line 1027 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden WriteLiteral(" \r\n  Why are these devices to be decommissioned?\r\n \r\n"); WriteLiteral("
    \r\n \r\n"); #line 1033 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden #line 1033 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" foreach (DecommissionReasons decommissionReason in Enum.GetValues(typeof(DecommissionReasons)).Cast().OrderBy(r => r.ToString())) { #line default #line hidden WriteLiteral("
  • \r\n ((int)decommissionReason #line default #line hidden , 58853), false) ); WriteLiteral("\r\n name=\"decommissionReason\""); WriteAttribute("value", Tuple.Create(" value=\"", 58946), Tuple.Create("\"", 58980) #line 1037 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" , Tuple.Create(Tuple.Create("", 58954), Tuple.Create((int)decommissionReason #line default #line hidden , 58954), false) ); WriteLiteral(" "); #line 1037 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write((decommissionReason == DecommissionReasons.EndOfLife) ? "checked=\"checked\"" : string.Empty); #line default #line hidden WriteLiteral(" />\r\n ((int)decommissionReason #line default #line hidden , 59167), false) ); WriteLiteral(">"); #line 1038 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(decommissionReason.ReasonMessage()); #line default #line hidden WriteLiteral("\r\n
  • \r\n"); #line 1040 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" } #line default #line hidden WriteLiteral(" \r\n
    \r\n \r\n \r\n Unassign devices users\r\n " + "\r\n
    \r\n"); #line 1048 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" } #line default #line hidden WriteLiteral(" \r\n"); WriteLiteral(" $(function () { let buttonDialog = null; $('#DeviceProfile_Decommission').click(function () { if (!buttonDialog) { buttonDialog = $('#DeviceProfile_Decommission_Dialog') .dialog({ resizable: false, modal: true, autoOpen: false, buttons: { ""Decommission"": function () { const $this = $(this); $this.find('form').trigger('submit'); $this.dialog(""disable""); $this.dialog(""option"", ""buttons"", null); }, Cancel: function () { $(this).dialog(""close""); } } }); } buttonDialog.dialog('open'); return false; }); }); "); #line 1079 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" } #line default #line hidden WriteLiteral(" "); #line 1080 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" if (canDelete) { #line default #line hidden WriteLiteral(" Delete\r\n"); WriteLiteral(" \r\n"); #line 1084 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" #line default #line hidden #line 1084 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" using (Html.BeginForm(MVC.API.DeviceProfile.Delete(Model.DeviceProfile.Id, true))) { #line default #line hidden #line 1086 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(Html.AntiForgeryToken()); #line default #line hidden #line 1086 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" } #line default #line hidden WriteLiteral("

    \r\n \r\n This item will be permanently deleted and cannot be recove" + "red. Are you sure?\r\n

    \r\n \r\n"); WriteLiteral(" $(function () { let dialog = null; $('#buttonDelete').on('click', function () { if (!dialog) { dialog = $(""#dialogConfirmDelete"").dialog({ resizable: false, width: 300, modal: true, autoOpen: false, buttons: { ""Delete"": function () { $(this) .dialog(""option"", ""buttons"", null) .find('form').trigger('submit'); }, Cancel: function () { $(this).dialog(""close""); } } }); } dialog.dialog('open'); }); }); "); #line 1120 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" } #line default #line hidden WriteLiteral(" "); #line 1121 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" if (Authorization.Has(Claims.Device.Actions.Export)) { #line default #line hidden #line 1123 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(Html.ActionLinkButton("Export Devices", MVC.Device.Export(null, Disco.Models.Services.Devices.DeviceExportTypes.Profile, Model.DeviceProfile.Id))); #line default #line hidden #line 1123 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" } #line default #line hidden WriteLiteral(" "); #line 1125 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" if (Authorization.Has(Claims.Device.Search) && Model.DeviceCount > 0) { #line default #line hidden #line 1127 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" Write(Html.ActionLinkButton(string.Format("View {0} Device{1}", Model.DeviceCount, (Model.DeviceCount != 1 ? "s" : null)), MVC.Search.Query(Model.DeviceProfile.Id.ToString(), "DeviceProfile"))); #line default #line hidden #line 1127 "..\..\Areas\Config\Views\DeviceProfile\Show.cshtml" } #line default #line hidden WriteLiteral("\r\n"); } } } #pragma warning restore 1591