319 lines
9.0 KiB
C#
319 lines
9.0 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;
|
|
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/_Certificates.cshtml")]
|
|
public partial class _Certificates : Disco.Services.Web.WebViewPage<Disco.Web.Models.Device.ShowModel>
|
|
{
|
|
public _Certificates()
|
|
{
|
|
}
|
|
public override void Execute()
|
|
{
|
|
|
|
#line 2 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
|
|
|
|
Authorization.Require(Claims.Device.ShowCertificates);
|
|
var hasDownloadCert = Authorization.Has(Claims.Config.DeviceCertificate.DownloadCertificates);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n<div");
|
|
|
|
WriteLiteral(" id=\"DeviceDetailTab-Certificates\"");
|
|
|
|
WriteLiteral(" class=\"DevicePart\"");
|
|
|
|
WriteLiteral(">\r\n <div");
|
|
|
|
WriteLiteral(" class=\"genericData certificateTable\"");
|
|
|
|
WriteLiteral(">\r\n");
|
|
|
|
|
|
#line 8 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 8 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
|
|
if (Model.Certificates.Count() > 0)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <table");
|
|
|
|
WriteLiteral(" class=\"genericData certificateTable\"");
|
|
|
|
WriteLiteral(@">
|
|
<tr>
|
|
<th>
|
|
Name
|
|
</th>
|
|
<th>
|
|
Enabled
|
|
</th>
|
|
<th>
|
|
Allocated
|
|
</th>
|
|
<th>
|
|
Expires
|
|
</th>
|
|
</tr>
|
|
");
|
|
|
|
|
|
#line 25 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 25 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
|
|
foreach (var item in Model.Certificates)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <tr>\r\n <td>\r\n");
|
|
|
|
|
|
#line 29 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 29 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
|
|
if (hasDownloadCert)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <a");
|
|
|
|
WriteLiteral(" href=\"#\"");
|
|
|
|
WriteLiteral(" class=\"certificateDownload\"");
|
|
|
|
WriteLiteral(" data-id=\"");
|
|
|
|
|
|
#line 31 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
|
|
Write(item.Id);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\"");
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 31 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
|
|
Write(item.Name);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</a>\r\n");
|
|
|
|
|
|
#line 32 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 35 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
|
|
Write(item.Name);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 35 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
|
|
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </td>\r\n <td>\r\n");
|
|
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 39 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
|
|
Write(item.Enabled);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n </td>\r\n <td>\r\n");
|
|
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 42 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
|
|
Write(CommonHelpers.FriendlyDate(item.AllocatedDate));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n </td>\r\n <td>\r\n");
|
|
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 45 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
|
|
Write(CommonHelpers.FriendlyDate(item.ExpirationDate));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
|
|
|
|
|
|
#line 48 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </table>\r\n");
|
|
|
|
|
|
#line 50 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
|
|
if (hasDownloadCert)
|
|
{
|
|
using (Html.BeginForm(MVC.API.DeviceCertificate.Download()))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 54 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
|
|
Write(Html.AntiForgeryToken());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 54 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <input");
|
|
|
|
WriteLiteral(" type=\"hidden\"");
|
|
|
|
WriteLiteral(" name=\"id\"");
|
|
|
|
WriteLiteral(" />\r\n");
|
|
|
|
|
|
#line 56 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(@" <script>
|
|
$(function () {
|
|
$('#DeviceDetailTab-Certificates').on('click', '.certificateDownload', function (e) {
|
|
e.preventDefault();
|
|
const form = $('#DeviceDetailTab-Certificates').find('form');
|
|
form.find('input[name=""id""]').val($(this).attr('data-id'));
|
|
form.trigger('submit');
|
|
return false;
|
|
})
|
|
})
|
|
</script>
|
|
");
|
|
|
|
|
|
#line 68 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
|
|
}
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <span");
|
|
|
|
WriteLiteral(" class=\"smallMessage\"");
|
|
|
|
WriteLiteral(">No Certificates Allocated</span>\r\n");
|
|
|
|
|
|
#line 73 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </div>\r\n <script>\r\n $(\'#DeviceDetailTabItems\').append(\'<li><a href=" +
|
|
"\"#DeviceDetailTab-Certificates\">Certificates [");
|
|
|
|
|
|
#line 76 "..\..\Views\Device\DeviceParts\_Certificates.cshtml"
|
|
Write(Model.Certificates.Count);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("]</a></li>\');\r\n </script>\r\n</div>\r\n");
|
|
|
|
}
|
|
}
|
|
}
|
|
#pragma warning restore 1591
|