27c21175d7
Migrate much of BI to Services. Added Wireless Profile Provider plugin feature. Added Certificate Authority Provider plugin feature. Modified Certificate Provider plugin feature. Database migration v17, for Device Profiles. Enrolment Client Updated to support CA Certificates, Wireless Profiles and Hardware Info. New Client Enrolment Protocol to support new features. Plugin Manifest Generator added to main solution. Improved AD search performance.
2901 lines
110 KiB
C#
2901 lines
110 KiB
C#
#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.Views.Device.DeviceParts
|
|
{
|
|
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 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
using Disco.Services.Users.UserFlags;
|
|
|
|
#line default
|
|
#line hidden
|
|
using Disco.Services.Web;
|
|
using Disco.Web;
|
|
using Disco.Web.Extensions;
|
|
|
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
|
|
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Device/DeviceParts/_Subject.cshtml")]
|
|
public partial class _Subject : Disco.Services.Web.WebViewPage<Disco.Web.Models.Device.ShowModel>
|
|
{
|
|
public _Subject()
|
|
{
|
|
}
|
|
public override void Execute()
|
|
{
|
|
|
|
#line 3 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
Authorization.Require(Claims.Device.Show);
|
|
|
|
Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n<table");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Subjects\"");
|
|
|
|
WriteLiteral(">\r\n <tr>\r\n <td");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Details\"");
|
|
|
|
WriteLiteral(">\r\n <div>\r\n <div");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Details_Asset\"");
|
|
|
|
WriteLiteral(">\r\n <table");
|
|
|
|
WriteLiteral(" class=\"none verticalHeadings\"");
|
|
|
|
WriteLiteral(">\r\n <tr>\r\n <td>\r\n " +
|
|
" <span");
|
|
|
|
WriteLiteral(" title=\"Computer Name\"");
|
|
|
|
WriteLiteral(">Name:</span>\r\n </td>\r\n <td" +
|
|
">\r\n");
|
|
|
|
|
|
#line 19 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 19 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (string.IsNullOrWhiteSpace(Model.Device.ComputerName))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <span");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Details_Asset_NameUnknown\"");
|
|
|
|
WriteLiteral(" title=\"Computer Name\"");
|
|
|
|
WriteLiteral(" class=\"smallMessage\"");
|
|
|
|
WriteLiteral("><Unknown/None></span>\r\n");
|
|
|
|
|
|
#line 22 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <h4");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Details_Asset_Name\"");
|
|
|
|
WriteLiteral(" title=\"Computer Name\"");
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 25 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Model.Device.ComputerName);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</h4>\r\n");
|
|
|
|
|
|
#line 26 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </td>\r\n </tr>\r\n " +
|
|
" <tr>\r\n <td>\r\n " +
|
|
" <span");
|
|
|
|
WriteLiteral(" title=\"Domain Name\"");
|
|
|
|
WriteLiteral(">Domain:</span>\r\n </td>\r\n <" +
|
|
"td>\r\n");
|
|
|
|
|
|
#line 34 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 34 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (string.IsNullOrWhiteSpace(Model.Device.ComputerDomainName))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <span");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Details_Asset_DomainUnknown\"");
|
|
|
|
WriteLiteral(" title=\"Computer Domain\"");
|
|
|
|
WriteLiteral(" class=\"smallMessage\"");
|
|
|
|
WriteLiteral("><None></span>\r\n");
|
|
|
|
|
|
#line 37 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <h4");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Details_Asset_Domain\"");
|
|
|
|
WriteLiteral(" title=\"Computer Domain\"");
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 40 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Model.Device.ComputerDomainName);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</h4>\r\n");
|
|
|
|
|
|
#line 41 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </td>\r\n </tr>\r\n " +
|
|
" <tr>\r\n <td>Asset:</td>\r\n " +
|
|
" <td>\r\n");
|
|
|
|
|
|
#line 47 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 47 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Authorization.Has(Claims.Device.Properties.AssetNumber))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 49 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Html.TextBoxFor(m => m.Device.AssetNumber, new { @class = "small discreet" }));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 49 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 49 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(AjaxHelpers.AjaxSave());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 49 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 49 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(AjaxHelpers.AjaxLoader());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 49 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <span");
|
|
|
|
WriteLiteral(" class=\"small discreet\"");
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 53 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Model.Device.AssetNumber ?? "Unknown");
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</span>\r\n");
|
|
|
|
|
|
#line 54 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </td>\r\n </tr>\r\n " +
|
|
" <tr>\r\n <td>Location:</td>\r\n " +
|
|
" <td>\r\n");
|
|
|
|
|
|
#line 60 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 60 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Authorization.Has(Claims.Device.Properties.Location))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 62 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Html.TextBoxFor(m => m.Device.Location, new { @class = "small discreet" }));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 62 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 62 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(AjaxHelpers.AjaxSave());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 62 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 62 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(AjaxHelpers.AjaxLoader());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 62 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <span");
|
|
|
|
WriteLiteral(" class=\"small discreet\"");
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 66 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Model.Device.Location ?? "Unknown");
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</span>\r\n");
|
|
|
|
|
|
#line 67 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </td>\r\n </tr>\r\n " +
|
|
" </table>\r\n");
|
|
|
|
|
|
#line 71 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 71 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Authorization.HasAny(Claims.Device.Properties.AssetNumber, Claims.Device.Properties.Location))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <script>\r\n $(function () {\r\n");
|
|
|
|
|
|
#line 75 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 75 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Authorization.Has(Claims.Device.Properties.AssetNumber))
|
|
{
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("document.DiscoFunctions.PropertyChangeHelper($(\'#Device_AssetNumber\'), \'Unknown\'," +
|
|
" \'");
|
|
|
|
|
|
#line 76 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Url.Action(MVC.API.Device.UpdateAssetNumber(Model.Device.SerialNumber, null)));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\', \'AssetNumber\');");
|
|
|
|
|
|
#line 76 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 77 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Authorization.Has(Claims.Device.Properties.Location))
|
|
{
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("document.DiscoFunctions.PropertyChangeHelper($(\'#Device_Location\'), \'Unknown\', \'");
|
|
|
|
|
|
#line 78 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Url.Action(MVC.API.Device.UpdateLocation(Model.Device.SerialNumber, null)));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\', \'Location\');");
|
|
|
|
|
|
#line 78 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" });\r\n </script>\r\n");
|
|
|
|
|
|
#line 81 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </div>\r\n <div");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Details_Dates\"");
|
|
|
|
WriteLiteral(" class=\"status\"");
|
|
|
|
WriteLiteral(">\r\n <table");
|
|
|
|
WriteLiteral(" class=\"none verticalHeadings\"");
|
|
|
|
WriteLiteral(">\r\n <tr>\r\n <td>\r\n " +
|
|
" Created:\r\n </td>\r\n " +
|
|
" <td><span");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Details_Dates_Created\"");
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 89 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(CommonHelpers.FriendlyDate(Model.Device.CreatedDate));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</span></td>\r\n </tr>\r\n");
|
|
|
|
|
|
#line 91 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 91 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Model.Device.DecommissionedDate.HasValue)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <tr>\r\n <td>\r\n " +
|
|
" Decommissioned:\r\n </td" +
|
|
">\r\n <td><span");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Details_Dates_Decommissioned\"");
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 97 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(CommonHelpers.FriendlyDate(Model.Device.DecommissionedDate));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</span></td>\r\n </tr>\r\n");
|
|
|
|
|
|
#line 99 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n <tr>\r\n <td>\r\n " +
|
|
" Enrolled:\r\n </td>\r\n " +
|
|
" <td>\r\n");
|
|
|
|
|
|
#line 106 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 106 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Model.Device.EnrolledDate.HasValue)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" ");
|
|
|
|
WriteLiteral("First: ");
|
|
|
|
WriteLiteral("<span");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Details_Asset_Enrolled_First\"");
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 108 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(CommonHelpers.FriendlyDate(Model.Device.EnrolledDate));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</span>\r\n");
|
|
|
|
|
|
#line 109 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Model.Device.LastEnrolDate.HasValue && Model.Device.EnrolledDate.Value != Model.Device.LastEnrolDate.Value)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <br />");
|
|
|
|
WriteLiteral("Last: ");
|
|
|
|
WriteLiteral("<span");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Details_Asset_Enrolled_Last\"");
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 111 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(CommonHelpers.FriendlyDate(Model.Device.LastEnrolDate));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</span>\r\n");
|
|
|
|
|
|
#line 112 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <span");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Details_Asset_Enrolled_Never\"");
|
|
|
|
WriteLiteral(" class=\"smallMessage\"");
|
|
|
|
WriteLiteral(">Never</span>\r\n");
|
|
|
|
|
|
#line 117 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 118 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Model.Device.AllowUnauthenticatedEnrol)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <span");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Details_Asset_Enrolled_Trusted\"");
|
|
|
|
WriteLiteral(" title=\"Trusted Unauthenticated Enrolment is Allowed\"");
|
|
|
|
WriteLiteral("></span>\r\n");
|
|
|
|
|
|
#line 121 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </td>\r\n </tr>\r\n\r\n " +
|
|
" </table>\r\n </div>\r\n <div");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Details_Status\"");
|
|
|
|
WriteLiteral(" class=\"status\"");
|
|
|
|
WriteLiteral(">\r\n <table");
|
|
|
|
WriteLiteral(" class=\"none verticalHeadings\"");
|
|
|
|
WriteLiteral(">\r\n <tr>\r\n <td>\r\n " +
|
|
" <span");
|
|
|
|
WriteLiteral(" title=\"Last Network Logon Date\"");
|
|
|
|
WriteLiteral(">Last Seen:</span>\r\n </td>\r\n " +
|
|
" <td>\r\n");
|
|
|
|
|
|
#line 134 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 134 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
string lastSeenClass = null;
|
|
if (Model.Device.LastNetworkLogonDate.HasValue)
|
|
{
|
|
if (Model.Device.LastNetworkLogonDate.Value < DateTime.Now.AddDays(-30))
|
|
{
|
|
lastSeenClass = "error";
|
|
}
|
|
else
|
|
{
|
|
if (Model.Device.LastNetworkLogonDate.Value < DateTime.Now.AddDays(-7))
|
|
{
|
|
lastSeenClass = "alert";
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n <span");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Details_Status_LastSeen\"");
|
|
|
|
WriteAttribute("class", Tuple.Create(" class=\"", 8454), Tuple.Create("\"", 8476)
|
|
|
|
#line 151 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 8462), Tuple.Create<System.Object, System.Int32>(lastSeenClass
|
|
|
|
#line default
|
|
#line hidden
|
|
, 8462), false)
|
|
);
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 151 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(CommonHelpers.FriendlyDate(Model.Device.LastNetworkLogonDate));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</span>\r\n </td>\r\n");
|
|
|
|
|
|
#line 153 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 153 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (!string.IsNullOrEmpty(Model.Device.ComputerName))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <script");
|
|
|
|
WriteLiteral(" type=\"text/javascript\"");
|
|
|
|
WriteLiteral(@">
|
|
$(function () {
|
|
var updated = false;
|
|
var span = $('#Device_Show_Details_Status_LastSeen');
|
|
var spanProgress = null;
|
|
|
|
$.getJSON('");
|
|
|
|
|
|
#line 161 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Url.Action(MVC.API.Device.LastNetworkLogonDate(Model.Device.SerialNumber)));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\', function (response, result) {\r\n upd" +
|
|
"ated = true;\r\n if (spanProgress)\r\n " +
|
|
" spanProgress.remove();\r\n\r\n " +
|
|
" if (result != \'success\') {\r\n " +
|
|
" alert(\'Unable to retrieve latest network logon da" +
|
|
"te:\\n\' + response);\r\n $(\'<span>\')" +
|
|
".addClass(\'smallMessage\').text(\'[may not be current]\').appendTo(span);\r\n " +
|
|
" } else {\r\n " +
|
|
" var spanClasses = \'\',\r\n " +
|
|
" diff = moment().valueOf() - response.UnixEpoc;\r\n " +
|
|
" if (diff > 2592000000) // 30 Days\r\n " +
|
|
" spanClasses = \'error\';\r\n " +
|
|
" else if (diff > 604800000) // 7 Days\r\n " +
|
|
" spanClasses = \'alert\';\r\n " +
|
|
" span.removeClass(\'alert error\').addClass(spanClasses)." +
|
|
"attr(\'title\', response.Formatted).text(response.Formatted).livestamp(response.Un" +
|
|
"ixEpoc);\r\n }\r\n " +
|
|
" });\r\n window.setTimeout(" +
|
|
"function () {\r\n if (!updated) {\r\n " +
|
|
" spanProgress = $(\'<i>\').addClass(\'aj" +
|
|
"axLoading showInitially\').attr(\'title\', \'Loading...\').appendTo(span);\r\n " +
|
|
" }\r\n }," +
|
|
" 250);\r\n });\r\n " +
|
|
" </script>\r\n");
|
|
|
|
|
|
#line 186 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </tr>\r\n </table>\r\n </di" +
|
|
"v>\r\n <div");
|
|
|
|
WriteLiteral(" class=\"status\"");
|
|
|
|
WriteLiteral(">\r\n");
|
|
|
|
|
|
#line 191 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 191 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
var assignedUser = Model.Device.AssignedUser;
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n <table");
|
|
|
|
WriteLiteral(" class=\"none verticalHeadings\"");
|
|
|
|
WriteLiteral(">\r\n <tr>\r\n <td>\r\n " +
|
|
" Assignment:\r\n </td>\r\n " +
|
|
" <td>\r\n");
|
|
|
|
|
|
#line 200 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 200 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (assignedUser != null)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" id=\"Device_Show_User\"");
|
|
|
|
WriteLiteral(">\r\n <div");
|
|
|
|
WriteLiteral(" id=\"Device_Show_User_DisplayName\"");
|
|
|
|
WriteLiteral(" title=\"Display Name\"");
|
|
|
|
WriteLiteral(">\r\n");
|
|
|
|
|
|
#line 204 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 204 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Authorization.Has(Claims.User.Show))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 206 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Html.ActionLink(assignedUser.DisplayName, MVC.User.Show(assignedUser.UserId)));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 206 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 210 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(assignedUser.DisplayName);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 210 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </div>\r\n " +
|
|
" <div");
|
|
|
|
WriteLiteral(" id=\"Device_Show_User_Id\"");
|
|
|
|
WriteLiteral(" title=\"Id\"");
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 213 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(assignedUser.FriendlyId());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</div>\r\n");
|
|
|
|
|
|
#line 214 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 214 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Authorization.Has(Claims.User.ShowDetails))
|
|
{
|
|
if (!string.IsNullOrWhiteSpace(assignedUser.PhoneNumber))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" id=\"Device_Show_User_PhoneNumber\"");
|
|
|
|
WriteLiteral(" title=\"Phone Number\"");
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 218 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(assignedUser.PhoneNumber);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</div>\r\n");
|
|
|
|
|
|
#line 219 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
if (!string.IsNullOrWhiteSpace(assignedUser.EmailAddress))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" id=\"Device_Show_User_EmailAddress\"");
|
|
|
|
WriteLiteral(" title=\"Email Address\"");
|
|
|
|
WriteLiteral("><a");
|
|
|
|
WriteAttribute("href", Tuple.Create(" href=\"", 13219), Tuple.Create("\"", 13274)
|
|
, Tuple.Create(Tuple.Create("", 13226), Tuple.Create("mailto:", 13226), true)
|
|
|
|
#line 222 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 13233), Tuple.Create<System.Object, System.Int32>(Model.Device.AssignedUser.EmailAddress
|
|
|
|
#line default
|
|
#line hidden
|
|
, 13233), false)
|
|
);
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 222 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(assignedUser.EmailAddress);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</a></div>\r\n");
|
|
|
|
|
|
#line 223 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 225 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Authorization.Has(Claims.User.ShowFlagAssignments))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" id=\"Device_Show_User_Flags\"");
|
|
|
|
WriteLiteral(">\r\n");
|
|
|
|
|
|
#line 228 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 228 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
foreach (var flag in assignedUser.UserFlagAssignments.Where(f => !f.RemovedDate.HasValue).Select(f => Tuple.Create(f, UserFlagService.GetUserFlag(f.UserFlagId))))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <i");
|
|
|
|
WriteAttribute("class", Tuple.Create(" class=\"", 13942), Tuple.Create("\"", 14012)
|
|
, Tuple.Create(Tuple.Create("", 13950), Tuple.Create("flag", 13950), true)
|
|
, Tuple.Create(Tuple.Create(" ", 13954), Tuple.Create("fa", 13955), true)
|
|
, Tuple.Create(Tuple.Create(" ", 13957), Tuple.Create("fa-", 13958), true)
|
|
|
|
#line 230 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 13961), Tuple.Create<System.Object, System.Int32>(flag.Item2.Icon
|
|
|
|
#line default
|
|
#line hidden
|
|
, 13961), false)
|
|
, Tuple.Create(Tuple.Create(" ", 13979), Tuple.Create("fa-fw", 13980), true)
|
|
, Tuple.Create(Tuple.Create(" ", 13985), Tuple.Create("d-", 13986), true)
|
|
|
|
#line 230 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 13988), Tuple.Create<System.Object, System.Int32>(flag.Item2.IconColour
|
|
|
|
#line default
|
|
#line hidden
|
|
, 13988), false)
|
|
);
|
|
|
|
WriteLiteral(">\r\n <span");
|
|
|
|
WriteLiteral(" class=\"details\"");
|
|
|
|
WriteLiteral(">\r\n <span");
|
|
|
|
WriteLiteral(" class=\"name\"");
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 232 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(flag.Item2.Name);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</span>");
|
|
|
|
|
|
#line 232 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (flag.Item1.Comments != null)
|
|
{
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("<span");
|
|
|
|
WriteLiteral(" class=\"comments\"");
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 233 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(flag.Item1.Comments.ToHtmlComment());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</span>");
|
|
|
|
|
|
#line 233 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("<span");
|
|
|
|
WriteLiteral(" class=\"added\"");
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 233 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(CommonHelpers.FriendlyDateAndUser(flag.Item1.AddedDate, flag.Item1.AddedUserId));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</span>\r\n </span>\r\n " +
|
|
" </i>\r\n");
|
|
|
|
|
|
#line 236 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <script");
|
|
|
|
WriteLiteral(" type=\"text/javascript\"");
|
|
|
|
WriteLiteral(">\r\n $(function () {\r\n " +
|
|
" $(\'#Device_Show_User_Flags\')\r\n " +
|
|
" .tooltip({\r\n " +
|
|
" items: \'i.flag\',\r\n " +
|
|
" content: function () {\r\n " +
|
|
" var $this = $" +
|
|
"(this);\r\n ret" +
|
|
"urn $this.children(\'.details\').html();\r\n " +
|
|
" },\r\n " +
|
|
" tooltipClass: \'User_FlagAssignment_Tooltip\',\r\n " +
|
|
" position: {\r\n " +
|
|
" my: \"right top\",\r\n " +
|
|
" at: \"right bottom\",\r\n " +
|
|
" collision: \"flipfit fl" +
|
|
"ip\"\r\n },\r\n " +
|
|
" hade: {\r\n " +
|
|
" effect: \'\'\r\n " +
|
|
" },\r\n " +
|
|
" close: function (e, ui) {\r\n " +
|
|
" ui.tooltip.hover(\r\n " +
|
|
" function () {\r\n " +
|
|
" $(thi" +
|
|
"s).stop(true).fadeTo(100, 1);\r\n " +
|
|
" },\r\n " +
|
|
" function () {\r\n " +
|
|
" $(this).fadeOut(100, function () { $(this).remove(" +
|
|
"); });\r\n " +
|
|
"});\r\n }\r\n " +
|
|
" });\r\n " +
|
|
" });\r\n " +
|
|
" </script>\r\n </div>\r\n");
|
|
|
|
|
|
#line 268 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </div>\r\n");
|
|
|
|
|
|
#line 270 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <span");
|
|
|
|
WriteLiteral(" class=\"smallMessage\"");
|
|
|
|
WriteLiteral(">Not Assigned</span>\r\n");
|
|
|
|
|
|
#line 274 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </td>\r\n </tr>\r\n " +
|
|
" </table>\r\n </div>\r\n");
|
|
|
|
|
|
#line 279 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 279 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Authorization.Has(Claims.Device.Actions.GenerateDocuments))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" id=\"Device_Show_GenerateDocument_Container\"");
|
|
|
|
WriteLiteral(" class=\"status\"");
|
|
|
|
WriteLiteral(">\r\n");
|
|
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 282 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Html.DropDownList("Device_Show_GenerateDocument", Model.DocumentTemplatesSelectListItems));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n <script");
|
|
|
|
WriteLiteral(" type=\"text/javascript\"");
|
|
|
|
WriteLiteral(">\r\n $(function () {\r\n v" +
|
|
"ar generatePdfUrl = \'");
|
|
|
|
|
|
#line 285 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Url.Action(MVC.API.Device.GeneratePdf(Model.Device.SerialNumber.ToString(), null)));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("?DocumentTemplateId=\';\r\n var $documentTemplates = " +
|
|
"$(\'#Device_Show_GenerateDocument\');\r\n var $genera" +
|
|
"tionHost;\r\n\r\n $documentTemplates.change(function " +
|
|
"() {\r\n var v = $documentTemplates.val();\r\n " +
|
|
" if (v) {\r\n " +
|
|
" var url = generatePdfUrl + v;\r\n\r\n if (" +
|
|
"$.connection && $.connection.hub && $.connection.hub.transport &&\r\n " +
|
|
" $.connection.hub.transport.name == \'foreverFr" +
|
|
"ame\') {\r\n // SignalR active with fore" +
|
|
"verFrame transport - use popup window\r\n " +
|
|
" window.open(url, \'_blank\', \'height=150,width=250,location=no,menubar=no,resiz" +
|
|
"able=no,scrollbars=no,status=no,toolbar=no\');\r\n " +
|
|
" } else {\r\n // use iFrame\r\n " +
|
|
" if (!$generationHost) {\r\n " +
|
|
" $generationHost = $(\'<iframe>\')\r\n " +
|
|
" .attr({ \'src\': url, \'title\': \'Document Gen" +
|
|
"eration Host\' })\r\n .addClass(" +
|
|
"\'hidden\')\r\n .appendTo(\'body\')" +
|
|
"\r\n .contents();\r\n " +
|
|
" } else {\r\n " +
|
|
" $generationHost[0].location.href = url;\r\n " +
|
|
" }\r\n }\r\n\r\n " +
|
|
" $documentTemplates.val(\'\').blur();\r\n " +
|
|
" }\r\n });\r\n " +
|
|
" });\r\n </script>\r\n </div>\r\n");
|
|
|
|
|
|
#line 317 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </div>\r\n </td>\r\n <td");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Policies\"");
|
|
|
|
WriteLiteral(" rowspan=\"2\"");
|
|
|
|
WriteLiteral(">\r\n <div>\r\n <div");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Policies_Profile\"");
|
|
|
|
WriteLiteral(">\r\n <h2");
|
|
|
|
WriteLiteral(" title=\"Device Profile\"");
|
|
|
|
WriteLiteral(">\r\n");
|
|
|
|
|
|
#line 324 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 324 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Authorization.Has(Claims.Config.DeviceProfile.Show))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 326 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Html.ActionLink(Model.Device.DeviceProfile.Name, MVC.Config.DeviceProfile.Index(Model.Device.DeviceProfileId)));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 326 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 330 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Model.Device.DeviceProfile.Name);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 330 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </h2>\r\n <table");
|
|
|
|
WriteLiteral(" class=\"none verticalHeadings\"");
|
|
|
|
WriteLiteral(">\r\n <tr>\r\n <td>\r\n " +
|
|
" <span");
|
|
|
|
WriteLiteral(" title=\"Distribution Type\"");
|
|
|
|
WriteLiteral(">Distribution:</span>\r\n </td>\r\n " +
|
|
" <td>\r\n");
|
|
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 339 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Model.Device.DeviceProfile.DistributionType.ToString());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n </td>\r\n </tr>\r\n " +
|
|
" <tr>\r\n <td>\r\n " +
|
|
" <span");
|
|
|
|
WriteLiteral(" title=\"Address\"");
|
|
|
|
WriteLiteral(">Address:</span>\r\n </td>\r\n " +
|
|
"<td>\r\n");
|
|
|
|
|
|
#line 347 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 347 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
if (Model.DeviceProfileDefaultOrganisationAddress != null)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <span");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Policies_Profile_Address\"");
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 350 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Model.DeviceProfileDefaultOrganisationAddress.Name);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</span>\r\n");
|
|
|
|
|
|
#line 351 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <span");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Policies_Profile_Address_None\"");
|
|
|
|
WriteLiteral(" class=\"smallMessage\"");
|
|
|
|
WriteLiteral(">None</span>\r\n");
|
|
|
|
|
|
#line 355 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n </td>\r\n </tr>\r\n " +
|
|
" <tr>\r\n <td>\r\n " +
|
|
" <span");
|
|
|
|
WriteLiteral(" title=\"Provision Active Directory Account\"");
|
|
|
|
WriteLiteral(">Provision Account:</span>\r\n </td>\r\n " +
|
|
" <td>\r\n");
|
|
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 364 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Model.Device.DeviceProfile.ProvisionADAccount ? "Active Directory" : "No");
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n </td>\r\n </tr>\r\n " +
|
|
" <tr>\r\n <td>\r\n " +
|
|
" <span");
|
|
|
|
WriteLiteral(" title=\"Provisioned Personal Certificates\"");
|
|
|
|
WriteLiteral(">Certificates:</span>\r\n </td>\r\n " +
|
|
" <td>\r\n");
|
|
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 372 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Model.DeviceProfileCertificateProviders != null ? string.Join(", ", Model.DeviceProfileCertificateProviders.Select(c => c.Name)) : "None Provisioned");
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n </td>\r\n <tr>\r\n " +
|
|
" <td>\r\n <span");
|
|
|
|
WriteLiteral(" title=\"Provisioned Wireless Profiles\"");
|
|
|
|
WriteLiteral(">Wireless Profiles:</span>\r\n </td>\r\n " +
|
|
" <td>\r\n");
|
|
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 379 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Model.DeviceProfileWirelessProfileProviders != null ? string.Join(", ", Model.DeviceProfileWirelessProfileProviders.Select(c => c.Name)) : "None Provisioned");
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n </td>\r\n </tr>\r\n " +
|
|
" </table>\r\n");
|
|
|
|
|
|
#line 383 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 383 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Model.Device.CanUpdateDeviceProfile())
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 385 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Html.ActionLinkSmallButton("Update Profile", MVC.API.Device.UpdateDeviceProfileId(Model.Device.SerialNumber, redirect: true), "Device_Show_Policies_Profile_Actions_Update_Button"));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 385 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Policies_Profile_Actions_Update_Dialog\"");
|
|
|
|
WriteLiteral(" class=\"dialog\"");
|
|
|
|
WriteLiteral(" title=\"Assign to Device Profile\"");
|
|
|
|
WriteLiteral(">\r\n <div>\r\n <ul");
|
|
|
|
WriteLiteral(" class=\"none\"");
|
|
|
|
WriteLiteral(">\r\n");
|
|
|
|
|
|
#line 390 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 390 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
foreach (var dp in Model.DeviceProfiles.OrderBy(i => i.Name))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <li>\r\n " +
|
|
" <input");
|
|
|
|
WriteLiteral(" type=\"radio\"");
|
|
|
|
WriteLiteral(" data-deviceprofileid=\"");
|
|
|
|
|
|
#line 393 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(dp.Id);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\"");
|
|
|
|
WriteLiteral(" name=\"DeviceProfile\"");
|
|
|
|
WriteAttribute("id", Tuple.Create(" id=\"", 24364), Tuple.Create("\"", 24391)
|
|
, Tuple.Create(Tuple.Create("", 24369), Tuple.Create("DeviceProfile_", 24369), true)
|
|
|
|
#line 393 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 24383), Tuple.Create<System.Object, System.Int32>(dp.Id
|
|
|
|
#line default
|
|
#line hidden
|
|
, 24383), false)
|
|
);
|
|
|
|
WriteLiteral(" /><label");
|
|
|
|
WriteAttribute("for", Tuple.Create(" for=\"", 24401), Tuple.Create("\"", 24429)
|
|
, Tuple.Create(Tuple.Create("", 24407), Tuple.Create("DeviceProfile_", 24407), true)
|
|
|
|
#line 393 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 24421), Tuple.Create<System.Object, System.Int32>(dp.Id
|
|
|
|
#line default
|
|
#line hidden
|
|
, 24421), false)
|
|
);
|
|
|
|
WriteAttribute("title", Tuple.Create(" title=\"", 24430), Tuple.Create("\"", 24474)
|
|
, Tuple.Create(Tuple.Create("", 24438), Tuple.Create("Distribution:", 24438), true)
|
|
|
|
#line 393 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
, Tuple.Create(Tuple.Create(" ", 24451), Tuple.Create<System.Object, System.Int32>(dp.DistributionType
|
|
|
|
#line default
|
|
#line hidden
|
|
, 24452), false)
|
|
);
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 393 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(dp.Name);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</label>\r\n </li>\r\n");
|
|
|
|
|
|
#line 395 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </ul>\r\n </div>\r\n " +
|
|
" </div>\r\n");
|
|
|
|
WriteLiteral(" <script>\r\n $(function () {\r\n " +
|
|
" var currentProfile = \'");
|
|
|
|
|
|
#line 401 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Model.Device.DeviceProfileId);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\';\r\n var button = $(\'#Device_Show_Policies_Profile" +
|
|
"_Actions_Update_Button\');\r\n var buttonDialog = nu" +
|
|
"ll;\r\n var dialogInputs = null;\r\n " +
|
|
" var dialogContainers = null;\r\n\r\n b" +
|
|
"utton.click(function () {\r\n\r\n if (!buttonDial" +
|
|
"og) {\r\n buttonDialog = $(\'#Device_Show_Po" +
|
|
"licies_Profile_Actions_Update_Dialog\')\r\n " +
|
|
" .dialog({\r\n " +
|
|
" resizable: false,\r\n " +
|
|
" modal: true,\r\n " +
|
|
" maxHeight: 450,\r\n " +
|
|
" autoOpen: false,\r\n " +
|
|
" buttons: {\r\n " +
|
|
" \"Update Profile\": function () {\r\n " +
|
|
" var deviceProfileId = dialogInputs.f" +
|
|
"ilter(\':checked\').attr(\'data-deviceprofileid\');\r\n\r\n " +
|
|
" if (deviceProfileId) {\r\n " +
|
|
" var $this = $(thi" +
|
|
"s);\r\n " +
|
|
" $this.dialog(\"disable\");\r\n " +
|
|
" $this.dialog(\"option\", \"buttons\", null);\r\n " +
|
|
" window.location.hre" +
|
|
"f = button.attr(\'href\') + \'&DeviceProfileId=\' + deviceProfileId;\r\n " +
|
|
" } else {\r\n " +
|
|
" alert(\'A device " +
|
|
"profile must be selected\');\r\n " +
|
|
" }\r\n " +
|
|
" },\r\n " +
|
|
" Cancel: function () {\r\n " +
|
|
" $(this).dialog(\"close\");\r\n " +
|
|
" }\r\n " +
|
|
" }\r\n " +
|
|
" });\r\n dialogInputs = buttonDialog.find" +
|
|
"(\'input\');\r\n dialogContainers = dialogInp" +
|
|
"uts.closest(\'li\');\r\n\r\n dialogInputs.chang" +
|
|
"e(function () {\r\n dialogContainers.re" +
|
|
"moveClass(\'selected\');\r\n $(this).clos" +
|
|
"est(\'li\').addClass(\'selected\');\r\n });\r\n " +
|
|
" }\r\n\r\n dialo" +
|
|
"gInputs.filter(\'[data-deviceprofileid=\' + currentProfile + \']\').prop(\'checked\', " +
|
|
"true).change();\r\n\r\n buttonDialog.dialog(\'open" +
|
|
"\');\r\n return false;\r\n " +
|
|
" });\r\n\r\n });\r\n </script" +
|
|
">\r\n");
|
|
|
|
|
|
#line 451 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </div>\r\n <div");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Policies_Batch\"");
|
|
|
|
WriteLiteral(" class=\"status\"");
|
|
|
|
WriteLiteral(">\r\n");
|
|
|
|
|
|
#line 454 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 454 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Model.Device.DeviceBatchId.HasValue)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <h2");
|
|
|
|
WriteLiteral(" title=\"Device Batch\"");
|
|
|
|
WriteLiteral(">\r\n");
|
|
|
|
|
|
#line 457 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 457 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Authorization.Has(Claims.Config.DeviceBatch.Show))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 459 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Html.ActionLink(Model.Device.DeviceBatch.Name, MVC.Config.DeviceBatch.Index(Model.Device.DeviceBatchId.Value)));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 459 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 463 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Model.Device.DeviceBatch.Name);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 463 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </h2>\r\n");
|
|
|
|
WriteLiteral(" <table");
|
|
|
|
WriteLiteral(" class=\"none verticalHeadings\"");
|
|
|
|
WriteLiteral(">\r\n <tr>\r\n <td>\r\n " +
|
|
" <span");
|
|
|
|
WriteLiteral(" title=\"Purchased Date\"");
|
|
|
|
WriteLiteral(">Purchased:</span>\r\n </td>\r\n " +
|
|
" <td>\r\n");
|
|
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 472 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(CommonHelpers.FriendlyDate(Model.Device.DeviceBatch.PurchaseDate));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n </td>\r\n </tr>\r\n " +
|
|
" <tr>\r\n <td>\r\n " +
|
|
" <span");
|
|
|
|
WriteLiteral(" title=\"Supplier\"");
|
|
|
|
WriteLiteral(">Supplier:</span>\r\n </td>\r\n " +
|
|
" <td>\r\n");
|
|
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 480 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Model.Device.DeviceBatch.Supplier ?? "Unknown");
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n </td>\r\n </tr>\r\n " +
|
|
" <tr>\r\n <td>\r\n " +
|
|
" <span");
|
|
|
|
WriteLiteral(" title=\"Warranty Valid Until\"");
|
|
|
|
WriteLiteral(">Warranty Until:</span>\r\n </td>\r\n " +
|
|
" <td");
|
|
|
|
WriteAttribute("class", Tuple.Create(" class=\"", 30134), Tuple.Create("\"", 30282)
|
|
|
|
#line 487 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 30142), Tuple.Create<System.Object, System.Int32>(Model.Device.DeviceBatch.WarrantyValidUntil.HasValue && Model.Device.DeviceBatch.WarrantyValidUntil.Value < DateTime.Now ? "alert" : null
|
|
|
|
#line default
|
|
#line hidden
|
|
, 30142), false)
|
|
);
|
|
|
|
WriteLiteral(">\r\n");
|
|
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 488 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(CommonHelpers.FriendlyDate(Model.Device.DeviceBatch.WarrantyValidUntil, "Unknown", null));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n </td>\r\n </tr>\r\n " +
|
|
" <tr>\r\n <td>\r\n " +
|
|
" <span");
|
|
|
|
WriteLiteral(" title=\"Insurance Supplier\"");
|
|
|
|
WriteLiteral(">Insurance Supplier:</span>\r\n </td>\r\n " +
|
|
" <td>\r\n");
|
|
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 496 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Model.Device.DeviceBatch.InsuranceSupplier ?? "Unknown");
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n </td>\r\n </tr>\r\n " +
|
|
" <tr>\r\n <td>\r\n " +
|
|
" <span");
|
|
|
|
WriteLiteral(" title=\"Insured Until\"");
|
|
|
|
WriteLiteral(">Insured Until:</span>\r\n </td>\r\n " +
|
|
" <td");
|
|
|
|
WriteAttribute("class", Tuple.Create(" class=\"", 31136), Tuple.Create("\"", 31272)
|
|
|
|
#line 503 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 31144), Tuple.Create<System.Object, System.Int32>(Model.Device.DeviceBatch.InsuredUntil.HasValue && Model.Device.DeviceBatch.InsuredUntil.Value < DateTime.Now ? "alert" : null
|
|
|
|
#line default
|
|
#line hidden
|
|
, 31144), false)
|
|
);
|
|
|
|
WriteLiteral(">\r\n");
|
|
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 504 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(CommonHelpers.FriendlyDate(Model.Device.DeviceBatch.InsuredUntil, "Unknown", null));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n </td>\r\n </tr>\r\n " +
|
|
" </table>\r\n");
|
|
|
|
|
|
#line 508 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <h2>Batch: <em>Not Associated</em></h2>\r\n");
|
|
|
|
|
|
#line 512 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 513 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Model.Device.CanUpdateDeviceBatch())
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 515 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Html.ActionLinkSmallButton("Update Batch", MVC.API.Device.UpdateDeviceBatchId(Model.Device.SerialNumber, null, true), "Device_Show_Policies_Batch_Actions_Update_Button"));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 515 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Policies_Batch_Actions_Update_Dialog\"");
|
|
|
|
WriteLiteral(" class=\"dialog\"");
|
|
|
|
WriteLiteral(" title=\"Assign to Device Batch\"");
|
|
|
|
WriteLiteral(">\r\n <div>\r\n <ul");
|
|
|
|
WriteLiteral(" class=\"none\"");
|
|
|
|
WriteLiteral(">\r\n");
|
|
|
|
|
|
#line 520 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 520 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
foreach (var db in Model.DeviceBatches.OrderBy(i => i.Name))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <li>\r\n " +
|
|
" <input");
|
|
|
|
WriteLiteral(" type=\"radio\"");
|
|
|
|
WriteLiteral(" data-devicebatchid=\"");
|
|
|
|
|
|
#line 523 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(db.Id);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\"");
|
|
|
|
WriteLiteral(" name=\"DeviceBatch\"");
|
|
|
|
WriteAttribute("id", Tuple.Create(" id=\"", 32460), Tuple.Create("\"", 32485)
|
|
, Tuple.Create(Tuple.Create("", 32465), Tuple.Create("DeviceBatch_", 32465), true)
|
|
|
|
#line 523 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 32477), Tuple.Create<System.Object, System.Int32>(db.Id
|
|
|
|
#line default
|
|
#line hidden
|
|
, 32477), false)
|
|
);
|
|
|
|
WriteLiteral(" /><label");
|
|
|
|
WriteAttribute("for", Tuple.Create(" for=\"", 32495), Tuple.Create("\"", 32521)
|
|
, Tuple.Create(Tuple.Create("", 32501), Tuple.Create("DeviceBatch_", 32501), true)
|
|
|
|
#line 523 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 32513), Tuple.Create<System.Object, System.Int32>(db.Id
|
|
|
|
#line default
|
|
#line hidden
|
|
, 32513), false)
|
|
);
|
|
|
|
WriteAttribute("title", Tuple.Create(" title=\"", 32522), Tuple.Create("\"", 32578)
|
|
, Tuple.Create(Tuple.Create("", 32530), Tuple.Create("Purchased:", 32530), true)
|
|
|
|
#line 523 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
, Tuple.Create(Tuple.Create(" ", 32540), Tuple.Create<System.Object, System.Int32>(db.PurchaseDate.ToLongDateString()
|
|
|
|
#line default
|
|
#line hidden
|
|
, 32541), false)
|
|
);
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 523 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(db.Name);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</label>\r\n </li>\r\n");
|
|
|
|
|
|
#line 525 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </ul>\r\n </div>\r\n " +
|
|
" </div>\r\n");
|
|
|
|
WriteLiteral(" <script>\r\n $(function () {\r\n " +
|
|
" var currentBatch = \'");
|
|
|
|
|
|
#line 531 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Model.Device.DeviceBatchId);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\';\r\n var button = $(\'#Device_Show_Policies_Batch_A" +
|
|
"ctions_Update_Button\');\r\n var buttonDialog = null" +
|
|
";\r\n var dialogInputs = null;\r\n " +
|
|
" var dialogContainers = null;\r\n\r\n but" +
|
|
"ton.click(function () {\r\n\r\n if (!buttonDialog" +
|
|
") {\r\n buttonDialog = $(\'#Device_Show_Poli" +
|
|
"cies_Batch_Actions_Update_Dialog\')\r\n " +
|
|
" .dialog({\r\n " +
|
|
" resizable: false,\r\n " +
|
|
" modal: true,\r\n " +
|
|
" maxHeight: 450,\r\n " +
|
|
" autoOpen: false,\r\n " +
|
|
" buttons: {\r\n " +
|
|
" \"Update Batch\": function () {\r\n " +
|
|
" var deviceBatchId = dialogInputs.filter(\':" +
|
|
"checked\').attr(\'data-devicebatchid\');\r\n\r\n " +
|
|
" if (deviceBatchId) {\r\n " +
|
|
" var $this = $(this);\r\n " +
|
|
" $this.dialo" +
|
|
"g(\"disable\");\r\n " +
|
|
" $this.dialog(\"option\", \"buttons\", null);\r\n " +
|
|
" window.location.href = button.a" +
|
|
"ttr(\'href\') + \'&DeviceBatchId=\' + deviceBatchId;\r\n " +
|
|
" } else {\r\n " +
|
|
" alert(\'A device batch must be se" +
|
|
"lected\');\r\n " +
|
|
" }\r\n },\r\n " +
|
|
" Cancel: functi" +
|
|
"on () {\r\n " +
|
|
" $(this).dialog(\"close\");\r\n " +
|
|
" }\r\n " +
|
|
" }\r\n });\r\n " +
|
|
" dialogInputs = buttonDialog.find(\'input\');\r\n " +
|
|
" dialogContainers = dialogInputs.closest(\'li\');" +
|
|
"\r\n\r\n dialogInputs.change(function () {\r\n " +
|
|
" dialogContainers.removeClass(\'selecte" +
|
|
"d\');\r\n $(this).closest(\'li\').addClass" +
|
|
"(\'selected\');\r\n });\r\n " +
|
|
" }\r\n\r\n if (!!currentBatch) {\r\n" +
|
|
" dialogInputs.filter(\'[data-devicebatchid" +
|
|
"=\' + currentBatch + \']\').prop(\'checked\', true).change();\r\n " +
|
|
" }\r\n\r\n buttonDialog.dialog(\'open" +
|
|
"\');\r\n return false;\r\n " +
|
|
" });\r\n\r\n });\r\n </script" +
|
|
">\r\n");
|
|
|
|
|
|
#line 583 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </div>\r\n </div>\r\n </td>\r\n <td");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Aspects\"");
|
|
|
|
WriteLiteral(" rowspan=\"2\"");
|
|
|
|
WriteLiteral(">\r\n <div>\r\n <div");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Aspects_Model\"");
|
|
|
|
WriteLiteral(" class=\"clearfix\"");
|
|
|
|
WriteLiteral(">\r\n <h2");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Aspects_Model_Description\"");
|
|
|
|
WriteLiteral(" title=\"Model Description\"");
|
|
|
|
WriteLiteral(">\r\n");
|
|
|
|
|
|
#line 591 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 591 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Authorization.Has(Claims.Config.DeviceModel.Show))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 593 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Html.ActionLink(Model.Device.DeviceModel.ToString(), MVC.Config.DeviceModel.Index(Model.Device.DeviceModelId)));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 593 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 597 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Model.Device.DeviceModel.ToString());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 597 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </h2>\r\n <img");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Aspects_Model_Image\"");
|
|
|
|
WriteLiteral(" alt=\"Model Image\"");
|
|
|
|
WriteAttribute("src", Tuple.Create(" src=\"", 37313), Tuple.Create("\"", 37423)
|
|
|
|
#line 600 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 37319), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DeviceModel.Image(Model.Device.DeviceModelId, Model.Device.DeviceModel.ImageHash()))
|
|
|
|
#line default
|
|
#line hidden
|
|
, 37319), false)
|
|
);
|
|
|
|
WriteLiteral(" />\r\n </div>\r\n </div>\r\n </td>\r\n </tr>\r\n <t" +
|
|
"r");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Subjects_Actions\"");
|
|
|
|
WriteLiteral(">\r\n <td");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Device_Actions\"");
|
|
|
|
WriteLiteral(">\r\n");
|
|
|
|
|
|
#line 607 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 607 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Model.Device.CanCreateJob())
|
|
{
|
|
Html.BundleDeferred("~/ClientScripts/Modules/Disco-CreateJob");
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 610 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Html.ActionLinkSmallButton("Create Job", MVC.Job.Create(Model.Device.SerialNumber, Model.Device.AssignedUserId), "buttonCreateJob"));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 610 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 612 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Model.Device.CanUpdateAssignment())
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <a");
|
|
|
|
WriteLiteral(" id=\"Device_Show_User_Actions_Assign_Button\"");
|
|
|
|
WriteLiteral(" href=\"#\"");
|
|
|
|
WriteLiteral(" class=\"button small\"");
|
|
|
|
WriteLiteral(">Update Assignment</a>\r\n");
|
|
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" id=\"Device_Show_User_Actions_Assign_Dialog\"");
|
|
|
|
WriteLiteral(" class=\"dialog\"");
|
|
|
|
WriteLiteral(" title=\"Assign this Device?\"");
|
|
|
|
WriteLiteral(">\r\n <h4><i");
|
|
|
|
WriteLiteral(" class=\"fa fa-info-circle information\"");
|
|
|
|
WriteLiteral("></i> Assign to User:</h4>\r\n <br />\r\n");
|
|
|
|
|
|
#line 618 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 618 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
using (Html.BeginForm(MVC.API.Device.UpdateAssignedUserId(Model.Device.SerialNumber, redirect: true)))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <input");
|
|
|
|
WriteLiteral(" id=\"Device_Show_User_Actions_Assign_UserId\"");
|
|
|
|
WriteLiteral(" name=\"AssignedUserId\"");
|
|
|
|
WriteLiteral(" type=\"text\"");
|
|
|
|
WriteLiteral(" />\r\n");
|
|
|
|
|
|
#line 621 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </div>\r\n");
|
|
|
|
WriteLiteral(" <script");
|
|
|
|
WriteLiteral(" type=\"text/javascript\"");
|
|
|
|
WriteLiteral(@">
|
|
$(function () {
|
|
var button = $('#Device_Show_User_Actions_Assign_Button');
|
|
var buttonDialog = null;
|
|
var inputUserId = null;
|
|
|
|
var dialogButtons = {
|
|
");
|
|
|
|
|
|
#line 630 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 630 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
if (assignedUser != null)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" ");
|
|
|
|
WriteLiteral(@"
|
|
""Unassign"": function () {
|
|
var $this = $(this);
|
|
$this.dialog(""disable"");
|
|
$this.dialog(""option"", ""buttons"", null);
|
|
|
|
inputUserId.val('');
|
|
inputUserId.closest('form').submit()
|
|
},
|
|
");
|
|
|
|
WriteLiteral("\r\n");
|
|
|
|
|
|
#line 643 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n \"Assign\": function () {\r\n " +
|
|
" var $this = $(this);\r\n var userId = inputUs" +
|
|
"erId.val();\r\n if (userId) {\r\n " +
|
|
" $this.dialog(\"disable\");\r\n $t" +
|
|
"his.dialog(\"option\", \"buttons\", null);\r\n inpu" +
|
|
"tUserId.closest(\'form\').submit()\r\n } else {\r\n " +
|
|
" alert(\'Enter a user to assign this device\');\r\n " +
|
|
" }\r\n },\r\n " +
|
|
" Cancel: function () {\r\n $(this).dial" +
|
|
"og(\"close\");\r\n }\r\n }\r\n\r\n " +
|
|
" button.click(function () {\r\n if (!b" +
|
|
"uttonDialog) {\r\n buttonDialog = $(\'#Device_Show_U" +
|
|
"ser_Actions_Assign_Dialog\')\r\n " +
|
|
" .dialog({\r\n resizable: f" +
|
|
"alse,\r\n height: 180,\r\n " +
|
|
" modal: true,\r\n " +
|
|
" autoOpen: false,\r\n " +
|
|
" buttons: dialogButtons\r\n " +
|
|
" });\r\n inputUserI" +
|
|
"d = $(\'#Device_Show_User_Actions_Assign_UserId\');\r\n " +
|
|
" inputUserId.focus(function () { inputUserId.select() })\r\n " +
|
|
" .autocomplete({\r\n source:" +
|
|
" \'");
|
|
|
|
|
|
#line 674 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Url.Action(MVC.API.Search.UsersUpstream()));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(@"',
|
|
minLength: 2,
|
|
select: function (e, ui) {
|
|
inputUserId.val(ui.item.Id);
|
|
return false;
|
|
}
|
|
});
|
|
inputUserId.data('ui-autocomplete')._renderItem = function (ul, item) {
|
|
return $(""<li>"")
|
|
.data(""item.autocomplete"", item)
|
|
.append(""<a><strong>"" + item.DisplayName + ""</strong><br>"" + item.Id + "" ("" + item.Type + "")</a>"")
|
|
.appendTo(ul);
|
|
};
|
|
}
|
|
buttonDialog.dialog('open');
|
|
inputUserId.focus();
|
|
return false;
|
|
});
|
|
|
|
});
|
|
</script>
|
|
");
|
|
|
|
|
|
#line 695 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 696 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Model.Device.CanUpdateTrustEnrol())
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 698 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Html.ActionLinkSmallButton("Trust Enrol", MVC.API.Device.UpdateAllowUnauthenticatedEnrol(Model.Device.SerialNumber, true.ToString(), true), "Device_Show_Device_Actions_TrustEnrol_Button"));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 698 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Device_Actions_TrustEnrol_Dialog\"");
|
|
|
|
WriteLiteral(" class=\"dialog\"");
|
|
|
|
WriteLiteral(" title=\"Trust this Device?\"");
|
|
|
|
WriteLiteral(@">
|
|
<p>
|
|
Devices flagged as 'trusted' are allowed a single-use device enrolment without providing authentication (for example: Active Directory Computer Account).
|
|
</p>
|
|
<p>
|
|
Once a device enrols, its trust setting is reset and additional enrolments need to be authenticated (domain joined) or manually trusted again.
|
|
</p>
|
|
<div");
|
|
|
|
WriteLiteral(" class=\"info-box\"");
|
|
|
|
WriteLiteral(" style=\"margin-top: 1em;\"");
|
|
|
|
WriteLiteral(">\r\n <p");
|
|
|
|
WriteLiteral(" class=\"fa-p\"");
|
|
|
|
WriteLiteral(" style=\"margin-bottom: 1em;\"");
|
|
|
|
WriteLiteral(">\r\n <i");
|
|
|
|
WriteLiteral(" class=\"fa fa-exclamation-triangle\"");
|
|
|
|
WriteLiteral("></i>This action will allow a device <em>claiming</em> to have the Serial Number " +
|
|
"\'");
|
|
|
|
|
|
#line 708 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Model.Device.SerialNumber);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(@"' to be enrolled without authentication.
|
|
</p>
|
|
<div>
|
|
<strong>Are you sure you want to allow an unauthenticated enrolment?</strong>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
");
|
|
|
|
WriteLiteral(" <script");
|
|
|
|
WriteLiteral(" type=\"text/javascript\"");
|
|
|
|
WriteLiteral(">\r\n $(function () {\r\n var button = $(\'#" +
|
|
"Device_Show_Device_Actions_TrustEnrol_Button\');\r\n var but" +
|
|
"tonDialog;\r\n button.click(function () {\r\n " +
|
|
" if (!buttonDialog) {\r\n var buttonLink" +
|
|
" = button.attr(\'href\');\r\n button.attr(\'href\', \'#\'" +
|
|
");\r\n buttonDialog = $(\'#Device_Show_Device_Action" +
|
|
"s_TrustEnrol_Dialog\').dialog({\r\n resizable: f" +
|
|
"alse,\r\n width: 400,\r\n " +
|
|
" modal: true,\r\n autoOpen: false,\r\n" +
|
|
" buttons: {\r\n " +
|
|
" \"Trust\": function () {\r\n var " +
|
|
"$this = $(this);\r\n $this.dialog(\"disa" +
|
|
"ble\");\r\n $this.dialog(\"option\", \"butt" +
|
|
"ons\", null);\r\n window.location.href =" +
|
|
" buttonLink;\r\n },\r\n " +
|
|
" Cancel: function () {\r\n " +
|
|
" $(this).dialog(\"close\");\r\n }\r\n " +
|
|
" }\r\n });\r\n " +
|
|
" }\r\n\r\n buttonDialog.dialog(\'open\');\r" +
|
|
"\n\r\n return false;\r\n });\r\n " +
|
|
" });\r\n </script>\r\n");
|
|
|
|
|
|
#line 748 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 749 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Model.Device.CanUpdateUntrustEnrol())
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 751 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Html.ActionLinkSmallButton("Untrust Enrol", MVC.API.Device.UpdateAllowUnauthenticatedEnrol(Model.Device.SerialNumber, false.ToString(), true), "Device_Show_Device_Actions_UntrustEnrol_Button"));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 751 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Device_Actions_UntrustEnrol_Dialog\"");
|
|
|
|
WriteLiteral(" title=\"Untrust this Device?\"");
|
|
|
|
WriteLiteral(">\r\n <div");
|
|
|
|
WriteLiteral(" class=\"info-box\"");
|
|
|
|
WriteLiteral(">\r\n <p");
|
|
|
|
WriteLiteral(" class=\"fa-p\"");
|
|
|
|
WriteLiteral(" style=\"margin-bottom: 1em;\"");
|
|
|
|
WriteLiteral(">\r\n <i");
|
|
|
|
WriteLiteral(" class=\"fa fa-info-circle\"");
|
|
|
|
WriteLiteral(@"></i>This action will require the device to enrol with authentication (for example: domain joined).
|
|
</p>
|
|
<div>
|
|
<strong>Are you sure you want to require an authenticated enrolment?</strong>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
");
|
|
|
|
WriteLiteral(" <script");
|
|
|
|
WriteLiteral(" type=\"text/javascript\"");
|
|
|
|
WriteLiteral(@">
|
|
$(function () {
|
|
var button = $('#Device_Show_Device_Actions_UntrustEnrol_Button');
|
|
var buttonDialog = $('#Device_Show_Device_Actions_UntrustEnrol_Dialog');
|
|
var buttonLink = button.attr('href');
|
|
button.attr('href', '#');
|
|
button.click(function () {
|
|
buttonDialog.dialog('open');
|
|
return false;
|
|
});
|
|
buttonDialog.dialog({
|
|
resizable: false,
|
|
width: 400,
|
|
modal: true,
|
|
autoOpen: false,
|
|
buttons: {
|
|
""Untrust"": function () {
|
|
var $this = $(this);
|
|
$this.dialog(""disable"");
|
|
$this.dialog(""option"", ""buttons"", null);
|
|
window.location.href = buttonLink;
|
|
},
|
|
Cancel: function () {
|
|
$(this).dialog(""close"");
|
|
}
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
");
|
|
|
|
|
|
#line 791 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 792 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Model.Device.CanDecommission())
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 794 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Html.ActionLinkSmallButton("Decommission", MVC.API.Device.Decommission(), "Device_Show_Device_Actions_Decommission_Button"));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 794 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Device_Actions_Decommission_Dialog\"");
|
|
|
|
WriteLiteral(" class=\"dialog\"");
|
|
|
|
WriteLiteral(" title=\"Device Decommissioning\"");
|
|
|
|
WriteLiteral(">\r\n <div");
|
|
|
|
WriteLiteral(" class=\"clearfix\"");
|
|
|
|
WriteLiteral(" style=\"margin-bottom: 10px;\"");
|
|
|
|
WriteLiteral(">\r\n <i");
|
|
|
|
WriteLiteral(" class=\"fa fa-question-circle fa-lg information\"");
|
|
|
|
WriteLiteral("></i> Why is this device to be decommissioned?\r\n </div>\r\n" +
|
|
" <div>\r\n <ul");
|
|
|
|
WriteLiteral(" class=\"none\"");
|
|
|
|
WriteLiteral(">\r\n");
|
|
|
|
|
|
#line 801 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 801 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
foreach (DecommissionReasons decommissionReason in Enum.GetValues(typeof(DecommissionReasons)).Cast<DecommissionReasons>().OrderBy(r => r.ToString()))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <li>\r\n <input");
|
|
|
|
WriteLiteral(" type=\"radio\"");
|
|
|
|
WriteAttribute("id", Tuple.Create(" id=\"", 48980), Tuple.Create("\"", 49058)
|
|
, Tuple.Create(Tuple.Create("", 48985), Tuple.Create("Device_Show_Device_Actions_Decommission_Reason_", 48985), true)
|
|
|
|
#line 804 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 49032), Tuple.Create<System.Object, System.Int32>((int)decommissionReason
|
|
|
|
#line default
|
|
#line hidden
|
|
, 49032), false)
|
|
);
|
|
|
|
WriteLiteral("\r\n name=\"Device_Show_Device_Actions_Dec" +
|
|
"ommission_Reason\"");
|
|
|
|
WriteAttribute("value", Tuple.Create(" value=\"", 49157), Tuple.Create("\"", 49191)
|
|
|
|
#line 805 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 49165), Tuple.Create<System.Object, System.Int32>((int)decommissionReason
|
|
|
|
#line default
|
|
#line hidden
|
|
, 49165), false)
|
|
);
|
|
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 805 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write((decommissionReason == DecommissionReasons.EndOfLife) ? "checked=\"checked\"" : string.Empty);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" />\r\n <label");
|
|
|
|
WriteAttribute("for", Tuple.Create(" for=\"", 49335), Tuple.Create("\"", 49414)
|
|
, Tuple.Create(Tuple.Create("", 49341), Tuple.Create("Device_Show_Device_Actions_Decommission_Reason_", 49341), true)
|
|
|
|
#line 806 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 49388), Tuple.Create<System.Object, System.Int32>((int)decommissionReason
|
|
|
|
#line default
|
|
#line hidden
|
|
, 49388), false)
|
|
);
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 806 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(decommissionReason.ReasonMessage());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</label>\r\n </li>\r\n");
|
|
|
|
|
|
#line 808 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </ul>\r\n </div>\r\n </div>" +
|
|
"\r\n");
|
|
|
|
WriteLiteral(" <script");
|
|
|
|
WriteLiteral(" type=\"text/javascript\"");
|
|
|
|
WriteLiteral(">\r\n $(function () {\r\n var button = $(\'#" +
|
|
"Device_Show_Device_Actions_Decommission_Button\');\r\n var b" +
|
|
"uttonDialog = null;\r\n var deviceSerialNumber = \'");
|
|
|
|
|
|
#line 816 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Model.Device.SerialNumber);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\';\r\n\r\n button.click(function () {\r\n\r\n " +
|
|
" if (!buttonDialog) {\r\n buttonDialog = $(\'#" +
|
|
"Device_Show_Device_Actions_Decommission_Dialog\')\r\n " +
|
|
" .dialog({\r\n " +
|
|
" resizable: false,\r\n " +
|
|
" modal: true,\r\n autoOp" +
|
|
"en: false,\r\n buttons: {\r\n" +
|
|
" \"Decommission\": func" +
|
|
"tion () {\r\n\r\n var" +
|
|
" reasonId = buttonDialog.find(\'input:checked\').val();\r\n\r\n " +
|
|
" var $this = $(this);\r\n " +
|
|
" $this.dialog(\"disable\");\r\n " +
|
|
" $this.dialog(\"option\", " +
|
|
"\"buttons\", null);\r\n\r\n " +
|
|
" var url = button.attr(\'href\') + \'/\' + deviceSerialNumber + \'?Reason=\' + rea" +
|
|
"sonId + \'&redirect=True\';\r\n\r\n " +
|
|
" window.location.href = url;\r\n " +
|
|
" },\r\n " +
|
|
" Cancel: function () {\r\n " +
|
|
" $(this).dialog(\"close\");\r\n " +
|
|
" }\r\n }\r" +
|
|
"\n });\r\n " +
|
|
" }\r\n\r\n buttonDialog.dialog(\'open\');\r\n " +
|
|
" return false;\r\n });\r\n\r\n " +
|
|
" });\r\n </script>\r\n");
|
|
|
|
|
|
#line 852 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 853 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Model.Device.CanRecommission())
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 855 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Html.ActionLinkSmallButton("Recommission", MVC.API.Device.Recommission(Model.Device.SerialNumber, true), "Device_Show_Device_Actions_Recommission_Button"));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 855 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Device_Actions_Recommission_Dialog\"");
|
|
|
|
WriteLiteral(" title=\"Recommission this Device?\"");
|
|
|
|
WriteLiteral(">\r\n <p>\r\n <i");
|
|
|
|
WriteLiteral(" class=\"fa fa-exclamation-triangle fa-lg\"");
|
|
|
|
WriteLiteral("></i> Are you sure?\r\n </p>\r\n </div>\r\n");
|
|
|
|
WriteLiteral(" <script");
|
|
|
|
WriteLiteral(" type=\"text/javascript\"");
|
|
|
|
WriteLiteral(@">
|
|
$(function () {
|
|
var button = $('#Device_Show_Device_Actions_Recommission_Button');
|
|
var buttonDialog = $('#Device_Show_Device_Actions_Recommission_Dialog');
|
|
var buttonLink = button.attr('href');
|
|
button.attr('href', '#');
|
|
button.click(function () {
|
|
buttonDialog.dialog('open');
|
|
return false;
|
|
});
|
|
buttonDialog.dialog({
|
|
resizable: false,
|
|
height: 140,
|
|
modal: true,
|
|
autoOpen: false,
|
|
buttons: {
|
|
""Recommission"": function () {
|
|
var $this = $(this);
|
|
$this.dialog(""disable"");
|
|
$this.dialog(""option"", ""buttons"", null);
|
|
window.location.href = buttonLink;
|
|
},
|
|
Cancel: function () {
|
|
$(this).dialog(""close"");
|
|
}
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
");
|
|
|
|
|
|
#line 890 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 891 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Model.Device.CanDelete())
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 893 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Html.ActionLinkSmallButton("Delete Device", MVC.API.Device.Delete(Model.Device.SerialNumber, true), "Device_Show_Device_Actions_Delete_Button"));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 893 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Device_Actions_Delete_Dialog\"");
|
|
|
|
WriteLiteral(" title=\"Delete this Device?\"");
|
|
|
|
WriteLiteral(">\r\n <p>\r\n <i");
|
|
|
|
WriteLiteral(" class=\"fa fa-exclamation-triangle fa-lg\"");
|
|
|
|
WriteLiteral(@"></i>
|
|
This item will be permanently deleted and cannot be recovered.<br />
|
|
Jobs linked to this Device (but not to a User) will be deleted also.<br />
|
|
Are you sure?
|
|
</p>
|
|
</div>
|
|
");
|
|
|
|
WriteLiteral(" <script");
|
|
|
|
WriteLiteral(" type=\"text/javascript\"");
|
|
|
|
WriteLiteral(@">
|
|
$(function () {
|
|
var button = $('#Device_Show_Device_Actions_Delete_Button');
|
|
var buttonDialog = $('#Device_Show_Device_Actions_Delete_Dialog');
|
|
var buttonLink = button.attr('href');
|
|
button.attr('href', '#');
|
|
button.click(function () {
|
|
buttonDialog.dialog('open');
|
|
return false;
|
|
});
|
|
buttonDialog.dialog({
|
|
resizable: false,
|
|
height: 200,
|
|
modal: true,
|
|
autoOpen: false,
|
|
buttons: {
|
|
""Delete"": function () {
|
|
var $this = $(this);
|
|
$this.dialog(""disable"");
|
|
$this.dialog(""option"", ""buttons"", null);
|
|
window.location.href = buttonLink;
|
|
},
|
|
Cancel: function () {
|
|
$(this).dialog(""close"");
|
|
}
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
");
|
|
|
|
|
|
#line 931 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </td>\r\n </tr>\r\n</table>\r\n");
|
|
|
|
}
|
|
}
|
|
}
|
|
#pragma warning restore 1591
|