Files
Disco/Disco.Web/Areas/Config/Views/DeviceBatch/Timeline.generated.cs
T
2025-07-31 16:18:32 +10:00

146 lines
7.8 KiB
C#

#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Disco.Web.Areas.Config.Views.DeviceBatch
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Web;
using System.Web.Helpers;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using System.Web.Mvc.Html;
using System.Web.Routing;
using System.Web.Security;
using System.Web.UI;
using System.Web.WebPages;
using Disco;
using Disco.Models.Repository;
using Disco.Services;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DeviceBatch/Timeline.cshtml")]
public partial class Timeline : Disco.Services.Web.WebViewPage<dynamic>
{
public Timeline()
{
}
public override void Execute()
{
#line 1 "..\..\Areas\Config\Views\DeviceBatch\Timeline.cshtml"
Authorization.Require(Claims.Config.DeviceBatch.ShowTimeline);
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Batches", MVC.Config.DeviceBatch.Index(null), "Timeline");
Html.BundleDeferred("~/Style/Timeline");
Html.BundleDeferred("~/ClientScripts/Modules/Timeline");
#line default
#line hidden
WriteLiteral("\r\n<div");
WriteLiteral(" id=\"deviceBatchesTimeline\"");
WriteLiteral(" style=\"height: 550px;\"");
WriteLiteral(" data-url=\"");
#line 8 "..\..\Areas\Config\Views\DeviceBatch\Timeline.cshtml"
Write(Url.Action(MVC.API.DeviceBatch.Timeline()));
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(">\r\n</div>\r\n<script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(">\r\n (function () {\r\n var tl;\r\n\r\n $(function () {\r\n\r\n " +
"var eventSource = new Timeline.DefaultEventSource();\r\n\r\n var currentD" +
"ate = new Date();\r\n currentDate = new Date(currentDate.getFullYear()," +
" currentDate.getMonth(), currentDate.getDay(), 10, 0, 0);\r\n var tomor" +
"rowDate = new Date();\r\n tomorrowDate.setDate(currentDate.getDate() + " +
"1);\r\n var sixMonthsDate = new Date();\r\n sixMonthsDate.setD" +
"ate(currentDate.getDate());\r\n sixMonthsDate.setMonth(currentDate.getM" +
"onth() + 6);\r\n\r\n var hotZoneStart1 = new Date(currentDate.getFullYear" +
"(), 0, 1, 10, 0, 0);\r\n var hotZoneEnd1 = new Date(currentDate.getFull" +
"Year(), 11, 31, 10, 0, 0);\r\n var hotZoneStart2 = new Date(currentDate" +
".getFullYear() + 1, 0, 1, 10, 0, 0);\r\n var hotZoneEnd2 = new Date(cur" +
"rentDate.getFullYear() + 1, 11, 31, 10, 0, 0);\r\n //hotZoneEnd.setDate" +
"(hotZoneEnd.getDate() - 1);\r\n\r\n //hotZoneStart = hotZoneStart.toLocal" +
"eDateString();\r\n //hotZoneEnd = hotZoneEnd.toLocaleDateString();\r\n\r\n\r" +
"\n var bandInfos = [\r\n Timeline.createHotZoneBandInfo({" +
"\r\n zones: [\r\n {\r\n " +
" start: hotZoneStart1,\r\n end: hotZoneEnd1,\r\n " +
" magnify: 4,\r\n unit: Timeline" +
".DateTime.MONTH\r\n },\r\n {\r\n " +
" start: hotZoneStart2,\r\n end: hotZ" +
"oneEnd2,\r\n magnify: 4,\r\n u" +
"nit: Timeline.DateTime.MONTH\r\n }\r\n ],\r" +
"\n eventSource: eventSource,\r\n width: \"85%\"" +
",\r\n intervalUnit: Timeline.DateTime.YEAR,\r\n " +
" intervalPixels: 150,\r\n timeZone: 10,\r\n d" +
"ate: sixMonthsDate\r\n }),\r\n Timeline.createBandInfo" +
"({\r\n eventSource: eventSource,\r\n width: \"1" +
"5%\",\r\n intervalUnit: Timeline.DateTime.YEAR,\r\n " +
" intervalPixels: 150,\r\n overview: true,\r\n " +
" timeZone: 10,\r\n date: sixMonthsDate\r\n })\r\n" +
" ];\r\n bandInfos[1].syncWith = 0;\r\n bandInfos[1]" +
".highlight = true;\r\n\r\n for (var i = 0; i < bandInfos.length; i++) {\r\n" +
" bandInfos[i].decorators = [\r\n new Timeline.Sp" +
"anHighlightDecorator({\r\n startDate: currentDate,\r\n " +
" endDate: tomorrowDate,\r\n color: \"#CC2222" +
"\",\r\n opacity: 50\r\n }),\r\n " +
" new Timeline.SpanHighlightDecorator({\r\n startDate: " +
"hotZoneStart1,\r\n endDate: hotZoneEnd1,\r\n " +
" color: \"#CEA5A5\",\r\n opacity: 50\r\n " +
" }),\r\n new Timeline.SpanHighlightDecorator({\r\n " +
" startDate: hotZoneStart2,\r\n endDate: hotZoneEn" +
"d2,\r\n color: \"#CCB7B7\",\r\n opacity:" +
" 50\r\n })\r\n ];\r\n }\r\n\r\n tl" +
" = Timeline.create($(\'#deviceBatchesTimeline\')[0], bandInfos);\r\n\r\n va" +
"r tlResizeLayoutHandle = null;\r\n $(window).resize(function () {\r\n " +
" if (tlResizeLayoutHandle)\r\n window.clearTimeout(t" +
"lResizeLayoutHandle);\r\n tlResizeLayoutHandle = window.setTimeout(" +
"function () {\r\n tlResizeLayoutHandle = null;\r\n " +
" tl.layout();\r\n }, 500);\r\n });\r\n\r\n // L" +
"oad Events\r\n async function loadEventsAsync() {\r\n try " +
"{\r\n const dataUrl = $(\'#deviceBatchesTimeline\').attr(\'data-ur" +
"l\');\r\n const body = new FormData();\r\n body" +
".append(\'__RequestVerificationToken\', document.body.dataset.antiforgery);\r\n " +
" const response = await fetch(dataUrl, {\r\n " +
"method: \'POST\',\r\n body: body\r\n });\r\n " +
" if (response.ok) {\r\n const data = await" +
" response.json();\r\n eventSource.loadJSON(data, dataUrl);\r" +
"\n } else {\r\n alert(\'Unable to load Tim" +
"eline Data: \' + response.statusText);\r\n }\r\n } " +
"catch (e) {\r\n alert(\'Unable to load Timeline Data: \' + e);\r\n " +
" }\r\n }\r\n loadEventsAsync();\r\n });\r\n\r\n" +
" })();\r\n\r\n</script>\r\n");
}
}
}
#pragma warning restore 1591