@@ -0,0 +1,123 @@
|
|||||||
|
using Disco.BI.Extensions;
|
||||||
|
using Disco.Data.Repository;
|
||||||
|
using Disco.Services.Logging;
|
||||||
|
using Disco.Services.Tasks;
|
||||||
|
using Quartz;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Disco.BI.DeviceBI.Migration
|
||||||
|
{
|
||||||
|
public class LogMacAddressImporting : ScheduledTask
|
||||||
|
{
|
||||||
|
public override string TaskName { get { return "Migration: Logs to Device Mac Address Details"; } }
|
||||||
|
|
||||||
|
public override bool SingleInstanceTask { get { return true; } }
|
||||||
|
public override bool CancelInitiallySupported { get { return false; } }
|
||||||
|
|
||||||
|
#region Required Helpers
|
||||||
|
private static string RequiredFilePath(DiscoDataContext dbContext)
|
||||||
|
{
|
||||||
|
if (dbContext.DiscoConfiguration.DataStoreLocation != null)
|
||||||
|
return System.IO.Path.Combine(dbContext.DiscoConfiguration.DataStoreLocation, "_LogMacAddressImportingRequired.txt");
|
||||||
|
else
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool IsRequired(DiscoDataContext dbContext)
|
||||||
|
{
|
||||||
|
var requiredFilePath = RequiredFilePath(dbContext);
|
||||||
|
|
||||||
|
if (requiredFilePath == null)
|
||||||
|
return false;
|
||||||
|
else
|
||||||
|
return System.IO.File.Exists(requiredFilePath);
|
||||||
|
}
|
||||||
|
public static void SetRequired(DiscoDataContext dbContext)
|
||||||
|
{
|
||||||
|
var requiredFilePath = RequiredFilePath(dbContext);
|
||||||
|
|
||||||
|
if (requiredFilePath != null)
|
||||||
|
{
|
||||||
|
System.IO.File.WriteAllText(requiredFilePath, "This file exists to indicate an Importing of Mac Address from the Disco Logs is required. It will automatically be deleted when the import completes.");
|
||||||
|
System.IO.File.SetAttributes(requiredFilePath, System.IO.FileAttributes.Hidden);
|
||||||
|
}
|
||||||
|
// ELSE: Could never be required if no DataStoreLocation is set (no logs to process)
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
public override void InitalizeScheduledTask(DiscoDataContext dbContext)
|
||||||
|
{
|
||||||
|
if (IsRequired(dbContext))
|
||||||
|
{
|
||||||
|
// Schedule in 15mins
|
||||||
|
var trigger = TriggerBuilder.Create()
|
||||||
|
.StartAt(DateTimeOffset.Now.AddMinutes(15));
|
||||||
|
|
||||||
|
this.ScheduleTask(trigger);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ScheduledTaskStatus ScheduleImmediately()
|
||||||
|
{
|
||||||
|
var existingTask = ScheduledTasks.GetTaskStatuses(typeof(LogMacAddressImporting)).Where(s => s.IsRunning).FirstOrDefault();
|
||||||
|
if (existingTask != null)
|
||||||
|
return existingTask;
|
||||||
|
|
||||||
|
var instance = new LogMacAddressImporting();
|
||||||
|
return instance.ScheduleTask();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void ExecuteTask()
|
||||||
|
{
|
||||||
|
using (DiscoDataContext dbContext = new DiscoDataContext())
|
||||||
|
{
|
||||||
|
Status.UpdateStatus(0, "Importing MAC Addresses", "Querying Logs for Details");
|
||||||
|
// Load Logs
|
||||||
|
var logRetriever = new ReadLogContext()
|
||||||
|
{
|
||||||
|
Module = DeviceBI.EnrolmentLog.Current.ModuleId,
|
||||||
|
EventTypes = new List<int>() { (int)DeviceBI.EnrolmentLog.EventTypeIds.SessionDeviceInfo }
|
||||||
|
};
|
||||||
|
var results = logRetriever.Query(dbContext);
|
||||||
|
|
||||||
|
Status.UpdateStatus(50, string.Format("Passing {0} logs", results.Count));
|
||||||
|
|
||||||
|
Dictionary<string, Tuple<string, string>> addresses = new Dictionary<string, Tuple<string, string>>();
|
||||||
|
|
||||||
|
foreach (var result in results.OrderBy(r => r.Timestamp))
|
||||||
|
addresses[((string)result.Arguments[1]).ToLower()] = new Tuple<string, string>((string)result.Arguments[4], (string)result.Arguments[5]);
|
||||||
|
|
||||||
|
Status.UpdateStatus(75, string.Format("Importing {0} details", addresses.Count));
|
||||||
|
|
||||||
|
var devices = dbContext.Devices.Include("DeviceDetails").ToList();
|
||||||
|
|
||||||
|
Tuple<string, string> addressResult;
|
||||||
|
foreach (var device in devices)
|
||||||
|
{
|
||||||
|
if (addresses.TryGetValue(device.SerialNumber.ToLower(), out addressResult))
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(addressResult.Item1))
|
||||||
|
device.DeviceDetails.LanMacAddress(device, addressResult.Item1);
|
||||||
|
if (!string.IsNullOrEmpty(addressResult.Item2))
|
||||||
|
device.DeviceDetails.WLanMacAddress(device, addressResult.Item2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Status.UpdateStatus(90, "Saving to Database");
|
||||||
|
|
||||||
|
dbContext.SaveChanges();
|
||||||
|
|
||||||
|
// Finished - Remove Placeholder File
|
||||||
|
var requiredFilePath = RequiredFilePath(dbContext);
|
||||||
|
if (System.IO.File.Exists(requiredFilePath))
|
||||||
|
System.IO.File.Delete(requiredFilePath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -10,7 +10,8 @@ namespace Disco.BI.DeviceBI
|
|||||||
{
|
{
|
||||||
public static class Searching
|
public static class Searching
|
||||||
{
|
{
|
||||||
private static List<DeviceSearchResultItem> Search_SelectDeviceSearchResultItem(IQueryable<Device> Query, int? LimitCount = null){
|
private static List<DeviceSearchResultItem> Search_SelectDeviceSearchResultItem(IQueryable<Device> Query, int? LimitCount = null)
|
||||||
|
{
|
||||||
if (LimitCount.HasValue)
|
if (LimitCount.HasValue)
|
||||||
Query = Query.Take(LimitCount.Value);
|
Query = Query.Take(LimitCount.Value);
|
||||||
|
|
||||||
@@ -28,15 +29,34 @@ namespace Disco.BI.DeviceBI
|
|||||||
}).ToList();
|
}).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<DeviceSearchResultItem> Search(DiscoDataContext dbContext, string Term, int? LimitCount = null)
|
public static List<DeviceSearchResultItem> Search(DiscoDataContext dbContext, string Term, int? LimitCount = null, bool SearchDetails = false)
|
||||||
{
|
{
|
||||||
return Search_SelectDeviceSearchResultItem(dbContext.Devices.Where(d =>
|
IQueryable<Device> query;
|
||||||
d.AssetNumber.Contains(Term) ||
|
|
||||||
d.ComputerName.Contains(Term) ||
|
query = null;
|
||||||
d.SerialNumber.Contains(Term) ||
|
|
||||||
d.Location.Contains(Term) ||
|
if (SearchDetails)
|
||||||
Term.Contains(d.SerialNumber)
|
{
|
||||||
), LimitCount);
|
query = dbContext.Devices.Where(d =>
|
||||||
|
d.AssetNumber.Contains(Term) ||
|
||||||
|
d.ComputerName.Contains(Term) ||
|
||||||
|
d.SerialNumber.Contains(Term) ||
|
||||||
|
d.Location.Contains(Term) ||
|
||||||
|
Term.Contains(d.SerialNumber) ||
|
||||||
|
d.DeviceDetails.Any(dd => dd.Value.Contains(Term))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
query = dbContext.Devices.Where(d =>
|
||||||
|
d.AssetNumber.Contains(Term) ||
|
||||||
|
d.ComputerName.Contains(Term) ||
|
||||||
|
d.SerialNumber.Contains(Term) ||
|
||||||
|
d.Location.Contains(Term) ||
|
||||||
|
Term.Contains(d.SerialNumber));
|
||||||
|
}
|
||||||
|
|
||||||
|
return Search_SelectDeviceSearchResultItem(query, LimitCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<DeviceSearchResultItem> SearchDeviceModel(DiscoDataContext dbContext, int DeviceModelId, int? LimitCount = null)
|
public static List<DeviceSearchResultItem> SearchDeviceModel(DiscoDataContext dbContext, int DeviceModelId, int? LimitCount = null)
|
||||||
|
|||||||
@@ -0,0 +1,109 @@
|
|||||||
|
using Disco.Models.Repository;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Disco.BI.Extensions
|
||||||
|
{
|
||||||
|
public static class DeviceDetailExtensions
|
||||||
|
{
|
||||||
|
|
||||||
|
#region Scope Declaration
|
||||||
|
|
||||||
|
public const string ScopeHardware = "Hardware";
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Helpers
|
||||||
|
private static string GetDetail(this IEnumerable<DeviceDetail> details, string Scope, string Key)
|
||||||
|
{
|
||||||
|
if (details == null)
|
||||||
|
throw new ArgumentNullException("details");
|
||||||
|
if (string.IsNullOrEmpty(Scope))
|
||||||
|
throw new ArgumentNullException("Scope");
|
||||||
|
if (string.IsNullOrEmpty(Key))
|
||||||
|
throw new ArgumentNullException("Key");
|
||||||
|
|
||||||
|
var detail = details.Where(d => d.Key == Key).FirstOrDefault();
|
||||||
|
|
||||||
|
if (detail == null)
|
||||||
|
return null;
|
||||||
|
else
|
||||||
|
return detail.Value;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void SetDetail(this Device device, string Scope, string Key, string Value)
|
||||||
|
{
|
||||||
|
if (device == null)
|
||||||
|
throw new ArgumentNullException("device");
|
||||||
|
if (string.IsNullOrEmpty(Scope))
|
||||||
|
throw new ArgumentNullException("Scope");
|
||||||
|
if (string.IsNullOrEmpty(Key))
|
||||||
|
throw new ArgumentNullException("Key");
|
||||||
|
|
||||||
|
var detail = device.DeviceDetails.Where(d => d.Scope == Scope && d.Key == Key).FirstOrDefault();
|
||||||
|
|
||||||
|
// No Detail Stored & Set to Null
|
||||||
|
if (detail == null && Value == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (detail == null)
|
||||||
|
{
|
||||||
|
detail = new DeviceDetail()
|
||||||
|
{
|
||||||
|
DeviceSerialNumber = device.SerialNumber,
|
||||||
|
Scope = Scope,
|
||||||
|
Key = Key,
|
||||||
|
Value = Value
|
||||||
|
};
|
||||||
|
device.DeviceDetails.Add(detail);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (detail.Value != Value)
|
||||||
|
detail.Value = Value;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region LanMacAddress
|
||||||
|
public const string KeyLanMacAddress = "LanMacAddress";
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the LanMacAddress Device Detail Value
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>The LanMacAddress or null</returns>
|
||||||
|
public static string LanMacAddress(this IEnumerable<DeviceDetail> details)
|
||||||
|
{
|
||||||
|
return details.GetDetail(ScopeHardware, KeyLanMacAddress);
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Sets the LanMacAddress Device Detail Value
|
||||||
|
/// </summary>
|
||||||
|
public static void LanMacAddress(this IEnumerable<DeviceDetail> details, Device device, string LanMacAddress)
|
||||||
|
{
|
||||||
|
device.SetDetail(ScopeHardware, KeyLanMacAddress, LanMacAddress);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region WLanMacAddress
|
||||||
|
public const string KeyWLanMacAddress = "WLanMacAddress";
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the WLanMacAddress Device Detail Value
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>The WLanMacAddress or null</returns>
|
||||||
|
public static string WLanMacAddress(this IEnumerable<DeviceDetail> details)
|
||||||
|
{
|
||||||
|
return details.GetDetail(ScopeHardware, KeyWLanMacAddress);
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Sets the WLanMacAddress Device Detail Value
|
||||||
|
/// </summary>
|
||||||
|
public static void WLanMacAddress(this IEnumerable<DeviceDetail> details, Device device, string WLanMacAddress)
|
||||||
|
{
|
||||||
|
device.SetDetail(ScopeHardware, KeyWLanMacAddress, WLanMacAddress);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -127,6 +127,7 @@
|
|||||||
<Compile Include="BI\DeviceBI\Importing\Import.cs" />
|
<Compile Include="BI\DeviceBI\Importing\Import.cs" />
|
||||||
<Compile Include="BI\DeviceBI\Importing\ImportParseTask.cs" />
|
<Compile Include="BI\DeviceBI\Importing\ImportParseTask.cs" />
|
||||||
<Compile Include="BI\DeviceBI\Importing\ImportProcessTask.cs" />
|
<Compile Include="BI\DeviceBI\Importing\ImportProcessTask.cs" />
|
||||||
|
<Compile Include="BI\DeviceBI\Migration\LogMacAddressImporting.cs" />
|
||||||
<Compile Include="BI\DeviceBI\Searching.cs" />
|
<Compile Include="BI\DeviceBI\Searching.cs" />
|
||||||
<Compile Include="BI\DisposableImageCollection.cs" />
|
<Compile Include="BI\DisposableImageCollection.cs" />
|
||||||
<Compile Include="BI\DocumentTemplateBI\DocumentTemplateQRCodeLocationCache.cs" />
|
<Compile Include="BI\DocumentTemplateBI\DocumentTemplateQRCodeLocationCache.cs" />
|
||||||
@@ -146,6 +147,7 @@
|
|||||||
<Compile Include="BI\Extensions\DeviceActionExtensions.cs" />
|
<Compile Include="BI\Extensions\DeviceActionExtensions.cs" />
|
||||||
<Compile Include="BI\Extensions\DeviceBatchExtensions.cs" />
|
<Compile Include="BI\Extensions\DeviceBatchExtensions.cs" />
|
||||||
<Compile Include="BI\Extensions\DeviceCertificateExtensions.cs" />
|
<Compile Include="BI\Extensions\DeviceCertificateExtensions.cs" />
|
||||||
|
<Compile Include="BI\Extensions\DeviceDetailExtensions.cs" />
|
||||||
<Compile Include="BI\Extensions\DeviceModelExtensions.cs" />
|
<Compile Include="BI\Extensions\DeviceModelExtensions.cs" />
|
||||||
<Compile Include="BI\Extensions\DeviceProfileExtensions.cs" />
|
<Compile Include="BI\Extensions\DeviceProfileExtensions.cs" />
|
||||||
<Compile Include="BI\Extensions\JobActionExtensions.cs" />
|
<Compile Include="BI\Extensions\JobActionExtensions.cs" />
|
||||||
@@ -256,7 +258,7 @@
|
|||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<ProjectExtensions>
|
<ProjectExtensions>
|
||||||
<VisualStudio>
|
<VisualStudio>
|
||||||
<UserProperties BuildVersion_StartDate="2011/7/1" BuildVersion_BuildAction="Both" BuildVersion_DetectChanges="False" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_UpdateFileVersion="True" />
|
<UserProperties BuildVersion_UpdateFileVersion="True" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_DetectChanges="False" BuildVersion_BuildAction="Both" BuildVersion_StartDate="2011/7/1" />
|
||||||
</VisualStudio>
|
</VisualStudio>
|
||||||
</ProjectExtensions>
|
</ProjectExtensions>
|
||||||
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ namespace Disco.Web
|
|||||||
Disco.BI.Interop.SignalRHandlers.RepositoryMonitorNotifications.Initialize();
|
Disco.BI.Interop.SignalRHandlers.RepositoryMonitorNotifications.Initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void InitializeUpdateEnvironment(DiscoDataContext dbContext)
|
public static void InitializeUpdateEnvironment(DiscoDataContext dbContext, Version PreviousVersion)
|
||||||
{
|
{
|
||||||
// Initialize Logging
|
// Initialize Logging
|
||||||
Disco.Services.Logging.LogContext.Initalize(dbContext, DiscoApplication.SchedulerFactory);
|
Disco.Services.Logging.LogContext.Initalize(dbContext, DiscoApplication.SchedulerFactory);
|
||||||
@@ -83,6 +83,10 @@ namespace Disco.Web
|
|||||||
|
|
||||||
// Initialize Scheduled Tasks
|
// Initialize Scheduled Tasks
|
||||||
Disco.Services.Tasks.ScheduledTasks.InitalizeScheduledTasks(dbContext, DiscoApplication.SchedulerFactory, true);
|
Disco.Services.Tasks.ScheduledTasks.InitalizeScheduledTasks(dbContext, DiscoApplication.SchedulerFactory, true);
|
||||||
|
|
||||||
|
// Import MAC Address Migration
|
||||||
|
if (PreviousVersion != null && PreviousVersion < new Version(1, 2, 910, 0))
|
||||||
|
Disco.BI.DeviceBI.Migration.LogMacAddressImporting.SetRequired(dbContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void DisposeEnvironment()
|
public static void DisposeEnvironment()
|
||||||
|
|||||||
@@ -506,5 +506,11 @@ namespace Disco.Web.Areas.API.Controllers
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
public virtual ActionResult MigrateDeviceMacAddressesFromLog()
|
||||||
|
{
|
||||||
|
var taskStatus = Disco.BI.DeviceBI.Migration.LogMacAddressImporting.ScheduleImmediately();
|
||||||
|
return RedirectToAction(MVC.Config.Logging.TaskStatus(taskStatus.SessionId));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -222,6 +222,36 @@
|
|||||||
right: 220px;
|
right: 220px;
|
||||||
margin-top: -24px;
|
margin-top: -24px;
|
||||||
}
|
}
|
||||||
|
#DeviceDetailTab-DetailsContainer > table {
|
||||||
|
border: solid 1px #e8eef4;
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
#DeviceDetailTab-DetailsContainer > table > tbody > tr > td {
|
||||||
|
border: solid 1px #e8eef4;
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
#DeviceDetailTab-DetailsContainer > table > tbody > tr:nth-child(odd) > td {
|
||||||
|
background-color: #fcfcfd;
|
||||||
|
}
|
||||||
|
#DeviceDetailTab-DetailsContainer > table > thead > tr > th,
|
||||||
|
#DeviceDetailTab-DetailsContainer > table > tbody > tr > th {
|
||||||
|
background-color: #e8eef4;
|
||||||
|
border: solid 1px #e8eef4;
|
||||||
|
}
|
||||||
|
#DeviceDetailTab-DetailsContainer > table > tbody > tr:hover > td {
|
||||||
|
background-color: #e8eef4;
|
||||||
|
}
|
||||||
|
#DeviceDetailTab-DetailsContainer > table > tfoot > tr > th,
|
||||||
|
#DeviceDetailTab-DetailsContainer > table > tfoot > tr > td {
|
||||||
|
background-color: #e8eef4;
|
||||||
|
}
|
||||||
|
#DeviceDetailTab-DetailsContainer > table > tbody > tr > th {
|
||||||
|
width: 150px;
|
||||||
|
}
|
||||||
|
#DeviceDetailTab-DetailsContainer > table > tbody > tr > th,
|
||||||
|
#DeviceDetailTab-DetailsContainer > table > tbody > tr > td {
|
||||||
|
padding: 10px 6px;
|
||||||
|
}
|
||||||
#deviceShowResources #Attachments {
|
#deviceShowResources #Attachments {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
border: 1px solid #cccccc;
|
border: 1px solid #cccccc;
|
||||||
|
|||||||
@@ -196,6 +196,23 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#DeviceDetailTab-DetailsContainer {
|
||||||
|
& > table {
|
||||||
|
.tableData();
|
||||||
|
|
||||||
|
& > tbody > tr {
|
||||||
|
& > th {
|
||||||
|
width: 150px;
|
||||||
|
}
|
||||||
|
|
||||||
|
& > th, & > td {
|
||||||
|
padding: 10px 6px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#deviceShowResources {
|
#deviceShowResources {
|
||||||
#Attachments {
|
#Attachments {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -118,7 +118,7 @@ namespace Disco.Web.Controllers
|
|||||||
|
|
||||||
dbContext.Configuration.LazyLoadingEnabled = true;
|
dbContext.Configuration.LazyLoadingEnabled = true;
|
||||||
|
|
||||||
m.Device = dbContext.Devices
|
m.Device = dbContext.Devices.Include("DeviceDetails")
|
||||||
.Where(d => d.SerialNumber == id)
|
.Where(d => d.SerialNumber == id)
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ namespace Disco.Web.Controllers
|
|||||||
m.ErrorMessage = "A search term of at least two characters is required";
|
m.ErrorMessage = "A search term of at least two characters is required";
|
||||||
return View(m);
|
return View(m);
|
||||||
}
|
}
|
||||||
m.Devices = BI.DeviceBI.Searching.Search(dbContext, term);
|
m.Devices = BI.DeviceBI.Searching.Search(dbContext, term, null, searchDetails);
|
||||||
m.Jobs = BI.JobBI.Searching.Search(dbContext, term, null, true, searchDetails);
|
m.Jobs = BI.JobBI.Searching.Search(dbContext, term, null, true, searchDetails);
|
||||||
m.Users = BI.UserBI.Searching.Search(dbContext, term);
|
m.Users = BI.UserBI.Searching.Search(dbContext, term);
|
||||||
}
|
}
|
||||||
@@ -125,7 +125,7 @@ namespace Disco.Web.Controllers
|
|||||||
m.ErrorMessage = "A search term of at least two characters is required";
|
m.ErrorMessage = "A search term of at least two characters is required";
|
||||||
return View(m);
|
return View(m);
|
||||||
}
|
}
|
||||||
m.Devices = BI.DeviceBI.Searching.Search(dbContext, term);
|
m.Devices = BI.DeviceBI.Searching.Search(dbContext, term, null, searchDetails);
|
||||||
if (m.Devices.Count == 1)
|
if (m.Devices.Count == 1)
|
||||||
{
|
{
|
||||||
return RedirectToAction(MVC.Device.Show(m.Devices[0].SerialNumber));
|
return RedirectToAction(MVC.Device.Show(m.Devices[0].SerialNumber));
|
||||||
|
|||||||
@@ -544,6 +544,11 @@
|
|||||||
<AutoGen>True</AutoGen>
|
<AutoGen>True</AutoGen>
|
||||||
<DesignTime>True</DesignTime>
|
<DesignTime>True</DesignTime>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Views\Device\DeviceParts\_Details.generated.cs">
|
||||||
|
<DependentUpon>_Details.cshtml</DependentUpon>
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
</Compile>
|
||||||
<Compile Include="Views\Device\DeviceParts\_AssignmentHistory.generated.cs">
|
<Compile Include="Views\Device\DeviceParts\_AssignmentHistory.generated.cs">
|
||||||
<AutoGen>True</AutoGen>
|
<AutoGen>True</AutoGen>
|
||||||
<DesignTime>True</DesignTime>
|
<DesignTime>True</DesignTime>
|
||||||
@@ -1438,6 +1443,10 @@
|
|||||||
<Generator>RazorGenerator</Generator>
|
<Generator>RazorGenerator</Generator>
|
||||||
<LastGenOutput>AddOffline.generated.cs</LastGenOutput>
|
<LastGenOutput>AddOffline.generated.cs</LastGenOutput>
|
||||||
</None>
|
</None>
|
||||||
|
<Content Include="Views\Device\DeviceParts\_Details.cshtml">
|
||||||
|
<Generator>RazorGenerator</Generator>
|
||||||
|
<LastGenOutput>_Details.generated.cs</LastGenOutput>
|
||||||
|
</Content>
|
||||||
<None Include="Views\Device\DeviceParts\_AssignmentHistory.cshtml">
|
<None Include="Views\Device\DeviceParts\_AssignmentHistory.cshtml">
|
||||||
<Generator>RazorGenerator</Generator>
|
<Generator>RazorGenerator</Generator>
|
||||||
<LastGenOutput>_AssignmentHistory.generated.cs</LastGenOutput>
|
<LastGenOutput>_AssignmentHistory.generated.cs</LastGenOutput>
|
||||||
@@ -1933,7 +1942,7 @@
|
|||||||
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
|
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
|
||||||
</WebProjectProperties>
|
</WebProjectProperties>
|
||||||
</FlavorProperties>
|
</FlavorProperties>
|
||||||
<UserProperties BuildVersion_UpdateFileVersion="True" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_DetectChanges="False" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildAction="Both" BuildVersion_StartDate="2011/7/1" />
|
<UserProperties BuildVersion_StartDate="2011/7/1" BuildVersion_BuildAction="Both" BuildVersion_UseGlobalSettings="False" BuildVersion_DetectChanges="False" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_UpdateFileVersion="True" />
|
||||||
</VisualStudio>
|
</VisualStudio>
|
||||||
</ProjectExtensions>
|
</ProjectExtensions>
|
||||||
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
||||||
|
|||||||
@@ -44,7 +44,8 @@ namespace Disco.Web
|
|||||||
using (DiscoDataContext dbContext = new DiscoDataContext())
|
using (DiscoDataContext dbContext = new DiscoDataContext())
|
||||||
{
|
{
|
||||||
// Check for Post-Update
|
// Check for Post-Update
|
||||||
bool isVersionUpdate = dbContext.DiscoConfiguration.InstalledDatabaseVersion != Disco.BI.Interop.Community.UpdateCheck.CurrentDiscoVersion();
|
var previousVersion = dbContext.DiscoConfiguration.InstalledDatabaseVersion;
|
||||||
|
bool isVersionUpdate = previousVersion != Disco.BI.Interop.Community.UpdateCheck.CurrentDiscoVersion();
|
||||||
bool ignoreVersionUpdate = false;
|
bool ignoreVersionUpdate = false;
|
||||||
|
|
||||||
if (isVersionUpdate)
|
if (isVersionUpdate)
|
||||||
@@ -100,7 +101,7 @@ namespace Disco.Web
|
|||||||
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
|
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
|
||||||
RouteConfig.RegisterUpdateRoutes(RouteTable.Routes);
|
RouteConfig.RegisterUpdateRoutes(RouteTable.Routes);
|
||||||
BundleConfig.RegisterBundles();
|
BundleConfig.RegisterBundles();
|
||||||
AppConfig.InitializeUpdateEnvironment(dbContext);
|
AppConfig.InitializeUpdateEnvironment(dbContext, previousVersion);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1191,12 +1191,14 @@ namespace Disco.Web.Controllers
|
|||||||
{
|
{
|
||||||
public readonly string _AssignmentHistory = "_AssignmentHistory";
|
public readonly string _AssignmentHistory = "_AssignmentHistory";
|
||||||
public readonly string _Certificates = "_Certificates";
|
public readonly string _Certificates = "_Certificates";
|
||||||
|
public readonly string _Details = "_Details";
|
||||||
public readonly string _Jobs = "_Jobs";
|
public readonly string _Jobs = "_Jobs";
|
||||||
public readonly string _Resources = "_Resources";
|
public readonly string _Resources = "_Resources";
|
||||||
public readonly string _Subject = "_Subject";
|
public readonly string _Subject = "_Subject";
|
||||||
}
|
}
|
||||||
public readonly string _AssignmentHistory = "~/Views/Device/DeviceParts/_AssignmentHistory.cshtml";
|
public readonly string _AssignmentHistory = "~/Views/Device/DeviceParts/_AssignmentHistory.cshtml";
|
||||||
public readonly string _Certificates = "~/Views/Device/DeviceParts/_Certificates.cshtml";
|
public readonly string _Certificates = "~/Views/Device/DeviceParts/_Certificates.cshtml";
|
||||||
|
public readonly string _Details = "~/Views/Device/DeviceParts/_Details.cshtml";
|
||||||
public readonly string _Jobs = "~/Views/Device/DeviceParts/_Jobs.cshtml";
|
public readonly string _Jobs = "~/Views/Device/DeviceParts/_Jobs.cshtml";
|
||||||
public readonly string _Resources = "~/Views/Device/DeviceParts/_Resources.cshtml";
|
public readonly string _Resources = "~/Views/Device/DeviceParts/_Resources.cshtml";
|
||||||
public readonly string _Subject = "~/Views/Device/DeviceParts/_Subject.cshtml";
|
public readonly string _Subject = "~/Views/Device/DeviceParts/_Subject.cshtml";
|
||||||
@@ -3386,6 +3388,7 @@ namespace Disco.Web.Areas.API.Controllers
|
|||||||
public readonly string ImportParse = "ImportParse";
|
public readonly string ImportParse = "ImportParse";
|
||||||
public readonly string ImportProcess = "ImportProcess";
|
public readonly string ImportProcess = "ImportProcess";
|
||||||
public readonly string ExportAllDevices = "ExportAllDevices";
|
public readonly string ExportAllDevices = "ExportAllDevices";
|
||||||
|
public readonly string MigrateDeviceMacAddressesFromLog = "MigrateDeviceMacAddressesFromLog";
|
||||||
}
|
}
|
||||||
|
|
||||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
@@ -3412,6 +3415,7 @@ namespace Disco.Web.Areas.API.Controllers
|
|||||||
public const string ImportParse = "ImportParse";
|
public const string ImportParse = "ImportParse";
|
||||||
public const string ImportProcess = "ImportProcess";
|
public const string ImportProcess = "ImportProcess";
|
||||||
public const string ExportAllDevices = "ExportAllDevices";
|
public const string ExportAllDevices = "ExportAllDevices";
|
||||||
|
public const string MigrateDeviceMacAddressesFromLog = "MigrateDeviceMacAddressesFromLog";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -3845,6 +3849,15 @@ namespace Disco.Web.Areas.API.Controllers
|
|||||||
return callInfo;
|
return callInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
partial void MigrateDeviceMacAddressesFromLogOverride(T4MVC_System_Web_Mvc_ActionResult callInfo);
|
||||||
|
|
||||||
|
public override System.Web.Mvc.ActionResult MigrateDeviceMacAddressesFromLog()
|
||||||
|
{
|
||||||
|
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.MigrateDeviceMacAddressesFromLog);
|
||||||
|
MigrateDeviceMacAddressesFromLogOverride(callInfo);
|
||||||
|
return callInfo;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
@model Disco.Web.Models.Device.ShowModel
|
||||||
|
<div id="DeviceDetailTab-Details" class="DevicePart">
|
||||||
|
<div id="DeviceDetailTab-DetailsContainer">
|
||||||
|
<table class="tableData">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th>LAN MAC Address</th>
|
||||||
|
<td>@(Model.Device.DeviceDetails.LanMacAddress() ?? "Unknown")</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>WLAN MAC Address</th>
|
||||||
|
<td>@(Model.Device.DeviceDetails.WLanMacAddress() ?? "Unknown")</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
$('#DeviceDetailTabItems').append('<li><a href="#DeviceDetailTab-Details">Details</a></li>');
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
#pragma warning disable 1591
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
// Runtime Version:4.0.30319.18051
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Disco.Web.Views.Device.DeviceParts
|
||||||
|
{
|
||||||
|
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", "2.0.0.0")]
|
||||||
|
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Device/DeviceParts/_Details.cshtml")]
|
||||||
|
public partial class Details : System.Web.Mvc.WebViewPage<Disco.Web.Models.Device.ShowModel>
|
||||||
|
{
|
||||||
|
public Details()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
public override void Execute()
|
||||||
|
{
|
||||||
|
WriteLiteral("<div");
|
||||||
|
|
||||||
|
WriteLiteral(" id=\"DeviceDetailTab-Details\"");
|
||||||
|
|
||||||
|
WriteLiteral(" class=\"DevicePart\"");
|
||||||
|
|
||||||
|
WriteLiteral(">\r\n <div");
|
||||||
|
|
||||||
|
WriteLiteral(" id=\"DeviceDetailTab-DetailsContainer\"");
|
||||||
|
|
||||||
|
WriteLiteral(">\r\n <table");
|
||||||
|
|
||||||
|
WriteLiteral(" class=\"tableData\"");
|
||||||
|
|
||||||
|
WriteLiteral(">\r\n <tbody>\r\n <tr>\r\n <th>LAN MAC Add" +
|
||||||
|
"ress</th>\r\n <td>");
|
||||||
|
|
||||||
|
|
||||||
|
#line 8 "..\..\Views\Device\DeviceParts\_Details.cshtml"
|
||||||
|
Write(Model.Device.DeviceDetails.LanMacAddress() ?? "Unknown");
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
WriteLiteral("</td>\r\n </tr>\r\n <tr>\r\n <th>WLAN " +
|
||||||
|
"MAC Address</th>\r\n <td>");
|
||||||
|
|
||||||
|
|
||||||
|
#line 12 "..\..\Views\Device\DeviceParts\_Details.cshtml"
|
||||||
|
Write(Model.Device.DeviceDetails.WLanMacAddress() ?? "Unknown");
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
WriteLiteral("</td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </div>\r" +
|
||||||
|
"\n <script>\r\n $(\'#DeviceDetailTabItems\').append(\'<li><a href=\"#DeviceDe" +
|
||||||
|
"tailTab-Details\">Details</a></li>\');\r\n </script>\r\n</div>\r\n");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#pragma warning restore 1591
|
||||||
@@ -46,6 +46,7 @@
|
|||||||
<div id="DeviceDetailTabs">
|
<div id="DeviceDetailTabs">
|
||||||
<ul id="DeviceDetailTabItems"></ul>
|
<ul id="DeviceDetailTabItems"></ul>
|
||||||
@Html.Partial(MVC.Device.Views.DeviceParts._Jobs, Model)
|
@Html.Partial(MVC.Device.Views.DeviceParts._Jobs, Model)
|
||||||
|
@Html.Partial(MVC.Device.Views.DeviceParts._Details, Model)
|
||||||
@Html.Partial(MVC.Device.Views.DeviceParts._AssignmentHistory, Model)
|
@Html.Partial(MVC.Device.Views.DeviceParts._AssignmentHistory, Model)
|
||||||
@Html.Partial(MVC.Device.Views.DeviceParts._Resources, Model)
|
@Html.Partial(MVC.Device.Views.DeviceParts._Resources, Model)
|
||||||
@Html.Partial(MVC.Device.Views.DeviceParts._Certificates, Model)
|
@Html.Partial(MVC.Device.Views.DeviceParts._Certificates, Model)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
// Runtime Version:4.0.30319.18033
|
// Runtime Version:4.0.30319.18051
|
||||||
//
|
//
|
||||||
// Changes to this file may cause incorrect behavior and will be lost if
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
// the code is regenerated.
|
// the code is regenerated.
|
||||||
@@ -155,7 +155,7 @@ WriteLiteral(" ");
|
|||||||
|
|
||||||
|
|
||||||
#line 49 "..\..\Views\Device\Show.cshtml"
|
#line 49 "..\..\Views\Device\Show.cshtml"
|
||||||
Write(Html.Partial(MVC.Device.Views.DeviceParts._AssignmentHistory, Model));
|
Write(Html.Partial(MVC.Device.Views.DeviceParts._Details, Model));
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
@@ -166,7 +166,7 @@ WriteLiteral(" ");
|
|||||||
|
|
||||||
|
|
||||||
#line 50 "..\..\Views\Device\Show.cshtml"
|
#line 50 "..\..\Views\Device\Show.cshtml"
|
||||||
Write(Html.Partial(MVC.Device.Views.DeviceParts._Resources, Model));
|
Write(Html.Partial(MVC.Device.Views.DeviceParts._AssignmentHistory, Model));
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
@@ -177,6 +177,17 @@ WriteLiteral(" ");
|
|||||||
|
|
||||||
|
|
||||||
#line 51 "..\..\Views\Device\Show.cshtml"
|
#line 51 "..\..\Views\Device\Show.cshtml"
|
||||||
|
Write(Html.Partial(MVC.Device.Views.DeviceParts._Resources, Model));
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
WriteLiteral("\r\n");
|
||||||
|
|
||||||
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
|
#line 52 "..\..\Views\Device\Show.cshtml"
|
||||||
Write(Html.Partial(MVC.Device.Views.DeviceParts._Certificates, Model));
|
Write(Html.Partial(MVC.Device.Views.DeviceParts._Certificates, Model));
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
@if (Model != null)
|
@if (Model != null)
|
||||||
{
|
{
|
||||||
@Html.Hidden("limit", Model)
|
@Html.Hidden("limit", Model)
|
||||||
if (Model == "jobs")
|
if (Model == "jobs" || Model == "devices")
|
||||||
{
|
{
|
||||||
<br />
|
<br />
|
||||||
<input type="checkbox" name="searchDetails" id="searchDetails" value="true" /><label
|
<input type="checkbox" name="searchDetails" id="searchDetails" value="true" /><label
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
// Runtime Version:4.0.30319.18033
|
// Runtime Version:4.0.30319.18051
|
||||||
//
|
//
|
||||||
// Changes to this file may cause incorrect behavior and will be lost if
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
// the code is regenerated.
|
// the code is regenerated.
|
||||||
@@ -108,7 +108,7 @@ WriteLiteral("\r\n");
|
|||||||
|
|
||||||
#line 15 "..\..\Views\Shared\_SearchDialog.cshtml"
|
#line 15 "..\..\Views\Shared\_SearchDialog.cshtml"
|
||||||
|
|
||||||
if (Model == "jobs")
|
if (Model == "jobs" || Model == "devices")
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user