#34 Feature: Detailed Device Exporting
Many additional device properties are available to export. The previous export configuration is remembered.
This commit is contained in:
@@ -673,11 +673,11 @@
|
||||
</div>
|
||||
<div>
|
||||
<ul class="none">
|
||||
@foreach (Device.DecommissionReasons decommissionReason in Enum.GetValues(typeof(Device.DecommissionReasons)))
|
||||
@foreach (DecommissionReasons decommissionReason in Enum.GetValues(typeof(DecommissionReasons)))
|
||||
{
|
||||
<li>
|
||||
<input type="radio" id="Device_Show_Device_Actions_Decommission_Reason_@((int)decommissionReason)"
|
||||
name="Device_Show_Device_Actions_Decommission_Reason" value="@((int)decommissionReason)" @((decommissionReason == Device.DecommissionReasons.EndOfLife) ? "checked=\"checked\"" : string.Empty)/>
|
||||
name="Device_Show_Device_Actions_Decommission_Reason" value="@((int)decommissionReason)" @((decommissionReason == DecommissionReasons.EndOfLife) ? "checked=\"checked\"" : string.Empty)/>
|
||||
<label for="Device_Show_Device_Actions_Decommission_Reason_@((int)decommissionReason)">@(decommissionReason.ReasonMessage())</label>
|
||||
</li>
|
||||
}
|
||||
|
||||
@@ -2304,7 +2304,7 @@ WriteLiteral(">\r\n");
|
||||
#line hidden
|
||||
|
||||
#line 676 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
foreach (Device.DecommissionReasons decommissionReason in Enum.GetValues(typeof(Device.DecommissionReasons)))
|
||||
foreach (DecommissionReasons decommissionReason in Enum.GetValues(typeof(DecommissionReasons)))
|
||||
{
|
||||
|
||||
|
||||
@@ -2314,50 +2314,50 @@ WriteLiteral(" <li>\r\n
|
||||
|
||||
WriteLiteral(" type=\"radio\"");
|
||||
|
||||
WriteAttribute("id", Tuple.Create(" id=\"", 41943), Tuple.Create("\"", 42021)
|
||||
, Tuple.Create(Tuple.Create("", 41948), Tuple.Create("Device_Show_Device_Actions_Decommission_Reason_", 41948), true)
|
||||
WriteAttribute("id", Tuple.Create(" id=\"", 41929), Tuple.Create("\"", 42007)
|
||||
, Tuple.Create(Tuple.Create("", 41934), Tuple.Create("Device_Show_Device_Actions_Decommission_Reason_", 41934), true)
|
||||
|
||||
#line 679 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 41995), Tuple.Create<System.Object, System.Int32>((int)decommissionReason
|
||||
, Tuple.Create(Tuple.Create("", 41981), Tuple.Create<System.Object, System.Int32>((int)decommissionReason
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 41995), false)
|
||||
, 41981), false)
|
||||
);
|
||||
|
||||
WriteLiteral("\r\n name=\"Device_Show_Device_Actions_Decomm" +
|
||||
"ission_Reason\"");
|
||||
|
||||
WriteAttribute("value", Tuple.Create(" value=\"", 42117), Tuple.Create("\"", 42151)
|
||||
WriteAttribute("value", Tuple.Create(" value=\"", 42103), Tuple.Create("\"", 42137)
|
||||
|
||||
#line 680 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 42125), Tuple.Create<System.Object, System.Int32>((int)decommissionReason
|
||||
, Tuple.Create(Tuple.Create("", 42111), Tuple.Create<System.Object, System.Int32>((int)decommissionReason
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 42125), false)
|
||||
, 42111), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 680 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
Write((decommissionReason == Device.DecommissionReasons.EndOfLife) ? "checked=\"checked\"" : string.Empty);
|
||||
Write((decommissionReason == DecommissionReasons.EndOfLife) ? "checked=\"checked\"" : string.Empty);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("/>\r\n <label");
|
||||
|
||||
WriteAttribute("for", Tuple.Create(" for=\"", 42301), Tuple.Create("\"", 42380)
|
||||
, Tuple.Create(Tuple.Create("", 42307), Tuple.Create("Device_Show_Device_Actions_Decommission_Reason_", 42307), true)
|
||||
WriteAttribute("for", Tuple.Create(" for=\"", 42280), Tuple.Create("\"", 42359)
|
||||
, Tuple.Create(Tuple.Create("", 42286), Tuple.Create("Device_Show_Device_Actions_Decommission_Reason_", 42286), true)
|
||||
|
||||
#line 681 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 42354), Tuple.Create<System.Object, System.Int32>((int)decommissionReason
|
||||
, Tuple.Create(Tuple.Create("", 42333), Tuple.Create<System.Object, System.Int32>((int)decommissionReason
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 42354), false)
|
||||
, 42333), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
@@ -0,0 +1,150 @@
|
||||
@using Disco.Web.Models.Device;
|
||||
@using Disco.Models.Services.Devices;
|
||||
@model ExportModel
|
||||
@{
|
||||
Authorization.RequireAny(Claims.Device.Actions.Export);
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Devices", MVC.Device.Index(), "Export Devices");
|
||||
|
||||
var optionsMetadata = ModelMetadata.FromLambdaExpression(m => m.Options, ViewData);
|
||||
var optionGroups = optionsMetadata.Properties.Where(p => p.ShortDisplayName != null && p.ModelType == typeof(bool))
|
||||
.GroupBy(m => m.ShortDisplayName);
|
||||
}
|
||||
<div id="Devices_Export">
|
||||
@if (!string.IsNullOrEmpty(Model.DownloadExportSessionId))
|
||||
{
|
||||
<div id="Devices_Export_Download_Dialog" class="dialog" title="Export Devices">
|
||||
<h4>The Device Export was completed successfully.</h4>
|
||||
<a href="@Url.Action(MVC.API.Device.ExportRetrieve(Model.DownloadExportSessionId))" class="button"><i class="fa fa-download fa-lg"></i>Download Device Export</a>
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
$('#Devices_Export_Download_Dialog')
|
||||
.dialog({
|
||||
width: 400,
|
||||
resizable: false,
|
||||
modal: true,
|
||||
autoOpen: true
|
||||
});
|
||||
});
|
||||
</script>
|
||||
}
|
||||
@using (Html.BeginForm(MVC.API.Device.Export()))
|
||||
{
|
||||
<div id="Devices_Export_Type" class="form" style="width: 530px">
|
||||
<h2>Export Type</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<th style="width: 150px">Type:
|
||||
</th>
|
||||
<td>
|
||||
@Html.DropDownListFor(m => m.Options.ExportType, Enum.GetNames(typeof(Disco.Models.Services.Devices.Exporting.DeviceExportTypes)).Select(t => new SelectListItem() { Text = t, Value = t }))
|
||||
<div id="Devices_Export_Type_Target_Batch" class="Devices_Export_Type_Target">
|
||||
@Html.DropDownListFor(m => m.Options.ExportTypeTargetId, Model.DeviceBatches.Select(i => new SelectListItem() { Value = i.Key.ToString(), Text = i.Value }))
|
||||
</div>
|
||||
<div id="Devices_Export_Type_Target_Model" class="Devices_Export_Type_Target">
|
||||
@Html.DropDownListFor(m => m.Options.ExportTypeTargetId, Model.DeviceModels.Select(i => new SelectListItem() { Value = i.Key.ToString(), Text = i.Value }))
|
||||
</div>
|
||||
<div id="Devices_Export_Type_Target_Profile" class="Devices_Export_Type_Target">
|
||||
@Html.DropDownListFor(m => m.Options.ExportTypeTargetId, Model.DeviceProfiles.Select(i => new SelectListItem() { Value = i.Key.ToString(), Text = i.Value }))
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="Devices_Export_Fields" class="form" style="width: 530px; margin-top: 15px;">
|
||||
<h2>Export Fields <a id="Devices_Export_Fields_Defaults" href="#">(Defaults)</a></h2>
|
||||
<table>
|
||||
@foreach (var optionGroup in optionGroups)
|
||||
{
|
||||
var optionFields = optionGroup.ToList();
|
||||
var itemsPerColumn = (int)Math.Ceiling((double)optionFields.Count / 2);
|
||||
<tr>
|
||||
<th style="width: 120px;">
|
||||
@optionGroup.Key
|
||||
@if (optionFields.Count > 2)
|
||||
{
|
||||
<span style="display: block;" class="select"><a class="selectAll" href="#">ALL</a> | <a class="selectNone" href="#">NONE</a></span>
|
||||
}
|
||||
</th>
|
||||
<td>
|
||||
<div class="Devices_Export_Fields_Group">
|
||||
<table class="none">
|
||||
<tr>
|
||||
<td style="width: 50%">
|
||||
<ul class="none">
|
||||
@foreach (var optionItem in optionFields.Take(itemsPerColumn))
|
||||
{
|
||||
<li title="@optionItem.Description">
|
||||
<input type="checkbox" id="Options_@optionItem.PropertyName" name="Options.@optionItem.PropertyName" value="true" @(((bool)optionItem.Model) ? "checked " : null)/><label for="Options_@optionItem.PropertyName">@optionItem.DisplayName</label></li>
|
||||
}
|
||||
</ul>
|
||||
</td>
|
||||
<td style="width: 50%">
|
||||
<ul class="none">
|
||||
@foreach (var optionItem in optionFields.Skip(itemsPerColumn))
|
||||
{
|
||||
<li title="@optionItem.Description">
|
||||
<input type="checkbox" id="Options_@optionItem.PropertyName" name="Options.@optionItem.PropertyName" value="true" @(((bool)optionItem.Model) ? "checked " : null)/><label for="Options_@optionItem.PropertyName">@optionItem.DisplayName</label></li>
|
||||
}
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
exportDefaultFields = ['DeviceSerialNumber', 'ModelId', 'ProfileId', 'BatchId', 'AssignedUserId', 'DeviceLocation', 'DeviceAssetNumber'];
|
||||
$exportFields = $('#Devices_Export_Fields');
|
||||
$exportType = $('#Options_ExportType');
|
||||
$exportTypeTargetContainers = $('#Devices_Export_Type').find('.Devices_Export_Type_Target');
|
||||
|
||||
function exportTypeChange() {
|
||||
$exportTypeTargetContainers.hide();
|
||||
$exportTypeTargetContainers.find('select').prop('disabled', true);
|
||||
|
||||
switch ($exportType.val()) {
|
||||
case 'Batch':
|
||||
$('#Devices_Export_Type_Target_Batch').show().find('select').prop('disabled', false);
|
||||
break;
|
||||
case 'Profile':
|
||||
$('#Devices_Export_Type_Target_Profile').show().find('select').prop('disabled', false);
|
||||
break;
|
||||
case 'Model':
|
||||
$('#Devices_Export_Type_Target_Model').show().find('select').prop('disabled', false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
$exportType.change(exportTypeChange);
|
||||
exportTypeChange();
|
||||
|
||||
$exportFields.on('click', 'a.selectAll,a.selectNone', function () {
|
||||
$this = $(this);
|
||||
|
||||
$this.closest('tr').find('input').prop('checked', $this.is('.selectAll'));
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#Devices_Export_Fields_Defaults').click(function () {
|
||||
|
||||
$exportFields.find('input').prop('checked', false);
|
||||
|
||||
$.each(exportDefaultFields, function (index, value) {
|
||||
$('#Options_' + value).prop('checked', true);
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<div class="actionBar">
|
||||
<input type="submit" class="button" value="Export Devices" />
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
@@ -0,0 +1,611 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.34014
|
||||
//
|
||||
// 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.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
|
||||
#line 2 "..\..\Views\Device\Export.cshtml"
|
||||
using Disco.Models.Services.Devices;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
using Disco.Services;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Web;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
#line 1 "..\..\Views\Device\Export.cshtml"
|
||||
using Disco.Web.Models.Device;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Device/Export.cshtml")]
|
||||
public partial class Export : Disco.Services.Web.WebViewPage<ExportModel>
|
||||
{
|
||||
public Export()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 4 "..\..\Views\Device\Export.cshtml"
|
||||
|
||||
Authorization.RequireAny(Claims.Device.Actions.Export);
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Devices", MVC.Device.Index(), "Export Devices");
|
||||
|
||||
var optionsMetadata = ModelMetadata.FromLambdaExpression(m => m.Options, ViewData);
|
||||
var optionGroups = optionsMetadata.Properties.Where(p => p.ShortDisplayName != null && p.ModelType == typeof(bool))
|
||||
.GroupBy(m => m.ShortDisplayName);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n<div");
|
||||
|
||||
WriteLiteral(" id=\"Devices_Export\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 14 "..\..\Views\Device\Export.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 14 "..\..\Views\Device\Export.cshtml"
|
||||
if (!string.IsNullOrEmpty(Model.DownloadExportSessionId))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" id=\"Devices_Export_Download_Dialog\"");
|
||||
|
||||
WriteLiteral(" class=\"dialog\"");
|
||||
|
||||
WriteLiteral(" title=\"Export Devices\"");
|
||||
|
||||
WriteLiteral(">\r\n <h4>The Device Export was completed successfully.</h4>\r\n " +
|
||||
" <a");
|
||||
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 776), Tuple.Create("\"", 856)
|
||||
|
||||
#line 18 "..\..\Views\Device\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 783), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Device.ExportRetrieve(Model.DownloadExportSessionId))
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 783), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" class=\"button\"");
|
||||
|
||||
WriteLiteral("><i");
|
||||
|
||||
WriteLiteral(" class=\"fa fa-download fa-lg\"");
|
||||
|
||||
WriteLiteral("></i>Download Device Export</a>\r\n </div>\r\n");
|
||||
|
||||
WriteLiteral(@" <script>
|
||||
$(function () {
|
||||
$('#Devices_Export_Download_Dialog')
|
||||
.dialog({
|
||||
width: 400,
|
||||
resizable: false,
|
||||
modal: true,
|
||||
autoOpen: true
|
||||
});
|
||||
});
|
||||
</script>
|
||||
");
|
||||
|
||||
|
||||
#line 31 "..\..\Views\Device\Export.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 32 "..\..\Views\Device\Export.cshtml"
|
||||
using (Html.BeginForm(MVC.API.Device.Export()))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" id=\"Devices_Export_Type\"");
|
||||
|
||||
WriteLiteral(" class=\"form\"");
|
||||
|
||||
WriteLiteral(" style=\"width: 530px\"");
|
||||
|
||||
WriteLiteral(">\r\n <h2>Export Type</h2>\r\n <table>\r\n <tr>\r\n " +
|
||||
" <th");
|
||||
|
||||
WriteLiteral(" style=\"width: 150px\"");
|
||||
|
||||
WriteLiteral(">Type:\r\n </th>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 41 "..\..\Views\Device\Export.cshtml"
|
||||
Write(Html.DropDownListFor(m => m.Options.ExportType, Enum.GetNames(typeof(Disco.Models.Services.Devices.Exporting.DeviceExportTypes)).Select(t => new SelectListItem() { Text = t, Value = t })));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n <div");
|
||||
|
||||
WriteLiteral(" id=\"Devices_Export_Type_Target_Batch\"");
|
||||
|
||||
WriteLiteral(" class=\"Devices_Export_Type_Target\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 43 "..\..\Views\Device\Export.cshtml"
|
||||
Write(Html.DropDownListFor(m => m.Options.ExportTypeTargetId, Model.DeviceBatches.Select(i => new SelectListItem() { Value = i.Key.ToString(), Text = i.Value })));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </div>\r\n <div");
|
||||
|
||||
WriteLiteral(" id=\"Devices_Export_Type_Target_Model\"");
|
||||
|
||||
WriteLiteral(" class=\"Devices_Export_Type_Target\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 46 "..\..\Views\Device\Export.cshtml"
|
||||
Write(Html.DropDownListFor(m => m.Options.ExportTypeTargetId, Model.DeviceModels.Select(i => new SelectListItem() { Value = i.Key.ToString(), Text = i.Value })));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </div>\r\n <div");
|
||||
|
||||
WriteLiteral(" id=\"Devices_Export_Type_Target_Profile\"");
|
||||
|
||||
WriteLiteral(" class=\"Devices_Export_Type_Target\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 49 "..\..\Views\Device\Export.cshtml"
|
||||
Write(Html.DropDownListFor(m => m.Options.ExportTypeTargetId, Model.DeviceProfiles.Select(i => new SelectListItem() { Value = i.Key.ToString(), Text = i.Value })));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </div>\r\n </td>\r\n </tr" +
|
||||
">\r\n </table>\r\n </div>\r\n");
|
||||
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" id=\"Devices_Export_Fields\"");
|
||||
|
||||
WriteLiteral(" class=\"form\"");
|
||||
|
||||
WriteLiteral(" style=\"width: 530px; margin-top: 15px;\"");
|
||||
|
||||
WriteLiteral(">\r\n <h2>Export Fields <a");
|
||||
|
||||
WriteLiteral(" id=\"Devices_Export_Fields_Defaults\"");
|
||||
|
||||
WriteLiteral(" href=\"#\"");
|
||||
|
||||
WriteLiteral(">(Defaults)</a></h2>\r\n <table>\r\n");
|
||||
|
||||
|
||||
#line 58 "..\..\Views\Device\Export.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 58 "..\..\Views\Device\Export.cshtml"
|
||||
foreach (var optionGroup in optionGroups)
|
||||
{
|
||||
var optionFields = optionGroup.ToList();
|
||||
var itemsPerColumn = (int)Math.Ceiling((double)optionFields.Count / 2);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <tr>\r\n <th");
|
||||
|
||||
WriteLiteral(" style=\"width: 120px;\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 64 "..\..\Views\Device\Export.cshtml"
|
||||
Write(optionGroup.Key);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
|
||||
#line 65 "..\..\Views\Device\Export.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 65 "..\..\Views\Device\Export.cshtml"
|
||||
if (optionFields.Count > 2)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <span");
|
||||
|
||||
WriteLiteral(" style=\"display: block;\"");
|
||||
|
||||
WriteLiteral(" class=\"select\"");
|
||||
|
||||
WriteLiteral("><a");
|
||||
|
||||
WriteLiteral(" class=\"selectAll\"");
|
||||
|
||||
WriteLiteral(" href=\"#\"");
|
||||
|
||||
WriteLiteral(">ALL</a> | <a");
|
||||
|
||||
WriteLiteral(" class=\"selectNone\"");
|
||||
|
||||
WriteLiteral(" href=\"#\"");
|
||||
|
||||
WriteLiteral(">NONE</a></span>\r\n");
|
||||
|
||||
|
||||
#line 68 "..\..\Views\Device\Export.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </th>\r\n <td>\r\n " +
|
||||
" <div");
|
||||
|
||||
WriteLiteral(" class=\"Devices_Export_Fields_Group\"");
|
||||
|
||||
WriteLiteral(">\r\n <table");
|
||||
|
||||
WriteLiteral(" class=\"none\"");
|
||||
|
||||
WriteLiteral(">\r\n <tr>\r\n " +
|
||||
" <td");
|
||||
|
||||
WriteLiteral(" style=\"width: 50%\"");
|
||||
|
||||
WriteLiteral(">\r\n <ul");
|
||||
|
||||
WriteLiteral(" class=\"none\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 76 "..\..\Views\Device\Export.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 76 "..\..\Views\Device\Export.cshtml"
|
||||
foreach (var optionItem in optionFields.Take(itemsPerColumn))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <li");
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 4330), Tuple.Create("\"", 4361)
|
||||
|
||||
#line 78 "..\..\Views\Device\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4338), Tuple.Create<System.Object, System.Int32>(optionItem.Description
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 4338), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n <input");
|
||||
|
||||
WriteLiteral(" type=\"checkbox\"");
|
||||
|
||||
WriteAttribute("id", Tuple.Create(" id=\"", 4443), Tuple.Create("\"", 4480)
|
||||
, Tuple.Create(Tuple.Create("", 4448), Tuple.Create("Options_", 4448), true)
|
||||
|
||||
#line 79 "..\..\Views\Device\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4456), Tuple.Create<System.Object, System.Int32>(optionItem.PropertyName
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 4456), false)
|
||||
);
|
||||
|
||||
WriteAttribute("name", Tuple.Create(" name=\"", 4481), Tuple.Create("\"", 4520)
|
||||
, Tuple.Create(Tuple.Create("", 4488), Tuple.Create("Options.", 4488), true)
|
||||
|
||||
#line 79 "..\..\Views\Device\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4496), Tuple.Create<System.Object, System.Int32>(optionItem.PropertyName
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 4496), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" value=\"true\"");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 79 "..\..\Views\Device\Export.cshtml"
|
||||
Write(((bool)optionItem.Model) ? "checked " : null);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("/><label");
|
||||
|
||||
WriteAttribute("for", Tuple.Create(" for=\"", 4590), Tuple.Create("\"", 4628)
|
||||
, Tuple.Create(Tuple.Create("", 4596), Tuple.Create("Options_", 4596), true)
|
||||
|
||||
#line 79 "..\..\Views\Device\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4604), Tuple.Create<System.Object, System.Int32>(optionItem.PropertyName
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 4604), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 79 "..\..\Views\Device\Export.cshtml"
|
||||
Write(optionItem.DisplayName);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</label></li>\r\n");
|
||||
|
||||
|
||||
#line 80 "..\..\Views\Device\Export.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </ul>\r\n " +
|
||||
" </td>\r\n <td");
|
||||
|
||||
WriteLiteral(" style=\"width: 50%\"");
|
||||
|
||||
WriteLiteral(">\r\n <ul");
|
||||
|
||||
WriteLiteral(" class=\"none\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 85 "..\..\Views\Device\Export.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 85 "..\..\Views\Device\Export.cshtml"
|
||||
foreach (var optionItem in optionFields.Skip(itemsPerColumn))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <li");
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 5163), Tuple.Create("\"", 5194)
|
||||
|
||||
#line 87 "..\..\Views\Device\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 5171), Tuple.Create<System.Object, System.Int32>(optionItem.Description
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 5171), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n <input");
|
||||
|
||||
WriteLiteral(" type=\"checkbox\"");
|
||||
|
||||
WriteAttribute("id", Tuple.Create(" id=\"", 5276), Tuple.Create("\"", 5313)
|
||||
, Tuple.Create(Tuple.Create("", 5281), Tuple.Create("Options_", 5281), true)
|
||||
|
||||
#line 88 "..\..\Views\Device\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 5289), Tuple.Create<System.Object, System.Int32>(optionItem.PropertyName
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 5289), false)
|
||||
);
|
||||
|
||||
WriteAttribute("name", Tuple.Create(" name=\"", 5314), Tuple.Create("\"", 5353)
|
||||
, Tuple.Create(Tuple.Create("", 5321), Tuple.Create("Options.", 5321), true)
|
||||
|
||||
#line 88 "..\..\Views\Device\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 5329), Tuple.Create<System.Object, System.Int32>(optionItem.PropertyName
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 5329), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" value=\"true\"");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 88 "..\..\Views\Device\Export.cshtml"
|
||||
Write(((bool)optionItem.Model) ? "checked " : null);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("/><label");
|
||||
|
||||
WriteAttribute("for", Tuple.Create(" for=\"", 5423), Tuple.Create("\"", 5461)
|
||||
, Tuple.Create(Tuple.Create("", 5429), Tuple.Create("Options_", 5429), true)
|
||||
|
||||
#line 88 "..\..\Views\Device\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 5437), Tuple.Create<System.Object, System.Int32>(optionItem.PropertyName
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 5437), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 88 "..\..\Views\Device\Export.cshtml"
|
||||
Write(optionItem.DisplayName);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</label></li>\r\n");
|
||||
|
||||
|
||||
#line 89 "..\..\Views\Device\Export.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@" </ul>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
");
|
||||
|
||||
|
||||
#line 97 "..\..\Views\Device\Export.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </table>\r\n </div>\r\n");
|
||||
|
||||
WriteLiteral(" <script>\r\n $(function () {\r\n exportDefaultField" +
|
||||
"s = [\'DeviceSerialNumber\', \'ModelId\', \'ProfileId\', \'BatchId\', \'AssignedUserId\', " +
|
||||
"\'DeviceLocation\', \'DeviceAssetNumber\'];\r\n $exportFields = $(\'#Dev" +
|
||||
"ices_Export_Fields\');\r\n $exportType = $(\'#Options_ExportType\');\r\n" +
|
||||
" $exportTypeTargetContainers = $(\'#Devices_Export_Type\').find(\'.D" +
|
||||
"evices_Export_Type_Target\');\r\n\r\n function exportTypeChange() {\r\n " +
|
||||
" $exportTypeTargetContainers.hide();\r\n $exp" +
|
||||
"ortTypeTargetContainers.find(\'select\').prop(\'disabled\', true);\r\n\r\n " +
|
||||
" switch ($exportType.val()) {\r\n case \'Batch\':\r\n " +
|
||||
" $(\'#Devices_Export_Type_Target_Batch\').show().find(\'selec" +
|
||||
"t\').prop(\'disabled\', false);\r\n break;\r\n " +
|
||||
" case \'Profile\':\r\n $(\'#Devices_Export_Type_T" +
|
||||
"arget_Profile\').show().find(\'select\').prop(\'disabled\', false);\r\n " +
|
||||
" break;\r\n case \'Model\':\r\n " +
|
||||
" $(\'#Devices_Export_Type_Target_Model\').show().find(\'select\').prop(\'disabl" +
|
||||
"ed\', false);\r\n break;\r\n }\r\n " +
|
||||
" }\r\n $exportType.change(exportTypeChange);\r\n " +
|
||||
" exportTypeChange();\r\n\r\n $exportFields.on(\'click\', \'a.selectAll" +
|
||||
",a.selectNone\', function () {\r\n $this = $(this);\r\n\r\n " +
|
||||
" $this.closest(\'tr\').find(\'input\').prop(\'checked\', $this.is(\'.selectAl" +
|
||||
"l\'));\r\n\r\n return false;\r\n });\r\n\r\n " +
|
||||
" $(\'#Devices_Export_Fields_Defaults\').click(function () {\r\n\r\n " +
|
||||
" $exportFields.find(\'input\').prop(\'checked\', false);\r\n\r\n $." +
|
||||
"each(exportDefaultFields, function (index, value) {\r\n $(\'" +
|
||||
"#Options_\' + value).prop(\'checked\', true);\r\n });\r\n\r\n " +
|
||||
" return false;\r\n });\r\n });\r\n </script" +
|
||||
">\r\n");
|
||||
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"actionBar\"");
|
||||
|
||||
WriteLiteral(">\r\n <input");
|
||||
|
||||
WriteLiteral(" type=\"submit\"");
|
||||
|
||||
WriteLiteral(" class=\"button\"");
|
||||
|
||||
WriteLiteral(" value=\"Export Devices\"");
|
||||
|
||||
WriteLiteral(" />\r\n </div>\r\n");
|
||||
|
||||
|
||||
#line 149 "..\..\Views\Device\Export.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</div>\r\n");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -189,9 +189,4 @@
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (Authorization.Has(Claims.Device.Actions.Export)){
|
||||
<div class="actionBar">
|
||||
@Html.ActionLinkButton("Export All Devices", MVC.API.Device.ExportAllDevices())
|
||||
</div>
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.34011
|
||||
// Runtime Version:4.0.30319.34014
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
@@ -544,37 +544,6 @@ WriteLiteral(" </tbody>\r\n </table>\r\n </div>
|
||||
|
||||
#line 192 "..\..\Views\Device\ImportExport.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 193 "..\..\Views\Device\ImportExport.cshtml"
|
||||
if (Authorization.Has(Claims.Device.Actions.Export)){
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("<div");
|
||||
|
||||
WriteLiteral(" class=\"actionBar\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 195 "..\..\Views\Device\ImportExport.cshtml"
|
||||
Write(Html.ActionLinkButton("Export All Devices", MVC.API.Device.ExportAllDevices()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n</div>\r\n");
|
||||
|
||||
|
||||
#line 197 "..\..\Views\Device\ImportExport.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
@if (Authorization.HasAny(Claims.Device.Actions.Import, Claims.Device.Actions.Export, Claims.Device.Actions.EnrolDevices))
|
||||
{
|
||||
<div class="actionBar">
|
||||
@if (Authorization.HasAll(Claims.Device.Actions.Import, Claims.Device.Actions.Export))
|
||||
@if (Authorization.Has(Claims.Device.Actions.Import))
|
||||
{
|
||||
@Html.ActionLinkButton("Import/Export Devices", MVC.Device.ImportExport())
|
||||
}else if (Authorization.Has(Claims.Device.Actions.Import)){
|
||||
@Html.ActionLinkButton("Import Devices", MVC.Device.ImportExport())
|
||||
}else if (Authorization.Has(Claims.Device.Actions.Export)){
|
||||
@Html.ActionLinkButton("Export All Devices", MVC.API.Device.ExportAllDevices())
|
||||
}
|
||||
@if (Authorization.Has(Claims.Device.Actions.Export))
|
||||
{
|
||||
@Html.ActionLinkButton("Export Devices", MVC.Device.Export())
|
||||
}
|
||||
@if (Authorization.Has(Claims.Device.Actions.EnrolDevices))
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.34011
|
||||
// Runtime Version:4.0.30319.34014
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
@@ -107,7 +107,7 @@ WriteLiteral(">\r\n");
|
||||
#line hidden
|
||||
|
||||
#line 12 "..\..\Views\Device\Index.cshtml"
|
||||
if (Authorization.HasAll(Claims.Device.Actions.Import, Claims.Device.Actions.Export))
|
||||
if (Authorization.Has(Claims.Device.Actions.Import))
|
||||
{
|
||||
|
||||
|
||||
@@ -115,44 +115,39 @@ WriteLiteral(">\r\n");
|
||||
#line hidden
|
||||
|
||||
#line 14 "..\..\Views\Device\Index.cshtml"
|
||||
Write(Html.ActionLinkButton("Import/Export Devices", MVC.Device.ImportExport()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 14 "..\..\Views\Device\Index.cshtml"
|
||||
|
||||
}else if (Authorization.Has(Claims.Device.Actions.Import)){
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 16 "..\..\Views\Device\Index.cshtml"
|
||||
Write(Html.ActionLinkButton("Import Devices", MVC.Device.ImportExport()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 16 "..\..\Views\Device\Index.cshtml"
|
||||
#line 14 "..\..\Views\Device\Index.cshtml"
|
||||
|
||||
}else if (Authorization.Has(Claims.Device.Actions.Export)){
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 16 "..\..\Views\Device\Index.cshtml"
|
||||
if (Authorization.Has(Claims.Device.Actions.Export))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 18 "..\..\Views\Device\Index.cshtml"
|
||||
Write(Html.ActionLinkButton("Export All Devices", MVC.API.Device.ExportAllDevices()));
|
||||
Write(Html.ActionLinkButton("Export Devices", MVC.Device.Export()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 18 "..\..\Views\Device\Index.cshtml"
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user