Feature: Device Importing & Exporting
This commit is contained in:
@@ -0,0 +1,102 @@
|
||||
using Disco.Models.BI.Device;
|
||||
using Disco.Models.Repository;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Disco.BI.DeviceBI.Importing
|
||||
{
|
||||
public static class Export
|
||||
{
|
||||
private const string ExportHeader = "Serial Number,Device Model,Device Profile,Device Batch,Assigned User,Location,Asset Number";
|
||||
|
||||
public static MemoryStream GenerateExport(IQueryable<Device> Devices)
|
||||
{
|
||||
var devices = Devices.Select(d => new ImportDevice()
|
||||
{
|
||||
SerialNumber = d.SerialNumber,
|
||||
DeviceModelId = d.DeviceModelId,
|
||||
DeviceProfileId = d.DeviceProfileId,
|
||||
DeviceBatchId = d.DeviceBatchId,
|
||||
AssignedUserId = d.AssignedUserId,
|
||||
Location = d.Location,
|
||||
AssetNumber = d.AssetNumber
|
||||
});
|
||||
|
||||
MemoryStream exportStream = new MemoryStream();
|
||||
|
||||
StreamWriter exportWriter = new StreamWriter(exportStream);
|
||||
// Write Header
|
||||
exportWriter.WriteLine(ExportHeader);
|
||||
|
||||
foreach (var device in devices)
|
||||
device.ExportCsv(exportWriter);
|
||||
|
||||
exportWriter.Flush();
|
||||
|
||||
exportStream.Position = 0;
|
||||
return exportStream;
|
||||
}
|
||||
|
||||
private static void ExportCsv(this ImportDevice device, StreamWriter writer)
|
||||
{
|
||||
// SERIAL NUMBER
|
||||
writer.Write('"');
|
||||
writer.Write(device.SerialNumber.Replace("\"", "\"\""));
|
||||
writer.Write('"');
|
||||
|
||||
writer.Write(',');
|
||||
|
||||
// DEVICE MODEL
|
||||
if (device.DeviceModelId.HasValue)
|
||||
writer.Write(device.DeviceModelId.Value);
|
||||
|
||||
writer.Write(',');
|
||||
|
||||
// DEVICE PROFILE
|
||||
writer.Write(device.DeviceProfileId);
|
||||
|
||||
writer.Write(',');
|
||||
|
||||
// DEVICE BATCH
|
||||
if (device.DeviceBatchId.HasValue)
|
||||
writer.Write(device.DeviceBatchId.Value);
|
||||
|
||||
writer.Write(',');
|
||||
|
||||
// ASSIGNED USER
|
||||
if (device.AssignedUserId != null)
|
||||
{
|
||||
writer.Write('"');
|
||||
writer.Write(device.AssignedUserId.Replace("\"", "\"\""));
|
||||
writer.Write('"');
|
||||
}
|
||||
|
||||
writer.Write(',');
|
||||
|
||||
// LOCATION
|
||||
if (!string.IsNullOrWhiteSpace(device.Location))
|
||||
{
|
||||
writer.Write('"');
|
||||
writer.Write(device.Location.Replace("\"", "\"\""));
|
||||
writer.Write('"');
|
||||
}
|
||||
|
||||
writer.Write(',');
|
||||
|
||||
// ASSET NUMBER
|
||||
if (!string.IsNullOrWhiteSpace(device.AssetNumber))
|
||||
{
|
||||
writer.Write('"');
|
||||
writer.Write(device.AssetNumber.Replace("\"", "\"\""));
|
||||
writer.Write('"');
|
||||
}
|
||||
|
||||
writer.WriteLine();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -8,14 +8,23 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
using PopulateRecordReferences = System.Tuple<System.Collections.Generic.Dictionary<int, Disco.Models.Repository.DeviceModel>, System.Collections.Generic.Dictionary<int, Disco.Models.Repository.DeviceProfile>, System.Collections.Generic.Dictionary<int, Disco.Models.Repository.DeviceBatch>>;
|
||||
|
||||
namespace Disco.BI.DeviceBI.Importing
|
||||
{
|
||||
internal static class Import
|
||||
public static class Import
|
||||
{
|
||||
internal const string ImportParseCacheKey = "ImportParseResults_{0}";
|
||||
|
||||
internal static void ImportRecord(this ImportDevice device, DiscoDataContext dbContext, PopulateRecordReferences references)
|
||||
public static ImportDeviceSession GetSession(string ImportParseTaskId)
|
||||
{
|
||||
string parseKey = string.Format(ImportParseCacheKey, ImportParseTaskId);
|
||||
|
||||
return (ImportDeviceSession)HttpRuntime.Cache.Get(parseKey);
|
||||
}
|
||||
|
||||
internal static bool ImportRecord(this ImportDevice device, DiscoDataContext dbContext, PopulateRecordReferences references)
|
||||
{
|
||||
// Skips If Errors
|
||||
if (device.Errors == null || device.Errors.Count == 0)
|
||||
@@ -38,11 +47,16 @@ namespace Disco.BI.DeviceBI.Importing
|
||||
dbContext.Devices.Add(discoDevice);
|
||||
}
|
||||
|
||||
discoDevice.DeviceModelId = device.DeviceModelId;
|
||||
discoDevice.DeviceProfileId = device.DeviceProfileId;
|
||||
discoDevice.DeviceBatchId = device.DeviceBatchId;
|
||||
discoDevice.Location = device.Location;
|
||||
discoDevice.AssetNumber = device.AssetNumber;
|
||||
if (discoDevice.DeviceModelId != device.DeviceModelId)
|
||||
discoDevice.DeviceModelId = device.DeviceModelId;
|
||||
if (discoDevice.DeviceProfileId != device.DeviceProfileId)
|
||||
discoDevice.DeviceProfileId = device.DeviceProfileId;
|
||||
if (discoDevice.DeviceBatchId != device.DeviceBatchId)
|
||||
discoDevice.DeviceBatchId = device.DeviceBatchId;
|
||||
if (discoDevice.Location != device.Location)
|
||||
discoDevice.Location = device.Location;
|
||||
if (discoDevice.AssetNumber != device.AssetNumber)
|
||||
discoDevice.AssetNumber = device.AssetNumber;
|
||||
|
||||
if (discoDevice.AssignedUserId != device.AssignedUserId)
|
||||
{
|
||||
@@ -50,8 +64,11 @@ namespace Disco.BI.DeviceBI.Importing
|
||||
}
|
||||
|
||||
dbContext.SaveChanges();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
internal static PopulateRecordReferences GetPopulateRecordReferences(DiscoDataContext dbContext)
|
||||
@@ -72,7 +89,12 @@ namespace Disco.BI.DeviceBI.Importing
|
||||
|
||||
// SERIAL NUMBER - Existing Device
|
||||
if (!device.Errors.ContainsKey("SerialNumber"))
|
||||
{
|
||||
device.Device = dbContext.Devices.Find(device.SerialNumber);
|
||||
if (device.Device != null && device.Device.DecommissionedDate.HasValue)
|
||||
device.Errors.Add("SerialNumber", "The device is decommissioned");
|
||||
}
|
||||
|
||||
|
||||
// DEVICE MODEL
|
||||
if (!device.Errors.ContainsKey("DeviceModelId"))
|
||||
@@ -223,5 +245,21 @@ namespace Disco.BI.DeviceBI.Importing
|
||||
Errors = errors
|
||||
};
|
||||
}
|
||||
|
||||
#region ImportDevice Extensions
|
||||
|
||||
public static string ImportStatus(this ImportDevice device)
|
||||
{
|
||||
if (device.Errors.Count > 0)
|
||||
return "Error";
|
||||
|
||||
if (device.Device != null)
|
||||
return "Update";
|
||||
|
||||
return "New";
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,10 +22,9 @@ namespace Disco.BI.DeviceBI.Importing
|
||||
public override bool SingleInstanceTask { get { return false; } }
|
||||
public override bool CancelInitiallySupported { get { return false; } }
|
||||
|
||||
internal const string ImportParseCacheKey = "ImportParseResults_{0}";
|
||||
|
||||
protected override void ExecuteTask()
|
||||
{
|
||||
string csvFilename = (string)this.ExecutionContext.JobDetail.JobDataMap["CsvFilename"];
|
||||
MemoryStream csvStream = (MemoryStream)this.ExecutionContext.JobDetail.JobDataMap["CsvImport"];
|
||||
|
||||
this.Status.UpdateStatus(0, "Parsing CSV File", "Loading Records");
|
||||
@@ -64,12 +63,20 @@ namespace Disco.BI.DeviceBI.Importing
|
||||
}
|
||||
}
|
||||
|
||||
// Create Session Result
|
||||
ImportDeviceSession session = new ImportDeviceSession()
|
||||
{
|
||||
ImportParseTaskId = this.Status.SessionId,
|
||||
ImportFilename = csvFilename,
|
||||
ImportDevices = records
|
||||
};
|
||||
|
||||
// Set Results to Cache
|
||||
string key = string.Format(ImportParseCacheKey, this.Status.SessionId);
|
||||
HttpRuntime.Cache.Insert(key, records, null, Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(60), CacheItemPriority.NotRemovable, null);
|
||||
string key = string.Format(Import.ImportParseCacheKey, this.Status.SessionId);
|
||||
HttpRuntime.Cache.Insert(key, session, null, Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(60), CacheItemPriority.NotRemovable, null);
|
||||
}
|
||||
|
||||
public static ScheduledTaskStatus Run(Stream CsvImport)
|
||||
public static ScheduledTaskStatus Run(Stream CsvImport, String CsvFilename)
|
||||
{
|
||||
|
||||
MemoryStream csvStream = new MemoryStream();
|
||||
@@ -77,7 +84,7 @@ namespace Disco.BI.DeviceBI.Importing
|
||||
csvStream.Position = 0;
|
||||
|
||||
var task = new ImportParseTask();
|
||||
JobDataMap taskData = new JobDataMap() { { "CsvImport", csvStream } };
|
||||
JobDataMap taskData = new JobDataMap() { { "CsvImport", csvStream }, { "CsvFilename", CsvFilename } };
|
||||
return task.ScheduleTask(taskData);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,18 +20,19 @@ namespace Disco.BI.DeviceBI.Importing
|
||||
|
||||
protected override void ExecuteTask()
|
||||
{
|
||||
string parseKey = (string)this.ExecutionContext.JobDetail.JobDataMap["ParseKey"];
|
||||
string importParseTaskId = (string)this.ExecutionContext.JobDetail.JobDataMap["ImportParseTaskId"];
|
||||
|
||||
if (string.IsNullOrWhiteSpace(parseKey))
|
||||
throw new ArgumentNullException("ParseKey");
|
||||
if (string.IsNullOrWhiteSpace(importParseTaskId))
|
||||
throw new ArgumentNullException("ImportParseTaskId");
|
||||
|
||||
parseKey = string.Format(ImportParseTask.ImportParseCacheKey, parseKey);
|
||||
ImportDeviceSession session = Import.GetSession(importParseTaskId);
|
||||
|
||||
List<ImportDevice> records = (List<ImportDevice>)HttpRuntime.Cache.Get(parseKey);
|
||||
|
||||
if (records == null)
|
||||
if (session == null)
|
||||
throw new InvalidOperationException("The session timed out (60 minutes), try importing again");
|
||||
|
||||
List<ImportDevice> records = session.ImportDevices;
|
||||
int recordsImported = 0;
|
||||
|
||||
this.Status.UpdateStatus(0, "Processing Device Import", "Importing Devices");
|
||||
|
||||
using (DiscoDataContext dbContext = new DiscoDataContext())
|
||||
@@ -41,7 +42,8 @@ namespace Disco.BI.DeviceBI.Importing
|
||||
DateTime lastUpdate = DateTime.Now;
|
||||
foreach (var record in records)
|
||||
{
|
||||
record.ImportRecord(dbContext, populateReferences);
|
||||
if (record.ImportRecord(dbContext, populateReferences))
|
||||
recordsImported++;
|
||||
|
||||
if (DateTime.Now.Subtract(lastUpdate).TotalSeconds > 1)
|
||||
{
|
||||
@@ -52,15 +54,16 @@ namespace Disco.BI.DeviceBI.Importing
|
||||
}
|
||||
}
|
||||
|
||||
this.Status.SetFinishedMessage(string.Format("Imported {0} of {1} Devices", recordsImported, records.Count));
|
||||
}
|
||||
|
||||
public static ScheduledTaskStatus Run(string ParseTaskSessionKey)
|
||||
public static ScheduledTaskStatus Run(string ImportParseTaskId)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(ParseTaskSessionKey))
|
||||
throw new ArgumentNullException("ParseTaskSessionKey");
|
||||
if (string.IsNullOrWhiteSpace(ImportParseTaskId))
|
||||
throw new ArgumentNullException("ImportParseTaskId");
|
||||
|
||||
var task = new ImportProcessTask();
|
||||
JobDataMap taskData = new JobDataMap() { { "ParseKey", ParseTaskSessionKey } };
|
||||
JobDataMap taskData = new JobDataMap() { { "ImportParseTaskId", ImportParseTaskId } };
|
||||
return task.ScheduleTask(taskData);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,6 +123,7 @@
|
||||
<Compile Include="BI\AttachmentBI\Utilities.cs" />
|
||||
<Compile Include="BI\DeviceBI\BatchUtilities.cs" />
|
||||
<Compile Include="BI\DeviceBI\DeviceModelBI.cs" />
|
||||
<Compile Include="BI\DeviceBI\Importing\Export.cs" />
|
||||
<Compile Include="BI\DeviceBI\Importing\Import.cs" />
|
||||
<Compile Include="BI\DeviceBI\Importing\ImportParseTask.cs" />
|
||||
<Compile Include="BI\DeviceBI\Importing\ImportProcessTask.cs" />
|
||||
@@ -251,9 +252,7 @@
|
||||
<ItemGroup>
|
||||
<None Include="Resources\MimeType-unknown48.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="BI\CertificateBI\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
|
||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.2.0722.2112")]
|
||||
[assembly: AssemblyFileVersion("1.2.0722.2112")]
|
||||
[assembly: AssemblyVersion("1.2.0725.1725")]
|
||||
[assembly: AssemblyFileVersion("1.2.0725.1725")]
|
||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.2.0722.2115")]
|
||||
[assembly: AssemblyFileVersion("1.2.0722.2115")]
|
||||
[assembly: AssemblyVersion("1.2.0725.1725")]
|
||||
[assembly: AssemblyFileVersion("1.2.0725.1725")]
|
||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.2.0722.2047")]
|
||||
[assembly: AssemblyFileVersion("1.2.0722.2047")]
|
||||
[assembly: AssemblyVersion("1.2.0725.1725")]
|
||||
[assembly: AssemblyFileVersion("1.2.0725.1725")]
|
||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.2.0722.2112")]
|
||||
[assembly: AssemblyFileVersion("1.2.0722.2112")]
|
||||
[assembly: AssemblyVersion("1.2.0725.1725")]
|
||||
[assembly: AssemblyFileVersion("1.2.0725.1725")]
|
||||
@@ -28,7 +28,6 @@ namespace Disco.Models.BI.Device
|
||||
[StringLength(40)]
|
||||
public string AssetNumber { get; set; }
|
||||
|
||||
|
||||
public Repository.Device Device { get; set; }
|
||||
public Repository.DeviceModel DeviceModel { get; set; }
|
||||
public Repository.DeviceProfile DeviceProfile { get; set; }
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Disco.Models.BI.Device
|
||||
{
|
||||
public class ImportDeviceSession
|
||||
{
|
||||
public string ImportParseTaskId { get; set; }
|
||||
public string ImportFilename { get; set; }
|
||||
public List<ImportDevice> ImportDevices { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -47,6 +47,7 @@
|
||||
<ItemGroup>
|
||||
<Compile Include="BI\Config\OrganisationAddress.cs" />
|
||||
<Compile Include="BI\Device\ImportDevice.cs" />
|
||||
<Compile Include="BI\Device\ImportDeviceSession.cs" />
|
||||
<Compile Include="BI\DocumentTemplate\DocumentState.cs" />
|
||||
<Compile Include="BI\Expressions\IImageExpressionResult.cs" />
|
||||
<Compile Include="BI\Interop\Community\PluginLibraryCompatibilityItem.cs" />
|
||||
@@ -102,10 +103,11 @@
|
||||
<Compile Include="UI\Config\DeviceBatch\ConfigDeviceBatchIndexModel.cs" />
|
||||
<Compile Include="UI\Config\DeviceBatch\ConfigDeviceBatchIndexModelItem.cs" />
|
||||
<Compile Include="UI\Config\DeviceBatch\ConfigDeviceBatchShowModel.cs" />
|
||||
<Compile Include="UI\Config\DeviceBatch\ConfigDeviceBatchShowModelMembership.cs" />
|
||||
<Compile Include="UI\Config\DeviceBatch\ConfigDeviceBatchTimelineModel.cs" />
|
||||
<Compile Include="UI\Config\DeviceModel\ConfigDeviceModelIndexModel.cs" />
|
||||
<Compile Include="UI\Config\DeviceModel\ConfigDeviceModelIndexModelItem.cs" />
|
||||
<Compile Include="UI\Config\DeviceModel\ConfigDeviceModelShowModelComponents.cs" />
|
||||
<Compile Include="UI\Config\DeviceModel\ConfigDeviceModelComponentsModel.cs" />
|
||||
<Compile Include="UI\Config\DeviceModel\ConfigDeviceModelShowModel.cs" />
|
||||
<Compile Include="UI\Config\DeviceProfile\ConfigDeviceProfileCreateModel.cs" />
|
||||
<Compile Include="UI\Config\DeviceProfile\ConfigDeviceProfileDefaultsModel.cs" />
|
||||
@@ -125,6 +127,7 @@
|
||||
<Compile Include="UI\Config\Organisation\ConfigOrganisationIndexModel.cs" />
|
||||
<Compile Include="UI\Device\DeviceAddOfflineModel.cs" />
|
||||
<Compile Include="UI\Device\DeviceImportModel.cs" />
|
||||
<Compile Include="UI\Device\DeviceImportReviewModel.cs" />
|
||||
<Compile Include="UI\Device\DeviceIndexModel.cs" />
|
||||
<Compile Include="UI\Device\DeviceShowModel.cs" />
|
||||
<Compile Include="UI\Job\JobCreateModel.cs" />
|
||||
|
||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.2.0722.2112")]
|
||||
[assembly: AssemblyFileVersion("1.2.0722.2112")]
|
||||
[assembly: AssemblyVersion("1.2.0725.1725")]
|
||||
[assembly: AssemblyFileVersion("1.2.0725.1725")]
|
||||
@@ -0,0 +1,16 @@
|
||||
using Disco.Models.BI.Device;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Disco.Models.UI.Device
|
||||
{
|
||||
public interface DeviceImportReviewModel : BaseUIModel
|
||||
{
|
||||
string ImportParseTaskId { get; set; }
|
||||
string ImportFilename { get; set; }
|
||||
List<ImportDevice> ImportDevices { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.2.0722.2112")]
|
||||
[assembly: AssemblyFileVersion("1.2.0722.2112")]
|
||||
[assembly: AssemblyVersion("1.2.0725.1725")]
|
||||
[assembly: AssemblyFileVersion("1.2.0725.1725")]
|
||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.2.0722.2112")]
|
||||
[assembly: AssemblyFileVersion("1.2.0722.2112")]
|
||||
[assembly: AssemblyVersion("1.2.0725.1725")]
|
||||
[assembly: AssemblyFileVersion("1.2.0725.1725")]
|
||||
@@ -465,5 +465,22 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Exporting
|
||||
public virtual ActionResult ExportDevices(int id)
|
||||
{
|
||||
DeviceBatch db = dbContext.DeviceBatches.Find(id);
|
||||
if (db == null)
|
||||
throw new ArgumentNullException("id", "Invalid Device Batch Id");
|
||||
|
||||
var devices = dbContext.Devices.Where(d => !d.DecommissionedDate.HasValue && d.DeviceBatchId == db.Id);
|
||||
|
||||
var export = BI.DeviceBI.Importing.Export.GenerateExport(devices);
|
||||
|
||||
var filename = string.Format("DiscoDeviceExport-Batch_{0}-{1:yyyyMMdd-HHmmss}.csv", db.Id, DateTime.Now);
|
||||
|
||||
return File(export, "text/csv", filename);
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -464,14 +464,19 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
|
||||
#endregion
|
||||
|
||||
#region Importing / Exporting
|
||||
public virtual ActionResult ImportParse(HttpPostedFileBase ImportFile)
|
||||
{
|
||||
if (ImportFile == null || ImportFile.ContentLength == 0)
|
||||
throw new ArgumentNullException("ImportFile");
|
||||
|
||||
var status = Disco.BI.DeviceBI.Importing.ImportParseTask.Run(ImportFile.InputStream);
|
||||
var fileName = ImportFile.FileName;
|
||||
if (fileName.Contains(@"\"))
|
||||
fileName = fileName.Substring(fileName.LastIndexOf('\\') + 1);
|
||||
|
||||
status.SetFinishedUrl(Url.Action(MVC.API.Device.ImportProcess(status.SessionId)));
|
||||
var status = Disco.BI.DeviceBI.Importing.ImportParseTask.Run(ImportFile.InputStream, fileName);
|
||||
|
||||
status.SetFinishedUrl(Url.Action(MVC.Device.ImportReview(status.SessionId)));
|
||||
|
||||
return RedirectToAction(MVC.Config.Logging.TaskStatus(status.SessionId));
|
||||
}
|
||||
@@ -483,8 +488,23 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
|
||||
var status = Disco.BI.DeviceBI.Importing.ImportProcessTask.Run(ParseTaskSessionKey);
|
||||
|
||||
status.SetFinishedUrl(Url.Action(MVC.Device.Index()));
|
||||
|
||||
return RedirectToAction(MVC.Config.Logging.TaskStatus(status.SessionId));
|
||||
}
|
||||
|
||||
public virtual ActionResult ExportAllDevices()
|
||||
{
|
||||
// Non-Decommissioned Devices
|
||||
var devices = dbContext.Devices.Where(d => !d.DecommissionedDate.HasValue);
|
||||
|
||||
var export = BI.DeviceBI.Importing.Export.GenerateExport(devices);
|
||||
|
||||
var filename = string.Format("DiscoDeviceExport-AllDevices-{0:yyyyMMdd-HHmmss}.csv", DateTime.Now);
|
||||
|
||||
return File(export, "text/csv", filename);
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -334,5 +334,22 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Exporting
|
||||
public virtual ActionResult ExportDevices(int id)
|
||||
{
|
||||
DeviceModel dm = dbContext.DeviceModels.Find(id);
|
||||
if (dm == null)
|
||||
throw new ArgumentNullException("id", "Invalid Device Model Id");
|
||||
|
||||
var devices = dbContext.Devices.Where(d => !d.DecommissionedDate.HasValue && d.DeviceModelId == dm.Id);
|
||||
|
||||
var export = BI.DeviceBI.Importing.Export.GenerateExport(devices);
|
||||
|
||||
var filename = string.Format("DiscoDeviceExport-Model_{0}-{1:yyyyMMdd-HHmmss}.csv", dm.Id, DateTime.Now);
|
||||
|
||||
return File(export, "text/csv", filename);
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.Web.Mvc;
|
||||
using Disco.BI;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Data.Configuration.Modules;
|
||||
using Disco.Models.Repository;
|
||||
|
||||
namespace Disco.Web.Areas.API.Controllers
|
||||
{
|
||||
@@ -389,5 +390,22 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Exporting
|
||||
public virtual ActionResult ExportDevices(int id)
|
||||
{
|
||||
DeviceProfile dp = dbContext.DeviceProfiles.Find(id);
|
||||
if (dp == null)
|
||||
throw new ArgumentNullException("id", "Invalid Device Profile Id");
|
||||
|
||||
var devices = dbContext.Devices.Where(d => !d.DecommissionedDate.HasValue && d.DeviceProfileId == dp.Id);
|
||||
|
||||
var export = BI.DeviceBI.Importing.Export.GenerateExport(devices);
|
||||
|
||||
var filename = string.Format("DiscoDeviceExport-Profile_{0}-{1:yyyyMMdd-HHmmss}.csv", dp.Id, DateTime.Now);
|
||||
|
||||
return File(export, "text/csv", filename);
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1195,6 +1195,10 @@ body .ui-tooltip {
|
||||
.tableData > tbody > tr:hover > td {
|
||||
background-color: #e8eef4;
|
||||
}
|
||||
.tableData > tfoot > tr > th,
|
||||
.tableData > tfoot > tr > td {
|
||||
background-color: #e8eef4;
|
||||
}
|
||||
.tableDataDark {
|
||||
border: solid 1px #8db2d8;
|
||||
border-collapse: collapse;
|
||||
@@ -1668,6 +1672,10 @@ table.genericData > tbody > tr > th {
|
||||
table.genericData > tbody > tr:hover > td {
|
||||
background-color: #e8eef4;
|
||||
}
|
||||
table.genericData > tfoot > tr > th,
|
||||
table.genericData > tfoot > tr > td {
|
||||
background-color: #e8eef4;
|
||||
}
|
||||
table.genericData td.id {
|
||||
text-align: center;
|
||||
}
|
||||
@@ -1889,6 +1897,10 @@ table.jobTable > tbody > tr > th {
|
||||
table.jobTable > tbody > tr:hover > td {
|
||||
background-color: #e8eef4;
|
||||
}
|
||||
table.jobTable > tfoot > tr > th,
|
||||
table.jobTable > tfoot > tr > td {
|
||||
background-color: #e8eef4;
|
||||
}
|
||||
table.jobTable.hideStatusClosed tr[data-status=Closed] {
|
||||
display: none;
|
||||
}
|
||||
@@ -2217,7 +2229,7 @@ div.columnHost .column50 {
|
||||
white-space: nowrap;
|
||||
}
|
||||
.code {
|
||||
font-family: Consolas, monospace;
|
||||
font-family: Consolas, "Courier New", monospace;
|
||||
}
|
||||
div.code {
|
||||
border: 1px dashed #bbb;
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -17,6 +17,10 @@
|
||||
.tableData > tbody > tr:hover > td {
|
||||
background-color: #e8eef4;
|
||||
}
|
||||
.tableData > tfoot > tr > th,
|
||||
.tableData > tfoot > tr > td {
|
||||
background-color: #e8eef4;
|
||||
}
|
||||
.tableDataDark {
|
||||
border: solid 1px #8db2d8;
|
||||
border-collapse: collapse;
|
||||
@@ -140,6 +144,10 @@ table.expressionsTable > tbody > tr > th {
|
||||
table.expressionsTable > tbody > tr:hover > td {
|
||||
background-color: #e8eef4;
|
||||
}
|
||||
table.expressionsTable > tfoot > tr > th,
|
||||
table.expressionsTable > tfoot > tr > td {
|
||||
background-color: #e8eef4;
|
||||
}
|
||||
table.expressionsTable td.parseError {
|
||||
background-color: #FFD8D8;
|
||||
}
|
||||
@@ -165,6 +173,10 @@ table.expressionsTable td.parseError {
|
||||
#deviceComponents > tbody > tr:hover > td {
|
||||
background-color: #e8eef4;
|
||||
}
|
||||
#deviceComponents > tfoot > tr > th,
|
||||
#deviceComponents > tfoot > tr > td {
|
||||
background-color: #e8eef4;
|
||||
}
|
||||
#deviceComponents tr th.actions {
|
||||
width: 20px;
|
||||
}
|
||||
@@ -522,7 +534,7 @@ div.logEventsViewport table.logEventsViewport > tbody > tr > td.eventType {
|
||||
margin-left: 6px;
|
||||
background-color: #222;
|
||||
color: #0F0;
|
||||
font-family: Consolas, monospace;
|
||||
font-family: Consolas, "Courier New", monospace;
|
||||
border: 4px solid #CCC;
|
||||
-moz-border-radius: 4px;
|
||||
-webkit-border-radius: 4px;
|
||||
|
||||
@@ -641,7 +641,7 @@ div.logEventsViewport
|
||||
margin-left: 6px;
|
||||
background-color: #222;
|
||||
color: #0F0;
|
||||
font-family: Consolas, monospace;
|
||||
font-family: @FontFamilyMono;
|
||||
border: 4px solid #CCC;
|
||||
-moz-border-radius: 4px;
|
||||
-webkit-border-radius: 4px;
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
|
||||
#organisationCredits span.message {
|
||||
#organisationCredits span.message {
|
||||
color: #888;
|
||||
}
|
||||
#organisationCredits a {
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -25,6 +25,7 @@
|
||||
|
||||
@FontFamilyBody: "Segoe UI", Arial, Verdana, Tahoma, sans-serif;
|
||||
@FontFamilyHeading: "Segoe UI", Arial, Verdana, Tahoma, sans-serif;
|
||||
@FontFamilyMono: Consolas, "Courier New", monospace;
|
||||
@FontWeightHeading: lighter;
|
||||
@FontStretchHeading: condensed;
|
||||
|
||||
|
||||
@@ -17,6 +17,10 @@
|
||||
.tableData > tbody > tr:hover > td {
|
||||
background-color: #e8eef4;
|
||||
}
|
||||
.tableData > tfoot > tr > th,
|
||||
.tableData > tfoot > tr > td {
|
||||
background-color: #e8eef4;
|
||||
}
|
||||
.tableDataDark {
|
||||
border: solid 1px #8db2d8;
|
||||
border-collapse: collapse;
|
||||
@@ -319,3 +323,92 @@
|
||||
#deviceShowResources #Attachments div.attachmentInput span.photo {
|
||||
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAALH0lEQVRYw8WXa4xd11XHf2vvfc59zJ33y+PxYzyel2dsx48hdnCaNMFNFUGgkKCoKLxCE1EJKgoBCbW0fACpoihSUVBQUgW1FCRaJURRcF4iL8eJkzbYY0+Sie3YHs/kzvt13/eeffbmwx07IMFnjnTO3ufonL3+67/W2ue/xHvP/+chfX27+J3ffoCRwV307x5ibP8hWluauf22YwwNDjA2tofBgSFuOniYP/rjR8jOXqO7u4utPVvYu3eM4ZFh9u0/THNLKzftHWXfvlFGR4YZ3bOHA4cOc9udd+nmpsb23i1do4PDI7f+60+eebparX6ktQHA/O+4fP30vj4Azjni2BLbCBvVcHGEjy0+jolrFfp39TU1ZBq2490hH9vDcVQZK2ys9p0/826HSbWlK16FTcmApcWl9kQq/fUgCBBRGO/hRhi8wzmHtZYoqhHHFu8sOIuLa7S0tISlQr7TaHWT4Mdxdr+3lYFSYbVn8sMPm7wEYcWJym54Li96XsoWyE6VWVhf4NN1y7d+Yyf7R3cPtbZ3kEyl0VpjnItxLt40FGOjCsPDw23JRLIfH497Zw8R1/bUSvkdj373r1slbE7FXpnFKlxZ9ExlK7z4swJzqwus5S2lmsM7h1YKEyiSRhEYoTVlWM7Dvn37+u657zdvcG2SyeQRG9XudbHd4+Jqf7W41v3+mXMZLyosOpHpZc+lOcsPP8ox+2aR5Y1VCuWYWuxQogi0kAyEQCtSgZBJBCjxiFZoJSjRKOUx1jC/DneP7esCNBADmC/dc/cjf/Wdv73v+XOWdxdLPP1mkfm1LLliRLEa47xDI+hAERoIlaKtMUBrUAhKQIkgIoholN6cK6k/VwpBIVqxVPB0HxpobGrMtBQLhZUwkcCcnzjzdrnq7/vOM9MkxZJJKRJGSCWEhoSpLwTIDUMKJR6tQLzgtUFwiNKIEjSC1/URrRC1+Y0SChWPMsmwo615sLU5sxImkpjL12bf0xL7Pb2NUigWSASCEoUClNQvSkA8eBGUEgRBhLqnWvBiEJE65Urwqs6CUmrzfUVCacqxB6Vlx7atB5U2p4MgxKysrF9wtlbb0Z1JXLxWIxF4tBLwgjJqs0IEUSAIKI9gEPGIZtOwBhFEeYySzXndEa3qcy0aGynKwPDQ4IEwkSJIJDDr6+ura/OfFPt6RhOXsgFBSL3+xaEDjfebxqXuNQqMaLwCBegbLAkaj9KgUIjWmwwotBZAExvFmoOxvXv3tLV3kEynMbFz8fnzk4u7D+9tezVhCBP1eHtfX72eSCBKoUXQOkTCEGVriLcgghKP2qRfXQ+TaLRWiCh0KKTS0BJCycPBQ+PbP3fHXfUyfPzvvsuZsxNXHvjil0fCRIAJPUrxWYzFo8UgClSYAlvCzU6QHhhHfIi3MXIdwH/Lfq0FZYRME+gEzF5Z5+RzP+KN2lW+962vtxljEtbaqnnn9E+pVSvn2zV3N6YSJE1cz3L9Ge2iFNqESACJt39EfvJNXn31MPc88idQEbxjE7TURw3pRggzMHXmAm/+8/eYm3iNteVZerZvJ5X5drqrs6uzWCzOmo+mPsZ7f0bhaG0KIBa0Bu2lnmTXyyijUGdfJly8QFN/P1vfPc3Vc5e49RcHcDVwFrwDrcEkYebyIuf/8Sny504yZgz7bxplobqdy3Oz4L3p7ure7/Gz5sLFT2hsajrr4yjubg31ak4T1pMaLXUAOqlwuXXspVPM5xxDXQ388p0H+P7TT6LNvSx/cpEdg6P07uqjEpWYPfsWc//+E3oyhsMHb2ZhYZG55RVaMhlWK/MsLM+xe2hoPBEGJ8xGvkA1qs1uLM7UtjQPpIplRTqsU+kFRIFJQfWnLxHbKtZrenq7efGt95n/9D1W/uYVJqYu4pXHJDOkUoYH77iVge42yk746Mo0nQ0NSOxYWFvkC7vHafUwsmdkf3NzMya2ltmZ6cKpk2+sbj0+0DtZKqBrVbwWkqlmdGAoTk2RnjlD2BAyVyryzcf+iYnJ89z1uT6KJUGMQaihraXBG05+NMVY1wgd6QZev/oetaLl/i98nl628s7rpzh35jKHDx0a+NUv/Qpmfm6B+cWlp44c+3zXlk7YMbxIXC6ighSJ1hCco5CEcPh+onQHTR98zM4DBzk2fgjjoUKVXKmIjzyGkPWlZZ58+imWN1bI56rcOn4bP/y3E7x2Psfgni7W2gLm3Qzjo8d7AJGrly+rnbt2VYCgLj3qm8D7b59kOvspnVs78Klmpi5+yi+MHyA7c5XHHn+MB379t5hfXeDnjx6je0s3yTBJmA6p1ark8wUKG2s8+vhfkExamtOQnZnFN6+wlM/S2d7Oo9/4uNyzZdtWc25ycteOnTuNKIV1UMitkG5sYq1iKKokPq9JVIuszF9h9lorG6t55pbXCDJp+lt2kCvlKF4tkUw00NXZRjqTpJAvo2iA5qu8eOY/6U8JnSnD4rylsOHJXl4AHyU6O7v6zfMnThw7fvy4pFIpquUy1YrF2Tx33P5ziCjwELuYu24ep1gtASmOf/FOfnb6XWreUKlUWVtfYvqTKxw8dICWjg7KhQKN6XZuG/t9XjnxMBdCz3ImIt1h2NLdTG/PdhKJlBocGLjDXLp4uVqulEmlUhTLJYqVIuJhY22DyFapuhqFYo1qLcKWKpSVxZYKFIolhvqHmF5Y4S//4M+4NHeJIAh48MGv8mv330tHe8D2LSP8+df+lP7Rg/R1DaJMiy2vx+WZ2ez6k0/8IDv18YfnzPLSkirlirS1tkEc46wH8XjxeCXEFY94j3EWZ2JSTjOfy3H77bfR0dZD9toLTM1fpOXHY6x/bZIf/8sPeOirD9O7tR0jjpdebjh54tnnTszOzJyfX8yeW1xcWHr99VcryVSCYrGEKRRLUq5WN0W6oLQC71FaEfkIYwQVORweFwveR5gwIG2SOGcp5PNohPXvT8I2xda5bnL5dYJEPyjhwsUP/hDUhPeOjY0clUqJIDBordBaYSJbpRZFAFhncXG8+TcUrLVUqxFRFOOcx+OJHTQkM0ycPUfL1h4uzkzzjUe+zbsvv4YkNYO/NMbk2XMM7t7NxMQZ29rcvIj3XLkS31DfIvKZKBWluH6fNElIQxiGWGuJ45ggGYKAUnKdJJRJsby8TMXG7O7bRSqT5sixo7z21huUygUyjQ18+MEkL77wwsW5uexcGIQsLS2Sy60CEEUR3nu895hCLn8DjXWWUqlELpcjjmNEhEKuQKVSJrIWFzu8jwFFKt3A2toKx245ShgGvPjKf9Da2sTIyCANqTQfTE7aI0eOfPl3v/J7/7MVE6FQyGOtrQN46KGvJFZX68gaGxspFIo4F2GMwQQB6XSNKLKI1rgophJVcJsfb+vbzrVr0zQ3NjE6MkAutxWjNesb6/HNR49+s1DIT9R3Nm40oNfDcOHCP9QBPfHEE52nTp169ZYjRwfzubxGeVFKS2ytVKpVbGTBQ6lSxsYWnMM5X++g4gjn6osGWhMkEiTCRGVwePDN0bHRv49tnI3j+HIqlVrz1FW1MYYwDGlpaWF8fBzp6uoyDz38cIez8eHTp9/ZeW1mZqCQz2+LarU2B+nYxaEgOo5jtenNZr/ovYh4rXVstLZ4V1UmyLW2tMwEYfhJ9tPsVKlcOq+UWq5UKsX/szvu3bYjfP7557p7e3srb508GU5OTmamp6cbs9lsx/LySls+n2uslCsNNrYJ55xxzmkQH8c2NsZEqWS61NbeWtBWrzvxK80dLRvDQ0OV3f27q88++8zSLUePFvWmxpPPEmFTOyr+C6xPNMD6P8TnAAAAAElFTkSuQmCC) /*Images/Actions/photo.png*/;
|
||||
}
|
||||
#deviceImport #ImportFile {
|
||||
width: 100%;
|
||||
}
|
||||
#deviceImport #documentation {
|
||||
width: 700px;
|
||||
margin: 20px auto;
|
||||
}
|
||||
#deviceImport #documentation > table > thead > tr > th:first-child {
|
||||
width: 100px;
|
||||
}
|
||||
#deviceImportReview #errorMessage {
|
||||
font-weight: bold;
|
||||
color: red;
|
||||
}
|
||||
#deviceImportReview #devicesNavigation {
|
||||
margin-top: 15px;
|
||||
text-align: right;
|
||||
}
|
||||
#deviceImportReview #devicesNavigation ul {
|
||||
display: inline-block;
|
||||
padding: 1px;
|
||||
border: 1px solid #bbb;
|
||||
}
|
||||
#deviceImportReview #devicesNavigation ul li {
|
||||
display: inline-block;
|
||||
padding: 1px 6px;
|
||||
margin: 0;
|
||||
}
|
||||
#deviceImportReview #devicesNavigation ul li.statusError {
|
||||
background-color: #ffd3d3;
|
||||
}
|
||||
#deviceImportReview #devicesNavigation ul li.statusUpdate {
|
||||
background-color: #d3f3ff;
|
||||
}
|
||||
#deviceImportReview #devicesNavigation ul li.statusNew {
|
||||
background-color: #d9ffb4;
|
||||
}
|
||||
#deviceImportReview #devices {
|
||||
border: solid 1px #e8eef4;
|
||||
border-collapse: collapse;
|
||||
margin-top: 6px;
|
||||
}
|
||||
#deviceImportReview #devices > tbody > tr > td {
|
||||
border: solid 1px #e8eef4;
|
||||
background-color: #fff;
|
||||
}
|
||||
#deviceImportReview #devices > tbody > tr:nth-child(odd) > td {
|
||||
background-color: #fcfcfd;
|
||||
}
|
||||
#deviceImportReview #devices > thead > tr > th,
|
||||
#deviceImportReview #devices > tbody > tr > th {
|
||||
background-color: #e8eef4;
|
||||
border: solid 1px #e8eef4;
|
||||
}
|
||||
#deviceImportReview #devices > tbody > tr:hover > td {
|
||||
background-color: #e8eef4;
|
||||
}
|
||||
#deviceImportReview #devices > tfoot > tr > th,
|
||||
#deviceImportReview #devices > tfoot > tr > td {
|
||||
background-color: #e8eef4;
|
||||
}
|
||||
#deviceImportReview #devices > tbody td {
|
||||
vertical-align: middle;
|
||||
min-height: 32px;
|
||||
}
|
||||
#deviceImportReview #devices > tbody tr.statusError td {
|
||||
background-color: #ffd3d3;
|
||||
}
|
||||
#deviceImportReview #devices > tbody tr.statusUpdate td {
|
||||
background-color: #d3f3ff;
|
||||
}
|
||||
#deviceImportReview #devices > tbody tr.statusNew td {
|
||||
background-color: #d9ffb4;
|
||||
}
|
||||
#deviceImportReview #devices > tbody tr td.action {
|
||||
font-weight: bold;
|
||||
}
|
||||
#deviceImportReview #devices > tbody tr td.serialNumber {
|
||||
font-family: Consolas, "Courier New", monospace;
|
||||
font-weight: bold;
|
||||
}
|
||||
#deviceImportReview #devices > tbody tr td.model img.modelImage {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
margin-right: 2px;
|
||||
}
|
||||
#deviceImportReview #devices > tbody .error {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
@@ -309,3 +309,120 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#deviceImport {
|
||||
#ImportFile {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#documentation {
|
||||
width: 700px;
|
||||
margin: 20px auto;
|
||||
|
||||
& > table {
|
||||
& > thead > tr > th:first-child {
|
||||
width: 100px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#deviceImportReview {
|
||||
|
||||
#errorMessage {
|
||||
font-weight: bold;
|
||||
color: red;
|
||||
}
|
||||
|
||||
#devicesNavigation {
|
||||
margin-top: 15px;
|
||||
text-align: right;
|
||||
|
||||
ul {
|
||||
display: inline-block;
|
||||
padding: 1px;
|
||||
border: 1px solid #bbb;
|
||||
|
||||
li {
|
||||
display: inline-block;
|
||||
padding: 1px 6px;
|
||||
margin: 0;
|
||||
|
||||
&.statusError {
|
||||
background-color: #ffd3d3;
|
||||
}
|
||||
|
||||
&.statusUpdate {
|
||||
background-color: #d3f3ff;
|
||||
}
|
||||
|
||||
&.statusNew {
|
||||
background-color: #d9ffb4;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#devices {
|
||||
.tableData;
|
||||
margin-top: 6px;
|
||||
|
||||
& > tbody {
|
||||
|
||||
td {
|
||||
vertical-align: middle;
|
||||
min-height: 32px;
|
||||
}
|
||||
|
||||
tr.statusError td {
|
||||
background-color: #ffd3d3;
|
||||
}
|
||||
|
||||
tr.statusUpdate td {
|
||||
background-color: #d3f3ff;
|
||||
}
|
||||
|
||||
tr.statusNew td {
|
||||
background-color: #d9ffb4;
|
||||
}
|
||||
|
||||
tr {
|
||||
td.action {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
td.serialNumber {
|
||||
font-family: @FontFamilyMono;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
td.model {
|
||||
img.modelImage {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
margin-right: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
td.profile {
|
||||
}
|
||||
|
||||
td.batch {
|
||||
}
|
||||
|
||||
td.assignedUser {
|
||||
}
|
||||
|
||||
td.location {
|
||||
}
|
||||
|
||||
td.assetNumber {
|
||||
}
|
||||
}
|
||||
|
||||
.error {
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -1,15 +1,26 @@
|
||||
.tableData {
|
||||
.tableData {
|
||||
border: solid 1px #e8eef4;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
.tableData td {
|
||||
.tableData > tbody > tr > td {
|
||||
border: solid 1px #e8eef4;
|
||||
background-color: #fff;
|
||||
}
|
||||
.tableData th {
|
||||
.tableData > tbody > tr:nth-child(odd) > td {
|
||||
background-color: #fcfcfd;
|
||||
}
|
||||
.tableData > thead > tr > th,
|
||||
.tableData > tbody > tr > th {
|
||||
background-color: #e8eef4;
|
||||
border: solid 1px #e8eef4;
|
||||
}
|
||||
.tableData > tbody > tr:hover > td {
|
||||
background-color: #e8eef4;
|
||||
}
|
||||
.tableData > tfoot > tr > th,
|
||||
.tableData > tfoot > tr > td {
|
||||
background-color: #e8eef4;
|
||||
}
|
||||
.tableDataDark {
|
||||
border: solid 1px #8db2d8;
|
||||
border-collapse: collapse;
|
||||
|
||||
@@ -4,8 +4,7 @@ body
|
||||
{
|
||||
padding: 0;
|
||||
}
|
||||
#main
|
||||
{
|
||||
#main {
|
||||
background-color: #FFF;
|
||||
overflow: auto;
|
||||
padding: 0;
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
.tableData{border:solid 1px #e8eef4;border-collapse:collapse}.tableData td{border:solid 1px #e8eef4;background-color:#fff}.tableData th{background-color:#e8eef4;border:solid 1px #e8eef4}.tableDataDark{border:solid 1px #8db2d8;border-collapse:collapse}.tableDataDark td{border:solid 1px #8db2d8;background-color:#fff}.tableDataDark th{background-color:#8db2d8;border:solid 1px #8db2d8}.tableDataContainer{background-color:#fff}.tableDataVertical{border:solid 1px #e8eef4;border-collapse:collapse}.tableDataVertical>tbody>tr:nth-child(odd){background-color:#e8eef4;margin:0;padding:0}.tableDataVertical>tbody>tr>th.name{width:170px;text-align:right}.tableDataVertical table.sub>tbody>tr:not(:first-child)>th,.tableDataVertical table.sub>tbody>tr:not(:first-child)>td{border-top:1px dashed #aaa}.tableDataVertical table.sub>tbody>tr>th{font-weight:normal;text-align:right}.tableDataVertical table.sub>tbody>tr>th.name{text-align:right}.icon16{display:inline-block;height:16px;width:16px;margin-left:2px;cursor:pointer}.subtleUntilHover{-moz-opacity:.3;opacity:.3}.subtleUntilHover:hover{-moz-opacity:1;opacity:1}body{padding:0}#main{background-color:#fff;overflow:auto;padding:0;-moz-border-radius:0 0 6px 6px;-webkit-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}
|
||||
.tableData{border:solid 1px #e8eef4;border-collapse:collapse}.tableData>tbody>tr>td{border:solid 1px #e8eef4;background-color:#fff}.tableData>tbody>tr:nth-child(odd)>td{background-color:#fcfcfd}.tableData>thead>tr>th,.tableData>tbody>tr>th{background-color:#e8eef4;border:solid 1px #e8eef4}.tableData>tbody>tr:hover>td{background-color:#e8eef4}.tableData>tfoot>tr>th,.tableData>tfoot>tr>td{background-color:#e8eef4}.tableDataDark{border:solid 1px #8db2d8;border-collapse:collapse}.tableDataDark td{border:solid 1px #8db2d8;background-color:#fff}.tableDataDark th{background-color:#8db2d8;border:solid 1px #8db2d8}.tableDataContainer{background-color:#fff}.tableDataVertical{border:solid 1px #e8eef4;border-collapse:collapse}.tableDataVertical>tbody>tr:nth-child(odd){background-color:#e8eef4;margin:0;padding:0}.tableDataVertical>tbody>tr>th.name{width:170px;text-align:right}.tableDataVertical table.sub>tbody>tr:not(:first-child)>th,.tableDataVertical table.sub>tbody>tr:not(:first-child)>td{border-top:1px dashed #aaa}.tableDataVertical table.sub>tbody>tr>th{font-weight:normal;text-align:right}.tableDataVertical table.sub>tbody>tr>th.name{text-align:right}.icon16{display:inline-block;height:16px;width:16px;margin-left:2px;cursor:pointer}.subtleUntilHover{-moz-opacity:.3;opacity:.3}.subtleUntilHover:hover{-moz-opacity:1;opacity:1}body{padding:0}#main{background-color:#fff;overflow:auto;padding:0;-moz-border-radius:0 0 6px 6px;-webkit-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}
|
||||
@@ -1,4 +1,4 @@
|
||||
#dialogWait {
|
||||
#dialogWait {
|
||||
padding-top: 30px;
|
||||
}
|
||||
#dialogWait .ajaxLoading {
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
.isotope-item{z-index:2}.isotope-hidden.isotope-item{pointer-events:none;z-index:1}.isotope,.isotope .isotope-item{-webkit-transition-duration:.8s;-moz-transition-duration:.8s;-o-transition-duration:.8s;transition-duration:.8s}.isotope{-webkit-transition-property:height,width;-moz-transition-property:height,width;-o-transition-property:height,width;transition-property:height,width}.isotope .isotope-item{-webkit-transition-property:-webkit-transform,opacity;-moz-transition-property:-moz-transform,opacity;-o-transition-property:top,left,opacity;transition-property:transform,opacity}.isotope.no-transition,.isotope.no-transition .isotope-item,.isotope .isotope-item.no-transition{-webkit-transition-duration:0;-moz-transition-duration:0;-o-transition-duration:0;transition-duration:0}
|
||||
.isotope-item{z-index:2}.isotope-hidden.isotope-item{pointer-events:none;z-index:1}.isotope,.isotope .isotope-item{-webkit-transition-duration:.8s;-moz-transition-duration:.8s;-o-transition-duration:.8s;transition-duration:.8s}.isotope{-webkit-transition-property:height,width;-moz-transition-property:height,width;-o-transition-property:height,width;transition-property:height,width}.isotope .isotope-item{-webkit-transition-property:-webkit-transform,opacity;-moz-transition-property:-moz-transform,opacity;-o-transition-property:top,left,opacity;transition-property:transform,opacity}.isotope.no-transition,.isotope.no-transition .isotope-item,.isotope .isotope-item.no-transition{-webkit-transition-duration:0s;-moz-transition-duration:0s;-o-transition-duration:0s;transition-duration:0s}
|
||||
@@ -17,6 +17,10 @@
|
||||
.tableData > tbody > tr:hover > td {
|
||||
background-color: #e8eef4;
|
||||
}
|
||||
.tableData > tfoot > tr > th,
|
||||
.tableData > tfoot > tr > td {
|
||||
background-color: #e8eef4;
|
||||
}
|
||||
.tableDataDark {
|
||||
border: solid 1px #8db2d8;
|
||||
border-collapse: collapse;
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -7,7 +7,7 @@
|
||||
background-color: #fff;
|
||||
}
|
||||
.tableData > tbody > tr:nth-child(odd) > td {
|
||||
background-color: #baccde;
|
||||
background-color: #fcfcfd;
|
||||
}
|
||||
.tableData > thead > tr > th,
|
||||
.tableData > tbody > tr > th {
|
||||
@@ -17,6 +17,10 @@
|
||||
.tableData > tbody > tr:hover > td {
|
||||
background-color: #e8eef4;
|
||||
}
|
||||
.tableData > tfoot > tr > th,
|
||||
.tableData > tfoot > tr > td {
|
||||
background-color: #e8eef4;
|
||||
}
|
||||
.tableDataDark {
|
||||
border: solid 1px #8db2d8;
|
||||
border-collapse: collapse;
|
||||
|
||||
@@ -1,30 +1,29 @@
|
||||
@import "Declarations";
|
||||
|
||||
// Data Table Mixin
|
||||
.tableData
|
||||
{
|
||||
.tableData {
|
||||
border: solid 1px @TableDataBorderColour;
|
||||
border-collapse: collapse;
|
||||
|
||||
&>tbody > tr > td
|
||||
{
|
||||
& > tbody > tr > td {
|
||||
border: solid 1px @TableDataBorderColour;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
&>tbody > tr:nth-child(odd) > td
|
||||
{
|
||||
|
||||
& > tbody > tr:nth-child(odd) > td {
|
||||
background-color: @TableDataRowBackgroundColor;
|
||||
}
|
||||
|
||||
&>thead > tr > th, &>tbody > tr > th
|
||||
{
|
||||
& > thead > tr > th, & > tbody > tr > th {
|
||||
background-color: @TableDataBorderColour;
|
||||
border: solid 1px @TableDataBorderColour;
|
||||
}
|
||||
|
||||
&>tbody > tr:hover > td
|
||||
{
|
||||
& > tbody > tr:hover > td {
|
||||
background-color: @TableDataBorderColour;
|
||||
}
|
||||
|
||||
& > tfoot > tr > th, & > tfoot > tr > td {
|
||||
background-color: @TableDataBorderColour;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
.tableData{border:solid 1px #e8eef4;border-collapse:collapse}.tableData>tbody>tr>td{border:solid 1px #e8eef4;background-color:#fff}.tableData>tbody>tr:nth-child(odd)>td{background-color:#baccde}.tableData>thead>tr>th,.tableData>tbody>tr>th{background-color:#e8eef4;border:solid 1px #e8eef4}.tableData>tbody>tr:hover>td{background-color:#e8eef4}.tableDataDark{border:solid 1px #8db2d8;border-collapse:collapse}.tableDataDark td{border:solid 1px #8db2d8;background-color:#fff}.tableDataDark th{background-color:#8db2d8;border:solid 1px #8db2d8}.tableDataContainer{background-color:#fff}.tableDataVertical{border:solid 1px #e8eef4;border-collapse:collapse}.tableDataVertical>tbody>tr:nth-child(odd){background-color:#e8eef4;margin:0;padding:0}.tableDataVertical>tbody>tr>th.name{width:170px;text-align:right}.tableDataVertical table.sub>tbody>tr:not(:first-child)>th,.tableDataVertical table.sub>tbody>tr:not(:first-child)>td{border-top:1px dashed #aaa}.tableDataVertical table.sub>tbody>tr>th{font-weight:normal;text-align:right}.tableDataVertical table.sub>tbody>tr>th.name{text-align:right}.icon16{display:inline-block;height:16px;width:16px;margin-left:2px;cursor:pointer}.subtleUntilHover{-moz-opacity:.3;opacity:.3}.subtleUntilHover:hover{-moz-opacity:1;opacity:1}
|
||||
.tableData{border:solid 1px #e8eef4;border-collapse:collapse}.tableData>tbody>tr>td{border:solid 1px #e8eef4;background-color:#fff}.tableData>tbody>tr:nth-child(odd)>td{background-color:#fcfcfd}.tableData>thead>tr>th,.tableData>tbody>tr>th{background-color:#e8eef4;border:solid 1px #e8eef4}.tableData>tbody>tr:hover>td{background-color:#e8eef4}.tableData>tfoot>tr>th,.tableData>tfoot>tr>td{background-color:#e8eef4}.tableDataDark{border:solid 1px #8db2d8;border-collapse:collapse}.tableDataDark td{border:solid 1px #8db2d8;background-color:#fff}.tableDataDark th{background-color:#8db2d8;border:solid 1px #8db2d8}.tableDataContainer{background-color:#fff}.tableDataVertical{border:solid 1px #e8eef4;border-collapse:collapse}.tableDataVertical>tbody>tr:nth-child(odd){background-color:#e8eef4;margin:0;padding:0}.tableDataVertical>tbody>tr>th.name{width:170px;text-align:right}.tableDataVertical table.sub>tbody>tr:not(:first-child)>th,.tableDataVertical table.sub>tbody>tr:not(:first-child)>td{border-top:1px dashed #aaa}.tableDataVertical table.sub>tbody>tr>th{font-weight:normal;text-align:right}.tableDataVertical table.sub>tbody>tr>th.name{text-align:right}.icon16{display:inline-block;height:16px;width:16px;margin-left:2px;cursor:pointer}.subtleUntilHover{-moz-opacity:.3;opacity:.3}.subtleUntilHover:hover{-moz-opacity:1;opacity:1}
|
||||
@@ -17,6 +17,10 @@
|
||||
.tableData > tbody > tr:hover > td {
|
||||
background-color: #e8eef4;
|
||||
}
|
||||
.tableData > tfoot > tr > th,
|
||||
.tableData > tfoot > tr > td {
|
||||
background-color: #e8eef4;
|
||||
}
|
||||
.tableDataDark {
|
||||
border: solid 1px #8db2d8;
|
||||
border-collapse: collapse;
|
||||
@@ -490,6 +494,10 @@ table.genericData > tbody > tr > th {
|
||||
table.genericData > tbody > tr:hover > td {
|
||||
background-color: #e8eef4;
|
||||
}
|
||||
table.genericData > tfoot > tr > th,
|
||||
table.genericData > tfoot > tr > td {
|
||||
background-color: #e8eef4;
|
||||
}
|
||||
table.genericData td.id {
|
||||
text-align: center;
|
||||
}
|
||||
@@ -711,6 +719,10 @@ table.jobTable > tbody > tr > th {
|
||||
table.jobTable > tbody > tr:hover > td {
|
||||
background-color: #e8eef4;
|
||||
}
|
||||
table.jobTable > tfoot > tr > th,
|
||||
table.jobTable > tfoot > tr > td {
|
||||
background-color: #e8eef4;
|
||||
}
|
||||
table.jobTable.hideStatusClosed tr[data-status=Closed] {
|
||||
display: none;
|
||||
}
|
||||
@@ -1039,7 +1051,7 @@ div.columnHost .column50 {
|
||||
white-space: nowrap;
|
||||
}
|
||||
.code {
|
||||
font-family: Consolas, monospace;
|
||||
font-family: Consolas, "Courier New", monospace;
|
||||
}
|
||||
div.code {
|
||||
border: 1px dashed #bbb;
|
||||
|
||||
@@ -302,7 +302,7 @@ img
|
||||
|
||||
code
|
||||
{
|
||||
font-family: Consolas, "Courier New", monospace;
|
||||
font-family: @FontFamilyMono;
|
||||
}
|
||||
|
||||
hr
|
||||
@@ -1247,7 +1247,7 @@ div.columnHost
|
||||
|
||||
.code
|
||||
{
|
||||
font-family: Consolas, monospace;
|
||||
font-family: @FontFamilyMono;
|
||||
}
|
||||
|
||||
div.code
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
|
||||
.timeline-container {
|
||||
.timeline-container {
|
||||
border: 1px solid #aaa;
|
||||
}
|
||||
.timeline-event-label {
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
@import "../Declarations";
|
||||
|
||||
.timeline-container {
|
||||
border: 1px solid #aaa;
|
||||
}
|
||||
|
||||
.timeline-event-label {
|
||||
font-family: Consolas, "Courier New", monospace;
|
||||
font-family: @FontFamilyMono;
|
||||
font-size: 0.8em;
|
||||
padding-right: 1px;
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
.timeline-container{border:1px solid #aaa}.timeline-event-label{font-family:Consolas,"Courier New",monospace;font-size:.8em;padding-right:1px}
|
||||
.timeline-container{border:1px solid #aaa}.timeline-event-label{font-family:Consolas,"Courier New",monospace;font-size:.8em;padding-right:1px}
|
||||
@@ -17,6 +17,10 @@
|
||||
.tableData > tbody > tr:hover > td {
|
||||
background-color: #e8eef4;
|
||||
}
|
||||
.tableData > tfoot > tr > th,
|
||||
.tableData > tfoot > tr > td {
|
||||
background-color: #e8eef4;
|
||||
}
|
||||
.tableDataDark {
|
||||
border: solid 1px #8db2d8;
|
||||
border-collapse: collapse;
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -1,7 +1,91 @@
|
||||
.ui-widget {
|
||||
.tableData {
|
||||
border: solid 1px #e8eef4;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
.tableData > tbody > tr > td {
|
||||
border: solid 1px #e8eef4;
|
||||
background-color: #fff;
|
||||
}
|
||||
.tableData > tbody > tr:nth-child(odd) > td {
|
||||
background-color: #fcfcfd;
|
||||
}
|
||||
.tableData > thead > tr > th,
|
||||
.tableData > tbody > tr > th {
|
||||
background-color: #e8eef4;
|
||||
border: solid 1px #e8eef4;
|
||||
}
|
||||
.tableData > tbody > tr:hover > td {
|
||||
background-color: #e8eef4;
|
||||
}
|
||||
.tableData > tfoot > tr > th,
|
||||
.tableData > tfoot > tr > td {
|
||||
background-color: #e8eef4;
|
||||
}
|
||||
.tableDataDark {
|
||||
border: solid 1px #8db2d8;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
.tableDataDark td {
|
||||
border: solid 1px #8db2d8;
|
||||
background-color: #fff;
|
||||
}
|
||||
.tableDataDark th {
|
||||
background-color: #8db2d8;
|
||||
border: solid 1px #8db2d8;
|
||||
}
|
||||
.tableDataContainer {
|
||||
background-color: #fff;
|
||||
}
|
||||
.tableDataVertical {
|
||||
border: solid 1px #e8eef4;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
.tableDataVertical > tbody > tr:nth-child(odd) {
|
||||
background-color: #e8eef4;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.tableDataVertical > tbody > tr > th.name {
|
||||
width: 170px;
|
||||
text-align: right;
|
||||
}
|
||||
.tableDataVertical table.sub > tbody > tr:not(:first-child) > th,
|
||||
.tableDataVertical table.sub > tbody > tr:not(:first-child) > td {
|
||||
border-top: 1px dashed #aaa;
|
||||
}
|
||||
.tableDataVertical table.sub > tbody > tr > th {
|
||||
font-weight: normal;
|
||||
text-align: right;
|
||||
}
|
||||
.tableDataVertical table.sub > tbody > tr > th.name {
|
||||
text-align: right;
|
||||
}
|
||||
.icon16 {
|
||||
display: inline-block;
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
margin-left: 2px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.subtleUntilHover {
|
||||
-moz-opacity: 0.3;
|
||||
opacity: 0.3;
|
||||
}
|
||||
.subtleUntilHover:hover {
|
||||
-moz-opacity: 1;
|
||||
opacity: 1;
|
||||
}
|
||||
.ui-widget {
|
||||
/*font-size: 11px !important;*/
|
||||
|
||||
font-size: 12px !important;
|
||||
font-family: "Segoe UI", Arial, Verdana, Tahoma, sans-serif;
|
||||
}
|
||||
.ui-widget input,
|
||||
.ui-widget select,
|
||||
.ui-widget textarea,
|
||||
.ui-widget button {
|
||||
font-family: "Segoe UI", Arial, Verdana, Tahoma, sans-serif;
|
||||
}
|
||||
.watermark {
|
||||
color: #888 !important;
|
||||
@@ -53,3 +137,12 @@
|
||||
.ui-tabs .ui-tabs-panel {
|
||||
padding: .5em;
|
||||
}
|
||||
/*.ui-tabs > ul > li.ui-state-default
|
||||
{
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.ui-tabs > ul > li.ui-state-active
|
||||
{
|
||||
font-weight: bold;
|
||||
}*/
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@import "Shared";
|
||||
|
||||
.ui-widget
|
||||
{
|
||||
/*font-size: 11px !important;*/
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -76,16 +76,38 @@ namespace Disco.Web.Controllers
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Import
|
||||
#region Import/Export
|
||||
[HttpGet]
|
||||
public virtual ActionResult Import()
|
||||
public virtual ActionResult ImportExport()
|
||||
{
|
||||
Models.Device.ImportModel m = new Models.Device.ImportModel();
|
||||
|
||||
m.DeviceModels = dbContext.DeviceModels.ToList();
|
||||
m.DeviceProfiles = dbContext.DeviceProfiles.ToList();
|
||||
m.DeviceBatches = dbContext.DeviceBatches.ToList();
|
||||
|
||||
// UI Extensions
|
||||
UIExtensions.ExecuteExtensions<DeviceImportModel>(this.ControllerContext, m);
|
||||
|
||||
return View();
|
||||
return View(m);
|
||||
}
|
||||
[HttpGet]
|
||||
public virtual ActionResult ImportReview(string ImportParseTaskId)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(ImportParseTaskId))
|
||||
throw new ArgumentNullException("ImportParseTaskId");
|
||||
|
||||
var session = Disco.BI.DeviceBI.Importing.Import.GetSession(ImportParseTaskId);
|
||||
|
||||
if (session == null)
|
||||
throw new ArgumentException("The Import Parse Task Id is invalid or the session timed out (60 minutes), try importing again", "ImportParseTaskId");
|
||||
|
||||
Models.Device.ImportReviewModel m = Models.Device.ImportReviewModel.FromImportDeviceSession(session);
|
||||
|
||||
// UI Extensions
|
||||
UIExtensions.ExecuteExtensions<DeviceImportReviewModel>(this.ControllerContext, m);
|
||||
|
||||
return View(m);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
+22
-10
@@ -194,6 +194,7 @@
|
||||
<Compile Include="Areas\Config\Models\Config\IndexModel.cs" />
|
||||
<Compile Include="Areas\Config\Models\DeviceBatch\CreateModel.cs" />
|
||||
<Compile Include="Areas\Config\Models\DeviceBatch\TimelineModel.cs" />
|
||||
<Compile Include="Areas\Config\Models\DeviceBatch\_ShowModelMembership.cs" />
|
||||
<Compile Include="Areas\Config\Models\DeviceProfile\CreateModel.cs" />
|
||||
<Compile Include="Areas\Config\Models\DocumentTemplate\ImportStatusModel.cs" />
|
||||
<Compile Include="Areas\Config\Models\Enrolment\StatusModel.cs" />
|
||||
@@ -514,6 +515,7 @@
|
||||
</Compile>
|
||||
<Compile Include="Models\Device\AddOfflineModel.cs" />
|
||||
<Compile Include="Models\Device\ImportModel.cs" />
|
||||
<Compile Include="Models\Device\ImportReviewModel.cs" />
|
||||
<Compile Include="Models\Device\IndexModel.cs" />
|
||||
<Compile Include="Models\Device\ShowModel.cs" />
|
||||
<Compile Include="Models\InitialConfig\CompleteModel.cs" />
|
||||
@@ -567,10 +569,15 @@
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>_Subject.cshtml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\Device\Import.generated.cs">
|
||||
<Compile Include="Views\Device\ImportExport.generated.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Import.cshtml</DependentUpon>
|
||||
<DependentUpon>ImportExport.cshtml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\Device\ImportReview.generated.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>ImportReview.cshtml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\Device\Index.generated.cs">
|
||||
<DependentUpon>Index.cshtml</DependentUpon>
|
||||
@@ -856,6 +863,7 @@
|
||||
</None>
|
||||
<None Include="ClientSource\Scripts\Core\jquery-ui-1.10.3.js" />
|
||||
<None Include="ClientSource\Scripts\Core\jquery-2.0.2.js" />
|
||||
<Content Include="ClientSource\Scripts\Core\disco.uicore.js" />
|
||||
<Content Include="ClientSource\Scripts\Modules\Disco-AjaxHelperIcons.min.js">
|
||||
<DependentUpon>Disco-AjaxHelperIcons.js.bundle</DependentUpon>
|
||||
</Content>
|
||||
@@ -1068,15 +1076,15 @@
|
||||
<Content Include="ClientSource\Style\Declarations.min.css">
|
||||
<DependentUpon>Declarations.less</DependentUpon>
|
||||
</Content>
|
||||
<None Include="ClientSource\Style\Device.css">
|
||||
<DependentUpon>Device.less</DependentUpon>
|
||||
</None>
|
||||
<Content Include="ClientSource\Style\Device.min.css">
|
||||
<DependentUpon>Device.less</DependentUpon>
|
||||
</Content>
|
||||
<None Include="ClientSource\Style\Dialog.css">
|
||||
<DependentUpon>Dialog.less</DependentUpon>
|
||||
</None>
|
||||
<Content Include="ClientSource\Style\Device.css">
|
||||
<DependentUpon>Device.less</DependentUpon>
|
||||
</Content>
|
||||
<Content Include="ClientSource\Style\Device.min.css">
|
||||
<DependentUpon>Device.less</DependentUpon>
|
||||
</Content>
|
||||
<Content Include="ClientSource\Style\Dialog.min.css">
|
||||
<DependentUpon>Dialog.less</DependentUpon>
|
||||
</Content>
|
||||
@@ -1450,9 +1458,13 @@
|
||||
<Generator>RazorGenerator</Generator>
|
||||
<LastGenOutput>_Subject.generated.cs</LastGenOutput>
|
||||
</None>
|
||||
<None Include="Views\Device\Import.cshtml">
|
||||
<None Include="Views\Device\ImportExport.cshtml">
|
||||
<Generator>RazorGenerator</Generator>
|
||||
<LastGenOutput>Import.generated.cs</LastGenOutput>
|
||||
<LastGenOutput>ImportExport.generated.cs</LastGenOutput>
|
||||
</None>
|
||||
<None Include="Views\Device\ImportReview.cshtml">
|
||||
<Generator>RazorGenerator</Generator>
|
||||
<LastGenOutput>ImportReview.generated.cs</LastGenOutput>
|
||||
</None>
|
||||
<None Include="Views\Device\Index.cshtml">
|
||||
<Generator>RazorGenerator</Generator>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Disco.Models.UI.Device;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Models.UI.Device;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
@@ -9,7 +10,11 @@ namespace Disco.Web.Models.Device
|
||||
{
|
||||
public class ImportModel : DeviceImportModel
|
||||
{
|
||||
[Required, Display(Name="Import File")]
|
||||
[Required, Display(Name="CSV Import File")]
|
||||
public HttpPostedFileBase ImportFile { get; set; }
|
||||
|
||||
public List<DeviceModel> DeviceModels { get; set; }
|
||||
public List<DeviceProfile> DeviceProfiles { get; set; }
|
||||
public List<DeviceBatch> DeviceBatches { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using Disco.Models.BI.Device;
|
||||
using Disco.Models.UI.Device;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace Disco.Web.Models.Device
|
||||
{
|
||||
public class ImportReviewModel : DeviceImportReviewModel
|
||||
{
|
||||
public string ImportParseTaskId { get; set; }
|
||||
public string ImportFilename { get; set; }
|
||||
public List<ImportDevice> ImportDevices { get; set; }
|
||||
|
||||
public static ImportReviewModel FromImportDeviceSession(ImportDeviceSession session)
|
||||
{
|
||||
return new ImportReviewModel()
|
||||
{
|
||||
ImportParseTaskId = session.ImportParseTaskId,
|
||||
ImportFilename = session.ImportFilename,
|
||||
ImportDevices = session.ImportDevices
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.2.0722.2112")]
|
||||
[assembly: AssemblyFileVersion("1.2.0722.2112")]
|
||||
[assembly: AssemblyVersion("1.2.0725.1725")]
|
||||
[assembly: AssemblyFileVersion("1.2.0725.1725")]
|
||||
+125
-8
@@ -1083,6 +1083,12 @@ namespace Disco.Web.Controllers
|
||||
return RedirectToRoutePermanent(callInfo.RouteValueDictionary);
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public virtual System.Web.Mvc.ActionResult ImportReview()
|
||||
{
|
||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.ImportReview);
|
||||
}
|
||||
[NonAction]
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public virtual System.Web.Mvc.ActionResult Show()
|
||||
@@ -1107,7 +1113,8 @@ namespace Disco.Web.Controllers
|
||||
{
|
||||
public readonly string Index = "Index";
|
||||
public readonly string AddOffline = "AddOffline";
|
||||
public readonly string Import = "Import";
|
||||
public readonly string ImportExport = "ImportExport";
|
||||
public readonly string ImportReview = "ImportReview";
|
||||
public readonly string Show = "Show";
|
||||
}
|
||||
|
||||
@@ -1116,7 +1123,8 @@ namespace Disco.Web.Controllers
|
||||
{
|
||||
public const string Index = "Index";
|
||||
public const string AddOffline = "AddOffline";
|
||||
public const string Import = "Import";
|
||||
public const string ImportExport = "ImportExport";
|
||||
public const string ImportReview = "ImportReview";
|
||||
public const string Show = "Show";
|
||||
}
|
||||
|
||||
@@ -1129,6 +1137,14 @@ namespace Disco.Web.Controllers
|
||||
{
|
||||
public readonly string m = "m";
|
||||
}
|
||||
static readonly ActionParamsClass_ImportReview s_params_ImportReview = new ActionParamsClass_ImportReview();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ActionParamsClass_ImportReview ImportReviewParams { get { return s_params_ImportReview; } }
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionParamsClass_ImportReview
|
||||
{
|
||||
public readonly string ImportParseTaskId = "ImportParseTaskId";
|
||||
}
|
||||
static readonly ActionParamsClass_Show s_params_Show = new ActionParamsClass_Show();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ActionParamsClass_Show ShowParams { get { return s_params_Show; } }
|
||||
@@ -1150,14 +1166,16 @@ namespace Disco.Web.Controllers
|
||||
public readonly string _DeviceTable = "_DeviceTable";
|
||||
public readonly string _ViewStart = "_ViewStart";
|
||||
public readonly string AddOffline = "AddOffline";
|
||||
public readonly string Import = "Import";
|
||||
public readonly string ImportExport = "ImportExport";
|
||||
public readonly string ImportReview = "ImportReview";
|
||||
public readonly string Index = "Index";
|
||||
public readonly string Show = "Show";
|
||||
}
|
||||
public readonly string _DeviceTable = "~/Views/Device/_DeviceTable.cshtml";
|
||||
public readonly string _ViewStart = "~/Views/Device/_ViewStart.cshtml";
|
||||
public readonly string AddOffline = "~/Views/Device/AddOffline.cshtml";
|
||||
public readonly string Import = "~/Views/Device/Import.cshtml";
|
||||
public readonly string ImportExport = "~/Views/Device/ImportExport.cshtml";
|
||||
public readonly string ImportReview = "~/Views/Device/ImportReview.cshtml";
|
||||
public readonly string Index = "~/Views/Device/Index.cshtml";
|
||||
public readonly string Show = "~/Views/Device/Show.cshtml";
|
||||
static readonly _DevicePartsClass s_DeviceParts = new _DevicePartsClass();
|
||||
@@ -1217,12 +1235,22 @@ namespace Disco.Web.Controllers
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
partial void ImportOverride(T4MVC_System_Web_Mvc_ActionResult callInfo);
|
||||
partial void ImportExportOverride(T4MVC_System_Web_Mvc_ActionResult callInfo);
|
||||
|
||||
public override System.Web.Mvc.ActionResult Import()
|
||||
public override System.Web.Mvc.ActionResult ImportExport()
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Import);
|
||||
ImportOverride(callInfo);
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.ImportExport);
|
||||
ImportExportOverride(callInfo);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
partial void ImportReviewOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string ImportParseTaskId);
|
||||
|
||||
public override System.Web.Mvc.ActionResult ImportReview(string ImportParseTaskId)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.ImportReview);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "ImportParseTaskId", ImportParseTaskId);
|
||||
ImportReviewOverride(callInfo, ImportParseTaskId);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
@@ -2592,6 +2620,12 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
{
|
||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Index);
|
||||
}
|
||||
[NonAction]
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public virtual System.Web.Mvc.ActionResult ExportDevices()
|
||||
{
|
||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.ExportDevices);
|
||||
}
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public DeviceBatchController Actions { get { return MVC.API.DeviceBatch; } }
|
||||
@@ -2626,6 +2660,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
public readonly string Delete = "Delete";
|
||||
public readonly string Index = "Index";
|
||||
public readonly string Timeline = "Timeline";
|
||||
public readonly string ExportDevices = "ExportDevices";
|
||||
}
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
@@ -2649,6 +2684,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
public const string Delete = "Delete";
|
||||
public const string Index = "Index";
|
||||
public const string Timeline = "Timeline";
|
||||
public const string ExportDevices = "ExportDevices";
|
||||
}
|
||||
|
||||
|
||||
@@ -2820,6 +2856,14 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
{
|
||||
public readonly string id = "id";
|
||||
}
|
||||
static readonly ActionParamsClass_ExportDevices s_params_ExportDevices = new ActionParamsClass_ExportDevices();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ActionParamsClass_ExportDevices ExportDevicesParams { get { return s_params_ExportDevices; } }
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionParamsClass_ExportDevices
|
||||
{
|
||||
public readonly string id = "id";
|
||||
}
|
||||
static readonly ViewsClass s_views = new ViewsClass();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ViewsClass Views { get { return s_views; } }
|
||||
@@ -3050,6 +3094,16 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
partial void ExportDevicesOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id);
|
||||
|
||||
public override System.Web.Mvc.ActionResult ExportDevices(int id)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.ExportDevices);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||
ExportDevicesOverride(callInfo, id);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3329,6 +3383,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
public readonly string AttachmentRemove = "AttachmentRemove";
|
||||
public readonly string ImportParse = "ImportParse";
|
||||
public readonly string ImportProcess = "ImportProcess";
|
||||
public readonly string ExportAllDevices = "ExportAllDevices";
|
||||
}
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
@@ -3354,6 +3409,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
public const string AttachmentRemove = "AttachmentRemove";
|
||||
public const string ImportParse = "ImportParse";
|
||||
public const string ImportProcess = "ImportProcess";
|
||||
public const string ExportAllDevices = "ExportAllDevices";
|
||||
}
|
||||
|
||||
|
||||
@@ -3776,6 +3832,15 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
partial void ExportAllDevicesOverride(T4MVC_System_Web_Mvc_ActionResult callInfo);
|
||||
|
||||
public override System.Web.Mvc.ActionResult ExportAllDevices()
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.ExportAllDevices);
|
||||
ExportAllDevicesOverride(callInfo);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3869,6 +3934,12 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
{
|
||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.ComponentRemove);
|
||||
}
|
||||
[NonAction]
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public virtual System.Web.Mvc.ActionResult ExportDevices()
|
||||
{
|
||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.ExportDevices);
|
||||
}
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public DeviceModelController Actions { get { return MVC.API.DeviceModel; } }
|
||||
@@ -3897,6 +3968,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
public readonly string ComponentUpdate = "ComponentUpdate";
|
||||
public readonly string ComponentRemove = "ComponentRemove";
|
||||
public readonly string Index = "Index";
|
||||
public readonly string ExportDevices = "ExportDevices";
|
||||
}
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
@@ -3914,6 +3986,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
public const string ComponentUpdate = "ComponentUpdate";
|
||||
public const string ComponentRemove = "ComponentRemove";
|
||||
public const string Index = "Index";
|
||||
public const string ExportDevices = "ExportDevices";
|
||||
}
|
||||
|
||||
|
||||
@@ -4023,6 +4096,14 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
{
|
||||
public readonly string id = "id";
|
||||
}
|
||||
static readonly ActionParamsClass_ExportDevices s_params_ExportDevices = new ActionParamsClass_ExportDevices();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ActionParamsClass_ExportDevices ExportDevicesParams { get { return s_params_ExportDevices; } }
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionParamsClass_ExportDevices
|
||||
{
|
||||
public readonly string id = "id";
|
||||
}
|
||||
static readonly ViewsClass s_views = new ViewsClass();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ViewsClass Views { get { return s_views; } }
|
||||
@@ -4189,6 +4270,16 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
partial void ExportDevicesOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id);
|
||||
|
||||
public override System.Web.Mvc.ActionResult ExportDevices(int id)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.ExportDevices);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||
ExportDevicesOverride(callInfo, id);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4306,6 +4397,12 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
{
|
||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.DefaultAddDeviceOffline);
|
||||
}
|
||||
[NonAction]
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public virtual System.Web.Mvc.ActionResult ExportDevices()
|
||||
{
|
||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.ExportDevices);
|
||||
}
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public DeviceProfileController Actions { get { return MVC.API.DeviceProfile; } }
|
||||
@@ -4338,6 +4435,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
public readonly string Delete = "Delete";
|
||||
public readonly string Default = "Default";
|
||||
public readonly string DefaultAddDeviceOffline = "DefaultAddDeviceOffline";
|
||||
public readonly string ExportDevices = "ExportDevices";
|
||||
}
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
@@ -4359,6 +4457,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
public const string Delete = "Delete";
|
||||
public const string Default = "Default";
|
||||
public const string DefaultAddDeviceOffline = "DefaultAddDeviceOffline";
|
||||
public const string ExportDevices = "ExportDevices";
|
||||
}
|
||||
|
||||
|
||||
@@ -4510,6 +4609,14 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
public readonly string id = "id";
|
||||
public readonly string redirect = "redirect";
|
||||
}
|
||||
static readonly ActionParamsClass_ExportDevices s_params_ExportDevices = new ActionParamsClass_ExportDevices();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ActionParamsClass_ExportDevices ExportDevicesParams { get { return s_params_ExportDevices; } }
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionParamsClass_ExportDevices
|
||||
{
|
||||
public readonly string id = "id";
|
||||
}
|
||||
static readonly ViewsClass s_views = new ViewsClass();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ViewsClass Views { get { return s_views; } }
|
||||
@@ -4716,6 +4823,16 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
partial void ExportDevicesOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id);
|
||||
|
||||
public override System.Web.Mvc.ActionResult ExportDevices(int id)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.ExportDevices);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||
ExportDevicesOverride(callInfo, id);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
@model Disco.Web.Models.Device.ImportModel
|
||||
@{
|
||||
ViewBag.Title = Html.ToBreadcrumb("Devices", MVC.Device.Index(), "Import Devices");
|
||||
}
|
||||
@using (Html.BeginForm(MVC.API.Device.ImportParse(), FormMethod.Post, new { enctype = "multipart/form-data" }))
|
||||
{
|
||||
@Html.ValidationSummary()
|
||||
<div id="importDialog" class="form" style="width: 450px">
|
||||
<table>
|
||||
<tr>
|
||||
<th>
|
||||
@Html.LabelFor(m => m.ImportFile)
|
||||
</th>
|
||||
<td>
|
||||
<input id="ImportFile" name="ImportFile" type="file" data-val="true" data-val-required="An Import File is required." />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p class="actions">
|
||||
<input type="submit" class="button" value="Import" />
|
||||
</p>
|
||||
</div>
|
||||
}
|
||||
@@ -1,129 +0,0 @@
|
||||
#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
|
||||
{
|
||||
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/Import.cshtml")]
|
||||
public partial class Import : System.Web.Mvc.WebViewPage<Disco.Web.Models.Device.ImportModel>
|
||||
{
|
||||
public Import()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 2 "..\..\Views\Device\Import.cshtml"
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Devices", MVC.Device.Index(), "Import Devices");
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
|
||||
#line 5 "..\..\Views\Device\Import.cshtml"
|
||||
using (Html.BeginForm(MVC.API.Device.ImportParse(), FormMethod.Post, new { enctype = "multipart/form-data" }))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 7 "..\..\Views\Device\Import.cshtml"
|
||||
Write(Html.ValidationSummary());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 7 "..\..\Views\Device\Import.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" id=\"importDialog\"");
|
||||
|
||||
WriteLiteral(" class=\"form\"");
|
||||
|
||||
WriteLiteral(" style=\"width: 450px\"");
|
||||
|
||||
WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 12 "..\..\Views\Device\Import.cshtml"
|
||||
Write(Html.LabelFor(m => m.ImportFile));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </th>\r\n <td>\r\n <input");
|
||||
|
||||
WriteLiteral(" id=\"ImportFile\"");
|
||||
|
||||
WriteLiteral(" name=\"ImportFile\"");
|
||||
|
||||
WriteLiteral(" type=\"file\"");
|
||||
|
||||
WriteLiteral(" data-val=\"true\"");
|
||||
|
||||
WriteLiteral(" data-val-required=\"An Import File is required.\"");
|
||||
|
||||
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=\"Import\"");
|
||||
|
||||
WriteLiteral(" />\r\n </p>\r\n </div>\r\n");
|
||||
|
||||
|
||||
#line 23 "..\..\Views\Device\Import.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -0,0 +1,192 @@
|
||||
@model Disco.Web.Models.Device.ImportModel
|
||||
@{
|
||||
ViewBag.Title = Html.ToBreadcrumb("Devices", MVC.Device.Index(), "Import/Export Devices");
|
||||
}
|
||||
<div id="deviceImport">
|
||||
@using (Html.BeginForm(MVC.API.Device.ImportParse(), FormMethod.Post, new { enctype = "multipart/form-data" }))
|
||||
{
|
||||
@Html.ValidationSummary()
|
||||
<div id="importDialog" class="form" style="width: 450px">
|
||||
<h2>Import Devices</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<th>
|
||||
@Html.LabelFor(m => m.ImportFile)
|
||||
</th>
|
||||
<td>
|
||||
<input id="ImportFile" name="ImportFile" type="file" data-val="true" data-val-required="An Import File is required." />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p class="actions">
|
||||
<input type="submit" class="button" value="Import" />
|
||||
</p>
|
||||
</div>
|
||||
}
|
||||
<div id="documentation">
|
||||
<h3>CSV Import Specification</h3>
|
||||
<h4>Format</h4>
|
||||
<ul>
|
||||
<li>The import file must be in <strong>comma-separated values format</strong> (<a href="http://en.wikipedia.org/wiki/Comma-separated_values" target="_blank">CSV Reference</a>).</li>
|
||||
<li>The <strong>first line will be ignored</strong> (it is assumed the file includes headers).</li>
|
||||
<li>Be conscious of editors removing leading zeros from serial numbers (ie: Microsoft Excel).</li>
|
||||
</ul>
|
||||
<h4>Fields</h4>
|
||||
<div class="smallMessage">The following fields/columns are available for to the import file. The <strong>order of the fields</strong> must be as shown below.</div>
|
||||
<table class="tableData">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 100px;">Field Name</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Serial Number</th>
|
||||
<td><strong>Required</strong> - must contain the device serial number (maximum of 60 characters).
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Device Model</th>
|
||||
<td>The <span class="code">ID</span> for the Device Model (<a href="#" id="showDeviceModels">Show IDs</a>). <em>Default: <span class="code">1</span> [@Html.ActionLink(Model.DeviceModels[0].ToString(), MVC.Config.DeviceModel.Index(Model.DeviceModels[0].Id))]</em>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Device Profile</th>
|
||||
<td>The <span class="code">ID</span> for the Device Profile (<a href="#" id="showDeviceProfiles">Show IDs</a>). <em>Default: <span class="code">1</span> [@Html.ActionLink(Model.DeviceProfiles[0].ToString(), MVC.Config.DeviceProfile.Index(Model.DeviceProfiles[0].Id))]</em>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Device Batch</th>
|
||||
<td>The <span class="code">ID</span> for the Device Batch (<a href="#" id="showDeviceBatches">Show IDs</a>). <em>Default: <span class="code"><None></span></em>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Assigned User</th>
|
||||
<td>The <span class="code">ID</span> for the User assigned to the device. <em>Default: <span class="code"><None></span></em>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Location</th>
|
||||
<td>Updates the Location of the device. Maximum of 250 characters. <em>Default: <span class="code"><None></span></em>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Asset Number</th>
|
||||
<td>Updates the Asset Number of the device. Maximum of 40 characters. <em>Default: <span class="code"><None></span></em>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<div id="showDeviceModelsDialog" class="hiddenDialog" title="Disco Device Model Ids">
|
||||
<table class="tableData">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Description</th>
|
||||
<th>Manufacturer</th>
|
||||
<th>Model</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var dm in Model.DeviceModels)
|
||||
{
|
||||
<tr>
|
||||
<td>@Html.ActionLink(dm.Id.ToString(), MVC.Config.DeviceModel.Index(dm.Id))</td>
|
||||
<td>@dm.ToString()</td>
|
||||
<td>@dm.Manufacturer</td>
|
||||
<td>@dm.Model</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="showDeviceProfilesDialog" class="hiddenDialog" title="Disco Device Profile Ids">
|
||||
<table class="tableData">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Name</th>
|
||||
<th>Short Name</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var dp in Model.DeviceProfiles)
|
||||
{
|
||||
<tr>
|
||||
<td>@Html.ActionLink(dp.Id.ToString(), MVC.Config.DeviceProfile.Index(dp.Id))</td>
|
||||
<td>@dp.Name</td>
|
||||
<td>@dp.ShortName</td>
|
||||
<td>@dp.Description</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="showDeviceBatchesDialog" class="hiddenDialog" title="Disco Device Batch Ids">
|
||||
<table class="tableData">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Name</th>
|
||||
<th>Purchase Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var db in Model.DeviceBatches)
|
||||
{
|
||||
<tr>
|
||||
<td>@Html.ActionLink(db.Id.ToString(), MVC.Config.DeviceBatch.Index(db.Id))</td>
|
||||
<td>@db.Name</td>
|
||||
<td>@CommonHelpers.FriendlyDate(db.PurchaseDate)</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
var dialogOptions = {
|
||||
width: 700,
|
||||
height: 600,
|
||||
resizable: false,
|
||||
modal: true,
|
||||
autoOpen: false
|
||||
},
|
||||
$showDeviceModelsDialog = null,
|
||||
$showDeviceProfilesDialog = null,
|
||||
$showDeviceBatchesDialog = null;
|
||||
|
||||
$('#showDeviceModels').click(function (e) {
|
||||
e.preventDefault();
|
||||
if (!$showDeviceModelsDialog)
|
||||
$showDeviceModelsDialog = $('#showDeviceModelsDialog').dialog(dialogOptions);
|
||||
$showDeviceModelsDialog.dialog('open');
|
||||
});
|
||||
|
||||
$('#showDeviceProfiles').click(function (e) {
|
||||
e.preventDefault();
|
||||
if (!$showDeviceProfilesDialog)
|
||||
$showDeviceProfilesDialog = $('#showDeviceProfilesDialog').dialog(dialogOptions);
|
||||
$showDeviceProfilesDialog.dialog('open');
|
||||
});
|
||||
$('#showDeviceBatches').click(function (e) {
|
||||
e.preventDefault();
|
||||
if (!$showDeviceBatchesDialog)
|
||||
$showDeviceBatchesDialog = $('#showDeviceBatchesDialog').dialog(dialogOptions);
|
||||
$showDeviceBatchesDialog.dialog('open');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
<div class="actionBar">
|
||||
@Html.ActionLinkButton("Export All Devices", MVC.API.Device.ExportAllDevices())
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,547 @@
|
||||
#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
|
||||
{
|
||||
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/ImportExport.cshtml")]
|
||||
public partial class ImportExport : System.Web.Mvc.WebViewPage<Disco.Web.Models.Device.ImportModel>
|
||||
{
|
||||
public ImportExport()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 2 "..\..\Views\Device\ImportExport.cshtml"
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Devices", MVC.Device.Index(), "Import/Export Devices");
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n<div");
|
||||
|
||||
WriteLiteral(" id=\"deviceImport\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 6 "..\..\Views\Device\ImportExport.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 6 "..\..\Views\Device\ImportExport.cshtml"
|
||||
using (Html.BeginForm(MVC.API.Device.ImportParse(), FormMethod.Post, new { enctype = "multipart/form-data" }))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 8 "..\..\Views\Device\ImportExport.cshtml"
|
||||
Write(Html.ValidationSummary());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 8 "..\..\Views\Device\ImportExport.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" id=\"importDialog\"");
|
||||
|
||||
WriteLiteral(" class=\"form\"");
|
||||
|
||||
WriteLiteral(" style=\"width: 450px\"");
|
||||
|
||||
WriteLiteral(">\r\n <h2>Import Devices</h2>\r\n <table>\r\n <tr>" +
|
||||
"\r\n <th>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 14 "..\..\Views\Device\ImportExport.cshtml"
|
||||
Write(Html.LabelFor(m => m.ImportFile));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </th>\r\n <td>\r\n <i" +
|
||||
"nput");
|
||||
|
||||
WriteLiteral(" id=\"ImportFile\"");
|
||||
|
||||
WriteLiteral(" name=\"ImportFile\"");
|
||||
|
||||
WriteLiteral(" type=\"file\"");
|
||||
|
||||
WriteLiteral(" data-val=\"true\"");
|
||||
|
||||
WriteLiteral(" data-val-required=\"An Import File is required.\"");
|
||||
|
||||
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=\"Import\"");
|
||||
|
||||
WriteLiteral(" />\r\n </p>\r\n </div>\r\n");
|
||||
|
||||
|
||||
#line 25 "..\..\Views\Device\ImportExport.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" id=\"documentation\"");
|
||||
|
||||
WriteLiteral(">\r\n <h3>CSV Import Specification</h3>\r\n <h4>Format</h4>\r\n <u" +
|
||||
"l>\r\n <li>The import file must be in <strong>comma-separated values fo" +
|
||||
"rmat</strong> (<a");
|
||||
|
||||
WriteLiteral(" href=\"http://en.wikipedia.org/wiki/Comma-separated_values\"");
|
||||
|
||||
WriteLiteral(" target=\"_blank\"");
|
||||
|
||||
WriteLiteral(@">CSV Reference</a>).</li>
|
||||
<li>The <strong>first line will be ignored</strong> (it is assumed the file includes headers).</li>
|
||||
<li>Be conscious of editors removing leading zeros from serial numbers (ie: Microsoft Excel).</li>
|
||||
</ul>
|
||||
<h4>Fields</h4>
|
||||
<div");
|
||||
|
||||
WriteLiteral(" class=\"smallMessage\"");
|
||||
|
||||
WriteLiteral(">The following fields/columns are available for to the import file. The <strong>o" +
|
||||
"rder of the fields</strong> must be as shown below.</div>\r\n <table");
|
||||
|
||||
WriteLiteral(" class=\"tableData\"");
|
||||
|
||||
WriteLiteral(">\r\n <thead>\r\n <tr>\r\n <th");
|
||||
|
||||
WriteLiteral(" style=\"width: 100px;\"");
|
||||
|
||||
WriteLiteral(@">Field Name</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Serial Number</th>
|
||||
<td><strong>Required</strong> - must contain the device serial number (maximum of 60 characters).
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Device Model</th>
|
||||
<td>The <span");
|
||||
|
||||
WriteLiteral(" class=\"code\"");
|
||||
|
||||
WriteLiteral(">ID</span> for the Device Model (<a");
|
||||
|
||||
WriteLiteral(" href=\"#\"");
|
||||
|
||||
WriteLiteral(" id=\"showDeviceModels\"");
|
||||
|
||||
WriteLiteral(">Show IDs</a>). <em>Default: <span");
|
||||
|
||||
WriteLiteral(" class=\"code\"");
|
||||
|
||||
WriteLiteral(">1</span> [");
|
||||
|
||||
|
||||
#line 51 "..\..\Views\Device\ImportExport.cshtml"
|
||||
Write(Html.ActionLink(Model.DeviceModels[0].ToString(), MVC.Config.DeviceModel.Index(Model.DeviceModels[0].Id)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("]</em>\r\n </td>\r\n </tr>\r\n <tr>\r\n " +
|
||||
" <th>Device Profile</th>\r\n <td>The <span");
|
||||
|
||||
WriteLiteral(" class=\"code\"");
|
||||
|
||||
WriteLiteral(">ID</span> for the Device Profile (<a");
|
||||
|
||||
WriteLiteral(" href=\"#\"");
|
||||
|
||||
WriteLiteral(" id=\"showDeviceProfiles\"");
|
||||
|
||||
WriteLiteral(">Show IDs</a>). <em>Default: <span");
|
||||
|
||||
WriteLiteral(" class=\"code\"");
|
||||
|
||||
WriteLiteral(">1</span> [");
|
||||
|
||||
|
||||
#line 56 "..\..\Views\Device\ImportExport.cshtml"
|
||||
Write(Html.ActionLink(Model.DeviceProfiles[0].ToString(), MVC.Config.DeviceProfile.Index(Model.DeviceProfiles[0].Id)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("]</em>\r\n </td>\r\n </tr>\r\n <tr>\r\n " +
|
||||
" <th>Device Batch</th>\r\n <td>The <span");
|
||||
|
||||
WriteLiteral(" class=\"code\"");
|
||||
|
||||
WriteLiteral(">ID</span> for the Device Batch (<a");
|
||||
|
||||
WriteLiteral(" href=\"#\"");
|
||||
|
||||
WriteLiteral(" id=\"showDeviceBatches\"");
|
||||
|
||||
WriteLiteral(">Show IDs</a>). <em>Default: <span");
|
||||
|
||||
WriteLiteral(" class=\"code\"");
|
||||
|
||||
WriteLiteral("><None></span></em>\r\n </td>\r\n </tr>\r\n " +
|
||||
" <tr>\r\n <th>Assigned User</th>\r\n " +
|
||||
" <td>The <span");
|
||||
|
||||
WriteLiteral(" class=\"code\"");
|
||||
|
||||
WriteLiteral(">ID</span> for the User assigned to the device. <em>Default: <span");
|
||||
|
||||
WriteLiteral(" class=\"code\"");
|
||||
|
||||
WriteLiteral("><None></span></em>\r\n </td>\r\n </tr>\r\n " +
|
||||
" <tr>\r\n <th>Location</th>\r\n <td" +
|
||||
">Updates the Location of the device. Maximum of 250 characters. <em>Default: <sp" +
|
||||
"an");
|
||||
|
||||
WriteLiteral(" class=\"code\"");
|
||||
|
||||
WriteLiteral("><None></span></em>\r\n </td>\r\n </tr>\r\n " +
|
||||
" <tr>\r\n <th>Asset Number</th>\r\n " +
|
||||
" <td>Updates the Asset Number of the device. Maximum of 40 characters. <em>Defau" +
|
||||
"lt: <span");
|
||||
|
||||
WriteLiteral(" class=\"code\"");
|
||||
|
||||
WriteLiteral("><None></span></em>\r\n </td>\r\n </tr>\r\n " +
|
||||
" </tbody>\r\n </table>\r\n\r\n\r\n <div");
|
||||
|
||||
WriteLiteral(" id=\"showDeviceModelsDialog\"");
|
||||
|
||||
WriteLiteral(" class=\"hiddenDialog\"");
|
||||
|
||||
WriteLiteral(" title=\"Disco Device Model Ids\"");
|
||||
|
||||
WriteLiteral(">\r\n <table");
|
||||
|
||||
WriteLiteral(" class=\"tableData\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Description</th>
|
||||
<th>Manufacturer</th>
|
||||
<th>Model</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
");
|
||||
|
||||
|
||||
#line 94 "..\..\Views\Device\ImportExport.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 94 "..\..\Views\Device\ImportExport.cshtml"
|
||||
foreach (var dm in Model.DeviceModels)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <tr>\r\n <td>");
|
||||
|
||||
|
||||
#line 97 "..\..\Views\Device\ImportExport.cshtml"
|
||||
Write(Html.ActionLink(dm.Id.ToString(), MVC.Config.DeviceModel.Index(dm.Id)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</td>\r\n <td>");
|
||||
|
||||
|
||||
#line 98 "..\..\Views\Device\ImportExport.cshtml"
|
||||
Write(dm.ToString());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</td>\r\n <td>");
|
||||
|
||||
|
||||
#line 99 "..\..\Views\Device\ImportExport.cshtml"
|
||||
Write(dm.Manufacturer);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</td>\r\n <td>");
|
||||
|
||||
|
||||
#line 100 "..\..\Views\Device\ImportExport.cshtml"
|
||||
Write(dm.Model);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</td>\r\n </tr>\r\n");
|
||||
|
||||
|
||||
#line 102 "..\..\Views\Device\ImportExport.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </tbody>\r\n </table>\r\n </div>\r\n\r\n <div");
|
||||
|
||||
WriteLiteral(" id=\"showDeviceProfilesDialog\"");
|
||||
|
||||
WriteLiteral(" class=\"hiddenDialog\"");
|
||||
|
||||
WriteLiteral(" title=\"Disco Device Profile Ids\"");
|
||||
|
||||
WriteLiteral(">\r\n <table");
|
||||
|
||||
WriteLiteral(" class=\"tableData\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Name</th>
|
||||
<th>Short Name</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
");
|
||||
|
||||
|
||||
#line 118 "..\..\Views\Device\ImportExport.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 118 "..\..\Views\Device\ImportExport.cshtml"
|
||||
foreach (var dp in Model.DeviceProfiles)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <tr>\r\n <td>");
|
||||
|
||||
|
||||
#line 121 "..\..\Views\Device\ImportExport.cshtml"
|
||||
Write(Html.ActionLink(dp.Id.ToString(), MVC.Config.DeviceProfile.Index(dp.Id)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</td>\r\n <td>");
|
||||
|
||||
|
||||
#line 122 "..\..\Views\Device\ImportExport.cshtml"
|
||||
Write(dp.Name);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</td>\r\n <td>");
|
||||
|
||||
|
||||
#line 123 "..\..\Views\Device\ImportExport.cshtml"
|
||||
Write(dp.ShortName);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</td>\r\n <td>");
|
||||
|
||||
|
||||
#line 124 "..\..\Views\Device\ImportExport.cshtml"
|
||||
Write(dp.Description);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</td>\r\n </tr>\r\n");
|
||||
|
||||
|
||||
#line 126 "..\..\Views\Device\ImportExport.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </tbody>\r\n </table>\r\n </div>\r\n\r\n <div");
|
||||
|
||||
WriteLiteral(" id=\"showDeviceBatchesDialog\"");
|
||||
|
||||
WriteLiteral(" class=\"hiddenDialog\"");
|
||||
|
||||
WriteLiteral(" title=\"Disco Device Batch Ids\"");
|
||||
|
||||
WriteLiteral(">\r\n <table");
|
||||
|
||||
WriteLiteral(" class=\"tableData\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Name</th>
|
||||
<th>Purchase Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
");
|
||||
|
||||
|
||||
#line 141 "..\..\Views\Device\ImportExport.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 141 "..\..\Views\Device\ImportExport.cshtml"
|
||||
foreach (var db in Model.DeviceBatches)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <tr>\r\n <td>");
|
||||
|
||||
|
||||
#line 144 "..\..\Views\Device\ImportExport.cshtml"
|
||||
Write(Html.ActionLink(db.Id.ToString(), MVC.Config.DeviceBatch.Index(db.Id)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</td>\r\n <td>");
|
||||
|
||||
|
||||
#line 145 "..\..\Views\Device\ImportExport.cshtml"
|
||||
Write(db.Name);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</td>\r\n <td>");
|
||||
|
||||
|
||||
#line 146 "..\..\Views\Device\ImportExport.cshtml"
|
||||
Write(CommonHelpers.FriendlyDate(db.PurchaseDate));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</td>\r\n </tr>\r\n");
|
||||
|
||||
|
||||
#line 148 "..\..\Views\Device\ImportExport.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </tbody>\r\n </table>\r\n </div>\r\n\r\n <script" +
|
||||
">\r\n $(function () {\r\n var dialogOptions = {\r\n " +
|
||||
" width: 700,\r\n height: 600,\r\n re" +
|
||||
"sizable: false,\r\n modal: true,\r\n autoOpen:" +
|
||||
" false\r\n },\r\n $showDeviceModelsDialog = null,\r\n " +
|
||||
" $showDeviceProfilesDialog = null,\r\n $showDeviceBatch" +
|
||||
"esDialog = null;\r\n\r\n $(\'#showDeviceModels\').click(function (e) {\r" +
|
||||
"\n e.preventDefault();\r\n if (!$showDeviceMo" +
|
||||
"delsDialog)\r\n $showDeviceModelsDialog = $(\'#showDeviceMod" +
|
||||
"elsDialog\').dialog(dialogOptions);\r\n $showDeviceModelsDialog." +
|
||||
"dialog(\'open\');\r\n });\r\n\r\n $(\'#showDeviceProfiles\')" +
|
||||
".click(function (e) {\r\n e.preventDefault();\r\n " +
|
||||
" if (!$showDeviceProfilesDialog)\r\n $showDeviceProfiles" +
|
||||
"Dialog = $(\'#showDeviceProfilesDialog\').dialog(dialogOptions);\r\n " +
|
||||
" $showDeviceProfilesDialog.dialog(\'open\');\r\n });\r\n " +
|
||||
" $(\'#showDeviceBatches\').click(function (e) {\r\n e.preventD" +
|
||||
"efault();\r\n if (!$showDeviceBatchesDialog)\r\n " +
|
||||
" $showDeviceBatchesDialog = $(\'#showDeviceBatchesDialog\').dialog(dialogOpt" +
|
||||
"ions);\r\n $showDeviceBatchesDialog.dialog(\'open\');\r\n " +
|
||||
" });\r\n });\r\n </script>\r\n </div>\r\n\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"actionBar\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 190 "..\..\Views\Device\ImportExport.cshtml"
|
||||
Write(Html.ActionLinkButton("Export All Devices", MVC.API.Device.ExportAllDevices()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </div>\r\n</div>\r\n");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -0,0 +1,249 @@
|
||||
@model Disco.Web.Models.Device.ImportReviewModel
|
||||
@using Disco.BI.DeviceBI.Importing
|
||||
@{
|
||||
ViewBag.Title = Html.ToBreadcrumb("Devices", MVC.Device.Index(), "Import Devices", MVC.Device.ImportExport(), string.Format("File: {0}", Model.ImportFilename));
|
||||
|
||||
int importDeviceOkCount = Model.ImportDevices.Count(id => id.Errors.Count == 0);
|
||||
int importDeviceNewCount = Model.ImportDevices.Count(id => id.Errors.Count == 0 && id.Device == null);
|
||||
int importDeviceUpdateCount = Model.ImportDevices.Count(id => id.Errors.Count == 0 && id.Device != null);
|
||||
int importDeviceErrorCount = Model.ImportDevices.Count - importDeviceOkCount;
|
||||
}
|
||||
<div id="deviceImportReview">
|
||||
@if (Model.ImportDevices.Count > 0)
|
||||
{
|
||||
<h2>Parsed @Model.ImportDevices.Count Device Record@(Model.ImportDevices.Count != 1 ? "s" : null)</h2>
|
||||
<h4>
|
||||
@importDeviceOkCount of @Model.ImportDevices.Count Device@(Model.ImportDevices.Count != 1 ? "s" : null) are ready for import.
|
||||
</h4>
|
||||
if (importDeviceErrorCount > 0)
|
||||
{
|
||||
<h4 id="errorMessage">
|
||||
@(importDeviceErrorCount) Record@(importDeviceErrorCount != 1 ? "s" : null) will be skipped if the import continues
|
||||
</h4>
|
||||
}
|
||||
|
||||
<div id="devicesNavigation">
|
||||
<ul class="none">
|
||||
@if (importDeviceNewCount > 0)
|
||||
{<li class="statusNew">
|
||||
<input id="devicesNavigationNew" type="checkbox" checked="checked" /><label for="devicesNavigationNew">Show New Devices (@(Model.ImportDevices.Count(id => id.Errors.Count == 0 && id.Device == null)))</label>
|
||||
</li>}@if (importDeviceUpdateCount > 0)
|
||||
{<li class="statusUpdate">
|
||||
<input id="devicesNavigationUpdate" type="checkbox" checked="checked" /><label for="devicesNavigationUpdate">Show Updates (@(Model.ImportDevices.Count(id => id.Errors.Count == 0 && id.Device != null)))</label>
|
||||
</li>}@if (importDeviceErrorCount > 0)
|
||||
{<li class="statusError">
|
||||
<input id="devicesNavigationError" type="checkbox" checked="checked" /><label for="devicesNavigationError">Show Errors (@(Model.ImportDevices.Count(id => id.Errors.Count != 0)))</label>
|
||||
</li>}
|
||||
</ul>
|
||||
<script>
|
||||
$(function () {
|
||||
$devices = $('#devices');
|
||||
$rows = $devices.children('tbody').children('tr');
|
||||
|
||||
$('#devicesNavigationNew').change(function () {
|
||||
if ($(this).is(':checked'))
|
||||
$rows.filter('.statusNew').show();
|
||||
else
|
||||
$rows.filter('.statusNew').hide();
|
||||
});
|
||||
|
||||
$('#devicesNavigationUpdate').change(function () {
|
||||
if ($(this).is(':checked'))
|
||||
$rows.filter('.statusUpdate').show();
|
||||
else
|
||||
$rows.filter('.statusUpdate').hide();
|
||||
});
|
||||
|
||||
$('#devicesNavigationError').change(function () {
|
||||
if ($(this).is(':checked'))
|
||||
$rows.filter('.statusError').show();
|
||||
else
|
||||
$rows.filter('.statusError').hide();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
<table id="devices">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="row">Row</th>
|
||||
<th class="action">Action</th>
|
||||
<th class="serialNumber">Serial Number</th>
|
||||
<th class="model">Model</th>
|
||||
<th class="profile">Profile</th>
|
||||
<th class="batch">Batch</th>
|
||||
<th class="assignedUser">Assigned User</th>
|
||||
<th class="location">Location</th>
|
||||
<th class="assetNumber">Asset Number</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var device in Model.ImportDevices)
|
||||
{
|
||||
bool isUpdate = device.Device != null;
|
||||
string error;
|
||||
<tr class="status@(device.ImportStatus())">
|
||||
<td class="row">
|
||||
@((Model.ImportDevices.IndexOf(device) + 1))
|
||||
</td>
|
||||
<td class="action">
|
||||
@(device.ImportStatus())
|
||||
</td>
|
||||
<td class="serialNumber">
|
||||
@if (device.Device == null)
|
||||
{
|
||||
@device.SerialNumber
|
||||
}
|
||||
else
|
||||
{
|
||||
@Html.ActionLink(device.SerialNumber, MVC.Device.Show(device.SerialNumber), new { target = "_blank" })
|
||||
}
|
||||
|
||||
@if (device.Errors.TryGetValue("SerialNumber", out error))
|
||||
{
|
||||
<div class="error">@error</div>
|
||||
}
|
||||
</td>
|
||||
<td class="model">
|
||||
@if (device.Errors.TryGetValue("DeviceModelId", out error))
|
||||
{
|
||||
<div class="error">@error</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!isUpdate || device.DeviceModelId != device.Device.DeviceModelId)
|
||||
{
|
||||
<img class="modelImage" alt="Model Image" src="@Url.Action(MVC.API.DeviceModel.Image(device.DeviceModel.Id, device.DeviceModel.ImageHash()))" />
|
||||
@device.DeviceModel.ToString()
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="smallMessage">No Change</span>
|
||||
}
|
||||
}</td>
|
||||
<td class="profile">
|
||||
@if (device.Errors.TryGetValue("DeviceProfileId", out error))
|
||||
{
|
||||
<div class="error">@error</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!isUpdate || device.DeviceProfileId != device.Device.DeviceProfileId)
|
||||
{
|
||||
@device.DeviceProfile.ToString()
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="smallMessage">No Change</span>
|
||||
}
|
||||
}</td>
|
||||
<td class="batch">
|
||||
@if (device.Errors.TryGetValue("DeviceBatchId", out error))
|
||||
{
|
||||
<div class="error">@error</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!isUpdate || device.DeviceBatchId != device.Device.DeviceBatchId)
|
||||
{
|
||||
if (device.DeviceBatch == null)
|
||||
{
|
||||
<text><None></text>
|
||||
}
|
||||
else
|
||||
{
|
||||
@device.DeviceBatch.ToString()
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="smallMessage">No Change</span>
|
||||
}
|
||||
}</td>
|
||||
<td class="assignedUser">
|
||||
@if (device.Errors.TryGetValue("AssignedUserId", out error))
|
||||
{
|
||||
<div class="error">@error</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!isUpdate || device.AssignedUserId != device.Device.AssignedUserId)
|
||||
{
|
||||
if (device.AssignedUser == null)
|
||||
{
|
||||
<text><None></text>
|
||||
}
|
||||
else
|
||||
{
|
||||
@device.AssignedUser.ToString()
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="smallMessage">No Change</span>
|
||||
}
|
||||
}</td>
|
||||
<td class="location">
|
||||
@if (device.Errors.TryGetValue("Location", out error))
|
||||
{
|
||||
<div class="error">@error</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!isUpdate || device.Location != device.Device.Location)
|
||||
{
|
||||
if (device.Location == null)
|
||||
{
|
||||
<text><None></text>
|
||||
}
|
||||
else
|
||||
{
|
||||
@device.Location
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="smallMessage">No Change</span>
|
||||
}
|
||||
}</td>
|
||||
<td class="assetNumber">
|
||||
@if (device.Errors.TryGetValue("AssetNumber", out error))
|
||||
{
|
||||
<div class="error">@error</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!isUpdate || device.AssetNumber != device.Device.AssetNumber)
|
||||
{
|
||||
if (device.AssetNumber == null)
|
||||
{
|
||||
<text><None></text>
|
||||
}
|
||||
else
|
||||
{
|
||||
@device.AssetNumber
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="smallMessage">No Change</span>
|
||||
}
|
||||
}</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
if (importDeviceOkCount > 0)
|
||||
{
|
||||
<div class="actionBar">
|
||||
@Html.ActionLinkButton(string.Format("Import {0} Device{1}", importDeviceOkCount, importDeviceOkCount != 1 ? "s" : null), MVC.API.Device.ImportProcess(Model.ImportParseTaskId))
|
||||
</div>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<h2>No Devices were found in this file</h2>
|
||||
}
|
||||
</div>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5,6 +5,6 @@
|
||||
Search for a Device</h3>
|
||||
@Html.Partial(MVC.Shared.Views._SearchDialog, "devices")
|
||||
<div class="actionBar">
|
||||
@Html.ActionLinkButton("Import Devices", MVC.Device.Import())
|
||||
@Html.ActionLinkButton("Import/Export Devices", MVC.Device.ImportExport())
|
||||
@Html.ActionLinkButton("Add Offline Device", MVC.Device.AddOffline())
|
||||
</div>
|
||||
|
||||
@@ -67,7 +67,7 @@ WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 8 "..\..\Views\Device\Index.cshtml"
|
||||
Write(Html.ActionLinkButton("Import Devices", MVC.Device.Import()));
|
||||
Write(Html.ActionLinkButton("Import/Export Devices", MVC.Device.ImportExport()));
|
||||
|
||||
|
||||
#line default
|
||||
|
||||
Reference in New Issue
Block a user