1390 lines
44 KiB
C#
1390 lines
44 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.Areas.Config.Views.DeviceModel
|
|
{
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Net;
|
|
using System.Text;
|
|
using System.Web;
|
|
using System.Web.Helpers;
|
|
using System.Web.Mvc;
|
|
using System.Web.Mvc.Ajax;
|
|
using System.Web.Mvc.Html;
|
|
using System.Web.Routing;
|
|
using System.Web.Security;
|
|
using System.Web.UI;
|
|
using System.Web.WebPages;
|
|
using Disco;
|
|
using Disco.Models.Repository;
|
|
using Disco.Services;
|
|
using Disco.Services.Authorization;
|
|
using Disco.Services.Web;
|
|
using Disco.Web;
|
|
using Disco.Web.Extensions;
|
|
|
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
|
|
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DeviceModel/Show.cshtml")]
|
|
public partial class Show : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.DeviceModel.ShowModel>
|
|
{
|
|
public Show()
|
|
{
|
|
}
|
|
public override void Execute()
|
|
{
|
|
|
|
#line 2 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
|
|
Authorization.Require(Claims.Config.DeviceModel.Show);
|
|
|
|
var canConfig = Authorization.Has(Claims.Config.DeviceModel.Configure);
|
|
var canViewPlugins = Authorization.Has(Claims.Config.Plugin.Install);
|
|
var isCustom = Model.DeviceModel.IsCustomModel();
|
|
|
|
if (canConfig)
|
|
{
|
|
Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
|
|
}
|
|
|
|
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Models", MVC.Config.DeviceModel.Index(null), Model.DeviceModel.ToString());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n<div");
|
|
|
|
WriteLiteral(" class=\"form\"");
|
|
|
|
WriteLiteral(" style=\"width: 530px\"");
|
|
|
|
WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th");
|
|
|
|
WriteLiteral(" style=\"width: 150px\"");
|
|
|
|
WriteLiteral(">\r\n Id:\r\n </th>\r\n <td>\r\n");
|
|
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 23 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
Write(Html.DisplayFor(model => model.DeviceModel.Id));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th>\r\n " +
|
|
" Description:\r\n </th>\r\n <td>\r\n");
|
|
|
|
|
|
#line 31 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 31 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
if (canConfig)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 33 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
Write(Html.EditorFor(model => model.DeviceModel.Description));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 33 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 34 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
Write(AjaxHelpers.AjaxSave());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 34 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 35 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
Write(AjaxHelpers.AjaxLoader());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 35 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(@" <script>
|
|
$(function () {
|
|
document.DiscoFunctions.PropertyChangeHelper(
|
|
$('#DeviceModel_Description'),
|
|
'Model Description',
|
|
'");
|
|
|
|
|
|
#line 41 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
Write(Url.Action(MVC.API.DeviceModel.UpdateDescription(Model.DeviceModel.Id)));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\',\r\n \'Description\'\r\n );\r\n " +
|
|
" });\r\n </script>\r\n");
|
|
|
|
|
|
#line 46 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 49 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
Write(Html.DisplayFor(model => model.DeviceModel.Description));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 49 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n <th>\r\n " +
|
|
" Manufacturer:\r\n </th>\r\n <td>\r\n");
|
|
|
|
|
|
#line 58 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 58 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
if (isCustom && canConfig)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 60 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
Write(Html.EditorFor(model => model.DeviceModel.Manufacturer));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 60 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 61 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
Write(AjaxHelpers.AjaxSave());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 61 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 62 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
Write(AjaxHelpers.AjaxLoader());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 62 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(@" <script>
|
|
$(function () {
|
|
document.DiscoFunctions.PropertyChangeHelper(
|
|
$('#DeviceModel_Manufacturer'),
|
|
'Manufacturer',
|
|
'");
|
|
|
|
|
|
#line 68 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
Write(Url.Action(MVC.API.DeviceModel.UpdateManufacturer(Model.DeviceModel.Id)));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\',\r\n \'manufacturer\'\r\n )" +
|
|
";\r\n });\r\n </script>\r\n");
|
|
|
|
|
|
#line 73 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 76 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
Write(Html.DisplayFor(model => model.DeviceModel.Manufacturer));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 76 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n <th>\r\n " +
|
|
" Model:\r\n </th>\r\n <td>\r\n");
|
|
|
|
|
|
#line 85 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 85 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
if (isCustom && canConfig)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 87 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
Write(Html.EditorFor(model => model.DeviceModel.Model));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 87 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 88 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
Write(AjaxHelpers.AjaxSave());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 88 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 89 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
Write(AjaxHelpers.AjaxLoader());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 89 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(@" <script>
|
|
$(function () {
|
|
document.DiscoFunctions.PropertyChangeHelper(
|
|
$('#DeviceModel_Model'),
|
|
'Model',
|
|
'");
|
|
|
|
|
|
#line 95 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
Write(Url.Action(MVC.API.DeviceModel.UpdateModel(Model.DeviceModel.Id)));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\',\r\n \'model\'\r\n );\r\n " +
|
|
" });\r\n </script>\r\n");
|
|
|
|
|
|
#line 100 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 103 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
Write(Html.DisplayFor(model => model.DeviceModel.Model));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 103 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n <th>Statistics</th>\r\n" +
|
|
" <td>\r\n <div><strong>");
|
|
|
|
|
|
#line 110 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
Write(Model.DeviceCount.ToString("n0"));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</strong> ");
|
|
|
|
|
|
#line 110 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
Write(Model.DeviceCount == 1 ? "devices is" : "devices are");
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" of this model type.</div>\r\n");
|
|
|
|
|
|
#line 111 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 111 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
if (Model.DeviceDecommissionedCount > 0)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" class=\"smallMessage\"");
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 113 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
Write(Model.DeviceDecommissionedCount.ToString("n0"));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 113 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
Write(Model.DeviceDecommissionedCount == 1 ? "device is" : "devices are");
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" decommissioned.</div>\r\n");
|
|
|
|
|
|
#line 114 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n <th>\r\n " +
|
|
" Default Purchase Date:\r\n </th>\r\n <td>\r\n");
|
|
|
|
|
|
#line 122 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 122 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
if (canConfig)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 124 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
Write(Html.EditorFor(model => model.DeviceModel.DefaultPurchaseDate));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 124 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 125 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
Write(AjaxHelpers.AjaxLoader());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 125 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(@" <script>
|
|
$(function () {
|
|
var dateField = $('#DeviceModel_DefaultPurchaseDate');
|
|
document.DiscoFunctions.DateChangeHelper(
|
|
dateField,
|
|
'None',
|
|
'");
|
|
|
|
|
|
#line 132 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
Write(Url.Action(MVC.API.DeviceModel.UpdateDefaultPurchaseDate(Model.DeviceModel.Id)));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\',\r\n \'DefaultPurchaseDate\',\r\n null," +
|
|
"\r\n true\r\n );\r\n " +
|
|
"});\r\n </script>\r\n");
|
|
|
|
|
|
#line 139 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 142 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
Write(CommonHelpers.FriendlyDate(Model.DeviceModel.DefaultPurchaseDate, "Unknown"));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 142 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n <th>\r\n " +
|
|
" Default Warranty Provider:\r\n </th>\r\n <td>\r\n");
|
|
|
|
|
|
#line 151 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 151 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
if (canConfig)
|
|
{
|
|
if (Model.WarrantyProviders.Count > 0)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 155 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
Write(Html.DropDownListFor(model => model.DeviceModel.DefaultWarrantyProvider, Model.WarrantyProviders.ToSelectListItems(Model.DeviceModel.DefaultWarrantyProvider, true, "None")));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 155 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 156 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
Write(AjaxHelpers.AjaxLoader());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 156 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(@" <script>
|
|
$(function () {
|
|
document.DiscoFunctions.PropertyChangeHelper(
|
|
$('#DeviceModel_DefaultWarrantyProvider'),
|
|
null,
|
|
'");
|
|
|
|
|
|
#line 162 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
Write(Url.Action(MVC.API.DeviceModel.UpdateDefaultWarrantyProvider(Model.DeviceModel.Id)));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\',\r\n \'DefaultWarrantyProvider\'\r\n " +
|
|
" );\r\n });\r\n </script>\r\n");
|
|
|
|
|
|
#line 167 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <span");
|
|
|
|
WriteLiteral(" class=\"smallMessage\"");
|
|
|
|
WriteLiteral(">No warranty provider plugins installed</span>\r\n");
|
|
|
|
|
|
#line 171 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
}
|
|
if (canViewPlugins)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" class=\"info-box\"");
|
|
|
|
WriteLiteral(">\r\n <p");
|
|
|
|
WriteLiteral(" class=\"fa-p\"");
|
|
|
|
WriteLiteral(">\r\n <i");
|
|
|
|
WriteLiteral(" class=\"fa fa-info-circle\"");
|
|
|
|
WriteLiteral("></i>View the <a");
|
|
|
|
WriteAttribute("href", Tuple.Create(" href=\"", 6969), Tuple.Create("\"", 7019)
|
|
|
|
#line 176 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 6976), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.Config.Plugins.Install())
|
|
|
|
#line default
|
|
#line hidden
|
|
, 6976), false)
|
|
);
|
|
|
|
WriteLiteral(">Plugin Catalogue</a> to discover and install warranty provider plugins.\r\n " +
|
|
" </p>\r\n </div>\r\n");
|
|
|
|
|
|
#line 179 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (Model.DeviceModel.DefaultWarrantyProvider == null)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <span");
|
|
|
|
WriteLiteral(" class=\"smallMessage\"");
|
|
|
|
WriteLiteral("><None Specified></span>\r\n");
|
|
|
|
|
|
#line 186 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
}
|
|
else
|
|
{
|
|
var provider = Model.WarrantyProviders.FirstOrDefault(wp => wp.Id == Model.DeviceModel.DefaultWarrantyProvider);
|
|
if (provider == null)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <span");
|
|
|
|
WriteLiteral(" class=\"smallMessage\"");
|
|
|
|
WriteLiteral("><None Specified></span>\r\n");
|
|
|
|
|
|
#line 193 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 196 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
Write(provider.Name);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 196 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n <th>\r\n " +
|
|
" Default Repair Provider:\r\n </th>\r\n <td>\r\n");
|
|
|
|
|
|
#line 207 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 207 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
if (canConfig)
|
|
{
|
|
if (Model.RepairProviders.Count > 0)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 211 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
Write(Html.DropDownListFor(model => model.DeviceModel.DefaultRepairProvider, Model.RepairProviders.ToSelectListItems(Model.DeviceModel.DefaultRepairProvider, true, "None")));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 211 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 212 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
Write(AjaxHelpers.AjaxLoader());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 212 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(@" <script>
|
|
$(function () {
|
|
document.DiscoFunctions.PropertyChangeHelper(
|
|
$('#DeviceModel_DefaultRepairProvider'),
|
|
null,
|
|
'");
|
|
|
|
|
|
#line 218 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
Write(Url.Action(MVC.API.DeviceModel.UpdateDefaultRepairProvider(Model.DeviceModel.Id)));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\',\r\n \'DefaultRepairProvider\'\r\n " +
|
|
");\r\n });\r\n </script>\r\n");
|
|
|
|
|
|
#line 223 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <div>No repair provider plugins installed</div>\r\n");
|
|
|
|
|
|
#line 227 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
}
|
|
if (canViewPlugins)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" class=\"info-box\"");
|
|
|
|
WriteLiteral(">\r\n <p");
|
|
|
|
WriteLiteral(" class=\"fa-p\"");
|
|
|
|
WriteLiteral(">\r\n <i");
|
|
|
|
WriteLiteral(" class=\"fa fa-info-circle\"");
|
|
|
|
WriteLiteral("></i>View the <a");
|
|
|
|
WriteAttribute("href", Tuple.Create(" href=\"", 9418), Tuple.Create("\"", 9468)
|
|
|
|
#line 232 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 9425), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.Config.Plugins.Install())
|
|
|
|
#line default
|
|
#line hidden
|
|
, 9425), false)
|
|
);
|
|
|
|
WriteLiteral(">Plugin Catalogue</a> to discover and install repair provider plugins.\r\n " +
|
|
" </p>\r\n </div>\r\n");
|
|
|
|
|
|
#line 235 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (Model.DeviceModel.DefaultRepairProvider == null)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <span");
|
|
|
|
WriteLiteral(" class=\"smallMessage\"");
|
|
|
|
WriteLiteral("><None Specified></span>\r\n");
|
|
|
|
|
|
#line 242 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
}
|
|
else
|
|
{
|
|
var provider = Model.RepairProviders.FirstOrDefault(wp => wp.Id == Model.DeviceModel.DefaultRepairProvider);
|
|
if (provider == null)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <span");
|
|
|
|
WriteLiteral(" class=\"smallMessage\"");
|
|
|
|
WriteLiteral("><None Specified></span>\r\n");
|
|
|
|
|
|
#line 249 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 252 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
Write(provider.Name);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 252 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n <th>\r\n " +
|
|
" Type:\r\n </th>\r\n <td>\r\n");
|
|
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 263 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
Write(Html.DisplayFor(model => model.DeviceModel.ModelType));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th>\r\n " +
|
|
" Image:\r\n </th>\r\n <td>\r\n <img");
|
|
|
|
WriteLiteral(" alt=\"Model Image\"");
|
|
|
|
WriteAttribute("src", Tuple.Create(" src=\"", 10795), Tuple.Create("\"", 10892)
|
|
|
|
#line 271 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 10801), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DeviceModel.Image(Model.DeviceModel.Id, Model.DeviceModel.ImageHash()))
|
|
|
|
#line default
|
|
#line hidden
|
|
, 10801), false)
|
|
);
|
|
|
|
WriteLiteral(" />\r\n");
|
|
|
|
|
|
#line 272 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 272 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
if (canConfig)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <hr />\r\n");
|
|
|
|
|
|
#line 275 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
using (Html.BeginForm(MVC.API.DeviceModel.Image(Model.DeviceModel.Id, true, null), FormMethod.Post, new { enctype = "multipart/form-data" }))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 277 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
Write(Html.AntiForgeryToken());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 277 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <input");
|
|
|
|
WriteLiteral(" type=\"file\"");
|
|
|
|
WriteLiteral(" name=\"Image\"");
|
|
|
|
WriteLiteral(" id=\"Image\"");
|
|
|
|
WriteLiteral(" style=\"width: 220px;\"");
|
|
|
|
WriteLiteral(" />\r\n");
|
|
|
|
WriteLiteral(" <input");
|
|
|
|
WriteLiteral(" class=\"button small\"");
|
|
|
|
WriteLiteral(" type=\"submit\"");
|
|
|
|
WriteLiteral(" value=\"Upload Image\"");
|
|
|
|
WriteLiteral(" />\r\n");
|
|
|
|
|
|
#line 280 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
}
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </td>\r\n </tr>\r\n </table>\r\n</div>\r\n<h2>Components</h2>\r\n");
|
|
|
|
|
|
#line 287 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
Write(Html.Partial(MVC.Config.DeviceModel.Views._DeviceComponentsTable, Model.DeviceComponentsModel));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n");
|
|
|
|
|
|
#line 288 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
Write(Html.Partial(MVC.Config.Shared.Views._DeviceGroupDocumentBulkGenerate, Model));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n<div");
|
|
|
|
WriteLiteral(" class=\"actionBar\"");
|
|
|
|
WriteLiteral(">\r\n");
|
|
|
|
|
|
#line 290 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 290 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
if (Model.CanDecommission)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <button");
|
|
|
|
WriteLiteral(" id=\"DeviceModel_Decommission\"");
|
|
|
|
WriteLiteral(" class=\"button\"");
|
|
|
|
WriteLiteral(">Decommission All Devices</button>\r\n");
|
|
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" id=\"DeviceModel_Decommission_Dialog\"");
|
|
|
|
WriteLiteral(" class=\"dialog\"");
|
|
|
|
WriteLiteral(" title=\"Model Device Decommission\"");
|
|
|
|
WriteLiteral(">\r\n");
|
|
|
|
|
|
#line 294 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 294 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
using (Html.BeginForm(MVC.API.Device.DeviceModelDecommission(Model.DeviceModel.Id)))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 296 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
Write(Html.AntiForgeryToken());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 296 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <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 are these devices to be decommissioned?\r\n </div>\r\n");
|
|
|
|
WriteLiteral(" <div>\r\n <ul");
|
|
|
|
WriteLiteral(" class=\"none\"");
|
|
|
|
WriteLiteral(">\r\n");
|
|
|
|
|
|
#line 302 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 302 "..\..\Areas\Config\Views\DeviceModel\Show.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=\"", 12682), Tuple.Create("\"", 12752)
|
|
, Tuple.Create(Tuple.Create("", 12687), Tuple.Create("DeviceModel_Decommission_Dialog_Reason_", 12687), true)
|
|
|
|
#line 305 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 12726), Tuple.Create<System.Object, System.Int32>((int)decommissionReason
|
|
|
|
#line default
|
|
#line hidden
|
|
, 12726), false)
|
|
);
|
|
|
|
WriteLiteral("\r\n name=\"decommissionReason\"");
|
|
|
|
WriteAttribute("value", Tuple.Create(" value=\"", 12819), Tuple.Create("\"", 12853)
|
|
|
|
#line 306 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 12827), Tuple.Create<System.Object, System.Int32>((int)decommissionReason
|
|
|
|
#line default
|
|
#line hidden
|
|
, 12827), false)
|
|
);
|
|
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 306 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
Write((decommissionReason == DecommissionReasons.EndOfLife) ? "checked=\"checked\"" : string.Empty);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" />\r\n <label");
|
|
|
|
WriteAttribute("for", Tuple.Create(" for=\"", 12993), Tuple.Create("\"", 13064)
|
|
, Tuple.Create(Tuple.Create("", 12999), Tuple.Create("DeviceModel_Decommission_Dialog_Reason_", 12999), true)
|
|
|
|
#line 307 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 13038), Tuple.Create<System.Object, System.Int32>((int)decommissionReason
|
|
|
|
#line default
|
|
#line hidden
|
|
, 13038), false)
|
|
);
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 307 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
Write(decommissionReason.ReasonMessage());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</label>\r\n </li>\r\n");
|
|
|
|
|
|
#line 309 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </ul>\r\n <br />\r\n <label" +
|
|
">\r\n <input");
|
|
|
|
WriteLiteral(" type=\"checkbox\"");
|
|
|
|
WriteLiteral(" value=\"true\"");
|
|
|
|
WriteLiteral(" name=\"unassignUsers\"");
|
|
|
|
WriteLiteral(" />\r\n Unassign devices users\r\n </label>" +
|
|
"\r\n </div>\r\n");
|
|
|
|
|
|
#line 317 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </div>\r\n");
|
|
|
|
WriteLiteral(" <script");
|
|
|
|
WriteLiteral(" type=\"text/javascript\"");
|
|
|
|
WriteLiteral(@">
|
|
$(function () {
|
|
let buttonDialog = null;
|
|
$('#DeviceModel_Decommission').click(function () {
|
|
if (!buttonDialog) {
|
|
buttonDialog = $('#DeviceModel_Decommission_Dialog')
|
|
.dialog({
|
|
resizable: false,
|
|
modal: true,
|
|
autoOpen: false,
|
|
buttons: {
|
|
""Decommission"": function () {
|
|
const $this = $(this);
|
|
$this.find('form').trigger('submit');
|
|
$this.dialog(""disable"");
|
|
$this.dialog(""option"", ""buttons"", null);
|
|
},
|
|
Cancel: function () {
|
|
$(this).dialog(""close"");
|
|
}
|
|
}
|
|
});
|
|
}
|
|
buttonDialog.dialog('open');
|
|
return false;
|
|
});
|
|
|
|
});
|
|
</script>
|
|
");
|
|
|
|
|
|
#line 348 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 349 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
if (Model.CanDelete)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <button");
|
|
|
|
WriteLiteral(" id=\"buttonDelete\"");
|
|
|
|
WriteLiteral(" type=\"button\"");
|
|
|
|
WriteLiteral(" class=\"button\"");
|
|
|
|
WriteLiteral(">Delete</button>\r\n");
|
|
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" id=\"dialogConfirmDelete\"");
|
|
|
|
WriteLiteral(" class=\"dialog\"");
|
|
|
|
WriteLiteral(" title=\"Delete this Device Model?\"");
|
|
|
|
WriteLiteral(">\r\n");
|
|
|
|
|
|
#line 353 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 353 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
using (Html.BeginForm(MVC.API.DeviceModel.Delete(Model.DeviceModel.Id, true)))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 355 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
Write(Html.AntiForgeryToken());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 355 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <p>\r\n <i");
|
|
|
|
WriteLiteral(" class=\"fa fa-exclamation-triangle fa-lg warning\"");
|
|
|
|
WriteLiteral("></i>\r\n This item will be permanently deleted and cannot be recove" +
|
|
"red. Are you sure?\r\n </p>\r\n </div>\r\n");
|
|
|
|
WriteLiteral(" <script");
|
|
|
|
WriteLiteral(" type=\"text/javascript\"");
|
|
|
|
WriteLiteral(@">
|
|
$(function () {
|
|
let dialog = null;
|
|
$('#buttonDelete').on('click', function () {
|
|
if (!dialog) {
|
|
dialog = $(""#dialogConfirmDelete"").dialog({
|
|
resizable: false,
|
|
width: 300,
|
|
modal: true,
|
|
autoOpen: false,
|
|
buttons: {
|
|
""Delete"": function () {
|
|
$(this)
|
|
.dialog(""option"", ""buttons"", null)
|
|
.find('form').trigger('submit');
|
|
},
|
|
Cancel: function () {
|
|
$(this).dialog(""close"");
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
dialog.dialog('open');
|
|
});
|
|
});
|
|
</script>
|
|
");
|
|
|
|
|
|
#line 389 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 390 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
if (Model.DeviceCount > 0)
|
|
{
|
|
if (Authorization.Has(Claims.Device.Actions.Export))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 394 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
Write(Html.ActionLinkButton("Export Devices", MVC.Device.Export(null, Disco.Models.Services.Devices.DeviceExportTypes.Model, Model.DeviceModel.Id)));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 394 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
|
|
}
|
|
if (Authorization.Has(Claims.Device.Search) && Model.DeviceCount > 0)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 398 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
Write(Html.ActionLinkButton(string.Format("View {0} Device{1}", Model.DeviceCount, (Model.DeviceCount != 1 ? "s" : null)), MVC.Search.Query(Model.DeviceModel.Id.ToString(), "DeviceModel")));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 398 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
|
|
|
}
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</div>\r\n");
|
|
|
|
}
|
|
}
|
|
}
|
|
#pragma warning restore 1591
|