feature: job exporting (resolves #155)
This commit is contained in:
@@ -693,6 +693,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
internal const string ExportSessionCacheKey = "DeviceExportContext_{0}";
|
||||
|
||||
[DiscoAuthorize(Claims.Device.Actions.Export)]
|
||||
[HttpPost, ValidateAntiForgeryToken]
|
||||
public virtual ActionResult Export(ExportModel Model)
|
||||
{
|
||||
if (Model == null || Model.Options == null)
|
||||
@@ -734,6 +735,9 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
if (context.Result == null || context.Result.Result == null)
|
||||
throw new ArgumentException("The export session is still running, or failed to complete successfully", "Id");
|
||||
|
||||
if (context.Result.RecordCount == 0)
|
||||
throw new ArgumentException("No records were found to export", nameof(Id));
|
||||
|
||||
var fileStream = context.Result.Result;
|
||||
|
||||
return this.File(fileStream.GetBuffer(), 0, (int)fileStream.Length, context.Result.MimeType, context.Result.Filename);
|
||||
|
||||
@@ -444,6 +444,9 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
if (context.Result == null || context.Result.Result == null)
|
||||
throw new ArgumentException("The export session is still running, or failed to complete successfully", nameof(Id));
|
||||
|
||||
if (context.Result.RecordCount == 0)
|
||||
throw new ArgumentException("No records were found to export", nameof(Id));
|
||||
|
||||
var fileStream = context.Result.Result;
|
||||
|
||||
return this.File(fileStream.GetBuffer(), 0, (int)fileStream.Length, context.Result.MimeType, context.Result.Filename);
|
||||
|
||||
@@ -1,18 +1,25 @@
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Models.Services.Job;
|
||||
using Disco.Models.Services.Jobs;
|
||||
using Disco.Models.Services.Jobs.Exporting;
|
||||
using Disco.Models.Services.Jobs.JobLists;
|
||||
using Disco.Services;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Exporting;
|
||||
using Disco.Services.Interop;
|
||||
using Disco.Services.Jobs.Exporting;
|
||||
using Disco.Services.Jobs.JobLists;
|
||||
using Disco.Services.Jobs.Statistics;
|
||||
using Disco.Services.Users;
|
||||
using Disco.Services.Web;
|
||||
using Disco.Web.Extensions;
|
||||
using Disco.Web.Models.Job;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Entity;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Caching;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace Disco.Web.Areas.API.Controllers
|
||||
@@ -2152,5 +2159,62 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
|
||||
return Json(results, JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
|
||||
#region Exporting
|
||||
internal const string ExportSessionCacheKey = "JobExportContext_{0}";
|
||||
|
||||
[DiscoAuthorize(Claims.Job.Actions.Export)]
|
||||
[HttpPost, ValidateAntiForgeryToken]
|
||||
public virtual ActionResult Export(ExportModel model)
|
||||
{
|
||||
if (model == null || model.Options == null)
|
||||
throw new ArgumentNullException(nameof(model));
|
||||
|
||||
// Write Options to Configuration
|
||||
Database.DiscoConfiguration.JobPreferences.LastExportOptions = model.Options;
|
||||
Database.SaveChanges();
|
||||
|
||||
// Start Export
|
||||
var exportContext = JobExportTask.ScheduleNow(model.Options);
|
||||
|
||||
// Store Export Context in Web Cache
|
||||
string key = string.Format(ExportSessionCacheKey, exportContext.TaskStatus.SessionId);
|
||||
HttpRuntime.Cache.Insert(key, exportContext, null, DateTime.Now.AddMinutes(60), Cache.NoSlidingExpiration, CacheItemPriority.NotRemovable, null);
|
||||
|
||||
// Set Task Finished Url
|
||||
var finishedActionResult = MVC.Job.Export(exportContext.TaskStatus.SessionId);
|
||||
exportContext.TaskStatus.SetFinishedUrl(Url.Action(finishedActionResult));
|
||||
|
||||
// Try waiting for completion
|
||||
if (exportContext.TaskStatus.WaitUntilFinished(TimeSpan.FromSeconds(2)))
|
||||
return RedirectToAction(finishedActionResult);
|
||||
else
|
||||
return RedirectToAction(MVC.Config.Logging.TaskStatus(exportContext.TaskStatus.SessionId));
|
||||
}
|
||||
|
||||
[DiscoAuthorize(Claims.Job.Actions.Export)]
|
||||
public virtual ActionResult ExportRetrieve(string id)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(id))
|
||||
throw new ArgumentNullException("Id");
|
||||
|
||||
string key = string.Format(ExportSessionCacheKey, id);
|
||||
var context = HttpRuntime.Cache.Get(key) as ExportTaskContext<JobExportOptions>;
|
||||
|
||||
if (context == null)
|
||||
throw new ArgumentException("The Id specified is invalid, or the export data expired (60 minutes)", nameof(id));
|
||||
|
||||
if (context.Result == null || context.Result.Result == null)
|
||||
throw new ArgumentException("The export session is still running, or failed to complete successfully", nameof(id));
|
||||
|
||||
if (context.Result.RecordCount == 0)
|
||||
throw new ArgumentException("No records were found to export", nameof(id));
|
||||
|
||||
var fileStream = context.Result.Result;
|
||||
|
||||
return this.File(fileStream.GetBuffer(), 0, (int)fileStream.Length, context.Result.MimeType, context.Result.Filename);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Disco.Models.Services.Job;
|
||||
using Disco.Models.Services.Jobs;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Jobs;
|
||||
using Disco.Services.Web;
|
||||
|
||||
@@ -449,6 +449,9 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
if (context.Result == null || context.Result.Result == null)
|
||||
throw new ArgumentException("The export session is still running, or failed to complete successfully", nameof(Id));
|
||||
|
||||
if (context.Result.RecordCount == 0)
|
||||
throw new ArgumentException("No records were found to export", nameof(Id));
|
||||
|
||||
var fileStream = context.Result.Result;
|
||||
|
||||
return this.File(fileStream.GetBuffer(), 0, (int)fileStream.Length, context.Result.MimeType, context.Result.Filename);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using Disco.Data.Repository;
|
||||
using Disco.Models.Services.Job;
|
||||
using Disco.Models.Services.Jobs;
|
||||
using Disco.Models.UI.Config.JobPreferences;
|
||||
using Disco.Services.Extensions;
|
||||
using System;
|
||||
|
||||
@@ -71,7 +71,8 @@
|
||||
@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>
|
||||
<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>
|
||||
@@ -80,7 +81,8 @@
|
||||
@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>
|
||||
<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>
|
||||
@@ -88,7 +90,8 @@
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
|
||||
}
|
||||
</table>
|
||||
</div>
|
||||
@@ -161,8 +164,15 @@
|
||||
@if (Model.ExportSessionId != null)
|
||||
{
|
||||
<div id="DeviceFlag_Export_Download_Dialog" class="dialog" title="Export Device Flags">
|
||||
<h4>@Model.ExportSessionResult.RecordCount record@(Model.ExportSessionResult.RecordCount != 1 ? "s" : null) were successfully exported.</h4>
|
||||
<a href="@Url.Action(MVC.API.DeviceFlag.ExportRetrieve(Model.ExportSessionId))" class="button"><i class="fa fa-download fa-lg"></i>Download Device Flag Export</a>
|
||||
@if (Model.ExportSessionResult.RecordCount == 0)
|
||||
{
|
||||
<h4>No records matched the filter criteria</h4>
|
||||
}
|
||||
else
|
||||
{
|
||||
<h4>@Model.ExportSessionResult.RecordCount record@(Model.ExportSessionResult.RecordCount != 1 ? "s" : null) were successfully exported.</h4>
|
||||
<a href="@Url.Action(MVC.API.DeviceFlag.ExportRetrieve(Model.ExportSessionId))" class="button"><i class="fa fa-download fa-lg"></i>Download Device Flag Export</a>
|
||||
}
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
@@ -402,32 +402,32 @@ WriteLiteral(" ");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("/><label");
|
||||
WriteLiteral(" /><label");
|
||||
|
||||
WriteAttribute("for", Tuple.Create(" for=\"", 4092), Tuple.Create("\"", 4130)
|
||||
, Tuple.Create(Tuple.Create("", 4098), Tuple.Create("Options_", 4098), true)
|
||||
WriteAttribute("for", Tuple.Create(" for=\"", 4093), Tuple.Create("\"", 4131)
|
||||
, Tuple.Create(Tuple.Create("", 4099), Tuple.Create("Options_", 4099), true)
|
||||
|
||||
#line 74 "..\..\Areas\Config\Views\DeviceFlag\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4106), Tuple.Create<System.Object, System.Int32>(optionItem.PropertyName
|
||||
, Tuple.Create(Tuple.Create("", 4107), Tuple.Create<System.Object, System.Int32>(optionItem.PropertyName
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 4106), false)
|
||||
, 4107), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 74 "..\..\Areas\Config\Views\DeviceFlag\Export.cshtml"
|
||||
Write(optionItem.DisplayName);
|
||||
Write(optionItem.DisplayName);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</label></li>\r\n");
|
||||
WriteLiteral("</label>\r\n </li>\r\n");
|
||||
|
||||
|
||||
#line 75 "..\..\Areas\Config\Views\DeviceFlag\Export.cshtml"
|
||||
#line 76 "..\..\Areas\Config\Views\DeviceFlag\Export.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -445,13 +445,13 @@ WriteLiteral(" class=\"none\"");
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 80 "..\..\Areas\Config\Views\DeviceFlag\Export.cshtml"
|
||||
#line 81 "..\..\Areas\Config\Views\DeviceFlag\Export.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 80 "..\..\Areas\Config\Views\DeviceFlag\Export.cshtml"
|
||||
#line 81 "..\..\Areas\Config\Views\DeviceFlag\Export.cshtml"
|
||||
foreach (var optionItem in optionFields.Skip(itemsPerColumn))
|
||||
{
|
||||
|
||||
@@ -460,40 +460,40 @@ WriteLiteral(">\r\n");
|
||||
#line hidden
|
||||
WriteLiteral(" <li");
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 4665), Tuple.Create("\"", 4696)
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 4720), Tuple.Create("\"", 4751)
|
||||
|
||||
#line 82 "..\..\Areas\Config\Views\DeviceFlag\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4673), Tuple.Create<System.Object, System.Int32>(optionItem.Description
|
||||
#line 83 "..\..\Areas\Config\Views\DeviceFlag\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4728), Tuple.Create<System.Object, System.Int32>(optionItem.Description
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 4673), false)
|
||||
, 4728), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n <input");
|
||||
|
||||
WriteLiteral(" type=\"checkbox\"");
|
||||
|
||||
WriteAttribute("id", Tuple.Create(" id=\"", 4778), Tuple.Create("\"", 4815)
|
||||
, Tuple.Create(Tuple.Create("", 4783), Tuple.Create("Options_", 4783), true)
|
||||
WriteAttribute("id", Tuple.Create(" id=\"", 4833), Tuple.Create("\"", 4870)
|
||||
, Tuple.Create(Tuple.Create("", 4838), Tuple.Create("Options_", 4838), true)
|
||||
|
||||
#line 83 "..\..\Areas\Config\Views\DeviceFlag\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4791), Tuple.Create<System.Object, System.Int32>(optionItem.PropertyName
|
||||
#line 84 "..\..\Areas\Config\Views\DeviceFlag\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4846), Tuple.Create<System.Object, System.Int32>(optionItem.PropertyName
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 4791), false)
|
||||
, 4846), false)
|
||||
);
|
||||
|
||||
WriteAttribute("name", Tuple.Create(" name=\"", 4816), Tuple.Create("\"", 4855)
|
||||
, Tuple.Create(Tuple.Create("", 4823), Tuple.Create("Options.", 4823), true)
|
||||
WriteAttribute("name", Tuple.Create(" name=\"", 4871), Tuple.Create("\"", 4910)
|
||||
, Tuple.Create(Tuple.Create("", 4878), Tuple.Create("Options.", 4878), true)
|
||||
|
||||
#line 83 "..\..\Areas\Config\Views\DeviceFlag\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4831), Tuple.Create<System.Object, System.Int32>(optionItem.PropertyName
|
||||
#line 84 "..\..\Areas\Config\Views\DeviceFlag\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4886), Tuple.Create<System.Object, System.Int32>(optionItem.PropertyName
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 4831), false)
|
||||
, 4886), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" value=\"true\"");
|
||||
@@ -501,38 +501,38 @@ WriteLiteral(" value=\"true\"");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 83 "..\..\Areas\Config\Views\DeviceFlag\Export.cshtml"
|
||||
#line 84 "..\..\Areas\Config\Views\DeviceFlag\Export.cshtml"
|
||||
Write(((bool)optionItem.Model) ? "checked " : null);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("/><label");
|
||||
WriteLiteral(" /><label");
|
||||
|
||||
WriteAttribute("for", Tuple.Create(" for=\"", 4925), Tuple.Create("\"", 4963)
|
||||
, Tuple.Create(Tuple.Create("", 4931), Tuple.Create("Options_", 4931), true)
|
||||
WriteAttribute("for", Tuple.Create(" for=\"", 4981), Tuple.Create("\"", 5019)
|
||||
, Tuple.Create(Tuple.Create("", 4987), Tuple.Create("Options_", 4987), true)
|
||||
|
||||
#line 83 "..\..\Areas\Config\Views\DeviceFlag\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4939), Tuple.Create<System.Object, System.Int32>(optionItem.PropertyName
|
||||
#line 84 "..\..\Areas\Config\Views\DeviceFlag\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4995), Tuple.Create<System.Object, System.Int32>(optionItem.PropertyName
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 4939), false)
|
||||
, 4995), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 83 "..\..\Areas\Config\Views\DeviceFlag\Export.cshtml"
|
||||
Write(optionItem.DisplayName);
|
||||
#line 84 "..\..\Areas\Config\Views\DeviceFlag\Export.cshtml"
|
||||
Write(optionItem.DisplayName);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</label></li>\r\n");
|
||||
WriteLiteral("</label>\r\n </li>\r\n");
|
||||
|
||||
|
||||
#line 84 "..\..\Areas\Config\Views\DeviceFlag\Export.cshtml"
|
||||
#line 86 "..\..\Areas\Config\Views\DeviceFlag\Export.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -544,11 +544,12 @@ WriteLiteral(@" </ul>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
");
|
||||
|
||||
|
||||
#line 92 "..\..\Areas\Config\Views\DeviceFlag\Export.cshtml"
|
||||
#line 94 "..\..\Areas\Config\Views\DeviceFlag\Export.cshtml"
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -590,7 +591,7 @@ WriteLiteral(" <script>\r\n $(function () {\r\n
|
||||
");\r\n });\r\n });\r\n </script>\r\n");
|
||||
|
||||
|
||||
#line 159 "..\..\Areas\Config\Views\DeviceFlag\Export.cshtml"
|
||||
#line 162 "..\..\Areas\Config\Views\DeviceFlag\Export.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -599,7 +600,7 @@ WriteLiteral(" <script>\r\n $(function () {\r\n
|
||||
WriteLiteral("</div>\r\n");
|
||||
|
||||
|
||||
#line 161 "..\..\Areas\Config\Views\DeviceFlag\Export.cshtml"
|
||||
#line 164 "..\..\Areas\Config\Views\DeviceFlag\Export.cshtml"
|
||||
if (Model.ExportSessionId != null)
|
||||
{
|
||||
|
||||
@@ -614,11 +615,38 @@ WriteLiteral(" class=\"dialog\"");
|
||||
|
||||
WriteLiteral(" title=\"Export Device Flags\"");
|
||||
|
||||
WriteLiteral(">\r\n <h4>");
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 164 "..\..\Areas\Config\Views\DeviceFlag\Export.cshtml"
|
||||
Write(Model.ExportSessionResult.RecordCount);
|
||||
#line 167 "..\..\Areas\Config\Views\DeviceFlag\Export.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 167 "..\..\Areas\Config\Views\DeviceFlag\Export.cshtml"
|
||||
if (Model.ExportSessionResult.RecordCount == 0)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <h4>No records matched the filter criteria</h4>\r\n");
|
||||
|
||||
|
||||
#line 170 "..\..\Areas\Config\Views\DeviceFlag\Export.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <h4>");
|
||||
|
||||
|
||||
#line 173 "..\..\Areas\Config\Views\DeviceFlag\Export.cshtml"
|
||||
Write(Model.ExportSessionResult.RecordCount);
|
||||
|
||||
|
||||
#line default
|
||||
@@ -626,22 +654,24 @@ WriteLiteral(">\r\n <h4>");
|
||||
WriteLiteral(" record");
|
||||
|
||||
|
||||
#line 164 "..\..\Areas\Config\Views\DeviceFlag\Export.cshtml"
|
||||
Write(Model.ExportSessionResult.RecordCount != 1 ? "s" : null);
|
||||
#line 173 "..\..\Areas\Config\Views\DeviceFlag\Export.cshtml"
|
||||
Write(Model.ExportSessionResult.RecordCount != 1 ? "s" : null);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" were successfully exported.</h4>\r\n <a");
|
||||
WriteLiteral(" were successfully exported.</h4>\r\n");
|
||||
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 8250), Tuple.Create("\"", 8326)
|
||||
WriteLiteral(" <a");
|
||||
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 8524), Tuple.Create("\"", 8600)
|
||||
|
||||
#line 165 "..\..\Areas\Config\Views\DeviceFlag\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 8257), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DeviceFlag.ExportRetrieve(Model.ExportSessionId))
|
||||
#line 174 "..\..\Areas\Config\Views\DeviceFlag\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 8531), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DeviceFlag.ExportRetrieve(Model.ExportSessionId))
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 8257), false)
|
||||
, 8531), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" class=\"button\"");
|
||||
@@ -650,7 +680,16 @@ WriteLiteral("><i");
|
||||
|
||||
WriteLiteral(" class=\"fa fa-download fa-lg\"");
|
||||
|
||||
WriteLiteral("></i>Download Device Flag Export</a>\r\n </div>\r\n");
|
||||
WriteLiteral("></i>Download Device Flag Export</a>\r\n");
|
||||
|
||||
|
||||
#line 175 "..\..\Areas\Config\Views\DeviceFlag\Export.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </div>\r\n");
|
||||
|
||||
WriteLiteral(@" <script>
|
||||
$(function () {
|
||||
@@ -667,7 +706,7 @@ WriteLiteral(@" <script>
|
||||
");
|
||||
|
||||
|
||||
#line 179 "..\..\Areas\Config\Views\DeviceFlag\Export.cshtml"
|
||||
#line 189 "..\..\Areas\Config\Views\DeviceFlag\Export.cshtml"
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -71,7 +71,8 @@
|
||||
@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>
|
||||
<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>
|
||||
@@ -80,7 +81,8 @@
|
||||
@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>
|
||||
<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>
|
||||
@@ -88,7 +90,8 @@
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
|
||||
}
|
||||
</table>
|
||||
</div>
|
||||
@@ -161,8 +164,15 @@
|
||||
@if (Model.ExportSessionId != null)
|
||||
{
|
||||
<div id="UserFlag_Export_Download_Dialog" class="dialog" title="Export User Flags">
|
||||
<h4>@Model.ExportSessionResult.RecordCount record@(Model.ExportSessionResult.RecordCount != 1 ? "s" : null) were successfully exported.</h4>
|
||||
<a href="@Url.Action(MVC.API.UserFlag.ExportRetrieve(Model.ExportSessionId))" class="button"><i class="fa fa-download fa-lg"></i>Download User Flag Export</a>
|
||||
@if (Model.ExportSessionResult.RecordCount == 0)
|
||||
{
|
||||
<h4>No records matched the filter criteria</h4>
|
||||
}
|
||||
else
|
||||
{
|
||||
<h4>@Model.ExportSessionResult.RecordCount record@(Model.ExportSessionResult.RecordCount != 1 ? "s" : null) were successfully exported.</h4>
|
||||
<a href="@Url.Action(MVC.API.UserFlag.ExportRetrieve(Model.ExportSessionId))" class="button"><i class="fa fa-download fa-lg"></i>Download User Flag Export</a>
|
||||
}
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
@@ -402,32 +402,32 @@ WriteLiteral(" ");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("/><label");
|
||||
WriteLiteral(" /><label");
|
||||
|
||||
WriteAttribute("for", Tuple.Create(" for=\"", 4084), Tuple.Create("\"", 4122)
|
||||
, Tuple.Create(Tuple.Create("", 4090), Tuple.Create("Options_", 4090), true)
|
||||
WriteAttribute("for", Tuple.Create(" for=\"", 4085), Tuple.Create("\"", 4123)
|
||||
, Tuple.Create(Tuple.Create("", 4091), Tuple.Create("Options_", 4091), true)
|
||||
|
||||
#line 74 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4098), Tuple.Create<System.Object, System.Int32>(optionItem.PropertyName
|
||||
, Tuple.Create(Tuple.Create("", 4099), Tuple.Create<System.Object, System.Int32>(optionItem.PropertyName
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 4098), false)
|
||||
, 4099), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 74 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
|
||||
Write(optionItem.DisplayName);
|
||||
Write(optionItem.DisplayName);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</label></li>\r\n");
|
||||
WriteLiteral("</label>\r\n </li>\r\n");
|
||||
|
||||
|
||||
#line 75 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
|
||||
#line 76 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -445,13 +445,13 @@ WriteLiteral(" class=\"none\"");
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 80 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
|
||||
#line 81 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 80 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
|
||||
#line 81 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
|
||||
foreach (var optionItem in optionFields.Skip(itemsPerColumn))
|
||||
{
|
||||
|
||||
@@ -460,40 +460,40 @@ WriteLiteral(">\r\n");
|
||||
#line hidden
|
||||
WriteLiteral(" <li");
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 4657), Tuple.Create("\"", 4688)
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 4712), Tuple.Create("\"", 4743)
|
||||
|
||||
#line 82 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4665), Tuple.Create<System.Object, System.Int32>(optionItem.Description
|
||||
#line 83 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4720), Tuple.Create<System.Object, System.Int32>(optionItem.Description
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 4665), false)
|
||||
, 4720), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n <input");
|
||||
|
||||
WriteLiteral(" type=\"checkbox\"");
|
||||
|
||||
WriteAttribute("id", Tuple.Create(" id=\"", 4770), Tuple.Create("\"", 4807)
|
||||
, Tuple.Create(Tuple.Create("", 4775), Tuple.Create("Options_", 4775), true)
|
||||
WriteAttribute("id", Tuple.Create(" id=\"", 4825), Tuple.Create("\"", 4862)
|
||||
, Tuple.Create(Tuple.Create("", 4830), Tuple.Create("Options_", 4830), true)
|
||||
|
||||
#line 83 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4783), Tuple.Create<System.Object, System.Int32>(optionItem.PropertyName
|
||||
#line 84 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4838), Tuple.Create<System.Object, System.Int32>(optionItem.PropertyName
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 4783), false)
|
||||
, 4838), false)
|
||||
);
|
||||
|
||||
WriteAttribute("name", Tuple.Create(" name=\"", 4808), Tuple.Create("\"", 4847)
|
||||
, Tuple.Create(Tuple.Create("", 4815), Tuple.Create("Options.", 4815), true)
|
||||
WriteAttribute("name", Tuple.Create(" name=\"", 4863), Tuple.Create("\"", 4902)
|
||||
, Tuple.Create(Tuple.Create("", 4870), Tuple.Create("Options.", 4870), true)
|
||||
|
||||
#line 83 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4823), Tuple.Create<System.Object, System.Int32>(optionItem.PropertyName
|
||||
#line 84 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4878), Tuple.Create<System.Object, System.Int32>(optionItem.PropertyName
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 4823), false)
|
||||
, 4878), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" value=\"true\"");
|
||||
@@ -501,38 +501,38 @@ WriteLiteral(" value=\"true\"");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 83 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
|
||||
#line 84 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
|
||||
Write(((bool)optionItem.Model) ? "checked " : null);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("/><label");
|
||||
WriteLiteral(" /><label");
|
||||
|
||||
WriteAttribute("for", Tuple.Create(" for=\"", 4917), Tuple.Create("\"", 4955)
|
||||
, Tuple.Create(Tuple.Create("", 4923), Tuple.Create("Options_", 4923), true)
|
||||
WriteAttribute("for", Tuple.Create(" for=\"", 4973), Tuple.Create("\"", 5011)
|
||||
, Tuple.Create(Tuple.Create("", 4979), Tuple.Create("Options_", 4979), true)
|
||||
|
||||
#line 83 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4931), Tuple.Create<System.Object, System.Int32>(optionItem.PropertyName
|
||||
#line 84 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4987), Tuple.Create<System.Object, System.Int32>(optionItem.PropertyName
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 4931), false)
|
||||
, 4987), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 83 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
|
||||
Write(optionItem.DisplayName);
|
||||
#line 84 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
|
||||
Write(optionItem.DisplayName);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</label></li>\r\n");
|
||||
WriteLiteral("</label>\r\n </li>\r\n");
|
||||
|
||||
|
||||
#line 84 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
|
||||
#line 86 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -544,11 +544,12 @@ WriteLiteral(@" </ul>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
");
|
||||
|
||||
|
||||
#line 92 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
|
||||
#line 94 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -590,7 +591,7 @@ WriteLiteral(" <script>\r\n $(function () {\r\n
|
||||
" });\r\n });\r\n </script>\r\n");
|
||||
|
||||
|
||||
#line 159 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
|
||||
#line 162 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -599,7 +600,7 @@ WriteLiteral(" <script>\r\n $(function () {\r\n
|
||||
WriteLiteral("</div>\r\n");
|
||||
|
||||
|
||||
#line 161 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
|
||||
#line 164 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
|
||||
if (Model.ExportSessionId != null)
|
||||
{
|
||||
|
||||
@@ -614,11 +615,38 @@ WriteLiteral(" class=\"dialog\"");
|
||||
|
||||
WriteLiteral(" title=\"Export User Flags\"");
|
||||
|
||||
WriteLiteral(">\r\n <h4>");
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 164 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
|
||||
Write(Model.ExportSessionResult.RecordCount);
|
||||
#line 167 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 167 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
|
||||
if (Model.ExportSessionResult.RecordCount == 0)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <h4>No records matched the filter criteria</h4>\r\n");
|
||||
|
||||
|
||||
#line 170 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <h4>");
|
||||
|
||||
|
||||
#line 173 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
|
||||
Write(Model.ExportSessionResult.RecordCount);
|
||||
|
||||
|
||||
#line default
|
||||
@@ -626,22 +654,24 @@ WriteLiteral(">\r\n <h4>");
|
||||
WriteLiteral(" record");
|
||||
|
||||
|
||||
#line 164 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
|
||||
Write(Model.ExportSessionResult.RecordCount != 1 ? "s" : null);
|
||||
#line 173 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
|
||||
Write(Model.ExportSessionResult.RecordCount != 1 ? "s" : null);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" were successfully exported.</h4>\r\n <a");
|
||||
WriteLiteral(" were successfully exported.</h4>\r\n");
|
||||
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 8226), Tuple.Create("\"", 8300)
|
||||
WriteLiteral(" <a");
|
||||
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 8500), Tuple.Create("\"", 8574)
|
||||
|
||||
#line 165 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 8233), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.UserFlag.ExportRetrieve(Model.ExportSessionId))
|
||||
#line 174 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 8507), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.UserFlag.ExportRetrieve(Model.ExportSessionId))
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 8233), false)
|
||||
, 8507), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" class=\"button\"");
|
||||
@@ -650,7 +680,16 @@ WriteLiteral("><i");
|
||||
|
||||
WriteLiteral(" class=\"fa fa-download fa-lg\"");
|
||||
|
||||
WriteLiteral("></i>Download User Flag Export</a>\r\n </div>\r\n");
|
||||
WriteLiteral("></i>Download User Flag Export</a>\r\n");
|
||||
|
||||
|
||||
#line 175 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </div>\r\n");
|
||||
|
||||
WriteLiteral(@" <script>
|
||||
$(function () {
|
||||
@@ -667,7 +706,7 @@ WriteLiteral(@" <script>
|
||||
");
|
||||
|
||||
|
||||
#line 179 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
|
||||
#line 189 "..\..\Areas\Config\Views\UserFlag\Export.cshtml"
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user