qol: use unified exporting for logs
This commit is contained in:
@@ -402,6 +402,7 @@
|
||||
<Compile Include="Jobs\Statistics\DailyOpenedClosed.cs" />
|
||||
<Compile Include="Logging\LogBase.cs" />
|
||||
<Compile Include="Logging\LogContext.cs" />
|
||||
<Compile Include="Logging\LogExport.cs" />
|
||||
<Compile Include="Logging\LogReInitalizeJob.cs" />
|
||||
<Compile Include="Logging\Models\LogEvent.cs" />
|
||||
<Compile Include="Logging\Models\LogEventType.cs" />
|
||||
|
||||
@@ -15,9 +15,6 @@ namespace Disco.Services
|
||||
{
|
||||
public static ExportResult WriteExport<T>(IExportOptions options, IScheduledTaskStatus status, List<ExportFieldMetadata<T>> metadata, List<T> records) where T : IExportRecord
|
||||
{
|
||||
if (records.Count == 0)
|
||||
return new ExportResult();
|
||||
|
||||
var filenameWithoutExtension = $"{options.FilenamePrefix}-{status.StartedTimestamp.Value:yyyyMMdd-HHmmss}";
|
||||
MemoryStream stream;
|
||||
string filename;
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
using Disco.Models.Exporting;
|
||||
using Disco.Models.Services.Exporting;
|
||||
using Disco.Services.Logging.Models;
|
||||
using Disco.Services.Tasks;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Disco.Services.Logging
|
||||
{
|
||||
using Metadata = ExportFieldMetadata<LogLiveEvent>;
|
||||
|
||||
public static class LogExport
|
||||
{
|
||||
public static ExportResult GenerateExport(ExportFormat format, List<LogLiveEvent> records)
|
||||
{
|
||||
var options = new LogExportOptions(format);
|
||||
|
||||
const string DateFormat = "yyyy-MM-dd";
|
||||
const string DateTimeFormat = DateFormat + " HH:mm:ss";
|
||||
Func<object, string> csvStringEncoded = (o) => o == null ? null : $"\"{((string)o).Replace("\"", "\"\"")}\"";
|
||||
Func<object, string> csvToStringEncoded = (o) => o == null ? null : o.ToString();
|
||||
Func<object, string> csvCurrencyEncoded = (o) => ((decimal?)o).HasValue ? ((decimal?)o).Value.ToString("C") : null;
|
||||
Func<object, string> csvDateEncoded = (o) => ((DateTime)o).ToString(DateFormat);
|
||||
Func<object, string> csvDateTimeEncoded = (o) => ((DateTime)o).ToString(DateTimeFormat);
|
||||
Func<object, string> csvNullableDateEncoded = (o) => ((DateTime?)o).HasValue ? csvDateEncoded(o) : null;
|
||||
Func<object, string> csvNullableDateTimeEncoded = (o) => ((DateTime?)o).HasValue ? csvDateTimeEncoded(o) : null;
|
||||
|
||||
var metadata = new List<Metadata>
|
||||
{
|
||||
new Metadata(nameof(LogLiveEvent.Timestamp), nameof(LogLiveEvent.Timestamp), typeof(DateTime), e => e.Timestamp, csvDateTimeEncoded),
|
||||
new Metadata(nameof(LogLiveEvent.ModuleId), nameof(LogLiveEvent.ModuleId), typeof(int), e => e.ModuleId, csvToStringEncoded),
|
||||
new Metadata(nameof(LogLiveEvent.ModuleName), nameof(LogLiveEvent.ModuleName), typeof(string), e => e.ModuleName, csvStringEncoded),
|
||||
new Metadata(nameof(LogLiveEvent.ModuleDescription), nameof(LogLiveEvent.ModuleDescription), typeof(string), e => e.ModuleDescription, csvStringEncoded),
|
||||
new Metadata(nameof(LogLiveEvent.EventTypeId), nameof(LogLiveEvent.EventTypeId), typeof(int), e => e.EventTypeId, csvToStringEncoded),
|
||||
new Metadata(nameof(LogLiveEvent.EventTypeName), nameof(LogLiveEvent.EventTypeName), typeof(string), e => e.EventTypeName, csvStringEncoded),
|
||||
new Metadata("Severity", "Severity", typeof(string), e => e.EventTypeSeverity, csvToStringEncoded),
|
||||
new Metadata("Message", "Message", typeof(string), e => e.FormattedMessage, csvStringEncoded),
|
||||
};
|
||||
if (records.Count > 0)
|
||||
{
|
||||
var argCount = records.Max(r => r.Arguments?.Length ?? 0);
|
||||
for (var i = 0; i < argCount; i++)
|
||||
{
|
||||
var index = i;
|
||||
var name = $"Data{i + 1:00}";
|
||||
metadata.Add(new Metadata(name, name, typeof(string), e => (e.Arguments?.Length ?? 0) > index ? (e.Arguments[index] ?? "null") : null, csvStringEncoded));
|
||||
}
|
||||
}
|
||||
|
||||
return ExportHelpers.WriteExport(options, ScheduledTaskMockStatus.Create("Export Disco ICT Logs"), metadata, records);
|
||||
}
|
||||
}
|
||||
|
||||
public class LogExportOptions : IExportOptions
|
||||
{
|
||||
public ExportFormat Format { get; set; }
|
||||
public string FilenamePrefix { get; } = "DiscoIctLogs";
|
||||
public string ExcelWorksheetName { get; set; } = "Disco ICT Logs";
|
||||
public string ExcelTableName { get; set; } = "DiscoIctLogs";
|
||||
|
||||
public LogExportOptions(ExportFormat format)
|
||||
{
|
||||
Format = format;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,10 @@
|
||||
using System;
|
||||
using Disco.Models.Exporting;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Disco.Services.Logging.Models
|
||||
{
|
||||
public class LogLiveEvent
|
||||
public class LogLiveEvent : IExportRecord
|
||||
{
|
||||
public int ModuleId { get; set; }
|
||||
public string ModuleName { get; set; }
|
||||
|
||||
@@ -11,56 +11,6 @@ namespace Disco.Services.Logging
|
||||
public static class Utilities
|
||||
{
|
||||
|
||||
public const string LogEventCSVHeader = "Timestamp,ModuleId,ModuleName,ModuleDescription,EventTypeId,EventTypeName,Severity,Message";
|
||||
public static void ToCsvLine(this Models.LogLiveEvent e, TextWriter writer)
|
||||
{
|
||||
writer.Write(e.Timestamp.ToString("yyy-MM-dd HH:mm:ss"));
|
||||
writer.Write(",");
|
||||
writer.Write(e.ModuleId);
|
||||
writer.Write(",\"");
|
||||
writer.Write(e.ModuleName);
|
||||
writer.Write("\",\"");
|
||||
writer.Write(e.ModuleDescription);
|
||||
writer.Write("\",");
|
||||
writer.Write(e.EventTypeId);
|
||||
writer.Write(",\"");
|
||||
writer.Write(e.EventTypeName);
|
||||
writer.Write("\",");
|
||||
writer.Write(e.EventTypeSeverity);
|
||||
writer.Write(",\"");
|
||||
writer.Write(e.FormattedMessage.Replace("\"", "'"));
|
||||
writer.Write("\"");
|
||||
if (e.Arguments != null)
|
||||
{
|
||||
foreach (var arg in e.Arguments)
|
||||
{
|
||||
writer.Write(",\"");
|
||||
if (arg == null)
|
||||
writer.Write("null");
|
||||
else
|
||||
writer.Write(arg.ToString().Replace("\"", "'"));
|
||||
writer.Write("\"");
|
||||
}
|
||||
}
|
||||
writer.WriteLine();
|
||||
}
|
||||
public static MemoryStream ToCsv(this List<Models.LogLiveEvent> e)
|
||||
{
|
||||
var ms = new MemoryStream();
|
||||
StreamWriter sw = new StreamWriter(ms);
|
||||
sw.WriteLine(LogEventCSVHeader);
|
||||
if (e != null)
|
||||
{
|
||||
foreach (var le in e)
|
||||
{
|
||||
le.ToCsvLine(sw);
|
||||
}
|
||||
}
|
||||
sw.Flush();
|
||||
ms.Position = 0;
|
||||
return ms;
|
||||
}
|
||||
|
||||
public static List<SelectListItem> ToSelectListItems(this List<Models.LogEventType> items)
|
||||
{
|
||||
return items.Select(et => new SelectListItem() { Value = et.Id.ToString(), Text = et.Name }).ToList();
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Models.Exporting;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Logging;
|
||||
using Disco.Services.Tasks;
|
||||
using Disco.Services.Web;
|
||||
@@ -19,7 +20,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
return Json(m, JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
|
||||
[DiscoAuthorize(Claims.Config.Logging.Show)]
|
||||
[HttpPost, ValidateAntiForgeryToken, DiscoAuthorize(Claims.Config.Logging.Show)]
|
||||
public virtual ActionResult RetrieveEvents(string Format, DateTime? Start = null, DateTime? End = null, int? ModuleId = null, List<int> EventTypeIds = null, int? Take = null)
|
||||
{
|
||||
var logRetriever = new ReadLogContext()
|
||||
@@ -32,22 +33,20 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
};
|
||||
var results = logRetriever.Query(Database);
|
||||
|
||||
var exportFormat = ExportFormat.Xlsx;
|
||||
|
||||
switch (Format.ToLower())
|
||||
{
|
||||
case "json":
|
||||
{
|
||||
return Json(results, JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
case "csv":
|
||||
{
|
||||
return File(results.ToCsv(), "text/csv", "DiscoLogs.csv");
|
||||
}
|
||||
default:
|
||||
{
|
||||
throw new ArgumentException("Unknown Format", "Format");
|
||||
}
|
||||
exportFormat = ExportFormat.Csv;
|
||||
break;
|
||||
}
|
||||
|
||||
var export = LogExport.GenerateExport(exportFormat, results);
|
||||
|
||||
return File(export.Result, export.MimeType, export.Filename);
|
||||
}
|
||||
|
||||
public virtual ActionResult ScheduledTaskStatus(string id)
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
<h2>Documents Imported Today
|
||||
</h2>
|
||||
<div id="importStatus">
|
||||
@Html.AntiForgeryToken()
|
||||
<div id="noSessions" data-bind="visible: noSessions">
|
||||
<h3>No imported documents today</h3>
|
||||
</div>
|
||||
@@ -280,7 +281,8 @@
|
||||
Start: d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate(),
|
||||
End: null,
|
||||
ModuleId: 40,
|
||||
Take: 2000
|
||||
Take: 2000,
|
||||
'__RequestVerificationToken': host.find('input[name="__RequestVerificationToken"]').val()
|
||||
};
|
||||
$.ajax({
|
||||
url: '@(Url.Action(MVC.API.Logging.RetrieveEvents()))',
|
||||
|
||||
@@ -59,7 +59,18 @@ WriteLiteral("\r\n<h2>Documents Imported Today\r\n</h2>\r\n<div");
|
||||
|
||||
WriteLiteral(" id=\"importStatus\"");
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 11 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
|
||||
Write(Html.AntiForgeryToken());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n <div");
|
||||
|
||||
WriteLiteral(" id=\"noSessions\"");
|
||||
|
||||
@@ -276,7 +287,7 @@ WriteLiteral(">\r\n $(function () {\r\n var vm;\r\n var host =
|
||||
"var urlDeviceShow = \'");
|
||||
|
||||
|
||||
#line 103 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
|
||||
#line 104 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
|
||||
Write(Url.Action(MVC.Device.Show()));
|
||||
|
||||
|
||||
@@ -285,7 +296,7 @@ WriteLiteral(">\r\n $(function () {\r\n var vm;\r\n var host =
|
||||
WriteLiteral("/\'\r\n var urlJobShow = \'");
|
||||
|
||||
|
||||
#line 104 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
|
||||
#line 105 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
|
||||
Write(Url.Action(MVC.Job.Show()));
|
||||
|
||||
|
||||
@@ -294,7 +305,7 @@ WriteLiteral("/\'\r\n var urlJobShow = \'");
|
||||
WriteLiteral("/\'\r\n var urlUserShow = \'");
|
||||
|
||||
|
||||
#line 105 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
|
||||
#line 106 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
|
||||
Write(Url.Action(MVC.User.Show()));
|
||||
|
||||
|
||||
@@ -303,7 +314,7 @@ WriteLiteral("/\'\r\n var urlUserShow = \'");
|
||||
WriteLiteral("/\'\r\n var urlPageThumbnail = \'");
|
||||
|
||||
|
||||
#line 106 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
|
||||
#line 107 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
|
||||
Write(Url.Action(MVC.API.DocumentTemplate.ImporterThumbnail()));
|
||||
|
||||
|
||||
@@ -312,7 +323,7 @@ WriteLiteral("/\'\r\n var urlPageThumbnail = \'");
|
||||
WriteLiteral("/\'\r\n var urlDocumentTemplate = \'");
|
||||
|
||||
|
||||
#line 107 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
|
||||
#line 108 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
|
||||
Write(Url.Action(MVC.Config.DocumentTemplate.Index()));
|
||||
|
||||
|
||||
@@ -321,7 +332,7 @@ WriteLiteral("/\'\r\n var urlDocumentTemplate = \'");
|
||||
WriteLiteral("/\';\r\n var urlManuallyAssign = \'");
|
||||
|
||||
|
||||
#line 108 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
|
||||
#line 109 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
|
||||
Write(Url.Action(MVC.Config.DocumentTemplate.UndetectedPages()));
|
||||
|
||||
|
||||
@@ -428,11 +439,12 @@ WriteLiteral("\';\r\n var isLive = false;\r\n\r\n function pageVie
|
||||
"l();\r\n\r\n // Load Logs\r\n var d = new Date();\r\n v" +
|
||||
"ar loadData = {\r\n Format: \"json\",\r\n Start: d.getFu" +
|
||||
"llYear() + \'-\' + (d.getMonth() + 1) + \'-\' + d.getDate(),\r\n End: n" +
|
||||
"ull,\r\n ModuleId: 40,\r\n Take: 2000\r\n };\r" +
|
||||
"\n $.ajax({\r\n url: \'");
|
||||
"ull,\r\n ModuleId: 40,\r\n Take: 2000,\r\n " +
|
||||
" \'__RequestVerificationToken\': host.find(\'input[name=\"__RequestVerificationToke" +
|
||||
"n\"]\').val()\r\n };\r\n $.ajax({\r\n url: \'");
|
||||
|
||||
|
||||
#line 286 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
|
||||
#line 288 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
|
||||
Write(Url.Action(MVC.API.Logging.RetrieveEvents()));
|
||||
|
||||
|
||||
@@ -464,7 +476,7 @@ WriteLiteral(@"',
|
||||
$.connection.hub.qs = { LogModules: '");
|
||||
|
||||
|
||||
#line 309 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
|
||||
#line 311 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
|
||||
Write(Disco.Services.Documents.DocumentsLog.Current.LiveLogGroupName);
|
||||
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-Isotope");
|
||||
}
|
||||
<div id="enrolStatus">
|
||||
@Html.AntiForgeryToken();
|
||||
<div id="noSessions" data-bind="visible: noSessions">
|
||||
<h2>No enrollment sessions today</h2>
|
||||
</div>
|
||||
@@ -16,7 +17,7 @@
|
||||
<span data-bind="text: title"></span>
|
||||
<span class="details" data-bind="text: '(' + deviceModelDescription() + ')'"></span>
|
||||
<span class="pending" data-bind="visible: isPending"><code data-bind="text: pendingIdentifier"></code> <i class="fa fa-exclamation-circle"></i></span>
|
||||
|
||||
|
||||
</h3>
|
||||
<p class="sessionStart" data-bind="text: startTime"></p>
|
||||
<p class="sessionStatus" data-bind="text: progressStatus"></p>
|
||||
@@ -337,7 +338,8 @@
|
||||
Start: d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate(),
|
||||
End: null,
|
||||
ModuleId: 50,
|
||||
Take: 2000
|
||||
Take: 2000,
|
||||
'__RequestVerificationToken': host.find('input[name="__RequestVerificationToken"]').val()
|
||||
};
|
||||
$.ajax({
|
||||
url: '@(Url.Action(MVC.API.Logging.RetrieveEvents()))',
|
||||
|
||||
@@ -60,7 +60,18 @@ WriteLiteral("\r\n<div");
|
||||
|
||||
WriteLiteral(" id=\"enrolStatus\"");
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 10 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
|
||||
Write(Html.AntiForgeryToken());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(";\r\n <div");
|
||||
|
||||
WriteLiteral(" id=\"noSessions\"");
|
||||
|
||||
@@ -105,7 +116,7 @@ WriteLiteral("></code> <i");
|
||||
|
||||
WriteLiteral(" class=\"fa fa-exclamation-circle\"");
|
||||
|
||||
WriteLiteral("></i></span>\r\n \r\n </h3>\r\n <p");
|
||||
WriteLiteral("></i></span>\r\n\r\n </h3>\r\n <p");
|
||||
|
||||
WriteLiteral(" class=\"sessionStart\"");
|
||||
|
||||
@@ -160,13 +171,13 @@ WriteLiteral(" data-bind=\"visible: isPending\"");
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 32 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
|
||||
#line 33 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 32 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
|
||||
#line 33 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
|
||||
using (Html.BeginForm(MVC.API.Enrollment.ResolveSessionPending(), FormMethod.Post))
|
||||
{
|
||||
|
||||
@@ -180,20 +191,20 @@ WriteLiteral(" data-bind=\"text: pendingIdentifier\"");
|
||||
WriteLiteral("></code>\r\n");
|
||||
|
||||
|
||||
#line 35 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
|
||||
#line 36 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 35 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
|
||||
#line 36 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
|
||||
Write(Html.AntiForgeryToken());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 35 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
|
||||
#line 36 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
|
||||
;
|
||||
|
||||
|
||||
@@ -246,7 +257,7 @@ WriteLiteral(" class=\"button\"");
|
||||
WriteLiteral(">Reject</button>\r\n </div>\r\n");
|
||||
|
||||
|
||||
#line 44 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
|
||||
#line 45 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -426,7 +437,7 @@ WriteLiteral(@">
|
||||
var deviceBaseUrl = '");
|
||||
|
||||
|
||||
#line 124 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
|
||||
#line 125 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
|
||||
Write(Url.Action(MVC.Device.Show()));
|
||||
|
||||
|
||||
@@ -435,7 +446,7 @@ WriteLiteral(@">
|
||||
WriteLiteral("/\'\r\n var deviceModelImageUrl = \'");
|
||||
|
||||
|
||||
#line 125 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
|
||||
#line 126 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
|
||||
Write(Url.Action(MVC.API.DeviceModel.Image()));
|
||||
|
||||
|
||||
@@ -444,7 +455,7 @@ WriteLiteral("/\'\r\n var deviceModelImageUrl = \'");
|
||||
WriteLiteral("/\'\r\n var iconWarningUrl = \'url(");
|
||||
|
||||
|
||||
#line 126 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
|
||||
#line 127 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
|
||||
Write(Links.ClientSource.Style.Images.Status.warning32_png);
|
||||
|
||||
|
||||
@@ -453,7 +464,7 @@ WriteLiteral("/\'\r\n var iconWarningUrl = \'url(");
|
||||
WriteLiteral(")\';\r\n var iconErrorUrl = \'url(");
|
||||
|
||||
|
||||
#line 127 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
|
||||
#line 128 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
|
||||
Write(Links.ClientSource.Style.Images.Status.fail32_png);
|
||||
|
||||
|
||||
@@ -576,7 +587,7 @@ WriteLiteral(")\';\r\n\r\n function pageViewModel() {\r\n var
|
||||
" url: \'");
|
||||
|
||||
|
||||
#line 318 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
|
||||
#line 319 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
|
||||
Write(Url.Action(MVC.API.DeviceModel.Index()));
|
||||
|
||||
|
||||
@@ -604,13 +615,14 @@ WriteLiteral(@"',
|
||||
Start: d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate(),
|
||||
End: null,
|
||||
ModuleId: 50,
|
||||
Take: 2000
|
||||
Take: 2000,
|
||||
'__RequestVerificationToken': host.find('input[name=""__RequestVerificationToken""]').val()
|
||||
};
|
||||
$.ajax({
|
||||
url: '");
|
||||
|
||||
|
||||
#line 343 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
|
||||
#line 345 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
|
||||
Write(Url.Action(MVC.API.Logging.RetrieveEvents()));
|
||||
|
||||
|
||||
@@ -649,7 +661,7 @@ WriteLiteral(@"',
|
||||
$.connection.hub.qs = { LogModules: '");
|
||||
|
||||
|
||||
#line 373 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
|
||||
#line 375 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
|
||||
Write(Disco.Services.Devices.Enrolment.EnrolmentLog.Current.LiveLogGroupName);
|
||||
|
||||
|
||||
|
||||
@@ -4,31 +4,43 @@
|
||||
Authorization.Require(Claims.Config.Logging.Show);
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Logging");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/jQueryUI-TimePicker");
|
||||
}
|
||||
@using (Html.BeginForm(MVC.API.Logging.RetrieveEvents()))
|
||||
{
|
||||
{
|
||||
@Html.AntiForgeryToken()
|
||||
<div class="form" style="width: 520px;">
|
||||
<h2>Export Logs</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<th style="width: 105px;">Start Filter
|
||||
<th>Format</th>
|
||||
<td>
|
||||
<select name="Format">
|
||||
<option value="xlsx" selected>Xlsx</option>
|
||||
<option value="csv">CSV</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 105px;">
|
||||
Start Filter
|
||||
</th>
|
||||
<td>
|
||||
<input id="filterStart" type="text" name="Start" />
|
||||
<input id="filterStart" type="datetime-local" value="@(DateTime.Today.ToString("yyyy-MM-dd"))T00:00" name="Start" />
|
||||
<span class="smallMessage">* Optional</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>End Filter
|
||||
<th>
|
||||
End Filter
|
||||
</th>
|
||||
<td>
|
||||
<input id="filterEnd" type="text" name="End" />
|
||||
<input id="filterEnd" type="datetime-local" name="End" />
|
||||
<span class="smallMessage">* Optional</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Limit Filter
|
||||
<th>
|
||||
Limit Filter
|
||||
</th>
|
||||
<td>
|
||||
<select name="Take">
|
||||
@@ -42,21 +54,26 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Module Filter
|
||||
<th>
|
||||
Module Filter
|
||||
</th>
|
||||
<td>
|
||||
<select id="moduleId" name="ModuleId">
|
||||
<option value="" selected="selected">- All Modules -</option>
|
||||
@foreach (var lm in Model.LogModules.Keys.OrderBy(lm => lm.ModuleDescription))
|
||||
{
|
||||
<option value="@lm.ModuleId">@lm.ModuleDescription</option>
|
||||
<option value="@lm.ModuleId">@lm.ModuleDescription</option>
|
||||
|
||||
}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="trLogModuleEventTypes" style="display: none">
|
||||
<th>Event Type Filter <span style="display: block;" class="checkboxBulkSelectContainer">Select: <a id="eventTypesSelectAll" href="#">ALL</a> | <a id="eventTypesSelectNone"
|
||||
href="#">NONE</a></span>
|
||||
<th>
|
||||
Event Type Filter <span style="display: block;" class="checkboxBulkSelectContainer">
|
||||
Select: <a id="eventTypesSelectAll" href="#">ALL</a> | <a id="eventTypesSelectNone"
|
||||
href="#">NONE</a>
|
||||
</span>
|
||||
</th>
|
||||
<td>
|
||||
@{int uniqueIdSeed = 0;
|
||||
@@ -70,30 +87,12 @@
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td>
|
||||
@Html.Hidden("Format", "CSV")
|
||||
<input type="submit" class="button" value="Download CSV" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p class="actions">
|
||||
<input type="submit" class="button" value="Export" />
|
||||
</p>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var filterStart = $('#filterStart').watermark('Start').datetimepicker({
|
||||
ampm: true,
|
||||
stepMinute: 1,
|
||||
changeYear: true,
|
||||
changeMonth: true,
|
||||
dateFormat: 'yy/mm/dd'
|
||||
});
|
||||
var filterEnd = $('#filterEnd').watermark('End').datetimepicker({
|
||||
ampm: true,
|
||||
stepMinute: 1,
|
||||
changeYear: true,
|
||||
changeMonth: true,
|
||||
dateFormat: 'yy/mm/dd'
|
||||
});
|
||||
var moduleId = $('#moduleId');
|
||||
var trLogModuleEventTypes = $('#trLogModuleEventTypes');
|
||||
var logModuleEventTypes = trLogModuleEventTypes.find('.logModuleEventTypes').hide();
|
||||
|
||||
@@ -55,7 +55,6 @@ namespace Disco.Web.Areas.Config.Views.Logging
|
||||
Authorization.Require(Claims.Config.Logging.Show);
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Logging");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/jQueryUI-TimePicker");
|
||||
|
||||
|
||||
#line default
|
||||
@@ -63,9 +62,23 @@ namespace Disco.Web.Areas.Config.Views.Logging
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
|
||||
#line 9 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
#line 8 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
using (Html.BeginForm(MVC.API.Logging.RetrieveEvents()))
|
||||
{
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 10 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
Write(Html.AntiForgeryToken());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 10 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
@@ -77,16 +90,40 @@ WriteLiteral(" class=\"form\"");
|
||||
WriteLiteral(" style=\"width: 520px;\"");
|
||||
|
||||
WriteLiteral(">\r\n <h2>Export Logs</h2>\r\n <table>\r\n <tr>\r\n " +
|
||||
" <th");
|
||||
" <th>Format</th>\r\n <td>\r\n <select");
|
||||
|
||||
WriteLiteral(" name=\"Format\"");
|
||||
|
||||
WriteLiteral(">\r\n <option");
|
||||
|
||||
WriteLiteral(" value=\"xlsx\"");
|
||||
|
||||
WriteLiteral(" selected>Xlsx</option>\r\n <option");
|
||||
|
||||
WriteLiteral(" value=\"csv\"");
|
||||
|
||||
WriteLiteral(">CSV</option>\r\n </select>\r\n </td>\r\n " +
|
||||
"</tr>\r\n <tr>\r\n <th");
|
||||
|
||||
WriteLiteral(" style=\"width: 105px;\"");
|
||||
|
||||
WriteLiteral(">Start Filter\r\n </th>\r\n <td>\r\n <" +
|
||||
"input");
|
||||
WriteLiteral(">\r\n Start Filter\r\n </th>\r\n <td>\r" +
|
||||
"\n <input");
|
||||
|
||||
WriteLiteral(" id=\"filterStart\"");
|
||||
|
||||
WriteLiteral(" type=\"text\"");
|
||||
WriteLiteral(" type=\"datetime-local\"");
|
||||
|
||||
WriteAttribute("value", Tuple.Create(" value=\"", 956), Tuple.Create("\"", 1010)
|
||||
|
||||
#line 28 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 964), Tuple.Create<System.Object, System.Int32>(DateTime.Today.ToString("yyyy-MM-dd")
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 964), false)
|
||||
, Tuple.Create(Tuple.Create("", 1004), Tuple.Create("T00:00", 1004), true)
|
||||
);
|
||||
|
||||
WriteLiteral(" name=\"Start\"");
|
||||
|
||||
@@ -95,12 +132,12 @@ WriteLiteral(" />\r\n <span");
|
||||
WriteLiteral(" class=\"smallMessage\"");
|
||||
|
||||
WriteLiteral(">* Optional</span>\r\n </td>\r\n </tr>\r\n <tr>\r\n " +
|
||||
" <th>End Filter\r\n </th>\r\n <td>\r\n " +
|
||||
" <input");
|
||||
" <th>\r\n End Filter\r\n </th>\r\n " +
|
||||
" <td>\r\n <input");
|
||||
|
||||
WriteLiteral(" id=\"filterEnd\"");
|
||||
|
||||
WriteLiteral(" type=\"text\"");
|
||||
WriteLiteral(" type=\"datetime-local\"");
|
||||
|
||||
WriteLiteral(" name=\"End\"");
|
||||
|
||||
@@ -109,8 +146,8 @@ WriteLiteral(" />\r\n <span");
|
||||
WriteLiteral(" class=\"smallMessage\"");
|
||||
|
||||
WriteLiteral(">* Optional</span>\r\n </td>\r\n </tr>\r\n <tr>\r\n " +
|
||||
" <th>Limit Filter\r\n </th>\r\n <td>\r\n " +
|
||||
" <select");
|
||||
" <th>\r\n Limit Filter\r\n </th>\r\n " +
|
||||
" <td>\r\n <select");
|
||||
|
||||
WriteLiteral(" name=\"Take\"");
|
||||
|
||||
@@ -141,8 +178,9 @@ WriteLiteral(">50 Events</option>\r\n <option");
|
||||
WriteLiteral(" value=\"10\"");
|
||||
|
||||
WriteLiteral(">10 Events</option>\r\n </select>\r\n </td>\r\n " +
|
||||
" </tr>\r\n <tr>\r\n <th>Module Filter\r\n " +
|
||||
" </th>\r\n <td>\r\n <select");
|
||||
" </tr>\r\n <tr>\r\n <th>\r\n Module " +
|
||||
"Filter\r\n </th>\r\n <td>\r\n <select" +
|
||||
"");
|
||||
|
||||
WriteLiteral(" id=\"moduleId\"");
|
||||
|
||||
@@ -157,13 +195,13 @@ WriteLiteral(" selected=\"selected\"");
|
||||
WriteLiteral(">- All Modules -</option>\r\n");
|
||||
|
||||
|
||||
#line 50 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
#line 63 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 50 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
#line 63 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
foreach (var lm in Model.LogModules.Keys.OrderBy(lm => lm.ModuleDescription))
|
||||
{
|
||||
|
||||
@@ -172,29 +210,30 @@ WriteLiteral(">- All Modules -</option>\r\n");
|
||||
#line hidden
|
||||
WriteLiteral(" <option");
|
||||
|
||||
WriteAttribute("value", Tuple.Create(" value=\"", 2082), Tuple.Create("\"", 2102)
|
||||
WriteAttribute("value", Tuple.Create(" value=\"", 2518), Tuple.Create("\"", 2538)
|
||||
|
||||
#line 52 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 2090), Tuple.Create<System.Object, System.Int32>(lm.ModuleId
|
||||
#line 65 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 2526), Tuple.Create<System.Object, System.Int32>(lm.ModuleId
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 2090), false)
|
||||
, 2526), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 52 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
#line 65 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
Write(lm.ModuleDescription);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</option> \r\n");
|
||||
WriteLiteral("</option>\r\n");
|
||||
|
||||
|
||||
#line 53 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
#line 66 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -207,13 +246,13 @@ WriteLiteral(" id=\"trLogModuleEventTypes\"");
|
||||
|
||||
WriteLiteral(" style=\"display: none\"");
|
||||
|
||||
WriteLiteral(">\r\n <th>Event Type Filter <span");
|
||||
WriteLiteral(">\r\n <th>\r\n Event Type Filter <span");
|
||||
|
||||
WriteLiteral(" style=\"display: block;\"");
|
||||
|
||||
WriteLiteral(" class=\"checkboxBulkSelectContainer\"");
|
||||
|
||||
WriteLiteral(">Select: <a");
|
||||
WriteLiteral(">\r\n Select: <a");
|
||||
|
||||
WriteLiteral(" id=\"eventTypesSelectAll\"");
|
||||
|
||||
@@ -223,18 +262,20 @@ WriteLiteral(">ALL</a> | <a");
|
||||
|
||||
WriteLiteral(" id=\"eventTypesSelectNone\"");
|
||||
|
||||
WriteLiteral("\r\n href=\"#\"");
|
||||
WriteLiteral("\r\n " +
|
||||
" href=\"#\"");
|
||||
|
||||
WriteLiteral(">NONE</a></span>\r\n </th>\r\n <td>\r\n");
|
||||
WriteLiteral(">NONE</a>\r\n </span>\r\n </th>\r\n <t" +
|
||||
"d>\r\n");
|
||||
|
||||
|
||||
#line 62 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
#line 79 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 62 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
#line 79 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
int uniqueIdSeed = 0;
|
||||
|
||||
|
||||
@@ -243,13 +284,13 @@ WriteLiteral(">NONE</a></span>\r\n </th>\r\n <td>\
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
|
||||
#line 64 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
#line 81 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 64 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
#line 81 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
foreach (var lm in Model.LogModules)
|
||||
{
|
||||
|
||||
@@ -261,7 +302,7 @@ WriteLiteral(" <div");
|
||||
WriteLiteral(" data-logmoduleid=\"");
|
||||
|
||||
|
||||
#line 66 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
#line 83 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
Write(lm.Key.ModuleId);
|
||||
|
||||
|
||||
@@ -276,7 +317,7 @@ WriteLiteral(">\r\n");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 67 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
#line 84 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
Write(CommonHelpers.CheckBoxList("EventTypeIds", lm.Value.ToSelectListItems(), 2, false, uniqueIdSeed));
|
||||
|
||||
|
||||
@@ -285,85 +326,69 @@ WriteLiteral(" ");
|
||||
WriteLiteral("\r\n </div>\r\n");
|
||||
|
||||
|
||||
#line 69 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
#line 86 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
uniqueIdSeed += lm.Value.Count;
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n <th><" +
|
||||
"/th>\r\n <td>\r\n");
|
||||
WriteLiteral(" </td>\r\n </tr>\r\n </table>\r\n <p");
|
||||
|
||||
WriteLiteral(" ");
|
||||
WriteLiteral(" class=\"actions\"");
|
||||
|
||||
|
||||
#line 76 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
Write(Html.Hidden("Format", "CSV"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n <input");
|
||||
WriteLiteral(">\r\n <input");
|
||||
|
||||
WriteLiteral(" type=\"submit\"");
|
||||
|
||||
WriteLiteral(" class=\"button\"");
|
||||
|
||||
WriteLiteral(" value=\"Download CSV\"");
|
||||
WriteLiteral(" value=\"Export\"");
|
||||
|
||||
WriteLiteral(" />\r\n </td>\r\n </tr>\r\n </table>\r\n <script");
|
||||
WriteLiteral(" />\r\n </p>\r\n <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(">\r\n $(function () {\r\n var filterStart = $(\'#filterStart" +
|
||||
"\').watermark(\'Start\').datetimepicker({\r\n ampm: true,\r\n " +
|
||||
" stepMinute: 1,\r\n changeYear: true,\r\n " +
|
||||
" changeMonth: true,\r\n dateFormat: \'yy/mm/dd\'\r\n " +
|
||||
" });\r\n var filterEnd = $(\'#filterEnd\').watermark(\'End\').da" +
|
||||
"tetimepicker({\r\n ampm: true,\r\n stepMinute:" +
|
||||
" 1,\r\n changeYear: true,\r\n changeMonth: tru" +
|
||||
"e,\r\n dateFormat: \'yy/mm/dd\'\r\n });\r\n " +
|
||||
" var moduleId = $(\'#moduleId\');\r\n var trLogModuleEventTypes =" +
|
||||
" $(\'#trLogModuleEventTypes\');\r\n var logModuleEventTypes = trLogMo" +
|
||||
"duleEventTypes.find(\'.logModuleEventTypes\').hide();\r\n var logModu" +
|
||||
"leEventTypeCheckboxes = logModuleEventTypes.find(\'input[type=\"checkbox\"]\');\r\n\r\n " +
|
||||
" moduleId.change(function () {\r\n // Unselect Al" +
|
||||
"l\r\n logModuleEventTypes.slideUp();\r\n logMo" +
|
||||
"duleEventTypeCheckboxes.filter(\':checked\').prop(\'checked\', false);\r\n " +
|
||||
" var selectedModule = moduleId.val();\r\n if (selectedMo" +
|
||||
"dule) {\r\n trLogModuleEventTypes.show();\r\n " +
|
||||
" var selectedModuleEventTypes = logModuleEventTypes.filter(\'[data-logmodu" +
|
||||
"leid=\"\' + selectedModule + \'\"]\');\r\n if (selectedModuleEve" +
|
||||
"ntTypes.length > 0) {\r\n var selectedModuleEventTypeCh" +
|
||||
"eckboxes = selectedModuleEventTypes.find(\'input[type=\"checkbox\"]\');\r\n " +
|
||||
" selectedModuleEventTypeCheckboxes.prop(\'checked\', true);\r\n " +
|
||||
" trLogModuleEventTypes.show();\r\n " +
|
||||
" selectedModuleEventTypes.slideDown();\r\n } else {\r\n " +
|
||||
" trLogModuleEventTypes.hide();\r\n }\r" +
|
||||
"\n } else {\r\n trLogModuleEventTypes.hid" +
|
||||
"e();\r\n }\r\n });\r\n\r\n $(\'#eventTyp" +
|
||||
"esSelectAll\').click(function () {\r\n var selectedModule = modu" +
|
||||
"leId.val();\r\n if (selectedModule) {\r\n " +
|
||||
"var selectedModuleEventTypes = logModuleEventTypes.filter(\'[data-logmoduleid=\"\' " +
|
||||
"+ selectedModule + \'\"]\');\r\n if (selectedModuleEventTypes." +
|
||||
"length > 0) {\r\n var selectedModuleEventTypeCheckboxes" +
|
||||
" = selectedModuleEventTypes.find(\'input[type=\"checkbox\"]\');\r\n " +
|
||||
" selectedModuleEventTypeCheckboxes.prop(\'checked\', true);\r\n " +
|
||||
" }\r\n }\r\n return false;\r\n " +
|
||||
" });\r\n $(\'#eventTypesSelectNone\').click(function () {\r\n " +
|
||||
WriteLiteral(">\r\n $(function () {\r\n var moduleId = $(\'#moduleId\');\r\n " +
|
||||
" var trLogModuleEventTypes = $(\'#trLogModuleEventTypes\');\r\n " +
|
||||
" var logModuleEventTypes = trLogModuleEventTypes.find(\'.logModuleEventTy" +
|
||||
"pes\').hide();\r\n var logModuleEventTypeCheckboxes = logModuleEvent" +
|
||||
"Types.find(\'input[type=\"checkbox\"]\');\r\n\r\n moduleId.change(functio" +
|
||||
"n () {\r\n // Unselect All\r\n logModuleEventT" +
|
||||
"ypes.slideUp();\r\n logModuleEventTypeCheckboxes.filter(\':check" +
|
||||
"ed\').prop(\'checked\', false);\r\n var selectedModule = moduleId." +
|
||||
"val();\r\n if (selectedModule) {\r\n trLog" +
|
||||
"ModuleEventTypes.show();\r\n var selectedModuleEventTypes =" +
|
||||
" logModuleEventTypes.filter(\'[data-logmoduleid=\"\' + selectedModule + \'\"]\');\r\n " +
|
||||
" if (selectedModuleEventTypes.length > 0) {\r\n " +
|
||||
" var selectedModuleEventTypeCheckboxes = selectedModuleEventTypes.fi" +
|
||||
"nd(\'input[type=\"checkbox\"]\');\r\n selectedModuleEventTy" +
|
||||
"peCheckboxes.prop(\'checked\', true);\r\n trLogModuleEven" +
|
||||
"tTypes.show();\r\n selectedModuleEventTypes.slideDown()" +
|
||||
";\r\n } else {\r\n trLogModuleEven" +
|
||||
"tTypes.hide();\r\n }\r\n } else {\r\n " +
|
||||
" trLogModuleEventTypes.hide();\r\n }\r\n " +
|
||||
" });\r\n\r\n $(\'#eventTypesSelectAll\').click(function () {\r\n " +
|
||||
" var selectedModule = moduleId.val();\r\n if (s" +
|
||||
"electedModule) {\r\n var selectedModuleEventTypes = logModu" +
|
||||
"leEventTypes.filter(\'[data-logmoduleid=\"\' + selectedModule + \'\"]\');\r\n " +
|
||||
" if (selectedModuleEventTypes.length > 0) {\r\n " +
|
||||
" var selectedModuleEventTypeCheckboxes = selectedModuleEventTypes.find(\'inpu" +
|
||||
"t[type=\"checkbox\"]\');\r\n selectedModuleEventTypeCheckb" +
|
||||
"oxes.prop(\'checked\', false);\r\n }\r\n }\r\n" +
|
||||
" return false;\r\n });\r\n\r\n });\r\n " +
|
||||
" </script>\r\n </div>\r\n");
|
||||
"oxes.prop(\'checked\', true);\r\n }\r\n }\r\n " +
|
||||
" return false;\r\n });\r\n $(\'#event" +
|
||||
"TypesSelectNone\').click(function () {\r\n var selectedModule = " +
|
||||
"moduleId.val();\r\n if (selectedModule) {\r\n " +
|
||||
" var selectedModuleEventTypes = logModuleEventTypes.filter(\'[data-logmoduleid" +
|
||||
"=\"\' + selectedModule + \'\"]\');\r\n if (selectedModuleEventTy" +
|
||||
"pes.length > 0) {\r\n var selectedModuleEventTypeCheckb" +
|
||||
"oxes = selectedModuleEventTypes.find(\'input[type=\"checkbox\"]\');\r\n " +
|
||||
" selectedModuleEventTypeCheckboxes.prop(\'checked\', false);\r\n " +
|
||||
" }\r\n }\r\n return false;\r\n " +
|
||||
" });\r\n\r\n });\r\n </script>\r\n </div>\r\n");
|
||||
|
||||
|
||||
#line 149 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
#line 148 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -372,7 +397,7 @@ WriteLiteral(">\r\n $(function () {\r\n var filterStar
|
||||
WriteLiteral("<h2>Live Logging</h2>\r\n");
|
||||
|
||||
|
||||
#line 151 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
#line 150 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
Write(Html.Partial(MVC.Config.Shared.Views.LogEvents, new Disco.Web.Areas.Config.Models.Shared.LogEventsModel()
|
||||
{
|
||||
IsLive = true,
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
var uniqueId = Guid.NewGuid().ToString("N");
|
||||
}
|
||||
<div id="LogEvents_@(uniqueId)" class="logEventsViewport">
|
||||
@Html.AntiForgeryToken()
|
||||
<table class="logEventsViewport">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -42,7 +43,7 @@
|
||||
}
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var logEventsHost = $('LogEvents_@(uniqueId)');
|
||||
var logEventsHost = $('#LogEvents_@(uniqueId)');
|
||||
var logModuleId = '@(Model.ModuleFilter != null ? Model.ModuleFilter.ModuleId.ToString() : null)';
|
||||
var logModuleLiveGroupName = '@(Model.ModuleFilter != null ? Model.ModuleFilter.LiveLogGroupName : Disco.Services.Logging.LogNotificationsHub.AllLoggingNotification)';
|
||||
var logEventTypeFiltered = @(eventTypesFilterJson);
|
||||
@@ -80,7 +81,8 @@
|
||||
Start: formatDate(logStartFiler),
|
||||
End: logEndFiler,
|
||||
ModuleId: logModuleId,
|
||||
Take: logTakeFiler
|
||||
Take: logTakeFiler,
|
||||
'__RequestVerificationToken': logEventsHost.find('input[name="__RequestVerificationToken"]').val()
|
||||
};
|
||||
if (logEventTypeFiltered)
|
||||
loadData["EventTypeIds"] = logEventTypeFiltered;
|
||||
|
||||
@@ -70,7 +70,18 @@ WriteAttribute("id", Tuple.Create(" id=\"", 309), Tuple.Create("\"", 335)
|
||||
|
||||
WriteLiteral(" class=\"logEventsViewport\"");
|
||||
|
||||
WriteLiteral(">\r\n <table");
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 10 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
|
||||
Write(Html.AntiForgeryToken());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n <table");
|
||||
|
||||
WriteLiteral(" class=\"logEventsViewport\"");
|
||||
|
||||
@@ -95,21 +106,21 @@ WriteLiteral(">Message\r\n </th>\r\n </tr>\r\n
|
||||
|
||||
WriteLiteral(" class=\"logEventsViewportContainer\"");
|
||||
|
||||
WriteAttribute("style", Tuple.Create(" style=\"", 810), Tuple.Create("\"", 1020)
|
||||
WriteAttribute("style", Tuple.Create(" style=\"", 840), Tuple.Create("\"", 1050)
|
||||
|
||||
#line 24 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 818), Tuple.Create<System.Object, System.Int32>(Model.ViewPortWidth.HasValue ? string.Format("width:{0}px;", Model.ViewPortWidth.Value) : null
|
||||
#line 25 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 848), Tuple.Create<System.Object, System.Int32>(Model.ViewPortWidth.HasValue ? string.Format("width:{0}px;", Model.ViewPortWidth.Value) : null
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 818), false)
|
||||
, 848), false)
|
||||
|
||||
#line 24 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 915), Tuple.Create<System.Object, System.Int32>(Model.ViewPortHeight.HasValue ? string.Format("height:{0}px;", Model.ViewPortHeight.Value - 18) : null
|
||||
#line 25 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 945), Tuple.Create<System.Object, System.Int32>(Model.ViewPortHeight.HasValue ? string.Format("height:{0}px;", Model.ViewPortHeight.Value - 18) : null
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 915), false)
|
||||
, 945), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
@@ -165,13 +176,13 @@ WriteLiteral("></td>\r\n </tr>\r\n </tbody>\r\n
|
||||
"\r\n");
|
||||
|
||||
|
||||
#line 40 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
|
||||
#line 41 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 40 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
|
||||
#line 41 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
|
||||
|
||||
var eventTypesFilterJson = (Model.EventTypesFilter != null) ? Newtonsoft.Json.JsonConvert.SerializeObject(Model.EventTypesFilter.Select(et => et.Id).ToArray()) : "null";
|
||||
|
||||
@@ -182,11 +193,11 @@ WriteLiteral("\r\n <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(">\r\n $(function () {\r\n var logEventsHost = $(\'LogEvents_");
|
||||
WriteLiteral(">\r\n $(function () {\r\n var logEventsHost = $(\'#LogEvents_");
|
||||
|
||||
|
||||
#line 45 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
|
||||
Write(uniqueId);
|
||||
#line 46 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
|
||||
Write(uniqueId);
|
||||
|
||||
|
||||
#line default
|
||||
@@ -194,7 +205,7 @@ WriteLiteral(">\r\n $(function () {\r\n var logEventsHost = $(
|
||||
WriteLiteral("\');\r\n var logModuleId = \'");
|
||||
|
||||
|
||||
#line 46 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
|
||||
#line 47 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
|
||||
Write(Model.ModuleFilter != null ? Model.ModuleFilter.ModuleId.ToString() : null);
|
||||
|
||||
|
||||
@@ -203,7 +214,7 @@ WriteLiteral("\');\r\n var logModuleId = \'");
|
||||
WriteLiteral("\';\r\n var logModuleLiveGroupName = \'");
|
||||
|
||||
|
||||
#line 47 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
|
||||
#line 48 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
|
||||
Write(Model.ModuleFilter != null ? Model.ModuleFilter.LiveLogGroupName : Disco.Services.Logging.LogNotificationsHub.AllLoggingNotification);
|
||||
|
||||
|
||||
@@ -212,7 +223,7 @@ WriteLiteral("\';\r\n var logModuleLiveGroupName = \'");
|
||||
WriteLiteral("\';\r\n var logEventTypeFiltered = ");
|
||||
|
||||
|
||||
#line 48 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
|
||||
#line 49 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
|
||||
Write(eventTypesFilterJson);
|
||||
|
||||
|
||||
@@ -221,7 +232,7 @@ WriteLiteral("\';\r\n var logEventTypeFiltered = ");
|
||||
WriteLiteral("; \r\n var logStartFiler = ");
|
||||
|
||||
|
||||
#line 49 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
|
||||
#line 50 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
|
||||
Write(AjaxHelpers.JsonDate(Model.StartFilter));
|
||||
|
||||
|
||||
@@ -230,7 +241,7 @@ WriteLiteral("; \r\n var logStartFiler = ");
|
||||
WriteLiteral(";\r\n var logEndFiler = ");
|
||||
|
||||
|
||||
#line 50 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
|
||||
#line 51 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
|
||||
Write(AjaxHelpers.JsonDate(Model.EndFilter));
|
||||
|
||||
|
||||
@@ -239,7 +250,7 @@ WriteLiteral(";\r\n var logEndFiler = ");
|
||||
WriteLiteral(";\r\n var logTakeFiler = \'");
|
||||
|
||||
|
||||
#line 51 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
|
||||
#line 52 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
|
||||
Write(Model.TakeFilter);
|
||||
|
||||
|
||||
@@ -249,7 +260,7 @@ WriteLiteral("\';\r\n var logHub = null;\r\n var liveEvent
|
||||
"");
|
||||
|
||||
|
||||
#line 53 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
|
||||
#line 54 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
|
||||
Write(Model.JavascriptLiveEventFunctionName);
|
||||
|
||||
|
||||
@@ -258,7 +269,7 @@ WriteLiteral("\';\r\n var logHub = null;\r\n var liveEvent
|
||||
WriteLiteral("\';\r\n var useLive = (\'True\'===\'");
|
||||
|
||||
|
||||
#line 54 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
|
||||
#line 55 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
|
||||
Write(Model.IsLive);
|
||||
|
||||
|
||||
@@ -293,7 +304,8 @@ WriteLiteral(@"');
|
||||
Start: formatDate(logStartFiler),
|
||||
End: logEndFiler,
|
||||
ModuleId: logModuleId,
|
||||
Take: logTakeFiler
|
||||
Take: logTakeFiler,
|
||||
'__RequestVerificationToken': logEventsHost.find('input[name=""__RequestVerificationToken""]').val()
|
||||
};
|
||||
if (logEventTypeFiltered)
|
||||
loadData[""EventTypeIds""] = logEventTypeFiltered;
|
||||
@@ -301,7 +313,7 @@ WriteLiteral(@"');
|
||||
url: '");
|
||||
|
||||
|
||||
#line 88 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
|
||||
#line 90 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
|
||||
Write(Url.Action(MVC.API.Logging.RetrieveEvents()));
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user