initial source commit
This commit is contained in:
@@ -0,0 +1,122 @@
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace Disco.Web.Areas.Config
|
||||
{
|
||||
public class ConfigAreaRegistration : AreaRegistration
|
||||
{
|
||||
public override string AreaName
|
||||
{
|
||||
get
|
||||
{
|
||||
return "Config";
|
||||
}
|
||||
}
|
||||
|
||||
public override void RegisterArea(AreaRegistrationContext context)
|
||||
{
|
||||
context.MapRoute(
|
||||
"Config_DeviceModel_GenericComponents",
|
||||
"Config/DeviceModel/GenericComponents",
|
||||
new { controller = "DeviceModel", action = "GenericComponents" }
|
||||
);
|
||||
context.MapRoute(
|
||||
"Config_DeviceModel",
|
||||
"Config/DeviceModel/{id}",
|
||||
new { controller = "DeviceModel", action = "Index", id = UrlParameter.Optional }
|
||||
);
|
||||
context.MapRoute(
|
||||
"Config_DeviceBatch_Create",
|
||||
"Config/DeviceBatch/Create",
|
||||
new { controller = "DeviceBatch", action = "Create", id = UrlParameter.Optional }
|
||||
);
|
||||
context.MapRoute(
|
||||
"Config_DeviceBatch_Timeline",
|
||||
"Config/DeviceBatch/Timeline",
|
||||
new { controller = "DeviceBatch", action = "Timeline" }
|
||||
);
|
||||
context.MapRoute(
|
||||
"Config_DeviceBatch",
|
||||
"Config/DeviceBatch/{id}",
|
||||
new { controller = "DeviceBatch", action = "Index", id = UrlParameter.Optional }
|
||||
);
|
||||
context.MapRoute(
|
||||
"Config_DeviceProfile_Create",
|
||||
"Config/DeviceProfile/Create",
|
||||
new { controller = "DeviceProfile", action = "Create" }
|
||||
);
|
||||
context.MapRoute(
|
||||
"Config_DeviceProfile_Defaults",
|
||||
"Config/DeviceProfile/Defaults",
|
||||
new { controller = "DeviceProfile", action = "Defaults" }
|
||||
);
|
||||
context.MapRoute(
|
||||
"Config_DeviceProfile",
|
||||
"Config/DeviceProfile/{id}",
|
||||
new { controller = "DeviceProfile", action = "Index", id = UrlParameter.Optional }
|
||||
);
|
||||
context.MapRoute(
|
||||
"Config_AttachmentType_Create",
|
||||
"Config/AttachmentType/Create",
|
||||
new { controller = "AttachmentType", action = "Create" }
|
||||
);
|
||||
context.MapRoute(
|
||||
"Config_AttachmentType_ExpressionBrowser_Type",
|
||||
"Config/AttachmentType/ExpressionBrowser/{type}",
|
||||
new { controller = "AttachmentType", action = "ExpressionBrowser", type = UrlParameter.Optional }
|
||||
);
|
||||
context.MapRoute(
|
||||
"Config_AttachmentType",
|
||||
"Config/AttachmentType/{id}",
|
||||
new { controller = "AttachmentType", action = "Index", id = UrlParameter.Optional }
|
||||
);
|
||||
context.MapRoute(
|
||||
"Config_DocumentTemplate_Create",
|
||||
"Config/DocumentTemplate/Create",
|
||||
new { controller = "DocumentTemplate", action = "Create", id = UrlParameter.Optional }
|
||||
);
|
||||
context.MapRoute(
|
||||
"Config_DocumentTemplate_ImportStatus",
|
||||
"Config/DocumentTemplate/ImportStatus",
|
||||
new { controller = "DocumentTemplate", action = "ImportStatus", id = UrlParameter.Optional }
|
||||
);
|
||||
context.MapRoute(
|
||||
"Config_DocumentTemplate_UndetectedPages",
|
||||
"Config/DocumentTemplate/UndetectedPages",
|
||||
new { controller = "DocumentTemplate", action = "UndetectedPages", id = UrlParameter.Optional }
|
||||
);
|
||||
context.MapRoute(
|
||||
"Config_DocumentTemplate_ExpressionBrowser",
|
||||
"Config/DocumentTemplate/ExpressionBrowser",
|
||||
new { controller = "DocumentTemplate", action = "ExpressionBrowser", id = UrlParameter.Optional }
|
||||
);
|
||||
context.MapRoute(
|
||||
"Config_DocumentTemplate",
|
||||
"Config/DocumentTemplate/{id}",
|
||||
new { controller = "DocumentTemplate", action = "Index", id = UrlParameter.Optional }
|
||||
);
|
||||
|
||||
context.MapRoute(
|
||||
"Config_Warranty",
|
||||
"Config/Warranty/{id}",
|
||||
new { controller = "Warranty", action = "Index", id = UrlParameter.Optional }
|
||||
);
|
||||
|
||||
context.MapRoute(
|
||||
"Config_Plugins",
|
||||
"Config/Plugins",
|
||||
new { controller = "Plugins", action = "Index"}
|
||||
);
|
||||
context.MapRoute(
|
||||
"Config_Plugins_Configure",
|
||||
"Config/Plugins/{PluginId}",
|
||||
new { controller = "Plugins", action = "Configure" }
|
||||
);
|
||||
|
||||
context.MapRoute(
|
||||
"Config_default",
|
||||
"Config/{controller}/{action}/{id}",
|
||||
new { controller = "Config", action = "Index", id = UrlParameter.Optional }
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Controllers
|
||||
{
|
||||
public partial class ConfigController : dbAdminController
|
||||
{
|
||||
//
|
||||
// GET: /Config/Config/
|
||||
|
||||
public virtual ActionResult Index()
|
||||
{
|
||||
|
||||
var m = new Models.Config.IndexModel()
|
||||
{
|
||||
UpdateResponse = dbContext.DiscoConfiguration.UpdateLastCheck
|
||||
};
|
||||
|
||||
return View(m);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using Disco.BI;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Controllers
|
||||
{
|
||||
public partial class DeviceBatchController : dbAdminController
|
||||
{
|
||||
|
||||
public virtual ActionResult Index(int? id)
|
||||
{
|
||||
dbContext.Configuration.LazyLoadingEnabled = true;
|
||||
|
||||
if (id.HasValue)
|
||||
{
|
||||
var m = new Models.DeviceBatch.ShowModel()
|
||||
{
|
||||
DeviceBatch = dbContext.DeviceBatches.Find(id)
|
||||
};
|
||||
if (m.DeviceBatch == null)
|
||||
{
|
||||
return RedirectToAction(MVC.Config.DeviceBatch.Index(null));
|
||||
}
|
||||
m.CanDelete = m.DeviceBatch.CanDelete(dbContext);
|
||||
|
||||
m.DeviceCount = m.DeviceBatch.Devices.Count();
|
||||
m.DeviceDecommissionedCount = m.DeviceBatch.Devices.Count(d => d.DecommissionedDate.HasValue);
|
||||
|
||||
m.DeviceModels = dbContext.DeviceModels.ToSelectListItems();
|
||||
|
||||
return View(MVC.Config.DeviceBatch.Views.Show, m);
|
||||
}
|
||||
else
|
||||
{
|
||||
return View(Models.DeviceBatch.IndexModel.Build(dbContext));
|
||||
}
|
||||
}
|
||||
|
||||
public virtual ActionResult Create()
|
||||
{
|
||||
// Default Batch
|
||||
var m = BI.DeviceBI.BatchUtilities.DefaultNewDeviceBatch(dbContext);
|
||||
return View(m);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public virtual ActionResult Create(Disco.Models.Repository.DeviceBatch model)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
// Check for Existing
|
||||
var existing = dbContext.DeviceBatches.Where(m => m.Name == model.Name).FirstOrDefault();
|
||||
if (existing == null)
|
||||
{
|
||||
dbContext.DeviceBatches.Add(model);
|
||||
dbContext.SaveChanges();
|
||||
return RedirectToAction(MVC.Config.DeviceBatch.Index(model.Id));
|
||||
}
|
||||
else
|
||||
{
|
||||
ModelState.AddModelError("Name", "A Device Batch with this name already exists.");
|
||||
}
|
||||
}
|
||||
|
||||
return View(model);
|
||||
}
|
||||
|
||||
public virtual ActionResult Timeline()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using Disco.Services.Plugins.Features.WarrantyProvider;
|
||||
using Disco.Services.Plugins;
|
||||
using Disco.BI.Extensions;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Controllers
|
||||
{
|
||||
public partial class DeviceModelController : dbAdminController
|
||||
{
|
||||
public virtual ActionResult Index(int? id)
|
||||
{
|
||||
if (id.HasValue)
|
||||
{
|
||||
var m = new Models.DeviceModel.ShowModel()
|
||||
{
|
||||
DeviceModel = dbContext.DeviceModels.Include("DeviceComponents.JobSubTypes").Where(dm => dm.Id == id.Value).FirstOrDefault(),
|
||||
WarrantyProviders = Plugins.GetPluginFeatures(typeof(WarrantyProviderFeature))
|
||||
};
|
||||
|
||||
m.DeviceComponentsModel = new Models.DeviceModel.DeviceComponentsModel()
|
||||
{
|
||||
DeviceModelId = m.DeviceModel.Id,
|
||||
DeviceComponents = m.DeviceModel.DeviceComponents.ToList(),
|
||||
JobSubTypes = dbContext.JobSubTypes.Where(jst => jst.JobTypeId == Disco.Models.Repository.JobType.JobTypeIds.HNWar).ToList()
|
||||
};
|
||||
|
||||
m.CanDelete = m.DeviceModel.CanDelete(dbContext);
|
||||
|
||||
//m.Devices = BI.DeviceBI.SelectDeviceSearchResultItem(dbContext.Devices.Where(d => d.DeviceModelId == m.DeviceModel.Id));
|
||||
|
||||
//m.Devices = dbContext.Devices.Include("DeviceModel").Include("DeviceProfile").Include("AssignedUser")
|
||||
// .Where(d => d.DeviceModelId == m.DeviceModel.Id).ToList();
|
||||
|
||||
return View(MVC.Config.DeviceModel.Views.Show, m);
|
||||
}
|
||||
else
|
||||
{
|
||||
return View(Models.DeviceModel.IndexModel.Build(dbContext));
|
||||
}
|
||||
}
|
||||
|
||||
public virtual ActionResult GenericComponents()
|
||||
{
|
||||
var m = new Models.DeviceModel.DeviceComponentsModel()
|
||||
{
|
||||
DeviceComponents = dbContext.DeviceComponents.Include("JobSubTypes").Where(dc => !dc.DeviceModelId.HasValue).ToList(),
|
||||
JobSubTypes = dbContext.JobSubTypes.Where(jst => jst.JobTypeId == Disco.Models.Repository.JobType.JobTypeIds.HNWar).ToList()
|
||||
};
|
||||
|
||||
return View(m);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using Disco.Data.Configuration;
|
||||
using Disco.BI;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Services.Plugins.Features.CertificateProvider;
|
||||
using Disco.Services.Plugins;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Controllers
|
||||
{
|
||||
public partial class DeviceProfileController : dbAdminController
|
||||
{
|
||||
public virtual ActionResult Index(int? id)
|
||||
{
|
||||
if (id.HasValue)
|
||||
{
|
||||
var m = new Models.DeviceProfile.ShowModel()
|
||||
{
|
||||
DeviceProfile = dbContext.DeviceProfiles.Find(id.Value),
|
||||
OrganisationAddresses = dbContext.DiscoConfiguration.OrganisationAddresses.Addresses,
|
||||
CertificateProviders = Plugins.GetPluginFeatures(typeof(CertificateProviderFeature))
|
||||
};
|
||||
|
||||
//m.Devices = BI.DeviceBI.SelectDeviceSearchResultItem(dbContext.Devices.Where(d => d.DeviceProfileId == m.DeviceProfile.Id));
|
||||
|
||||
var DistributionValues = Enum.GetValues(typeof(Disco.Models.Repository.DeviceProfile.DistributionTypes));
|
||||
m.DeviceProfileDistributionTypes = new List<SelectListItem>();
|
||||
foreach (int value in DistributionValues)
|
||||
{
|
||||
m.DeviceProfileDistributionTypes.Add(new SelectListItem()
|
||||
{
|
||||
Value = value.ToString(),
|
||||
Text = Enum.GetName(typeof(Disco.Models.Repository.DeviceProfile.DistributionTypes), value),
|
||||
Selected = ((int)m.DeviceProfile.DistributionType == value)
|
||||
});
|
||||
}
|
||||
m.CanDelete = m.DeviceProfile.CanDelete(dbContext);
|
||||
|
||||
// Removed 2012-06-14 G# - Properties moved to DeviceProfile model & DB Migrated in DBv3.
|
||||
//var config = m.DeviceProfile.Configuration(dbContext);
|
||||
//m.AllocateWirelessCertificate = m.DeviceProfile.AllocateWirelessCertificate;
|
||||
//m.OrganisationalUnit = m.DeviceProfile.OrganisationalUnit;
|
||||
//m.ComputerNameTemplate = m.DeviceProfile.ComputerNameTemplate;
|
||||
|
||||
return View(MVC.Config.DeviceProfile.Views.Show, m);
|
||||
}
|
||||
else
|
||||
{
|
||||
return View(Models.DeviceProfile.IndexModel.Build(dbContext));
|
||||
}
|
||||
}
|
||||
|
||||
public virtual ActionResult Create()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public virtual ActionResult Create(Disco.Models.Repository.DeviceProfile model)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
// Check for Existing
|
||||
var existing = dbContext.DeviceProfiles.Where(m => m.Name == model.Name).FirstOrDefault();
|
||||
if (existing == null)
|
||||
{
|
||||
model.ProvisionADAccount = true;
|
||||
|
||||
dbContext.DeviceProfiles.Add(model);
|
||||
dbContext.SaveChanges();
|
||||
return RedirectToAction(MVC.Config.DeviceProfile.Index(model.Id));
|
||||
}
|
||||
else
|
||||
{
|
||||
ModelState.AddModelError("Name", "A Device Profile with this name already exists.");
|
||||
}
|
||||
}
|
||||
|
||||
return View(model);
|
||||
}
|
||||
|
||||
public virtual ActionResult Defaults()
|
||||
{
|
||||
var m = new Models.DeviceProfile.DefaultsModel()
|
||||
{
|
||||
DeviceProfiles = dbContext.DeviceProfiles.ToList(),
|
||||
Default = dbContext.DiscoConfiguration.DeviceProfiles.DefaultDeviceProfileId,
|
||||
DefaultAddDeviceOffline = dbContext.DiscoConfiguration.DeviceProfiles.DefaultAddDeviceOfflineDeviceProfileId
|
||||
};
|
||||
m.DeviceProfilesAndNone = m.DeviceProfiles.ToList();
|
||||
m.DeviceProfilesAndNone.Insert(0, new Disco.Models.Repository.DeviceProfile() { Id = 0, Name = "<No Default>" });
|
||||
|
||||
return View(m);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using Disco.BI;
|
||||
using Disco.BI.Extensions;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Controllers
|
||||
{
|
||||
public partial class DocumentTemplateController : dbAdminController
|
||||
{
|
||||
|
||||
public virtual ActionResult Index(string id)
|
||||
{
|
||||
if (string.IsNullOrEmpty(id))
|
||||
{
|
||||
var m = new Models.DocumentTemplate.IndexModel() { DocumentTemplates = dbContext.DocumentTemplates.ToList() };
|
||||
return View(m);
|
||||
}
|
||||
else
|
||||
{
|
||||
var m = new Models.DocumentTemplate.ShowModel()
|
||||
{
|
||||
DocumentTemplate = dbContext.DocumentTemplates.Include("JobSubTypes").Where(at => at.Id == id).FirstOrDefault()
|
||||
};
|
||||
m.TemplateExpressions = m.DocumentTemplate.ExtractPdfExpressions(dbContext);
|
||||
m.UpdateModel(dbContext);
|
||||
return View(MVC.Config.DocumentTemplate.Views.Show, m);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual ActionResult ImportStatus()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
public virtual ActionResult UndetectedPages()
|
||||
{
|
||||
var m = new Models.DocumentTemplate.UndetectedPagesModel()
|
||||
{
|
||||
DocumentTemplates = dbContext.DocumentTemplates.ToList()
|
||||
};
|
||||
|
||||
return View(m);
|
||||
}
|
||||
|
||||
public virtual ActionResult Create()
|
||||
{
|
||||
var m = new Models.DocumentTemplate.CreateModel();
|
||||
m.UpdateModel(dbContext);
|
||||
|
||||
return View(m);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public virtual ActionResult Create(Models.DocumentTemplate.CreateModel model)
|
||||
{
|
||||
model.UpdateModel(dbContext);
|
||||
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
// Check for Existing
|
||||
var existing = dbContext.DocumentTemplates.Where(m => m.Id == model.DocumentTemplate.Id).FirstOrDefault();
|
||||
if (existing == null)
|
||||
{
|
||||
|
||||
dbContext.DocumentTemplates.Add(model.DocumentTemplate);
|
||||
|
||||
if (model.DocumentTemplate.Scope == Disco.Models.Repository.DocumentTemplate.DocumentTemplateScopes.Job)
|
||||
{
|
||||
var jobSubTypes = new List<Disco.Models.Repository.JobSubType>();
|
||||
jobSubTypes.AddRange(model.GetJobSubTypes);
|
||||
model.DocumentTemplate.JobSubTypes = jobSubTypes;
|
||||
//foreach (var jobSubType in model.GetJobSubTypes)
|
||||
// model.AttachmentType.JobSubTypes.Add(jobSubType);
|
||||
}
|
||||
|
||||
dbContext.SaveChanges();
|
||||
|
||||
// Save Template
|
||||
model.DocumentTemplate.SavePdfTemplate(dbContext, model.Template.InputStream);
|
||||
|
||||
return RedirectToAction(MVC.Config.DocumentTemplate.Index(model.DocumentTemplate.Id));
|
||||
}
|
||||
else
|
||||
{
|
||||
ModelState.AddModelError("Name", "A Document Template with this Name already exists.");
|
||||
}
|
||||
}
|
||||
return View(model);
|
||||
}
|
||||
|
||||
public virtual ActionResult ExpressionBrowser(string type, bool StaticDeclaredMembersOnly = false)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(type))
|
||||
{
|
||||
var m = new Models.DocumentTemplate.ExpressionBrowserModel()
|
||||
{
|
||||
DeviceType = typeof(Disco.Models.Repository.Device).AssemblyQualifiedName,
|
||||
JobType = typeof(Disco.Models.Repository.Job).AssemblyQualifiedName,
|
||||
UserType = typeof(Disco.Models.Repository.User).AssemblyQualifiedName,
|
||||
Variables = BI.Expressions.Expression.StandardVariableTypes(),
|
||||
ExtensionLibraries = BI.Expressions.Expression.ExtensionLibraryTypes()
|
||||
};
|
||||
|
||||
return View(m);
|
||||
}
|
||||
else
|
||||
{
|
||||
var t = Type.GetType(type);
|
||||
if (t != null)
|
||||
{
|
||||
return Json(BI.Expressions.ExpressionTypeDescriptor.Build(t, StaticDeclaredMembersOnly), JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
else
|
||||
{
|
||||
return Json("Invalid Type Specified", JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Controllers
|
||||
{
|
||||
public partial class EnrolmentController : dbAdminController
|
||||
{
|
||||
//
|
||||
// GET: /Config/Bootstrapper/
|
||||
|
||||
public virtual ActionResult Index()
|
||||
{
|
||||
var m = new Models.Enrolment.IndexModel()
|
||||
{
|
||||
MacSshUsername = dbContext.DiscoConfiguration.Bootstrapper.MacSshUsername
|
||||
};
|
||||
|
||||
return View(m);
|
||||
}
|
||||
public virtual ActionResult Status()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Controllers
|
||||
{
|
||||
public partial class ExpressionsController : Controller
|
||||
{
|
||||
//
|
||||
// GET: /Config/Expressions/
|
||||
|
||||
public virtual ActionResult Index()
|
||||
{
|
||||
return View(Views.Editor, new Models.Expressions.EditorModel()
|
||||
{
|
||||
Expression = @"JobComponentsTotalCost() < 100 ? JobComponentsTotalCost().ToString('c') : '$100.00'"
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using Disco.Services.Logging;
|
||||
using Disco.Services.Logging.Models;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Controllers
|
||||
{
|
||||
public partial class LoggingController : dbAdminController
|
||||
{
|
||||
//
|
||||
// GET: /Config/Logs/
|
||||
|
||||
public virtual ActionResult Index()
|
||||
{
|
||||
var m = new Models.Logging.IndexModel()
|
||||
{
|
||||
LogModules = new Dictionary<LogBase, List<LogEventType>>()
|
||||
};
|
||||
foreach (var logModule in LogContext.LogModules.Values)
|
||||
{
|
||||
m.LogModules.Add(logModule, logModule.EventTypes.Values.Where(et => et.UsePersist).ToList());
|
||||
}
|
||||
|
||||
return View(m);
|
||||
}
|
||||
|
||||
public virtual ActionResult TaskStatus(string id)
|
||||
{
|
||||
|
||||
if (string.IsNullOrEmpty(id))
|
||||
{
|
||||
string sessionId;
|
||||
do
|
||||
{
|
||||
System.Threading.Thread.Sleep(100);
|
||||
sessionId = Disco.Services.Tasks.ScheduledTasks.GetTaskStatuses(typeof(Disco.BI.Interop.ActiveDirectory.ActiveDirectoryUpdateLastNetworkLogonDateJob)).Select(t => t.SessionId).FirstOrDefault();
|
||||
} while (sessionId == null);
|
||||
|
||||
return View(new Models.Logging.TaskStatusModel() { SessionId = sessionId });
|
||||
}
|
||||
else
|
||||
{
|
||||
var taskStatus = Disco.Services.Tasks.ScheduledTasks.GetTaskStatus(id);
|
||||
return View(new Models.Logging.TaskStatusModel() { SessionId = taskStatus.SessionId });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Controllers
|
||||
{
|
||||
public partial class OrganisationController : dbAdminController
|
||||
{
|
||||
//
|
||||
// GET: /Config/Organisation/
|
||||
|
||||
public virtual ActionResult Index()
|
||||
{
|
||||
var viewModel = new Models.Organisation.IndexModel();
|
||||
|
||||
viewModel.OrganisationName = dbContext.DiscoConfiguration.OrganisationName;
|
||||
viewModel.MultiSiteMode = dbContext.DiscoConfiguration.MultiSiteMode;
|
||||
viewModel.OrganisationAddresses = dbContext.DiscoConfiguration.OrganisationAddresses.Addresses;
|
||||
|
||||
return View(viewModel);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using Disco.Services.Plugins;
|
||||
using Disco.Web.Areas.Config.Models.Plugins;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Controllers
|
||||
{
|
||||
public partial class PluginsController : dbAdminController
|
||||
{
|
||||
[HttpGet]
|
||||
public virtual ActionResult Index()
|
||||
{
|
||||
Models.Plugins.IndexViewModel vm = new Models.Plugins.IndexViewModel()
|
||||
{
|
||||
PluginManifests = Plugins.GetPlugins()
|
||||
};
|
||||
return View(vm);
|
||||
}
|
||||
|
||||
#region Plugin Configuration
|
||||
[HttpPost]
|
||||
public virtual ActionResult Configure(string PluginId, FormCollection form)
|
||||
{
|
||||
if (string.IsNullOrEmpty(PluginId))
|
||||
return RedirectToAction(MVC.Config.Plugins.Index());
|
||||
|
||||
PluginManifest manifest = Plugins.GetPlugin(PluginId);
|
||||
|
||||
using (PluginConfigurationHandler configHandler = manifest.CreateConfigurationHandler())
|
||||
{
|
||||
if (configHandler.Post(dbContext, form, this))
|
||||
{
|
||||
dbContext.SaveChanges();
|
||||
|
||||
PluginsLog.LogPluginConfigurationSaved(manifest.Id, DiscoApplication.CurrentUser.Id);
|
||||
|
||||
return RedirectToAction(MVC.Config.Plugins.Index());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Config Errors
|
||||
PluginConfigurationViewModel vm = new PluginConfigurationViewModel(configHandler.Get(dbContext, this));
|
||||
return View(Views.Configure, vm);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public virtual ActionResult Configure(string PluginId)
|
||||
{
|
||||
if (string.IsNullOrEmpty(PluginId))
|
||||
return RedirectToAction(MVC.Config.Plugins.Index());
|
||||
|
||||
PluginManifest manifest = Plugins.GetPlugin(PluginId);
|
||||
|
||||
using (PluginConfigurationHandler configHandler = manifest.CreateConfigurationHandler())
|
||||
{
|
||||
PluginConfigurationViewModel vm = new PluginConfigurationViewModel(configHandler.Get(dbContext, this));
|
||||
PluginsLog.LogPluginConfigurationLoaded(manifest.Id, DiscoApplication.CurrentUser.Id);
|
||||
return View(Views.Configure, vm);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
//public virtual ActionResult PluginAction(string PluginId, string PluginAction)
|
||||
//{
|
||||
// if (string.IsNullOrEmpty(PluginId))
|
||||
// return HttpNotFound("PluginId is Required");
|
||||
// if (string.IsNullOrEmpty(PluginAction))
|
||||
// return HttpNotFound("PluginAction is Required");
|
||||
|
||||
// PluginManifest def = Plugins.GetPlugin(PluginId);
|
||||
|
||||
// using (Plugin instance = def.CreateInstance())
|
||||
// {
|
||||
// IPluginWebController instanceController = instance as IPluginWebController;
|
||||
|
||||
// if (instanceController == null)
|
||||
// return HttpNotFound("Plugin is not a Web Controller");
|
||||
|
||||
// PluginsLog.LogPluginWebControllerAccessed(instance.Id, PluginAction, DiscoApplication.CurrentUser.Id);
|
||||
|
||||
// try
|
||||
// {
|
||||
// return instanceController.ExecuteAction(PluginAction, this);
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// PluginsLog.LogPluginException("Disco Plugin Web Controller Action", new PluginWebControllerException(instance.Id, PluginAction, ex));
|
||||
// return null;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Controllers
|
||||
{
|
||||
public partial class SystemConfigController : dbAdminController
|
||||
{
|
||||
[HttpGet]
|
||||
public virtual ActionResult Index()
|
||||
{
|
||||
var m = Models.SystemConfig.IndexModel.FromConfiguration(dbContext.DiscoConfiguration);
|
||||
return View(m);
|
||||
}
|
||||
[HttpPost]
|
||||
public virtual ActionResult Index(Models.SystemConfig.IndexModel config)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
config.ToConfiguration(dbContext);
|
||||
return RedirectToAction(MVC.Config.Config.Index());
|
||||
}
|
||||
else
|
||||
{
|
||||
return View();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using Disco.Models.BI.Interop.Community;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.Config
|
||||
{
|
||||
public class IndexModel
|
||||
{
|
||||
public bool UpdateAvailable
|
||||
{
|
||||
get
|
||||
{
|
||||
if (UpdateResponse != null)
|
||||
{
|
||||
var updateVersion = Version.Parse(UpdateResponse.Version);
|
||||
return (updateVersion > typeof(DiscoApplication).Assembly.GetName().Version);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public UpdateResponse UpdateResponse { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using Disco.Data.Repository;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.DeviceBatch
|
||||
{
|
||||
public class IndexModel
|
||||
{
|
||||
public List<_IndexModelDeviceBatch> DeviceBatches { get; set; }
|
||||
|
||||
public static IndexModel Build(DiscoDataContext dbContext)
|
||||
{
|
||||
var m = new IndexModel();
|
||||
m.DeviceBatches = dbContext.DeviceBatches.OrderBy(db => db.Name).Select(db => new _IndexModelDeviceBatch()
|
||||
{
|
||||
Id = db.Id,
|
||||
Name = db.Name,
|
||||
PurchaseDate = db.PurchaseDate,
|
||||
PurchaseUnitQuantity = db.UnitQuantity,
|
||||
DeviceCount = db.Devices.Count,
|
||||
DeviceDecommissionedCount = db.Devices.Count(d=> d.DecommissionedDate.HasValue),
|
||||
DefaultDeviceModel = db.DefaultDeviceModel.Description,
|
||||
WarrantyExpires = db.WarrantyValidUntil,
|
||||
InsuranceSupplier = db.InsuranceSupplier,
|
||||
InsuredUntil = db.InsuredUntil
|
||||
}).ToList();
|
||||
|
||||
return m;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.DeviceBatch
|
||||
{
|
||||
public class ShowModel
|
||||
{
|
||||
public Disco.Models.Repository.DeviceBatch DeviceBatch { get; set; }
|
||||
public List<SelectListItem> DeviceModels { get; set; }
|
||||
public int DeviceCount { get; set; }
|
||||
public int DeviceDecommissionedCount { get; set; }
|
||||
public bool CanDelete { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.DeviceBatch
|
||||
{
|
||||
public class _IndexModelDeviceBatch
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
[Required(), DisplayFormat(ApplyFormatInEditMode = true, ConvertEmptyStringToNull = true, DataFormatString = "{0:yyyy/MM/dd}", HtmlEncode = false)]
|
||||
public DateTime PurchaseDate { get; set; }
|
||||
public int DeviceCount { get; set; }
|
||||
public int DeviceDecommissionedCount { get; set; }
|
||||
public int? PurchaseUnitQuantity { get; set; }
|
||||
public string DefaultDeviceModel { get; set; }
|
||||
public DateTime? WarrantyExpires { get; set; }
|
||||
public DateTime? InsuredUntil { get; set; }
|
||||
public string InsuranceSupplier { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.DeviceModel
|
||||
{
|
||||
public class DeviceComponentsModel
|
||||
{
|
||||
public int? DeviceModelId { get; set; }
|
||||
public List<Disco.Models.Repository.DeviceComponent> DeviceComponents { get; set; }
|
||||
|
||||
public List<Disco.Models.Repository.JobSubType> JobSubTypes { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using Disco.Data.Repository;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.DeviceModel
|
||||
{
|
||||
public class IndexModel
|
||||
{
|
||||
public List<_IndexModelDeviceModel> DeviceModels { get; set; }
|
||||
|
||||
public static IndexModel Build(DiscoDataContext dbContext)
|
||||
{
|
||||
var m = new IndexModel();
|
||||
m.DeviceModels = dbContext.DeviceModels.OrderBy(dm => dm.Description).Select(dm => new _IndexModelDeviceModel()
|
||||
{
|
||||
Id = dm.Id,
|
||||
Name = dm.Description,
|
||||
Manufacturer = dm.Manufacturer,
|
||||
Model = dm.Model,
|
||||
ModelType = dm.ModelType,
|
||||
DeviceCount = dm.Devices.Count
|
||||
}).ToList();
|
||||
|
||||
return m;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using Disco.Services.Plugins;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.DeviceModel
|
||||
{
|
||||
public class ShowModel
|
||||
{
|
||||
public Disco.Models.Repository.DeviceModel DeviceModel { get; set; }
|
||||
|
||||
public Models.DeviceModel.DeviceComponentsModel DeviceComponentsModel { get; set; }
|
||||
|
||||
public List<PluginFeatureManifest> WarrantyProviders { get; set; }
|
||||
|
||||
public bool CanDelete { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.DeviceModel
|
||||
{
|
||||
public class _IndexModelDeviceModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Manufacturer { get; set; }
|
||||
public string Model { get; set; }
|
||||
public string ModelType { get; set; }
|
||||
public int DeviceCount { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
if (string.IsNullOrEmpty(Name))
|
||||
return string.Format("{0} {1}", Manufacturer, Model);
|
||||
else
|
||||
return Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.DeviceProfile
|
||||
{
|
||||
public class DefaultsModel
|
||||
{
|
||||
public List<Disco.Models.Repository.DeviceProfile> DeviceProfiles { get; set; }
|
||||
public List<Disco.Models.Repository.DeviceProfile> DeviceProfilesAndNone { get; set; }
|
||||
public int Default { get; set; }
|
||||
public int DefaultAddDeviceOffline { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using Disco.Data.Repository;
|
||||
using Disco.BI.Extensions;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.DeviceProfile
|
||||
{
|
||||
public class IndexModel
|
||||
{
|
||||
public List<_IndexModelDeviceProfile> DeviceProfiles { get; set; }
|
||||
|
||||
public static IndexModel Build(DiscoDataContext dbContext)
|
||||
{
|
||||
var m = new IndexModel();
|
||||
m.DeviceProfiles = dbContext.DeviceProfiles.OrderBy(dp => dp.Name).Select(dp => new _IndexModelDeviceProfile()
|
||||
{
|
||||
Id = dp.Id,
|
||||
Name = dp.Name,
|
||||
ShortName = dp.ShortName,
|
||||
Address = dp.DefaultOrganisationAddress,
|
||||
Description = dp.Description,
|
||||
DistributionTypeId = dp.DistributionTypeDb,
|
||||
DeviceCount = dp.Devices.Count,
|
||||
DeviceDecommissionedCount = dp.Devices.Count(d => d.DecommissionedDate.HasValue)
|
||||
}).ToList();
|
||||
|
||||
if (DiscoApplication.MultiSiteMode)
|
||||
{
|
||||
foreach (var dp in m.DeviceProfiles)
|
||||
if (dp.Address.HasValue)
|
||||
dp.AddressName = dbContext.DiscoConfiguration.OrganisationAddresses.GetAddress(dp.Address.Value).Name;
|
||||
}
|
||||
|
||||
return m;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using Disco.Services.Plugins;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.DeviceProfile
|
||||
{
|
||||
public class ShowModel
|
||||
{
|
||||
public Disco.Models.Repository.DeviceProfile DeviceProfile { get; set; }
|
||||
public List<SelectListItem> DeviceProfileDistributionTypes { get; set; }
|
||||
public List<Disco.Models.BI.Config.OrganisationAddress> OrganisationAddresses { get; set; }
|
||||
|
||||
public List<PluginFeatureManifest> CertificateProviders { get; set; }
|
||||
|
||||
public bool CanDelete { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.DeviceProfile
|
||||
{
|
||||
public class _IndexModelDeviceProfile
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string ShortName { get; set; }
|
||||
public int? Address { get; set; }
|
||||
//public string AddressShortName { get; set; }
|
||||
public string AddressName { get; set; }
|
||||
public string Description { get; set; }
|
||||
public int DistributionTypeId { get; set; }
|
||||
|
||||
public string DistributionType
|
||||
{
|
||||
get
|
||||
{
|
||||
return Enum.GetName(typeof(Disco.Models.Repository.DeviceProfile.DistributionTypes), this.DistributionTypeId);
|
||||
}
|
||||
}
|
||||
|
||||
public int DeviceCount { get; set; }
|
||||
public int DeviceDecommissionedCount { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Disco.Data.Repository;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.DocumentTemplate
|
||||
{
|
||||
[CustomValidation(typeof(CreateModelValidation), "ValidateCreateModel")]
|
||||
public class CreateModel
|
||||
{
|
||||
public Disco.Models.Repository.DocumentTemplate DocumentTemplate { get; set; }
|
||||
|
||||
[Required]
|
||||
public HttpPostedFileBase Template { get; set; }
|
||||
|
||||
public List<string> Types { get; set; }
|
||||
public List<string> SubTypes { get; set; }
|
||||
|
||||
public List<Disco.Models.Repository.JobType> JobTypes { get; set; }
|
||||
public List<Disco.Models.Repository.JobSubType> JobSubTypes { get; set; }
|
||||
|
||||
public List<string> Scopes
|
||||
{
|
||||
get
|
||||
{
|
||||
return Disco.Models.Repository.DocumentTemplate.DocumentTemplateScopes.ToList();
|
||||
}
|
||||
}
|
||||
|
||||
public List<Disco.Models.Repository.JobType> GetJobTypes
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Types != null)
|
||||
{
|
||||
var types = this.Types;
|
||||
return this.JobTypes.Where(m => types.Contains(m.Id)).ToList();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
public List<Disco.Models.Repository.JobSubType> GetJobSubTypes
|
||||
{
|
||||
get
|
||||
{
|
||||
if (SubTypes != null)
|
||||
{
|
||||
var subTypes = this.SubTypes;
|
||||
return this.JobSubTypes.Where(m => subTypes.Contains(String.Format("{0}_{1}", m.JobTypeId, m.Id))).ToList();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateModel(DiscoDataContext dbContext)
|
||||
{
|
||||
if (this.JobTypes == null)
|
||||
JobTypes = dbContext.JobTypes.ToList();
|
||||
if (this.JobSubTypes == null)
|
||||
JobSubTypes = dbContext.JobSubTypes.ToList();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class CreateModelValidation
|
||||
{
|
||||
|
||||
public static ValidationResult ValidateCreateModel(CreateModel model)
|
||||
{
|
||||
|
||||
if (model.DocumentTemplate != null && model.DocumentTemplate.Scope == Disco.Models.Repository.DocumentTemplate.DocumentTemplateScopes.Job)
|
||||
{
|
||||
if (model.Types != null && model.SubTypes != null)
|
||||
{
|
||||
var typeId = string.Format("{0}_", model.Types);
|
||||
model.SubTypes = model.SubTypes.Where(m => model.Types.Contains(m.Substring(0, m.IndexOf("_")))).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
return ValidationResult.Success;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.DocumentTemplate
|
||||
{
|
||||
public class ExpressionBrowserModel
|
||||
{
|
||||
public string DeviceType { get; set; }
|
||||
public string UserType { get; set; }
|
||||
public string JobType { get; set; }
|
||||
|
||||
//public string DataExtType { get; set; }
|
||||
//public string DeviceExtType { get; set; }
|
||||
//public string UserExtType { get; set; }
|
||||
|
||||
public Dictionary<string, string> Variables { get; set; }
|
||||
public Dictionary<string, string> ExtensionLibraries { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.DocumentTemplate
|
||||
{
|
||||
public class IndexModel
|
||||
{
|
||||
public List<Disco.Models.Repository.DocumentTemplate> DocumentTemplates { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using Disco.Data.Repository;
|
||||
using Disco.Models.Repository;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.DocumentTemplate
|
||||
{
|
||||
public class ShowModel
|
||||
{
|
||||
public Disco.Models.Repository.DocumentTemplate DocumentTemplate { get; set; }
|
||||
|
||||
public int StoredInstanceCount { get; set; }
|
||||
|
||||
public List<Disco.BI.Expressions.Expression> TemplateExpressions { get; set; }
|
||||
|
||||
public List<string> Types { get; set; }
|
||||
public List<string> SubTypes { get; set; }
|
||||
|
||||
public List<Disco.Models.Repository.JobType> JobTypes { get; set; }
|
||||
public List<Disco.Models.Repository.JobSubType> JobSubTypes { get; set; }
|
||||
|
||||
public ShowModel()
|
||||
{
|
||||
this.Types = new List<string>();
|
||||
this.SubTypes = new List<string>();
|
||||
}
|
||||
|
||||
public List<string> Scopes
|
||||
{
|
||||
get
|
||||
{
|
||||
return Disco.Models.Repository.DocumentTemplate.DocumentTemplateScopes.ToList();
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateModel(DiscoDataContext dbContext)
|
||||
{
|
||||
|
||||
switch (this.DocumentTemplate.Scope)
|
||||
{
|
||||
case Disco.Models.Repository.DocumentTemplate.DocumentTemplateScopes.Device:
|
||||
this.StoredInstanceCount = dbContext.DeviceAttachments.Count(a => a.DocumentTemplateId == this.DocumentTemplate.Id);
|
||||
break;
|
||||
case Disco.Models.Repository.DocumentTemplate.DocumentTemplateScopes.Job:
|
||||
this.StoredInstanceCount = dbContext.JobAttachments.Count(a => a.DocumentTemplateId == this.DocumentTemplate.Id);
|
||||
break;
|
||||
case Disco.Models.Repository.DocumentTemplate.DocumentTemplateScopes.User:
|
||||
this.StoredInstanceCount = dbContext.UserAttachments.Count(a => a.DocumentTemplateId == this.DocumentTemplate.Id);
|
||||
break;
|
||||
}
|
||||
|
||||
if (this.JobTypes == null)
|
||||
JobTypes = dbContext.JobTypes.ToList();
|
||||
if (this.JobSubTypes == null)
|
||||
JobSubTypes = dbContext.JobSubTypes.ToList();
|
||||
|
||||
if (DocumentTemplate != null)
|
||||
{
|
||||
if (DocumentTemplate.JobSubTypes != null)
|
||||
{
|
||||
foreach (var jst in DocumentTemplate.JobSubTypes)
|
||||
{
|
||||
if (!Types.Contains(jst.JobTypeId))
|
||||
Types.Add(jst.JobTypeId);
|
||||
SubTypes.Add(string.Format("{0}_{1}", jst.JobTypeId, jst.Id));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using Disco.BI;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.DocumentTemplate
|
||||
{
|
||||
public class UndetectedPagesModel
|
||||
{
|
||||
|
||||
public List<Disco.Models.Repository.DocumentTemplate> DocumentTemplates { get; set; }
|
||||
|
||||
public List<SelectListItem> DocumentTemplatesSelectListItems
|
||||
{
|
||||
get
|
||||
{
|
||||
var list = new List<SelectListItem>();
|
||||
list.Add(new SelectListItem() { Selected = false, Value = "--DEVICE", Text = "<Generic Device Document>" });
|
||||
list.Add(new SelectListItem() { Selected = true, Value = "--JOB", Text = "<Generic Job Document>" });
|
||||
list.Add(new SelectListItem() { Selected = false, Value = "--USER", Text = "<Generic User Document>" });
|
||||
list.AddRange(this.DocumentTemplates.ToSelectListItems());
|
||||
return list;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.Enrolment
|
||||
{
|
||||
public class IndexModel
|
||||
{
|
||||
public string MacSshUsername { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.Expressions
|
||||
{
|
||||
public class EditorModel
|
||||
{
|
||||
public string Expression { get; set; }
|
||||
public Disco.Web.Areas.API.Models.Expressions.ValidateExpressionModel ExpressionException { get; set; }
|
||||
public string TestScope { get; set; }
|
||||
public string TestScopeDataType { get; set; }
|
||||
public string TestScopeDataId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using Disco.Services.Logging;
|
||||
using Disco.Services.Logging.Models;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.Logging
|
||||
{
|
||||
public class IndexModel
|
||||
{
|
||||
public Dictionary<LogBase, List<LogEventType>> LogModules { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.Logging
|
||||
{
|
||||
public class TaskStatusModel
|
||||
{
|
||||
public string SessionId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using Disco.Models.BI.Config;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.Organisation
|
||||
{
|
||||
public class IndexModel
|
||||
{
|
||||
public string OrganisationName { get; set; }
|
||||
[Display(Name="Enabled")]
|
||||
public bool MultiSiteMode { get; set; }
|
||||
public List<OrganisationAddress> OrganisationAddresses { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using Disco.Services.Plugins;
|
||||
using Disco.Services.Plugins.Features.Other;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.Plugins
|
||||
{
|
||||
public class IndexViewModel
|
||||
{
|
||||
public List<PluginManifest> PluginManifests { get; set; }
|
||||
|
||||
public List<Tuple<Type, List<PluginManifest>>> PluginManifestsByType
|
||||
{
|
||||
get
|
||||
{
|
||||
if (PluginManifests.Count == 0)
|
||||
return new List<Tuple<Type, List<PluginManifest>>>();
|
||||
|
||||
var categorisedManifests = PluginManifests.SelectMany(pm => pm.Features)
|
||||
.GroupBy(fm => fm.CategoryType)
|
||||
.Select(g => new Tuple<Type, List<PluginManifest>>(g.Key, g.Select(fm => fm.PluginManifest).Distinct().OrderBy(fm => fm.Name).ToList())).ToList();
|
||||
|
||||
// Ensure all plugins are represented
|
||||
var allCategorisedManifests = categorisedManifests.SelectMany(g => g.Item2).ToList();
|
||||
|
||||
var unrepresentedPlugins = PluginManifests.Where(m => !allCategorisedManifests.Contains(m)).ToList();
|
||||
if (unrepresentedPlugins.Count > 0)
|
||||
{
|
||||
Tuple<Type, List<PluginManifest>> otherCategory = null;
|
||||
foreach (var category in categorisedManifests)
|
||||
{
|
||||
if (category.Item1 == typeof(OtherFeature))
|
||||
{
|
||||
otherCategory = category;
|
||||
}
|
||||
}
|
||||
if (otherCategory == null)
|
||||
{
|
||||
otherCategory = new Tuple<Type, List<PluginManifest>>(typeof(OtherFeature), new List<PluginManifest>());
|
||||
categorisedManifests.Add(otherCategory);
|
||||
}
|
||||
foreach (var pluginManifest in unrepresentedPlugins)
|
||||
otherCategory.Item2.Add(pluginManifest);
|
||||
}
|
||||
|
||||
return categorisedManifests;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using Disco.Services.Plugins;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.Plugins
|
||||
{
|
||||
public class PluginConfigurationViewModel
|
||||
{
|
||||
public PluginManifest Manifest { get; set; }
|
||||
public Type PluginViewType { get; set; }
|
||||
public object PluginViewModel { get; set; }
|
||||
|
||||
public PluginConfigurationViewModel(PluginConfigurationHandler.PluginConfigurationHandlerGetResponse response)
|
||||
{
|
||||
this.Manifest = response.Manifest;
|
||||
|
||||
this.PluginViewType = response.ViewType;
|
||||
this.PluginViewModel = response.ViewModel;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.Shared
|
||||
{
|
||||
public class LogEventsModel
|
||||
{
|
||||
public bool IsLive { get; set; }
|
||||
public Disco.Services.Logging.LogBase ModuleFilter { get; set; }
|
||||
public IEnumerable<Disco.Services.Logging.Models.LogEventType> EventTypesFilter { get; set; }
|
||||
public int? TakeFilter { get; set; }
|
||||
public DateTime? StartFilter { get; set; }
|
||||
public DateTime? EndFilter { get; set; }
|
||||
public int? ViewPortHeight { get; set; }
|
||||
public int? ViewPortWidth { get; set; }
|
||||
public string JavascriptLiveEventFunctionName { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using Disco.Data.Configuration;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Data.SqlClient;
|
||||
using Disco.Data.Repository;
|
||||
using Disco.Models.BI.Interop.Community;
|
||||
using Disco.Services.Tasks;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.SystemConfig
|
||||
{
|
||||
public class IndexModel
|
||||
{
|
||||
public Version DiscoVersion { get; set; }
|
||||
public DateTime? DiscoVersionBuilt
|
||||
{
|
||||
get
|
||||
{
|
||||
var v = DiscoVersion;
|
||||
if (v != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
return new DateTime(v.Minor + 2011, v.Build / 100, v.Build % 100, v.Revision / 100, v.Revision % 100, 0);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public string DataStoreLocation { get; set; }
|
||||
|
||||
#region Database Connection
|
||||
private Lazy<SqlConnectionStringBuilder> DatabaseConnectionString = new Lazy<SqlConnectionStringBuilder>(() =>
|
||||
{
|
||||
return new SqlConnectionStringBuilder(Disco.Data.Repository.DiscoDatabaseConnectionFactory.DiscoDataContextConnectionString);
|
||||
});
|
||||
public string DatabaseServer
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.DatabaseConnectionString.Value.DataSource;
|
||||
}
|
||||
}
|
||||
public string DatabaseName
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.DatabaseConnectionString.Value.InitialCatalog;
|
||||
}
|
||||
}
|
||||
public string DatabaseAuthentication
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.DatabaseConnectionString.Value.IntegratedSecurity ? "Integrated Authentication" : "SQL Authentication";
|
||||
}
|
||||
}
|
||||
public string DatabaseSqlAuthUsername
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.DatabaseConnectionString.Value.IntegratedSecurity ? null : this.DatabaseConnectionString.Value.UserID;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Proxy
|
||||
public string ProxyAddress { get; set; }
|
||||
public int ProxyPort { get; set; }
|
||||
public string ProxyUsername { get; set; }
|
||||
[DataType(DataType.Password)]
|
||||
public string ProxyPassword { get; set; }
|
||||
#endregion
|
||||
|
||||
public ScheduledTaskStatus UpdateRunningStatus { get; set; }
|
||||
public DateTime? UpdateNextScheduled { get; set; }
|
||||
public UpdateResponse UpdateLatestResponse { get; set; }
|
||||
public bool UpdateBetaDeployment { get; set; }
|
||||
|
||||
public static IndexModel FromConfiguration(ConfigurationContext config)
|
||||
{
|
||||
return new IndexModel()
|
||||
{
|
||||
DiscoVersion = typeof(DiscoApplication).Assembly.GetName().Version,
|
||||
DataStoreLocation = config.DataStoreLocation,
|
||||
ProxyAddress = config.ProxyAddress,
|
||||
ProxyPort = config.ProxyPort,
|
||||
ProxyUsername = config.ProxyUsername,
|
||||
ProxyPassword = config.ProxyPassword,
|
||||
UpdateLatestResponse = config.UpdateLastCheck,
|
||||
UpdateRunningStatus = Disco.BI.Interop.Community.UpdateCheckTask.RunningStatus,
|
||||
UpdateNextScheduled = Disco.BI.Interop.Community.UpdateCheckTask.NextScheduled,
|
||||
UpdateBetaDeployment = config.UpdateBetaDeployment
|
||||
};
|
||||
}
|
||||
|
||||
public void ToConfiguration(DiscoDataContext db)
|
||||
{
|
||||
ConfigurationContext config = db.DiscoConfiguration;
|
||||
//config.DataStoreLocation = DataStoreLocation;
|
||||
config.ProxyAddress = ProxyAddress;
|
||||
config.ProxyPort = ProxyPort;
|
||||
config.ProxyUsername = ProxyUsername;
|
||||
config.ProxyPassword = ProxyPassword;
|
||||
DiscoApplication.SetGlobalProxy(ProxyAddress, ProxyPort, ProxyUsername, ProxyPassword);
|
||||
|
||||
db.SaveChanges();
|
||||
|
||||
// Try and check for updates if needed - After Proxy Changed
|
||||
if (db.DiscoConfiguration.UpdateLastCheck == null
|
||||
|| db.DiscoConfiguration.UpdateLastCheck.ResponseTimestamp < DateTime.Now.AddDays(-1))
|
||||
{
|
||||
Disco.BI.Interop.Community.UpdateCheckTask.ScheduleNow();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.WirelessCertificate
|
||||
{
|
||||
public class IndexModel
|
||||
{
|
||||
public int Total { get; set; }
|
||||
public int Unallocated { get; set; }
|
||||
public int Allocated { get; set; }
|
||||
public string Provider { get; set; }
|
||||
public int AutoBufferMax { get; set; }
|
||||
public int AutoBufferLow { get; set; }
|
||||
public bool Processing { get; set; }
|
||||
|
||||
public string eduSTAR_SchoolId { get; set; }
|
||||
public string eduSTAR_Username { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
@model Disco.Web.Areas.Config.Models.Config.IndexModel
|
||||
@{
|
||||
ViewBag.Title = "Configuration";
|
||||
}
|
||||
<table id="pageMenu">
|
||||
<tr>
|
||||
<td>
|
||||
<div class="pageMenuArea">
|
||||
<h2>Hosting</h2>
|
||||
@Html.ActionLinkClass("System", MVC.Config.SystemConfig.Index(), "config")
|
||||
<div class="pageMenuBlurb">
|
||||
Update system configuration, such as the Data Storage Location and Proxy settings.
|
||||
</div>
|
||||
@Html.ActionLinkClass("Organisation Details", MVC.Config.Organisation.Index(), "config")
|
||||
<div class="pageMenuBlurb">
|
||||
Update the Organisation Name, Logo and Addresses associated with this organisation.
|
||||
</div>
|
||||
@Html.ActionLinkClass("Logging", MVC.Config.Logging.Index(), "config")
|
||||
<div class="pageMenuBlurb">
|
||||
Export Log files from various Disco Modules and view Live Logging.
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="pageMenuArea">
|
||||
<h2>Devices</h2>
|
||||
@Html.ActionLinkClass("Models", MVC.Config.DeviceModel.Index(), "config")
|
||||
<div class="pageMenuBlurb">
|
||||
Configure Components, Product Images and default settings for Device Models.
|
||||
</div>
|
||||
@Html.ActionLinkClass("Batches", MVC.Config.DeviceBatch.Index(), "config")
|
||||
<div class="pageMenuBlurb">
|
||||
Create and Configure Device Batches.
|
||||
</div>
|
||||
@Html.ActionLinkClass("Profiles", MVC.Config.DeviceProfile.Index(), "config")
|
||||
<div class="pageMenuBlurb">
|
||||
Configure Device Profiles including computer name generation, distribution and Active
|
||||
Directory OU layout.
|
||||
</div>
|
||||
@Html.ActionLinkClass("Enrolment", MVC.Config.Enrolment.Index(), "config")
|
||||
<div class="pageMenuBlurb">
|
||||
Configure Enrolment settings including secure credentials.
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="pageMenuArea">
|
||||
<h2>Features</h2>
|
||||
@Html.ActionLinkClass("Document Templates", MVC.Config.DocumentTemplate.Index(), "config")
|
||||
<div class="pageMenuBlurb">
|
||||
Create, Update and Bulk Generate documents based on PDF Templates for Jobs, Devices
|
||||
and Users.
|
||||
</div>
|
||||
@Html.ActionLinkClass("Plugins", MVC.Config.Plugins.Index(), "config")
|
||||
<div class="pageMenuBlurb">
|
||||
Manage extensions to the Disco platform.
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@{
|
||||
if (Model.UpdateAvailable)
|
||||
{
|
||||
<div id="updateAvailableContainer">
|
||||
<div>An updated version of Disco is available</div>
|
||||
<a href="@Model.UpdateResponse.UrlLink" target="_blank">Download Disco v@(Model.UpdateResponse.Version)</a>
|
||||
</div>
|
||||
<script>
|
||||
(function () {
|
||||
$(function () {
|
||||
var layout_PageHeading = $('#layout_PageHeading').height(80);
|
||||
var updateAvailableContainer = $('#updateAvailableContainer');
|
||||
updateAvailableContainer.appendTo(layout_PageHeading);
|
||||
@{
|
||||
if (Model.UpdateResponse.VersionReleasedTimestamp < DateTime.Now.AddDays(-7))
|
||||
{
|
||||
<text>
|
||||
updateAvailableContainer.effect("shake", { times: 3 }, 100);
|
||||
</text>
|
||||
}
|
||||
}
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,304 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.17929
|
||||
//
|
||||
// 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.Config
|
||||
{
|
||||
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.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/Config/Index.cshtml")]
|
||||
public class Index : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.Config.IndexModel>
|
||||
{
|
||||
public Index()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 2 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
|
||||
ViewBag.Title = "Configuration";
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n<table");
|
||||
|
||||
WriteLiteral(" id=\"pageMenu\"");
|
||||
|
||||
WriteLiteral(">\r\n <tr>\r\n <td>\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"pageMenuArea\"");
|
||||
|
||||
WriteLiteral(">\r\n <h2>Hosting</h2>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 10 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
Write(Html.ActionLinkClass("System", MVC.Config.SystemConfig.Index(), "config"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"pageMenuBlurb\"");
|
||||
|
||||
WriteLiteral(">\r\n Update system configuration, such as the Data Storage Loca" +
|
||||
"tion and Proxy settings.\r\n </div>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 14 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
Write(Html.ActionLinkClass("Organisation Details", MVC.Config.Organisation.Index(), "config"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"pageMenuBlurb\"");
|
||||
|
||||
WriteLiteral(">\r\n Update the Organisation Name, Logo and Addresses associate" +
|
||||
"d with this organisation.\r\n </div>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 18 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
Write(Html.ActionLinkClass("Logging", MVC.Config.Logging.Index(), "config"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"pageMenuBlurb\"");
|
||||
|
||||
WriteLiteral(">\r\n Export Log files from various Disco Modules and view Live " +
|
||||
"Logging.\r\n </div>\r\n </div>\r\n </td>\r\n <td" +
|
||||
">\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"pageMenuArea\"");
|
||||
|
||||
WriteLiteral(">\r\n <h2>Devices</h2>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 27 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
Write(Html.ActionLinkClass("Models", MVC.Config.DeviceModel.Index(), "config"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"pageMenuBlurb\"");
|
||||
|
||||
WriteLiteral(">\r\n Configure Components, Product Images and default settings " +
|
||||
"for Device Models.\r\n </div>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 31 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
Write(Html.ActionLinkClass("Batches", MVC.Config.DeviceBatch.Index(), "config"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"pageMenuBlurb\"");
|
||||
|
||||
WriteLiteral(">\r\n Create and Configure Device Batches.\r\n </di" +
|
||||
"v>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 35 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
Write(Html.ActionLinkClass("Profiles", MVC.Config.DeviceProfile.Index(), "config"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"pageMenuBlurb\"");
|
||||
|
||||
WriteLiteral(">\r\n Configure Device Profiles including computer name generati" +
|
||||
"on, distribution and Active\r\n Directory OU layout.\r\n " +
|
||||
" </div>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 40 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
Write(Html.ActionLinkClass("Enrolment", MVC.Config.Enrolment.Index(), "config"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"pageMenuBlurb\"");
|
||||
|
||||
WriteLiteral(">\r\n Configure Enrolment settings including secure credentials." +
|
||||
"\r\n </div>\r\n </div>\r\n </td>\r\n <td>\r\n " +
|
||||
" <div");
|
||||
|
||||
WriteLiteral(" class=\"pageMenuArea\"");
|
||||
|
||||
WriteLiteral(">\r\n <h2>Features</h2>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 49 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
Write(Html.ActionLinkClass("Document Templates", MVC.Config.DocumentTemplate.Index(), "config"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"pageMenuBlurb\"");
|
||||
|
||||
WriteLiteral(">\r\n Create, Update and Bulk Generate documents based on PDF Te" +
|
||||
"mplates for Jobs, Devices\r\n and Users.\r\n </div" +
|
||||
">\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 54 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
Write(Html.ActionLinkClass("Plugins", MVC.Config.Plugins.Index(), "config"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"pageMenuBlurb\"");
|
||||
|
||||
WriteLiteral(">\r\n Manage extensions to the Disco platform.\r\n " +
|
||||
"</div>\r\n </div>\r\n </td>\r\n </tr>\r\n</table>\r\n");
|
||||
|
||||
|
||||
#line 62 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
|
||||
if (Model.UpdateAvailable)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" id=\"updateAvailableContainer\"");
|
||||
|
||||
WriteLiteral(">\r\n <div>An updated version of Disco is available</div>\r\n <a");
|
||||
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 3034), Tuple.Create("\"", 3070)
|
||||
|
||||
#line 67 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 3041), Tuple.Create<System.Object, System.Int32>(Model.UpdateResponse.UrlLink
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 3041), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" target=\"_blank\"");
|
||||
|
||||
WriteLiteral(">Download Disco v");
|
||||
|
||||
|
||||
#line 67 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
Write(Model.UpdateResponse.Version);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</a>\r\n </div>\r\n");
|
||||
|
||||
WriteLiteral(@" <script>
|
||||
(function () {
|
||||
$(function () {
|
||||
var layout_PageHeading = $('#layout_PageHeading').height(80);
|
||||
var updateAvailableContainer = $('#updateAvailableContainer');
|
||||
updateAvailableContainer.appendTo(layout_PageHeading);
|
||||
");
|
||||
|
||||
|
||||
#line 75 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 75 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
|
||||
if (Model.UpdateResponse.VersionReleasedTimestamp < DateTime.Now.AddDays(-7))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" ");
|
||||
|
||||
WriteLiteral("\r\n updateAvailableContainer.effect(\"shake\", { times: 3 }, 100);\r\n " +
|
||||
" ");
|
||||
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
|
||||
#line 81 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n });\r\n })();\r\n </script>\r\n");
|
||||
|
||||
|
||||
#line 86 "..\..\Areas\Config\Views\Config\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -0,0 +1,39 @@
|
||||
@model Disco.Models.Repository.DeviceBatch
|
||||
@{
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Batches", MVC.Config.DeviceBatch.Index(null), "Create");
|
||||
}
|
||||
@using (Html.BeginForm())
|
||||
{
|
||||
<div class="form" style="width: 450px">
|
||||
<table>
|
||||
<tr>
|
||||
<th>
|
||||
Name:
|
||||
</th>
|
||||
<td>
|
||||
@Html.EditorFor(model => model.Name)<br />@Html.ValidationMessageFor(model => model.Name)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Purchase Date:
|
||||
</th>
|
||||
<td>@Html.EditorFor(model => model.PurchaseDate)<br />@Html.ValidationMessageFor(model => model.PurchaseDate)
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p class="actions">
|
||||
<input type="submit" class="button" value="Create" />
|
||||
</p>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$('#Name').focus().select();
|
||||
$('#PurchaseDate').datepicker({
|
||||
changeYear: true,
|
||||
changeMonth: true,
|
||||
dateFormat: 'yy/mm/dd'
|
||||
})
|
||||
});
|
||||
</script>
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.17929
|
||||
//
|
||||
// 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.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DeviceBatch/Create.cshtml")]
|
||||
public class Create : System.Web.Mvc.WebViewPage<Disco.Models.Repository.DeviceBatch>
|
||||
{
|
||||
public Create()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 2 "..\..\Areas\Config\Views\DeviceBatch\Create.cshtml"
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Batches", MVC.Config.DeviceBatch.Index(null), "Create");
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
|
||||
#line 5 "..\..\Areas\Config\Views\DeviceBatch\Create.cshtml"
|
||||
using (Html.BeginForm())
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"form\"");
|
||||
|
||||
WriteLiteral(" style=\"width: 450px\"");
|
||||
|
||||
WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th>\r\n N" +
|
||||
"ame:\r\n </th>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 14 "..\..\Areas\Config\Views\DeviceBatch\Create.cshtml"
|
||||
Write(Html.EditorFor(model => model.Name));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("<br />");
|
||||
|
||||
|
||||
#line 14 "..\..\Areas\Config\Views\DeviceBatch\Create.cshtml"
|
||||
Write(Html.ValidationMessageFor(model => model.Name));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
|
||||
">\r\n Purchase Date:\r\n </th>\r\n <t" +
|
||||
"d>");
|
||||
|
||||
|
||||
#line 21 "..\..\Areas\Config\Views\DeviceBatch\Create.cshtml"
|
||||
Write(Html.EditorFor(model => model.PurchaseDate));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("<br />");
|
||||
|
||||
|
||||
#line 21 "..\..\Areas\Config\Views\DeviceBatch\Create.cshtml"
|
||||
Write(Html.ValidationMessageFor(model => model.PurchaseDate));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n </table>\r\n <p");
|
||||
|
||||
WriteLiteral(" class=\"actions\"");
|
||||
|
||||
WriteLiteral(">\r\n <input");
|
||||
|
||||
WriteLiteral(" type=\"submit\"");
|
||||
|
||||
WriteLiteral(" class=\"button\"");
|
||||
|
||||
WriteLiteral(" value=\"Create\"");
|
||||
|
||||
WriteLiteral(" />\r\n </p>\r\n </div>\r\n");
|
||||
|
||||
WriteLiteral(" <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
$(function () {
|
||||
$('#Name').focus().select();
|
||||
$('#PurchaseDate').datepicker({
|
||||
changeYear: true,
|
||||
changeMonth: true,
|
||||
dateFormat: 'yy/mm/dd'
|
||||
})
|
||||
});
|
||||
</script>
|
||||
");
|
||||
|
||||
|
||||
#line 39 "..\..\Areas\Config\Views\DeviceBatch\Create.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -0,0 +1,69 @@
|
||||
@model Disco.Web.Areas.Config.Models.DeviceBatch.IndexModel
|
||||
@{
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Batches");
|
||||
}
|
||||
<table class="tableData">
|
||||
<tr>
|
||||
<th>
|
||||
Name
|
||||
</th>
|
||||
<th>
|
||||
Default Model
|
||||
</th>
|
||||
<th>
|
||||
Purchase Date
|
||||
</th>
|
||||
<th>
|
||||
Warranty Expires
|
||||
</th>
|
||||
<th>
|
||||
Insurance Expires
|
||||
</th>
|
||||
<th>
|
||||
Device Count
|
||||
</th>
|
||||
</tr>
|
||||
@foreach (var item in Model.DeviceBatches)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@Html.ActionLink(item.Name, MVC.Config.DeviceBatch.Index(item.Id))
|
||||
</td>
|
||||
<td>
|
||||
@item.DefaultDeviceModel
|
||||
</td>
|
||||
<td>
|
||||
@CommonHelpers.FriendlyDate(item.PurchaseDate)
|
||||
</td>
|
||||
<td>
|
||||
@CommonHelpers.FriendlyDate(item.WarrantyExpires, "Unknown")
|
||||
</td>
|
||||
<td>
|
||||
@CommonHelpers.FriendlyDate(item.InsuredUntil, item.InsuranceSupplier == null ? "N/A" : "Unknown")
|
||||
@(item.InsuranceSupplier == null ? string.Empty : string.Format("[{0}]", item.InsuranceSupplier))
|
||||
</td>
|
||||
<td>
|
||||
@if (item.PurchaseUnitQuantity.HasValue)
|
||||
{
|
||||
<span>@item.DeviceCount.ToString("n0")/@(item.PurchaseUnitQuantity.Value.ToString("n0"))</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
@item.DeviceCount.ToString("n0")
|
||||
}
|
||||
@if (item.DeviceDecommissionedCount > 0)
|
||||
{
|
||||
<span class="smallMessage" title="@(item.DeviceDecommissionedCount) Decommissioned">
|
||||
(@(item.DeviceDecommissionedCount))</span>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
<div class="actionBar">
|
||||
@if (Model.DeviceBatches.Count > 0)
|
||||
{
|
||||
@Html.ActionLinkButton("Timeline", MVC.Config.DeviceBatch.Timeline())
|
||||
}
|
||||
@Html.ActionLinkButton("Create Device Batch", MVC.Config.DeviceBatch.Create())
|
||||
</div>
|
||||
@@ -0,0 +1,319 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.17929
|
||||
//
|
||||
// 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.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DeviceBatch/Index.cshtml")]
|
||||
public class Index : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.DeviceBatch.IndexModel>
|
||||
{
|
||||
public Index()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 2 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Batches");
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n<table");
|
||||
|
||||
WriteLiteral(" class=\"tableData\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
<tr>
|
||||
<th>
|
||||
Name
|
||||
</th>
|
||||
<th>
|
||||
Default Model
|
||||
</th>
|
||||
<th>
|
||||
Purchase Date
|
||||
</th>
|
||||
<th>
|
||||
Warranty Expires
|
||||
</th>
|
||||
<th>
|
||||
Insurance Expires
|
||||
</th>
|
||||
<th>
|
||||
Device Count
|
||||
</th>
|
||||
</tr>
|
||||
");
|
||||
|
||||
|
||||
#line 26 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 26 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
|
||||
foreach (var item in Model.DeviceBatches)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <tr>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 30 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
|
||||
Write(Html.ActionLink(item.Name, MVC.Config.DeviceBatch.Index(item.Id)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 33 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
|
||||
Write(item.DefaultDeviceModel);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 36 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
|
||||
Write(CommonHelpers.FriendlyDate(item.PurchaseDate));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 39 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
|
||||
Write(CommonHelpers.FriendlyDate(item.WarrantyExpires, "Unknown"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 42 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
|
||||
Write(CommonHelpers.FriendlyDate(item.InsuredUntil, item.InsuranceSupplier == null ? "N/A" : "Unknown"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 43 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
|
||||
Write(item.InsuranceSupplier == null ? string.Empty : string.Format("[{0}]", item.InsuranceSupplier));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n <td>\r\n");
|
||||
|
||||
|
||||
#line 46 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 46 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
|
||||
if (item.PurchaseUnitQuantity.HasValue)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <span>");
|
||||
|
||||
|
||||
#line 48 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
|
||||
Write(item.DeviceCount.ToString("n0"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("/");
|
||||
|
||||
|
||||
#line 48 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
|
||||
Write(item.PurchaseUnitQuantity.Value.ToString("n0"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</span>\r\n");
|
||||
|
||||
|
||||
#line 49 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 52 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
|
||||
Write(item.DeviceCount.ToString("n0"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 52 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
|
||||
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 54 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
|
||||
if (item.DeviceDecommissionedCount > 0)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <span");
|
||||
|
||||
WriteLiteral(" class=\"smallMessage\"");
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 1775), Tuple.Create("\"", 1831)
|
||||
|
||||
#line 56 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1783), Tuple.Create<System.Object, System.Int32>(item.DeviceDecommissionedCount
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 1783), false)
|
||||
, Tuple.Create(Tuple.Create(" ", 1816), Tuple.Create("Decommissioned", 1817), true)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n (");
|
||||
|
||||
|
||||
#line 57 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
|
||||
Write(item.DeviceDecommissionedCount);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(")</span>\r\n");
|
||||
|
||||
|
||||
#line 58 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </td>\r\n </tr>\r\n");
|
||||
|
||||
|
||||
#line 61 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</table>\r\n<div");
|
||||
|
||||
WriteLiteral(" class=\"actionBar\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 64 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 64 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
|
||||
if (Model.DeviceBatches.Count > 0)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 66 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
|
||||
Write(Html.ActionLinkButton("Timeline", MVC.Config.DeviceBatch.Timeline()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 66 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
|
||||
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 68 "..\..\Areas\Config\Views\DeviceBatch\Index.cshtml"
|
||||
Write(Html.ActionLinkButton("Create Device Batch", MVC.Config.DeviceBatch.Create()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n</div>\r\n");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -0,0 +1,504 @@
|
||||
@model Disco.Web.Areas.Config.Models.DeviceBatch.ShowModel
|
||||
@{
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Batches", MVC.Config.DeviceBatch.Index(null), Model.DeviceBatch.ToString());
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Disco-AjaxHelperIcons");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/tinymce");
|
||||
}
|
||||
<div class="form deviceBatches" style="width: 730px">
|
||||
<table>
|
||||
<tr>
|
||||
<th style="width: 150px">
|
||||
Id:
|
||||
</th>
|
||||
<td>
|
||||
@Html.DisplayFor(model => model.DeviceBatch.Id)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Name:
|
||||
</th>
|
||||
<td>@Html.EditorFor(model => model.DeviceBatch.Name)
|
||||
@AjaxHelpers.AjaxSave()
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
document.DiscoFunctions.PropertyChangeHelper(
|
||||
$('#DeviceBatch_Name'),
|
||||
'Invalid Name',
|
||||
'@(Url.Action(MVC.API.DeviceBatch.UpdateName(Model.DeviceBatch.Id)))',
|
||||
'BatchName'
|
||||
);
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Device Count:
|
||||
</th>
|
||||
<td>
|
||||
@if (Model.DeviceBatch.UnitQuantity.HasValue)
|
||||
{
|
||||
<span>@Model.DeviceCount of @(Model.DeviceBatch.UnitQuantity.Value)</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
@Model.DeviceCount
|
||||
}
|
||||
managed by Disco
|
||||
@if (Model.DeviceDecommissionedCount > 0)
|
||||
{
|
||||
<span class="smallMessage">(@(Model.DeviceDecommissionedCount)
|
||||
Decommissioned)</span>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Purchase:
|
||||
</th>
|
||||
<td class="details">
|
||||
<table class="sub">
|
||||
<tr>
|
||||
<th class="name" style="width: 100px">
|
||||
Purchase Date:
|
||||
</th>
|
||||
<td>
|
||||
@Html.EditorFor(model => model.DeviceBatch.PurchaseDate)
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<script>
|
||||
$(function () {
|
||||
var dateField = $('#DeviceBatch_PurchaseDate');
|
||||
document.DiscoFunctions.DateChangeHelper(
|
||||
dateField,
|
||||
'Invalid Date',
|
||||
'@(Url.Action(MVC.API.DeviceBatch.UpdatePurchaseDate(Model.DeviceBatch.Id)))',
|
||||
'PurchaseDate',
|
||||
null,
|
||||
true
|
||||
);
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Supplier:
|
||||
</th>
|
||||
<td>
|
||||
@Html.EditorFor(model => model.DeviceBatch.Supplier)
|
||||
@AjaxHelpers.AjaxSave()
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
document.DiscoFunctions.PropertyChangeHelper(
|
||||
$('#DeviceBatch_Supplier'),
|
||||
'Batch Supplier',
|
||||
'@(Url.Action(MVC.API.DeviceBatch.UpdateSupplier(Model.DeviceBatch.Id)))',
|
||||
'Supplier'
|
||||
);
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Unit Cost:
|
||||
</th>
|
||||
<td>
|
||||
@Html.EditorFor(model => model.DeviceBatch.UnitCost)
|
||||
@AjaxHelpers.AjaxSave()
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
document.DiscoFunctions.PropertyChangeHelper(
|
||||
$('#DeviceBatch_UnitCost'),
|
||||
'Unit Cost',
|
||||
'@(Url.Action(MVC.API.DeviceBatch.UpdateUnitCost(Model.DeviceBatch.Id)))',
|
||||
'UnitCost'
|
||||
);
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Quantity:
|
||||
</th>
|
||||
<td>
|
||||
@Html.EditorFor(model => model.DeviceBatch.UnitQuantity)
|
||||
@AjaxHelpers.AjaxSave()
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
document.DiscoFunctions.PropertyChangeHelper(
|
||||
$('#DeviceBatch_UnitQuantity'),
|
||||
'Quantity',
|
||||
'@(Url.Action(MVC.API.DeviceBatch.UpdateUnitQuantity(Model.DeviceBatch.Id)))',
|
||||
'UnitQuantity'
|
||||
);
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div id="DeviceBatch_PurchaseDetails_Container">
|
||||
<div>
|
||||
Details @AjaxHelpers.AjaxLoader("ajaxPurchaseDetails")
|
||||
</div>
|
||||
@Html.EditorFor(model => model.DeviceBatch.PurchaseDetails)
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var model = {
|
||||
$field: $('#DeviceBatch_PurchaseDetails'),
|
||||
fieldName: 'PurchaseDetails',
|
||||
$ajax_loading: null,
|
||||
$ajax_ok: null,
|
||||
updated: function () {
|
||||
if (!model.$ajax_loading)
|
||||
model.$ajax_loading = $('#ajax' + model.fieldName + '_loading');
|
||||
if (!model.$ajax_ok)
|
||||
model.$ajax_ok = $('#ajax' + model.fieldName + '_ok');
|
||||
model.$ajax_loading.show();
|
||||
var data = {};
|
||||
data[model.fieldName] = model.$field.tinymce().getContent();
|
||||
$.ajax({
|
||||
url: '@(Url.Action(MVC.API.DeviceBatch.UpdatePurchaseDetails(Model.DeviceBatch.Id)))',
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
traditional: true,
|
||||
type: 'POST',
|
||||
success: function (d) {
|
||||
if (d == 'OK') {
|
||||
model.$ajax_loading.hide();
|
||||
model.$ajax_ok.show().delay('fast').fadeOut('slow');
|
||||
} else {
|
||||
model.$ajax_loading.hide();
|
||||
alert('Unable to update purchase details: ' + d);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to update purchase details: ' + errorThrown);
|
||||
model.$ajax_loading.hide();
|
||||
}
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
model.$field.tinymce({
|
||||
theme: 'simple',
|
||||
setup: function (ed) {
|
||||
ed.onInit.add(function (ed) {
|
||||
$(ed.getWin()).blur(model.updated);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Default Device Model:
|
||||
</th>
|
||||
<td>
|
||||
@Html.DropDownListFor(model => model.DeviceBatch.DefaultDeviceModelId, Model.DeviceModels)
|
||||
@AjaxHelpers.AjaxSave()
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
document.DiscoFunctions.PropertyChangeHelper(
|
||||
$('#DeviceBatch_DefaultDeviceModelId'),
|
||||
null,
|
||||
'@(Url.Action(MVC.API.DeviceBatch.UpdateDefaultDeviceModelId(Model.DeviceBatch.Id)))',
|
||||
'DefaultDeviceModelId'
|
||||
);
|
||||
});
|
||||
</script>
|
||||
<br />
|
||||
<span class="smallMessage">Devices added offline will default to this Device Model.
|
||||
Once a device enrols the Device Model will be accurately represented.</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Warranty:
|
||||
</th>
|
||||
<td class="details">
|
||||
<table class="sub">
|
||||
<tr>
|
||||
<th class="name" style="width: 100px">
|
||||
Valid Until:
|
||||
</th>
|
||||
<td>
|
||||
@Html.EditorFor(model => model.DeviceBatch.WarrantyValidUntil)
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<script>
|
||||
$(function () {
|
||||
var dateField = $('#DeviceBatch_WarrantyValidUntil');
|
||||
document.DiscoFunctions.DateChangeHelper(
|
||||
dateField,
|
||||
'Warranty Valid Until',
|
||||
'@(Url.Action(MVC.API.DeviceBatch.UpdateWarrantyValidUntil(Model.DeviceBatch.Id)))',
|
||||
'WarrantyValidUntil',
|
||||
null,
|
||||
true
|
||||
);
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div id="DeviceBatch_WarrantyDetails_Container">
|
||||
<div>
|
||||
Details @AjaxHelpers.AjaxLoader("ajaxWarrantyDetails")
|
||||
</div>
|
||||
@Html.EditorFor(model => model.DeviceBatch.WarrantyDetails)
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var model = {
|
||||
$field: $('#DeviceBatch_WarrantyDetails'),
|
||||
fieldName: 'WarrantyDetails',
|
||||
$ajax_loading: null,
|
||||
$ajax_ok: null,
|
||||
updated: function () {
|
||||
if (!model.$ajax_loading)
|
||||
model.$ajax_loading = $('#ajax' + model.fieldName + '_loading');
|
||||
if (!model.$ajax_ok)
|
||||
model.$ajax_ok = $('#ajax' + model.fieldName + '_ok');
|
||||
model.$ajax_loading.show();
|
||||
var data = {};
|
||||
data[model.fieldName] = model.$field.tinymce().getContent();
|
||||
$.ajax({
|
||||
url: '@(Url.Action(MVC.API.DeviceBatch.UpdateWarrantyDetails(Model.DeviceBatch.Id)))',
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
traditional: true,
|
||||
type: 'POST',
|
||||
success: function (d) {
|
||||
if (d == 'OK') {
|
||||
model.$ajax_loading.hide();
|
||||
model.$ajax_ok.show().delay('fast').fadeOut('slow');
|
||||
} else {
|
||||
model.$ajax_loading.hide();
|
||||
alert('Unable to update warranty details: ' + d);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to update warranty details: ' + errorThrown);
|
||||
model.$ajax_loading.hide();
|
||||
}
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
model.$field.tinymce({
|
||||
theme: 'simple',
|
||||
setup: function (ed) {
|
||||
ed.onInit.add(function (ed) {
|
||||
$(ed.getWin()).blur(model.updated);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Insurance:
|
||||
</th>
|
||||
<td class="details">
|
||||
<table class="sub">
|
||||
<tr>
|
||||
<th class="name" style="width: 100px">
|
||||
Supplier:
|
||||
</th>
|
||||
<td>
|
||||
@Html.EditorFor(model => model.DeviceBatch.InsuranceSupplier)
|
||||
@AjaxHelpers.AjaxSave()
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
document.DiscoFunctions.PropertyChangeHelper(
|
||||
$('#DeviceBatch_InsuranceSupplier'),
|
||||
'Insurance Supplier',
|
||||
'@(Url.Action(MVC.API.DeviceBatch.UpdateInsuranceSupplier(Model.DeviceBatch.Id)))',
|
||||
'InsuranceSupplier'
|
||||
);
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="name">
|
||||
Insured Date:
|
||||
</th>
|
||||
<td>
|
||||
@Html.EditorFor(model => model.DeviceBatch.InsuredDate)
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<script>
|
||||
$(function () {
|
||||
var dateField = $('#DeviceBatch_InsuredDate');
|
||||
document.DiscoFunctions.DateChangeHelper(
|
||||
dateField,
|
||||
'Insured Date',
|
||||
'@(Url.Action(MVC.API.DeviceBatch.UpdateInsuredDate(Model.DeviceBatch.Id)))',
|
||||
'InsuredDate',
|
||||
null,
|
||||
true
|
||||
);
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="name">
|
||||
Insured Until:
|
||||
</th>
|
||||
<td>
|
||||
@Html.EditorFor(model => model.DeviceBatch.InsuredUntil)
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<script>
|
||||
$(function () {
|
||||
var dateField = $('#DeviceBatch_InsuredUntil');
|
||||
document.DiscoFunctions.DateChangeHelper(
|
||||
dateField,
|
||||
'Insured Until',
|
||||
'@(Url.Action(MVC.API.DeviceBatch.UpdateInsuredUntil(Model.DeviceBatch.Id)))',
|
||||
'InsuredUntil',
|
||||
null,
|
||||
true
|
||||
);
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div id="DeviceBatch_InsuranceDetails_Container">
|
||||
<div>
|
||||
Details @AjaxHelpers.AjaxLoader("ajaxInsuranceDetails")
|
||||
</div>
|
||||
@Html.EditorFor(model => model.DeviceBatch.InsuranceDetails)
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var model = {
|
||||
$DeviceBatch_Comments: $('#DeviceBatch_InsuranceDetails'),
|
||||
$ajax_loading: null,
|
||||
$ajax_ok: null,
|
||||
updated: function () {
|
||||
if (!model.$ajax_loading)
|
||||
model.$ajax_loading = $('#ajaxInsuranceDetails_loading');
|
||||
if (!model.$ajax_ok)
|
||||
model.$ajax_ok = $('#ajaxInsuranceDetails_ok');
|
||||
model.$ajax_loading.show();
|
||||
var data = { InsuranceDetails: model.$DeviceBatch_Comments.tinymce().getContent() };
|
||||
$.ajax({
|
||||
url: '@(Url.Action(MVC.API.DeviceBatch.UpdateInsuranceDetails(Model.DeviceBatch.Id)))',
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
traditional: true,
|
||||
type: 'POST',
|
||||
success: function (d) {
|
||||
if (d == 'OK') {
|
||||
model.$ajax_loading.hide();
|
||||
model.$ajax_ok.show().delay('fast').fadeOut('slow');
|
||||
} else {
|
||||
model.$ajax_loading.hide();
|
||||
alert('Unable to update insurance details: ' + d);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to update insurance details: ' + errorThrown);
|
||||
model.$ajax_loading.hide();
|
||||
}
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
model.$DeviceBatch_Comments.tinymce({
|
||||
theme: 'simple',
|
||||
setup: function (ed) {
|
||||
//ed.onChange.add(model.updatedThrottle);
|
||||
ed.onInit.add(function (ed) {
|
||||
$(ed.getWin()).blur(model.updated);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Comments:<br />
|
||||
@AjaxHelpers.AjaxLoader("ajaxComments")
|
||||
</th>
|
||||
<td>
|
||||
@Html.EditorFor(model => model.DeviceBatch.Comments)
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var model = {
|
||||
$DeviceBatch_Comments: $('#DeviceBatch_Comments'),
|
||||
$ajax_loading: null,
|
||||
$ajax_ok: null,
|
||||
updated: function () {
|
||||
if (!model.$ajax_loading)
|
||||
model.$ajax_loading = $('#ajaxComments_loading');
|
||||
if (!model.$ajax_ok)
|
||||
model.$ajax_ok = $('#ajaxComments_ok');
|
||||
model.$ajax_loading.show();
|
||||
var data = { Comments: model.$DeviceBatch_Comments.tinymce().getContent() };
|
||||
$.ajax({
|
||||
url: '@(Url.Action(MVC.API.DeviceBatch.UpdateComments(Model.DeviceBatch.Id)))',
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
traditional: true,
|
||||
type: 'POST',
|
||||
success: function (d) {
|
||||
if (d == 'OK') {
|
||||
model.$ajax_loading.hide();
|
||||
model.$ajax_ok.show().delay('fast').fadeOut('slow');
|
||||
} else {
|
||||
model.$ajax_loading.hide();
|
||||
alert('Unable to update comments: ' + d);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to update comments: ' + errorThrown);
|
||||
model.$ajax_loading.hide();
|
||||
}
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
model.$DeviceBatch_Comments.tinymce({
|
||||
theme: 'simple',
|
||||
setup: function (ed) {
|
||||
//ed.onChange.add(model.updatedThrottle);
|
||||
ed.onInit.add(function (ed) {
|
||||
$(ed.getWin()).blur(model.updated);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="actionBar">
|
||||
@if (Model.CanDelete)
|
||||
{
|
||||
@Html.ActionLinkButton("Delete", MVC.API.DeviceBatch.Delete(Model.DeviceBatch.Id, true), "buttonDelete")
|
||||
}
|
||||
@if (Model.DeviceCount > 0)
|
||||
{
|
||||
@Html.ActionLinkButton("View Devices", MVC.Search.Query(Model.DeviceBatch.Id.ToString(), "DeviceBatch"))
|
||||
}
|
||||
</div>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,122 @@
|
||||
@{
|
||||
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");
|
||||
}
|
||||
<div id="deviceBatchesTimeline" style="height: 550px;">
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
(function () {
|
||||
var dataUrl = '@(Url.Action(MVC.API.DeviceBatch.Timeline()))';
|
||||
var tl;
|
||||
|
||||
$(function () {
|
||||
|
||||
var eventSource = new Timeline.DefaultEventSource();
|
||||
|
||||
var currentDate = new Date();
|
||||
currentDate = new Date(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDay(), 10, 0, 0);
|
||||
var tomorrowDate = new Date();
|
||||
tomorrowDate.setDate(currentDate.getDate() + 1);
|
||||
var sixMonthsDate = new Date();
|
||||
sixMonthsDate.setDate(currentDate.getDate());
|
||||
sixMonthsDate.setMonth(currentDate.getMonth() + 6);
|
||||
|
||||
var hotZoneStart1 = new Date(currentDate.getFullYear(), 0, 1, 10, 0, 0);
|
||||
var hotZoneEnd1 = new Date(currentDate.getFullYear(), 11, 31, 10, 0, 0);
|
||||
var hotZoneStart2 = new Date(currentDate.getFullYear() + 1, 0, 1, 10, 0, 0);
|
||||
var hotZoneEnd2 = new Date(currentDate.getFullYear() + 1, 11, 31, 10, 0, 0);
|
||||
//hotZoneEnd.setDate(hotZoneEnd.getDate() - 1);
|
||||
|
||||
//hotZoneStart = hotZoneStart.toLocaleDateString();
|
||||
//hotZoneEnd = hotZoneEnd.toLocaleDateString();
|
||||
|
||||
|
||||
var bandInfos = [
|
||||
Timeline.createHotZoneBandInfo({
|
||||
zones: [
|
||||
{
|
||||
start: hotZoneStart1,
|
||||
end: hotZoneEnd1,
|
||||
magnify: 4,
|
||||
unit: Timeline.DateTime.MONTH
|
||||
},
|
||||
{
|
||||
start: hotZoneStart2,
|
||||
end: hotZoneEnd2,
|
||||
magnify: 4,
|
||||
unit: Timeline.DateTime.MONTH
|
||||
}
|
||||
],
|
||||
eventSource: eventSource,
|
||||
width: "85%",
|
||||
intervalUnit: Timeline.DateTime.YEAR,
|
||||
intervalPixels: 150,
|
||||
timeZone: 10,
|
||||
date: sixMonthsDate
|
||||
}),
|
||||
Timeline.createBandInfo({
|
||||
eventSource: eventSource,
|
||||
width: "15%",
|
||||
intervalUnit: Timeline.DateTime.YEAR,
|
||||
intervalPixels: 150,
|
||||
overview: true,
|
||||
timeZone: 10,
|
||||
date: sixMonthsDate
|
||||
})
|
||||
];
|
||||
bandInfos[1].syncWith = 0;
|
||||
bandInfos[1].highlight = true;
|
||||
|
||||
for (var i = 0; i < bandInfos.length; i++) {
|
||||
bandInfos[i].decorators = [
|
||||
new Timeline.SpanHighlightDecorator({
|
||||
startDate: currentDate,
|
||||
endDate: tomorrowDate,
|
||||
color: "#CC2222",
|
||||
opacity: 50
|
||||
}),
|
||||
new Timeline.SpanHighlightDecorator({
|
||||
startDate: hotZoneStart1,
|
||||
endDate: hotZoneEnd1,
|
||||
color: "#CEA5A5",
|
||||
opacity: 50
|
||||
}),
|
||||
new Timeline.SpanHighlightDecorator({
|
||||
startDate: hotZoneStart2,
|
||||
endDate: hotZoneEnd2,
|
||||
color: "#CCB7B7",
|
||||
opacity: 50
|
||||
})
|
||||
];
|
||||
}
|
||||
|
||||
tl = Timeline.create($('#deviceBatchesTimeline')[0], bandInfos);
|
||||
|
||||
var tlResizeLayoutHandle = null;
|
||||
$(window).resize(function () {
|
||||
if (tlResizeLayoutHandle)
|
||||
window.clearTimeout(tlResizeLayoutHandle);
|
||||
tlResizeLayoutHandle = window.setTimeout(function () {
|
||||
tlResizeLayoutHandle = null;
|
||||
tl.layout();
|
||||
}, 500);
|
||||
});
|
||||
|
||||
// Load Events
|
||||
$.ajax({
|
||||
url: dataUrl,
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
success: function (data) {
|
||||
eventSource.loadJSON(data, dataUrl);
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to load Timeline Data: ' + errorThrown);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
})();
|
||||
|
||||
</script>
|
||||
@@ -0,0 +1,131 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.17929
|
||||
//
|
||||
// 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.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DeviceBatch/Timeline.cshtml")]
|
||||
public class Timeline : System.Web.Mvc.WebViewPage<dynamic>
|
||||
{
|
||||
public Timeline()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 1 "..\..\Areas\Config\Views\DeviceBatch\Timeline.cshtml"
|
||||
|
||||
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(">\r\n</div>\r\n<script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(">\r\n (function () {\r\n var dataUrl = \'");
|
||||
|
||||
|
||||
#line 10 "..\..\Areas\Config\Views\DeviceBatch\Timeline.cshtml"
|
||||
Write(Url.Action(MVC.API.DeviceBatch.Timeline()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\';\r\n var tl;\r\n\r\n $(function () {\r\n\r\n var eventSource = n" +
|
||||
"ew Timeline.DefaultEventSource();\r\n\r\n var currentDate = new Date();\r\n" +
|
||||
" currentDate = new Date(currentDate.getFullYear(), currentDate.getMon" +
|
||||
"th(), currentDate.getDay(), 10, 0, 0);\r\n var tomorrowDate = new Date(" +
|
||||
");\r\n tomorrowDate.setDate(currentDate.getDate() + 1);\r\n va" +
|
||||
"r sixMonthsDate = new Date();\r\n sixMonthsDate.setDate(currentDate.get" +
|
||||
"Date());\r\n sixMonthsDate.setMonth(currentDate.getMonth() + 6);\r\n " +
|
||||
" \r\n var hotZoneStart1 = new Date(currentDate.getFullYear(), 0, " +
|
||||
"1, 10, 0, 0);\r\n var hotZoneEnd1 = new Date(currentDate.getFullYear()," +
|
||||
" 11, 31, 10, 0, 0);\r\n var hotZoneStart2 = new Date(currentDate.getFul" +
|
||||
"lYear() + 1, 0, 1, 10, 0, 0);\r\n var hotZoneEnd2 = new Date(currentDat" +
|
||||
"e.getFullYear() + 1, 11, 31, 10, 0, 0);\r\n //hotZoneEnd.setDate(hotZon" +
|
||||
"eEnd.getDate() - 1);\r\n\r\n //hotZoneStart = hotZoneStart.toLocaleDateSt" +
|
||||
"ring();\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: h" +
|
||||
"otZoneStart1,\r\n end: hotZoneEnd1,\r\n " +
|
||||
" magnify: 4,\r\n unit: Timeline.DateTime.MONTH\r\n " +
|
||||
" },\r\n {\r\n start: hotZoneStart" +
|
||||
"2,\r\n end: hotZoneEnd2,\r\n magnify: " +
|
||||
"4,\r\n unit: 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: 1" +
|
||||
"0,\r\n date: sixMonthsDate\r\n }),\r\n " +
|
||||
" Timeline.createBandInfo({\r\n eventSource: eventSource,\r\n " +
|
||||
" width: \"15%\",\r\n intervalUnit: Timeline.DateTi" +
|
||||
"me.YEAR,\r\n intervalPixels: 150,\r\n overview" +
|
||||
": true,\r\n timeZone: 10,\r\n date: sixMonthsD" +
|
||||
"ate\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 < b" +
|
||||
"andInfos.length; i++) {\r\n bandInfos[i].decorators = [\r\n " +
|
||||
" new Timeline.SpanHighlightDecorator({\r\n startDa" +
|
||||
"te: 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: hotZon" +
|
||||
"eEnd1,\r\n color: \"#CEA5A5\",\r\n opaci" +
|
||||
"ty: 50\r\n }),\r\n new Timeline.SpanHighlightD" +
|
||||
"ecorator({\r\n startDate: hotZoneStart2,\r\n " +
|
||||
" endDate: hotZoneEnd2,\r\n color: \"#CCB7B7\",\r\n " +
|
||||
" opacity: 50\r\n })\r\n ];\r\n " +
|
||||
" }\r\n\r\n tl = Timeline.create($(\'#deviceBatchesTimeline\')[0], band" +
|
||||
"Infos);\r\n\r\n var tlResizeLayoutHandle = null;\r\n $(window).r" +
|
||||
"esize(function () {\r\n if (tlResizeLayoutHandle)\r\n " +
|
||||
" window.clearTimeout(tlResizeLayoutHandle);\r\n tlResizeLayoutHa" +
|
||||
"ndle = window.setTimeout(function () {\r\n tlResizeLayoutHandle" +
|
||||
" = null;\r\n tl.layout();\r\n }, 500);\r\n " +
|
||||
" });\r\n\r\n // Load Events\r\n $.ajax({\r\n url: " +
|
||||
"dataUrl,\r\n dataType: \'json\',\r\n type: \'POST\',\r\n " +
|
||||
" success: function (data) {\r\n eventSource.loadJSON" +
|
||||
"(data, dataUrl);\r\n },\r\n error: function (jqXHR, te" +
|
||||
"xtStatus, errorThrown) {\r\n alert(\'Unable to load Timeline Dat" +
|
||||
"a: \' + errorThrown);\r\n }\r\n });\r\n });\r\n\r\n })(" +
|
||||
");\r\n\r\n</script>\r\n");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -0,0 +1,5 @@
|
||||
@model Disco.Web.Areas.Config.Models.DeviceModel.DeviceComponentsModel
|
||||
@{
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Models", MVC.Config.DeviceModel.Index(null), "Generic Components");
|
||||
}
|
||||
@Html.Partial(MVC.Config.DeviceModel.Views._DeviceComponentsTable, Model)
|
||||
@@ -0,0 +1,63 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.17929
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Disco.Web.Areas.Config.Views.DeviceModel
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.Helpers;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Mvc.Ajax;
|
||||
using System.Web.Mvc.Html;
|
||||
using System.Web.Routing;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.WebPages;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DeviceModel/GenericComponents.cshtml")]
|
||||
public class GenericComponents : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.DeviceModel.DeviceComponentsModel>
|
||||
{
|
||||
public GenericComponents()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 2 "..\..\Areas\Config\Views\DeviceModel\GenericComponents.cshtml"
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Models", MVC.Config.DeviceModel.Index(null), "Generic Components");
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
|
||||
#line 5 "..\..\Areas\Config\Views\DeviceModel\GenericComponents.cshtml"
|
||||
Write(Html.Partial(MVC.Config.DeviceModel.Views._DeviceComponentsTable, Model));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -0,0 +1,46 @@
|
||||
@model Disco.Web.Areas.Config.Models.DeviceModel.IndexModel
|
||||
@{
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Models");
|
||||
}
|
||||
<table class="tableData">
|
||||
<tr>
|
||||
<th>
|
||||
Name/Description
|
||||
</th>
|
||||
<th>
|
||||
Manufacturer
|
||||
</th>
|
||||
<th>
|
||||
Model
|
||||
</th>
|
||||
<th>
|
||||
Type
|
||||
</th>
|
||||
<th>
|
||||
Device Count
|
||||
</th>
|
||||
</tr>
|
||||
@foreach (var item in Model.DeviceModels)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@Html.ActionLink(item.ToString(), MVC.Config.DeviceModel.Index(item.Id))
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Manufacturer)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Model)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.ModelType)
|
||||
</td>
|
||||
<td>
|
||||
@item.DeviceCount.ToString("n0")
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
<div class="actionBar">
|
||||
@Html.ActionLinkButton("Generic Components", MVC.Config.DeviceModel.GenericComponents())
|
||||
</div>
|
||||
@@ -0,0 +1,173 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.17929
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Disco.Web.Areas.Config.Views.DeviceModel
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.Helpers;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Mvc.Ajax;
|
||||
using System.Web.Mvc.Html;
|
||||
using System.Web.Routing;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.WebPages;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DeviceModel/Index.cshtml")]
|
||||
public class Index : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.DeviceModel.IndexModel>
|
||||
{
|
||||
public Index()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 2 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Models");
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n<table");
|
||||
|
||||
WriteLiteral(" class=\"tableData\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
<tr>
|
||||
<th>
|
||||
Name/Description
|
||||
</th>
|
||||
<th>
|
||||
Manufacturer
|
||||
</th>
|
||||
<th>
|
||||
Model
|
||||
</th>
|
||||
<th>
|
||||
Type
|
||||
</th>
|
||||
<th>
|
||||
Device Count
|
||||
</th>
|
||||
</tr>
|
||||
");
|
||||
|
||||
|
||||
#line 23 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 23 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
|
||||
foreach (var item in Model.DeviceModels)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <tr>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 27 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
|
||||
Write(Html.ActionLink(item.ToString(), MVC.Config.DeviceModel.Index(item.Id)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 30 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
|
||||
Write(Html.DisplayFor(modelItem => item.Manufacturer));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 33 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
|
||||
Write(Html.DisplayFor(modelItem => item.Model));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 36 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
|
||||
Write(Html.DisplayFor(modelItem => item.ModelType));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 39 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
|
||||
Write(item.DeviceCount.ToString("n0"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
|
||||
|
||||
|
||||
#line 42 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</table>\r\n<div");
|
||||
|
||||
WriteLiteral(" class=\"actionBar\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 45 "..\..\Areas\Config\Views\DeviceModel\Index.cshtml"
|
||||
Write(Html.ActionLinkButton("Generic Components", MVC.Config.DeviceModel.GenericComponents()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n</div>");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -0,0 +1,205 @@
|
||||
@model Disco.Web.Areas.Config.Models.DeviceModel.ShowModel
|
||||
@{
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Models", MVC.Config.DeviceModel.Index(null), Model.DeviceModel.ToString());
|
||||
}
|
||||
<div class="form" style="width: 530px">
|
||||
<table>
|
||||
<tr>
|
||||
<th style="width: 150px">
|
||||
Id:
|
||||
</th>
|
||||
<td>
|
||||
@Html.DisplayFor(model => model.DeviceModel.Id)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Description:
|
||||
</th>
|
||||
<td>@Html.EditorFor(model => model.DeviceModel.Description)
|
||||
@AjaxHelpers.AjaxSave()
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Manufacturer:
|
||||
</th>
|
||||
<td>
|
||||
@Html.DisplayFor(model => model.DeviceModel.Manufacturer)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Model:
|
||||
</th>
|
||||
<td>
|
||||
@Html.DisplayFor(model => model.DeviceModel.Model)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Default Purchase Date:
|
||||
</th>
|
||||
<td>
|
||||
@Html.EditorFor(model => model.DeviceModel.DefaultPurchaseDate)
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Default Warranty Provider:
|
||||
</th>
|
||||
<td>
|
||||
@Html.DropDownListFor(model => model.DeviceModel.DefaultWarrantyProvider, Model.WarrantyProviders.ToSelectListItems(Model.DeviceModel.DefaultWarrantyProvider, true, "None"))
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Type:
|
||||
</th>
|
||||
<td>
|
||||
@Html.DisplayFor(model => model.DeviceModel.ModelType)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Image:
|
||||
</th>
|
||||
<td>
|
||||
<img alt="Model Image" src="@Url.Action(MVC.API.DeviceModel.Image(Model.DeviceModel.Id, Model.DeviceModel.ImageHash()))" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<label for="DeviceModel_Image">
|
||||
Update Image:
|
||||
</label>
|
||||
</th>
|
||||
<td>
|
||||
@using (Html.BeginForm(MVC.API.DeviceModel.Image(Model.DeviceModel.Id, true, null), FormMethod.Post, new { enctype = "multipart/form-data" }))
|
||||
{
|
||||
<input type="file" name="Image" id="Image" style="width: 250px;" />
|
||||
<input class="button" type="submit" value="Update" />
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var $Description = $('#DeviceModel_Description');
|
||||
var $DescriptionAjaxSave = $Description.next('.ajaxSave');
|
||||
$Description
|
||||
.watermark('Model Description')
|
||||
.focus(function () { $Description.select() })
|
||||
.keydown(function (e) {
|
||||
$DescriptionAjaxSave.show();
|
||||
if (e.which == 13) {
|
||||
$(this).blur();
|
||||
}
|
||||
}).blur(function () {
|
||||
$DescriptionAjaxSave.hide();
|
||||
})
|
||||
.change(function () {
|
||||
$DescriptionAjaxSave.hide();
|
||||
var $ajaxLoading = $DescriptionAjaxSave.next('.ajaxLoading').show();
|
||||
var data = { Description: $Description.val() };
|
||||
$.ajax({
|
||||
url: '@Url.Action(MVC.API.DeviceModel.UpdateDescription(Model.DeviceModel.Id))',
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
success: function (d) {
|
||||
if (d == 'OK') {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
} else {
|
||||
$ajaxLoading.hide();
|
||||
alert('Unable to update description: ' + d);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to update description: ' + textStatus);
|
||||
$ajaxLoading.hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var $dataField = $('#DeviceModel_DefaultPurchaseDate');
|
||||
var $ajaxLoading = $dataField.next('.ajaxLoading');
|
||||
var dateFieldValue = $dataField.val();
|
||||
var dateFieldChangeToken = null;
|
||||
$dataField
|
||||
.watermark('None')
|
||||
.datepicker({
|
||||
changeYear: true,
|
||||
changeMonth: true,
|
||||
dateFormat: 'yy/mm/dd'
|
||||
})
|
||||
.change(function () {
|
||||
var dateText = $dataField.val();
|
||||
if (dateFieldValue.toLowerCase() != dateText.toLowerCase()) {
|
||||
dateFieldValue = dateText;
|
||||
if (dateFieldChangeToken)
|
||||
window.clearTimeout(dateFieldChangeToken);
|
||||
dateFieldChangeToken = window.setTimeout(function () {
|
||||
$ajaxLoading.show();
|
||||
var data = {};
|
||||
data['DefaultPurchaseDate'] = dateFieldValue;
|
||||
$.getJSON('@(Url.Action(MVC.API.DeviceModel.UpdateDefaultPurchaseDate(Model.DeviceModel.Id)))', data, function (response, result) {
|
||||
if (result != 'success' || response != 'OK') {
|
||||
alert('Unable to change Date:\n' + response);
|
||||
$ajaxLoading.hide();
|
||||
} else {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
}
|
||||
})
|
||||
dateFieldChangeToken = null;
|
||||
}, 500);
|
||||
}
|
||||
}).focus(function () {
|
||||
$(this).select();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var $DefaultWarrantyProvider = $('#DeviceModel_DefaultWarrantyProvider');
|
||||
var $ajaxLoading = $DefaultWarrantyProvider.next('.ajaxLoading');
|
||||
$DefaultWarrantyProvider
|
||||
.change(function () {
|
||||
$ajaxLoading.show();
|
||||
var data = { DefaultWarrantyProvider: $DefaultWarrantyProvider.val() };
|
||||
$.ajax({
|
||||
url: '@Url.Action(MVC.API.DeviceModel.UpdateDefaultWarrantyProvider(Model.DeviceModel.Id))',
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
success: function (d) {
|
||||
if (d == 'OK') {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
} else {
|
||||
$ajaxLoading.hide();
|
||||
alert('Unable to default warranty provider: ' + d);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to default warranty provider: ' + textStatus);
|
||||
$ajaxLoading.hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<h2>
|
||||
Components</h2>
|
||||
@Html.Partial(MVC.Config.DeviceModel.Views._DeviceComponentsTable, Model.DeviceComponentsModel)
|
||||
<div class="actionBar">
|
||||
@if (Model.CanDelete)
|
||||
{
|
||||
@Html.ActionLinkButton("Delete", MVC.API.DeviceModel.Delete(Model.DeviceModel.Id, true), "buttonDelete")
|
||||
}
|
||||
@Html.ActionLinkButton("View Devices", MVC.Search.Query(Model.DeviceModel.Id.ToString(), "DeviceModel"))
|
||||
</div>
|
||||
@@ -0,0 +1,458 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.17929
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Disco.Web.Areas.Config.Views.DeviceModel
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.Helpers;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Mvc.Ajax;
|
||||
using System.Web.Mvc.Html;
|
||||
using System.Web.Routing;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.WebPages;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DeviceModel/Show.cshtml")]
|
||||
public class Show : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.DeviceModel.ShowModel>
|
||||
{
|
||||
public Show()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 2 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Models", MVC.Config.DeviceModel.Index(null), Model.DeviceModel.ToString());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n<div");
|
||||
|
||||
WriteLiteral(" class=\"form\"");
|
||||
|
||||
WriteLiteral(" style=\"width: 530px\"");
|
||||
|
||||
WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th");
|
||||
|
||||
WriteLiteral(" style=\"width: 150px\"");
|
||||
|
||||
WriteLiteral(">\r\n Id:\r\n </th>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 12 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
||||
Write(Html.DisplayFor(model => model.DeviceModel.Id));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th>\r\n " +
|
||||
" Description:\r\n </th>\r\n <td>");
|
||||
|
||||
|
||||
#line 19 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
||||
Write(Html.EditorFor(model => model.DeviceModel.Description));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 20 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
||||
Write(AjaxHelpers.AjaxSave());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 21 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
||||
Write(AjaxHelpers.AjaxLoader());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th>\r\n " +
|
||||
" Manufacturer:\r\n </th>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 29 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
||||
Write(Html.DisplayFor(model => model.DeviceModel.Manufacturer));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th>\r\n " +
|
||||
" Model:\r\n </th>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 37 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
||||
Write(Html.DisplayFor(model => model.DeviceModel.Model));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th>\r\n " +
|
||||
" Default Purchase Date:\r\n </th>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 45 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
||||
Write(Html.EditorFor(model => model.DeviceModel.DefaultPurchaseDate));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 46 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
||||
Write(AjaxHelpers.AjaxLoader());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th>\r\n " +
|
||||
" Default Warranty Provider:\r\n </th>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 54 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
||||
Write(Html.DropDownListFor(model => model.DeviceModel.DefaultWarrantyProvider, Model.WarrantyProviders.ToSelectListItems(Model.DeviceModel.DefaultWarrantyProvider, true, "None")));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 55 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
||||
Write(AjaxHelpers.AjaxLoader());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th>\r\n " +
|
||||
" Type:\r\n </th>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 63 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
||||
Write(Html.DisplayFor(model => model.DeviceModel.ModelType));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th>\r\n " +
|
||||
" Image:\r\n </th>\r\n <td>\r\n <img");
|
||||
|
||||
WriteLiteral(" alt=\"Model Image\"");
|
||||
|
||||
WriteAttribute("src", Tuple.Create(" src=\"", 2151), Tuple.Create("\"", 2248)
|
||||
|
||||
#line 71 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 2157), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DeviceModel.Image(Model.DeviceModel.Id, Model.DeviceModel.ImageHash()))
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 2157), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" />\r\n </td>\r\n </tr>\r\n <tr>\r\n <th>\r\n " +
|
||||
" <label");
|
||||
|
||||
WriteLiteral(" for=\"DeviceModel_Image\"");
|
||||
|
||||
WriteLiteral(">\r\n Update Image:\r\n </label>\r\n </th>" +
|
||||
"\r\n <td>\r\n");
|
||||
|
||||
|
||||
#line 81 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 81 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
||||
using (Html.BeginForm(MVC.API.DeviceModel.Image(Model.DeviceModel.Id, true, null), FormMethod.Post, new { enctype = "multipart/form-data" }))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <input");
|
||||
|
||||
WriteLiteral(" type=\"file\"");
|
||||
|
||||
WriteLiteral(" name=\"Image\"");
|
||||
|
||||
WriteLiteral(" id=\"Image\"");
|
||||
|
||||
WriteLiteral(" style=\"width: 250px;\"");
|
||||
|
||||
WriteLiteral(" />\r\n");
|
||||
|
||||
WriteLiteral(" <input");
|
||||
|
||||
WriteLiteral(" class=\"button\"");
|
||||
|
||||
WriteLiteral(" type=\"submit\"");
|
||||
|
||||
WriteLiteral(" value=\"Update\"");
|
||||
|
||||
WriteLiteral(" />\r\n");
|
||||
|
||||
|
||||
#line 85 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </td>\r\n </tr>\r\n </table>\r\n <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
$(function () {
|
||||
var $Description = $('#DeviceModel_Description');
|
||||
var $DescriptionAjaxSave = $Description.next('.ajaxSave');
|
||||
$Description
|
||||
.watermark('Model Description')
|
||||
.focus(function () { $Description.select() })
|
||||
.keydown(function (e) {
|
||||
$DescriptionAjaxSave.show();
|
||||
if (e.which == 13) {
|
||||
$(this).blur();
|
||||
}
|
||||
}).blur(function () {
|
||||
$DescriptionAjaxSave.hide();
|
||||
})
|
||||
.change(function () {
|
||||
$DescriptionAjaxSave.hide();
|
||||
var $ajaxLoading = $DescriptionAjaxSave.next('.ajaxLoading').show();
|
||||
var data = { Description: $Description.val() };
|
||||
$.ajax({
|
||||
url: '");
|
||||
|
||||
|
||||
#line 109 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
||||
Write(Url.Action(MVC.API.DeviceModel.UpdateDescription(Model.DeviceModel.Id)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@"',
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
success: function (d) {
|
||||
if (d == 'OK') {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
} else {
|
||||
$ajaxLoading.hide();
|
||||
alert('Unable to update description: ' + d);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to update description: ' + textStatus);
|
||||
$ajaxLoading.hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
$(function () {
|
||||
var $dataField = $('#DeviceModel_DefaultPurchaseDate');
|
||||
var $ajaxLoading = $dataField.next('.ajaxLoading');
|
||||
var dateFieldValue = $dataField.val();
|
||||
var dateFieldChangeToken = null;
|
||||
$dataField
|
||||
.watermark('None')
|
||||
.datepicker({
|
||||
changeYear: true,
|
||||
changeMonth: true,
|
||||
dateFormat: 'yy/mm/dd'
|
||||
})
|
||||
.change(function () {
|
||||
var dateText = $dataField.val();
|
||||
if (dateFieldValue.toLowerCase() != dateText.toLowerCase()) {
|
||||
dateFieldValue = dateText;
|
||||
if (dateFieldChangeToken)
|
||||
window.clearTimeout(dateFieldChangeToken);
|
||||
dateFieldChangeToken = window.setTimeout(function () {
|
||||
$ajaxLoading.show();
|
||||
var data = {};
|
||||
data['DefaultPurchaseDate'] = dateFieldValue;
|
||||
$.getJSON('");
|
||||
|
||||
|
||||
#line 151 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
||||
Write(Url.Action(MVC.API.DeviceModel.UpdateDefaultPurchaseDate(Model.DeviceModel.Id)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@"', data, function (response, result) {
|
||||
if (result != 'success' || response != 'OK') {
|
||||
alert('Unable to change Date:\n' + response);
|
||||
$ajaxLoading.hide();
|
||||
} else {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
}
|
||||
})
|
||||
dateFieldChangeToken = null;
|
||||
}, 500);
|
||||
}
|
||||
}).focus(function () {
|
||||
$(this).select();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
$(function () {
|
||||
var $DefaultWarrantyProvider = $('#DeviceModel_DefaultWarrantyProvider');
|
||||
var $ajaxLoading = $DefaultWarrantyProvider.next('.ajaxLoading');
|
||||
$DefaultWarrantyProvider
|
||||
.change(function () {
|
||||
$ajaxLoading.show();
|
||||
var data = { DefaultWarrantyProvider: $DefaultWarrantyProvider.val() };
|
||||
$.ajax({
|
||||
url: '");
|
||||
|
||||
|
||||
#line 176 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
||||
Write(Url.Action(MVC.API.DeviceModel.UpdateDefaultWarrantyProvider(Model.DeviceModel.Id)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@"',
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
success: function (d) {
|
||||
if (d == 'OK') {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
} else {
|
||||
$ajaxLoading.hide();
|
||||
alert('Unable to default warranty provider: ' + d);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to default warranty provider: ' + textStatus);
|
||||
$ajaxLoading.hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<h2>
|
||||
Components</h2>
|
||||
");
|
||||
|
||||
|
||||
#line 198 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
||||
Write(Html.Partial(MVC.Config.DeviceModel.Views._DeviceComponentsTable, Model.DeviceComponentsModel));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n<div");
|
||||
|
||||
WriteLiteral(" class=\"actionBar\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 200 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 200 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
||||
if (Model.CanDelete)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 202 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
||||
Write(Html.ActionLinkButton("Delete", MVC.API.DeviceModel.Delete(Model.DeviceModel.Id, true), "buttonDelete"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 202 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
||||
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 204 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
|
||||
Write(Html.ActionLinkButton("View Devices", MVC.Search.Query(Model.DeviceModel.Id.ToString(), "DeviceModel")));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n</div>\r\n");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -0,0 +1,270 @@
|
||||
@model Disco.Web.Areas.Config.Models.DeviceModel.DeviceComponentsModel
|
||||
@{
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Disco-jQueryExtensions");
|
||||
}
|
||||
<table id="deviceComponents" data-devicemodelid="@(Model.DeviceModelId.HasValue ? Model.DeviceModelId.Value.ToString() : string.Empty)">
|
||||
<tr>
|
||||
<th>
|
||||
Description
|
||||
</th>
|
||||
<th>
|
||||
Cost
|
||||
</th>
|
||||
<th>
|
||||
Job Types
|
||||
</th>
|
||||
<th class="actions">
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
@foreach (var item in Model.DeviceComponents)
|
||||
{
|
||||
<tr data-devicecomponentid="@item.Id">
|
||||
<td>
|
||||
<input type="text" class="description" value="@item.Description" />
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" class="cost" value="@item.Cost.ToString("C")" />
|
||||
</td>
|
||||
<td>
|
||||
<span class="edit@(item.JobSubTypes.Count > 0 ? " editAlert" : string.Empty)"></span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="remove"></span>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<a href="#" id="addDeviceComponent">Add Component</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var $deviceComponents = $('#deviceComponents');
|
||||
|
||||
$('#addDeviceComponent').click(function () {
|
||||
var dc = $('<tr><td><input type="text" class="description" /></td><td><input type="text" class="cost" /></td><td><span class="edit"></span></td><td><span class="remove"></span></td></tr>');
|
||||
dc.find('input').focus(function () { $(this).select() })
|
||||
dc.insertBefore($deviceComponents.find('tr').last());
|
||||
dc.find('input.description').focus();
|
||||
return false;
|
||||
});
|
||||
|
||||
var removeComponentConfirmed = function (id, row) {
|
||||
var data = { id: id };
|
||||
$.ajax({
|
||||
url: '@Url.Action(MVC.API.DeviceModel.ComponentRemove())',
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
success: function (d) {
|
||||
if (d == 'OK') {
|
||||
row.remove();
|
||||
} else {
|
||||
alert('Unable to remove component: ' + d);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to remove component: ' + textStatus);
|
||||
}
|
||||
});
|
||||
}
|
||||
var removeComponent = function () {
|
||||
var componentRow = $(this).closest('tr');
|
||||
var id = componentRow.attr('data-devicecomponentid');
|
||||
if (id) {
|
||||
var dialog = $("#dialogConfirmRemove");
|
||||
var buttons = dialog.dialog("option", "buttons");
|
||||
buttons['Remove'] = function () { removeComponentConfirmed(id, componentRow); $(this).dialog("close"); };
|
||||
var buttons = dialog.dialog("option", "buttons", buttons);
|
||||
dialog.dialog('open');
|
||||
} else {
|
||||
// New - Remove
|
||||
componentRow.remove();
|
||||
}
|
||||
}
|
||||
var updateComponent = function () {
|
||||
var componentRow = $(this).closest('tr');
|
||||
componentRow.find('input').attr('disabled', true).addClass('updating');
|
||||
|
||||
var id = componentRow.attr('data-devicecomponentid');
|
||||
if (id) {
|
||||
// Update
|
||||
var data = {
|
||||
id: id,
|
||||
Description: componentRow.find('input.description').val(),
|
||||
Cost: componentRow.find('input.cost').val()
|
||||
};
|
||||
$.ajax({
|
||||
url: '@Url.Action(MVC.API.DeviceModel.ComponentUpdate())',
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
data: data,
|
||||
success: function (d) {
|
||||
componentRow.find('input').attr('disabled', false).removeClass('updating');
|
||||
if (d.Result == 'OK') {
|
||||
componentRow.find('input.description').val(d.Component.Description);
|
||||
componentRow.find('input.cost').val(d.Component.Cost);
|
||||
} else {
|
||||
alert('Unable to update component: ' + d.Result);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to update component: ' + textStatus);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Add
|
||||
id = componentRow.closest('table').attr('data-devicemodelid');
|
||||
var data = {
|
||||
id: id,
|
||||
Description: componentRow.find('input.description').val(),
|
||||
Cost: componentRow.find('input.cost').val()
|
||||
};
|
||||
$.ajax({
|
||||
url: '@Url.Action(MVC.API.DeviceModel.ComponentAdd(null, null, null))',
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
data: data,
|
||||
success: function (d) {
|
||||
componentRow.find('input').attr('disabled', false).removeClass('updating');
|
||||
if (d.Result == 'OK') {
|
||||
componentRow.attr('data-devicecomponentid', d.Component.Id);
|
||||
componentRow.find('input.description').val(d.Component.Description);
|
||||
componentRow.find('input.cost').val(d.Component.Cost);
|
||||
} else {
|
||||
alert('Unable to add component: ' + d.Result);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to add component: ' + textStatus);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
var editComponentJobTypes = function () {
|
||||
var edit$this = $(this);
|
||||
var componentRow = edit$this.closest('tr');
|
||||
|
||||
var id = componentRow.attr('data-devicecomponentid');
|
||||
|
||||
if (id) {
|
||||
var data = {
|
||||
id: id
|
||||
};
|
||||
$.ajax({
|
||||
url: '@Url.Action(MVC.API.DeviceModel.Component())',
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
success: function (d) {
|
||||
componentRow.find('input').attr('disabled', false).removeClass('updating');
|
||||
if (d.Result == 'OK') {
|
||||
$dialogUpdateJobTypes = $('#dialogUpdateJobTypes');
|
||||
$dialogUpdateJobTypes.find('input:checked').each(function () { $(this).attr('checked', false) });
|
||||
for (var i = 0; i < d.Component.JobSubTypes.length; i++) {
|
||||
var sjt = d.Component.JobSubTypes[i];
|
||||
$dialogUpdateJobTypes.find('#SubTypes_' + sjt).attr('checked', true);
|
||||
}
|
||||
$('#CheckboxBulkSelect_dialogUpdateJobTypes').checkboxBulkSelect('update');
|
||||
var buttons = $dialogUpdateJobTypes.dialog("option", "buttons");
|
||||
buttons['Save'] = function () {
|
||||
$dialogUpdateJobTypes.dialog("disable");
|
||||
var selectedSJTs = [];
|
||||
$dialogUpdateJobTypes.find('input:checked').each(function () { selectedSJTs.push($(this).val()) });
|
||||
|
||||
var data = {
|
||||
id: id,
|
||||
JobSubTypes: selectedSJTs
|
||||
};
|
||||
$.ajax({
|
||||
url: '@Url.Action(MVC.API.DeviceModel.ComponentUpdateJobSubTypes())',
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
traditional: true,
|
||||
data: data,
|
||||
success: function (d) {
|
||||
if (d.Result == 'OK') {
|
||||
if (d.Component.JobSubTypes.length > 0) {
|
||||
edit$this.addClass('editAlert');
|
||||
} else {
|
||||
edit$this.removeClass('editAlert');
|
||||
}
|
||||
$dialogUpdateJobTypes.dialog("enable");
|
||||
$dialogUpdateJobTypes.dialog("close");
|
||||
} else {
|
||||
alert('Unable to update component sub types: ' + d.Result);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to update component sub types: ' + textStatus);
|
||||
}
|
||||
});
|
||||
};
|
||||
var buttons = $dialogUpdateJobTypes.dialog("option", "buttons", buttons);
|
||||
$dialogUpdateJobTypes.dialog('open');
|
||||
} else {
|
||||
alert('Unable to load component: ' + d.Result);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to load component: ' + textStatus);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$("#dialogConfirmRemove").dialog({
|
||||
resizable: false,
|
||||
height: 140,
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
"Remove": function () {
|
||||
$(this).dialog("close");
|
||||
},
|
||||
Cancel: function () {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('#dialogUpdateJobTypes').dialog({
|
||||
resizable: false,
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
width: 550,
|
||||
buttons: {
|
||||
"Save": function () {
|
||||
$(this).dialog("close");
|
||||
},
|
||||
Cancel: function () {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('#CheckboxBulkSelect_dialogUpdateJobTypes').checkboxBulkSelect({ parentSelector: 'div' });
|
||||
|
||||
$deviceComponents.find('input').live('change', updateComponent).focus(function () { $(this).select() });
|
||||
$deviceComponents.find('span.remove').live('click', removeComponent);
|
||||
$deviceComponents.find('span.edit').live('click', editComponentJobTypes);
|
||||
|
||||
});
|
||||
</script>
|
||||
<div id="dialogUpdateJobTypes" title="Update Job Types">
|
||||
<div>
|
||||
<h2>
|
||||
Hardware Non-Warranty Job Types</h2>
|
||||
@CommonHelpers.CheckBoxList("SubTypes", Model.JobSubTypes.ToSelectListItems(), 2)
|
||||
<br />
|
||||
<span id="CheckboxBulkSelect_dialogUpdateJobTypes" class="checkboxBulkSelectContainer">
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id="dialogConfirmRemove" title="Delete this Component?">
|
||||
<p>
|
||||
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
|
||||
This item will be permanently deleted and cannot be recovered. Are you sure?</p>
|
||||
</div>
|
||||
@@ -0,0 +1,412 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.17929
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Disco.Web.Areas.Config.Views.DeviceModel
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.Helpers;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Mvc.Ajax;
|
||||
using System.Web.Mvc.Html;
|
||||
using System.Web.Routing;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.WebPages;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DeviceModel/_DeviceComponentsTable.cshtml")]
|
||||
public class DeviceComponentsTable : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.DeviceModel.DeviceComponentsModel>
|
||||
{
|
||||
public DeviceComponentsTable()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 2 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
|
||||
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Disco-jQueryExtensions");
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n<table");
|
||||
|
||||
WriteLiteral(" id=\"deviceComponents\"");
|
||||
|
||||
WriteLiteral(" data-devicemodelid=\"");
|
||||
|
||||
|
||||
#line 5 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
|
||||
Write(Model.DeviceModelId.HasValue ? Model.DeviceModelId.Value.ToString() : string.Empty);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(">\r\n <tr>\r\n <th>\r\n Description\r\n </th>\r\n <th>\r\n" +
|
||||
" Cost\r\n </th>\r\n <th>\r\n Job Types\r\n </" +
|
||||
"th>\r\n <th");
|
||||
|
||||
WriteLiteral(" class=\"actions\"");
|
||||
|
||||
WriteLiteral(">\r\n \r\n </th>\r\n </tr>\r\n");
|
||||
|
||||
|
||||
#line 20 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 20 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
|
||||
foreach (var item in Model.DeviceComponents)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <tr");
|
||||
|
||||
WriteLiteral(" data-devicecomponentid=\"");
|
||||
|
||||
|
||||
#line 22 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
|
||||
Write(item.Id);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(">\r\n <td>\r\n <input");
|
||||
|
||||
WriteLiteral(" type=\"text\"");
|
||||
|
||||
WriteLiteral(" class=\"description\"");
|
||||
|
||||
WriteAttribute("value", Tuple.Create(" value=\"", 710), Tuple.Create("\"", 735)
|
||||
|
||||
#line 24 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 718), Tuple.Create<System.Object, System.Int32>(item.Description
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 718), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" />\r\n </td>\r\n <td>\r\n <input");
|
||||
|
||||
WriteLiteral(" type=\"text\"");
|
||||
|
||||
WriteLiteral(" class=\"cost\"");
|
||||
|
||||
WriteAttribute("value", Tuple.Create(" value=\"", 825), Tuple.Create("\"", 857)
|
||||
|
||||
#line 27 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 833), Tuple.Create<System.Object, System.Int32>(item.Cost.ToString("C")
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 833), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" />\r\n </td>\r\n <td>\r\n <span");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 921), Tuple.Create("\"", 992)
|
||||
, Tuple.Create(Tuple.Create("", 929), Tuple.Create("edit", 929), true)
|
||||
|
||||
#line 30 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 933), Tuple.Create<System.Object, System.Int32>(item.JobSubTypes.Count > 0 ? " editAlert" : string.Empty
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 933), false)
|
||||
);
|
||||
|
||||
WriteLiteral("></span>\r\n </td>\r\n <td>\r\n <span");
|
||||
|
||||
WriteLiteral(" class=\"remove\"");
|
||||
|
||||
WriteLiteral("></span>\r\n </td>\r\n </tr>\r\n");
|
||||
|
||||
|
||||
#line 36 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <tr>\r\n <td");
|
||||
|
||||
WriteLiteral(" colspan=\"4\"");
|
||||
|
||||
WriteLiteral(">\r\n <a");
|
||||
|
||||
WriteLiteral(" href=\"#\"");
|
||||
|
||||
WriteLiteral(" id=\"addDeviceComponent\"");
|
||||
|
||||
WriteLiteral(">Add Component</a>\r\n </td>\r\n </tr>\r\n</table>\r\n<script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
$(function () {
|
||||
var $deviceComponents = $('#deviceComponents');
|
||||
|
||||
$('#addDeviceComponent').click(function () {
|
||||
var dc = $('<tr><td><input type=""text"" class=""description"" /></td><td><input type=""text"" class=""cost"" /></td><td><span class=""edit""></span></td><td><span class=""remove""></span></td></tr>');
|
||||
dc.find('input').focus(function () { $(this).select() })
|
||||
dc.insertBefore($deviceComponents.find('tr').last());
|
||||
dc.find('input.description').focus();
|
||||
return false;
|
||||
});
|
||||
|
||||
var removeComponentConfirmed = function (id, row) {
|
||||
var data = { id: id };
|
||||
$.ajax({
|
||||
url: '");
|
||||
|
||||
|
||||
#line 58 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
|
||||
Write(Url.Action(MVC.API.DeviceModel.ComponentRemove()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\',\r\n dataType: \'json\',\r\n data: data,\r\n " +
|
||||
" success: function (d) {\r\n if (d == \'OK\') {\r\n " +
|
||||
" row.remove();\r\n } else {\r\n a" +
|
||||
"lert(\'Unable to remove component: \' + d);\r\n }\r\n " +
|
||||
" },\r\n error: function (jqXHR, textStatus, errorThrown) {\r\n " +
|
||||
" alert(\'Unable to remove component: \' + textStatus);\r\n " +
|
||||
" }\r\n });\r\n }\r\n var removeComponent = function () {\r\n " +
|
||||
" var componentRow = $(this).closest(\'tr\');\r\n var id = compo" +
|
||||
"nentRow.attr(\'data-devicecomponentid\');\r\n if (id) {\r\n " +
|
||||
"var dialog = $(\"#dialogConfirmRemove\");\r\n var buttons = dialog.di" +
|
||||
"alog(\"option\", \"buttons\");\r\n buttons[\'Remove\'] = function () { re" +
|
||||
"moveComponentConfirmed(id, componentRow); $(this).dialog(\"close\"); };\r\n " +
|
||||
" var buttons = dialog.dialog(\"option\", \"buttons\", buttons);\r\n " +
|
||||
" dialog.dialog(\'open\');\r\n } else {\r\n // New - Remove" +
|
||||
"\r\n componentRow.remove();\r\n }\r\n }\r\n var " +
|
||||
"updateComponent = function () {\r\n var componentRow = $(this).closest(" +
|
||||
"\'tr\');\r\n componentRow.find(\'input\').attr(\'disabled\', true).addClass(\'" +
|
||||
"updating\');\r\n\r\n var id = componentRow.attr(\'data-devicecomponentid\');" +
|
||||
"\r\n if (id) {\r\n // Update\r\n var data = {" +
|
||||
"\r\n id: id,\r\n Description: componentRow.fin" +
|
||||
"d(\'input.description\').val(),\r\n Cost: componentRow.find(\'inpu" +
|
||||
"t.cost\').val()\r\n };\r\n $.ajax({\r\n " +
|
||||
" url: \'");
|
||||
|
||||
|
||||
#line 100 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
|
||||
Write(Url.Action(MVC.API.DeviceModel.ComponentUpdate()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@"',
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
data: data,
|
||||
success: function (d) {
|
||||
componentRow.find('input').attr('disabled', false).removeClass('updating');
|
||||
if (d.Result == 'OK') {
|
||||
componentRow.find('input.description').val(d.Component.Description);
|
||||
componentRow.find('input.cost').val(d.Component.Cost);
|
||||
} else {
|
||||
alert('Unable to update component: ' + d.Result);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to update component: ' + textStatus);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Add
|
||||
id = componentRow.closest('table').attr('data-devicemodelid');
|
||||
var data = {
|
||||
id: id,
|
||||
Description: componentRow.find('input.description').val(),
|
||||
Cost: componentRow.find('input.cost').val()
|
||||
};
|
||||
$.ajax({
|
||||
url: '");
|
||||
|
||||
|
||||
#line 126 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
|
||||
Write(Url.Action(MVC.API.DeviceModel.ComponentAdd(null, null, null)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@"',
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
data: data,
|
||||
success: function (d) {
|
||||
componentRow.find('input').attr('disabled', false).removeClass('updating');
|
||||
if (d.Result == 'OK') {
|
||||
componentRow.attr('data-devicecomponentid', d.Component.Id);
|
||||
componentRow.find('input.description').val(d.Component.Description);
|
||||
componentRow.find('input.cost').val(d.Component.Cost);
|
||||
} else {
|
||||
alert('Unable to add component: ' + d.Result);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to add component: ' + textStatus);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
var editComponentJobTypes = function () {
|
||||
var edit$this = $(this);
|
||||
var componentRow = edit$this.closest('tr');
|
||||
|
||||
var id = componentRow.attr('data-devicecomponentid');
|
||||
|
||||
if (id) {
|
||||
var data = {
|
||||
id: id
|
||||
};
|
||||
$.ajax({
|
||||
url: '");
|
||||
|
||||
|
||||
#line 157 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
|
||||
Write(Url.Action(MVC.API.DeviceModel.Component()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\',\r\n dataType: \'json\',\r\n data: data,\r\n " +
|
||||
" success: function (d) {\r\n componentRow.fin" +
|
||||
"d(\'input\').attr(\'disabled\', false).removeClass(\'updating\');\r\n " +
|
||||
" if (d.Result == \'OK\') {\r\n $dialogUpdateJobTypes " +
|
||||
"= $(\'#dialogUpdateJobTypes\');\r\n $dialogUpdateJobTypes" +
|
||||
".find(\'input:checked\').each(function () { $(this).attr(\'checked\', false) });\r\n " +
|
||||
" for (var i = 0; i < d.Component.JobSubTypes.length; i+" +
|
||||
"+) {\r\n var sjt = d.Component.JobSubTypes[i];\r\n " +
|
||||
" $dialogUpdateJobTypes.find(\'#SubTypes_\' + sjt).attr" +
|
||||
"(\'checked\', true);\r\n }\r\n $" +
|
||||
"(\'#CheckboxBulkSelect_dialogUpdateJobTypes\').checkboxBulkSelect(\'update\');\r\n " +
|
||||
" var buttons = $dialogUpdateJobTypes.dialog(\"option\", \"bu" +
|
||||
"ttons\");\r\n buttons[\'Save\'] = function () {\r\n " +
|
||||
" $dialogUpdateJobTypes.dialog(\"disable\");\r\n " +
|
||||
" var selectedSJTs = [];\r\n $dialog" +
|
||||
"UpdateJobTypes.find(\'input:checked\').each(function () { selectedSJTs.push($(this" +
|
||||
").val()) });\r\n\r\n var data = {\r\n " +
|
||||
" id: id,\r\n JobSubTypes: sele" +
|
||||
"ctedSJTs\r\n };\r\n $." +
|
||||
"ajax({\r\n url: \'");
|
||||
|
||||
|
||||
#line 181 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
|
||||
Write(Url.Action(MVC.API.DeviceModel.ComponentUpdateJobSubTypes()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\',\r\n dataType: \'json\',\r\n " +
|
||||
" type: \'POST\',\r\n traditional: tr" +
|
||||
"ue,\r\n data: data,\r\n " +
|
||||
" success: function (d) {\r\n if (d" +
|
||||
".Result == \'OK\') {\r\n if (d.Component." +
|
||||
"JobSubTypes.length > 0) {\r\n edit$" +
|
||||
"this.addClass(\'editAlert\');\r\n } else " +
|
||||
"{\r\n edit$this.removeClass(\'editAl" +
|
||||
"ert\');\r\n }\r\n " +
|
||||
" $dialogUpdateJobTypes.dialog(\"enable\");\r\n " +
|
||||
" $dialogUpdateJobTypes.dialog(\"close\");\r\n " +
|
||||
" } else {\r\n al" +
|
||||
"ert(\'Unable to update component sub types: \' + d.Result);\r\n " +
|
||||
" }\r\n },\r\n " +
|
||||
" error: function (jqXHR, textStatus, errorThrown) {\r\n " +
|
||||
" alert(\'Unable to update component sub types: \' + t" +
|
||||
"extStatus);\r\n }\r\n " +
|
||||
" });\r\n };\r\n var buttons" +
|
||||
" = $dialogUpdateJobTypes.dialog(\"option\", \"buttons\", buttons);\r\n " +
|
||||
" $dialogUpdateJobTypes.dialog(\'open\');\r\n } els" +
|
||||
"e {\r\n alert(\'Unable to load component: \' + d.Result);" +
|
||||
"\r\n }\r\n },\r\n error: " +
|
||||
"function (jqXHR, textStatus, errorThrown) {\r\n alert(\'Unab" +
|
||||
"le to load component: \' + textStatus);\r\n }\r\n }" +
|
||||
");\r\n }\r\n\r\n }\r\n\r\n $(\"#dialogConfirmRemove\").dialog({\r\n " +
|
||||
" resizable: false,\r\n height: 140,\r\n modal: true,\r" +
|
||||
"\n autoOpen: false,\r\n buttons: {\r\n \"Remove\":" +
|
||||
" function () {\r\n $(this).dialog(\"close\");\r\n }," +
|
||||
"\r\n Cancel: function () {\r\n $(this).dialog(\"clo" +
|
||||
"se\");\r\n }\r\n }\r\n });\r\n\r\n $(\'#dialogUpdate" +
|
||||
"JobTypes\').dialog({\r\n resizable: false,\r\n modal: true,\r\n " +
|
||||
" autoOpen: false,\r\n width: 550,\r\n buttons: {\r\n " +
|
||||
" \"Save\": function () {\r\n $(this).dialog(\"close\");" +
|
||||
"\r\n },\r\n Cancel: function () {\r\n " +
|
||||
" $(this).dialog(\"close\");\r\n }\r\n }\r\n });\r\n\r\n " +
|
||||
" $(\'#CheckboxBulkSelect_dialogUpdateJobTypes\').checkboxBulkSelect({ parentSel" +
|
||||
"ector: \'div\' });\r\n\r\n $deviceComponents.find(\'input\').live(\'change\', updat" +
|
||||
"eComponent).focus(function () { $(this).select() });\r\n $deviceComponents." +
|
||||
"find(\'span.remove\').live(\'click\', removeComponent);\r\n $deviceComponents.f" +
|
||||
"ind(\'span.edit\').live(\'click\', editComponentJobTypes);\r\n\r\n });\r\n</script>\r\n<d" +
|
||||
"iv");
|
||||
|
||||
WriteLiteral(" id=\"dialogUpdateJobTypes\"");
|
||||
|
||||
WriteLiteral(" title=\"Update Job Types\"");
|
||||
|
||||
WriteLiteral(">\r\n <div>\r\n <h2>\r\n Hardware Non-Warranty Job Types</h2>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 260 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
|
||||
Write(CommonHelpers.CheckBoxList("SubTypes", Model.JobSubTypes.ToSelectListItems(), 2));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n <br />\r\n <span");
|
||||
|
||||
WriteLiteral(" id=\"CheckboxBulkSelect_dialogUpdateJobTypes\"");
|
||||
|
||||
WriteLiteral(" class=\"checkboxBulkSelectContainer\"");
|
||||
|
||||
WriteLiteral(">\r\n </span>\r\n </div>\r\n</div>\r\n<div");
|
||||
|
||||
WriteLiteral(" id=\"dialogConfirmRemove\"");
|
||||
|
||||
WriteLiteral(" title=\"Delete this Component?\"");
|
||||
|
||||
WriteLiteral(">\r\n <p>\r\n <span");
|
||||
|
||||
WriteLiteral(" class=\"ui-icon ui-icon-alert\"");
|
||||
|
||||
WriteLiteral(" style=\"float: left; margin: 0 7px 20px 0;\"");
|
||||
|
||||
WriteLiteral("></span>\r\n This item will be permanently deleted and cannot be recovered. " +
|
||||
"Are you sure?</p>\r\n</div>\r\n");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -0,0 +1,43 @@
|
||||
@model Disco.Models.Repository.DeviceProfile
|
||||
@{
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Profiles", MVC.Config.DeviceProfile.Index(null), "Create");
|
||||
}
|
||||
@using (Html.BeginForm())
|
||||
{
|
||||
<div class="form" style="width: 450px">
|
||||
<table>
|
||||
<tr>
|
||||
<th>
|
||||
Name:
|
||||
</th>
|
||||
<td>
|
||||
@Html.TextBoxFor(model => model.Name)<br />@Html.ValidationMessageFor(model => model.Name)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Short Name:
|
||||
</th>
|
||||
<td>@Html.TextBoxFor(model => model.ShortName)<br />@Html.ValidationMessageFor(model => model.ShortName)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Description:
|
||||
</th>
|
||||
<td>@Html.TextBoxFor(model => model.Description)<br />@Html.ValidationMessageFor(model => model.Description)
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="ComputerNameTemplate" value="DeviceProfile.ShortName + '-' + SerialNumber" />
|
||||
<input type="hidden" name="ProvisionADAccount" value="True" />
|
||||
<p class="actions">
|
||||
<input type="submit" class="button" value="Create" />
|
||||
</p>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$('#Name').focus().select();
|
||||
});
|
||||
</script>
|
||||
}
|
||||
@@ -0,0 +1,174 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.17929
|
||||
//
|
||||
// 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.DeviceProfile
|
||||
{
|
||||
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.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DeviceProfile/Create.cshtml")]
|
||||
public class Create : System.Web.Mvc.WebViewPage<Disco.Models.Repository.DeviceProfile>
|
||||
{
|
||||
public Create()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 2 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Profiles", MVC.Config.DeviceProfile.Index(null), "Create");
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
|
||||
#line 5 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
|
||||
using (Html.BeginForm())
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"form\"");
|
||||
|
||||
WriteLiteral(" style=\"width: 450px\"");
|
||||
|
||||
WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th>\r\n N" +
|
||||
"ame:\r\n </th>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 14 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
|
||||
Write(Html.TextBoxFor(model => model.Name));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("<br />");
|
||||
|
||||
|
||||
#line 14 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
|
||||
Write(Html.ValidationMessageFor(model => model.Name));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
|
||||
">\r\n Short Name:\r\n </th>\r\n <td>");
|
||||
|
||||
|
||||
#line 21 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
|
||||
Write(Html.TextBoxFor(model => model.ShortName));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("<br />");
|
||||
|
||||
|
||||
#line 21 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
|
||||
Write(Html.ValidationMessageFor(model => model.ShortName));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
|
||||
">\r\n Description:\r\n </th>\r\n <td>" +
|
||||
"");
|
||||
|
||||
|
||||
#line 28 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
|
||||
Write(Html.TextBoxFor(model => model.Description));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("<br />");
|
||||
|
||||
|
||||
#line 28 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
|
||||
Write(Html.ValidationMessageFor(model => model.Description));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n </table>\r\n <input");
|
||||
|
||||
WriteLiteral(" type=\"hidden\"");
|
||||
|
||||
WriteLiteral(" name=\"ComputerNameTemplate\"");
|
||||
|
||||
WriteLiteral(" value=\"DeviceProfile.ShortName + \'-\' + SerialNumber\"");
|
||||
|
||||
WriteLiteral(" />\r\n <input");
|
||||
|
||||
WriteLiteral(" type=\"hidden\"");
|
||||
|
||||
WriteLiteral(" name=\"ProvisionADAccount\"");
|
||||
|
||||
WriteLiteral(" value=\"True\"");
|
||||
|
||||
WriteLiteral(" />\r\n <p");
|
||||
|
||||
WriteLiteral(" class=\"actions\"");
|
||||
|
||||
WriteLiteral(">\r\n <input");
|
||||
|
||||
WriteLiteral(" type=\"submit\"");
|
||||
|
||||
WriteLiteral(" class=\"button\"");
|
||||
|
||||
WriteLiteral(" value=\"Create\"");
|
||||
|
||||
WriteLiteral(" />\r\n </p>\r\n </div>\r\n");
|
||||
|
||||
WriteLiteral(" <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(">\r\n $(function () {\r\n $(\'#Name\').focus().select();\r\n });" +
|
||||
"\r\n </script>\r\n");
|
||||
|
||||
|
||||
#line 43 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -0,0 +1,60 @@
|
||||
@model Disco.Web.Areas.Config.Models.DeviceProfile.DefaultsModel
|
||||
@{
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Profiles", MVC.Config.DeviceProfile.Index(null), "Defaults");
|
||||
}
|
||||
<div class="form" style="width: 600px">
|
||||
<table>
|
||||
<tr>
|
||||
<th class="name" style="width: 230px">
|
||||
Default Profile:
|
||||
</th>
|
||||
<td class="value">
|
||||
@Html.DropDownListFor(m => m.Default, Model.DeviceProfiles.ToSelectListItems(Model.Default))
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$('#Default').change(function () {
|
||||
$this = $(this);
|
||||
$ajaxLoading = $this.next('.ajaxLoading').show();
|
||||
var data = { id: $this.val() };
|
||||
$.getJSON('@(Url.Action(MVC.API.DeviceProfile.Default()))', data, function (response, result) {
|
||||
if (result != 'success' || response != 'OK') {
|
||||
alert('Unable to change Default Device Profile:\n' + response);
|
||||
$ajaxLoading.hide();
|
||||
} else {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="name">
|
||||
Default Add Device Offline Profile:
|
||||
</th>
|
||||
<td class="value">
|
||||
@Html.DropDownListFor(m => m.DefaultAddDeviceOffline, Model.DeviceProfilesAndNone.ToSelectListItems(Model.DefaultAddDeviceOffline))
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$('#DefaultAddDeviceOffline').change(function () {
|
||||
$this = $(this);
|
||||
$ajaxLoading = $this.next('.ajaxLoading').show();
|
||||
var data = { id: $this.val() };
|
||||
$.getJSON('@(Url.Action(MVC.API.DeviceProfile.DefaultAddDeviceOffline()))', data, function (response, result) {
|
||||
if (result != 'success' || response != 'OK') {
|
||||
alert('Unable to change Default Add Device Offline Device Profile:\n' + response);
|
||||
$ajaxLoading.hide();
|
||||
} else {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
@@ -0,0 +1,192 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.17929
|
||||
//
|
||||
// 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.DeviceProfile
|
||||
{
|
||||
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.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DeviceProfile/Defaults.cshtml")]
|
||||
public class Defaults : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.DeviceProfile.DefaultsModel>
|
||||
{
|
||||
public Defaults()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 2 "..\..\Areas\Config\Views\DeviceProfile\Defaults.cshtml"
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Profiles", MVC.Config.DeviceProfile.Index(null), "Defaults");
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n<div");
|
||||
|
||||
WriteLiteral(" class=\"form\"");
|
||||
|
||||
WriteLiteral(" style=\"width: 600px\"");
|
||||
|
||||
WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th");
|
||||
|
||||
WriteLiteral(" class=\"name\"");
|
||||
|
||||
WriteLiteral(" style=\"width: 230px\"");
|
||||
|
||||
WriteLiteral(">\r\n Default Profile:\r\n </th>\r\n <td");
|
||||
|
||||
WriteLiteral(" class=\"value\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 12 "..\..\Areas\Config\Views\DeviceProfile\Defaults.cshtml"
|
||||
Write(Html.DropDownListFor(m => m.Default, Model.DeviceProfiles.ToSelectListItems(Model.Default)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 13 "..\..\Areas\Config\Views\DeviceProfile\Defaults.cshtml"
|
||||
Write(AjaxHelpers.AjaxLoader());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
$(function () {
|
||||
$('#Default').change(function () {
|
||||
$this = $(this);
|
||||
$ajaxLoading = $this.next('.ajaxLoading').show();
|
||||
var data = { id: $this.val() };
|
||||
$.getJSON('");
|
||||
|
||||
|
||||
#line 20 "..\..\Areas\Config\Views\DeviceProfile\Defaults.cshtml"
|
||||
Write(Url.Action(MVC.API.DeviceProfile.Default()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@"', data, function (response, result) {
|
||||
if (result != 'success' || response != 'OK') {
|
||||
alert('Unable to change Default Device Profile:\n' + response);
|
||||
$ajaxLoading.hide();
|
||||
} else {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th");
|
||||
|
||||
WriteLiteral(" class=\"name\"");
|
||||
|
||||
WriteLiteral(">\r\n Default Add Device Offline Profile:\r\n </th>\r\n " +
|
||||
" <td");
|
||||
|
||||
WriteLiteral(" class=\"value\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 38 "..\..\Areas\Config\Views\DeviceProfile\Defaults.cshtml"
|
||||
Write(Html.DropDownListFor(m => m.DefaultAddDeviceOffline, Model.DeviceProfilesAndNone.ToSelectListItems(Model.DefaultAddDeviceOffline)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 39 "..\..\Areas\Config\Views\DeviceProfile\Defaults.cshtml"
|
||||
Write(AjaxHelpers.AjaxLoader());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
$(function () {
|
||||
$('#DefaultAddDeviceOffline').change(function () {
|
||||
$this = $(this);
|
||||
$ajaxLoading = $this.next('.ajaxLoading').show();
|
||||
var data = { id: $this.val() };
|
||||
$.getJSON('");
|
||||
|
||||
|
||||
#line 46 "..\..\Areas\Config\Views\DeviceProfile\Defaults.cshtml"
|
||||
Write(Url.Action(MVC.API.DeviceProfile.DefaultAddDeviceOffline()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@"', data, function (response, result) {
|
||||
if (result != 'success' || response != 'OK') {
|
||||
alert('Unable to change Default Add Device Offline Device Profile:\n' + response);
|
||||
$ajaxLoading.hide();
|
||||
} else {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -0,0 +1,9 @@
|
||||
@model Disco.Web.Areas.Config.Models.DeviceProfile.IndexModel
|
||||
@{
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Profiles");
|
||||
}
|
||||
@Html.Partial(MVC.Config.DeviceProfile.Views._Table, Model, new ViewDataDictionary())
|
||||
<div class="actionBar">
|
||||
@Html.ActionLinkButton("Modify Default Profiles", MVC.Config.DeviceProfile.Defaults())
|
||||
@Html.ActionLinkButton("Create Device Profile", MVC.Config.DeviceProfile.Create())
|
||||
</div>
|
||||
@@ -0,0 +1,91 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.17929
|
||||
//
|
||||
// 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.DeviceProfile
|
||||
{
|
||||
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.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DeviceProfile/Index.cshtml")]
|
||||
public class Index : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.DeviceProfile.IndexModel>
|
||||
{
|
||||
public Index()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 2 "..\..\Areas\Config\Views\DeviceProfile\Index.cshtml"
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Profiles");
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
|
||||
#line 5 "..\..\Areas\Config\Views\DeviceProfile\Index.cshtml"
|
||||
Write(Html.Partial(MVC.Config.DeviceProfile.Views._Table, Model, new ViewDataDictionary()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n<div");
|
||||
|
||||
WriteLiteral(" class=\"actionBar\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 7 "..\..\Areas\Config\Views\DeviceProfile\Index.cshtml"
|
||||
Write(Html.ActionLinkButton("Modify Default Profiles", MVC.Config.DeviceProfile.Defaults()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 8 "..\..\Areas\Config\Views\DeviceProfile\Index.cshtml"
|
||||
Write(Html.ActionLinkButton("Create Device Profile", MVC.Config.DeviceProfile.Create()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n</div>\r\n");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -0,0 +1,536 @@
|
||||
@model Disco.Web.Areas.Config.Models.DeviceProfile.ShowModel
|
||||
@{
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Profiles", MVC.Config.DeviceProfile.Index(null), Model.DeviceProfile.ToString());
|
||||
Html.BundleDeferred("~/Style/jQueryUI/dynatree");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/jQueryUI-DynaTree");
|
||||
}
|
||||
<div id="configurationDeviceProfileShow" class="form" style="width: 600px">
|
||||
<table>
|
||||
<tr>
|
||||
<th>
|
||||
Id:
|
||||
</th>
|
||||
<td>
|
||||
@Html.DisplayFor(model => model.DeviceProfile.Id)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Name:
|
||||
</th>
|
||||
<td>@Html.TextBoxFor(model => model.DeviceProfile.Name)
|
||||
@AjaxHelpers.AjaxSave()
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var $Name = $('#DeviceProfile_Name');
|
||||
var $NameAjaxSave = $Name.next('.ajaxSave');
|
||||
$Name
|
||||
.watermark('Profile Short Name')
|
||||
.focus(function () { $Name.select() })
|
||||
.keydown(function (e) {
|
||||
$NameAjaxSave.show();
|
||||
if (e.which == 13) {
|
||||
$(this).blur();
|
||||
}
|
||||
}).blur(function () {
|
||||
$NameAjaxSave.hide();
|
||||
})
|
||||
.change(function () {
|
||||
$NameAjaxSave.hide();
|
||||
var $ajaxLoading = $NameAjaxSave.next('.ajaxLoading').show();
|
||||
var data = { ProfileName: $Name.val() };
|
||||
$.ajax({
|
||||
url: '@Url.Action(MVC.API.DeviceProfile.UpdateName(Model.DeviceProfile.Id))',
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
success: function (d) {
|
||||
if (d == 'OK') {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
} else {
|
||||
$ajaxLoading.hide();
|
||||
alert('Unable to update name: ' + d);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to update name: ' + textStatus);
|
||||
$ajaxLoading.hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Short Name:
|
||||
</th>
|
||||
<td>@Html.TextBoxFor(model => model.DeviceProfile.ShortName)
|
||||
@AjaxHelpers.AjaxSave()
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var $ShortName = $('#DeviceProfile_ShortName');
|
||||
var $ShortNameAjaxSave = $ShortName.next('.ajaxSave');
|
||||
$ShortName
|
||||
.watermark('Profile Short Name')
|
||||
.focus(function () { $ShortName.select() })
|
||||
.keydown(function (e) {
|
||||
$ShortNameAjaxSave.show();
|
||||
if (e.which == 13) {
|
||||
$(this).blur();
|
||||
}
|
||||
}).blur(function () {
|
||||
$ShortNameAjaxSave.hide();
|
||||
})
|
||||
.change(function () {
|
||||
$ShortNameAjaxSave.hide();
|
||||
var $ajaxLoading = $ShortNameAjaxSave.next('.ajaxLoading').show();
|
||||
var data = { ShortName: $ShortName.val() };
|
||||
$.ajax({
|
||||
url: '@Url.Action(MVC.API.DeviceProfile.UpdateShortName(Model.DeviceProfile.Id))',
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
success: function (d) {
|
||||
if (d == 'OK') {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
} else {
|
||||
$ajaxLoading.hide();
|
||||
alert('Unable to update short name: ' + d);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to update short name: ' + textStatus);
|
||||
$ajaxLoading.hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Description:
|
||||
</th>
|
||||
<td>@Html.TextBoxFor(model => model.DeviceProfile.Description)
|
||||
@AjaxHelpers.AjaxSave()
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var $Description = $('#DeviceProfile_Description');
|
||||
var $DescriptionAjaxSave = $Description.next('.ajaxSave');
|
||||
$Description
|
||||
.watermark('Profile Description')
|
||||
.focus(function () { $Description.select() })
|
||||
.keydown(function (e) {
|
||||
$DescriptionAjaxSave.show();
|
||||
if (e.which == 13) {
|
||||
$(this).blur();
|
||||
}
|
||||
}).blur(function () {
|
||||
$DescriptionAjaxSave.hide();
|
||||
})
|
||||
.change(function () {
|
||||
$DescriptionAjaxSave.hide();
|
||||
var $ajaxLoading = $DescriptionAjaxSave.next('.ajaxLoading').show();
|
||||
var data = { Description: $Description.val() };
|
||||
$.ajax({
|
||||
url: '@Url.Action(MVC.API.DeviceProfile.UpdateDescription(Model.DeviceProfile.Id))',
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
success: function (d) {
|
||||
if (d == 'OK') {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
} else {
|
||||
$ajaxLoading.hide();
|
||||
alert('Unable to update description: ' + d);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to update description: ' + textStatus);
|
||||
$ajaxLoading.hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Distribution Type:
|
||||
</th>
|
||||
<td>
|
||||
@Html.DropDownList("DeviceProfile_DistributionType", Model.DeviceProfileDistributionTypes)
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$('#DeviceProfile_DistributionType').change(function () {
|
||||
var $this = $(this);
|
||||
var $ajaxLoading = $this.next('.ajaxLoading').show();
|
||||
var data = { DistributionType: $this.val() };
|
||||
$.getJSON('@Url.Action(MVC.API.DeviceProfile.UpdateDistributionType(Model.DeviceProfile.Id))', data, function (response, result) {
|
||||
if (result != 'success' || response != 'OK') {
|
||||
alert('Unable to change Distribution Type:\n' + response);
|
||||
$ajaxLoading.hide();
|
||||
} else {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Address:
|
||||
</th>
|
||||
<td>
|
||||
@Html.DropDownListFor(m => m.DeviceProfile.DefaultOrganisationAddress, Model.OrganisationAddresses.ToSelectListItems(Model.DeviceProfile.DefaultOrganisationAddress, true, "None"))
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$('#DeviceProfile_DefaultOrganisationAddress').change(function () {
|
||||
var $this = $(this);
|
||||
var $ajaxLoading = $this.next('.ajaxLoading').show();
|
||||
var data = { DefaultOrganisationAddress: $this.val() };
|
||||
$.getJSON('@Url.Action(MVC.API.DeviceProfile.UpdateDefaultOrganisationAddress(Model.DeviceProfile.Id))', data, function (response, result) {
|
||||
if (result != 'success' || response != 'OK') {
|
||||
alert('Unable to change Address:\n' + response);
|
||||
$ajaxLoading.hide();
|
||||
} else {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Allocate Certificates:
|
||||
</th>
|
||||
<td>
|
||||
@Html.DropDownListFor(model => model.DeviceProfile.CertificateProviderId, Model.CertificateProviders.ToSelectListItems(null, true, "Not Allocated"))
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var $field = $('#DeviceProfile_CertificateProviderId');
|
||||
var $ajaxLoading = $field.next('.ajaxLoading');
|
||||
$field
|
||||
.change(function () {
|
||||
$ajaxLoading.show();
|
||||
var data = { CertificateProviderId: $field.val() };
|
||||
$.ajax({
|
||||
url: '@Url.Action(MVC.API.DeviceProfile.UpdateCertificateProviderId(Model.DeviceProfile.Id))',
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
success: function (d) {
|
||||
if (d == 'OK') {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
} else {
|
||||
$ajaxLoading.hide();
|
||||
alert('Unable to update Certificate Provider Id: ' + d);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to update Certificate Provider Id: ' + textStatus);
|
||||
$ajaxLoading.hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Computer Name Template Expression:
|
||||
</th>
|
||||
<td>@Html.TextBoxFor(model => model.DeviceProfile.ComputerNameTemplate)
|
||||
@AjaxHelpers.AjaxSave()
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<a id="expressionBrowserAnchor" href="@(Url.Action(MVC.Config.DocumentTemplate.ExpressionBrowser()))">
|
||||
</a>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var $ComputerNameTemplate = $('#DeviceProfile_ComputerNameTemplate');
|
||||
var $ajaxSave = $ComputerNameTemplate.next('.ajaxSave');
|
||||
$ComputerNameTemplate
|
||||
.focus(function () { $ComputerNameTemplate.select() })
|
||||
.keydown(function (e) {
|
||||
$ajaxSave.show();
|
||||
if (e.which == 13) {
|
||||
$(this).blur();
|
||||
}
|
||||
}).blur(function () {
|
||||
$ajaxSave.hide();
|
||||
})
|
||||
.change(function () {
|
||||
$ajaxSave.hide();
|
||||
var $ajaxLoading = $ajaxSave.next('.ajaxLoading').show();
|
||||
var data = { ComputerNameTemplate: $ComputerNameTemplate.val() };
|
||||
$.ajax({
|
||||
url: '@(Url.Action(MVC.API.DeviceProfile.UpdateComputerNameTemplate(Model.DeviceProfile.Id)))',
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
success: function (d) {
|
||||
if (d == 'OK') {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
} else {
|
||||
$ajaxLoading.hide();
|
||||
alert('Unable to update computer name template: ' + d);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to update computer name template: ' + textStatus);
|
||||
$ajaxLoading.hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<div style="margin-top: 8px;">
|
||||
<label for="DeviceProfile_ProvisionADAccount">
|
||||
Provision Active Directory Account:
|
||||
</label>
|
||||
<input id="DeviceProfile_ProvisionADAccount" type="checkbox" @(Model.DeviceProfile.ProvisionADAccount ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty))/>
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$('#DeviceProfile_ProvisionADAccount').click(function () {
|
||||
var $this = $(this);
|
||||
var $ajaxLoading = $this.next('.ajaxLoading').show();
|
||||
var data = { ProvisionADAccount: $this.is(':checked') };
|
||||
$.getJSON('@Url.Action(MVC.API.DeviceProfile.UpdateProvisionADAccount(Model.DeviceProfile.Id))', data, function (response, result) {
|
||||
if (result != 'success' || response != 'OK') {
|
||||
alert('Unable to change Provision AD Account:\n' + response);
|
||||
$ajaxLoading.hide();
|
||||
} else {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<div style="margin-top: 8px;">
|
||||
<label for="DeviceProfile_EnforceComputerNameConvention">
|
||||
Enforce Naming Convention:
|
||||
</label>
|
||||
<input id="DeviceProfile_EnforceComputerNameConvention" type="checkbox" @(Model.DeviceProfile.EnforceComputerNameConvention ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty))/>
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$('#DeviceProfile_EnforceComputerNameConvention').click(function () {
|
||||
var $this = $(this);
|
||||
var $ajaxLoading = $this.next('.ajaxLoading').show();
|
||||
var data = { EnforceComputerNameConvention: $this.is(':checked') };
|
||||
$.getJSON('@Url.Action(MVC.API.DeviceProfile.UpdateEnforceComputerNameConvention(Model.DeviceProfile.Id))', data, function (response, result) {
|
||||
if (result != 'success' || response != 'OK') {
|
||||
alert('Unable to change Enforce Computer Name Convention:\n' + response);
|
||||
$ajaxLoading.hide();
|
||||
} else {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Default Organisational Unit:
|
||||
</th>
|
||||
<td>
|
||||
@Html.HiddenFor(model => model.DeviceProfile.OrganisationalUnit)
|
||||
<div id="displayOrganisationalUnit">
|
||||
</div>
|
||||
<a id="changeOrganisationalUnit" href="#">Change</a>@AjaxHelpers.AjaxLoader()
|
||||
<div id="dialogOrganisationalUnit" title="Default Organisational Unit">
|
||||
<div id="treeOrganisationalUnit">
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var ouValue = $('#DeviceProfile_OrganisationalUnit');
|
||||
var ouDisplay = $('#displayOrganisationalUnit');
|
||||
var ouTree = $('#treeOrganisationalUnit');
|
||||
var ouChangeLink = $('#changeOrganisationalUnit');
|
||||
var ouTreeLoaded = false;
|
||||
var ouFriendlyName = function (ou) {
|
||||
return ou.replace(/ou=/gi, '').split(',').reverse().join(' > ');
|
||||
};
|
||||
var updateDisplayOrganisationalUnit = function () {
|
||||
var value = ouValue.val();
|
||||
if (value) {
|
||||
ouDisplay.text(ouFriendlyName(value));
|
||||
} else {
|
||||
ouDisplay.text('{Default Computers Container}');
|
||||
}
|
||||
};
|
||||
var ouSet = function (ou) {
|
||||
$ajaxLoading = ouChangeLink.next('.ajaxLoading').show();
|
||||
var data = { OrganisationalUnit: ou };
|
||||
$.getJSON('@Url.Action(MVC.API.DeviceProfile.UpdateOrganisationalUnit(Model.DeviceProfile.Id, null))', data, function (response, result) {
|
||||
if (result != 'success' || response != 'OK') {
|
||||
alert('Unable to change Organisational Unit:\n' + response);
|
||||
$ajaxLoading.hide();
|
||||
} else {
|
||||
ouValue.val(ou);
|
||||
updateDisplayOrganisationalUnit();
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
}
|
||||
});
|
||||
}
|
||||
var ouUpdateTree = function () {
|
||||
var dynaTree = ouTree.dynatree("getTree");
|
||||
var value = ouValue.val();
|
||||
if (value) {
|
||||
dynaTree.activateKey(value);
|
||||
} else {
|
||||
var activeNode = dynaTree.getActiveNode();
|
||||
if (activeNode)
|
||||
activeNode.deactivate();
|
||||
}
|
||||
}
|
||||
|
||||
var ouDialog = $('#dialogOrganisationalUnit').dialog({
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
'Use Default Container': function () {
|
||||
ouSet('');
|
||||
$(this).dialog("close");
|
||||
},
|
||||
'Save': function () {
|
||||
var node = ouTree.dynatree("getTree").getActiveNode();
|
||||
if (node) {
|
||||
ouSet(node.data.key);
|
||||
$(this).dialog("close");
|
||||
} else {
|
||||
alert('Select an Organisational Unit to Save')
|
||||
}
|
||||
}
|
||||
},
|
||||
draggable: false,
|
||||
modal: true,
|
||||
resizable: false,
|
||||
width: 400,
|
||||
height: 400
|
||||
});
|
||||
|
||||
var ouChange = function () {
|
||||
if (!ouTreeLoaded) {
|
||||
$.getJSON('@(Url.Action(MVC.API.DeviceProfile.OrganisationalUnits()))', null, function (data) {
|
||||
var dynatreeDataTransformer = function (element) {
|
||||
var child = {
|
||||
title: element.Name,
|
||||
key: element.Path,
|
||||
isFolder: true
|
||||
}
|
||||
if (element.Children) {
|
||||
child.children = [];
|
||||
for (var i = 0; i < element.Children.length; i++) {
|
||||
child.children.push(dynatreeDataTransformer(element.Children[i]));
|
||||
}
|
||||
}
|
||||
return child;
|
||||
};
|
||||
var dynatreeData = [];
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
dynatreeData.push(dynatreeDataTransformer(data[i]));
|
||||
}
|
||||
|
||||
ouTree.dynatree({
|
||||
children: dynatreeData,
|
||||
onActivate: function (node) {
|
||||
//alert('node selected: ' + node.data.key);
|
||||
}
|
||||
});
|
||||
ouTreeLoaded = true;
|
||||
ouUpdateTree();
|
||||
});
|
||||
} else {
|
||||
ouUpdateTree();
|
||||
}
|
||||
ouDialog.dialog('open');
|
||||
};
|
||||
|
||||
ouChangeLink.click(ouChange);
|
||||
updateDisplayOrganisationalUnit();
|
||||
});
|
||||
</script>
|
||||
<div style="margin-top: 8px;">
|
||||
<label for="DeviceProfile_EnforceOrganisationalUnit">
|
||||
Enforce:
|
||||
</label>
|
||||
<input id="DeviceProfile_EnforceOrganisationalUnit" type="checkbox" @(Model.DeviceProfile.EnforceOrganisationalUnit ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty))/>
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$('#DeviceProfile_EnforceOrganisationalUnit').click(function () {
|
||||
var $this = $(this);
|
||||
var $ajaxLoading = $this.next('.ajaxLoading').show();
|
||||
var data = { EnforceOrganisationalUnit: $this.is(':checked') };
|
||||
$.getJSON('@Url.Action(MVC.API.DeviceProfile.UpdateEnforceOrganisationalUnit(Model.DeviceProfile.Id))', data, function (response, result) {
|
||||
if (result != 'success' || response != 'OK') {
|
||||
alert('Unable to change Enforce Organisation Unit:\n' + response);
|
||||
$ajaxLoading.hide();
|
||||
} else {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="dialogConfirmDelete" title="Delete this Device Profile?">
|
||||
<p>
|
||||
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
|
||||
This item will be permanently deleted and cannot be recovered. Are you sure?</p>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
|
||||
var button = $('#buttonDelete');
|
||||
var buttonLink = button.attr('href');
|
||||
button.attr('href', '#');
|
||||
button.click(function () {
|
||||
$("#dialogConfirmDelete").dialog('open');
|
||||
});
|
||||
|
||||
$("#dialogConfirmDelete").dialog({
|
||||
resizable: false,
|
||||
height: 140,
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
"Delete": function () {
|
||||
$(this).dialog('disable');
|
||||
window.location.href = buttonLink;
|
||||
},
|
||||
Cancel: function () {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
<div class="actionBar">
|
||||
@if (Model.CanDelete)
|
||||
{
|
||||
@Html.ActionLinkButton("Delete", MVC.API.DeviceProfile.Delete(Model.DeviceProfile.Id, true), "buttonDelete")
|
||||
}
|
||||
@Html.ActionLinkButton("View Devices", MVC.Search.Query(Model.DeviceProfile.Id.ToString(), "DeviceProfile"))
|
||||
</div>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,15 @@
|
||||
@model Disco.Web.Areas.Config.Models.DeviceProfile.IndexModel
|
||||
@if (DiscoApplication.MultiSiteMode)
|
||||
{
|
||||
var deviceProfilesGrouped = Model.DeviceProfiles.OrderBy(i => i.AddressName).GroupBy(i => i.AddressName);
|
||||
foreach (var deviceProfilesGroup in deviceProfilesGrouped)
|
||||
{
|
||||
if (deviceProfilesGroup.Key != null)
|
||||
{ <h2>@deviceProfilesGroup.Key</h2> }
|
||||
@Html.Partial(MVC.Config.DeviceProfile.Views._TableRender, deviceProfilesGroup, new ViewDataDictionary())
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@Html.Partial(MVC.Config.DeviceProfile.Views._TableRender, Model.DeviceProfiles, new ViewDataDictionary())
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.17929
|
||||
//
|
||||
// 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.DeviceProfile
|
||||
{
|
||||
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.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DeviceProfile/_Table.cshtml")]
|
||||
public class Table : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.DeviceProfile.IndexModel>
|
||||
{
|
||||
public Table()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 2 "..\..\Areas\Config\Views\DeviceProfile\_Table.cshtml"
|
||||
if (DiscoApplication.MultiSiteMode)
|
||||
{
|
||||
var deviceProfilesGrouped = Model.DeviceProfiles.OrderBy(i => i.AddressName).GroupBy(i => i.AddressName);
|
||||
foreach (var deviceProfilesGroup in deviceProfilesGrouped)
|
||||
{
|
||||
if (deviceProfilesGroup.Key != null)
|
||||
{
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <h2>");
|
||||
|
||||
|
||||
#line 8 "..\..\Areas\Config\Views\DeviceProfile\_Table.cshtml"
|
||||
Write(deviceProfilesGroup.Key);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</h2> ");
|
||||
|
||||
|
||||
#line 8 "..\..\Areas\Config\Views\DeviceProfile\_Table.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 9 "..\..\Areas\Config\Views\DeviceProfile\_Table.cshtml"
|
||||
Write(Html.Partial(MVC.Config.DeviceProfile.Views._TableRender, deviceProfilesGroup, new ViewDataDictionary()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 9 "..\..\Areas\Config\Views\DeviceProfile\_Table.cshtml"
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 14 "..\..\Areas\Config\Views\DeviceProfile\_Table.cshtml"
|
||||
Write(Html.Partial(MVC.Config.DeviceProfile.Views._TableRender, Model.DeviceProfiles, new ViewDataDictionary()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 14 "..\..\Areas\Config\Views\DeviceProfile\_Table.cshtml"
|
||||
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -0,0 +1,39 @@
|
||||
@model IEnumerable<Disco.Web.Areas.Config.Models.DeviceProfile._IndexModelDeviceProfile>
|
||||
<table class="tableData deviceProfileTable">
|
||||
<tr>
|
||||
<th class="name">
|
||||
Name
|
||||
</th>
|
||||
<th class="description">
|
||||
Description
|
||||
</th>
|
||||
<th class="type">
|
||||
Type
|
||||
</th>
|
||||
<th class="deviceCount">
|
||||
Device Count
|
||||
</th>
|
||||
</tr>
|
||||
@foreach (var item in Model)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@Html.ActionLink(item.Name, MVC.Config.DeviceProfile.Index(item.Id))
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Description)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.DistributionType)
|
||||
</td>
|
||||
<td>
|
||||
@item.DeviceCount.ToString("n0")
|
||||
@if (item.DeviceDecommissionedCount > 0)
|
||||
{
|
||||
<span class="smallMessage" title="@(item.DeviceDecommissionedCount) Decommissioned">
|
||||
(@(item.DeviceDecommissionedCount))</span>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
@@ -0,0 +1,186 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.17929
|
||||
//
|
||||
// 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.DeviceProfile
|
||||
{
|
||||
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.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DeviceProfile/_TableRender.cshtml")]
|
||||
public class TableRender : System.Web.Mvc.WebViewPage<IEnumerable<Disco.Web.Areas.Config.Models.DeviceProfile._IndexModelDeviceProfile>>
|
||||
{
|
||||
public TableRender()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
WriteLiteral("<table");
|
||||
|
||||
WriteLiteral(" class=\"tableData deviceProfileTable\"");
|
||||
|
||||
WriteLiteral(">\r\n <tr>\r\n <th");
|
||||
|
||||
WriteLiteral(" class=\"name\"");
|
||||
|
||||
WriteLiteral(">\r\n Name\r\n </th>\r\n <th");
|
||||
|
||||
WriteLiteral(" class=\"description\"");
|
||||
|
||||
WriteLiteral(">\r\n Description\r\n </th>\r\n <th");
|
||||
|
||||
WriteLiteral(" class=\"type\"");
|
||||
|
||||
WriteLiteral(">\r\n Type\r\n </th>\r\n <th");
|
||||
|
||||
WriteLiteral(" class=\"deviceCount\"");
|
||||
|
||||
WriteLiteral(">\r\n Device Count\r\n </th>\r\n </tr>\r\n");
|
||||
|
||||
|
||||
#line 17 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 17 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
|
||||
foreach (var item in Model)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <tr>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 21 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
|
||||
Write(Html.ActionLink(item.Name, MVC.Config.DeviceProfile.Index(item.Id)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 24 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
|
||||
Write(Html.DisplayFor(modelItem => item.Description));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 27 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
|
||||
Write(Html.DisplayFor(modelItem => item.DistributionType));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 30 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
|
||||
Write(item.DeviceCount.ToString("n0"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
|
||||
#line 31 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 31 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
|
||||
if (item.DeviceDecommissionedCount > 0)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <span");
|
||||
|
||||
WriteLiteral(" class=\"smallMessage\"");
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 1005), Tuple.Create("\"", 1061)
|
||||
|
||||
#line 33 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1013), Tuple.Create<System.Object, System.Int32>(item.DeviceDecommissionedCount
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 1013), false)
|
||||
, Tuple.Create(Tuple.Create(" ", 1046), Tuple.Create("Decommissioned", 1047), true)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n (");
|
||||
|
||||
|
||||
#line 34 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
|
||||
Write(item.DeviceDecommissionedCount);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(")</span>\r\n");
|
||||
|
||||
|
||||
#line 35 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </td>\r\n </tr>\r\n");
|
||||
|
||||
|
||||
#line 38 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</table>\r\n");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -0,0 +1,96 @@
|
||||
@model Disco.Web.Areas.Config.Models.DocumentTemplate.CreateModel
|
||||
@{
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Document Templates", MVC.Config.DocumentTemplate.Index(null), "Create");
|
||||
}
|
||||
@using (Html.BeginForm(MVC.Config.DocumentTemplate.Create(), FormMethod.Post, new { enctype = "multipart/form-data" }))
|
||||
{
|
||||
<div class="form" style="width: 650px">
|
||||
<table>
|
||||
<tr>
|
||||
<th>
|
||||
Id:
|
||||
</th>
|
||||
<td>@Html.TextBoxFor(model => model.DocumentTemplate.Id)<br />@Html.ValidationMessageFor(model => model.DocumentTemplate.Id)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Description:
|
||||
</th>
|
||||
<td>@Html.TextBoxFor(model => model.DocumentTemplate.Description)<br />@Html.ValidationMessageFor(model => model.DocumentTemplate.Description)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Scope:
|
||||
</th>
|
||||
<td>
|
||||
@Html.DropDownListFor(model => model.DocumentTemplate.Scope, Model.Scopes.ToSelectListItems(null))
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Template PDF
|
||||
</th>
|
||||
<td>
|
||||
<input type="file" name="Template" /><br />@Html.ValidationMessage("Template")
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="trJobTypes">
|
||||
<th class="name">
|
||||
Types:
|
||||
</th>
|
||||
<td class="value">
|
||||
@CommonHelpers.CheckBoxList("Types", Model.JobTypes.ToSelectListItems(Model.Types), 2)
|
||||
</td>
|
||||
</tr>
|
||||
@foreach (var jt in Model.JobTypes)
|
||||
{
|
||||
<tr id="trJobSubType@(jt.Id)" class="jobSubTypes">
|
||||
<th class="name">
|
||||
@jt.Description<br />
|
||||
Sub Types<br />
|
||||
@CommonHelpers.CheckboxBulkSelect(string.Format("CheckboxBulkSelect_{0}", jt.Id))
|
||||
</th>
|
||||
<td class="value">
|
||||
@CommonHelpers.CheckBoxList("SubTypes", Model.JobSubTypes.Where(jst => jst.JobTypeId == jt.Id).ToList().ToSelectListItems(Model.SubTypes), 2)
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
<p class="actions">
|
||||
<input type="submit" class="button" value="Create" />
|
||||
</p>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$('#Name').focus().select();
|
||||
|
||||
var $scope = $('#DocumentTemplate_Scope');
|
||||
var $trJobTypes = $('#trJobTypes');
|
||||
var $jobTypes = $trJobTypes.find('input[type="checkbox"]');
|
||||
$scope.change(scopeChange);
|
||||
$jobTypes.change(jobTypesChange);
|
||||
|
||||
scopeChange();
|
||||
|
||||
function scopeChange() {
|
||||
if ($scope.val() == 'Job') {
|
||||
$trJobTypes.show();
|
||||
jobTypesChange();
|
||||
} else {
|
||||
$trJobTypes.hide();
|
||||
$('.jobSubTypes').hide();
|
||||
}
|
||||
}
|
||||
|
||||
function jobTypesChange() {
|
||||
$('.jobSubTypes').hide();
|
||||
$jobTypes.filter(':checked').each(function () {
|
||||
$('#trJobSubType' + $(this).val()).show();
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
}
|
||||
@@ -0,0 +1,299 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.17929
|
||||
//
|
||||
// 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.DocumentTemplate
|
||||
{
|
||||
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.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DocumentTemplate/Create.cshtml")]
|
||||
public class Create : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.DocumentTemplate.CreateModel>
|
||||
{
|
||||
public Create()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 2 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Document Templates", MVC.Config.DocumentTemplate.Index(null), "Create");
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
|
||||
#line 5 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
|
||||
using (Html.BeginForm(MVC.Config.DocumentTemplate.Create(), FormMethod.Post, new { enctype = "multipart/form-data" }))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"form\"");
|
||||
|
||||
WriteLiteral(" style=\"width: 650px\"");
|
||||
|
||||
WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th>\r\n I" +
|
||||
"d:\r\n </th>\r\n <td>");
|
||||
|
||||
|
||||
#line 13 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
|
||||
Write(Html.TextBoxFor(model => model.DocumentTemplate.Id));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("<br />");
|
||||
|
||||
|
||||
#line 13 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
|
||||
Write(Html.ValidationMessageFor(model => model.DocumentTemplate.Id));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
|
||||
">\r\n Description:\r\n </th>\r\n <td>" +
|
||||
"");
|
||||
|
||||
|
||||
#line 20 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
|
||||
Write(Html.TextBoxFor(model => model.DocumentTemplate.Description));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("<br />");
|
||||
|
||||
|
||||
#line 20 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
|
||||
Write(Html.ValidationMessageFor(model => model.DocumentTemplate.Description));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
|
||||
">\r\n Scope:\r\n </th>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 28 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
|
||||
Write(Html.DropDownListFor(model => model.DocumentTemplate.Scope, Model.Scopes.ToSelectListItems(null)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
|
||||
">\r\n Template PDF\r\n </th>\r\n <td>" +
|
||||
"\r\n <input");
|
||||
|
||||
WriteLiteral(" type=\"file\"");
|
||||
|
||||
WriteLiteral(" name=\"Template\"");
|
||||
|
||||
WriteLiteral(" /><br />");
|
||||
|
||||
|
||||
#line 36 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
|
||||
Write(Html.ValidationMessage("Template"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr");
|
||||
|
||||
WriteLiteral(" id=\"trJobTypes\"");
|
||||
|
||||
WriteLiteral(">\r\n <th");
|
||||
|
||||
WriteLiteral(" class=\"name\"");
|
||||
|
||||
WriteLiteral(">\r\n Types:\r\n </th>\r\n <td");
|
||||
|
||||
WriteLiteral(" class=\"value\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 44 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
|
||||
Write(CommonHelpers.CheckBoxList("Types", Model.JobTypes.ToSelectListItems(Model.Types), 2));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
|
||||
|
||||
|
||||
#line 47 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 47 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
|
||||
foreach (var jt in Model.JobTypes)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <tr");
|
||||
|
||||
WriteAttribute("id", Tuple.Create(" id=\"", 1914), Tuple.Create("\"", 1939)
|
||||
, Tuple.Create(Tuple.Create("", 1919), Tuple.Create("trJobSubType", 1919), true)
|
||||
|
||||
#line 49 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1931), Tuple.Create<System.Object, System.Int32>(jt.Id
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 1931), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" class=\"jobSubTypes\"");
|
||||
|
||||
WriteLiteral(">\r\n <th");
|
||||
|
||||
WriteLiteral(" class=\"name\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 51 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
|
||||
Write(jt.Description);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("<br />\r\n Sub Types<br />\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 53 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
|
||||
Write(CommonHelpers.CheckboxBulkSelect(string.Format("CheckboxBulkSelect_{0}", jt.Id)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </th>\r\n <td");
|
||||
|
||||
WriteLiteral(" class=\"value\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 56 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
|
||||
Write(CommonHelpers.CheckBoxList("SubTypes", Model.JobSubTypes.Where(jst => jst.JobTypeId == jt.Id).ToList().ToSelectListItems(Model.SubTypes), 2));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n </tr> \r\n");
|
||||
|
||||
|
||||
#line 59 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </table>\r\n <p");
|
||||
|
||||
WriteLiteral(" class=\"actions\"");
|
||||
|
||||
WriteLiteral(">\r\n <input");
|
||||
|
||||
WriteLiteral(" type=\"submit\"");
|
||||
|
||||
WriteLiteral(" class=\"button\"");
|
||||
|
||||
WriteLiteral(" value=\"Create\"");
|
||||
|
||||
WriteLiteral(" />\r\n </p>\r\n </div>\r\n");
|
||||
|
||||
WriteLiteral(" <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
$(function () {
|
||||
$('#Name').focus().select();
|
||||
|
||||
var $scope = $('#DocumentTemplate_Scope');
|
||||
var $trJobTypes = $('#trJobTypes');
|
||||
var $jobTypes = $trJobTypes.find('input[type=""checkbox""]');
|
||||
$scope.change(scopeChange);
|
||||
$jobTypes.change(jobTypesChange);
|
||||
|
||||
scopeChange();
|
||||
|
||||
function scopeChange() {
|
||||
if ($scope.val() == 'Job') {
|
||||
$trJobTypes.show();
|
||||
jobTypesChange();
|
||||
} else {
|
||||
$trJobTypes.hide();
|
||||
$('.jobSubTypes').hide();
|
||||
}
|
||||
}
|
||||
|
||||
function jobTypesChange() {
|
||||
$('.jobSubTypes').hide();
|
||||
$jobTypes.filter(':checked').each(function () {
|
||||
$('#trJobSubType' + $(this).val()).show();
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
");
|
||||
|
||||
|
||||
#line 96 "..\..\Areas\Config\Views\DocumentTemplate\Create.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -0,0 +1,132 @@
|
||||
@model Disco.Web.Areas.Config.Models.DocumentTemplate.ExpressionBrowserModel
|
||||
@{
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Document Templates", MVC.Config.DocumentTemplate.Index(null), "Expression Browser");
|
||||
Html.BundleDeferred("~/Style/jQueryUI/dynatree");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/jQueryUI-DynaTree");
|
||||
}
|
||||
<div id="configurationDocumentTemplateExpressionBrowser">
|
||||
Expressions within Disco are based on the <a href="http://www.springframework.net/"
|
||||
target="_blank">Spring.NET Framework</a>. Please refer to the <a href="http://www.springframework.net/doc-latest/reference/html/expressions.html"
|
||||
target="_blank">Expression Evaluation</a> documentation.
|
||||
<h2>
|
||||
Device Scope</h2>
|
||||
<div id="deviceScopeTree" class="expressionTree">
|
||||
</div>
|
||||
<h2>
|
||||
Job Scope</h2>
|
||||
<div id="jobScopeTree" class="expressionTree">
|
||||
</div>
|
||||
<h2>
|
||||
User Scope</h2>
|
||||
<div id="userScopeTree" class="expressionTree">
|
||||
</div>
|
||||
<h2>
|
||||
Variables
|
||||
</h2>
|
||||
<div id="variableScopeTree" class="expressionTree">
|
||||
</div>
|
||||
<h2>
|
||||
Extension Libraries</h2>
|
||||
<div id="extScopeTree" class="expressionTree">
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
if (!document.DiscoFunctions) {
|
||||
document.DiscoFunctions = {};
|
||||
}
|
||||
|
||||
var typeLib = {};
|
||||
var loadTypeUrl = '@(Url.Action(MVC.Config.DocumentTemplate.ExpressionBrowser()))';
|
||||
var deviceScopeTree = $('#deviceScopeTree');
|
||||
var jobScopeTree = $('#jobScopeTree');
|
||||
var userScopeTree = $('#userScopeTree');
|
||||
var variableScopeTree = $('#variableScopeTree');
|
||||
var extScopeTree = $('#extScopeTree');
|
||||
|
||||
var lazyLoadNode = function (node) {
|
||||
if (node.data.expressionType) {
|
||||
node.setLazyNodeStatus(DTNodeStatus_Loading);
|
||||
loadType(node, node.data.expressionType, node.data.staticDeclaredMembersOnly);
|
||||
} else {
|
||||
if (node.data.memberDescriptor) {
|
||||
loadMember(node);
|
||||
} else {
|
||||
node.setLazyNodeStatus(DTNodeStatus_Ok);
|
||||
}
|
||||
}
|
||||
}
|
||||
var loadMember = function (memberNode) {
|
||||
var previousUpdateMode = memberNode.tree.enableUpdate(false);
|
||||
var memberDescriptor = memberNode.data.memberDescriptor;
|
||||
// Return Type
|
||||
memberNode.addChild({ title: 'Returns: ' + memberDescriptor.ReturnType, tooltip: memberDescriptor.ReturnExpressionType, isFolder: true, expressionType: memberDescriptor.ReturnExpressionType, isLazy: true, addClass: 'object' });
|
||||
// Parameters
|
||||
var parametersNode = memberNode.addChild({ title: 'Parameters', isFolder: true, addClass: 'parameter' });
|
||||
for (var i = 0; i < memberDescriptor.Parameters.length; i++) {
|
||||
var p = memberDescriptor.Parameters[i];
|
||||
parametersNode.addChild({ title: p.Name + ' [' + p.ReturnType + ']', tooltip: p.ReturnExpressionType, addClass: 'object' });
|
||||
}
|
||||
memberNode.setLazyNodeStatus(DTNodeStatus_Ok);
|
||||
memberNode.tree.enableUpdate(previousUpdateMode);
|
||||
}
|
||||
var typeLoaded = function (parentNode, typeDescriptor) {
|
||||
var previousUpdateMode = parentNode.tree.enableUpdate(false);
|
||||
for (var i = 0; i < typeDescriptor.Members.length; i++) {
|
||||
var memberDescriptor = typeDescriptor.Members[i];
|
||||
parentNode.addChild({ title: memberDescriptor.Name, tooltip: memberDescriptor.ReturnType, isFolder: true, addClass: memberDescriptor.Kind, memberDescriptor: memberDescriptor, isLazy: true });
|
||||
}
|
||||
parentNode.setLazyNodeStatus(DTNodeStatus_Ok);
|
||||
parentNode.tree.enableUpdate(previousUpdateMode);
|
||||
}
|
||||
|
||||
var loadType = function (parentNode, type, staticDeclaredMembersOnly) {
|
||||
if (typeLib[type]) {
|
||||
typeLoaded(parentNode, typeLib[type]);
|
||||
} else {
|
||||
var requestData = { type: type, StaticDeclaredMembersOnly: staticDeclaredMembersOnly };
|
||||
$.getJSON(loadTypeUrl, requestData, function (data) {
|
||||
typeLib[type] = data;
|
||||
typeLoaded(parentNode, data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var initVariable = function (name, type) {
|
||||
variableScopeTree.dynatree('getRoot').addChild({ title: name, tooltip: type, isFolder: true, addClass: 'object', expressionType: type, isLazy: true });
|
||||
}
|
||||
var initExpressionLibrary = function (name, type) {
|
||||
extScopeTree.dynatree('getRoot').addChild({ title: name, tooltip: type, isFolder: true, addClass: 'object', expressionType: type, staticDeclaredMembersOnly: true, isLazy: true });
|
||||
}
|
||||
|
||||
// Init
|
||||
deviceScopeTree.dynatree({ onLazyRead: lazyLoadNode });
|
||||
loadType(deviceScopeTree.dynatree('getRoot'), '@(Model.DeviceType)');
|
||||
|
||||
jobScopeTree.dynatree({ onLazyRead: lazyLoadNode });
|
||||
loadType(jobScopeTree.dynatree('getRoot'), '@(Model.JobType)');
|
||||
|
||||
userScopeTree.dynatree({ onLazyRead: lazyLoadNode });
|
||||
loadType(userScopeTree.dynatree('getRoot'), '@(Model.UserType)');
|
||||
|
||||
variableScopeTree.dynatree({ onLazyRead: lazyLoadNode });
|
||||
document.DiscoFunctions.expressionInitVariable = initVariable;
|
||||
|
||||
extScopeTree.dynatree({ onLazyRead: lazyLoadNode });
|
||||
document.DiscoFunctions.expressionInitExpressionLibrary = initExpressionLibrary;
|
||||
});
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
@{
|
||||
foreach (var variable in Model.Variables)
|
||||
{
|
||||
<text>document.DiscoFunctions.expressionInitVariable('@(variable.Key)', '@variable.Value');</text>
|
||||
}
|
||||
foreach (var variable in Model.ExtensionLibraries)
|
||||
{
|
||||
<text>document.DiscoFunctions.expressionInitExpressionLibrary('@(variable.Key)', '@variable.Value');</text>
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,282 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.17929
|
||||
//
|
||||
// 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.DocumentTemplate
|
||||
{
|
||||
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.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DocumentTemplate/ExpressionBrowser.cshtml")]
|
||||
public class ExpressionBrowser : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.DocumentTemplate.ExpressionBrowserModel>
|
||||
{
|
||||
public ExpressionBrowser()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 2 "..\..\Areas\Config\Views\DocumentTemplate\ExpressionBrowser.cshtml"
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Document Templates", MVC.Config.DocumentTemplate.Index(null), "Expression Browser");
|
||||
Html.BundleDeferred("~/Style/jQueryUI/dynatree");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/jQueryUI-DynaTree");
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n<div");
|
||||
|
||||
WriteLiteral(" id=\"configurationDocumentTemplateExpressionBrowser\"");
|
||||
|
||||
WriteLiteral(">\r\n Expressions within Disco are based on the <a");
|
||||
|
||||
WriteLiteral(" href=\"http://www.springframework.net/\"");
|
||||
|
||||
WriteLiteral("\r\n target=\"_blank\"");
|
||||
|
||||
WriteLiteral(">Spring.NET Framework</a>. Please refer to the <a");
|
||||
|
||||
WriteLiteral(" href=\"http://www.springframework.net/doc-latest/reference/html/expressions.html\"" +
|
||||
"");
|
||||
|
||||
WriteLiteral("\r\n target=\"_blank\"");
|
||||
|
||||
WriteLiteral(">Expression Evaluation</a> documentation.\r\n <h2>\r\n Device Scope</h2>\r\n " +
|
||||
" <div");
|
||||
|
||||
WriteLiteral(" id=\"deviceScopeTree\"");
|
||||
|
||||
WriteLiteral(" class=\"expressionTree\"");
|
||||
|
||||
WriteLiteral(">\r\n </div>\r\n <h2>\r\n Job Scope</h2>\r\n <div");
|
||||
|
||||
WriteLiteral(" id=\"jobScopeTree\"");
|
||||
|
||||
WriteLiteral(" class=\"expressionTree\"");
|
||||
|
||||
WriteLiteral(">\r\n </div>\r\n <h2>\r\n User Scope</h2>\r\n <div");
|
||||
|
||||
WriteLiteral(" id=\"userScopeTree\"");
|
||||
|
||||
WriteLiteral(" class=\"expressionTree\"");
|
||||
|
||||
WriteLiteral(">\r\n </div>\r\n <h2>\r\n Variables\r\n </h2>\r\n <div");
|
||||
|
||||
WriteLiteral(" id=\"variableScopeTree\"");
|
||||
|
||||
WriteLiteral(" class=\"expressionTree\"");
|
||||
|
||||
WriteLiteral(">\r\n </div>\r\n <h2>\r\n Extension Libraries</h2>\r\n <div");
|
||||
|
||||
WriteLiteral(" id=\"extScopeTree\"");
|
||||
|
||||
WriteLiteral(" class=\"expressionTree\"");
|
||||
|
||||
WriteLiteral(">\r\n </div>\r\n</div>\r\n<script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(">\r\n $(function () {\r\n if (!document.DiscoFunctions) {\r\n docu" +
|
||||
"ment.DiscoFunctions = {};\r\n }\r\n\r\n var typeLib = {};\r\n var l" +
|
||||
"oadTypeUrl = \'");
|
||||
|
||||
|
||||
#line 40 "..\..\Areas\Config\Views\DocumentTemplate\ExpressionBrowser.cshtml"
|
||||
Write(Url.Action(MVC.Config.DocumentTemplate.ExpressionBrowser()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\';\r\n var deviceScopeTree = $(\'#deviceScopeTree\');\r\n var jobScopeTre" +
|
||||
"e = $(\'#jobScopeTree\');\r\n var userScopeTree = $(\'#userScopeTree\');\r\n " +
|
||||
" var variableScopeTree = $(\'#variableScopeTree\');\r\n var extScopeTree = " +
|
||||
"$(\'#extScopeTree\');\r\n\r\n var lazyLoadNode = function (node) {\r\n " +
|
||||
" if (node.data.expressionType) {\r\n node.setLazyNodeStatus(DTNodeS" +
|
||||
"tatus_Loading);\r\n loadType(node, node.data.expressionType, node.d" +
|
||||
"ata.staticDeclaredMembersOnly);\r\n } else {\r\n if (node." +
|
||||
"data.memberDescriptor) {\r\n loadMember(node);\r\n " +
|
||||
" } else {\r\n node.setLazyNodeStatus(DTNodeStatus_Ok);\r\n " +
|
||||
" }\r\n }\r\n }\r\n var loadMember = function (memberN" +
|
||||
"ode) {\r\n var previousUpdateMode = memberNode.tree.enableUpdate(false)" +
|
||||
";\r\n var memberDescriptor = memberNode.data.memberDescriptor;\r\n " +
|
||||
" // Return Type\r\n memberNode.addChild({ title: \'Returns: \' + memb" +
|
||||
"erDescriptor.ReturnType, tooltip: memberDescriptor.ReturnExpressionType, isFolde" +
|
||||
"r: true, expressionType: memberDescriptor.ReturnExpressionType, isLazy: true, ad" +
|
||||
"dClass: \'object\' });\r\n // Parameters\r\n var parametersNode " +
|
||||
"= memberNode.addChild({ title: \'Parameters\', isFolder: true, addClass: \'paramete" +
|
||||
"r\' });\r\n for (var i = 0; i < memberDescriptor.Parameters.length; i++)" +
|
||||
" {\r\n var p = memberDescriptor.Parameters[i];\r\n par" +
|
||||
"ametersNode.addChild({ title: p.Name + \' [\' + p.ReturnType + \']\', tooltip: p.Ret" +
|
||||
"urnExpressionType, addClass: \'object\' });\r\n }\r\n memberNode" +
|
||||
".setLazyNodeStatus(DTNodeStatus_Ok);\r\n memberNode.tree.enableUpdate(p" +
|
||||
"reviousUpdateMode);\r\n }\r\n var typeLoaded = function (parentNode, t" +
|
||||
"ypeDescriptor) {\r\n var previousUpdateMode = parentNode.tree.enableUpd" +
|
||||
"ate(false);\r\n for (var i = 0; i < typeDescriptor.Members.length; i++)" +
|
||||
" {\r\n var memberDescriptor = typeDescriptor.Members[i];\r\n " +
|
||||
" parentNode.addChild({ title: memberDescriptor.Name, tooltip: memberDescri" +
|
||||
"ptor.ReturnType, isFolder: true, addClass: memberDescriptor.Kind, memberDescript" +
|
||||
"or: memberDescriptor, isLazy: true });\r\n }\r\n parentNode.se" +
|
||||
"tLazyNodeStatus(DTNodeStatus_Ok);\r\n parentNode.tree.enableUpdate(prev" +
|
||||
"iousUpdateMode);\r\n }\r\n\r\n var loadType = function (parentNode, type" +
|
||||
", staticDeclaredMembersOnly) {\r\n if (typeLib[type]) {\r\n " +
|
||||
" typeLoaded(parentNode, typeLib[type]);\r\n } else {\r\n " +
|
||||
"var requestData = { type: type, StaticDeclaredMembersOnly: staticDeclaredMembers" +
|
||||
"Only };\r\n $.getJSON(loadTypeUrl, requestData, function (data) {\r\n" +
|
||||
" typeLib[type] = data;\r\n typeLoaded(parent" +
|
||||
"Node, data);\r\n });\r\n }\r\n }\r\n\r\n var initV" +
|
||||
"ariable = function (name, type) {\r\n variableScopeTree.dynatree(\'getRo" +
|
||||
"ot\').addChild({ title: name, tooltip: type, isFolder: true, addClass: \'object\', " +
|
||||
"expressionType: type, isLazy: true });\r\n }\r\n var initExpressionLib" +
|
||||
"rary = function (name, type) {\r\n extScopeTree.dynatree(\'getRoot\').add" +
|
||||
"Child({ title: name, tooltip: type, isFolder: true, addClass: \'object\', expressi" +
|
||||
"onType: type, staticDeclaredMembersOnly: true, isLazy: true });\r\n }\r\n\r\n " +
|
||||
" // Init\r\n deviceScopeTree.dynatree({ onLazyRead: lazyLoadNode });\r\n" +
|
||||
" loadType(deviceScopeTree.dynatree(\'getRoot\'), \'");
|
||||
|
||||
|
||||
#line 104 "..\..\Areas\Config\Views\DocumentTemplate\ExpressionBrowser.cshtml"
|
||||
Write(Model.DeviceType);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\');\r\n\r\n jobScopeTree.dynatree({ onLazyRead: lazyLoadNode });\r\n load" +
|
||||
"Type(jobScopeTree.dynatree(\'getRoot\'), \'");
|
||||
|
||||
|
||||
#line 107 "..\..\Areas\Config\Views\DocumentTemplate\ExpressionBrowser.cshtml"
|
||||
Write(Model.JobType);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\');\r\n\r\n userScopeTree.dynatree({ onLazyRead: lazyLoadNode });\r\n loa" +
|
||||
"dType(userScopeTree.dynatree(\'getRoot\'), \'");
|
||||
|
||||
|
||||
#line 110 "..\..\Areas\Config\Views\DocumentTemplate\ExpressionBrowser.cshtml"
|
||||
Write(Model.UserType);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@"');
|
||||
|
||||
variableScopeTree.dynatree({ onLazyRead: lazyLoadNode });
|
||||
document.DiscoFunctions.expressionInitVariable = initVariable;
|
||||
|
||||
extScopeTree.dynatree({ onLazyRead: lazyLoadNode });
|
||||
document.DiscoFunctions.expressionInitExpressionLibrary = initExpressionLibrary;
|
||||
});
|
||||
</script>
|
||||
<script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(">\r\n $(function () {\r\n");
|
||||
|
||||
|
||||
#line 121 "..\..\Areas\Config\Views\DocumentTemplate\ExpressionBrowser.cshtml"
|
||||
|
||||
foreach (var variable in Model.Variables)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" ");
|
||||
|
||||
WriteLiteral("document.DiscoFunctions.expressionInitVariable(\'");
|
||||
|
||||
|
||||
#line 124 "..\..\Areas\Config\Views\DocumentTemplate\ExpressionBrowser.cshtml"
|
||||
Write(variable.Key);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\', \'");
|
||||
|
||||
|
||||
#line 124 "..\..\Areas\Config\Views\DocumentTemplate\ExpressionBrowser.cshtml"
|
||||
Write(variable.Value);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\');");
|
||||
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
|
||||
#line 125 "..\..\Areas\Config\Views\DocumentTemplate\ExpressionBrowser.cshtml"
|
||||
}
|
||||
foreach (var variable in Model.ExtensionLibraries)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" ");
|
||||
|
||||
WriteLiteral("document.DiscoFunctions.expressionInitExpressionLibrary(\'");
|
||||
|
||||
|
||||
#line 128 "..\..\Areas\Config\Views\DocumentTemplate\ExpressionBrowser.cshtml"
|
||||
Write(variable.Key);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\', \'");
|
||||
|
||||
|
||||
#line 128 "..\..\Areas\Config\Views\DocumentTemplate\ExpressionBrowser.cshtml"
|
||||
Write(variable.Value);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\');");
|
||||
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
|
||||
#line 129 "..\..\Areas\Config\Views\DocumentTemplate\ExpressionBrowser.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n });\r\n </script>");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -0,0 +1,322 @@
|
||||
@{
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Document Templates", MVC.Config.DocumentTemplate.Index(), "Import Status");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR");
|
||||
}
|
||||
<h2>
|
||||
Documents Imported Today
|
||||
</h2>
|
||||
<div id="importStatus">
|
||||
<div id="noSessions" data-bind="visible: noSessions">
|
||||
<h3>
|
||||
No imported documents today</h3>
|
||||
</div>
|
||||
<div id="sessions" data-bind="visible: !noSessions(), foreach: {data: sessions, afterRender: sessionRendered}"
|
||||
style="display: none">
|
||||
<div class="session">
|
||||
<div class="clearfix">
|
||||
<div class="sessionLeftPane">
|
||||
<h3>
|
||||
<span data-bind="text: title"></span>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="sessionRightPane">
|
||||
<p class="sessionStart" data-bind="text: startTime">
|
||||
</p>
|
||||
<p class="sessionStatus" data-bind="text: progressStatus">
|
||||
</p>
|
||||
<div data-bind="visible: !sessionEnded(), progressValue: progressValue" class="sessionProgress">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sessionPages clearfix" data-bind="foreach: {data: sessionPages}">
|
||||
<div class="sessionPage" data-bind="style: {backgroundImage: thumbnailUrl}">
|
||||
<div class="sessionPageDetails">
|
||||
<h3 data-bind="text: title">
|
||||
</h3>
|
||||
<div data-bind="visible: undetected">
|
||||
Disco QR-Code not found<br />
|
||||
<a target="_blank" data-bind="attr: {href: manuallyAssignUrl}, visible: $parent.sessionEnded">Manually Assign Page</a>
|
||||
</div>
|
||||
<div data-bind="visible: detected">
|
||||
Document: <a target="_blank" data-bind="text: documentTemplate, attr: {href: documentTemplateUrl}">
|
||||
</a>
|
||||
<br />
|
||||
Target: <a target="_blank" data-bind="text: assignedData, attr: {href: assignedDataUrl}">
|
||||
</a>
|
||||
</div>
|
||||
<div data-bind="visible: !(detected() || undetected())">
|
||||
<p class="sessionStatus" data-bind="text: progressStatus">
|
||||
</p>
|
||||
<div data-bind="progressValue: progressValue" class="sessionProgress">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sessionInfoMessages">
|
||||
<table class="logEventsViewport">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="icon">
|
||||
|
||||
</th>
|
||||
<th class="message">
|
||||
Message
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
<div class="logEventsViewportContainer">
|
||||
<div class="logEventsViewportNoLogs" data-bind="visible: messages().length == 0"
|
||||
style="display: none">
|
||||
No logs
|
||||
</div>
|
||||
<table class="logEventsViewport" data-bind="visible: messages().length > 0" style="display: none">
|
||||
<tbody data-bind="foreach: messages">
|
||||
<tr>
|
||||
<td class="icon" data-bind="attr: {title: FormattedTimestamp}, css: {information: EventTypeSeverity == 0, warning: EventTypeSeverity == 1, error: EventTypeSeverity == 2}">
|
||||
|
||||
</td>
|
||||
<td class="message" data-bind="text: FormattedMessage, attr: {title: EventTypeName}">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
ko.bindingHandlers.progressValue = {
|
||||
update: function (element, valueAccessor, allBindingsAccessor, viewModel) {
|
||||
var v = ko.utils.unwrapObservable(valueAccessor());
|
||||
var vInt = parseInt(v);
|
||||
if (vInt >= 0) {
|
||||
$element = $(element);
|
||||
if (!$element.is('.ui-progressbar'))
|
||||
$element.progressbar();
|
||||
$(element).progressbar('option', 'value', vInt);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var vm;
|
||||
var host = $('#importStatus');
|
||||
var hostSessions = $('#sessions');
|
||||
var liveConnection;
|
||||
var urlDeviceShow = '@(Url.Action(MVC.Device.Show()))/'
|
||||
var urlJobShow = '@(Url.Action(MVC.Job.Show()))/'
|
||||
var urlUserShow = '@(Url.Action(MVC.User.Show()))/'
|
||||
var urlPageThumbnail = '@(Url.Action(MVC.API.DocumentTemplate.ImporterThumbnail()))/'
|
||||
var urlDocumentTemplate = '@(Url.Action(MVC.Config.DocumentTemplate.Index()))/';
|
||||
var urlManuallyAssign = '@(Url.Action(MVC.Config.DocumentTemplate.UndetectedPages()))';
|
||||
var iconErrorUrl = 'url(@(Links.ClientSource.Style.Images.Status.fail32_png))';
|
||||
var isLive = false;
|
||||
|
||||
function pageViewModel() {
|
||||
var self = this;
|
||||
|
||||
self.noSessions = ko.observable(true);
|
||||
self.sessions = ko.observableArray();
|
||||
self.sessionIndex = {};
|
||||
|
||||
self.sessionRendered = function (e, d) {
|
||||
if (!d.sessionEnded()) {
|
||||
d.progressbar = $(e).find('.sessionProgress').progressbar();
|
||||
}
|
||||
};
|
||||
}
|
||||
function sessionViewModel(id) {
|
||||
var self = this;
|
||||
|
||||
self.title = ko.observable(id);
|
||||
self.messages = ko.observableArray();
|
||||
self.progressStatus = ko.observable();
|
||||
self.progressValue = ko.observable();
|
||||
self.startTime = ko.observable();
|
||||
self.sessionEnded = ko.observable(false);
|
||||
|
||||
self.sessionPages = ko.observableArray();
|
||||
self.sessionPagesIndex = {};
|
||||
self.addSessionPage = function (sessionPage) {
|
||||
//if (isLive) {
|
||||
self.sessionPages.push(sessionPage);
|
||||
self.sessionPagesIndex[sessionPage.pageNumber] = sessionPage;
|
||||
//}
|
||||
}
|
||||
}
|
||||
function sessionPageViewModel(sessionId, pageNumber) {
|
||||
var self = this;
|
||||
|
||||
self.sessionId = sessionId;
|
||||
self.pageNumber = pageNumber;
|
||||
self.title = 'Page ' + pageNumber;
|
||||
self.progressStatus = ko.observable();
|
||||
self.progressValue = ko.observable();
|
||||
self.undetected = ko.observable(false);
|
||||
self.detected = ko.observable(false);
|
||||
self.documentTemplateId = ko.observable();
|
||||
self.documentTemplate = ko.observable();
|
||||
self.assignedDataType = ko.observable();
|
||||
self.assignedDataId = ko.observable();
|
||||
self.assignedData = ko.observable();
|
||||
self.thumbnailEnabled = ko.observable(0);
|
||||
self.updateThumbnail = function () {
|
||||
self.thumbnailEnabled(self.thumbnailEnabled() + 1);
|
||||
}
|
||||
self.documentTemplateUrl = ko.computed(function () {
|
||||
return urlDocumentTemplate + self.documentTemplateId();
|
||||
});
|
||||
self.manuallyAssignUrl = ko.computed(function () {
|
||||
return urlManuallyAssign + '#' + self.sessionId + '_' + self.pageNumber;
|
||||
});
|
||||
self.assignedDataUrl = ko.computed(function () {
|
||||
var t = self.assignedDataType();
|
||||
var dId = self.assignedDataId();
|
||||
switch (t) {
|
||||
case 'Device':
|
||||
return urlDeviceShow + dId;
|
||||
case 'Job':
|
||||
return urlJobShow + dId;
|
||||
case 'User':
|
||||
return urlUserShow + dId;
|
||||
}
|
||||
return null;
|
||||
});
|
||||
self.thumbnailUrl = ko.computed(function () {
|
||||
var enabled = self.thumbnailEnabled();
|
||||
if (enabled > 0) {
|
||||
return 'url(' + urlPageThumbnail + '?SessionId=' + self.sessionId + '&PageNumber=' + self.pageNumber + '&NoCache=' + enabled + ')';
|
||||
}
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
function parseLog(log) {
|
||||
if (log.ModuleId === 40 && log.Arguments && log.Arguments.length > 0) {
|
||||
// find session
|
||||
var sessionId = log.Arguments[0];
|
||||
var session = vm.sessionIndex[sessionId];
|
||||
if (!session && log.EventTypeId === 10) { // Starting Session (Ignore 'partial' sessions)
|
||||
session = new sessionViewModel(log.Arguments[1]);
|
||||
vm.sessionIndex[sessionId] = session;
|
||||
vm.sessions.unshift(session);
|
||||
vm.noSessions(false);
|
||||
}
|
||||
if (session) {
|
||||
switch (log.EventTypeId) {
|
||||
case 10: // SessionStarting
|
||||
session.startTime(log.FormattedTimestamp.substring(log.FormattedTimestamp.indexOf(' ') + 1));
|
||||
break;
|
||||
case 11: // SessionProgress
|
||||
session.progressValue(log.Arguments[1]);
|
||||
session.progressStatus(log.Arguments[2]);
|
||||
break;
|
||||
case 12: // SessionFinished
|
||||
session.sessionEnded(true);
|
||||
session.progressStatus('Import Finished');
|
||||
break;
|
||||
case 15: // SessionWarning
|
||||
session.messages.unshift(log);
|
||||
break;
|
||||
case 16: // SessionError
|
||||
session.messages.unshift(log);
|
||||
break;
|
||||
case 100: // ImportPageStarting
|
||||
session.addSessionPage(new sessionPageViewModel(sessionId, log.Arguments[1]));
|
||||
break;
|
||||
case 104: // ImportPageImageUpdate
|
||||
var p = session.sessionPagesIndex[log.Arguments[1]];
|
||||
if (p) {
|
||||
p.updateThumbnail();
|
||||
}
|
||||
break;
|
||||
case 105: // ImportPageProgress
|
||||
var p = session.sessionPagesIndex[log.Arguments[1]];
|
||||
if (p) {
|
||||
p.progressValue(log.Arguments[2]);
|
||||
p.progressStatus(log.Arguments[3]);
|
||||
}
|
||||
break;
|
||||
case 110: // ImportPageDetected
|
||||
var p = session.sessionPagesIndex[log.Arguments[1]];
|
||||
if (p) {
|
||||
p.documentTemplateId(log.Arguments[2]);
|
||||
p.documentTemplate(log.Arguments[3]);
|
||||
p.assignedDataType(log.Arguments[4]);
|
||||
p.assignedDataId(log.Arguments[5]);
|
||||
p.assignedData(log.Arguments[6]);
|
||||
p.detected(true);
|
||||
if (!isLive) {
|
||||
p.updateThumbnail();
|
||||
}
|
||||
}
|
||||
session.messages.unshift(log);
|
||||
break;
|
||||
case 115: // ImportPageUndetected
|
||||
var p = session.sessionPagesIndex[log.Arguments[1]];
|
||||
if (p) {
|
||||
p.undetected(true);
|
||||
if (!isLive) {
|
||||
p.updateThumbnail();
|
||||
}
|
||||
}
|
||||
session.messages.unshift(log);
|
||||
break;
|
||||
case 150: // Ignore: ImportPageUndetectedStored
|
||||
break;
|
||||
default:
|
||||
session.messages.unshift(log);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function init() {
|
||||
// Create View Model
|
||||
vm = new pageViewModel();
|
||||
|
||||
// Load Logs
|
||||
var d = new Date();
|
||||
var loadData = {
|
||||
Format: "json",
|
||||
Start: d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate(),
|
||||
End: null,
|
||||
ModuleId: 40,
|
||||
Take: 2000
|
||||
};
|
||||
$.ajax({
|
||||
url: '@(Url.Action(MVC.API.Logging.RetrieveEvents()))',
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
traditional: true,
|
||||
data: loadData,
|
||||
success: init_loadedLogs,
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to retrieve logs: ' + errorThrown);
|
||||
}
|
||||
});
|
||||
}
|
||||
function init_loadedLogs(logs) {
|
||||
logs.reverse();
|
||||
for (var i = 0; i < logs.length; i++) {
|
||||
parseLog(logs[i]);
|
||||
}
|
||||
// Bind
|
||||
ko.applyBindings(vm);
|
||||
|
||||
// Init Persistent Connection
|
||||
liveConnection = $.connection('@(Url.Content("~/API/Logging/Notifications"))');
|
||||
liveConnection.received(parseLog);
|
||||
liveConnection.error(function (e) { alert('Live-Log Error: ' + e) });
|
||||
isLive = true;
|
||||
liveConnection.start(function () {
|
||||
liveConnection.send('/addToGroups:@(Disco.BI.DocumentTemplateBI.Importer.DocumentImporterLog.Current.LiveLogGroupName)');
|
||||
});
|
||||
}
|
||||
init();
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,484 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.17929
|
||||
//
|
||||
// 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.DocumentTemplate
|
||||
{
|
||||
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.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DocumentTemplate/ImportStatus.cshtml")]
|
||||
public class ImportStatus : System.Web.Mvc.WebViewPage<dynamic>
|
||||
{
|
||||
public ImportStatus()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 1 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Document Templates", MVC.Config.DocumentTemplate.Index(), "Import Status");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR");
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n<h2>\r\n Documents Imported Today\r\n</h2>\r\n<div");
|
||||
|
||||
WriteLiteral(" id=\"importStatus\"");
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" id=\"noSessions\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"visible: noSessions\"");
|
||||
|
||||
WriteLiteral(">\r\n <h3>\r\n No imported documents today</h3>\r\n </div>\r\n <d" +
|
||||
"iv");
|
||||
|
||||
WriteLiteral(" id=\"sessions\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"visible: !noSessions(), foreach: {data: sessions, afterRender: sessio" +
|
||||
"nRendered}\"");
|
||||
|
||||
WriteLiteral("\r\n style=\"display: none\"");
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"session\"");
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"clearfix\"");
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"sessionLeftPane\"");
|
||||
|
||||
WriteLiteral(">\r\n <h3>\r\n <span");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: title\"");
|
||||
|
||||
WriteLiteral("></span>\r\n </h3>\r\n </div>\r\n <div" +
|
||||
"");
|
||||
|
||||
WriteLiteral(" class=\"sessionRightPane\"");
|
||||
|
||||
WriteLiteral(">\r\n <p");
|
||||
|
||||
WriteLiteral(" class=\"sessionStart\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: startTime\"");
|
||||
|
||||
WriteLiteral(">\r\n </p>\r\n <p");
|
||||
|
||||
WriteLiteral(" class=\"sessionStatus\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: progressStatus\"");
|
||||
|
||||
WriteLiteral(">\r\n </p>\r\n <div");
|
||||
|
||||
WriteLiteral(" data-bind=\"visible: !sessionEnded(), progressValue: progressValue\"");
|
||||
|
||||
WriteLiteral(" class=\"sessionProgress\"");
|
||||
|
||||
WriteLiteral(">\r\n </div>\r\n </div>\r\n </div>\r\n " +
|
||||
" <div");
|
||||
|
||||
WriteLiteral(" class=\"sessionPages clearfix\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"foreach: {data: sessionPages}\"");
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"sessionPage\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"style: {backgroundImage: thumbnailUrl}\"");
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"sessionPageDetails\"");
|
||||
|
||||
WriteLiteral(">\r\n <h3");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: title\"");
|
||||
|
||||
WriteLiteral(">\r\n </h3>\r\n <div");
|
||||
|
||||
WriteLiteral(" data-bind=\"visible: undetected\"");
|
||||
|
||||
WriteLiteral(">\r\n Disco QR-Code not found<br />\r\n " +
|
||||
" <a");
|
||||
|
||||
WriteLiteral(" target=\"_blank\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"attr: {href: manuallyAssignUrl}, visible: $parent.sessionEnded\"");
|
||||
|
||||
WriteLiteral(">Manually Assign Page</a>\r\n </div>\r\n " +
|
||||
" <div");
|
||||
|
||||
WriteLiteral(" data-bind=\"visible: detected\"");
|
||||
|
||||
WriteLiteral(">\r\n Document: <a");
|
||||
|
||||
WriteLiteral(" target=\"_blank\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: documentTemplate, attr: {href: documentTemplateUrl}\"");
|
||||
|
||||
WriteLiteral(">\r\n </a>\r\n <br />\r\n " +
|
||||
" Target: <a");
|
||||
|
||||
WriteLiteral(" target=\"_blank\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: assignedData, attr: {href: assignedDataUrl}\"");
|
||||
|
||||
WriteLiteral(">\r\n </a>\r\n </div>\r\n " +
|
||||
" <div");
|
||||
|
||||
WriteLiteral(" data-bind=\"visible: !(detected() || undetected())\"");
|
||||
|
||||
WriteLiteral(">\r\n <p");
|
||||
|
||||
WriteLiteral(" class=\"sessionStatus\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: progressStatus\"");
|
||||
|
||||
WriteLiteral(">\r\n </p>\r\n <div");
|
||||
|
||||
WriteLiteral(" data-bind=\"progressValue: progressValue\"");
|
||||
|
||||
WriteLiteral(" class=\"sessionProgress\"");
|
||||
|
||||
WriteLiteral(">\r\n </div>\r\n </div>\r\n " +
|
||||
" </div>\r\n </div>\r\n </div>\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"sessionInfoMessages\"");
|
||||
|
||||
WriteLiteral(">\r\n <table");
|
||||
|
||||
WriteLiteral(" class=\"logEventsViewport\"");
|
||||
|
||||
WriteLiteral(">\r\n <thead>\r\n <tr>\r\n " +
|
||||
" <th");
|
||||
|
||||
WriteLiteral(" class=\"icon\"");
|
||||
|
||||
WriteLiteral(">\r\n \r\n </th>\r\n " +
|
||||
" <th");
|
||||
|
||||
WriteLiteral(" class=\"message\"");
|
||||
|
||||
WriteLiteral(">\r\n Message\r\n </th>\r\n " +
|
||||
" </tr>\r\n </thead>\r\n </tab" +
|
||||
"le>\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"logEventsViewportContainer\"");
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"logEventsViewportNoLogs\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"visible: messages().length == 0\"");
|
||||
|
||||
WriteLiteral("\r\n style=\"display: none\"");
|
||||
|
||||
WriteLiteral(">\r\n No logs\r\n </div>\r\n " +
|
||||
" <table");
|
||||
|
||||
WriteLiteral(" class=\"logEventsViewport\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"visible: messages().length > 0\"");
|
||||
|
||||
WriteLiteral(" style=\"display: none\"");
|
||||
|
||||
WriteLiteral(">\r\n <tbody");
|
||||
|
||||
WriteLiteral(" data-bind=\"foreach: messages\"");
|
||||
|
||||
WriteLiteral(">\r\n <tr>\r\n <td");
|
||||
|
||||
WriteLiteral(" class=\"icon\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"attr: {title: FormattedTimestamp}, css: {information: EventTypeSeveri" +
|
||||
"ty == 0, warning: EventTypeSeverity == 1, error: EventTypeSeverity == 2}\"");
|
||||
|
||||
WriteLiteral(">\r\n \r\n </" +
|
||||
"td>\r\n <td");
|
||||
|
||||
WriteLiteral(" class=\"message\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: FormattedMessage, attr: {title: EventTypeName}\"");
|
||||
|
||||
WriteLiteral(">\r\n </td>\r\n </tr>\r\n " +
|
||||
" </tbody>\r\n </table>\r\n </di" +
|
||||
"v>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n<script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
ko.bindingHandlers.progressValue = {
|
||||
update: function (element, valueAccessor, allBindingsAccessor, viewModel) {
|
||||
var v = ko.utils.unwrapObservable(valueAccessor());
|
||||
var vInt = parseInt(v);
|
||||
if (vInt >= 0) {
|
||||
$element = $(element);
|
||||
if (!$element.is('.ui-progressbar'))
|
||||
$element.progressbar();
|
||||
$(element).progressbar('option', 'value', vInt);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(">\r\n $(function () {\r\n var vm;\r\n var host = $(\'#importStatus\');\r\n" +
|
||||
" var hostSessions = $(\'#sessions\');\r\n var liveConnection;\r\n " +
|
||||
" var urlDeviceShow = \'");
|
||||
|
||||
|
||||
#line 111 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
|
||||
Write(Url.Action(MVC.Device.Show()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("/\'\r\n var urlJobShow = \'");
|
||||
|
||||
|
||||
#line 112 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
|
||||
Write(Url.Action(MVC.Job.Show()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("/\'\r\n var urlUserShow = \'");
|
||||
|
||||
|
||||
#line 113 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
|
||||
Write(Url.Action(MVC.User.Show()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("/\'\r\n var urlPageThumbnail = \'");
|
||||
|
||||
|
||||
#line 114 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
|
||||
Write(Url.Action(MVC.API.DocumentTemplate.ImporterThumbnail()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("/\'\r\n var urlDocumentTemplate = \'");
|
||||
|
||||
|
||||
#line 115 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
|
||||
Write(Url.Action(MVC.Config.DocumentTemplate.Index()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("/\';\r\n var urlManuallyAssign = \'");
|
||||
|
||||
|
||||
#line 116 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
|
||||
Write(Url.Action(MVC.Config.DocumentTemplate.UndetectedPages()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\';\r\n var iconErrorUrl = \'url(");
|
||||
|
||||
|
||||
#line 117 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
|
||||
Write(Links.ClientSource.Style.Images.Status.fail32_png);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(")\';\r\n var isLive = false;\r\n\r\n function pageViewModel() {\r\n " +
|
||||
" var self = this;\r\n\r\n self.noSessions = ko.observable(true);\r\n " +
|
||||
" self.sessions = ko.observableArray();\r\n self.sessionIndex = {}" +
|
||||
";\r\n\r\n self.sessionRendered = function (e, d) {\r\n if (!" +
|
||||
"d.sessionEnded()) {\r\n d.progressbar = $(e).find(\'.sessionProg" +
|
||||
"ress\').progressbar();\r\n }\r\n };\r\n }\r\n fun" +
|
||||
"ction sessionViewModel(id) {\r\n var self = this;\r\n\r\n self.t" +
|
||||
"itle = ko.observable(id);\r\n self.messages = ko.observableArray();\r\n " +
|
||||
" self.progressStatus = ko.observable();\r\n self.progressValue" +
|
||||
" = ko.observable();\r\n self.startTime = ko.observable();\r\n " +
|
||||
"self.sessionEnded = ko.observable(false);\r\n\r\n self.sessionPages = ko." +
|
||||
"observableArray();\r\n self.sessionPagesIndex = {};\r\n self.a" +
|
||||
"ddSessionPage = function (sessionPage) {\r\n //if (isLive) {\r\n " +
|
||||
" self.sessionPages.push(sessionPage);\r\n self.sessionPag" +
|
||||
"esIndex[sessionPage.pageNumber] = sessionPage;\r\n //}\r\n " +
|
||||
" }\r\n }\r\n function sessionPageViewModel(sessionId, pageNumber) {\r\n " +
|
||||
" var self = this;\r\n\r\n self.sessionId = sessionId;\r\n " +
|
||||
" self.pageNumber = pageNumber;\r\n self.title = \'Page \' + pageNumber" +
|
||||
";\r\n self.progressStatus = ko.observable();\r\n self.progress" +
|
||||
"Value = ko.observable();\r\n self.undetected = ko.observable(false);\r\n " +
|
||||
" self.detected = ko.observable(false);\r\n self.documentTempl" +
|
||||
"ateId = ko.observable();\r\n self.documentTemplate = ko.observable();\r\n" +
|
||||
" self.assignedDataType = ko.observable();\r\n self.assignedD" +
|
||||
"ataId = ko.observable();\r\n self.assignedData = ko.observable();\r\n " +
|
||||
" self.thumbnailEnabled = ko.observable(0);\r\n self.updateThumbn" +
|
||||
"ail = function () {\r\n self.thumbnailEnabled(self.thumbnailEnabled" +
|
||||
"() + 1);\r\n }\r\n self.documentTemplateUrl = ko.computed(func" +
|
||||
"tion () {\r\n return urlDocumentTemplate + self.documentTemplateId(" +
|
||||
");\r\n });\r\n self.manuallyAssignUrl = ko.computed(function (" +
|
||||
") {\r\n return urlManuallyAssign + \'#\' + self.sessionId + \'_\' + sel" +
|
||||
"f.pageNumber;\r\n });\r\n self.assignedDataUrl = ko.computed(f" +
|
||||
"unction () {\r\n var t = self.assignedDataType();\r\n " +
|
||||
"var dId = self.assignedDataId();\r\n switch (t) {\r\n " +
|
||||
" case \'Device\':\r\n return urlDeviceShow + dId;\r\n " +
|
||||
" case \'Job\':\r\n return urlJobShow + dId;\r\n " +
|
||||
" case \'User\':\r\n return urlUserShow + dId;\r" +
|
||||
"\n }\r\n return null;\r\n });\r\n s" +
|
||||
"elf.thumbnailUrl = ko.computed(function () {\r\n var enabled = self" +
|
||||
".thumbnailEnabled();\r\n if (enabled > 0) {\r\n re" +
|
||||
"turn \'url(\' + urlPageThumbnail + \'?SessionId=\' + self.sessionId + \'&PageNumber=\'" +
|
||||
" + self.pageNumber + \'&NoCache=\' + enabled + \')\';\r\n }\r\n " +
|
||||
" return null;\r\n });\r\n }\r\n\r\n function parseLog(log)" +
|
||||
" {\r\n if (log.ModuleId === 40 && log.Arguments && log.Arguments.length" +
|
||||
" > 0) {\r\n // find session\r\n var sessionId = log.Ar" +
|
||||
"guments[0];\r\n var session = vm.sessionIndex[sessionId];\r\n " +
|
||||
" if (!session && log.EventTypeId === 10) { // Starting Session (Ignore \'p" +
|
||||
"artial\' sessions)\r\n session = new sessionViewModel(log.Argume" +
|
||||
"nts[1]);\r\n vm.sessionIndex[sessionId] = session;\r\n " +
|
||||
" vm.sessions.unshift(session);\r\n vm.noSessions(false)" +
|
||||
";\r\n }\r\n if (session) {\r\n switch" +
|
||||
" (log.EventTypeId) {\r\n case 10: // SessionStarting\r\n " +
|
||||
" session.startTime(log.FormattedTimestamp.substring(log.Fo" +
|
||||
"rmattedTimestamp.indexOf(\' \') + 1));\r\n break;\r\n " +
|
||||
" case 11: // SessionProgress\r\n sessi" +
|
||||
"on.progressValue(log.Arguments[1]);\r\n session.progres" +
|
||||
"sStatus(log.Arguments[2]);\r\n break;\r\n " +
|
||||
" case 12: // SessionFinished\r\n session.session" +
|
||||
"Ended(true);\r\n session.progressStatus(\'Import Finishe" +
|
||||
"d\');\r\n break;\r\n case 15: // Se" +
|
||||
"ssionWarning\r\n session.messages.unshift(log);\r\n " +
|
||||
" break;\r\n case 16: // SessionError\r\n" +
|
||||
" session.messages.unshift(log);\r\n " +
|
||||
" break;\r\n case 100: // ImportPageStarting\r\n " +
|
||||
" session.addSessionPage(new sessionPageViewModel(sessionId, " +
|
||||
"log.Arguments[1]));\r\n break;\r\n " +
|
||||
" case 104: // ImportPageImageUpdate\r\n var p = session" +
|
||||
".sessionPagesIndex[log.Arguments[1]];\r\n if (p) {\r\n " +
|
||||
" p.updateThumbnail();\r\n }" +
|
||||
"\r\n break;\r\n case 105: // Impor" +
|
||||
"tPageProgress\r\n var p = session.sessionPagesIndex[log" +
|
||||
".Arguments[1]];\r\n if (p) {\r\n " +
|
||||
" p.progressValue(log.Arguments[2]);\r\n p.pro" +
|
||||
"gressStatus(log.Arguments[3]);\r\n }\r\n " +
|
||||
" break;\r\n case 110: // ImportPageDetected\r\n " +
|
||||
" var p = session.sessionPagesIndex[log.Arguments[1]];\r\n " +
|
||||
" if (p) {\r\n p.documentTe" +
|
||||
"mplateId(log.Arguments[2]);\r\n p.documentTemplate(" +
|
||||
"log.Arguments[3]);\r\n p.assignedDataType(log.Argum" +
|
||||
"ents[4]);\r\n p.assignedDataId(log.Arguments[5]);\r\n" +
|
||||
" p.assignedData(log.Arguments[6]);\r\n " +
|
||||
" p.detected(true);\r\n if (!isLiv" +
|
||||
"e) {\r\n p.updateThumbnail();\r\n " +
|
||||
" }\r\n }\r\n se" +
|
||||
"ssion.messages.unshift(log);\r\n break;\r\n " +
|
||||
" case 115: // ImportPageUndetected\r\n var p =" +
|
||||
" session.sessionPagesIndex[log.Arguments[1]];\r\n if (p" +
|
||||
") {\r\n p.undetected(true);\r\n " +
|
||||
" if (!isLive) {\r\n p.updateThumbnail(" +
|
||||
");\r\n }\r\n }\r\n " +
|
||||
" session.messages.unshift(log);\r\n br" +
|
||||
"eak;\r\n case 150: // Ignore: ImportPageUndetectedStored\r\n " +
|
||||
" break;\r\n default:\r\n " +
|
||||
" session.messages.unshift(log);\r\n }\r\n " +
|
||||
" }\r\n }\r\n }\r\n function init() {\r\n // C" +
|
||||
"reate View Model\r\n vm = new pageViewModel();\r\n\r\n // Load L" +
|
||||
"ogs\r\n var d = new Date();\r\n var loadData = {\r\n " +
|
||||
" Format: \"json\",\r\n Start: d.getFullYear() + \'-\' + (d.getMonth(" +
|
||||
") + 1) + \'-\' + d.getDate(),\r\n End: null,\r\n ModuleI" +
|
||||
"d: 40,\r\n Take: 2000\r\n };\r\n $.ajax({\r\n " +
|
||||
" url: \'");
|
||||
|
||||
|
||||
#line 292 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
|
||||
Write(Url.Action(MVC.API.Logging.RetrieveEvents()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@"',
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
traditional: true,
|
||||
data: loadData,
|
||||
success: init_loadedLogs,
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to retrieve logs: ' + errorThrown);
|
||||
}
|
||||
});
|
||||
}
|
||||
function init_loadedLogs(logs) {
|
||||
logs.reverse();
|
||||
for (var i = 0; i < logs.length; i++) {
|
||||
parseLog(logs[i]);
|
||||
}
|
||||
// Bind
|
||||
ko.applyBindings(vm);
|
||||
|
||||
// Init Persistent Connection
|
||||
liveConnection = $.connection('");
|
||||
|
||||
|
||||
#line 312 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
|
||||
Write(Url.Content("~/API/Logging/Notifications"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@"');
|
||||
liveConnection.received(parseLog);
|
||||
liveConnection.error(function (e) { alert('Live-Log Error: ' + e) });
|
||||
isLive = true;
|
||||
liveConnection.start(function () {
|
||||
liveConnection.send('/addToGroups:");
|
||||
|
||||
|
||||
#line 317 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
|
||||
Write(Disco.BI.DocumentTemplateBI.Importer.DocumentImporterLog.Current.LiveLogGroupName);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\');\r\n });\r\n }\r\n init();\r\n });\r\n</script>\r\n");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -0,0 +1,37 @@
|
||||
@model Disco.Web.Areas.Config.Models.DocumentTemplate.IndexModel
|
||||
@{
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Document Templates");
|
||||
}
|
||||
<table class="tableData">
|
||||
<tr>
|
||||
<th>
|
||||
Id
|
||||
</th>
|
||||
<th>
|
||||
Description
|
||||
</th>
|
||||
<th>
|
||||
Scope
|
||||
</th>
|
||||
</tr>
|
||||
@foreach (var item in Model.DocumentTemplates)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@Html.ActionLink(item.Id.ToString(), MVC.Config.DocumentTemplate.Index(item.Id))
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Description)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Scope)
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
<div class="actionBar">
|
||||
@Html.ActionLinkButton("Undetected Pages", MVC.Config.DocumentTemplate.UndetectedPages())
|
||||
@Html.ActionLinkButton("Import Status", MVC.Config.DocumentTemplate.ImportStatus())
|
||||
@Html.ActionLinkButton("Expression Browser", MVC.Config.DocumentTemplate.ExpressionBrowser())
|
||||
@Html.ActionLinkButton("Create Document Template", MVC.Config.DocumentTemplate.Create())
|
||||
</div>
|
||||
@@ -0,0 +1,168 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.17929
|
||||
//
|
||||
// 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.DocumentTemplate
|
||||
{
|
||||
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.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DocumentTemplate/Index.cshtml")]
|
||||
public class Index : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.DocumentTemplate.IndexModel>
|
||||
{
|
||||
public Index()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 2 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Document Templates");
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n<table");
|
||||
|
||||
WriteLiteral(" class=\"tableData\"");
|
||||
|
||||
WriteLiteral(">\r\n <tr>\r\n <th>\r\n Id\r\n </th>\r\n <th>\r\n " +
|
||||
" Description\r\n </th>\r\n <th>\r\n Scope\r\n </th>\r\n " +
|
||||
" </tr>\r\n");
|
||||
|
||||
|
||||
#line 17 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 17 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||
foreach (var item in Model.DocumentTemplates)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <tr>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 21 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||
Write(Html.ActionLink(item.Id.ToString(), MVC.Config.DocumentTemplate.Index(item.Id)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 24 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||
Write(Html.DisplayFor(modelItem => item.Description));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 27 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||
Write(Html.DisplayFor(modelItem => item.Scope));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
|
||||
|
||||
|
||||
#line 30 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</table>\r\n<div");
|
||||
|
||||
WriteLiteral(" class=\"actionBar\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 33 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||
Write(Html.ActionLinkButton("Undetected Pages", MVC.Config.DocumentTemplate.UndetectedPages()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 34 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||
Write(Html.ActionLinkButton("Import Status", MVC.Config.DocumentTemplate.ImportStatus()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 35 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||
Write(Html.ActionLinkButton("Expression Browser", MVC.Config.DocumentTemplate.ExpressionBrowser()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 36 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||
Write(Html.ActionLinkButton("Create Document Template", MVC.Config.DocumentTemplate.Create()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n</div>");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -0,0 +1,362 @@
|
||||
@model Disco.Web.Areas.Config.Models.DocumentTemplate.ShowModel
|
||||
@{
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Document Templates", MVC.Config.DocumentTemplate.Index(null), Model.DocumentTemplate.Description);
|
||||
}
|
||||
<div class="form" style="width: 650px">
|
||||
<table>
|
||||
<tr>
|
||||
<th>
|
||||
Id:
|
||||
</th>
|
||||
<td>@Html.DisplayFor(model => model.DocumentTemplate.Id)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Stored Instances:
|
||||
</th>
|
||||
<td>@Html.DisplayFor(model => model.StoredInstanceCount)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Description:
|
||||
</th>
|
||||
<td>@Html.TextBoxFor(model => model.DocumentTemplate.Description)
|
||||
@AjaxHelpers.AjaxSave()
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var $Description = $('#DocumentTemplate_Description');
|
||||
var $DescriptionAjaxSave = $Description.next('.ajaxSave');
|
||||
$Description
|
||||
.watermark('Description')
|
||||
.focus(function () { $Description.select() })
|
||||
.keydown(function (e) {
|
||||
$DescriptionAjaxSave.show();
|
||||
if (e.which == 13) {
|
||||
$(this).blur();
|
||||
}
|
||||
}).blur(function () {
|
||||
$DescriptionAjaxSave.hide();
|
||||
})
|
||||
.change(function () {
|
||||
$DescriptionAjaxSave.hide();
|
||||
var $ajaxLoading = $DescriptionAjaxSave.next('.ajaxLoading').show();
|
||||
var data = { Description: $Description.val() };
|
||||
$.ajax({
|
||||
url: '@Url.Action(MVC.API.DocumentTemplate.UpdateDescription(Model.DocumentTemplate.Id))',
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
success: function (d) {
|
||||
if (d == 'OK') {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
} else {
|
||||
$ajaxLoading.hide();
|
||||
alert('Unable to update description: ' + d);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to update description: ' + textStatus);
|
||||
$ajaxLoading.hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Always Flatten Form:
|
||||
</th>
|
||||
<td>
|
||||
<input id="DocumentTemplate_FlattenForm" type="checkbox" @(Model.DocumentTemplate.FlattenForm ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty))/>
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$('#DocumentTemplate_FlattenForm').click(function () {
|
||||
var $this = $(this);
|
||||
var $ajaxLoading = $this.next('.ajaxLoading').show();
|
||||
var data = { FlattenForm: $this.is(':checked') };
|
||||
$.getJSON('@(Url.Action(MVC.API.DocumentTemplate.UpdateFlattenForm(Model.DocumentTemplate.Id)))', data, function (response, result) {
|
||||
if (result != 'success' || response != 'OK') {
|
||||
alert('Unable to change Flatten Form:\n' + response);
|
||||
$ajaxLoading.hide();
|
||||
} else {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Scope:
|
||||
</th>
|
||||
<td>
|
||||
@Html.DropDownListFor(model => model.DocumentTemplate.Scope, Model.Scopes.ToSelectListItems(null))
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var $scope = $('#DocumentTemplate_Scope');
|
||||
$scope.change(function () {
|
||||
var $ajaxLoading = $scope.next('.ajaxLoading').show();
|
||||
var data = { Scope: $scope.val() };
|
||||
$.ajax({
|
||||
url: '@Url.Action(MVC.API.DocumentTemplate.UpdateScope(Model.DocumentTemplate.Id))',
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
success: function (d) {
|
||||
if (d == 'OK') {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
scopeChange();
|
||||
} else {
|
||||
$ajaxLoading.hide();
|
||||
alert('Unable to update scope: ' + d);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to update scope: ' + textStatus);
|
||||
$ajaxLoading.hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
var $trJobTypes = $('#trJobTypes');
|
||||
var $trJobTypeActions = $('#trJobTypeActions');
|
||||
var $jobTypes = $trJobTypes.find('input[type="checkbox"]');
|
||||
$jobTypes.change(jobTypesChange);
|
||||
|
||||
function scopeChange() {
|
||||
if ($scope.val() == 'Job') {
|
||||
$trJobTypes.show();
|
||||
$trJobTypeActions.show();
|
||||
jobTypesChange();
|
||||
} else {
|
||||
$trJobTypes.hide();
|
||||
$trJobTypeActions.hide();
|
||||
$jobTypes.filter(':checked').each(function () {
|
||||
$(this).attr('checked', false);
|
||||
});
|
||||
$('.jobSubTypes').hide().find('input[type="checkbox"]:checked').each(function () {
|
||||
$(this).attr('checked', false);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function jobTypesChange() {
|
||||
$('.jobSubTypes').hide();
|
||||
$jobTypes.filter(':checked').each(function () {
|
||||
$('#trJobSubType' + $(this).val()).show();
|
||||
});
|
||||
}
|
||||
|
||||
$('#TypeAction_Save').click(function () {
|
||||
var data = { SubTypes: [] };
|
||||
var $ajaxLoading = $('#TypeAction_Save').next('.ajaxLoading').show();
|
||||
|
||||
$jobTypes.filter(':checked').each(function () {
|
||||
var $this = $(this);
|
||||
$('#trJobSubType' + $this.val()).find('input[type="checkbox"]:checked').each(function () {
|
||||
data.SubTypes.push($(this).val());
|
||||
});
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: '@Url.Action(MVC.API.DocumentTemplate.UpdateSubTypes(Model.DocumentTemplate.Id))',
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
traditional: true,
|
||||
data: data,
|
||||
success: function (d) {
|
||||
if (d == 'OK') {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
scopeChange();
|
||||
} else {
|
||||
$ajaxLoading.hide();
|
||||
alert('Unable to update job types: ' + d);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to update job types: ' + textStatus);
|
||||
$ajaxLoading.hide();
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
scopeChange();
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="trJobTypes">
|
||||
<th class="name">
|
||||
Types:
|
||||
</th>
|
||||
<td class="value">
|
||||
@CommonHelpers.CheckBoxList("Types", Model.JobTypes.ToSelectListItems(Model.Types), 2)
|
||||
</td>
|
||||
</tr>
|
||||
@foreach (var jt in Model.JobTypes)
|
||||
{
|
||||
<tr id="trJobSubType@(jt.Id)" class="jobSubTypes">
|
||||
<th class="name">
|
||||
@jt.Description<br />
|
||||
Sub Types<br />
|
||||
@CommonHelpers.CheckboxBulkSelect(string.Format("CheckboxBulkSelect_{0}", jt.Id))
|
||||
</th>
|
||||
<td class="value">
|
||||
@CommonHelpers.CheckBoxList("SubTypes", Model.JobSubTypes.Where(jst => jst.JobTypeId == jt.Id).ToList().ToSelectListItems(Model.SubTypes), 2)
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
<tr id="trJobTypeActions">
|
||||
<th class="name">
|
||||
</th>
|
||||
<td class="value">
|
||||
<a id="TypeAction_Save" href="#" class="button">Save Job Types</a>@AjaxHelpers.AjaxLoader()
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Template PDF
|
||||
</th>
|
||||
<td>
|
||||
@Html.ActionLink("Download Template", MVC.API.DocumentTemplate.Template(Model.DocumentTemplate.Id))
|
||||
<br />
|
||||
@using (Html.BeginForm(MVC.API.DocumentTemplate.Template(Model.DocumentTemplate.Id, true, null), FormMethod.Post, new { enctype = "multipart/form-data" }))
|
||||
{
|
||||
<input type="file" name="Template" id="Template" style="width: 250px;" />
|
||||
<input class="button" type="submit" value="Upload" />
|
||||
}
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var $template = $('#Template');
|
||||
$template.closest('form').submit(function () {
|
||||
if ($template.val() == '') {
|
||||
alert('A template file is required to upload.');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Filter Expression:
|
||||
</th>
|
||||
<td>@Html.TextBoxFor(model => model.DocumentTemplate.FilterExpression)
|
||||
@AjaxHelpers.AjaxRemove()
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var $FilterExpression = $('#DocumentTemplate_FilterExpression');
|
||||
var $ajaxLoading = $FilterExpression.nextAll('.ajaxLoading').first();
|
||||
var $ajaxRemove = $FilterExpression.nextAll('.ajaxRemove').first();
|
||||
$FilterExpression
|
||||
.watermark('Filter Expression')
|
||||
.focus(function () { $FilterExpression.select() })
|
||||
.keydown(function (e) {
|
||||
if (e.which == 13) {
|
||||
$(this).blur();
|
||||
}
|
||||
}).change(function () {
|
||||
updateFilterExpression($FilterExpression.val());
|
||||
});
|
||||
if ($FilterExpression.val() != '')
|
||||
$ajaxRemove.show();
|
||||
$ajaxRemove.click(function () {
|
||||
updateFilterExpression('');
|
||||
$FilterExpression.val('');
|
||||
});
|
||||
var updateFilterExpression = function (filterExpression) {
|
||||
$ajaxLoading.show();
|
||||
$ajaxRemove.hide();
|
||||
var data = { FilterExpression: filterExpression };
|
||||
$.ajax({
|
||||
url: '@Url.Action(MVC.API.DocumentTemplate.UpdateFilterExpression(Model.DocumentTemplate.Id))',
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
success: function (d) {
|
||||
if (d == 'OK') {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
if (data.FilterExpression != '')
|
||||
$ajaxRemove.fadeIn('fast');
|
||||
} else {
|
||||
$ajaxLoading.hide();
|
||||
alert('Unable to update filter expression: ' + d);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to update filter expression: ' + textStatus);
|
||||
$ajaxLoading.hide();
|
||||
}
|
||||
});
|
||||
};
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Bulk Generate
|
||||
</th>
|
||||
<td>
|
||||
@using (Html.BeginForm(MVC.API.DocumentTemplate.BulkGenerate(Model.DocumentTemplate.Id), FormMethod.Post))
|
||||
{
|
||||
<textarea name="DataIds"></textarea>
|
||||
<input class="button" type="submit" value="Generate" />
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<h2>
|
||||
Template Expressions</h2>
|
||||
@Html.Partial(MVC.Config.DocumentTemplate.Views._ExpressionsTable, Model.TemplateExpressions)
|
||||
<div id="dialogConfirmDelete" title="Delete this Document Template?">
|
||||
<p>
|
||||
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 100px 0;">
|
||||
</span>This item will be permanently deleted and cannot be recovered.<br />
|
||||
<em>This <strong>will not delete attachments</strong> which have already been imported,
|
||||
but any generated documents will no longer be automatically imported.</em><br />
|
||||
Are you sure?</p>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var button = $('#buttonDelete');
|
||||
var buttonDialog = $("#dialogConfirmDelete");
|
||||
var buttonLink = button.attr('href');
|
||||
button.attr('href', '#');
|
||||
button.click(function () {
|
||||
buttonDialog.dialog('open');
|
||||
return false;
|
||||
});
|
||||
buttonDialog.dialog({
|
||||
resizable: false,
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
"Delete": function () {
|
||||
$this = $(this);
|
||||
$this.dialog('disable');
|
||||
$this.dialog("option", "buttons", null);
|
||||
window.location.href = buttonLink;
|
||||
},
|
||||
Cancel: function () {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
<div class="actionBar">
|
||||
@Html.ActionLinkButton("Expression Browser", MVC.Config.DocumentTemplate.ExpressionBrowser())
|
||||
@Html.ActionLinkButton("Delete", MVC.API.DocumentTemplate.Delete(Model.DocumentTemplate.Id, true), "buttonDelete")
|
||||
</div>
|
||||
@@ -0,0 +1,781 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.17929
|
||||
//
|
||||
// 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.DocumentTemplate
|
||||
{
|
||||
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.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DocumentTemplate/Show.cshtml")]
|
||||
public class Show : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.DocumentTemplate.ShowModel>
|
||||
{
|
||||
public Show()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 2 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Document Templates", MVC.Config.DocumentTemplate.Index(null), Model.DocumentTemplate.Description);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n<div");
|
||||
|
||||
WriteLiteral(" class=\"form\"");
|
||||
|
||||
WriteLiteral(" style=\"width: 650px\"");
|
||||
|
||||
WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th>\r\n Id:\r\n " +
|
||||
"</th>\r\n <td>");
|
||||
|
||||
|
||||
#line 11 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
Write(Html.DisplayFor(model => model.DocumentTemplate.Id));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th>\r\n " +
|
||||
" Stored Instances:\r\n </th>\r\n <td>");
|
||||
|
||||
|
||||
#line 18 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
Write(Html.DisplayFor(model => model.StoredInstanceCount));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th>\r\n " +
|
||||
" Description:\r\n </th>\r\n <td>");
|
||||
|
||||
|
||||
#line 25 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
Write(Html.TextBoxFor(model => model.DocumentTemplate.Description));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 26 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
Write(AjaxHelpers.AjaxSave());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 27 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
Write(AjaxHelpers.AjaxLoader());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
$(function () {
|
||||
var $Description = $('#DocumentTemplate_Description');
|
||||
var $DescriptionAjaxSave = $Description.next('.ajaxSave');
|
||||
$Description
|
||||
.watermark('Description')
|
||||
.focus(function () { $Description.select() })
|
||||
.keydown(function (e) {
|
||||
$DescriptionAjaxSave.show();
|
||||
if (e.which == 13) {
|
||||
$(this).blur();
|
||||
}
|
||||
}).blur(function () {
|
||||
$DescriptionAjaxSave.hide();
|
||||
})
|
||||
.change(function () {
|
||||
$DescriptionAjaxSave.hide();
|
||||
var $ajaxLoading = $DescriptionAjaxSave.next('.ajaxLoading').show();
|
||||
var data = { Description: $Description.val() };
|
||||
$.ajax({
|
||||
url: '");
|
||||
|
||||
|
||||
#line 48 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
Write(Url.Action(MVC.API.DocumentTemplate.UpdateDescription(Model.DocumentTemplate.Id)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@"',
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
success: function (d) {
|
||||
if (d == 'OK') {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
} else {
|
||||
$ajaxLoading.hide();
|
||||
alert('Unable to update description: ' + d);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to update description: ' + textStatus);
|
||||
$ajaxLoading.hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Always Flatten Form:
|
||||
</th>
|
||||
<td>
|
||||
<input");
|
||||
|
||||
WriteLiteral(" id=\"DocumentTemplate_FlattenForm\"");
|
||||
|
||||
WriteLiteral(" type=\"checkbox\"");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 74 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
Write(Model.DocumentTemplate.FlattenForm ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("/>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 75 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
Write(AjaxHelpers.AjaxLoader());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
$(function () {
|
||||
$('#DocumentTemplate_FlattenForm').click(function () {
|
||||
var $this = $(this);
|
||||
var $ajaxLoading = $this.next('.ajaxLoading').show();
|
||||
var data = { FlattenForm: $this.is(':checked') };
|
||||
$.getJSON('");
|
||||
|
||||
|
||||
#line 82 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
Write(Url.Action(MVC.API.DocumentTemplate.UpdateFlattenForm(Model.DocumentTemplate.Id)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@"', data, function (response, result) {
|
||||
if (result != 'success' || response != 'OK') {
|
||||
alert('Unable to change Flatten Form:\n' + response);
|
||||
$ajaxLoading.hide();
|
||||
} else {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Scope:
|
||||
</th>
|
||||
<td>
|
||||
");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 100 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
Write(Html.DropDownListFor(model => model.DocumentTemplate.Scope, Model.Scopes.ToSelectListItems(null)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 101 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
Write(AjaxHelpers.AjaxLoader());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
$(function () {
|
||||
var $scope = $('#DocumentTemplate_Scope');
|
||||
$scope.change(function () {
|
||||
var $ajaxLoading = $scope.next('.ajaxLoading').show();
|
||||
var data = { Scope: $scope.val() };
|
||||
$.ajax({
|
||||
url: '");
|
||||
|
||||
|
||||
#line 109 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
Write(Url.Action(MVC.API.DocumentTemplate.UpdateScope(Model.DocumentTemplate.Id)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\',\r\n dataType: \'json\',\r\n " +
|
||||
" data: data,\r\n success: function (d) {\r\n " +
|
||||
" if (d == \'OK\') {\r\n " +
|
||||
" $ajaxLoading.hide().next(\'.ajaxOk\').show().delay(\'fast\').fadeOut(\'slow" +
|
||||
"\');\r\n scopeChange();\r\n " +
|
||||
" } else {\r\n $ajaxLoading." +
|
||||
"hide();\r\n alert(\'Unable to update scope: " +
|
||||
"\' + d);\r\n }\r\n " +
|
||||
"},\r\n error: function (jqXHR, textStatus, errorThr" +
|
||||
"own) {\r\n alert(\'Unable to update scope: \' + t" +
|
||||
"extStatus);\r\n $ajaxLoading.hide();\r\n " +
|
||||
" }\r\n });\r\n " +
|
||||
" });\r\n\r\n var $trJobTypes = $(\'#trJobTypes\');\r\n " +
|
||||
" var $trJobTypeActions = $(\'#trJobTypeActions\');\r\n " +
|
||||
" var $jobTypes = $trJobTypes.find(\'input[type=\"checkbox\"]\');\r\n " +
|
||||
" $jobTypes.change(jobTypesChange);\r\n\r\n functi" +
|
||||
"on scopeChange() {\r\n if ($scope.val() == \'Job\') {\r\n " +
|
||||
" $trJobTypes.show();\r\n " +
|
||||
" $trJobTypeActions.show();\r\n jobTypesChange();\r" +
|
||||
"\n } else {\r\n $trJobTyp" +
|
||||
"es.hide();\r\n $trJobTypeActions.hide();\r\n " +
|
||||
" $jobTypes.filter(\':checked\').each(function () {\r\n " +
|
||||
" $(this).attr(\'checked\', false);\r\n " +
|
||||
" });\r\n $(\'.jobSubTypes\').hide().find(" +
|
||||
"\'input[type=\"checkbox\"]:checked\').each(function () {\r\n " +
|
||||
" $(this).attr(\'checked\', false);\r\n });\r\n" +
|
||||
" }\r\n }\r\n\r\n " +
|
||||
" function jobTypesChange() {\r\n $(\'.jobSubTypes\').h" +
|
||||
"ide();\r\n $jobTypes.filter(\':checked\').each(function (" +
|
||||
") {\r\n $(\'#trJobSubType\' + $(this).val()).show();\r" +
|
||||
"\n });\r\n }\r\n\r\n " +
|
||||
" $(\'#TypeAction_Save\').click(function () {\r\n va" +
|
||||
"r data = { SubTypes: [] };\r\n var $ajaxLoading = $(\'#T" +
|
||||
"ypeAction_Save\').next(\'.ajaxLoading\').show();\r\n\r\n $jo" +
|
||||
"bTypes.filter(\':checked\').each(function () {\r\n va" +
|
||||
"r $this = $(this);\r\n $(\'#trJobSubType\' + $this.va" +
|
||||
"l()).find(\'input[type=\"checkbox\"]:checked\').each(function () {\r\n " +
|
||||
" data.SubTypes.push($(this).val());\r\n " +
|
||||
" });\r\n });\r\n\r\n $.aj" +
|
||||
"ax({\r\n url: \'");
|
||||
|
||||
|
||||
#line 169 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
Write(Url.Action(MVC.API.DocumentTemplate.UpdateSubTypes(Model.DocumentTemplate.Id)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@"',
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
traditional: true,
|
||||
data: data,
|
||||
success: function (d) {
|
||||
if (d == 'OK') {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
scopeChange();
|
||||
} else {
|
||||
$ajaxLoading.hide();
|
||||
alert('Unable to update job types: ' + d);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to update job types: ' + textStatus);
|
||||
$ajaxLoading.hide();
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
scopeChange();
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr");
|
||||
|
||||
WriteLiteral(" id=\"trJobTypes\"");
|
||||
|
||||
WriteLiteral(">\r\n <th");
|
||||
|
||||
WriteLiteral(" class=\"name\"");
|
||||
|
||||
WriteLiteral(">\r\n Types:\r\n </th>\r\n <td");
|
||||
|
||||
WriteLiteral(" class=\"value\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 201 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
Write(CommonHelpers.CheckBoxList("Types", Model.JobTypes.ToSelectListItems(Model.Types), 2));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
|
||||
|
||||
|
||||
#line 204 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 204 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
foreach (var jt in Model.JobTypes)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <tr");
|
||||
|
||||
WriteAttribute("id", Tuple.Create(" id=\"", 10448), Tuple.Create("\"", 10473)
|
||||
, Tuple.Create(Tuple.Create("", 10453), Tuple.Create("trJobSubType", 10453), true)
|
||||
|
||||
#line 206 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 10465), Tuple.Create<System.Object, System.Int32>(jt.Id
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 10465), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" class=\"jobSubTypes\"");
|
||||
|
||||
WriteLiteral(">\r\n <th");
|
||||
|
||||
WriteLiteral(" class=\"name\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 208 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
Write(jt.Description);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("<br />\r\n Sub Types<br />\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 210 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
Write(CommonHelpers.CheckboxBulkSelect(string.Format("CheckboxBulkSelect_{0}", jt.Id)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </th>\r\n <td");
|
||||
|
||||
WriteLiteral(" class=\"value\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 213 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
Write(CommonHelpers.CheckBoxList("SubTypes", Model.JobSubTypes.Where(jst => jst.JobTypeId == jt.Id).ToList().ToSelectListItems(Model.SubTypes), 2));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n </tr> \r\n");
|
||||
|
||||
|
||||
#line 216 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <tr");
|
||||
|
||||
WriteLiteral(" id=\"trJobTypeActions\"");
|
||||
|
||||
WriteLiteral(">\r\n <th");
|
||||
|
||||
WriteLiteral(" class=\"name\"");
|
||||
|
||||
WriteLiteral(">\r\n </th>\r\n <td");
|
||||
|
||||
WriteLiteral(" class=\"value\"");
|
||||
|
||||
WriteLiteral(">\r\n <a");
|
||||
|
||||
WriteLiteral(" id=\"TypeAction_Save\"");
|
||||
|
||||
WriteLiteral(" href=\"#\"");
|
||||
|
||||
WriteLiteral(" class=\"button\"");
|
||||
|
||||
WriteLiteral(">Save Job Types</a>");
|
||||
|
||||
|
||||
#line 221 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
Write(AjaxHelpers.AjaxLoader());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th>\r\n " +
|
||||
" Template PDF\r\n </th>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 229 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
Write(Html.ActionLink("Download Template", MVC.API.DocumentTemplate.Template(Model.DocumentTemplate.Id)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n <br />\r\n");
|
||||
|
||||
|
||||
#line 231 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 231 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
using (Html.BeginForm(MVC.API.DocumentTemplate.Template(Model.DocumentTemplate.Id, true, null), FormMethod.Post, new { enctype = "multipart/form-data" }))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <input");
|
||||
|
||||
WriteLiteral(" type=\"file\"");
|
||||
|
||||
WriteLiteral(" name=\"Template\"");
|
||||
|
||||
WriteLiteral(" id=\"Template\"");
|
||||
|
||||
WriteLiteral(" style=\"width: 250px;\"");
|
||||
|
||||
WriteLiteral(" />\r\n");
|
||||
|
||||
WriteLiteral(" <input");
|
||||
|
||||
WriteLiteral(" class=\"button\"");
|
||||
|
||||
WriteLiteral(" type=\"submit\"");
|
||||
|
||||
WriteLiteral(" value=\"Upload\"");
|
||||
|
||||
WriteLiteral(" />\r\n");
|
||||
|
||||
|
||||
#line 235 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
$(function () {
|
||||
var $template = $('#Template');
|
||||
$template.closest('form').submit(function () {
|
||||
if ($template.val() == '') {
|
||||
alert('A template file is required to upload.');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Filter Expression:
|
||||
</th>
|
||||
<td>");
|
||||
|
||||
|
||||
#line 253 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
Write(Html.TextBoxFor(model => model.DocumentTemplate.FilterExpression));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 254 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
Write(AjaxHelpers.AjaxRemove());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 255 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
Write(AjaxHelpers.AjaxLoader());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(">\r\n $(function () {\r\n var $FilterExpres" +
|
||||
"sion = $(\'#DocumentTemplate_FilterExpression\');\r\n var $aj" +
|
||||
"axLoading = $FilterExpression.nextAll(\'.ajaxLoading\').first();\r\n " +
|
||||
" var $ajaxRemove = $FilterExpression.nextAll(\'.ajaxRemove\').first();\r\n " +
|
||||
" $FilterExpression\r\n .waterma" +
|
||||
"rk(\'Filter Expression\')\r\n .focus(function () { $F" +
|
||||
"ilterExpression.select() })\r\n .keydown(function (" +
|
||||
"e) {\r\n if (e.which == 13) {\r\n " +
|
||||
" $(this).blur();\r\n }\r\n" +
|
||||
" }).change(function () {\r\n " +
|
||||
" updateFilterExpression($FilterExpression.val());\r\n " +
|
||||
" });\r\n if ($FilterExpression.val() != \'\')\r\n" +
|
||||
" $ajaxRemove.show();\r\n $ajaxRe" +
|
||||
"move.click(function () {\r\n updateFilterExpression(\'\')" +
|
||||
";\r\n $FilterExpression.val(\'\');\r\n " +
|
||||
" });\r\n var updateFilterExpression = function (filterExp" +
|
||||
"ression) {\r\n $ajaxLoading.show();\r\n " +
|
||||
" $ajaxRemove.hide();\r\n var data = { FilterEx" +
|
||||
"pression: filterExpression };\r\n $.ajax({\r\n " +
|
||||
" url: \'");
|
||||
|
||||
|
||||
#line 282 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
Write(Url.Action(MVC.API.DocumentTemplate.UpdateFilterExpression(Model.DocumentTemplate.Id)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@"',
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
success: function (d) {
|
||||
if (d == 'OK') {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
if (data.FilterExpression != '')
|
||||
$ajaxRemove.fadeIn('fast');
|
||||
} else {
|
||||
$ajaxLoading.hide();
|
||||
alert('Unable to update filter expression: ' + d);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to update filter expression: ' + textStatus);
|
||||
$ajaxLoading.hide();
|
||||
}
|
||||
});
|
||||
};
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Bulk Generate
|
||||
</th>
|
||||
<td>
|
||||
");
|
||||
|
||||
|
||||
#line 310 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 310 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
using (Html.BeginForm(MVC.API.DocumentTemplate.BulkGenerate(Model.DocumentTemplate.Id), FormMethod.Post))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <textarea");
|
||||
|
||||
WriteLiteral(" name=\"DataIds\"");
|
||||
|
||||
WriteLiteral("></textarea>\r\n");
|
||||
|
||||
WriteLiteral(" <input");
|
||||
|
||||
WriteLiteral(" class=\"button\"");
|
||||
|
||||
WriteLiteral(" type=\"submit\"");
|
||||
|
||||
WriteLiteral(" value=\"Generate\"");
|
||||
|
||||
WriteLiteral(" />\r\n");
|
||||
|
||||
|
||||
#line 314 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </td>\r\n </tr>\r\n </table>\r\n</div>\r\n<h2>\r\n Template Expres" +
|
||||
"sions</h2>\r\n");
|
||||
|
||||
|
||||
#line 321 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
Write(Html.Partial(MVC.Config.DocumentTemplate.Views._ExpressionsTable, Model.TemplateExpressions));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n<div");
|
||||
|
||||
WriteLiteral(" id=\"dialogConfirmDelete\"");
|
||||
|
||||
WriteLiteral(" title=\"Delete this Document Template?\"");
|
||||
|
||||
WriteLiteral(">\r\n <p>\r\n <span");
|
||||
|
||||
WriteLiteral(" class=\"ui-icon ui-icon-alert\"");
|
||||
|
||||
WriteLiteral(" style=\"float: left; margin: 0 7px 100px 0;\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
</span>This item will be permanently deleted and cannot be recovered.<br />
|
||||
<em>This <strong>will not delete attachments</strong> which have already been imported,
|
||||
but any generated documents will no longer be automatically imported.</em><br />
|
||||
Are you sure?</p>
|
||||
</div>
|
||||
<script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
$(function () {
|
||||
var button = $('#buttonDelete');
|
||||
var buttonDialog = $(""#dialogConfirmDelete"");
|
||||
var buttonLink = button.attr('href');
|
||||
button.attr('href', '#');
|
||||
button.click(function () {
|
||||
buttonDialog.dialog('open');
|
||||
return false;
|
||||
});
|
||||
buttonDialog.dialog({
|
||||
resizable: false,
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
""Delete"": function () {
|
||||
$this = $(this);
|
||||
$this.dialog('disable');
|
||||
$this.dialog(""option"", ""buttons"", null);
|
||||
window.location.href = buttonLink;
|
||||
},
|
||||
Cancel: function () {
|
||||
$(this).dialog(""close"");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
<div");
|
||||
|
||||
WriteLiteral(" class=\"actionBar\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 360 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
Write(Html.ActionLinkButton("Expression Browser", MVC.Config.DocumentTemplate.ExpressionBrowser()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 361 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
Write(Html.ActionLinkButton("Delete", MVC.API.DocumentTemplate.Delete(Model.DocumentTemplate.Id, true), "buttonDelete"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n</div>\r\n");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -0,0 +1,239 @@
|
||||
@model Disco.Web.Areas.Config.Models.DocumentTemplate.UndetectedPagesModel
|
||||
@{
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Document Templates", MVC.Config.DocumentTemplate.Index(), "Undetected Pages");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR");
|
||||
}
|
||||
<div id="undetectedPagesContainer">
|
||||
<div id="noUndetectedPages" data-bind="visible: noUndetectedPages">
|
||||
<h3>
|
||||
No Undetected Pages</h3>
|
||||
</div>
|
||||
<ul id="undetectedPages" class="clearfix" data-bind="visible: !noUndetectedPages(), foreach: {data: undetectedPages}">
|
||||
<li class="undetectedPage" data-bind="style: {backgroundImage: thumbnailUrl}, click: select">
|
||||
<div class="pageDetails" data-bind="text: timestampFuzzy, attr: {title: timestamp}">
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="undetectedPageDialog" data-bind="with: selectedUndetectedPage">
|
||||
<div class="pagePreview" data-bind="style: {backgroundImage: previewUrl}">
|
||||
</div>
|
||||
<div class="actions">
|
||||
<a href="#" class="button" target="_blank" data-bind="attr: {href: sourceUrl}">Download</a>
|
||||
<a href="#" class="button" id="dialogDeleteButton" data-bind="click: deletePage">Delete</a>
|
||||
</div>
|
||||
<div class="actions">
|
||||
Type: @Html.DropDownList("dialogDocumentTemplateId", Model.DocumentTemplatesSelectListItems, new Dictionary<string, object> { { "data-bind", "value: dialogTemplateId" } })
|
||||
Data:
|
||||
<input id="dialogDataId" type="text" data-bind="value: dialogDataId, autocomplete: {source: dialogDataIdService, minLength: 3, position: {my: 'left bottom', at: 'left top'}}" />
|
||||
<a href="#" class="button" id="dialogAssignButton" data-bind="click: assignPage">Assign</a>
|
||||
</div>
|
||||
</div>
|
||||
<div id="dialogRemove" title="Delete this Page?">
|
||||
<p>
|
||||
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
|
||||
Are you sure?</p>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
ko.bindingHandlers.autocomplete = {
|
||||
update: function (element, valueAccessor, allBindingsAccessor, viewModel) {
|
||||
var autocompleteOptions = ko.utils.unwrapObservable(valueAccessor());
|
||||
if (autocompleteOptions.source)
|
||||
autocompleteOptions.source = ko.utils.unwrapObservable(autocompleteOptions.source);
|
||||
$element = $(element);
|
||||
if (!$element.is('.ui-autocomplete-input')) {
|
||||
autocompleteOptions.select = function (e, ui) {
|
||||
allBindingsAccessor().value(ui.item.value);
|
||||
return false;
|
||||
}
|
||||
$element.autocomplete(autocompleteOptions);
|
||||
} else {
|
||||
// Update Source Option Only
|
||||
if (autocompleteOptions.source)
|
||||
$element.autocomplete('option', 'source', autocompleteOptions.source);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
|
||||
var vm;
|
||||
var urlUndetectedPageThumbnail = '@(new HtmlString(Url.Action(MVC.API.DocumentTemplate.ImporterUndetectedFile(null, false, true))))';
|
||||
var urlUndetectedPagePreview = '@(new HtmlString(Url.Action(MVC.API.DocumentTemplate.ImporterUndetectedFile(null, false, false))))';
|
||||
var urlUndetectedPageSource = '@(new HtmlString(Url.Action(MVC.API.DocumentTemplate.ImporterUndetectedFile(null, true, false))))';
|
||||
var urlDataIdLookupService = '@(Url.Action(MVC.API.DocumentTemplate.ImporterUndetectedDataIdLookup()))/';
|
||||
var urlImporterUndetectedAssign = '@(Url.Action(MVC.API.DocumentTemplate.ImporterUndetectedAssign()))/';
|
||||
var urlImporterUndetectedDelete = '@(Url.Action(MVC.API.DocumentTemplate.ImporterUndetectedDelete()))/';
|
||||
var $undetectedPageDialog = $('#undetectedPageDialog').dialog({
|
||||
modal: true,
|
||||
height: 820,
|
||||
width: 800,
|
||||
resizable: false,
|
||||
autoOpen: false
|
||||
});
|
||||
|
||||
$dialogRemove = $('#dialogRemove').dialog({
|
||||
resizable: false,
|
||||
height: 140,
|
||||
modal: true,
|
||||
autoOpen: false
|
||||
});
|
||||
|
||||
function pageViewModel() {
|
||||
var self = this;
|
||||
|
||||
self.selectedUndetectedPage = ko.observable(null);
|
||||
self.undetectedPages = ko.observableArray();
|
||||
self.noUndetectedPages = ko.computed(function () { return self.undetectedPages().length == 0 });
|
||||
self.selectNextPage = function () {
|
||||
var oldSelected = self.selectedUndetectedPage();
|
||||
var oldSelectedIndex = vm.undetectedPages.indexOf(oldSelected);
|
||||
|
||||
if (vm.undetectedPages().length > 1) {
|
||||
if (oldSelectedIndex > vm.undetectedPages().length - 1)
|
||||
vm.selectedUndetectedPage(vm.undetectedPages()[oldSelectedIndex + 1]);
|
||||
else
|
||||
vm.selectedUndetectedPage(vm.undetectedPages()[oldSelectedIndex - 1]);
|
||||
} else {
|
||||
$undetectedPageDialog.dialog('close');
|
||||
vm.selectedUndetectedPage(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function undetectedPageViewModel(id, timestamp, timestampFuzzy) {
|
||||
var self = this;
|
||||
|
||||
self.id = id;
|
||||
self.timestamp = timestamp;
|
||||
self.timestampFuzzy = timestampFuzzy;
|
||||
self.thumbnailUrl = "url(" + urlUndetectedPageThumbnail + "&id=" + id + ")";
|
||||
self.previewUrl = "url(" + urlUndetectedPagePreview + "&id=" + id + ")";
|
||||
self.sourceUrl = urlUndetectedPageSource + "&id=" + id;
|
||||
self.select = function (e, d) {
|
||||
vm.selectedUndetectedPage(self);
|
||||
$undetectedPageDialog.dialog('open');
|
||||
}
|
||||
|
||||
// Dialog Properties
|
||||
self.dialogTemplateId = ko.observable(null);
|
||||
self.dialogDataId = ko.observable(null);
|
||||
self.dialogDataIdService = ko.computed(function () {
|
||||
return urlDataIdLookupService + self.dialogTemplateId();
|
||||
});
|
||||
self.deletePage = function () {
|
||||
$undetectedPageDialog.dialog('option', 'disabled', true);
|
||||
|
||||
$dialogRemove.dialog('option', 'buttons', {
|
||||
"Remove": function () {
|
||||
$dialogRemove.dialog("close");
|
||||
var data = { id: self.id };
|
||||
$.ajax({
|
||||
url: urlImporterUndetectedDelete,
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
type: 'POST',
|
||||
success: function (d) {
|
||||
if (d == 'OK') {
|
||||
vm.selectNextPage();
|
||||
vm.undetectedPages.remove(self);
|
||||
} else {
|
||||
alert('Unable to delete page: ' + d);
|
||||
}
|
||||
$undetectedPageDialog.dialog('option', 'disabled', false);
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to delete page: ' + errorThrown);
|
||||
$undetectedPageDialog.dialog('option', 'disabled', false);
|
||||
}
|
||||
});
|
||||
},
|
||||
"Cancel": function () {
|
||||
$dialogRemove.dialog("close");
|
||||
$undetectedPageDialog.dialog('option', 'disabled', false);
|
||||
}
|
||||
});
|
||||
|
||||
$dialogRemove.dialog('open');
|
||||
|
||||
return false;
|
||||
}
|
||||
self.assignPage = function () {
|
||||
var dtId = self.dialogTemplateId();
|
||||
var dId = self.dialogDataId();
|
||||
if (!dtId || !dId) {
|
||||
alert('Please specify a valid Document Type and Data Id');
|
||||
} else {
|
||||
$undetectedPageDialog.dialog('option', 'disabled', true);
|
||||
|
||||
var data = { id: self.id, DocumentTemplateId: dtId, DataId: dId };
|
||||
|
||||
$.ajax({
|
||||
url: urlImporterUndetectedAssign,
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
type: 'POST',
|
||||
success: function (d) {
|
||||
if (d == 'OK') {
|
||||
vm.selectNextPage();
|
||||
vm.undetectedPages.remove(self);
|
||||
} else {
|
||||
alert('Unable to assign page: ' + d);
|
||||
}
|
||||
$undetectedPageDialog.dialog('option', 'disabled', false);
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to assign page: ' + errorThrown);
|
||||
$undetectedPageDialog.dialog('option', 'disabled', false);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
return false;
|
||||
};
|
||||
}
|
||||
|
||||
function init() {
|
||||
vm = new pageViewModel();
|
||||
|
||||
$.ajax({
|
||||
url: '@(Url.Action(MVC.API.DocumentTemplate.ImporterUndetectedFiles()))',
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
success: init_loadedContent,
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to load content: ' + errorThrown);
|
||||
}
|
||||
});
|
||||
}
|
||||
function init_loadedContent(content) {
|
||||
if (content.length > 0) {
|
||||
for (var i = 0; i < content.length; i++) {
|
||||
var c = content[i];
|
||||
var up = new undetectedPageViewModel(c.Id, c.Timestamp, c.TimestampFuzzy);
|
||||
vm.undetectedPages.push(up);
|
||||
}
|
||||
}
|
||||
|
||||
ko.applyBindings(vm);
|
||||
init_loadedOpen();
|
||||
}
|
||||
function init_loadedOpen() {
|
||||
var fileId = window.location.hash;
|
||||
if (fileId) {
|
||||
fileId = fileId.substr(1);
|
||||
for (var i = 0; i < vm.undetectedPages().length; i++) {
|
||||
var up = vm.undetectedPages()[i];
|
||||
if (up.id == fileId) {
|
||||
up.select();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
init();
|
||||
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,370 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.17929
|
||||
//
|
||||
// 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.DocumentTemplate
|
||||
{
|
||||
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.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DocumentTemplate/UndetectedPages.cshtml")]
|
||||
public class UndetectedPages : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.DocumentTemplate.UndetectedPagesModel>
|
||||
{
|
||||
public UndetectedPages()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 2 "..\..\Areas\Config\Views\DocumentTemplate\UndetectedPages.cshtml"
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Document Templates", MVC.Config.DocumentTemplate.Index(), "Undetected Pages");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR");
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n<div");
|
||||
|
||||
WriteLiteral(" id=\"undetectedPagesContainer\"");
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" id=\"noUndetectedPages\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"visible: noUndetectedPages\"");
|
||||
|
||||
WriteLiteral(">\r\n <h3>\r\n No Undetected Pages</h3>\r\n </div>\r\n <ul");
|
||||
|
||||
WriteLiteral(" id=\"undetectedPages\"");
|
||||
|
||||
WriteLiteral(" class=\"clearfix\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"visible: !noUndetectedPages(), foreach: {data: undetectedPages}\"");
|
||||
|
||||
WriteLiteral(">\r\n <li");
|
||||
|
||||
WriteLiteral(" class=\"undetectedPage\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"style: {backgroundImage: thumbnailUrl}, click: select\"");
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"pageDetails\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: timestampFuzzy, attr: {title: timestamp}\"");
|
||||
|
||||
WriteLiteral(">\r\n </div>\r\n </li>\r\n </ul>\r\n</div>\r\n<div");
|
||||
|
||||
WriteLiteral(" id=\"undetectedPageDialog\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"with: selectedUndetectedPage\"");
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"pagePreview\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"style: {backgroundImage: previewUrl}\"");
|
||||
|
||||
WriteLiteral(">\r\n </div>\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"actions\"");
|
||||
|
||||
WriteLiteral(">\r\n <a");
|
||||
|
||||
WriteLiteral(" href=\"#\"");
|
||||
|
||||
WriteLiteral(" class=\"button\"");
|
||||
|
||||
WriteLiteral(" target=\"_blank\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"attr: {href: sourceUrl}\"");
|
||||
|
||||
WriteLiteral(">Download</a>\r\n <a");
|
||||
|
||||
WriteLiteral(" href=\"#\"");
|
||||
|
||||
WriteLiteral(" class=\"button\"");
|
||||
|
||||
WriteLiteral(" id=\"dialogDeleteButton\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"click: deletePage\"");
|
||||
|
||||
WriteLiteral(">Delete</a>\r\n </div>\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"actions\"");
|
||||
|
||||
WriteLiteral(">\r\n Type: ");
|
||||
|
||||
|
||||
#line 27 "..\..\Areas\Config\Views\DocumentTemplate\UndetectedPages.cshtml"
|
||||
Write(Html.DropDownList("dialogDocumentTemplateId", Model.DocumentTemplatesSelectListItems, new Dictionary<string, object> { { "data-bind", "value: dialogTemplateId" } }));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n Data:\r\n <input");
|
||||
|
||||
WriteLiteral(" id=\"dialogDataId\"");
|
||||
|
||||
WriteLiteral(" type=\"text\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"value: dialogDataId, autocomplete: {source: dialogDataIdService, minL" +
|
||||
"ength: 3, position: {my: \'left bottom\', at: \'left top\'}}\"");
|
||||
|
||||
WriteLiteral(" />\r\n <a");
|
||||
|
||||
WriteLiteral(" href=\"#\"");
|
||||
|
||||
WriteLiteral(" class=\"button\"");
|
||||
|
||||
WriteLiteral(" id=\"dialogAssignButton\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"click: assignPage\"");
|
||||
|
||||
WriteLiteral(">Assign</a>\r\n </div>\r\n</div>\r\n<div");
|
||||
|
||||
WriteLiteral(" id=\"dialogRemove\"");
|
||||
|
||||
WriteLiteral(" title=\"Delete this Page?\"");
|
||||
|
||||
WriteLiteral(">\r\n <p>\r\n <span");
|
||||
|
||||
WriteLiteral(" class=\"ui-icon ui-icon-alert\"");
|
||||
|
||||
WriteLiteral(" style=\"float: left; margin: 0 7px 20px 0;\"");
|
||||
|
||||
WriteLiteral("></span>\r\n Are you sure?</p>\r\n</div>\r\n<script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
ko.bindingHandlers.autocomplete = {
|
||||
update: function (element, valueAccessor, allBindingsAccessor, viewModel) {
|
||||
var autocompleteOptions = ko.utils.unwrapObservable(valueAccessor());
|
||||
if (autocompleteOptions.source)
|
||||
autocompleteOptions.source = ko.utils.unwrapObservable(autocompleteOptions.source);
|
||||
$element = $(element);
|
||||
if (!$element.is('.ui-autocomplete-input')) {
|
||||
autocompleteOptions.select = function (e, ui) {
|
||||
allBindingsAccessor().value(ui.item.value);
|
||||
return false;
|
||||
}
|
||||
$element.autocomplete(autocompleteOptions);
|
||||
} else {
|
||||
// Update Source Option Only
|
||||
if (autocompleteOptions.source)
|
||||
$element.autocomplete('option', 'source', autocompleteOptions.source);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(">\r\n $(function () {\r\n\r\n var vm;\r\n var urlUndetectedPageThumbnail" +
|
||||
" = \'");
|
||||
|
||||
|
||||
#line 63 "..\..\Areas\Config\Views\DocumentTemplate\UndetectedPages.cshtml"
|
||||
Write(new HtmlString(Url.Action(MVC.API.DocumentTemplate.ImporterUndetectedFile(null, false, true))));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\';\r\n var urlUndetectedPagePreview = \'");
|
||||
|
||||
|
||||
#line 64 "..\..\Areas\Config\Views\DocumentTemplate\UndetectedPages.cshtml"
|
||||
Write(new HtmlString(Url.Action(MVC.API.DocumentTemplate.ImporterUndetectedFile(null, false, false))));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\';\r\n var urlUndetectedPageSource = \'");
|
||||
|
||||
|
||||
#line 65 "..\..\Areas\Config\Views\DocumentTemplate\UndetectedPages.cshtml"
|
||||
Write(new HtmlString(Url.Action(MVC.API.DocumentTemplate.ImporterUndetectedFile(null, true, false))));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\';\r\n var urlDataIdLookupService = \'");
|
||||
|
||||
|
||||
#line 66 "..\..\Areas\Config\Views\DocumentTemplate\UndetectedPages.cshtml"
|
||||
Write(Url.Action(MVC.API.DocumentTemplate.ImporterUndetectedDataIdLookup()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("/\';\r\n var urlImporterUndetectedAssign = \'");
|
||||
|
||||
|
||||
#line 67 "..\..\Areas\Config\Views\DocumentTemplate\UndetectedPages.cshtml"
|
||||
Write(Url.Action(MVC.API.DocumentTemplate.ImporterUndetectedAssign()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("/\';\r\n var urlImporterUndetectedDelete = \'");
|
||||
|
||||
|
||||
#line 68 "..\..\Areas\Config\Views\DocumentTemplate\UndetectedPages.cshtml"
|
||||
Write(Url.Action(MVC.API.DocumentTemplate.ImporterUndetectedDelete()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("/\';\r\n var $undetectedPageDialog = $(\'#undetectedPageDialog\').dialog({\r\n " +
|
||||
" modal: true,\r\n height: 820,\r\n width: 800,\r\n " +
|
||||
" resizable: false,\r\n autoOpen: false\r\n });\r\n\r\n $di" +
|
||||
"alogRemove = $(\'#dialogRemove\').dialog({\r\n resizable: false,\r\n " +
|
||||
" height: 140,\r\n modal: true,\r\n autoOpen: false\r\n " +
|
||||
" });\r\n\r\n function pageViewModel() {\r\n var self = this;\r\n\r\n " +
|
||||
" self.selectedUndetectedPage = ko.observable(null);\r\n self.un" +
|
||||
"detectedPages = ko.observableArray();\r\n self.noUndetectedPages = ko.c" +
|
||||
"omputed(function () { return self.undetectedPages().length == 0 });\r\n " +
|
||||
" self.selectNextPage = function () {\r\n var oldSelected = self.sel" +
|
||||
"ectedUndetectedPage();\r\n var oldSelectedIndex = vm.undetectedPage" +
|
||||
"s.indexOf(oldSelected);\r\n\r\n if (vm.undetectedPages().length > 1) " +
|
||||
"{\r\n if (oldSelectedIndex > vm.undetectedPages().length - 1)\r\n" +
|
||||
" vm.selectedUndetectedPage(vm.undetectedPages()[oldSelect" +
|
||||
"edIndex + 1]);\r\n else\r\n vm.selectedUnd" +
|
||||
"etectedPage(vm.undetectedPages()[oldSelectedIndex - 1]);\r\n } else" +
|
||||
" {\r\n $undetectedPageDialog.dialog(\'close\');\r\n " +
|
||||
" vm.selectedUndetectedPage(null);\r\n }\r\n }\r\n " +
|
||||
"}\r\n\r\n function undetectedPageViewModel(id, timestamp, timestampFuzzy) {\r\n" +
|
||||
" var self = this;\r\n\r\n self.id = id;\r\n self.time" +
|
||||
"stamp = timestamp;\r\n self.timestampFuzzy = timestampFuzzy;\r\n " +
|
||||
" self.thumbnailUrl = \"url(\" + urlUndetectedPageThumbnail + \"&id=\" + id + \")\";\r" +
|
||||
"\n self.previewUrl = \"url(\" + urlUndetectedPagePreview + \"&id=\" + id +" +
|
||||
" \")\";\r\n self.sourceUrl = urlUndetectedPageSource + \"&id=\" + id;\r\n " +
|
||||
" self.select = function (e, d) {\r\n vm.selectedUndetectedPa" +
|
||||
"ge(self);\r\n $undetectedPageDialog.dialog(\'open\');\r\n }\r" +
|
||||
"\n\r\n // Dialog Properties\r\n self.dialogTemplateId = ko.obse" +
|
||||
"rvable(null);\r\n self.dialogDataId = ko.observable(null);\r\n " +
|
||||
" self.dialogDataIdService = ko.computed(function () {\r\n return ur" +
|
||||
"lDataIdLookupService + self.dialogTemplateId();\r\n });\r\n se" +
|
||||
"lf.deletePage = function () {\r\n $undetectedPageDialog.dialog(\'opt" +
|
||||
"ion\', \'disabled\', true);\r\n\r\n $dialogRemove.dialog(\'option\', \'butt" +
|
||||
"ons\', {\r\n \"Remove\": function () {\r\n $d" +
|
||||
"ialogRemove.dialog(\"close\");\r\n var data = { id: self.id }" +
|
||||
";\r\n $.ajax({\r\n url: urlImporte" +
|
||||
"rUndetectedDelete,\r\n dataType: \'json\',\r\n " +
|
||||
" data: data,\r\n type: \'POST\',\r\n " +
|
||||
" success: function (d) {\r\n if (" +
|
||||
"d == \'OK\') {\r\n vm.selectNextPage();\r\n " +
|
||||
" vm.undetectedPages.remove(self);\r\n " +
|
||||
" } else {\r\n alert(\'Unable to del" +
|
||||
"ete page: \' + d);\r\n }\r\n " +
|
||||
" $undetectedPageDialog.dialog(\'option\', \'disabled\', false);\r\n " +
|
||||
" },\r\n error: function (jqXHR, textStatus" +
|
||||
", errorThrown) {\r\n alert(\'Unable to delete page: " +
|
||||
"\' + errorThrown);\r\n $undetectedPageDialog.dialog(" +
|
||||
"\'option\', \'disabled\', false);\r\n }\r\n " +
|
||||
" });\r\n },\r\n \"Cancel\": function () {\r\n" +
|
||||
" $dialogRemove.dialog(\"close\");\r\n " +
|
||||
"$undetectedPageDialog.dialog(\'option\', \'disabled\', false);\r\n " +
|
||||
"}\r\n });\r\n\r\n $dialogRemove.dialog(\'open\');\r\n\r\n " +
|
||||
" return false;\r\n }\r\n self.assignPage = function " +
|
||||
"() {\r\n var dtId = self.dialogTemplateId();\r\n var d" +
|
||||
"Id = self.dialogDataId();\r\n if (!dtId || !dId) {\r\n " +
|
||||
" alert(\'Please specify a valid Document Type and Data Id\');\r\n " +
|
||||
" } else {\r\n $undetectedPageDialog.dialog(\'option\', \'disabled\'" +
|
||||
", true);\r\n\r\n var data = { id: self.id, DocumentTemplateId: dt" +
|
||||
"Id, DataId: dId };\r\n\r\n $.ajax({\r\n url:" +
|
||||
" urlImporterUndetectedAssign,\r\n dataType: \'json\',\r\n " +
|
||||
" data: data,\r\n type: \'POST\',\r\n " +
|
||||
" success: function (d) {\r\n if (d == \'OK\'" +
|
||||
") {\r\n vm.selectNextPage();\r\n " +
|
||||
" vm.undetectedPages.remove(self);\r\n } else " +
|
||||
"{\r\n alert(\'Unable to assign page: \' + d);\r\n " +
|
||||
" }\r\n $undetectedPageDialog.dialo" +
|
||||
"g(\'option\', \'disabled\', false);\r\n },\r\n " +
|
||||
" error: function (jqXHR, textStatus, errorThrown) {\r\n " +
|
||||
" alert(\'Unable to assign page: \' + errorThrown);\r\n " +
|
||||
" $undetectedPageDialog.dialog(\'option\', \'disabled\', false);\r\n " +
|
||||
" }\r\n });\r\n\r\n }\r\n return fa" +
|
||||
"lse;\r\n };\r\n }\r\n\r\n function init() {\r\n vm = n" +
|
||||
"ew pageViewModel();\r\n\r\n $.ajax({\r\n url: \'");
|
||||
|
||||
|
||||
#line 202 "..\..\Areas\Config\Views\DocumentTemplate\UndetectedPages.cshtml"
|
||||
Write(Url.Action(MVC.API.DocumentTemplate.ImporterUndetectedFiles()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@"',
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
success: init_loadedContent,
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to load content: ' + errorThrown);
|
||||
}
|
||||
});
|
||||
}
|
||||
function init_loadedContent(content) {
|
||||
if (content.length > 0) {
|
||||
for (var i = 0; i < content.length; i++) {
|
||||
var c = content[i];
|
||||
var up = new undetectedPageViewModel(c.Id, c.Timestamp, c.TimestampFuzzy);
|
||||
vm.undetectedPages.push(up);
|
||||
}
|
||||
}
|
||||
|
||||
ko.applyBindings(vm);
|
||||
init_loadedOpen();
|
||||
}
|
||||
function init_loadedOpen() {
|
||||
var fileId = window.location.hash;
|
||||
if (fileId) {
|
||||
fileId = fileId.substr(1);
|
||||
for (var i = 0; i < vm.undetectedPages().length; i++) {
|
||||
var up = vm.undetectedPages()[i];
|
||||
if (up.id == fileId) {
|
||||
up.select();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
init();
|
||||
|
||||
});
|
||||
</script>
|
||||
");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -0,0 +1,75 @@
|
||||
@model IEnumerable<Disco.BI.Expressions.Expression>
|
||||
<div class="expressionsTable">
|
||||
@if (Model.Count() > 0)
|
||||
{
|
||||
<table class="expressionsTable">
|
||||
<tr>
|
||||
<th>
|
||||
Name
|
||||
</th>
|
||||
<th>
|
||||
Expression
|
||||
</th>
|
||||
<th>
|
||||
Errors Allowed
|
||||
</th>
|
||||
</tr>
|
||||
@foreach (var expression in Model.Where(m => m.IsDynamic))
|
||||
{
|
||||
var expressionParts = expression.Where(e => e.IsDynamic).ToArray();
|
||||
<tr>
|
||||
<td rowspan="@(expressionParts.Length)">
|
||||
@expression.Name
|
||||
</td>
|
||||
@if (expressionParts[0].ParseError)
|
||||
{
|
||||
<td class="parseError">
|
||||
@expressionParts[0].Source
|
||||
<div class="code">
|
||||
<strong>Expression Compilation Error:</strong><br />
|
||||
@expressionParts[0].ParseErrorMessage
|
||||
</div>
|
||||
</td>
|
||||
}
|
||||
else
|
||||
{
|
||||
<td>
|
||||
@expressionParts[0].Source
|
||||
</td>
|
||||
}
|
||||
<td>
|
||||
@(expressionParts[0].ErrorsAllowed ? "Yes" : "No")
|
||||
</td>
|
||||
</tr>
|
||||
for (int expressionIndex = 1; expressionIndex < expressionParts.Length; expressionIndex++)
|
||||
{
|
||||
<tr>
|
||||
@if (expressionParts[expressionIndex].ParseError)
|
||||
{
|
||||
<td class="parseError">
|
||||
@expressionParts[expressionIndex].Source
|
||||
<div class="code">
|
||||
<strong>Expression Compilation Error:</strong><br />
|
||||
@expressionParts[expressionIndex].ParseErrorMessage
|
||||
</div>
|
||||
</td>
|
||||
}
|
||||
else
|
||||
{
|
||||
<td>
|
||||
@expressionParts[expressionIndex].Source
|
||||
</td>
|
||||
}
|
||||
<td>
|
||||
@(expressionParts[expressionIndex].ErrorsAllowed ? "Yes" : "No")
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
}
|
||||
</table>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="smallMessage">No Expressions Found</span>
|
||||
}
|
||||
</div>
|
||||
@@ -0,0 +1,346 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.17929
|
||||
//
|
||||
// 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.DocumentTemplate
|
||||
{
|
||||
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.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DocumentTemplate/_ExpressionsTable.cshtml")]
|
||||
public class ExpressionsTable : System.Web.Mvc.WebViewPage<IEnumerable<Disco.BI.Expressions.Expression>>
|
||||
{
|
||||
public ExpressionsTable()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
WriteLiteral("<div");
|
||||
|
||||
WriteLiteral(" class=\"expressionsTable\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 3 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 3 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
|
||||
if (Model.Count() > 0)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <table");
|
||||
|
||||
WriteLiteral(" class=\"expressionsTable\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
<tr>
|
||||
<th>
|
||||
Name
|
||||
</th>
|
||||
<th>
|
||||
Expression
|
||||
</th>
|
||||
<th>
|
||||
Errors Allowed
|
||||
</th>
|
||||
</tr>
|
||||
");
|
||||
|
||||
|
||||
#line 17 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 17 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
|
||||
foreach (var expression in Model.Where(m => m.IsDynamic))
|
||||
{
|
||||
var expressionParts = expression.Where(e => e.IsDynamic).ToArray();
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <tr>\r\n <td");
|
||||
|
||||
WriteAttribute("rowspan", Tuple.Create(" rowspan=\"", 647), Tuple.Create("\"", 682)
|
||||
|
||||
#line 21 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 657), Tuple.Create<System.Object, System.Int32>(expressionParts.Length
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 657), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 22 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
|
||||
Write(expression.Name);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n");
|
||||
|
||||
|
||||
#line 24 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 24 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
|
||||
if (expressionParts[0].ParseError)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <td");
|
||||
|
||||
WriteLiteral(" class=\"parseError\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 27 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
|
||||
Write(expressionParts[0].Source);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"code\"");
|
||||
|
||||
WriteLiteral(">\r\n <strong>Expression Compilation Error:</strong>" +
|
||||
"<br />\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 30 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
|
||||
Write(expressionParts[0].ParseErrorMessage);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </div>\r\n </td>\r\n");
|
||||
|
||||
|
||||
#line 33 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 37 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
|
||||
Write(expressionParts[0].Source);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n");
|
||||
|
||||
|
||||
#line 39 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 41 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
|
||||
Write(expressionParts[0].ErrorsAllowed ? "Yes" : "No");
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
|
||||
|
||||
|
||||
#line 44 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
|
||||
for (int expressionIndex = 1; expressionIndex < expressionParts.Length; expressionIndex++)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <tr>\r\n");
|
||||
|
||||
|
||||
#line 47 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 47 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
|
||||
if (expressionParts[expressionIndex].ParseError)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <td");
|
||||
|
||||
WriteLiteral(" class=\"parseError\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 50 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
|
||||
Write(expressionParts[expressionIndex].Source);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"code\"");
|
||||
|
||||
WriteLiteral(">\r\n <strong>Expression Compilation Error:</strong>" +
|
||||
"<br />\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 53 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
|
||||
Write(expressionParts[expressionIndex].ParseErrorMessage);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </div>\r\n </td>\r\n");
|
||||
|
||||
|
||||
#line 56 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 60 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
|
||||
Write(expressionParts[expressionIndex].Source);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n");
|
||||
|
||||
|
||||
#line 62 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 64 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
|
||||
Write(expressionParts[expressionIndex].ErrorsAllowed ? "Yes" : "No");
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
|
||||
|
||||
|
||||
#line 67 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </table>\r\n");
|
||||
|
||||
|
||||
#line 70 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <span");
|
||||
|
||||
WriteLiteral(" class=\"smallMessage\"");
|
||||
|
||||
WriteLiteral(">No Expressions Found</span>\r\n");
|
||||
|
||||
|
||||
#line 74 "..\..\Areas\Config\Views\DocumentTemplate\_ExpressionsTable.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</div>\r\n");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -0,0 +1,130 @@
|
||||
@model Disco.Web.Areas.Config.Models.Enrolment.IndexModel
|
||||
@{
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Enrolment");
|
||||
}
|
||||
<div class="form" style="width: 530px;">
|
||||
<h2>Apple Mac Secure Enrol</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<th>Username:
|
||||
</th>
|
||||
<td>@Html.TextBoxFor(model => model.MacSshUsername)
|
||||
@AjaxHelpers.AjaxSave()
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var $DOM = $('#MacSshUsername');
|
||||
var $DOMAjaxSave = $DOM.next('.ajaxSave');
|
||||
$DOM
|
||||
.watermark('Username')
|
||||
.focus(function () { $DOM.select() })
|
||||
.keydown(function (e) {
|
||||
$DOMAjaxSave.show();
|
||||
if (e.which == 13) {
|
||||
$(this).blur();
|
||||
}
|
||||
}).blur(function () {
|
||||
$DOMAjaxSave.hide();
|
||||
})
|
||||
.change(function () {
|
||||
$DOMAjaxSave.hide();
|
||||
var $ajaxLoading = $DOMAjaxSave.next('.ajaxLoading').show();
|
||||
var data = { MacSshUsername: $DOM.val() };
|
||||
$.ajax({
|
||||
url: '@Url.Action(MVC.API.Bootstrapper.MacSshUsername())',
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
success: function (d) {
|
||||
if (d == 'OK') {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
} else {
|
||||
$ajaxLoading.hide();
|
||||
alert('Unable to update Username: ' + d);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to update Username: ' + textStatus);
|
||||
$ajaxLoading.hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Password:
|
||||
</th>
|
||||
<td>
|
||||
<input id="MacSshPassword" type="password" />
|
||||
@AjaxHelpers.AjaxSave()
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var $DOM = $('#MacSshPassword');
|
||||
var $DOMAjaxSave = $DOM.next('.ajaxSave');
|
||||
$DOM
|
||||
.watermark('Password')
|
||||
.focus(function () { $DOM.select() })
|
||||
.keydown(function (e) {
|
||||
$DOMAjaxSave.show();
|
||||
if (e.which == 13) {
|
||||
$(this).blur();
|
||||
}
|
||||
}).blur(function () {
|
||||
$DOMAjaxSave.hide();
|
||||
})
|
||||
.change(function () {
|
||||
$DOMAjaxSave.hide();
|
||||
var $ajaxLoading = $DOMAjaxSave.next('.ajaxLoading').show();
|
||||
var data = { MacSshPassword: $DOM.val() };
|
||||
$.ajax({
|
||||
url: '@Url.Action(MVC.API.Bootstrapper.MacSshPassword())',
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
success: function (d) {
|
||||
if (d == 'OK') {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
} else {
|
||||
$ajaxLoading.hide();
|
||||
alert('Unable to update Password: ' + d);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to update Password: ' + textStatus);
|
||||
$ajaxLoading.hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<span class="smallText"><strong>Instructions:</strong> The above credentials must be
|
||||
able to connect to the requesting Apple Mac client via <a target="_blank" href="http://en.wikipedia.org/wiki/Secure_Shell">SSH</a>. Enter/Script the following command:</span>
|
||||
<div class="code">
|
||||
curl <a target="_blank" href="http://disco:9292/Services/Client/Unauthenticated/MacSecureEnrol">http://disco:9292/Services/Client/Unauthenticated/MacSecureEnrol</a>
|
||||
</div>
|
||||
<span class="smallText">This url will return a <a target="_blank" href="http://json.org/">JSON</a> response containing basic information about the enrolment.</span><br />
|
||||
<span class="smallMessage">This command makes use of <a target="_blank" href="http://curl.haxx.se/">cURL</a> (bundled with OSX). Other methods can also trigger a Mac Secure Enrol,
|
||||
such as an anchor (<span class="code"><a></span>) or <span class="code"><script></span>
|
||||
tag embedded on the organisation's intranet.</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<h2>Live Enrolment Logging</h2>
|
||||
@Html.Partial(MVC.Config.Shared.Views.LogEvents, new Disco.Web.Areas.Config.Models.Shared.LogEventsModel()
|
||||
{
|
||||
IsLive = true,
|
||||
TakeFilter = 100,
|
||||
StartFilter = DateTime.Today.AddDays(-1),
|
||||
ModuleFilter = Disco.BI.DeviceBI.EnrolmentLog.Current,
|
||||
ViewPortHeight = 250
|
||||
})
|
||||
<div class="actionBar">
|
||||
@Html.ActionLinkButton("Download Bootstrapper", MVC.Services.Client.Bootstrapper())
|
||||
@Html.ActionLinkButton("Enrolment Status", MVC.Config.Enrolment.Status())
|
||||
</div>
|
||||
@@ -0,0 +1,335 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.17929
|
||||
//
|
||||
// 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.Enrolment
|
||||
{
|
||||
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.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/Enrolment/Index.cshtml")]
|
||||
public class Index : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.Enrolment.IndexModel>
|
||||
{
|
||||
public Index()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 2 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Enrolment");
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n<div");
|
||||
|
||||
WriteLiteral(" class=\"form\"");
|
||||
|
||||
WriteLiteral(" style=\"width: 530px;\"");
|
||||
|
||||
WriteLiteral(">\r\n <h2>Apple Mac Secure Enrol</h2>\r\n <table>\r\n <tr>\r\n <t" +
|
||||
"h>Username:\r\n </th>\r\n <td>");
|
||||
|
||||
|
||||
#line 11 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
|
||||
Write(Html.TextBoxFor(model => model.MacSshUsername));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 12 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
|
||||
Write(AjaxHelpers.AjaxSave());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 13 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
|
||||
Write(AjaxHelpers.AjaxLoader());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
$(function () {
|
||||
var $DOM = $('#MacSshUsername');
|
||||
var $DOMAjaxSave = $DOM.next('.ajaxSave');
|
||||
$DOM
|
||||
.watermark('Username')
|
||||
.focus(function () { $DOM.select() })
|
||||
.keydown(function (e) {
|
||||
$DOMAjaxSave.show();
|
||||
if (e.which == 13) {
|
||||
$(this).blur();
|
||||
}
|
||||
}).blur(function () {
|
||||
$DOMAjaxSave.hide();
|
||||
})
|
||||
.change(function () {
|
||||
$DOMAjaxSave.hide();
|
||||
var $ajaxLoading = $DOMAjaxSave.next('.ajaxLoading').show();
|
||||
var data = { MacSshUsername: $DOM.val() };
|
||||
$.ajax({
|
||||
url: '");
|
||||
|
||||
|
||||
#line 34 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
|
||||
Write(Url.Action(MVC.API.Bootstrapper.MacSshUsername()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@"',
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
success: function (d) {
|
||||
if (d == 'OK') {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
} else {
|
||||
$ajaxLoading.hide();
|
||||
alert('Unable to update Username: ' + d);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to update Username: ' + textStatus);
|
||||
$ajaxLoading.hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Password:
|
||||
</th>
|
||||
<td>
|
||||
<input");
|
||||
|
||||
WriteLiteral(" id=\"MacSshPassword\"");
|
||||
|
||||
WriteLiteral(" type=\"password\"");
|
||||
|
||||
WriteLiteral(" />\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 60 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
|
||||
Write(AjaxHelpers.AjaxSave());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 61 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
|
||||
Write(AjaxHelpers.AjaxLoader());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
$(function () {
|
||||
var $DOM = $('#MacSshPassword');
|
||||
var $DOMAjaxSave = $DOM.next('.ajaxSave');
|
||||
$DOM
|
||||
.watermark('Password')
|
||||
.focus(function () { $DOM.select() })
|
||||
.keydown(function (e) {
|
||||
$DOMAjaxSave.show();
|
||||
if (e.which == 13) {
|
||||
$(this).blur();
|
||||
}
|
||||
}).blur(function () {
|
||||
$DOMAjaxSave.hide();
|
||||
})
|
||||
.change(function () {
|
||||
$DOMAjaxSave.hide();
|
||||
var $ajaxLoading = $DOMAjaxSave.next('.ajaxLoading').show();
|
||||
var data = { MacSshPassword: $DOM.val() };
|
||||
$.ajax({
|
||||
url: '");
|
||||
|
||||
|
||||
#line 82 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
|
||||
Write(Url.Action(MVC.API.Bootstrapper.MacSshPassword()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@"',
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
success: function (d) {
|
||||
if (d == 'OK') {
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
} else {
|
||||
$ajaxLoading.hide();
|
||||
alert('Unable to update Password: ' + d);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to update Password: ' + textStatus);
|
||||
$ajaxLoading.hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td");
|
||||
|
||||
WriteLiteral(" colspan=\"2\"");
|
||||
|
||||
WriteLiteral(">\r\n <span");
|
||||
|
||||
WriteLiteral(" class=\"smallText\"");
|
||||
|
||||
WriteLiteral("><strong>Instructions:</strong> The above credentials must be\r\n " +
|
||||
" able to connect to the requesting Apple Mac client via <a");
|
||||
|
||||
WriteLiteral(" target=\"_blank\"");
|
||||
|
||||
WriteLiteral(" href=\"http://en.wikipedia.org/wiki/Secure_Shell\"");
|
||||
|
||||
WriteLiteral(">SSH</a>. Enter/Script the following command:</span>\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"code\"");
|
||||
|
||||
WriteLiteral(">\r\n curl <a");
|
||||
|
||||
WriteLiteral(" target=\"_blank\"");
|
||||
|
||||
WriteLiteral(" href=\"http://disco:9292/Services/Client/Unauthenticated/MacSecureEnrol\"");
|
||||
|
||||
WriteLiteral(">http://disco:9292/Services/Client/Unauthenticated/MacSecureEnrol</a>\r\n " +
|
||||
" </div>\r\n <span");
|
||||
|
||||
WriteLiteral(" class=\"smallText\"");
|
||||
|
||||
WriteLiteral(">This url will return a <a");
|
||||
|
||||
WriteLiteral(" target=\"_blank\"");
|
||||
|
||||
WriteLiteral(" href=\"http://json.org/\"");
|
||||
|
||||
WriteLiteral(">JSON</a> response containing basic information about the enrolment.</span><br />" +
|
||||
"\r\n <span");
|
||||
|
||||
WriteLiteral(" class=\"smallMessage\"");
|
||||
|
||||
WriteLiteral(">This command makes use of <a");
|
||||
|
||||
WriteLiteral(" target=\"_blank\"");
|
||||
|
||||
WriteLiteral(" href=\"http://curl.haxx.se/\"");
|
||||
|
||||
WriteLiteral(">cURL</a> (bundled with OSX). Other methods can also trigger a Mac Secure Enrol,\r" +
|
||||
"\n such as an anchor (<span");
|
||||
|
||||
WriteLiteral(" class=\"code\"");
|
||||
|
||||
WriteLiteral("><a></span>) or <span");
|
||||
|
||||
WriteLiteral(" class=\"code\"");
|
||||
|
||||
WriteLiteral("><script></span>\r\n tag embedded on the organisation\'s in" +
|
||||
"tranet.</span>\r\n </td>\r\n </tr>\r\n </table>\r\n</div>\r\n<h2>Live" +
|
||||
" Enrolment Logging</h2>\r\n");
|
||||
|
||||
|
||||
#line 119 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
|
||||
Write(Html.Partial(MVC.Config.Shared.Views.LogEvents, new Disco.Web.Areas.Config.Models.Shared.LogEventsModel()
|
||||
{
|
||||
IsLive = true,
|
||||
TakeFilter = 100,
|
||||
StartFilter = DateTime.Today.AddDays(-1),
|
||||
ModuleFilter = Disco.BI.DeviceBI.EnrolmentLog.Current,
|
||||
ViewPortHeight = 250
|
||||
}));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n<div");
|
||||
|
||||
WriteLiteral(" class=\"actionBar\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 128 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
|
||||
Write(Html.ActionLinkButton("Download Bootstrapper", MVC.Services.Client.Bootstrapper()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 129 "..\..\Areas\Config\Views\Enrolment\Index.cshtml"
|
||||
Write(Html.ActionLinkButton("Enrolment Status", MVC.Config.Enrolment.Status()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n</div>\r\n");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -0,0 +1,370 @@
|
||||
@{
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Enrolment", MVC.Config.Enrolment.Index(), "Status");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-Isotope");
|
||||
}
|
||||
<div id="enrolStatus">
|
||||
<div id="noSessions" data-bind="visible: noSessions">
|
||||
<h2>
|
||||
No enrolment sessions today</h2>
|
||||
</div>
|
||||
<div id="sessions" data-bind="visible: !noSessions(), foreach: {data: sessions, afterRender: sessionRendered, afterAdd: sessionAdded}"
|
||||
style="display: none">
|
||||
<div class="session" data-bind="style: {backgroundImage: deviceModelImageUrl}, click: select">
|
||||
<h3>
|
||||
<span data-bind="text: title"></span><span class="details" data-bind="text: '(' + deviceModelDescription() + ')'">
|
||||
</span>
|
||||
</h3>
|
||||
<p class="sessionStart" data-bind="text: startTime">
|
||||
</p>
|
||||
<p class="sessionStatus" data-bind="text: progressStatus">
|
||||
</p>
|
||||
<div data-bind="visible: !sessionEnded(), progressValue: progressValue" class="sessionProgress">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="dialogSession" data-bind="with: currentSession">
|
||||
<div class="sessionHeader clearfix" data-bind="style: {backgroundImage: deviceModelImageUrl}">
|
||||
<h2>
|
||||
<a href="" target="_blank" data-bind="text: title, attr: {href: deviceUrl}"></a>
|
||||
</h2>
|
||||
<h3 data-bind="text: deviceModelDescription">
|
||||
</h3>
|
||||
<table data-bind="if: sessionDeviceInfo">
|
||||
<tr>
|
||||
<th style="width: 128px">
|
||||
Computer Name:
|
||||
</th>
|
||||
<td data-bind="text: sessionDeviceInfo().Arguments[3]">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 128px">
|
||||
UUID:
|
||||
</th>
|
||||
<td data-bind="text: sessionDeviceInfo().Arguments[2]">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 128px">
|
||||
LAN Mac Address:
|
||||
</th>
|
||||
<td data-bind="text: sessionDeviceInfo().Arguments[4]">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 128px">
|
||||
WLAN Mac Address:
|
||||
</th>
|
||||
<td data-bind="text: sessionDeviceInfo().Arguments[5]">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 128px">
|
||||
Manufacturer/Model:
|
||||
</th>
|
||||
<td data-bind="text: sessionDeviceInfo().Arguments[6] + ' ' + sessionDeviceInfo().Arguments[7]">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="sessionProgress clearfix">
|
||||
<p class="sessionStart" data-bind="text: startTime">
|
||||
</p>
|
||||
<p class="sessionStatus" data-bind="text: progressStatus">
|
||||
</p>
|
||||
<div data-bind="visible: !sessionEnded(), progressValue: progressValue">
|
||||
</div>
|
||||
</div>
|
||||
<div class="sessionInfoContainer clearfix">
|
||||
<div class="sessionInfoMessages">
|
||||
<table class="logEventsViewport">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="icon">
|
||||
|
||||
</th>
|
||||
<th class="message">
|
||||
Message
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
<div class="logEventsViewportContainer">
|
||||
<div class="logEventsViewportNoLogs" data-bind="visible: messages().length == 0"
|
||||
style="display: none">
|
||||
No logs
|
||||
</div>
|
||||
<table class="logEventsViewport" data-bind="visible: messages().length > 0" style="display: none">
|
||||
<tbody data-bind="foreach: messages">
|
||||
<tr>
|
||||
<td class="icon" data-bind="attr: {title: FormattedTimestamp}, css: {information: EventTypeSeverity == 0, warning: EventTypeSeverity == 1, error: EventTypeSeverity == 2}">
|
||||
|
||||
</td>
|
||||
<td class="message" data-bind="text: FormattedMessage, attr: {title: EventTypeName}">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sessionInfoConsole" data-bind="foreach: console">
|
||||
<span data-bind="text: Arguments[1]"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
ko.bindingHandlers.progressValue = {
|
||||
update: function (element, valueAccessor, allBindingsAccessor, viewModel) {
|
||||
var v = ko.utils.unwrapObservable(valueAccessor());
|
||||
var vInt = parseInt(v);
|
||||
if (vInt >= 0) {
|
||||
$element = $(element);
|
||||
if (!$element.is('.ui-progressbar'))
|
||||
$element.progressbar();
|
||||
$(element).progressbar('option', 'value', vInt);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var vm;
|
||||
var host = $('#enrolStatus');
|
||||
var hostSessions = $('#sessions');
|
||||
var hostDialogSessions = $('#dialogSession');
|
||||
//var hostDialogSessionsProgress = $('#dialogSession').find('.sessionProgress');
|
||||
var deviceModels = {};
|
||||
var liveConnection;
|
||||
var deviceBaseUrl = '@(Url.Action(MVC.Device.Show()))/'
|
||||
var deviceModelImageUrl = '@(Url.Action(MVC.API.DeviceModel.Image()))/'
|
||||
var iconWarningUrl = 'url(@(Links.ClientSource.Style.Images.Status.warning32_png))';
|
||||
var iconErrorUrl = 'url(@(Links.ClientSource.Style.Images.Status.fail32_png))';
|
||||
|
||||
function pageViewModel() {
|
||||
var self = this;
|
||||
|
||||
self.noSessions = ko.observable(true);
|
||||
self.sessions = ko.observableArray();
|
||||
self.sessionIndex = {};
|
||||
|
||||
self.isotopeInited = false;
|
||||
|
||||
self.currentSession = ko.observable();
|
||||
|
||||
self.sessionRendered = function (e, d) {
|
||||
if (!d.sessionEnded()) {
|
||||
d.progressbar = $(e).find('.sessionProgress').progressbar();
|
||||
}
|
||||
};
|
||||
self.sessionAdded = function (e, d) {
|
||||
if (self.isotopeInited) {
|
||||
hostSessions.isotope('reloadItems').isotope({ sortBy: 'original-order' });
|
||||
}
|
||||
};
|
||||
}
|
||||
function sessionViewModel(id) {
|
||||
var self = this;
|
||||
|
||||
self.title = ko.observable(id);
|
||||
self.messages = ko.observableArray();
|
||||
self.console = ko.observableArray();
|
||||
self.serialNumber = ko.observable();
|
||||
self.sessionDeviceInfo = ko.observable();
|
||||
self.progressStatus = ko.observable();
|
||||
self.progressValue = ko.observable();
|
||||
self.startTime = ko.observable();
|
||||
self.sessionEnded = ko.observable(false);
|
||||
self.progressbar = null;
|
||||
self.hasError = ko.observable(false);
|
||||
self.hasWarning = ko.observable(false);
|
||||
self.deviceModelId = ko.observable();
|
||||
self.deviceModelDescription = ko.computed(function () {
|
||||
var deviceModelId = self.deviceModelId();
|
||||
var sessionDeviceInfo = self.sessionDeviceInfo();
|
||||
if (deviceModelId) {
|
||||
var dm = deviceModels[deviceModelId];
|
||||
if (dm) {
|
||||
if (dm.Description)
|
||||
return dm.Description;
|
||||
else
|
||||
return dm.Manufacturer + ' ' + dm.Model;
|
||||
}
|
||||
}
|
||||
if (sessionDeviceInfo) {
|
||||
return sessionDeviceInfo.Arguments[6] + ' ' + sessionDeviceInfo.Arguments[7];
|
||||
}
|
||||
});
|
||||
self.deviceUrl = ko.computed(function () {
|
||||
var serialNumber = self.serialNumber();
|
||||
if (serialNumber)
|
||||
return deviceBaseUrl + serialNumber;
|
||||
else
|
||||
return null;
|
||||
});
|
||||
self.deviceModelImageUrl = ko.computed(function () {
|
||||
var deviceModelImage;
|
||||
if (self.deviceModelId())
|
||||
deviceModelImage = 'url(' + deviceModelImageUrl + self.deviceModelId() + ')';
|
||||
else
|
||||
deviceModelImage = 'url(' + deviceModelImageUrl + ')';
|
||||
if (self.hasError())
|
||||
return iconErrorUrl + ', ' + deviceModelImage;
|
||||
else
|
||||
if (self.hasWarning())
|
||||
return iconWarningUrl + ', ' + deviceModelImage;
|
||||
else
|
||||
return 'none, ' + deviceModelImage;
|
||||
});
|
||||
self.select = function (e, d) {
|
||||
vm.currentSession(self);
|
||||
hostDialogSessions.dialog('open');
|
||||
hostDialogSessions.dialog('option', 'title', 'Device Enrolment: ' + self.title());
|
||||
}
|
||||
}
|
||||
|
||||
function parseLog(log) {
|
||||
if (log.ModuleId === 50 && log.Arguments && log.Arguments.length > 0) {
|
||||
// find session
|
||||
var sessionId = log.Arguments[0];
|
||||
var session = vm.sessionIndex[sessionId];
|
||||
if (!session && log.EventTypeId === 10) { // Starting Session (Ignore 'partial' sessions)
|
||||
session = new sessionViewModel(sessionId);
|
||||
vm.sessionIndex[sessionId] = session;
|
||||
vm.sessions.unshift(session);
|
||||
vm.noSessions(false);
|
||||
}
|
||||
if (session) {
|
||||
switch (log.EventTypeId) {
|
||||
case 10: // SessionStarting
|
||||
session.title(log.Arguments[1]);
|
||||
session.startTime(log.FormattedTimestamp.substring(log.FormattedTimestamp.indexOf(' ') + 1));
|
||||
session.messages.unshift(log);
|
||||
break;
|
||||
case 11: // SessionProgress
|
||||
//session.progressbar.progressbar('option', 'value', log.Arguments[1]);
|
||||
session.progressValue(log.Arguments[1]);
|
||||
session.progressStatus(log.Arguments[2]);
|
||||
break;
|
||||
case 12: // SessionDevice
|
||||
session.title(log.Arguments[1]);
|
||||
session.serialNumber(log.Arguments[1]);
|
||||
if (log.Arguments.length >= 3 && log.Arguments[2])
|
||||
session.deviceModelId(log.Arguments[2]);
|
||||
break;
|
||||
break;
|
||||
case 13: // SessionDeviceInfo
|
||||
session.title(log.Arguments[1]);
|
||||
session.serialNumber(log.Arguments[1]);
|
||||
session.sessionDeviceInfo(log);
|
||||
if (log.Arguments.length >= 10 && log.Arguments[9])
|
||||
session.deviceModelId(log.Arguments[9]);
|
||||
break;
|
||||
case 20: // SessionFinished
|
||||
session.sessionEnded(true);
|
||||
if (session.hasError())
|
||||
session.progressStatus('Enrolment Finished with an Error');
|
||||
else
|
||||
if (session.hasWarning())
|
||||
session.progressStatus('Enrolment Finished with a Warning');
|
||||
else
|
||||
session.progressStatus('Enrolment Finished Successfully');
|
||||
session.messages.unshift(log);
|
||||
break;
|
||||
case 21: // SessionDiagnosticInformation
|
||||
session.console.push(log);
|
||||
break;
|
||||
case 22: // SessionWarning
|
||||
session.hasWarning(true);
|
||||
session.messages.unshift(log);
|
||||
break;
|
||||
case 23: // SessionError
|
||||
case 24: // SessionErrorWithInner
|
||||
case 25: // SessionClientError
|
||||
session.hasError(true);
|
||||
session.messages.unshift(log);
|
||||
break;
|
||||
default:
|
||||
session.messages.unshift(log);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function init() {
|
||||
hostDialogSessions.dialog({
|
||||
modal: true,
|
||||
height: 664,
|
||||
width: 900,
|
||||
resizable: false,
|
||||
autoOpen: false,
|
||||
buttons: { 'Close': function () { $(this).dialog('close'); } }
|
||||
});
|
||||
//hostDialogSessionsProgress.progressbar();
|
||||
|
||||
// Create View Model
|
||||
vm = new pageViewModel();
|
||||
$.ajax({
|
||||
url: '@(Url.Action(MVC.API.DeviceModel.Index()))',
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
success: init_loadedDeviceModels,
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to retrieve device models: ' + errorThrown);
|
||||
}
|
||||
});
|
||||
}
|
||||
function init_loadedDeviceModels(models) {
|
||||
for (var i = 0; i < models.length; i++) {
|
||||
var m = models[i];
|
||||
deviceModels[m.Id] = m;
|
||||
}
|
||||
|
||||
// Load Logs
|
||||
var d = new Date();
|
||||
var loadData = {
|
||||
Format: "json",
|
||||
Start: d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate(),
|
||||
End: null,
|
||||
ModuleId: 50,
|
||||
Take: 2000
|
||||
};
|
||||
$.ajax({
|
||||
url: '@(Url.Action(MVC.API.Logging.RetrieveEvents()))',
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
traditional: true,
|
||||
data: loadData,
|
||||
success: init_loadedLogs,
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to retrieve logs: ' + errorThrown);
|
||||
}
|
||||
});
|
||||
}
|
||||
function init_loadedLogs(logs) {
|
||||
logs.reverse();
|
||||
for (var i = 0; i < logs.length; i++) {
|
||||
parseLog(logs[i]);
|
||||
}
|
||||
// Bind
|
||||
ko.applyBindings(vm);
|
||||
|
||||
// Isotope
|
||||
hostSessions.isotope({
|
||||
itemSelector: '.session',
|
||||
layoutMode: 'fitRows'
|
||||
});
|
||||
vm.isotopeInited = true;
|
||||
|
||||
// Init Persistent Connection
|
||||
liveConnection = $.connection('@(Url.Content("~/API/Logging/Notifications"))');
|
||||
liveConnection.received(parseLog);
|
||||
liveConnection.error(function (e) { alert('Live-Log Error: ' + e) });
|
||||
liveConnection.start(function () {
|
||||
liveConnection.send('/addToGroups:@(Disco.BI.DeviceBI.EnrolmentLog.Current.LiveLogGroupName)');
|
||||
});
|
||||
}
|
||||
init();
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,539 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.17929
|
||||
//
|
||||
// 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.Enrolment
|
||||
{
|
||||
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.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/Enrolment/Status.cshtml")]
|
||||
public class Status : System.Web.Mvc.WebViewPage<dynamic>
|
||||
{
|
||||
public Status()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 1 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Enrolment", MVC.Config.Enrolment.Index(), "Status");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-Isotope");
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n<div");
|
||||
|
||||
WriteLiteral(" id=\"enrolStatus\"");
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" id=\"noSessions\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"visible: noSessions\"");
|
||||
|
||||
WriteLiteral(">\r\n <h2>\r\n No enrolment sessions today</h2>\r\n </div>\r\n <d" +
|
||||
"iv");
|
||||
|
||||
WriteLiteral(" id=\"sessions\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"visible: !noSessions(), foreach: {data: sessions, afterRender: sessio" +
|
||||
"nRendered, afterAdd: sessionAdded}\"");
|
||||
|
||||
WriteLiteral("\r\n style=\"display: none\"");
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"session\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"style: {backgroundImage: deviceModelImageUrl}, click: select\"");
|
||||
|
||||
WriteLiteral(">\r\n <h3>\r\n <span");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: title\"");
|
||||
|
||||
WriteLiteral("></span><span");
|
||||
|
||||
WriteLiteral(" class=\"details\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: \'(\' + deviceModelDescription() + \')\'\"");
|
||||
|
||||
WriteLiteral(">\r\n </span>\r\n </h3>\r\n <p");
|
||||
|
||||
WriteLiteral(" class=\"sessionStart\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: startTime\"");
|
||||
|
||||
WriteLiteral(">\r\n </p>\r\n <p");
|
||||
|
||||
WriteLiteral(" class=\"sessionStatus\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: progressStatus\"");
|
||||
|
||||
WriteLiteral(">\r\n </p>\r\n <div");
|
||||
|
||||
WriteLiteral(" data-bind=\"visible: !sessionEnded(), progressValue: progressValue\"");
|
||||
|
||||
WriteLiteral(" class=\"sessionProgress\"");
|
||||
|
||||
WriteLiteral(">\r\n </div>\r\n </div>\r\n </div>\r\n <div");
|
||||
|
||||
WriteLiteral(" id=\"dialogSession\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"with: currentSession\"");
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"sessionHeader clearfix\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"style: {backgroundImage: deviceModelImageUrl}\"");
|
||||
|
||||
WriteLiteral(">\r\n <h2>\r\n <a");
|
||||
|
||||
WriteLiteral(" href=\"\"");
|
||||
|
||||
WriteLiteral(" target=\"_blank\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: title, attr: {href: deviceUrl}\"");
|
||||
|
||||
WriteLiteral("></a>\r\n </h2>\r\n <h3");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: deviceModelDescription\"");
|
||||
|
||||
WriteLiteral(">\r\n </h3>\r\n <table");
|
||||
|
||||
WriteLiteral(" data-bind=\"if: sessionDeviceInfo\"");
|
||||
|
||||
WriteLiteral(">\r\n <tr>\r\n <th");
|
||||
|
||||
WriteLiteral(" style=\"width: 128px\"");
|
||||
|
||||
WriteLiteral(">\r\n Computer Name:\r\n </th>\r\n " +
|
||||
" <td");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: sessionDeviceInfo().Arguments[3]\"");
|
||||
|
||||
WriteLiteral(">\r\n </td>\r\n </tr>\r\n <tr>\r\n " +
|
||||
" <th");
|
||||
|
||||
WriteLiteral(" style=\"width: 128px\"");
|
||||
|
||||
WriteLiteral(">\r\n UUID:\r\n </th>\r\n " +
|
||||
"<td");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: sessionDeviceInfo().Arguments[2]\"");
|
||||
|
||||
WriteLiteral(">\r\n </td>\r\n </tr>\r\n <tr>\r\n " +
|
||||
" <th");
|
||||
|
||||
WriteLiteral(" style=\"width: 128px\"");
|
||||
|
||||
WriteLiteral(">\r\n LAN Mac Address:\r\n </th>\r\n " +
|
||||
" <td");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: sessionDeviceInfo().Arguments[4]\"");
|
||||
|
||||
WriteLiteral(">\r\n </td>\r\n </tr>\r\n <tr>\r\n " +
|
||||
" <th");
|
||||
|
||||
WriteLiteral(" style=\"width: 128px\"");
|
||||
|
||||
WriteLiteral(">\r\n WLAN Mac Address:\r\n </th>\r\n " +
|
||||
" <td");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: sessionDeviceInfo().Arguments[5]\"");
|
||||
|
||||
WriteLiteral(">\r\n </td>\r\n </tr>\r\n <tr>\r\n " +
|
||||
" <th");
|
||||
|
||||
WriteLiteral(" style=\"width: 128px\"");
|
||||
|
||||
WriteLiteral(">\r\n Manufacturer/Model:\r\n </th>\r\n " +
|
||||
" <td");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: sessionDeviceInfo().Arguments[6] + \' \' + sessionDeviceInfo().Ar" +
|
||||
"guments[7]\"");
|
||||
|
||||
WriteLiteral(">\r\n </td>\r\n </tr>\r\n </table>\r\n " +
|
||||
" </div>\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"sessionProgress clearfix\"");
|
||||
|
||||
WriteLiteral(">\r\n <p");
|
||||
|
||||
WriteLiteral(" class=\"sessionStart\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: startTime\"");
|
||||
|
||||
WriteLiteral(">\r\n </p>\r\n <p");
|
||||
|
||||
WriteLiteral(" class=\"sessionStatus\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: progressStatus\"");
|
||||
|
||||
WriteLiteral(">\r\n </p>\r\n <div");
|
||||
|
||||
WriteLiteral(" data-bind=\"visible: !sessionEnded(), progressValue: progressValue\"");
|
||||
|
||||
WriteLiteral(">\r\n </div>\r\n </div>\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"sessionInfoContainer clearfix\"");
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"sessionInfoMessages\"");
|
||||
|
||||
WriteLiteral(">\r\n <table");
|
||||
|
||||
WriteLiteral(" class=\"logEventsViewport\"");
|
||||
|
||||
WriteLiteral(">\r\n <thead>\r\n <tr>\r\n " +
|
||||
" <th");
|
||||
|
||||
WriteLiteral(" class=\"icon\"");
|
||||
|
||||
WriteLiteral(">\r\n \r\n </th>\r\n " +
|
||||
" <th");
|
||||
|
||||
WriteLiteral(" class=\"message\"");
|
||||
|
||||
WriteLiteral(">\r\n Message\r\n </th>\r\n " +
|
||||
" </tr>\r\n </thead>\r\n </tab" +
|
||||
"le>\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"logEventsViewportContainer\"");
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"logEventsViewportNoLogs\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"visible: messages().length == 0\"");
|
||||
|
||||
WriteLiteral("\r\n style=\"display: none\"");
|
||||
|
||||
WriteLiteral(">\r\n No logs\r\n </div>\r\n " +
|
||||
" <table");
|
||||
|
||||
WriteLiteral(" class=\"logEventsViewport\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"visible: messages().length > 0\"");
|
||||
|
||||
WriteLiteral(" style=\"display: none\"");
|
||||
|
||||
WriteLiteral(">\r\n <tbody");
|
||||
|
||||
WriteLiteral(" data-bind=\"foreach: messages\"");
|
||||
|
||||
WriteLiteral(">\r\n <tr>\r\n <td");
|
||||
|
||||
WriteLiteral(" class=\"icon\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"attr: {title: FormattedTimestamp}, css: {information: EventTypeSeveri" +
|
||||
"ty == 0, warning: EventTypeSeverity == 1, error: EventTypeSeverity == 2}\"");
|
||||
|
||||
WriteLiteral(">\r\n \r\n </" +
|
||||
"td>\r\n <td");
|
||||
|
||||
WriteLiteral(" class=\"message\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: FormattedMessage, attr: {title: EventTypeName}\"");
|
||||
|
||||
WriteLiteral(">\r\n </td>\r\n </tr>\r\n " +
|
||||
" </tbody>\r\n </table>\r\n </di" +
|
||||
"v>\r\n </div>\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"sessionInfoConsole\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"foreach: console\"");
|
||||
|
||||
WriteLiteral(">\r\n <span");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: Arguments[1]\"");
|
||||
|
||||
WriteLiteral("></span>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n<script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
ko.bindingHandlers.progressValue = {
|
||||
update: function (element, valueAccessor, allBindingsAccessor, viewModel) {
|
||||
var v = ko.utils.unwrapObservable(valueAccessor());
|
||||
var vInt = parseInt(v);
|
||||
if (vInt >= 0) {
|
||||
$element = $(element);
|
||||
if (!$element.is('.ui-progressbar'))
|
||||
$element.progressbar();
|
||||
$(element).progressbar('option', 'value', vInt);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
$(function () {
|
||||
var vm;
|
||||
var host = $('#enrolStatus');
|
||||
var hostSessions = $('#sessions');
|
||||
var hostDialogSessions = $('#dialogSession');
|
||||
//var hostDialogSessionsProgress = $('#dialogSession').find('.sessionProgress');
|
||||
var deviceModels = {};
|
||||
var liveConnection;
|
||||
var deviceBaseUrl = '");
|
||||
|
||||
|
||||
#line 141 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
|
||||
Write(Url.Action(MVC.Device.Show()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("/\'\r\n var deviceModelImageUrl = \'");
|
||||
|
||||
|
||||
#line 142 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
|
||||
Write(Url.Action(MVC.API.DeviceModel.Image()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("/\'\r\n var iconWarningUrl = \'url(");
|
||||
|
||||
|
||||
#line 143 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
|
||||
Write(Links.ClientSource.Style.Images.Status.warning32_png);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(")\';\r\n var iconErrorUrl = \'url(");
|
||||
|
||||
|
||||
#line 144 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
|
||||
Write(Links.ClientSource.Style.Images.Status.fail32_png);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(")\';\r\n\r\n function pageViewModel() {\r\n var self = this;\r\n\r\n " +
|
||||
" self.noSessions = ko.observable(true);\r\n self.sessions = ko.obs" +
|
||||
"ervableArray();\r\n self.sessionIndex = {};\r\n\r\n self.isotope" +
|
||||
"Inited = false;\r\n\r\n self.currentSession = ko.observable();\r\n\r\n " +
|
||||
" self.sessionRendered = function (e, d) {\r\n if (!d.sessionEnd" +
|
||||
"ed()) {\r\n d.progressbar = $(e).find(\'.sessionProgress\').progr" +
|
||||
"essbar();\r\n }\r\n };\r\n self.sessionAdded = fu" +
|
||||
"nction (e, d) {\r\n if (self.isotopeInited) {\r\n " +
|
||||
"hostSessions.isotope(\'reloadItems\').isotope({ sortBy: \'original-order\' });\r\n " +
|
||||
" }\r\n };\r\n }\r\n function sessionViewModel(id) " +
|
||||
"{\r\n var self = this;\r\n\r\n self.title = ko.observable(id);\r\n" +
|
||||
" self.messages = ko.observableArray();\r\n self.console = ko" +
|
||||
".observableArray();\r\n self.serialNumber = ko.observable();\r\n " +
|
||||
" self.sessionDeviceInfo = ko.observable();\r\n self.progressStatus = " +
|
||||
"ko.observable();\r\n self.progressValue = ko.observable();\r\n " +
|
||||
" self.startTime = ko.observable();\r\n self.sessionEnded = ko.observabl" +
|
||||
"e(false);\r\n self.progressbar = null;\r\n self.hasError = ko." +
|
||||
"observable(false);\r\n self.hasWarning = ko.observable(false);\r\n " +
|
||||
" self.deviceModelId = ko.observable();\r\n self.deviceModelDescript" +
|
||||
"ion = ko.computed(function () {\r\n var deviceModelId = self.device" +
|
||||
"ModelId();\r\n var sessionDeviceInfo = self.sessionDeviceInfo();\r\n " +
|
||||
" if (deviceModelId) {\r\n var dm = deviceModels[d" +
|
||||
"eviceModelId];\r\n if (dm) {\r\n if (dm.De" +
|
||||
"scription)\r\n return dm.Description;\r\n " +
|
||||
" else\r\n return dm.Manufacturer + \' \' + dm.Mode" +
|
||||
"l;\r\n }\r\n }\r\n if (sessionDeviceI" +
|
||||
"nfo) {\r\n return sessionDeviceInfo.Arguments[6] + \' \' + sessio" +
|
||||
"nDeviceInfo.Arguments[7];\r\n }\r\n });\r\n self." +
|
||||
"deviceUrl = ko.computed(function () {\r\n var serialNumber = self.s" +
|
||||
"erialNumber();\r\n if (serialNumber)\r\n return de" +
|
||||
"viceBaseUrl + serialNumber;\r\n else\r\n return nu" +
|
||||
"ll;\r\n });\r\n self.deviceModelImageUrl = ko.computed(functio" +
|
||||
"n () {\r\n var deviceModelImage;\r\n if (self.deviceMo" +
|
||||
"delId())\r\n deviceModelImage = \'url(\' + deviceModelImageUrl + " +
|
||||
"self.deviceModelId() + \')\';\r\n else\r\n deviceMod" +
|
||||
"elImage = \'url(\' + deviceModelImageUrl + \')\';\r\n if (self.hasError" +
|
||||
"())\r\n return iconErrorUrl + \', \' + deviceModelImage;\r\n " +
|
||||
" else\r\n if (self.hasWarning())\r\n " +
|
||||
" return iconWarningUrl + \', \' + deviceModelImage;\r\n else\r\n " +
|
||||
" return \'none, \' + deviceModelImage;\r\n });\r\n " +
|
||||
" self.select = function (e, d) {\r\n vm.currentSession(self" +
|
||||
");\r\n hostDialogSessions.dialog(\'open\');\r\n hostDial" +
|
||||
"ogSessions.dialog(\'option\', \'title\', \'Device Enrolment: \' + self.title());\r\n " +
|
||||
" }\r\n }\r\n\r\n function parseLog(log) {\r\n if (log.Mo" +
|
||||
"duleId === 50 && log.Arguments && log.Arguments.length > 0) {\r\n /" +
|
||||
"/ find session\r\n var sessionId = log.Arguments[0];\r\n " +
|
||||
" var session = vm.sessionIndex[sessionId];\r\n if (!session && lo" +
|
||||
"g.EventTypeId === 10) { // Starting Session (Ignore \'partial\' sessions)\r\n " +
|
||||
" session = new sessionViewModel(sessionId);\r\n vm." +
|
||||
"sessionIndex[sessionId] = session;\r\n vm.sessions.unshift(sess" +
|
||||
"ion);\r\n vm.noSessions(false);\r\n }\r\n " +
|
||||
" if (session) {\r\n switch (log.EventTypeId) {\r\n " +
|
||||
" case 10: // SessionStarting\r\n session.ti" +
|
||||
"tle(log.Arguments[1]);\r\n session.startTime(log.Format" +
|
||||
"tedTimestamp.substring(log.FormattedTimestamp.indexOf(\' \') + 1));\r\n " +
|
||||
" session.messages.unshift(log);\r\n break" +
|
||||
";\r\n case 11: // SessionProgress\r\n " +
|
||||
" //session.progressbar.progressbar(\'option\', \'value\', log.Arguments[1]);\r\n " +
|
||||
" session.progressValue(log.Arguments[1]);\r\n " +
|
||||
" session.progressStatus(log.Arguments[2]);\r\n " +
|
||||
" break;\r\n case 12: // SessionDevice\r\n " +
|
||||
" session.title(log.Arguments[1]);\r\n sessi" +
|
||||
"on.serialNumber(log.Arguments[1]);\r\n if (log.Argument" +
|
||||
"s.length >= 3 && log.Arguments[2])\r\n session.devi" +
|
||||
"ceModelId(log.Arguments[2]);\r\n break;\r\n " +
|
||||
" break;\r\n case 13: // SessionDeviceInfo\r\n " +
|
||||
" session.title(log.Arguments[1]);\r\n " +
|
||||
" session.serialNumber(log.Arguments[1]);\r\n sess" +
|
||||
"ion.sessionDeviceInfo(log);\r\n if (log.Arguments.lengt" +
|
||||
"h >= 10 && log.Arguments[9])\r\n session.deviceMode" +
|
||||
"lId(log.Arguments[9]);\r\n break;\r\n " +
|
||||
" case 20: // SessionFinished\r\n session.sessionEnde" +
|
||||
"d(true);\r\n if (session.hasError())\r\n " +
|
||||
" session.progressStatus(\'Enrolment Finished with an Error\');\r\n " +
|
||||
" else\r\n if (session.hasWar" +
|
||||
"ning())\r\n session.progressStatus(\'Enrolment F" +
|
||||
"inished with a Warning\');\r\n else\r\n " +
|
||||
" session.progressStatus(\'Enrolment Finished Successfully\');\r" +
|
||||
"\n session.messages.unshift(log);\r\n " +
|
||||
" break;\r\n case 21: // SessionDiagnosticInformatio" +
|
||||
"n\r\n session.console.push(log);\r\n " +
|
||||
" break;\r\n case 22: // SessionWarning\r\n " +
|
||||
" session.hasWarning(true);\r\n session.me" +
|
||||
"ssages.unshift(log);\r\n break;\r\n " +
|
||||
" case 23: // SessionError\r\n case 24: // SessionErrorWith" +
|
||||
"Inner\r\n case 25: // SessionClientError\r\n " +
|
||||
" session.hasError(true);\r\n session.messages" +
|
||||
".unshift(log);\r\n break;\r\n defa" +
|
||||
"ult:\r\n session.messages.unshift(log);\r\n " +
|
||||
" }\r\n }\r\n }\r\n }\r\n function init() {\r" +
|
||||
"\n hostDialogSessions.dialog({\r\n modal: true,\r\n " +
|
||||
" height: 664,\r\n width: 900,\r\n resizable: fa" +
|
||||
"lse,\r\n autoOpen: false,\r\n buttons: { \'Close\': func" +
|
||||
"tion () { $(this).dialog(\'close\'); } }\r\n });\r\n //hostDialo" +
|
||||
"gSessionsProgress.progressbar();\r\n\r\n // Create View Model\r\n " +
|
||||
" vm = new pageViewModel();\r\n $.ajax({\r\n url: \'");
|
||||
|
||||
|
||||
#line 309 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
|
||||
Write(Url.Action(MVC.API.DeviceModel.Index()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@"',
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
success: init_loadedDeviceModels,
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to retrieve device models: ' + errorThrown);
|
||||
}
|
||||
});
|
||||
}
|
||||
function init_loadedDeviceModels(models) {
|
||||
for (var i = 0; i < models.length; i++) {
|
||||
var m = models[i];
|
||||
deviceModels[m.Id] = m;
|
||||
}
|
||||
|
||||
// Load Logs
|
||||
var d = new Date();
|
||||
var loadData = {
|
||||
Format: ""json"",
|
||||
Start: d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate(),
|
||||
End: null,
|
||||
ModuleId: 50,
|
||||
Take: 2000
|
||||
};
|
||||
$.ajax({
|
||||
url: '");
|
||||
|
||||
|
||||
#line 334 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
|
||||
Write(Url.Action(MVC.API.Logging.RetrieveEvents()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@"',
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
traditional: true,
|
||||
data: loadData,
|
||||
success: init_loadedLogs,
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to retrieve logs: ' + errorThrown);
|
||||
}
|
||||
});
|
||||
}
|
||||
function init_loadedLogs(logs) {
|
||||
logs.reverse();
|
||||
for (var i = 0; i < logs.length; i++) {
|
||||
parseLog(logs[i]);
|
||||
}
|
||||
// Bind
|
||||
ko.applyBindings(vm);
|
||||
|
||||
// Isotope
|
||||
hostSessions.isotope({
|
||||
itemSelector: '.session',
|
||||
layoutMode: 'fitRows'
|
||||
});
|
||||
vm.isotopeInited = true;
|
||||
|
||||
// Init Persistent Connection
|
||||
liveConnection = $.connection('");
|
||||
|
||||
|
||||
#line 361 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
|
||||
Write(Url.Content("~/API/Logging/Notifications"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\');\r\n liveConnection.received(parseLog);\r\n liveConnection.e" +
|
||||
"rror(function (e) { alert(\'Live-Log Error: \' + e) });\r\n liveConnectio" +
|
||||
"n.start(function () {\r\n liveConnection.send(\'/addToGroups:");
|
||||
|
||||
|
||||
#line 365 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
|
||||
Write(Disco.BI.DeviceBI.EnrolmentLog.Current.LiveLogGroupName);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\');\r\n });\r\n }\r\n init();\r\n });\r\n</script>\r\n");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -0,0 +1,52 @@
|
||||
@model Disco.Web.Areas.Config.Models.Expressions.EditorModel
|
||||
@{
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Expressions");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Disco-ExpressionEditor");
|
||||
}
|
||||
<div id="expressionEditor">
|
||||
<div id="expressionEditorContainer">
|
||||
</div>
|
||||
<div id="expressionEditorExceptionContainer">
|
||||
<h3>
|
||||
Parse Error:</h3>
|
||||
<div id="expressionEditorException">
|
||||
</div>
|
||||
</div>
|
||||
<button id="expressionEditorValidateButton">
|
||||
Validate</button>
|
||||
@if (false)
|
||||
{ <script src="/ClientSource/Scripts/Core/jquery-1.7.1.js" type="text/javascript"></script>}
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var initExpression = '@(Model.Expression)';
|
||||
var hostSrcUrl = '@(Links.ClientSource.Style.ExpressionEditor_htm)';
|
||||
var host = $('<iframe>').attr('src', hostSrcUrl).css({ width: '100%', height: 100, border: 'none' });
|
||||
$('#expressionEditorContainer').append(host);
|
||||
|
||||
var $expressionEditorExceptionContainer = $('#expressionEditorExceptionContainer');
|
||||
var $expressionEditorException = $('#expressionEditorException');
|
||||
|
||||
var editor = new DiscoExpressionEditor(host, '@(Url.Action(MVC.API.Expressions.ValidateExpression()))', initExpression);
|
||||
|
||||
editor.expressionExceptionChanged = function (e) {
|
||||
if (e && !e.ExpressionValid) {
|
||||
$expressionEditorException.text(e.Message);
|
||||
$expressionEditorExceptionContainer.slideDown();
|
||||
} else {
|
||||
$expressionEditorExceptionContainer.slideUp();
|
||||
}
|
||||
};
|
||||
editor.expressionValidated = function (result, e) {
|
||||
if (result)
|
||||
alert('Validation Passed');
|
||||
};
|
||||
|
||||
$('#expressionEditorValidateButton').click(function () {
|
||||
editor.validateExpression();
|
||||
});
|
||||
|
||||
|
||||
editor.hostInit();
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
@@ -0,0 +1,169 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.17929
|
||||
//
|
||||
// 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.Expressions
|
||||
{
|
||||
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.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/Expressions/Editor.cshtml")]
|
||||
public class Editor : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.Expressions.EditorModel>
|
||||
{
|
||||
public Editor()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 2 "..\..\Areas\Config\Views\Expressions\Editor.cshtml"
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Expressions");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Disco-ExpressionEditor");
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n<div");
|
||||
|
||||
WriteLiteral(" id=\"expressionEditor\"");
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" id=\"expressionEditorContainer\"");
|
||||
|
||||
WriteLiteral(">\r\n </div>\r\n <div");
|
||||
|
||||
WriteLiteral(" id=\"expressionEditorExceptionContainer\"");
|
||||
|
||||
WriteLiteral(">\r\n <h3>\r\n Parse Error:</h3>\r\n <div");
|
||||
|
||||
WriteLiteral(" id=\"expressionEditorException\"");
|
||||
|
||||
WriteLiteral(">\r\n </div>\r\n </div>\r\n <button");
|
||||
|
||||
WriteLiteral(" id=\"expressionEditorValidateButton\"");
|
||||
|
||||
WriteLiteral(">\r\n Validate</button>\r\n");
|
||||
|
||||
|
||||
#line 17 "..\..\Areas\Config\Views\Expressions\Editor.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 17 "..\..\Areas\Config\Views\Expressions\Editor.cshtml"
|
||||
if (false)
|
||||
{
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <script");
|
||||
|
||||
WriteLiteral(" src=\"/ClientSource/Scripts/Core/jquery-1.7.1.js\"");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral("></script>");
|
||||
|
||||
|
||||
#line 18 "..\..\Areas\Config\Views\Expressions\Editor.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(">\r\n $(function () {\r\n var initExpression = \'");
|
||||
|
||||
|
||||
#line 21 "..\..\Areas\Config\Views\Expressions\Editor.cshtml"
|
||||
Write(Model.Expression);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\';\r\n var hostSrcUrl = \'");
|
||||
|
||||
|
||||
#line 22 "..\..\Areas\Config\Views\Expressions\Editor.cshtml"
|
||||
Write(Links.ClientSource.Style.ExpressionEditor_htm);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@"';
|
||||
var host = $('<iframe>').attr('src', hostSrcUrl).css({ width: '100%', height: 100, border: 'none' });
|
||||
$('#expressionEditorContainer').append(host);
|
||||
|
||||
var $expressionEditorExceptionContainer = $('#expressionEditorExceptionContainer');
|
||||
var $expressionEditorException = $('#expressionEditorException');
|
||||
|
||||
var editor = new DiscoExpressionEditor(host, '");
|
||||
|
||||
|
||||
#line 29 "..\..\Areas\Config\Views\Expressions\Editor.cshtml"
|
||||
Write(Url.Action(MVC.API.Expressions.ValidateExpression()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@"', initExpression);
|
||||
|
||||
editor.expressionExceptionChanged = function (e) {
|
||||
if (e && !e.ExpressionValid) {
|
||||
$expressionEditorException.text(e.Message);
|
||||
$expressionEditorExceptionContainer.slideDown();
|
||||
} else {
|
||||
$expressionEditorExceptionContainer.slideUp();
|
||||
}
|
||||
};
|
||||
editor.expressionValidated = function (result, e) {
|
||||
if (result)
|
||||
alert('Validation Passed');
|
||||
};
|
||||
|
||||
$('#expressionEditorValidateButton').click(function () {
|
||||
editor.validateExpression();
|
||||
});
|
||||
|
||||
|
||||
editor.hostInit();
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -0,0 +1,164 @@
|
||||
@model Disco.Web.Areas.Config.Models.Logging.IndexModel
|
||||
@using Disco.Services.Logging
|
||||
@{
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Logging");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/jQueryUI-TimePicker");
|
||||
}
|
||||
@using (Html.BeginForm(MVC.API.Logging.RetrieveEvents()))
|
||||
{
|
||||
<div class="form" style="width: 520px;">
|
||||
<h2>
|
||||
Export Logs</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<th style="width: 105px;">
|
||||
Start Filter
|
||||
</th>
|
||||
<td>
|
||||
<input id="filterStart" type="text" name="Start" />
|
||||
<span class="smallMessage">* Optional</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
End Filter
|
||||
</th>
|
||||
<td>
|
||||
<input id="filterEnd" type="text" name="End" />
|
||||
<span class="smallMessage">* Optional</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Limit Filter
|
||||
</th>
|
||||
<td>
|
||||
<select name="Take">
|
||||
<option selected="selected" value="">- All Events -</option>
|
||||
<option value="1000">1,000 Events</option>
|
||||
<option value="500">500 Events</option>
|
||||
<option value="100">100 Events</option>
|
||||
<option value="50">50 Events</option>
|
||||
<option value="10">10 Events</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<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>
|
||||
}
|
||||
</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>
|
||||
<td>
|
||||
@{int uniqueIdSeed = 0;
|
||||
}
|
||||
@foreach (var lm in Model.LogModules)
|
||||
{
|
||||
<div data-logmoduleid="@lm.Key.ModuleId" class="logModuleEventTypes">
|
||||
@CommonHelpers.CheckBoxList("EventTypeIds", lm.Value.ToSelectListItems(), 2, false, uniqueIdSeed)
|
||||
</div>
|
||||
uniqueIdSeed += lm.Value.Count;
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
</th>
|
||||
<td>
|
||||
@Html.Hidden("Format", "CSV")
|
||||
<input type="submit" class="button" value="Download CSV" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<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();
|
||||
var logModuleEventTypeCheckboxes = logModuleEventTypes.find('input[type="checkbox"]');
|
||||
|
||||
moduleId.change(function () {
|
||||
// Unselect All
|
||||
logModuleEventTypes.slideUp();
|
||||
logModuleEventTypeCheckboxes.filter(':checked').attr('checked', false);
|
||||
var selectedModule = moduleId.val();
|
||||
if (selectedModule) {
|
||||
trLogModuleEventTypes.show();
|
||||
var selectedModuleEventTypes = logModuleEventTypes.filter('[data-logmoduleid="' + selectedModule + '"]');
|
||||
if (selectedModuleEventTypes.length > 0) {
|
||||
var selectedModuleEventTypeCheckboxes = selectedModuleEventTypes.find('input[type="checkbox"]');
|
||||
selectedModuleEventTypeCheckboxes.attr('checked', true);
|
||||
trLogModuleEventTypes.show();
|
||||
selectedModuleEventTypes.slideDown();
|
||||
} else {
|
||||
trLogModuleEventTypes.hide();
|
||||
}
|
||||
} else {
|
||||
trLogModuleEventTypes.hide();
|
||||
}
|
||||
});
|
||||
|
||||
$('#eventTypesSelectAll').click(function () {
|
||||
var selectedModule = moduleId.val();
|
||||
if (selectedModule) {
|
||||
var selectedModuleEventTypes = logModuleEventTypes.filter('[data-logmoduleid="' + selectedModule + '"]');
|
||||
if (selectedModuleEventTypes.length > 0) {
|
||||
var selectedModuleEventTypeCheckboxes = selectedModuleEventTypes.find('input[type="checkbox"]');
|
||||
selectedModuleEventTypeCheckboxes.attr('checked', true);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
});
|
||||
$('#eventTypesSelectNone').click(function () {
|
||||
var selectedModule = moduleId.val();
|
||||
if (selectedModule) {
|
||||
var selectedModuleEventTypes = logModuleEventTypes.filter('[data-logmoduleid="' + selectedModule + '"]');
|
||||
if (selectedModuleEventTypes.length > 0) {
|
||||
var selectedModuleEventTypeCheckboxes = selectedModuleEventTypes.find('input[type="checkbox"]');
|
||||
selectedModuleEventTypeCheckboxes.attr('checked', false);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
}
|
||||
<h2>
|
||||
Live Logging</h2>
|
||||
@Html.Partial(MVC.Config.Shared.Views.LogEvents, new Disco.Web.Areas.Config.Models.Shared.LogEventsModel()
|
||||
{
|
||||
IsLive = true,
|
||||
TakeFilter = 100,
|
||||
StartFilter = DateTime.Today.AddDays(-1),
|
||||
ViewPortHeight = 450
|
||||
})
|
||||
@@ -0,0 +1,388 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.17929
|
||||
//
|
||||
// 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.Logging
|
||||
{
|
||||
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.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
|
||||
#line 2 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
using Disco.Services.Logging;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/Logging/Index.cshtml")]
|
||||
public class Index : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.Logging.IndexModel>
|
||||
{
|
||||
public Index()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 3 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Logging");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/jQueryUI-TimePicker");
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
|
||||
#line 7 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
using (Html.BeginForm(MVC.API.Logging.RetrieveEvents()))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"form\"");
|
||||
|
||||
WriteLiteral(" style=\"width: 520px;\"");
|
||||
|
||||
WriteLiteral(">\r\n <h2>\r\n Export Logs</h2>\r\n <table>\r\n <tr>\r" +
|
||||
"\n <th");
|
||||
|
||||
WriteLiteral(" style=\"width: 105px;\"");
|
||||
|
||||
WriteLiteral(">\r\n Start Filter\r\n </th>\r\n <td>\r" +
|
||||
"\n <input");
|
||||
|
||||
WriteLiteral(" id=\"filterStart\"");
|
||||
|
||||
WriteLiteral(" type=\"text\"");
|
||||
|
||||
WriteLiteral(" name=\"Start\"");
|
||||
|
||||
WriteLiteral(" />\r\n <span");
|
||||
|
||||
WriteLiteral(" class=\"smallMessage\"");
|
||||
|
||||
WriteLiteral(">* Optional</span>\r\n </td>\r\n </tr>\r\n <tr>\r\n " +
|
||||
" <th>\r\n End Filter\r\n </th>\r\n " +
|
||||
" <td>\r\n <input");
|
||||
|
||||
WriteLiteral(" id=\"filterEnd\"");
|
||||
|
||||
WriteLiteral(" type=\"text\"");
|
||||
|
||||
WriteLiteral(" name=\"End\"");
|
||||
|
||||
WriteLiteral(" />\r\n <span");
|
||||
|
||||
WriteLiteral(" class=\"smallMessage\"");
|
||||
|
||||
WriteLiteral(">* Optional</span>\r\n </td>\r\n </tr>\r\n <tr>\r\n " +
|
||||
" <th>\r\n Limit Filter\r\n </th>\r\n " +
|
||||
" <td>\r\n <select");
|
||||
|
||||
WriteLiteral(" name=\"Take\"");
|
||||
|
||||
WriteLiteral(">\r\n <option");
|
||||
|
||||
WriteLiteral(" selected=\"selected\"");
|
||||
|
||||
WriteLiteral(" value=\"\"");
|
||||
|
||||
WriteLiteral(">- All Events -</option>\r\n <option");
|
||||
|
||||
WriteLiteral(" value=\"1000\"");
|
||||
|
||||
WriteLiteral(">1,000 Events</option>\r\n <option");
|
||||
|
||||
WriteLiteral(" value=\"500\"");
|
||||
|
||||
WriteLiteral(">500 Events</option>\r\n <option");
|
||||
|
||||
WriteLiteral(" value=\"100\"");
|
||||
|
||||
WriteLiteral(">100 Events</option>\r\n <option");
|
||||
|
||||
WriteLiteral(" value=\"50\"");
|
||||
|
||||
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>\r\n Module " +
|
||||
"Filter\r\n </th>\r\n <td>\r\n <select" +
|
||||
"");
|
||||
|
||||
WriteLiteral(" id=\"moduleId\"");
|
||||
|
||||
WriteLiteral(" name=\"ModuleId\"");
|
||||
|
||||
WriteLiteral(">\r\n <option");
|
||||
|
||||
WriteLiteral(" value=\"\"");
|
||||
|
||||
WriteLiteral(" selected=\"selected\"");
|
||||
|
||||
WriteLiteral(">- All Modules -</option>\r\n");
|
||||
|
||||
|
||||
#line 53 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 53 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
foreach (var lm in Model.LogModules.Keys.OrderBy(lm => lm.ModuleDescription))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <option");
|
||||
|
||||
WriteAttribute("value", Tuple.Create(" value=\"", 2126), Tuple.Create("\"", 2146)
|
||||
|
||||
#line 55 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 2134), Tuple.Create<System.Object, System.Int32>(lm.ModuleId
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 2134), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 55 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
Write(lm.ModuleDescription);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</option> \r\n");
|
||||
|
||||
|
||||
#line 56 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </select>\r\n </td>\r\n </tr>\r\n " +
|
||||
" <tr");
|
||||
|
||||
WriteLiteral(" id=\"trLogModuleEventTypes\"");
|
||||
|
||||
WriteLiteral(" style=\"display: none\"");
|
||||
|
||||
WriteLiteral(">\r\n <th>\r\n Event Type Filter <span");
|
||||
|
||||
WriteLiteral(" style=\"display: block;\"");
|
||||
|
||||
WriteLiteral(" class=\"checkboxBulkSelectContainer\"");
|
||||
|
||||
WriteLiteral(">\r\n Select: <a");
|
||||
|
||||
WriteLiteral(" id=\"eventTypesSelectAll\"");
|
||||
|
||||
WriteLiteral(" href=\"#\"");
|
||||
|
||||
WriteLiteral(">ALL</a> | <a");
|
||||
|
||||
WriteLiteral(" id=\"eventTypesSelectNone\"");
|
||||
|
||||
WriteLiteral("\r\n href=\"#\"");
|
||||
|
||||
WriteLiteral(">NONE</a></span>\r\n </th>\r\n <td>\r\n");
|
||||
|
||||
|
||||
#line 67 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 67 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
int uniqueIdSeed = 0;
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
|
||||
#line 69 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 69 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
foreach (var lm in Model.LogModules)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" data-logmoduleid=\"");
|
||||
|
||||
|
||||
#line 71 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
Write(lm.Key.ModuleId);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(" class=\"logModuleEventTypes\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 72 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
Write(CommonHelpers.CheckBoxList("EventTypeIds", lm.Value.ToSelectListItems(), 2, false, uniqueIdSeed));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </div>\r\n");
|
||||
|
||||
|
||||
#line 74 "..\..\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>\r" +
|
||||
"\n </th>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 82 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
Write(Html.Hidden("Format", "CSV"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n <input");
|
||||
|
||||
WriteLiteral(" type=\"submit\"");
|
||||
|
||||
WriteLiteral(" class=\"button\"");
|
||||
|
||||
WriteLiteral(" value=\"Download CSV\"");
|
||||
|
||||
WriteLiteral(" />\r\n </td>\r\n </tr>\r\n </table>\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\').attr(\'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.attr(\'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.attr(\'checked\', true);\r\n " +
|
||||
" }\r\n }\r\n return false;\r\n " +
|
||||
" });\r\n $(\'#eventTypesSelectNone\').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.attr(\'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 155 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("<h2>\r\n Live Logging</h2>\r\n");
|
||||
|
||||
|
||||
#line 158 "..\..\Areas\Config\Views\Logging\Index.cshtml"
|
||||
Write(Html.Partial(MVC.Config.Shared.Views.LogEvents, new Disco.Web.Areas.Config.Models.Shared.LogEventsModel()
|
||||
{
|
||||
IsLive = true,
|
||||
TakeFilter = 100,
|
||||
StartFilter = DateTime.Today.AddDays(-1),
|
||||
ViewPortHeight = 450
|
||||
}));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -0,0 +1,260 @@
|
||||
@model Disco.Web.Areas.Config.Models.Logging.TaskStatusModel
|
||||
@{
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Logging", MVC.Config.Logging.Index(), "Task Status");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR");
|
||||
}
|
||||
<div style="min-height: 300px;">
|
||||
<div id="scheduledTaskStatus" class="form" style="width: 520px;" data-bind="visible: Initialized">
|
||||
<h2 data-bind="text: TaskName">
|
||||
</h2>
|
||||
<table>
|
||||
<tr data-bind="visible: IsRunning">
|
||||
<th class="process" data-bind="text: CurrentProcess">
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
<tr data-bind="visible: IsRunning">
|
||||
<td class="description" data-bind="text: CurrentDescription">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr data-bind="visible: IsRunning">
|
||||
<td class="progress">
|
||||
<div data-bind="progressValue: Progress">
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr data-bind="visible: FinishedTimestamp">
|
||||
<td class="finishedTimestamp">
|
||||
<h3>
|
||||
Finished: <span data-bind="text: FinishedTimestampFormatted"></span>
|
||||
</h3>
|
||||
</td>
|
||||
</tr>
|
||||
<tr data-bind="visible: FinishedTimestamp() && !TaskExceptionMessage()">
|
||||
<td class="finishedMessage" data-bind="css: {finishedRedirect: FinishedUrl}">
|
||||
<span data-bind="text: FinishedMessage"></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr data-bind="visible: TaskExceptionMessage">
|
||||
<td class="exception">
|
||||
Last Error:
|
||||
<div class="code" data-bind="text: TaskExceptionMessage">
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr data-bind="visible: NextScheduledTimestamp">
|
||||
<td class="nextScheduledTimestamp">
|
||||
Next Scheduled: <span data-bind="text: NextScheduledTimestampFormatted"></span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
ko.bindingHandlers.progressValue = {
|
||||
init: function (element, valueAccessor, allBindingsAccessor, viewModel) {
|
||||
var $element = $(element);
|
||||
if (!$element.is('.ui-progressbar'))
|
||||
$element.progressbar();
|
||||
},
|
||||
update: function (element, valueAccessor, allBindingsAccessor, viewModel) {
|
||||
var v = ko.utils.unwrapObservable(valueAccessor());
|
||||
var vInt = parseInt(v);
|
||||
if (vInt >= 0) {
|
||||
$(element).progressbar('option', 'value', vInt);
|
||||
}
|
||||
}
|
||||
};
|
||||
//* http://webcloud.se/log/JavaScript-and-ISO-8601/
|
||||
Date.prototype.setISO8601 = function (string) {
|
||||
var regexp = "([0-9]{4})(-([0-9]{2})(-([0-9]{2})" +
|
||||
"(T([0-9]{2}):([0-9]{2})(:([0-9]{2})(\.([0-9]+))?)?" +
|
||||
"(Z|(([-+])([0-9]{2}):([0-9]{2})))?)?)?)?";
|
||||
var d = string.match(new RegExp(regexp));
|
||||
|
||||
var offset = 0;
|
||||
var date = new Date(d[1], 0, 1);
|
||||
|
||||
if (d[3]) { date.setMonth(d[3] - 1); }
|
||||
if (d[5]) { date.setDate(d[5]); }
|
||||
if (d[7]) { date.setHours(d[7]); }
|
||||
if (d[8]) { date.setMinutes(d[8]); }
|
||||
if (d[10]) { date.setSeconds(d[10]); }
|
||||
if (d[12]) { date.setMilliseconds(Number("0." + d[12]) * 1000); }
|
||||
if (d[14]) {
|
||||
offset = (Number(d[16]) * 60) + Number(d[17]);
|
||||
offset *= ((d[15] == '-') ? 1 : -1);
|
||||
}
|
||||
|
||||
offset -= date.getTimezoneOffset();
|
||||
time = (Number(date) + (offset * 60 * 1000));
|
||||
this.setTime(Number(time));
|
||||
return this;
|
||||
}
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var sessionId = '@(Model.SessionId)';
|
||||
var sessionStatusUrl = '@(Url.Action(MVC.API.Logging.ScheduledTaskStatus(Model.SessionId)))';
|
||||
|
||||
var view = $('#scheduledTaskStatus');
|
||||
var vm = null;
|
||||
|
||||
var liveConnection = null;
|
||||
|
||||
var statusViewModel = function (sessionId) {
|
||||
var self = this;
|
||||
|
||||
self.Initialized = ko.observable(false);
|
||||
|
||||
self.TimestampParse = function (timestamp) {
|
||||
if (timestamp) {
|
||||
if (timestamp.indexOf("\/Date(") == 0)
|
||||
return new Date(parseInt(timestamp.substr(6)));
|
||||
else
|
||||
return (new Date()).setISO8601(timestamp);
|
||||
}
|
||||
return new Date();
|
||||
}
|
||||
self.TimestampFormat = function (timestamp) {
|
||||
var addZero = function (v) { v = v + ''; if (v.length == 1) v = '0' + v; return v; }
|
||||
return timestamp.getFullYear() + '/' + addZero((1 + timestamp.getMonth())) + '/' + addZero(timestamp.getDate()) + ' ' + addZero(timestamp.getHours()) + ':' + addZero(timestamp.getMinutes()) + ':' + addZero(timestamp.getSeconds());
|
||||
}
|
||||
|
||||
self.SessionId = sessionId;
|
||||
self.TaskName = ko.observable(null);
|
||||
self.StatusVersion = -1;
|
||||
|
||||
self.Progress = ko.observable(0);
|
||||
self.CurrentProcess = ko.observable(null);
|
||||
self.CurrentDescription = ko.observable(null);
|
||||
|
||||
self.IsRunning = ko.observable(null);
|
||||
|
||||
self.TaskExceptionMessage = ko.observable(null);
|
||||
|
||||
self.FinishedTimestamp = ko.observable(null);
|
||||
self.NextScheduledTimestamp = ko.observable(null)
|
||||
|
||||
self.NextScheduledTimestampFormatted = ko.computed(function () {
|
||||
return self.TimestampFormat(self.TimestampParse(self.NextScheduledTimestamp()));
|
||||
});
|
||||
self.FinishedTimestampFormatted = ko.computed(function () {
|
||||
return self.TimestampFormat(self.TimestampParse(self.FinishedTimestamp()));
|
||||
});
|
||||
|
||||
self.FinishedUrl = ko.observable(null);
|
||||
self.FinishedMessage = ko.observable(null);
|
||||
|
||||
self.Finished = function () {
|
||||
if (self.FinishedTimestamp()) {
|
||||
if (self.FinishedUrl() && !self.TaskExceptionMessage()) {
|
||||
if (self.FinishedMessage())
|
||||
window.setTimeout(function () { window.location.href = self.FinishedUrl(); }, 3000);
|
||||
else
|
||||
window.location.href = self.FinishedUrl();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
self.Initialize = function (taskStatus) {
|
||||
self.TaskName(taskStatus.TaskName);
|
||||
self.FinishedUrl(taskStatus.FinishedUrl);
|
||||
|
||||
self.Progress(taskStatus.Progress);
|
||||
self.CurrentProcess(taskStatus.CurrentProcess);
|
||||
self.CurrentDescription(taskStatus.CurrentDescription);
|
||||
|
||||
self.IsRunning(taskStatus.IsRunning);
|
||||
|
||||
self.TaskExceptionMessage(taskStatus.TaskExceptionMessage);
|
||||
|
||||
self.FinishedTimestamp(taskStatus.FinishedTimestamp);
|
||||
self.NextScheduledTimestamp(taskStatus.NextScheduledTimestamp);
|
||||
|
||||
self.FinishedMessage(taskStatus.FinishedMessage);
|
||||
|
||||
self.Initialized(true);
|
||||
|
||||
self.Finished();
|
||||
}
|
||||
self.Update = function (taskStatus) {
|
||||
if (!self.Initialized())
|
||||
return self.Initialize(taskStatus);
|
||||
|
||||
if (taskStatus.StatusVersion < self.StatusVersion)
|
||||
return; // Have Newer Status Update
|
||||
self.StatusVersion = taskStatus.StatusVersion;
|
||||
|
||||
for (var changedPropertyIndex = 0; changedPropertyIndex < taskStatus.ChangedProperties.length; changedPropertyIndex++) {
|
||||
switch (taskStatus.ChangedProperties[changedPropertyIndex]) {
|
||||
case 'Progress':
|
||||
self.Progress(taskStatus.Progress);
|
||||
break;
|
||||
case 'CurrentProcess':
|
||||
self.CurrentProcess(taskStatus.CurrentProcess);
|
||||
break;
|
||||
case 'CurrentDescription':
|
||||
self.CurrentDescription(taskStatus.CurrentDescription);
|
||||
break;
|
||||
case 'IsRunning':
|
||||
self.IsRunning(taskStatus.IsRunning);
|
||||
break;
|
||||
case 'TaskException':
|
||||
self.TaskExceptionMessage(taskStatus.TaskExceptionMessage);
|
||||
break;
|
||||
case 'NextScheduledTimestamp':
|
||||
self.NextScheduledTimestamp(taskStatus.NextScheduledTimestamp);
|
||||
break;
|
||||
case 'FinishedUrl':
|
||||
self.FinishedUrl(taskStatus.FinishedUrl);
|
||||
break;
|
||||
case 'FinishedMessage':
|
||||
self.FinishedMessage(taskStatus.FinishedMessage);
|
||||
break;
|
||||
case 'FinishedTimestamp':
|
||||
self.FinishedTimestamp(taskStatus.FinishedTimestamp);
|
||||
window.setTimeout(self.Finished, 1);
|
||||
break;
|
||||
default:
|
||||
// Ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
vm = new statusViewModel(sessionId);
|
||||
ko.applyBindings(vm, view[0]);
|
||||
|
||||
// Start Live Connection
|
||||
updateWithLive();
|
||||
|
||||
function updateWithAjax(onSuccess) {
|
||||
$.ajax({
|
||||
url: sessionStatusUrl,
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
traditional: true,
|
||||
success: update_Received,
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to load Session: ' + errorThrown);
|
||||
}
|
||||
});
|
||||
}
|
||||
function updateWithLive() {
|
||||
liveConnection = $.connection('@(Url.Content("~/API/Logging/TaskStatusNotifications"))');
|
||||
liveConnection.received(update_Received);
|
||||
liveConnection.error(function (e) { alert('Live-Status Error: ' + e) });
|
||||
liveConnection.start(function () {
|
||||
liveConnection.send('/addToGroups:' + sessionId);
|
||||
updateWithAjax();
|
||||
});
|
||||
}
|
||||
function update_Received(taskStatus) {
|
||||
vm.Update(taskStatus);
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,314 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.17929
|
||||
//
|
||||
// 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.Logging
|
||||
{
|
||||
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.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/Logging/TaskStatus.cshtml")]
|
||||
public class TaskStatus : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.Logging.TaskStatusModel>
|
||||
{
|
||||
public TaskStatus()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 2 "..\..\Areas\Config\Views\Logging\TaskStatus.cshtml"
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Logging", MVC.Config.Logging.Index(), "Task Status");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR");
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n<div");
|
||||
|
||||
WriteLiteral(" style=\"min-height: 300px;\"");
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" id=\"scheduledTaskStatus\"");
|
||||
|
||||
WriteLiteral(" class=\"form\"");
|
||||
|
||||
WriteLiteral(" style=\"width: 520px;\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"visible: Initialized\"");
|
||||
|
||||
WriteLiteral(">\r\n <h2");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: TaskName\"");
|
||||
|
||||
WriteLiteral(">\r\n </h2>\r\n <table>\r\n <tr");
|
||||
|
||||
WriteLiteral(" data-bind=\"visible: IsRunning\"");
|
||||
|
||||
WriteLiteral(">\r\n <th");
|
||||
|
||||
WriteLiteral(" class=\"process\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: CurrentProcess\"");
|
||||
|
||||
WriteLiteral(">\r\n \r\n </th>\r\n </tr>\r\n " +
|
||||
" <tr");
|
||||
|
||||
WriteLiteral(" data-bind=\"visible: IsRunning\"");
|
||||
|
||||
WriteLiteral(">\r\n <td");
|
||||
|
||||
WriteLiteral(" class=\"description\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: CurrentDescription\"");
|
||||
|
||||
WriteLiteral(">\r\n \r\n </td>\r\n </tr>\r\n " +
|
||||
" <tr");
|
||||
|
||||
WriteLiteral(" data-bind=\"visible: IsRunning\"");
|
||||
|
||||
WriteLiteral(">\r\n <td");
|
||||
|
||||
WriteLiteral(" class=\"progress\"");
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" data-bind=\"progressValue: Progress\"");
|
||||
|
||||
WriteLiteral(">\r\n </div>\r\n </td>\r\n </tr>\r\n " +
|
||||
" <tr");
|
||||
|
||||
WriteLiteral(" data-bind=\"visible: FinishedTimestamp\"");
|
||||
|
||||
WriteLiteral(">\r\n <td");
|
||||
|
||||
WriteLiteral(" class=\"finishedTimestamp\"");
|
||||
|
||||
WriteLiteral(">\r\n <h3>\r\n Finished: <span");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: FinishedTimestampFormatted\"");
|
||||
|
||||
WriteLiteral("></span>\r\n </h3>\r\n </td>\r\n </tr>\r\n " +
|
||||
" <tr");
|
||||
|
||||
WriteLiteral(" data-bind=\"visible: FinishedTimestamp() && !TaskExceptionMessage()\"");
|
||||
|
||||
WriteLiteral(">\r\n <td");
|
||||
|
||||
WriteLiteral(" class=\"finishedMessage\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"css: {finishedRedirect: FinishedUrl}\"");
|
||||
|
||||
WriteLiteral(">\r\n <span");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: FinishedMessage\"");
|
||||
|
||||
WriteLiteral("></span>\r\n </td>\r\n </tr>\r\n <tr");
|
||||
|
||||
WriteLiteral(" data-bind=\"visible: TaskExceptionMessage\"");
|
||||
|
||||
WriteLiteral(">\r\n <td");
|
||||
|
||||
WriteLiteral(" class=\"exception\"");
|
||||
|
||||
WriteLiteral(">\r\n Last Error:\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"code\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: TaskExceptionMessage\"");
|
||||
|
||||
WriteLiteral(">\r\n </div>\r\n </td>\r\n </tr>\r\n " +
|
||||
" <tr");
|
||||
|
||||
WriteLiteral(" data-bind=\"visible: NextScheduledTimestamp\"");
|
||||
|
||||
WriteLiteral(">\r\n <td");
|
||||
|
||||
WriteLiteral(" class=\"nextScheduledTimestamp\"");
|
||||
|
||||
WriteLiteral(">\r\n Next Scheduled: <span");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: NextScheduledTimestampFormatted\"");
|
||||
|
||||
WriteLiteral("></span>\r\n </td>\r\n </tr>\r\n </table>\r\n </div>\r" +
|
||||
"\n</div>\r\n<script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(">\r\n ko.bindingHandlers.progressValue = {\r\n init: function (element, val" +
|
||||
"ueAccessor, allBindingsAccessor, viewModel) {\r\n var $element = $(elem" +
|
||||
"ent);\r\n if (!$element.is(\'.ui-progressbar\'))\r\n $elemen" +
|
||||
"t.progressbar();\r\n },\r\n update: function (element, valueAccessor, " +
|
||||
"allBindingsAccessor, viewModel) {\r\n var v = ko.utils.unwrapObservable" +
|
||||
"(valueAccessor());\r\n var vInt = parseInt(v);\r\n if (vInt >=" +
|
||||
" 0) {\r\n $(element).progressbar(\'option\', \'value\', vInt);\r\n " +
|
||||
" }\r\n }\r\n };\r\n //* http://webcloud.se/log/JavaScript-and-ISO-860" +
|
||||
"1/\r\n Date.prototype.setISO8601 = function (string) {\r\n var regexp = \"(" +
|
||||
"[0-9]{4})(-([0-9]{2})(-([0-9]{2})\" +\r\n \"(T([0-9]{2}):([0-9]{2})(:([0-9]{2" +
|
||||
"})(\\.([0-9]+))?)?\" +\r\n \"(Z|(([-+])([0-9]{2}):([0-9]{2})))?)?)?)?\";\r\n " +
|
||||
" var d = string.match(new RegExp(regexp));\r\n\r\n var offset = 0;\r\n " +
|
||||
" var date = new Date(d[1], 0, 1);\r\n\r\n if (d[3]) { date.setMonth(d[3] - 1)" +
|
||||
"; }\r\n if (d[5]) { date.setDate(d[5]); }\r\n if (d[7]) { date.setHour" +
|
||||
"s(d[7]); }\r\n if (d[8]) { date.setMinutes(d[8]); }\r\n if (d[10]) { d" +
|
||||
"ate.setSeconds(d[10]); }\r\n if (d[12]) { date.setMilliseconds(Number(\"0.\" " +
|
||||
"+ d[12]) * 1000); }\r\n if (d[14]) {\r\n offset = (Number(d[16]) *" +
|
||||
" 60) + Number(d[17]);\r\n offset *= ((d[15] == \'-\') ? 1 : -1);\r\n " +
|
||||
" }\r\n\r\n offset -= date.getTimezoneOffset();\r\n time = (Number(date) " +
|
||||
"+ (offset * 60 * 1000));\r\n this.setTime(Number(time));\r\n return th" +
|
||||
"is;\r\n }\r\n</script>\r\n<script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(">\r\n $(function () {\r\n var sessionId = \'");
|
||||
|
||||
|
||||
#line 99 "..\..\Areas\Config\Views\Logging\TaskStatus.cshtml"
|
||||
Write(Model.SessionId);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\';\r\n var sessionStatusUrl = \'");
|
||||
|
||||
|
||||
#line 100 "..\..\Areas\Config\Views\Logging\TaskStatus.cshtml"
|
||||
Write(Url.Action(MVC.API.Logging.ScheduledTaskStatus(Model.SessionId)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\';\r\n\r\n var view = $(\'#scheduledTaskStatus\');\r\n var vm = null;\r\n\r\n " +
|
||||
" var liveConnection = null;\r\n\r\n var statusViewModel = function (sess" +
|
||||
"ionId) {\r\n var self = this;\r\n\r\n self.Initialized = ko.obse" +
|
||||
"rvable(false);\r\n\r\n self.TimestampParse = function (timestamp) {\r\n " +
|
||||
" if (timestamp) {\r\n if (timestamp.indexOf(\"\\/Date(" +
|
||||
"\") == 0)\r\n return new Date(parseInt(timestamp.substr(6)))" +
|
||||
";\r\n else\r\n return (new Date()).setISO8" +
|
||||
"601(timestamp);\r\n }\r\n return new Date();\r\n " +
|
||||
" }\r\n self.TimestampFormat = function (timestamp) {\r\n " +
|
||||
" var addZero = function (v) { v = v + \'\'; if (v.length == 1) v = \'0\' + v; retur" +
|
||||
"n v; }\r\n return timestamp.getFullYear() + \'/\' + addZero((1 + time" +
|
||||
"stamp.getMonth())) + \'/\' + addZero(timestamp.getDate()) + \' \' + addZero(timestam" +
|
||||
"p.getHours()) + \':\' + addZero(timestamp.getMinutes()) + \':\' + addZero(timestamp." +
|
||||
"getSeconds());\r\n }\r\n\r\n self.SessionId = sessionId;\r\n " +
|
||||
" self.TaskName = ko.observable(null);\r\n self.StatusVersion = -1;" +
|
||||
"\r\n\r\n self.Progress = ko.observable(0);\r\n self.CurrentProce" +
|
||||
"ss = ko.observable(null);\r\n self.CurrentDescription = ko.observable(n" +
|
||||
"ull);\r\n\r\n self.IsRunning = ko.observable(null);\r\n\r\n self.T" +
|
||||
"askExceptionMessage = ko.observable(null);\r\n\r\n self.FinishedTimestamp" +
|
||||
" = ko.observable(null);\r\n self.NextScheduledTimestamp = ko.observable" +
|
||||
"(null)\r\n\r\n self.NextScheduledTimestampFormatted = ko.computed(functio" +
|
||||
"n () {\r\n return self.TimestampFormat(self.TimestampParse(self.Nex" +
|
||||
"tScheduledTimestamp()));\r\n });\r\n self.FinishedTimestampFor" +
|
||||
"matted = ko.computed(function () {\r\n return self.TimestampFormat(" +
|
||||
"self.TimestampParse(self.FinishedTimestamp()));\r\n });\r\n\r\n " +
|
||||
"self.FinishedUrl = ko.observable(null);\r\n self.FinishedMessage = ko.o" +
|
||||
"bservable(null);\r\n\r\n self.Finished = function () {\r\n i" +
|
||||
"f (self.FinishedTimestamp()) {\r\n if (self.FinishedUrl() && !s" +
|
||||
"elf.TaskExceptionMessage()) {\r\n if (self.FinishedMessage(" +
|
||||
"))\r\n window.setTimeout(function () { window.location." +
|
||||
"href = self.FinishedUrl(); }, 3000);\r\n else\r\n " +
|
||||
" window.location.href = self.FinishedUrl();\r\n " +
|
||||
"}\r\n }\r\n }\r\n\r\n self.Initialize = function (t" +
|
||||
"askStatus) {\r\n self.TaskName(taskStatus.TaskName);\r\n " +
|
||||
" self.FinishedUrl(taskStatus.FinishedUrl);\r\n\r\n self.Progress(ta" +
|
||||
"skStatus.Progress);\r\n self.CurrentProcess(taskStatus.CurrentProce" +
|
||||
"ss);\r\n self.CurrentDescription(taskStatus.CurrentDescription);\r\n\r" +
|
||||
"\n self.IsRunning(taskStatus.IsRunning);\r\n\r\n self.T" +
|
||||
"askExceptionMessage(taskStatus.TaskExceptionMessage);\r\n\r\n self.Fi" +
|
||||
"nishedTimestamp(taskStatus.FinishedTimestamp);\r\n self.NextSchedul" +
|
||||
"edTimestamp(taskStatus.NextScheduledTimestamp);\r\n\r\n self.Finished" +
|
||||
"Message(taskStatus.FinishedMessage);\r\n\r\n self.Initialized(true);\r" +
|
||||
"\n\r\n self.Finished();\r\n }\r\n self.Update = fu" +
|
||||
"nction (taskStatus) {\r\n if (!self.Initialized())\r\n " +
|
||||
" return self.Initialize(taskStatus);\r\n\r\n if (taskStatus.Statu" +
|
||||
"sVersion < self.StatusVersion)\r\n return; // Have Newer Status" +
|
||||
" Update\r\n self.StatusVersion = taskStatus.StatusVersion;\r\n\r\n " +
|
||||
" for (var changedPropertyIndex = 0; changedPropertyIndex < taskStatus." +
|
||||
"ChangedProperties.length; changedPropertyIndex++) {\r\n switch " +
|
||||
"(taskStatus.ChangedProperties[changedPropertyIndex]) {\r\n " +
|
||||
"case \'Progress\':\r\n self.Progress(taskStatus.Progress)" +
|
||||
";\r\n break;\r\n case \'CurrentProc" +
|
||||
"ess\':\r\n self.CurrentProcess(taskStatus.CurrentProcess" +
|
||||
");\r\n break;\r\n case \'CurrentDes" +
|
||||
"cription\':\r\n self.CurrentDescription(taskStatus.Curre" +
|
||||
"ntDescription);\r\n break;\r\n cas" +
|
||||
"e \'IsRunning\':\r\n self.IsRunning(taskStatus.IsRunning)" +
|
||||
";\r\n break;\r\n case \'TaskExcepti" +
|
||||
"on\':\r\n self.TaskExceptionMessage(taskStatus.TaskExcep" +
|
||||
"tionMessage);\r\n break;\r\n case " +
|
||||
"\'NextScheduledTimestamp\':\r\n self.NextScheduledTimesta" +
|
||||
"mp(taskStatus.NextScheduledTimestamp);\r\n break;\r\n " +
|
||||
" case \'FinishedUrl\':\r\n self.Finish" +
|
||||
"edUrl(taskStatus.FinishedUrl);\r\n break;\r\n " +
|
||||
" case \'FinishedMessage\':\r\n self.FinishedMe" +
|
||||
"ssage(taskStatus.FinishedMessage);\r\n break;\r\n " +
|
||||
" case \'FinishedTimestamp\':\r\n self.Fini" +
|
||||
"shedTimestamp(taskStatus.FinishedTimestamp);\r\n window" +
|
||||
".setTimeout(self.Finished, 1);\r\n break;\r\n " +
|
||||
" default:\r\n // Ignore\r\n " +
|
||||
" }\r\n }\r\n }\r\n }\r\n\r\n vm = new statusViewMo" +
|
||||
"del(sessionId);\r\n ko.applyBindings(vm, view[0]);\r\n\r\n // Start Live" +
|
||||
" Connection\r\n updateWithLive();\r\n\r\n function updateWithAjax(onSucc" +
|
||||
"ess) {\r\n $.ajax({\r\n url: sessionStatusUrl,\r\n " +
|
||||
" dataType: \'json\',\r\n type: \'POST\',\r\n traditio" +
|
||||
"nal: true,\r\n success: update_Received,\r\n error: fu" +
|
||||
"nction (jqXHR, textStatus, errorThrown) {\r\n alert(\'Unable to " +
|
||||
"load Session: \' + errorThrown);\r\n }\r\n });\r\n }\r\n" +
|
||||
" function updateWithLive() {\r\n liveConnection = $.connection(\'" +
|
||||
"");
|
||||
|
||||
|
||||
#line 247 "..\..\Areas\Config\Views\Logging\TaskStatus.cshtml"
|
||||
Write(Url.Content("~/API/Logging/TaskStatusNotifications"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@"');
|
||||
liveConnection.received(update_Received);
|
||||
liveConnection.error(function (e) { alert('Live-Status Error: ' + e) });
|
||||
liveConnection.start(function () {
|
||||
liveConnection.send('/addToGroups:' + sessionId);
|
||||
updateWithAjax();
|
||||
});
|
||||
}
|
||||
function update_Received(taskStatus) {
|
||||
vm.Update(taskStatus);
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -0,0 +1,371 @@
|
||||
@model Disco.Web.Areas.Config.Models.Organisation.IndexModel
|
||||
@{
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Organisation Details");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Disco-AjaxHelperIcons");
|
||||
}
|
||||
<div class="form" style="width: 700px">
|
||||
<h2>Details</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<th style="width: 160px">Name:
|
||||
</th>
|
||||
<td>
|
||||
@Html.EditorFor(m => m.OrganisationName)
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var field = $('#OrganisationName');
|
||||
document.DiscoFunctions.PropertyChangeHelper(
|
||||
field,
|
||||
'Unknown',
|
||||
'@(Url.Action(MVC.API.System.UpdateOrganisationName()))',
|
||||
'OrganisationName'
|
||||
);
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 160px">Logo:
|
||||
<br />
|
||||
<br />
|
||||
<a id="buttonUpdateOrganisationLogo" href="#" class="button">Update</a>
|
||||
</th>
|
||||
<td>
|
||||
<div style="text-align: center;">
|
||||
<img style="height: 256px; width: 256px;" alt="Organisation Logo" src="@(Url.OrganisationLogoUrl())" />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 160px">Multi-Site Mode:
|
||||
</th>
|
||||
<td>
|
||||
@Html.EditorFor(m => m.MultiSiteMode) @Html.LabelFor(m => m.MultiSiteMode)
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<div id="messageMultiSiteMode" style="display: none; padding: 0.7em 0.7em; margin-top: 20px;" class="ui-state-highlight ui-corner-all">
|
||||
<span style="margin-right: 0.3em; float: left;" class="ui-icon ui-icon-info"></span>
|
||||
Multi-Site mode is recommended where multiple addresses are configured.
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var field = $('#MultiSiteMode');
|
||||
document.DiscoFunctions.PropertyChangeHelper(
|
||||
field,
|
||||
null,
|
||||
'@(Url.Action(MVC.API.System.UpdateMultiSiteMode()))',
|
||||
'MultiSiteMode'
|
||||
);
|
||||
|
||||
var $orgAddresses = $('#organisationAddresses');
|
||||
if ($orgAddresses.length > 0 && $orgAddresses.find('tr').length > 2)
|
||||
$('#messageMultiSiteMode').show();
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 160px">Addresses:
|
||||
<br />
|
||||
<br />
|
||||
<a href="#" id="createAddress" class="button">Create</a>
|
||||
</th>
|
||||
<td>
|
||||
@if (Model.OrganisationAddresses.Count > 0)
|
||||
{
|
||||
<table id="organisationAddresses">
|
||||
<tr>
|
||||
<th>Name
|
||||
</th>
|
||||
<th>Address
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
@foreach (var item in Model.OrganisationAddresses)
|
||||
{
|
||||
<tr data-addressid="@item.Id">
|
||||
<td>
|
||||
<span class="name">@Html.DisplayFor(modelItem => item.Name)</span> (<span class="shortName">@Html.DisplayFor(modelItem => item.ShortName)</span>)
|
||||
</td>
|
||||
<td>
|
||||
<span class="address">@Html.DisplayFor(modelItem => item.Address)</span><br />
|
||||
<span class="suburb">@Html.DisplayFor(modelItem => item.Suburb)</span> <span class="postcode">@Html.DisplayFor(modelItem => item.Postcode)</span><br />
|
||||
<span class="state">@Html.DisplayFor(modelItem => item.State)</span> <span class="country">@Html.DisplayFor(modelItem => item.Country)</span><br />
|
||||
<span class="smallMessage">Phone:</span> <span class="phoneNumber">@Html.DisplayFor(modelItem => item.PhoneNumber)</span><br />
|
||||
<span class="smallMessage">Fax:</span> <span class="faxNumber">@Html.DisplayFor(modelItem => item.FaxNumber)</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="edit" title="Edit Address"></span><span class="delete" title="Delete Address"></span>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="smallMessage">No Addresses Stored</span>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="dialogUpdateOrganisationLogo" title="Update Organisation Logo">
|
||||
@using (Html.BeginForm(MVC.API.System.OrganisationLogo(true, null, null), FormMethod.Post, new { enctype = "multipart/form-data" }))
|
||||
{
|
||||
<h3>Update Action</h3>
|
||||
<div style="margin-top: 10px; padding-bottom: 5px;">
|
||||
<input id="updateOrganisationLogoResetLogo" type="radio" name="ResetLogo" value="true"
|
||||
checked="checked" /><label for="updateOrganisationLogoResetLogo">Remove Logo</label>
|
||||
</div>
|
||||
<div style="margin-top: 5px; border-top: 1px dashed #aaa; padding-top: 5px;">
|
||||
<input id="updateOrganisationLogoUploadLogo" type="radio" name="ResetLogo" value="false" /><label
|
||||
for="updateOrganisationLogoUploadLogo">Upload Logo</label>
|
||||
<div id="updateOrganisationLogoUploadLogoContainer" style="display: none; padding-left: 10px;">
|
||||
<input id="updateOrganisationLogoUploadLogoImage" type="file" name="Image" />
|
||||
<span id="updateOrganisationLogoUploadLogoImageRequired" class="field-validation-valid field-validation-error">* Required</span>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var button = $('#buttonUpdateOrganisationLogo');
|
||||
var buttonDialog = $('#dialogUpdateOrganisationLogo');
|
||||
button.click(function () {
|
||||
buttonDialog.dialog('open');
|
||||
return false;
|
||||
});
|
||||
buttonDialog.find('input[type="radio"]').click(function () {
|
||||
if ($('#updateOrganisationLogoUploadLogo').is(':checked')) {
|
||||
$('#updateOrganisationLogoUploadLogoImage').removeAttr('disabled');
|
||||
$('#updateOrganisationLogoUploadLogoContainer').slideDown();
|
||||
}
|
||||
else {
|
||||
$('#updateOrganisationLogoUploadLogoContainer').slideUp();
|
||||
$('#updateOrganisationLogoUploadLogoImage').attr('disabled', 'disabled');
|
||||
}
|
||||
});
|
||||
buttonDialog.dialog({
|
||||
resizable: false,
|
||||
height: 200,
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
"Save": function () {
|
||||
var $this = $(this);
|
||||
|
||||
var $image = $('#updateOrganisationLogoUploadLogoImage');
|
||||
if ($('#updateOrganisationLogoUploadLogo').is(':checked') && $image.val() == '') {
|
||||
$image.addClass('input-validation-error');
|
||||
$('#updateOrganisationLogoUploadLogoImageRequired').removeClass('field-validation-valid');
|
||||
} else {
|
||||
$image.removeClass('input-validation-error');
|
||||
$('#updateOrganisationLogoUploadLogoImageRequired').addClass('field-validation-valid');
|
||||
$this.dialog("disable");
|
||||
$this.dialog("option", "buttons", null);
|
||||
$this.find('form').submit();
|
||||
}
|
||||
},
|
||||
Cancel: function () {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<div id="dialogConfirmRemove" title="Delete this Component?">
|
||||
<p>
|
||||
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
|
||||
This item will be permanently deleted and cannot be recovered. Are you sure?
|
||||
</p>
|
||||
</div>
|
||||
<div id="dialogEdit" title="Edit/Create Address">
|
||||
<table>
|
||||
<tr>
|
||||
<td>Short Name
|
||||
</td>
|
||||
<td>
|
||||
<input id="editShortName" type="text" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Name
|
||||
</td>
|
||||
<td>
|
||||
<input id="editName" type="text" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Address
|
||||
</td>
|
||||
<td>
|
||||
<input id="editAddress" type="text" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Suburb
|
||||
</td>
|
||||
<td>
|
||||
<input id="editSuburb" type="text" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Postcode
|
||||
</td>
|
||||
<td>
|
||||
<input id="editPostcode" type="text" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>State
|
||||
</td>
|
||||
<td>
|
||||
<input id="editState" type="text" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Country
|
||||
</td>
|
||||
<td>
|
||||
<input id="editCountry" type="text" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Phone Number
|
||||
</td>
|
||||
<td>
|
||||
<input id="editPhoneNumber" type="text" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Fax Number
|
||||
</td>
|
||||
<td>
|
||||
<input id="editFaxNumber" type="text" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$("#dialogConfirmRemove").dialog({
|
||||
resizable: false,
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
"Delete": function () {
|
||||
return null;
|
||||
},
|
||||
Cancel: function () {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#organisationAddresses').find('span.delete').click(function () {
|
||||
var componentRow = $(this).closest('tr');
|
||||
var id = componentRow.attr('data-addressid');
|
||||
if (id) {
|
||||
var dialog = $("#dialogConfirmRemove");
|
||||
var buttons = dialog.dialog("option", "buttons");
|
||||
buttons['Delete'] = function () { $(this).dialog("disable"); window.location.href = '@(Url.Action(MVC.API.System.DeleteOrganisationAddress()))' + '?redirect=true&id=' + id; };
|
||||
var buttons = dialog.dialog("option", "buttons", buttons);
|
||||
dialog.dialog('open');
|
||||
}
|
||||
});
|
||||
|
||||
var editAddress = function (element) {
|
||||
var id = '', shortName = '', name = '', address = '', suburb = '', postcode = '', state = '', country = '', phoneNumber = '', faxNumber = '';
|
||||
var dialog = $('#dialogEdit');
|
||||
if (element) {
|
||||
id = element.attr('data-addressid');
|
||||
shortName = element.find('.shortName').text();
|
||||
name = element.find('.name').text();
|
||||
address = element.find('.address').text();
|
||||
suburb = element.find('.suburb').text();
|
||||
postcode = element.find('.postcode').text();
|
||||
state = element.find('.state').text();
|
||||
country = element.find('.country').text();
|
||||
phoneNumber = element.find('.phoneNumber').text();
|
||||
faxNumber = element.find('.faxNumber').text();
|
||||
dialog.attr('data-addressid', id);
|
||||
dialog.dialog('option', 'title', 'Edit Address: ' + name);
|
||||
} else {
|
||||
dialog.attr('data-addressid', null);
|
||||
dialog.dialog('option', 'title', 'Create Address');
|
||||
}
|
||||
|
||||
$('#editShortName').val(shortName);
|
||||
$('#editName').val(name);
|
||||
$('#editAddress').val(address);
|
||||
$('#editSuburb').val(suburb);
|
||||
$('#editPostcode').val(postcode);
|
||||
$('#editState').val(state);
|
||||
$('#editCountry').val(country);
|
||||
$('#editPhoneNumber').val(phoneNumber);
|
||||
$('#editFaxNumber').val(faxNumber);
|
||||
dialog.dialog('open');
|
||||
}
|
||||
|
||||
$('#organisationAddresses').find('span.edit').click(function () {
|
||||
var componentRow = $(this).closest('tr');
|
||||
editAddress(componentRow);
|
||||
});
|
||||
|
||||
$('#createAddress').click(function () {
|
||||
editAddress();
|
||||
return false;
|
||||
});
|
||||
|
||||
var submitAddress = function () {
|
||||
var dialog = $('#dialogEdit');
|
||||
var data = {
|
||||
Id: dialog.attr('data-addressid'),
|
||||
ShortName: $('#editShortName').val(),
|
||||
Name: $('#editName').val(),
|
||||
Address: $('#editAddress').val(),
|
||||
Suburb: $('#editSuburb').val(),
|
||||
Postcode: $('#editPostcode').val(),
|
||||
State: $('#editState').val(),
|
||||
Country: $('#editCountry').val(),
|
||||
PhoneNumber: $('#editPhoneNumber').val(),
|
||||
FaxNumber: $('#editFaxNumber').val()
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
url: '@(Url.Action(MVC.API.System.UpdateOrganisationAddress()))',
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
type: 'post',
|
||||
success: function (d) {
|
||||
if (d == 'OK') {
|
||||
window.location.href = '@(Url.Action(MVC.Config.Organisation.Index()))';
|
||||
} else {
|
||||
alert('Unable to update address:\n' + d);
|
||||
dialog.dialog('enable');
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to update address:\n' + textStatus);
|
||||
dialog.dialog('enable');
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
$("#dialogEdit").dialog({
|
||||
resizable: false,
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
width: 350,
|
||||
buttons: {
|
||||
"Save": function () {
|
||||
submitAddress();
|
||||
},
|
||||
Cancel: function () {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,782 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.17929
|
||||
//
|
||||
// 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.Organisation
|
||||
{
|
||||
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.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/Organisation/Index.cshtml")]
|
||||
public class Index : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.Organisation.IndexModel>
|
||||
{
|
||||
public Index()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 2 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Organisation Details");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Disco-AjaxHelperIcons");
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n<div");
|
||||
|
||||
WriteLiteral(" class=\"form\"");
|
||||
|
||||
WriteLiteral(" style=\"width: 700px\"");
|
||||
|
||||
WriteLiteral(">\r\n <h2>Details</h2>\r\n <table>\r\n <tr>\r\n <th");
|
||||
|
||||
WriteLiteral(" style=\"width: 160px\"");
|
||||
|
||||
WriteLiteral(">Name:\r\n </th>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 14 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
|
||||
Write(Html.EditorFor(m => m.OrganisationName));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 15 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
|
||||
Write(AjaxHelpers.AjaxLoader());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
$(function () {
|
||||
var field = $('#OrganisationName');
|
||||
document.DiscoFunctions.PropertyChangeHelper(
|
||||
field,
|
||||
'Unknown',
|
||||
'");
|
||||
|
||||
|
||||
#line 22 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
|
||||
Write(Url.Action(MVC.API.System.UpdateOrganisationName()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\',\r\n \'OrganisationName\'\r\n );\r\n " +
|
||||
" });\r\n </script>\r\n </td>\r\n </tr>\r" +
|
||||
"\n <tr>\r\n <th");
|
||||
|
||||
WriteLiteral(" style=\"width: 160px\"");
|
||||
|
||||
WriteLiteral(">Logo:\r\n <br />\r\n <br />\r\n <a");
|
||||
|
||||
WriteLiteral(" id=\"buttonUpdateOrganisationLogo\"");
|
||||
|
||||
WriteLiteral(" href=\"#\"");
|
||||
|
||||
WriteLiteral(" class=\"button\"");
|
||||
|
||||
WriteLiteral(">Update</a>\r\n </th>\r\n <td>\r\n <div");
|
||||
|
||||
WriteLiteral(" style=\"text-align: center;\"");
|
||||
|
||||
WriteLiteral(">\r\n <img");
|
||||
|
||||
WriteLiteral(" style=\"height: 256px; width: 256px;\"");
|
||||
|
||||
WriteLiteral(" alt=\"Organisation Logo\"");
|
||||
|
||||
WriteAttribute("src", Tuple.Create(" src=\"", 1500), Tuple.Create("\"", 1534)
|
||||
|
||||
#line 37 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1506), Tuple.Create<System.Object, System.Int32>(Url.OrganisationLogoUrl()
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 1506), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" />\r\n </div>\r\n </td>\r\n </tr>\r\n <tr>\r\n " +
|
||||
" <th");
|
||||
|
||||
WriteLiteral(" style=\"width: 160px\"");
|
||||
|
||||
WriteLiteral(">Multi-Site Mode:\r\n </th>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 45 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
|
||||
Write(Html.EditorFor(m => m.MultiSiteMode));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 45 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
|
||||
Write(Html.LabelFor(m => m.MultiSiteMode));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 46 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
|
||||
Write(AjaxHelpers.AjaxLoader());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n <div");
|
||||
|
||||
WriteLiteral(" id=\"messageMultiSiteMode\"");
|
||||
|
||||
WriteLiteral(" style=\"display: none; padding: 0.7em 0.7em; margin-top: 20px;\"");
|
||||
|
||||
WriteLiteral(" class=\"ui-state-highlight ui-corner-all\"");
|
||||
|
||||
WriteLiteral(">\r\n <span");
|
||||
|
||||
WriteLiteral(" style=\"margin-right: 0.3em; float: left;\"");
|
||||
|
||||
WriteLiteral(" class=\"ui-icon ui-icon-info\"");
|
||||
|
||||
WriteLiteral("></span>\r\n Multi-Site mode is recommended where multiple addre" +
|
||||
"sses are configured.\r\n </div>\r\n <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
$(function () {
|
||||
var field = $('#MultiSiteMode');
|
||||
document.DiscoFunctions.PropertyChangeHelper(
|
||||
field,
|
||||
null,
|
||||
'");
|
||||
|
||||
|
||||
#line 57 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
|
||||
Write(Url.Action(MVC.API.System.UpdateMultiSiteMode()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@"',
|
||||
'MultiSiteMode'
|
||||
);
|
||||
|
||||
var $orgAddresses = $('#organisationAddresses');
|
||||
if ($orgAddresses.length > 0 && $orgAddresses.find('tr').length > 2)
|
||||
$('#messageMultiSiteMode').show();
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th");
|
||||
|
||||
WriteLiteral(" style=\"width: 160px\"");
|
||||
|
||||
WriteLiteral(">Addresses:\r\n <br />\r\n <br />\r\n <a");
|
||||
|
||||
WriteLiteral(" href=\"#\"");
|
||||
|
||||
WriteLiteral(" id=\"createAddress\"");
|
||||
|
||||
WriteLiteral(" class=\"button\"");
|
||||
|
||||
WriteLiteral(">Create</a>\r\n </th>\r\n <td>\r\n");
|
||||
|
||||
|
||||
#line 75 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 75 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
|
||||
if (Model.OrganisationAddresses.Count > 0)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <table");
|
||||
|
||||
WriteLiteral(" id=\"organisationAddresses\"");
|
||||
|
||||
WriteLiteral(">\r\n <tr>\r\n <th>Name\r\n " +
|
||||
" </th>\r\n <th>Address\r\n " +
|
||||
" </th>\r\n <th></th>\r\n " +
|
||||
" </tr>\r\n");
|
||||
|
||||
|
||||
#line 85 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 85 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
|
||||
foreach (var item in Model.OrganisationAddresses)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <tr");
|
||||
|
||||
WriteLiteral(" data-addressid=\"");
|
||||
|
||||
|
||||
#line 87 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
|
||||
Write(item.Id);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(">\r\n <td>\r\n <spa" +
|
||||
"n");
|
||||
|
||||
WriteLiteral(" class=\"name\"");
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 89 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
|
||||
Write(Html.DisplayFor(modelItem => item.Name));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</span> (<span");
|
||||
|
||||
WriteLiteral(" class=\"shortName\"");
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 89 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
|
||||
Write(Html.DisplayFor(modelItem => item.ShortName));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</span>)\r\n </td>\r\n " +
|
||||
"<td>\r\n <span");
|
||||
|
||||
WriteLiteral(" class=\"address\"");
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 92 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
|
||||
Write(Html.DisplayFor(modelItem => item.Address));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</span><br />\r\n <span");
|
||||
|
||||
WriteLiteral(" class=\"suburb\"");
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 93 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
|
||||
Write(Html.DisplayFor(modelItem => item.Suburb));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</span> <span");
|
||||
|
||||
WriteLiteral(" class=\"postcode\"");
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 93 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
|
||||
Write(Html.DisplayFor(modelItem => item.Postcode));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</span><br />\r\n <span");
|
||||
|
||||
WriteLiteral(" class=\"state\"");
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 94 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
|
||||
Write(Html.DisplayFor(modelItem => item.State));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</span> <span");
|
||||
|
||||
WriteLiteral(" class=\"country\"");
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 94 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
|
||||
Write(Html.DisplayFor(modelItem => item.Country));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</span><br />\r\n <span");
|
||||
|
||||
WriteLiteral(" class=\"smallMessage\"");
|
||||
|
||||
WriteLiteral(">Phone:</span> <span");
|
||||
|
||||
WriteLiteral(" class=\"phoneNumber\"");
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 95 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
|
||||
Write(Html.DisplayFor(modelItem => item.PhoneNumber));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</span><br />\r\n <span");
|
||||
|
||||
WriteLiteral(" class=\"smallMessage\"");
|
||||
|
||||
WriteLiteral(">Fax:</span> <span");
|
||||
|
||||
WriteLiteral(" class=\"faxNumber\"");
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 96 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
|
||||
Write(Html.DisplayFor(modelItem => item.FaxNumber));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</span>\r\n </td>\r\n <" +
|
||||
"td>\r\n <span");
|
||||
|
||||
WriteLiteral(" class=\"edit\"");
|
||||
|
||||
WriteLiteral(" title=\"Edit Address\"");
|
||||
|
||||
WriteLiteral("></span><span");
|
||||
|
||||
WriteLiteral(" class=\"delete\"");
|
||||
|
||||
WriteLiteral(" title=\"Delete Address\"");
|
||||
|
||||
WriteLiteral("></span>\r\n </td>\r\n </tr" +
|
||||
">\r\n");
|
||||
|
||||
|
||||
#line 102 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </table>\r\n");
|
||||
|
||||
|
||||
#line 104 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <span");
|
||||
|
||||
WriteLiteral(" class=\"smallMessage\"");
|
||||
|
||||
WriteLiteral(">No Addresses Stored</span>\r\n");
|
||||
|
||||
|
||||
#line 108 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </td>\r\n </tr>\r\n </table>\r\n</div>\r\n<div");
|
||||
|
||||
WriteLiteral(" id=\"dialogUpdateOrganisationLogo\"");
|
||||
|
||||
WriteLiteral(" title=\"Update Organisation Logo\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 114 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 114 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
|
||||
using (Html.BeginForm(MVC.API.System.OrganisationLogo(true, null, null), FormMethod.Post, new { enctype = "multipart/form-data" }))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <h3>Update Action</h3>\r\n");
|
||||
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" style=\"margin-top: 10px; padding-bottom: 5px;\"");
|
||||
|
||||
WriteLiteral(">\r\n <input");
|
||||
|
||||
WriteLiteral(" id=\"updateOrganisationLogoResetLogo\"");
|
||||
|
||||
WriteLiteral(" type=\"radio\"");
|
||||
|
||||
WriteLiteral(" name=\"ResetLogo\"");
|
||||
|
||||
WriteLiteral(" value=\"true\"");
|
||||
|
||||
WriteLiteral("\r\n checked=\"checked\"");
|
||||
|
||||
WriteLiteral(" /><label");
|
||||
|
||||
WriteLiteral(" for=\"updateOrganisationLogoResetLogo\"");
|
||||
|
||||
WriteLiteral(">Remove Logo</label>\r\n </div>\r\n");
|
||||
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" style=\"margin-top: 5px; border-top: 1px dashed #aaa; padding-top: 5px;\"");
|
||||
|
||||
WriteLiteral(">\r\n <input");
|
||||
|
||||
WriteLiteral(" id=\"updateOrganisationLogoUploadLogo\"");
|
||||
|
||||
WriteLiteral(" type=\"radio\"");
|
||||
|
||||
WriteLiteral(" name=\"ResetLogo\"");
|
||||
|
||||
WriteLiteral(" value=\"false\"");
|
||||
|
||||
WriteLiteral(" /><label\r\n for=\"updateOrganisationLogoUploadLogo\">Upload Logo</la" +
|
||||
"bel>\r\n <div");
|
||||
|
||||
WriteLiteral(" id=\"updateOrganisationLogoUploadLogoContainer\"");
|
||||
|
||||
WriteLiteral(" style=\"display: none; padding-left: 10px;\"");
|
||||
|
||||
WriteLiteral(">\r\n <input");
|
||||
|
||||
WriteLiteral(" id=\"updateOrganisationLogoUploadLogoImage\"");
|
||||
|
||||
WriteLiteral(" type=\"file\"");
|
||||
|
||||
WriteLiteral(" name=\"Image\"");
|
||||
|
||||
WriteLiteral(" />\r\n <span");
|
||||
|
||||
WriteLiteral(" id=\"updateOrganisationLogoUploadLogoImageRequired\"");
|
||||
|
||||
WriteLiteral(" class=\"field-validation-valid field-validation-error\"");
|
||||
|
||||
WriteLiteral(">* Required</span>\r\n </div>\r\n </div>\r\n");
|
||||
|
||||
|
||||
#line 129 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</div>\r\n<script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(">\r\n $(function () {\r\n var button = $(\'#buttonUpdateOrganisationLogo\');\r" +
|
||||
"\n var buttonDialog = $(\'#dialogUpdateOrganisationLogo\');\r\n button." +
|
||||
"click(function () {\r\n buttonDialog.dialog(\'open\');\r\n retur" +
|
||||
"n false;\r\n });\r\n buttonDialog.find(\'input[type=\"radio\"]\').click(fu" +
|
||||
"nction () {\r\n if ($(\'#updateOrganisationLogoUploadLogo\').is(\':checked" +
|
||||
"\')) {\r\n $(\'#updateOrganisationLogoUploadLogoImage\').removeAttr(\'d" +
|
||||
"isabled\');\r\n $(\'#updateOrganisationLogoUploadLogoContainer\').slid" +
|
||||
"eDown();\r\n }\r\n else {\r\n $(\'#updateOrganisat" +
|
||||
"ionLogoUploadLogoContainer\').slideUp();\r\n $(\'#updateOrganisationL" +
|
||||
"ogoUploadLogoImage\').attr(\'disabled\', \'disabled\');\r\n }\r\n });\r\n" +
|
||||
" buttonDialog.dialog({\r\n resizable: false,\r\n height" +
|
||||
": 200,\r\n modal: true,\r\n autoOpen: false,\r\n butt" +
|
||||
"ons: {\r\n \"Save\": function () {\r\n var $this = $" +
|
||||
"(this);\r\n\r\n var $image = $(\'#updateOrganisationLogoUploadLogo" +
|
||||
"Image\');\r\n if ($(\'#updateOrganisationLogoUploadLogo\').is(\':ch" +
|
||||
"ecked\') && $image.val() == \'\') {\r\n $image.addClass(\'input" +
|
||||
"-validation-error\');\r\n $(\'#updateOrganisationLogoUploadLo" +
|
||||
"goImageRequired\').removeClass(\'field-validation-valid\');\r\n } " +
|
||||
"else {\r\n $image.removeClass(\'input-validation-error\');\r\n " +
|
||||
" $(\'#updateOrganisationLogoUploadLogoImageRequired\').addCl" +
|
||||
"ass(\'field-validation-valid\');\r\n $this.dialog(\"disable\");" +
|
||||
"\r\n $this.dialog(\"option\", \"buttons\", null);\r\n " +
|
||||
" $this.find(\'form\').submit();\r\n }\r\n " +
|
||||
" },\r\n Cancel: function () {\r\n $(this).dialog(\"" +
|
||||
"close\");\r\n }\r\n }\r\n });\r\n });\r\n</script>\r\n<di" +
|
||||
"v");
|
||||
|
||||
WriteLiteral(" id=\"dialogConfirmRemove\"");
|
||||
|
||||
WriteLiteral(" title=\"Delete this Component?\"");
|
||||
|
||||
WriteLiteral(">\r\n <p>\r\n <span");
|
||||
|
||||
WriteLiteral(" class=\"ui-icon ui-icon-alert\"");
|
||||
|
||||
WriteLiteral(" style=\"float: left; margin: 0 7px 20px 0;\"");
|
||||
|
||||
WriteLiteral("></span>\r\n This item will be permanently deleted and cannot be recovered. " +
|
||||
"Are you sure?\r\n </p>\r\n</div>\r\n<div");
|
||||
|
||||
WriteLiteral(" id=\"dialogEdit\"");
|
||||
|
||||
WriteLiteral(" title=\"Edit/Create Address\"");
|
||||
|
||||
WriteLiteral(">\r\n <table>\r\n <tr>\r\n <td>Short Name\r\n </td>\r" +
|
||||
"\n <td>\r\n <input");
|
||||
|
||||
WriteLiteral(" id=\"editShortName\"");
|
||||
|
||||
WriteLiteral(" type=\"text\"");
|
||||
|
||||
WriteLiteral(" />\r\n </td>\r\n </tr>\r\n <tr>\r\n <td>Name\r\n " +
|
||||
" </td>\r\n <td>\r\n <input");
|
||||
|
||||
WriteLiteral(" id=\"editName\"");
|
||||
|
||||
WriteLiteral(" type=\"text\"");
|
||||
|
||||
WriteLiteral(" />\r\n </td>\r\n </tr>\r\n <tr>\r\n <td>Address\r\n " +
|
||||
" </td>\r\n <td>\r\n <input");
|
||||
|
||||
WriteLiteral(" id=\"editAddress\"");
|
||||
|
||||
WriteLiteral(" type=\"text\"");
|
||||
|
||||
WriteLiteral(" />\r\n </td>\r\n </tr>\r\n <tr>\r\n <td>Suburb\r\n " +
|
||||
" </td>\r\n <td>\r\n <input");
|
||||
|
||||
WriteLiteral(" id=\"editSuburb\"");
|
||||
|
||||
WriteLiteral(" type=\"text\"");
|
||||
|
||||
WriteLiteral(" />\r\n </td>\r\n </tr>\r\n <tr>\r\n <td>Postcode\r\n " +
|
||||
" </td>\r\n <td>\r\n <input");
|
||||
|
||||
WriteLiteral(" id=\"editPostcode\"");
|
||||
|
||||
WriteLiteral(" type=\"text\"");
|
||||
|
||||
WriteLiteral(" />\r\n </td>\r\n </tr>\r\n <tr>\r\n <td>State\r\n " +
|
||||
" </td>\r\n <td>\r\n <input");
|
||||
|
||||
WriteLiteral(" id=\"editState\"");
|
||||
|
||||
WriteLiteral(" type=\"text\"");
|
||||
|
||||
WriteLiteral(" />\r\n </td>\r\n </tr>\r\n <tr>\r\n <td>Country\r\n " +
|
||||
" </td>\r\n <td>\r\n <input");
|
||||
|
||||
WriteLiteral(" id=\"editCountry\"");
|
||||
|
||||
WriteLiteral(" type=\"text\"");
|
||||
|
||||
WriteLiteral(" />\r\n </td>\r\n </tr>\r\n <tr>\r\n <td>Phone Number" +
|
||||
"\r\n </td>\r\n <td>\r\n <input");
|
||||
|
||||
WriteLiteral(" id=\"editPhoneNumber\"");
|
||||
|
||||
WriteLiteral(" type=\"text\"");
|
||||
|
||||
WriteLiteral(" />\r\n </td>\r\n </tr>\r\n <tr>\r\n <td>Fax Number\r\n" +
|
||||
" </td>\r\n <td>\r\n <input");
|
||||
|
||||
WriteLiteral(" id=\"editFaxNumber\"");
|
||||
|
||||
WriteLiteral(" type=\"text\"");
|
||||
|
||||
WriteLiteral(" />\r\n </td>\r\n </tr>\r\n </table>\r\n</div>\r\n<script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
$(function () {
|
||||
$(""#dialogConfirmRemove"").dialog({
|
||||
resizable: false,
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
""Delete"": function () {
|
||||
return null;
|
||||
},
|
||||
Cancel: function () {
|
||||
$(this).dialog(""close"");
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#organisationAddresses').find('span.delete').click(function () {
|
||||
var componentRow = $(this).closest('tr');
|
||||
var id = componentRow.attr('data-addressid');
|
||||
if (id) {
|
||||
var dialog = $(""#dialogConfirmRemove"");
|
||||
var buttons = dialog.dialog(""option"", ""buttons"");
|
||||
buttons['Delete'] = function () { $(this).dialog(""disable""); window.location.href = '");
|
||||
|
||||
|
||||
#line 271 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
|
||||
Write(Url.Action(MVC.API.System.DeleteOrganisationAddress()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\' + \'?redirect=true&id=\' + id; };\r\n var buttons = dialog.dialog(\"o" +
|
||||
"ption\", \"buttons\", buttons);\r\n dialog.dialog(\'open\');\r\n " +
|
||||
" }\r\n });\r\n\r\n var editAddress = function (element) {\r\n " +
|
||||
"var id = \'\', shortName = \'\', name = \'\', address = \'\', suburb = \'\', postcode = \'\'" +
|
||||
", state = \'\', country = \'\', phoneNumber = \'\', faxNumber = \'\';\r\n var d" +
|
||||
"ialog = $(\'#dialogEdit\');\r\n if (element) {\r\n id = elem" +
|
||||
"ent.attr(\'data-addressid\');\r\n shortName = element.find(\'.shortNam" +
|
||||
"e\').text();\r\n name = element.find(\'.name\').text();\r\n " +
|
||||
" address = element.find(\'.address\').text();\r\n suburb = element." +
|
||||
"find(\'.suburb\').text();\r\n postcode = element.find(\'.postcode\').te" +
|
||||
"xt();\r\n state = element.find(\'.state\').text();\r\n c" +
|
||||
"ountry = element.find(\'.country\').text();\r\n phoneNumber = element" +
|
||||
".find(\'.phoneNumber\').text();\r\n faxNumber = element.find(\'.faxNum" +
|
||||
"ber\').text();\r\n dialog.attr(\'data-addressid\', id);\r\n " +
|
||||
" dialog.dialog(\'option\', \'title\', \'Edit Address: \' + name);\r\n } els" +
|
||||
"e {\r\n dialog.attr(\'data-addressid\', null);\r\n dialo" +
|
||||
"g.dialog(\'option\', \'title\', \'Create Address\');\r\n }\r\n\r\n $(\'" +
|
||||
"#editShortName\').val(shortName);\r\n $(\'#editName\').val(name);\r\n " +
|
||||
" $(\'#editAddress\').val(address);\r\n $(\'#editSuburb\').val(suburb);\r" +
|
||||
"\n $(\'#editPostcode\').val(postcode);\r\n $(\'#editState\').val(" +
|
||||
"state);\r\n $(\'#editCountry\').val(country);\r\n $(\'#editPhoneN" +
|
||||
"umber\').val(phoneNumber);\r\n $(\'#editFaxNumber\').val(faxNumber);\r\n " +
|
||||
" dialog.dialog(\'open\');\r\n }\r\n\r\n $(\'#organisationAddresses\')" +
|
||||
".find(\'span.edit\').click(function () {\r\n var componentRow = $(this).c" +
|
||||
"losest(\'tr\');\r\n editAddress(componentRow);\r\n });\r\n\r\n $(" +
|
||||
"\'#createAddress\').click(function () {\r\n editAddress();\r\n r" +
|
||||
"eturn false;\r\n });\r\n\r\n var submitAddress = function () {\r\n " +
|
||||
" var dialog = $(\'#dialogEdit\');\r\n var data = {\r\n Id" +
|
||||
": dialog.attr(\'data-addressid\'),\r\n ShortName: $(\'#editShortName\')" +
|
||||
".val(),\r\n Name: $(\'#editName\').val(),\r\n Address: $" +
|
||||
"(\'#editAddress\').val(),\r\n Suburb: $(\'#editSuburb\').val(),\r\n " +
|
||||
" Postcode: $(\'#editPostcode\').val(),\r\n State: $(\'#editSt" +
|
||||
"ate\').val(),\r\n Country: $(\'#editCountry\').val(),\r\n " +
|
||||
" PhoneNumber: $(\'#editPhoneNumber\').val(),\r\n FaxNumber: $(\'#editF" +
|
||||
"axNumber\').val()\r\n };\r\n\r\n $.ajax({\r\n url: \'" +
|
||||
"");
|
||||
|
||||
|
||||
#line 336 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
|
||||
Write(Url.Action(MVC.API.System.UpdateOrganisationAddress()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\',\r\n dataType: \'json\',\r\n data: data,\r\n " +
|
||||
" type: \'post\',\r\n success: function (d) {\r\n i" +
|
||||
"f (d == \'OK\') {\r\n window.location.href = \'");
|
||||
|
||||
|
||||
#line 342 "..\..\Areas\Config\Views\Organisation\Index.cshtml"
|
||||
Write(Url.Action(MVC.Config.Organisation.Index()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@"';
|
||||
} else {
|
||||
alert('Unable to update address:\n' + d);
|
||||
dialog.dialog('enable');
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to update address:\n' + textStatus);
|
||||
dialog.dialog('enable');
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
$(""#dialogEdit"").dialog({
|
||||
resizable: false,
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
width: 350,
|
||||
buttons: {
|
||||
""Save"": function () {
|
||||
submitAddress();
|
||||
},
|
||||
Cancel: function () {
|
||||
$(this).dialog(""close"");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
</script>");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -0,0 +1,14 @@
|
||||
@model Disco.Web.Areas.Config.Models.Plugins.PluginConfigurationViewModel
|
||||
@{
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Plugins", MVC.Config.Plugins.Index(), Model.Manifest.Name);
|
||||
}
|
||||
@using (Html.BeginForm())
|
||||
{
|
||||
@Html.ValidationSummary(false)
|
||||
<div class="clearfix">
|
||||
@Html.PartialCompiled(Model.PluginViewType, Model.PluginViewModel)
|
||||
</div>
|
||||
<div class="actionBar">
|
||||
<input type="submit" class="button" value="Save Configuration" />
|
||||
</div>
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
@model Disco.Web.Areas.Config.Models.Plugins.IndexViewModel
|
||||
@using Disco.Services.Plugins;
|
||||
@{
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Plugins");
|
||||
}
|
||||
@{
|
||||
if (Model.PluginManifests.Count == 0)
|
||||
{
|
||||
<div class="form" style="width: 450px">
|
||||
<span class="smallMessage">No Plugins Installed</span>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
var pluginGroups = Model.PluginManifestsByType;
|
||||
|
||||
|
||||
int itemsPerColumn = pluginGroups.Count / 3;
|
||||
var itemNextId = 0;
|
||||
|
||||
<table id="pageMenu">
|
||||
<tr>
|
||||
@for (int i = 0; i < 3; i++)
|
||||
{
|
||||
<td>
|
||||
@{
|
||||
int itemsForThisColumn = itemsPerColumn + (pluginGroups.Count % 3 > i ? 1 : 0);
|
||||
for (int i2 = 0; i2 < itemsForThisColumn && itemNextId < pluginGroups.Count; i2++)
|
||||
{
|
||||
var pluginGroup = pluginGroups[itemNextId];
|
||||
itemNextId++;
|
||||
<div class="pageMenuArea">
|
||||
<h2>@Plugins.PluginFeatureCategoryDisplayName(pluginGroup.Item1)</h2>
|
||||
@foreach (var pluginDefinition in pluginGroup.Item2)
|
||||
{
|
||||
@Html.ActionLink(pluginDefinition.Name, MVC.Config.Plugins.Configure(pluginDefinition.Id))
|
||||
<div class="pageMenuBlurb">
|
||||
@pluginDefinition.Id | v@(pluginDefinition.Version.ToString(3))
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</td>
|
||||
}
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@*
|
||||
foreach (var pluginGroup in pluginGroups)
|
||||
{
|
||||
<div class="form" style="width: 450px">
|
||||
<h2>@DiscoPlugins.PluginCategoryDisplayName(pluginGroup.Key)</h2>
|
||||
<table>
|
||||
@foreach (var pluginDefinition in pluginGroup)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@if (pluginDefinition.HasConfiguration)
|
||||
{
|
||||
@Html.ActionLink(pluginDefinition.Name, MVC.Config.Plugins.Configure(pluginDefinition.Id))<br />
|
||||
<span class="smallMessage">@pluginDefinition.Id | v@(pluginDefinition.Version.ToString(3))</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
@pluginDefinition.Name <br />
|
||||
<span class="smallMessage">@pluginDefinition.Id | v@(pluginDefinition.Version.ToString(2))
|
||||
| Not Configurable</span>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
</div> *@
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,251 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.17929
|
||||
//
|
||||
// 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.Plugins
|
||||
{
|
||||
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.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
|
||||
#line 2 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
using Disco.Services.Plugins;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/Plugins/Index.cshtml")]
|
||||
public class Index : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.Plugins.IndexViewModel>
|
||||
{
|
||||
public Index()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 3 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Plugins");
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
|
||||
#line 6 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
|
||||
if (Model.PluginManifests.Count == 0)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"form\"");
|
||||
|
||||
WriteLiteral(" style=\"width: 450px\"");
|
||||
|
||||
WriteLiteral(">\r\n <span");
|
||||
|
||||
WriteLiteral(" class=\"smallMessage\"");
|
||||
|
||||
WriteLiteral(">No Plugins Installed</span>\r\n </div> \r\n");
|
||||
|
||||
|
||||
#line 12 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
var pluginGroups = Model.PluginManifestsByType;
|
||||
|
||||
|
||||
int itemsPerColumn = pluginGroups.Count / 3;
|
||||
var itemNextId = 0;
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <table");
|
||||
|
||||
WriteLiteral(" id=\"pageMenu\"");
|
||||
|
||||
WriteLiteral(">\r\n <tr>\r\n");
|
||||
|
||||
|
||||
#line 23 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 23 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <td>\r\n");
|
||||
|
||||
|
||||
#line 26 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 26 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
|
||||
int itemsForThisColumn = itemsPerColumn + (pluginGroups.Count % 3 > i ? 1 : 0);
|
||||
for (int i2 = 0; i2 < itemsForThisColumn && itemNextId < pluginGroups.Count; i2++)
|
||||
{
|
||||
var pluginGroup = pluginGroups[itemNextId];
|
||||
itemNextId++;
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"pageMenuArea\"");
|
||||
|
||||
WriteLiteral(">\r\n <h2>");
|
||||
|
||||
|
||||
#line 33 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
Write(Plugins.PluginFeatureCategoryDisplayName(pluginGroup.Item1));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</h2>\r\n");
|
||||
|
||||
|
||||
#line 34 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 34 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
foreach (var pluginDefinition in pluginGroup.Item2)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 36 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
Write(Html.ActionLink(pluginDefinition.Name, MVC.Config.Plugins.Configure(pluginDefinition.Id)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 36 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"pageMenuBlurb\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 38 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
Write(pluginDefinition.Id);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" | v");
|
||||
|
||||
|
||||
#line 38 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
Write(pluginDefinition.Version.ToString(3));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </div>\r\n");
|
||||
|
||||
|
||||
#line 40 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </div>\r\n");
|
||||
|
||||
|
||||
#line 42 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n");
|
||||
|
||||
|
||||
#line 45 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </tr>\r\n </table>\r\n");
|
||||
|
||||
|
||||
#line 48 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 74 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
|
||||
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -0,0 +1,115 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.17929
|
||||
//
|
||||
// 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.Plugins
|
||||
{
|
||||
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.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/Plugins/Configure.cshtml")]
|
||||
public class Configure : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.Plugins.PluginConfigurationViewModel>
|
||||
{
|
||||
public Configure()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 2 "..\..\Areas\Config\Views\Plugins\Configure.cshtml"
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Plugins", MVC.Config.Plugins.Index(), Model.Manifest.Name);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
|
||||
#line 5 "..\..\Areas\Config\Views\Plugins\Configure.cshtml"
|
||||
using (Html.BeginForm())
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 7 "..\..\Areas\Config\Views\Plugins\Configure.cshtml"
|
||||
Write(Html.ValidationSummary(false));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 7 "..\..\Areas\Config\Views\Plugins\Configure.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"clearfix\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 9 "..\..\Areas\Config\Views\Plugins\Configure.cshtml"
|
||||
Write(Html.PartialCompiled(Model.PluginViewType, Model.PluginViewModel));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </div>\r\n");
|
||||
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"actionBar\"");
|
||||
|
||||
WriteLiteral(">\r\n <input");
|
||||
|
||||
WriteLiteral(" type=\"submit\"");
|
||||
|
||||
WriteLiteral(" class=\"button\"");
|
||||
|
||||
WriteLiteral(" value=\"Save Configuration\"");
|
||||
|
||||
WriteLiteral(" />\r\n </div>\r\n");
|
||||
|
||||
|
||||
#line 14 "..\..\Areas\Config\Views\Plugins\Configure.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -0,0 +1,143 @@
|
||||
@model Disco.Web.Areas.Config.Models.Shared.LogEventsModel
|
||||
@{
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR");
|
||||
var uniqueId = Guid.NewGuid().ToString("N");
|
||||
}
|
||||
<div id="LogEvents_@(uniqueId)" class="logEventsViewport">
|
||||
<table class="logEventsViewport">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="icon">
|
||||
|
||||
</th>
|
||||
<th class="timestamp">
|
||||
Date/Time
|
||||
</th>
|
||||
<th class="eventType">
|
||||
Event Type
|
||||
</th>
|
||||
<th class="message">
|
||||
Message
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
<div class="logEventsViewportContainer" style="@(Model.ViewPortWidth.HasValue ? string.Format("width:{0}px;", Model.ViewPortWidth.Value) : null)@(Model.ViewPortHeight.HasValue ? string.Format("height:{0}px;", Model.ViewPortHeight.Value - 18) : null)">
|
||||
<div class="logEventsViewportNoLogs" data-bind="visible: EventLogs().length == 0"
|
||||
style="display: none">
|
||||
No logs
|
||||
</div>
|
||||
<table class="logEventsViewport" data-bind="visible: EventLogs().length > 0" style="display: none">
|
||||
<tbody data-bind="foreach: EventLogs">
|
||||
<tr>
|
||||
<td class="icon" data-bind="css: {information: EventTypeSeverity == 0, warning: EventTypeSeverity == 1, error: EventTypeSeverity == 2}">
|
||||
|
||||
</td>
|
||||
<td class="timestamp" data-bind="text: FormattedTimestamp">
|
||||
</td>
|
||||
<td class="eventType" data-bind="text: EventTypeName, attr: {title: ModuleDescription}">
|
||||
</td>
|
||||
<td class="message" data-bind="text: FormattedMessage, attr: {title: $parent.LogArguments($data)}">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@{
|
||||
var serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
|
||||
var eventTypesFilterJson = (Model.EventTypesFilter != null) ? serializer.Serialize(Model.EventTypesFilter.Select(et => et.Id).ToArray()) : "null";
|
||||
}
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
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.LogContext.LiveLogAllEventsGroupName)';
|
||||
var logEventTypeFiltered = @(eventTypesFilterJson);
|
||||
var logStartFiler = @(AjaxHelpers.JsonDate(Model.StartFilter));
|
||||
var logEndFiler = @(AjaxHelpers.JsonDate(Model.EndFilter));
|
||||
var logTakeFiler = '@(Model.TakeFilter)';
|
||||
var liveConnection = null;
|
||||
var liveEventReceivedFunction = '@(Model.JavascriptLiveEventFunctionName)';
|
||||
var useLive = ('True'==='@(Model.IsLive)');
|
||||
|
||||
// View Model
|
||||
var logsViewModel;
|
||||
function LogsViewModel(initialLogs){
|
||||
var self = this;
|
||||
|
||||
self.EventLogs = ko.observableArray(initialLogs);
|
||||
self.LogArguments = function(log){
|
||||
if (log.Arguments)
|
||||
return log.Arguments.join('\n');
|
||||
else
|
||||
return null;
|
||||
};
|
||||
}
|
||||
function formatDate(d){
|
||||
if (d){
|
||||
return d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate() + ' ' + d.getHours() + ':'+d.getMinutes()+':'+d.getSeconds();
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
function loadInitialData(){
|
||||
// Load Data
|
||||
var loadData = {
|
||||
Format: "json",
|
||||
Start: formatDate(logStartFiler),
|
||||
End: logEndFiler,
|
||||
ModuleId: logModuleId,
|
||||
Take: logTakeFiler
|
||||
};
|
||||
if (logEventTypeFiltered)
|
||||
loadData["EventTypeIds"] = logEventTypeFiltered;
|
||||
$.ajax({
|
||||
url: '@(Url.Action(MVC.API.Logging.RetrieveEvents()))',
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
data: loadData,
|
||||
success: function (d) {
|
||||
initLogs(d);
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to retrieve logs: ' + textStatus);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function initLogs(loadedLogs){
|
||||
logsViewModel = new LogsViewModel(loadedLogs);
|
||||
ko.applyBindings(logsViewModel, logEventsHost.get(0));
|
||||
|
||||
if (useLive){
|
||||
if (liveEventReceivedFunction){
|
||||
if (!document.DiscoFunctions) document.DiscoFunctions = {};
|
||||
if (!document.DiscoFunctions.LogEventsFunctions) document.DiscoFunctions.LogEventsFunctions = {};
|
||||
if (document.DiscoFunctions.LogEventsFunctions[liveEventReceivedFunction]){
|
||||
liveEventReceivedFunction = document.DiscoFunctions.LogEventsFunctions[liveEventReceivedFunction];
|
||||
}else{
|
||||
liveEventReceivedFunction = null;
|
||||
}
|
||||
}
|
||||
|
||||
liveConnection = $.connection('@(Url.Content("~/API/Logging/Notifications"))');
|
||||
liveConnection.received(logReceived);
|
||||
liveConnection.error(function(e){alert('Live-Log Error: '+e)});
|
||||
liveConnection.start(function(){
|
||||
if (logModuleLiveGroupName){
|
||||
liveConnection.send('/addToGroups:' + logModuleLiveGroupName);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function logReceived(log){
|
||||
if (log.UseDisplay) logsViewModel.EventLogs.unshift(log);
|
||||
if (liveEventReceivedFunction) liveEventReceivedFunction(log);
|
||||
}
|
||||
|
||||
loadInitialData();
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user