686 lines
21 KiB
C#
686 lines
21 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
|
|
{
|
|
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\_DeviceTable.cshtml"
|
|
using Disco.Services.Devices.DeviceFlags;
|
|
|
|
#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/_DeviceTable.cshtml")]
|
|
public partial class _DeviceTable : Disco.Services.Web.WebViewPage<IEnumerable<Disco.Models.Services.Searching.DeviceSearchResultItem>>
|
|
{
|
|
public _DeviceTable()
|
|
{
|
|
}
|
|
public override void Execute()
|
|
{
|
|
|
|
#line 3 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
|
|
var canShowDevices = Authorization.Has(Claims.Device.Show);
|
|
var canShowUsers = Authorization.Has(Claims.User.Show);
|
|
|
|
Html.BundleDeferred("~/ClientScripts/Modules/Disco-DataTableHelpers");
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n<div");
|
|
|
|
WriteLiteral(" class=\"genericData deviceTable\"");
|
|
|
|
WriteLiteral(">\r\n");
|
|
|
|
|
|
#line 10 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 10 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
if (Model != null && Model.Count() > 0)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <table");
|
|
|
|
WriteLiteral(" class=\"genericData deviceTable\"");
|
|
|
|
WriteLiteral(">\r\n <thead>\r\n <tr>\r\n <th>Serial</th>" +
|
|
"\r\n <th>Asset</th>\r\n <th");
|
|
|
|
WriteLiteral(" class=\"date\"");
|
|
|
|
WriteLiteral(@">Decommissioned</th>
|
|
<th>Name</th>
|
|
<th>Model</th>
|
|
<th>Profile</th>
|
|
<th>Batch</th>
|
|
<th>Assigned User</th>
|
|
<th>Jobs</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
");
|
|
|
|
|
|
#line 27 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 27 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
foreach (var item in Model)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <tr");
|
|
|
|
WriteAttribute("class", Tuple.Create(" class=\"", 1024), Tuple.Create("\"", 1101)
|
|
|
|
#line 29 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 1032), Tuple.Create<System.Object, System.Int32>(item.DecommissionedDate.HasValue ? "decommissioned" : string.Empty
|
|
|
|
#line default
|
|
#line hidden
|
|
, 1032), false)
|
|
);
|
|
|
|
WriteLiteral(">\r\n <td>\r\n");
|
|
|
|
|
|
#line 31 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 31 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
if (canShowDevices)
|
|
{
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 32 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
Write(Html.ActionLink(item.Id, MVC.Device.Show(item.Id)));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 32 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
}
|
|
else
|
|
{
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 34 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
Write(item.Id);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 34 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 35 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
if (item.DeviceFlagAssignments.CanShowAny())
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" class=\"flags\"");
|
|
|
|
WriteLiteral(">\r\n");
|
|
|
|
|
|
#line 38 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 38 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
foreach (var flag in item.DeviceFlagAssignments.Where(f => !f.RemovedDate.HasValue).Select(f => Tuple.Create(f, DeviceFlagService.GetDeviceFlag(f.DeviceFlagId))))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 40 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
if (flag.Item2.permission.CanShow())
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <i");
|
|
|
|
WriteAttribute("class", Tuple.Create(" class=\"", 1901), Tuple.Create("\"", 1981)
|
|
, Tuple.Create(Tuple.Create("", 1909), Tuple.Create("flag", 1909), true)
|
|
, Tuple.Create(Tuple.Create(" ", 1913), Tuple.Create("fa", 1914), true)
|
|
, Tuple.Create(Tuple.Create(" ", 1916), Tuple.Create("fa-", 1917), true)
|
|
|
|
#line 42 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 1920), Tuple.Create<System.Object, System.Int32>(flag.Item2.flag.Icon
|
|
|
|
#line default
|
|
#line hidden
|
|
, 1920), false)
|
|
, Tuple.Create(Tuple.Create(" ", 1943), Tuple.Create("fa-fw", 1944), true)
|
|
, Tuple.Create(Tuple.Create(" ", 1949), Tuple.Create("d-", 1950), true)
|
|
|
|
#line 42 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 1952), Tuple.Create<System.Object, System.Int32>(flag.Item2.flag.IconColour
|
|
|
|
#line default
|
|
#line hidden
|
|
, 1952), false)
|
|
);
|
|
|
|
WriteLiteral(">\r\n <span");
|
|
|
|
WriteLiteral(" class=\"details\"");
|
|
|
|
WriteLiteral(">\r\n <span");
|
|
|
|
WriteLiteral(" class=\"name\"");
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 44 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
Write(flag.Item2.flag.Name);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</span>\r\n");
|
|
|
|
|
|
#line 45 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 45 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
if (flag.Item1.Comments != null) {
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("<span");
|
|
|
|
WriteLiteral(" class=\"comments\"");
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 45 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
Write(flag.Item1.Comments.ToHtmlComment());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</span>");
|
|
|
|
|
|
#line 45 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
}
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n <span");
|
|
|
|
WriteLiteral(" class=\"added\"");
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 46 "..\..\Views\Device\_DeviceTable.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 49 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
}
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 49 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </div>\r\n");
|
|
|
|
|
|
#line 52 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </td>\r\n <td>\r\n");
|
|
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 55 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
Write(item.AssetNumber);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n </td>\r\n <td>\r\n");
|
|
|
|
|
|
#line 58 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 58 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
if (item.DecommissionedDate.HasValue)
|
|
{
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 59 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
Write(CommonHelpers.FriendlyDate(item.DecommissionedDate.Value));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 59 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </td>\r\n <td>\r\n");
|
|
|
|
|
|
#line 62 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 62 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
if (string.IsNullOrWhiteSpace(item.ComputerName))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <span");
|
|
|
|
WriteLiteral(" class=\"smallMessage\"");
|
|
|
|
WriteLiteral(">Unknown</span>\r\n");
|
|
|
|
|
|
#line 65 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 68 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
Write(item.ComputerName);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 68 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </td>\r\n <td>\r\n");
|
|
|
|
|
|
#line 72 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 72 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
if (item.DeviceModelDescription != null)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <span>");
|
|
|
|
|
|
#line 74 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
Write(item.DeviceModelDescription);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</span>\r\n");
|
|
|
|
|
|
#line 75 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <span");
|
|
|
|
WriteLiteral(" class=\"smallMessage\"");
|
|
|
|
WriteLiteral(">Unknown</span>\r\n");
|
|
|
|
|
|
#line 79 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </td>\r\n <td>\r\n");
|
|
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 82 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
Write(item.DeviceProfileName);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n </td>\r\n <td>\r\n");
|
|
|
|
|
|
#line 85 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 85 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
if (item.DeviceBatchName != null)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <span>");
|
|
|
|
|
|
#line 87 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
Write(item.DeviceBatchName);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</span>\r\n");
|
|
|
|
|
|
#line 88 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <span");
|
|
|
|
WriteLiteral(" class=\"smallMessage\"");
|
|
|
|
WriteLiteral(">N/A</span>\r\n");
|
|
|
|
|
|
#line 92 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </td>\r\n <td>\r\n");
|
|
|
|
|
|
#line 95 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 95 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
if (string.IsNullOrEmpty(item.AssignedUserId))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <span");
|
|
|
|
WriteLiteral(" class=\"smallMessage\"");
|
|
|
|
WriteLiteral(">N/A</span>\r\n");
|
|
|
|
|
|
#line 98 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <span>\r\n");
|
|
|
|
|
|
#line 102 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 102 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
if (canShowUsers)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 104 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
Write(Html.ActionLink(item.AssignedUserDescription, MVC.User.Show(item.AssignedUserId)));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 104 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 108 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
Write(item.AssignedUserDescription);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 108 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </span>\r\n");
|
|
|
|
|
|
#line 111 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </td>\r\n <td>\r\n");
|
|
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 114 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
Write(item.JobCount);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
|
|
|
|
|
|
#line 117 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </tbody>\r\n </table>\r\n");
|
|
|
|
WriteLiteral(" <script");
|
|
|
|
WriteLiteral(" type=\"text/javascript\"");
|
|
|
|
WriteLiteral(">\r\n $(function () {\r\n var userTable = $(\'table.deviceTa" +
|
|
"ble\');\r\n\r\n userTable.each(function () {\r\n var " +
|
|
"$this = $(this);\r\n\r\n if (!$this.data(\'deviceTable_Flags\')) {\r" +
|
|
"\n $this.tooltip({\r\n items: \'i." +
|
|
"flag\',\r\n content: function () {\r\n " +
|
|
" var $this = $(this);\r\n return $this.c" +
|
|
"hildren(\'.details\').html();\r\n },\r\n " +
|
|
" tooltipClass: \'FlagAssignment_Tooltip\',\r\n po" +
|
|
"sition: {\r\n my: \"right top\",\r\n " +
|
|
" at: \"right bottom\",\r\n collision: \"fl" +
|
|
"ipfit flip\"\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 " +
|
|
" $(this).stop(true).fadeTo(100, 1);\r\n " +
|
|
" },\r\n function () {" +
|
|
"\r\n $(this).fadeOut(100, function () { $(t" +
|
|
"his).remove(); });\r\n });\r\n " +
|
|
" }\r\n });\r\n\r\n $this.data(\'d" +
|
|
"eviceTable_Flags\', true)\r\n }\r\n });\r\n " +
|
|
" });\r\n </script>\r\n");
|
|
|
|
|
|
#line 159 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <span");
|
|
|
|
WriteLiteral(" class=\"smallMessage\"");
|
|
|
|
WriteLiteral(">No Devices Found</span>\r\n");
|
|
|
|
|
|
#line 163 "..\..\Views\Device\_DeviceTable.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</div>\r\n");
|
|
|
|
}
|
|
}
|
|
}
|
|
#pragma warning restore 1591
|