From a0e18ef9639b6a544366ed1aa6a66720dea5d740 Mon Sep 17 00:00:00 2001
From: Gary Sharp
Date: Tue, 3 Jun 2014 12:36:48 +1000
Subject: [PATCH] SignalR Bug Fixes & Minor UI Changes
Document Template import status and Device Enrolment status fixes.
Attachment download fixes for SignalR foreverFrame transport. Database
queries for Devices, Jobs and Users updated. Device attributes (model,
profile, batch) now shown in various places.
---
.../Searching/DeviceSearchResultItem.cs | 1 +
Disco.Services/Searching/Search.cs | 1 +
.../Areas/API/Controllers/DeviceController.cs | 4 +-
.../Areas/API/Controllers/JobController.cs | 4 +-
.../Areas/API/Controllers/UserController.cs | 4 +-
.../API/Models/Attachment/_AttachmentModel.cs | 18 ++
.../DocumentTemplate/ImportStatus.cshtml | 24 +-
.../ImportStatus.generated.cs | 222 +++++++-------
.../Config/Views/Enrolment/Status.cshtml | 19 +-
.../Views/Enrolment/Status.generated.cs | 32 +-
Disco.Web/Controllers/DeviceController.cs | 4 +-
Disco.Web/Controllers/JobController.cs | 9 +-
Disco.Web/Controllers/UserController.cs | 6 +-
.../Device/DeviceParts/_Resources.cshtml | 33 ++-
.../DeviceParts/_Resources.generated.cs | 108 ++++---
Disco.Web/Views/Device/_DeviceTable.cshtml | 12 +
.../Views/Device/_DeviceTable.generated.cs | 133 ++++++---
Disco.Web/Views/Job/JobParts/Resources.cshtml | 38 ++-
.../Views/Job/JobParts/Resources.generated.cs | 150 ++++++----
.../User/UserParts/_AssignmentHistory.cshtml | 56 +++-
.../UserParts/_AssignmentHistory.generated.cs | 280 +++++++++++++++---
.../Views/User/UserParts/_Resources.cshtml | 33 ++-
.../User/UserParts/_Resources.generated.cs | 95 +++---
.../Views/User/UserParts/_Subject.cshtml | 58 ++--
.../User/UserParts/_Subject.generated.cs | 209 +++++++++----
25 files changed, 1088 insertions(+), 465 deletions(-)
diff --git a/Disco.Models/Services/Searching/DeviceSearchResultItem.cs b/Disco.Models/Services/Searching/DeviceSearchResultItem.cs
index d947243b..c0cd6783 100644
--- a/Disco.Models/Services/Searching/DeviceSearchResultItem.cs
+++ b/Disco.Models/Services/Searching/DeviceSearchResultItem.cs
@@ -41,6 +41,7 @@ namespace Disco.Models.Services.Searching
public string ComputerName { get; set; }
public string DeviceModelDescription { get; set; }
public string DeviceProfileDescription { get; set; }
+ public string DeviceBatchName { get; set; }
public int JobCount { get; set; }
public DateTime? DecommissionedDate { get; set; }
diff --git a/Disco.Services/Searching/Search.cs b/Disco.Services/Searching/Search.cs
index 8158ed2f..87aa87e0 100644
--- a/Disco.Services/Searching/Search.cs
+++ b/Disco.Services/Searching/Search.cs
@@ -276,6 +276,7 @@ namespace Disco.Services.Searching
ComputerName = d.DeviceDomainId,
DeviceModelDescription = d.DeviceModel.Description,
DeviceProfileDescription = d.DeviceProfile.Description,
+ DeviceBatchName = d.DeviceBatch.Name,
DecommissionedDate = d.DecommissionedDate,
AssignedUserId = d.AssignedUserId,
AssignedUserDisplayName = d.AssignedUser.DisplayName,
diff --git a/Disco.Web/Areas/API/Controllers/DeviceController.cs b/Disco.Web/Areas/API/Controllers/DeviceController.cs
index dcadc480..5e8d6703 100644
--- a/Disco.Web/Areas/API/Controllers/DeviceController.cs
+++ b/Disco.Web/Areas/API/Controllers/DeviceController.cs
@@ -519,7 +519,7 @@ namespace Disco.Web.Areas.API.Controllers
[DiscoAuthorize(Claims.Device.ShowAttachments)]
public virtual ActionResult Attachment(int id)
{
- var da = Database.DeviceAttachments.Include("TechUser").Where(m => m.Id == id).FirstOrDefault();
+ var da = Database.DeviceAttachments.Include("DocumentTemplate").Include("TechUser").Where(m => m.Id == id).FirstOrDefault();
if (da != null)
{
@@ -537,7 +537,7 @@ namespace Disco.Web.Areas.API.Controllers
[DiscoAuthorize(Claims.Device.ShowAttachments)]
public virtual ActionResult Attachments(string id)
{
- var d = Database.Devices.Include("DeviceAttachments.TechUser").Where(m => m.SerialNumber == id).FirstOrDefault();
+ var d = Database.Devices.Include("DeviceAttachments.DocumentTemplate").Include("DeviceAttachments.TechUser").Where(m => m.SerialNumber == id).FirstOrDefault();
if (d != null)
{
var m = new Models.Attachment.AttachmentsModel()
diff --git a/Disco.Web/Areas/API/Controllers/JobController.cs b/Disco.Web/Areas/API/Controllers/JobController.cs
index 6c1da7a3..d6f47bde 100644
--- a/Disco.Web/Areas/API/Controllers/JobController.cs
+++ b/Disco.Web/Areas/API/Controllers/JobController.cs
@@ -1974,7 +1974,7 @@ namespace Disco.Web.Areas.API.Controllers
[DiscoAuthorize(Claims.Job.ShowAttachments)]
public virtual ActionResult Attachment(int id)
{
- var ja = Database.JobAttachments.Include("TechUser").Where(m => m.Id == id).FirstOrDefault();
+ var ja = Database.JobAttachments.Include("DocumentTemplate").Include("TechUser").Where(m => m.Id == id).FirstOrDefault();
if (ja != null)
{
@@ -1992,7 +1992,7 @@ namespace Disco.Web.Areas.API.Controllers
[DiscoAuthorize(Claims.Job.ShowAttachments)]
public virtual ActionResult Attachments(int id)
{
- var j = Database.Jobs.Include("JobAttachments.TechUser").Where(m => m.Id == id).FirstOrDefault();
+ var j = Database.Jobs.Include("JobAttachments.DocumentTemplate").Include("JobAttachments.TechUser").Where(m => m.Id == id).FirstOrDefault();
if (j != null)
{
var m = new Models.Attachment.AttachmentsModel()
diff --git a/Disco.Web/Areas/API/Controllers/UserController.cs b/Disco.Web/Areas/API/Controllers/UserController.cs
index 426cc60b..da260c3b 100644
--- a/Disco.Web/Areas/API/Controllers/UserController.cs
+++ b/Disco.Web/Areas/API/Controllers/UserController.cs
@@ -102,7 +102,7 @@ namespace Disco.Web.Areas.API.Controllers
[DiscoAuthorize(Claims.User.ShowAttachments)]
public virtual ActionResult Attachment(int id)
{
- var ua = Database.UserAttachments.Include("TechUser").Where(m => m.Id == id).FirstOrDefault();
+ var ua = Database.UserAttachments.Include("DocumentTemplate").Include("TechUser").Where(m => m.Id == id).FirstOrDefault();
if (ua != null)
{
@@ -125,7 +125,7 @@ namespace Disco.Web.Areas.API.Controllers
else
id = Domain + @"\" + id;
- var u = Database.Users.Include("UserAttachments.TechUser").Where(m => m.UserId == id).FirstOrDefault();
+ var u = Database.Users.Include("UserAttachments.DocumentTemplate").Include("UserAttachments.TechUser").Where(m => m.UserId == id).FirstOrDefault();
if (u != null)
{
var m = new Models.Attachment.AttachmentsModel()
diff --git a/Disco.Web/Areas/API/Models/Attachment/_AttachmentModel.cs b/Disco.Web/Areas/API/Models/Attachment/_AttachmentModel.cs
index fee6df51..e109326c 100644
--- a/Disco.Web/Areas/API/Models/Attachment/_AttachmentModel.cs
+++ b/Disco.Web/Areas/API/Models/Attachment/_AttachmentModel.cs
@@ -11,6 +11,18 @@ namespace Disco.Web.Areas.API.Models.Attachment
public string AuthorId { get; set; }
public DateTime Timestamp { get; set; }
public string Comments { get; set; }
+ public string DocumentTemplateId { get; set; }
+ public string DocumentTemplateDescription { get; set; }
+ public string Description
+ {
+ get
+ {
+ if (DocumentTemplateId != null && DocumentTemplateDescription != null)
+ return DocumentTemplateDescription;
+ else
+ return Comments;
+ }
+ }
public string Filename { get; set; }
public string MimeType { get; set; }
public long TimestampUnixEpoc { get { return Timestamp.ToUnixEpoc(); } }
@@ -26,6 +38,8 @@ namespace Disco.Web.Areas.API.Models.Attachment
Author = ua.TechUser.ToStringFriendly(),
Timestamp = ua.Timestamp,
Comments = ua.Comments,
+ DocumentTemplateId = ua.DocumentTemplateId,
+ DocumentTemplateDescription = ua.DocumentTemplateId == null ? null : ua.DocumentTemplate.Description,
Filename = ua.Filename,
MimeType = ua.MimeType
};
@@ -40,6 +54,8 @@ namespace Disco.Web.Areas.API.Models.Attachment
Author = ja.TechUser.ToStringFriendly(),
Timestamp = ja.Timestamp,
Comments = ja.Comments,
+ DocumentTemplateId = ja.DocumentTemplateId,
+ DocumentTemplateDescription = ja.DocumentTemplateId == null ? null : ja.DocumentTemplate.Description,
Filename = ja.Filename,
MimeType = ja.MimeType
};
@@ -54,6 +70,8 @@ namespace Disco.Web.Areas.API.Models.Attachment
Author = da.TechUser.ToStringFriendly(),
Timestamp = da.Timestamp,
Comments = da.Comments,
+ DocumentTemplateId = da.DocumentTemplateId,
+ DocumentTemplateDescription = da.DocumentTemplateId == null ? null : da.DocumentTemplate.Description,
Filename = da.Filename,
MimeType = da.MimeType
};
diff --git a/Disco.Web/Areas/Config/Views/DocumentTemplate/ImportStatus.cshtml b/Disco.Web/Areas/Config/Views/DocumentTemplate/ImportStatus.cshtml
index 869bd700..32e2da32 100644
--- a/Disco.Web/Areas/Config/Views/DocumentTemplate/ImportStatus.cshtml
+++ b/Disco.Web/Areas/Config/Views/DocumentTemplate/ImportStatus.cshtml
@@ -1,6 +1,6 @@
@{
Authorization.Require(Claims.Config.DocumentTemplate.ShowStatus);
-
+
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Document Templates", MVC.Config.DocumentTemplate.Index(), "Import Status");
Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR");
@@ -99,7 +99,7 @@
var vm;
var host = $('#importStatus');
var hostSessions = $('#sessions');
- var liveConnection;
+ var logHub = null;
var urlDeviceShow = '@(Url.Action(MVC.Device.Show()))/'
var urlJobShow = '@(Url.Action(MVC.Job.Show()))/'
var urlUserShow = '@(Url.Action(MVC.User.Show()))/'
@@ -134,10 +134,8 @@
self.sessionPages = ko.observableArray();
self.sessionPagesIndex = {};
self.addSessionPage = function (sessionPage) {
- //if (isLive) {
self.sessionPages.push(sessionPage);
self.sessionPagesIndex[sessionPage.pageNumber] = sessionPage;
- //}
}
}
function sessionPageViewModel(sessionId, pageNumber) {
@@ -305,11 +303,19 @@
ko.applyBindings(vm);
// Init Persistent Connection
- liveConnection = $.connection('@(Url.Content("~/API/Logging/Notifications"))', { addToGroups: '@(Disco.BI.DocumentTemplateBI.Importer.DocumentImporterLog.Current.LiveLogGroupName)' });
- liveConnection.received(parseLog);
- liveConnection.error(function (e) { if (e.status != 200) alert('Live-Log Error: ' + e.statusText + ': ' + e.responseText); });
- isLive = true;
- liveConnection.start();
+ logHub = $.connection.logNotifications;
+ logHub.client.receiveLog = parseLog
+
+ $.connection.hub.qs = { LogModules: '@(Disco.BI.DocumentTemplateBI.Importer.DocumentImporterLog.Current.LiveLogGroupName)' };
+ $.connection.hub.error(function (error) {
+ alert('Live-Log Error: ' + error);
+ });
+
+ $.connection.hub.start()
+ .done(function () { isLive = true; })
+ .fail(function (error) {
+ alert('Live-Log Connection Error: ' + error);
+ });
}
init();
});
diff --git a/Disco.Web/Areas/Config/Views/DocumentTemplate/ImportStatus.generated.cs b/Disco.Web/Areas/Config/Views/DocumentTemplate/ImportStatus.generated.cs
index 037a4ea9..80fa4368 100644
--- a/Disco.Web/Areas/Config/Views/DocumentTemplate/ImportStatus.generated.cs
+++ b/Disco.Web/Areas/Config/Views/DocumentTemplate/ImportStatus.generated.cs
@@ -48,7 +48,7 @@ namespace Disco.Web.Areas.Config.Views.DocumentTemplate
#line 1 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
Authorization.Require(Claims.Config.DocumentTemplate.ShowStatus);
-
+
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Document Templates", MVC.Config.DocumentTemplate.Index(), "Import Status");
Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR");
@@ -267,8 +267,8 @@ WriteLiteral(@">
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(">\r\n $(function () {\r\n var vm;\r\n var host = $(\'#importStatus\');\r\n" +
-" var hostSessions = $(\'#sessions\');\r\n var liveConnection;\r\n " +
-" var urlDeviceShow = \'");
+" var hostSessions = $(\'#sessions\');\r\n var logHub = null;\r\n " +
+"var urlDeviceShow = \'");
#line 103 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
@@ -334,101 +334,100 @@ WriteLiteral("\';\r\n var isLive = false;\r\n\r\n function pageVie
"= ko.observable();\r\n self.startTime = ko.observable();\r\n s" +
"elf.sessionEnded = ko.observable(false);\r\n\r\n self.sessionPages = ko.o" +
"bservableArray();\r\n self.sessionPagesIndex = {};\r\n self.ad" +
-"dSessionPage = function (sessionPage) {\r\n //if (isLive) {\r\n " +
-" self.sessionPages.push(sessionPage);\r\n self.sessionPage" +
-"sIndex[sessionPage.pageNumber] = sessionPage;\r\n //}\r\n " +
-"}\r\n }\r\n function sessionPageViewModel(sessionId, pageNumber) {\r\n " +
-" var self = this;\r\n\r\n self.sessionId = sessionId;\r\n " +
-" self.pageNumber = pageNumber;\r\n self.title = \'Page \' + pageNumber;" +
-"\r\n self.progressStatus = ko.observable();\r\n self.progressV" +
-"alue = ko.observable();\r\n self.undetected = ko.observable(false);\r\n " +
-" self.detected = ko.observable(false);\r\n self.documentTempla" +
-"teId = ko.observable();\r\n self.documentTemplate = ko.observable();\r\n " +
-" self.assignedDataType = ko.observable();\r\n self.assignedDa" +
-"taId = ko.observable();\r\n self.assignedData = ko.observable();\r\n " +
-" self.thumbnailEnabled = ko.observable(0);\r\n self.updateThumbna" +
-"il = function () {\r\n self.thumbnailEnabled(self.thumbnailEnabled(" +
-") + 1);\r\n }\r\n self.documentTemplateUrl = ko.computed(funct" +
-"ion () {\r\n return urlDocumentTemplate + self.documentTemplateId()" +
-";\r\n });\r\n self.manuallyAssignUrl = ko.computed(function ()" +
-" {\r\n return urlManuallyAssign + \'#\' + self.sessionId + \'_\' + self" +
-".pageNumber;\r\n });\r\n self.assignedDataUrl = ko.computed(fu" +
-"nction () {\r\n var t = self.assignedDataType();\r\n v" +
-"ar dId = self.assignedDataId();\r\n if (dId !== undefined) {\r\n " +
-" switch (t) {\r\n case \'Device\':\r\n " +
-" return urlDeviceShow + dId;\r\n case \'Job\'" +
-":\r\n return urlJobShow + dId;\r\n " +
-" case \'User\':\r\n if (dId.indexOf(\'\\\\\') < 0)\r\n " +
-" return urlUserShow + dId;\r\n el" +
-"se\r\n return urlUserShow + dId.substr(dId.indexOf(" +
-"\'\\\\\') + 1) + \'?domain=\' + dId.substr(0, dId.indexOf(\'\\\\\'));\r\n " +
-" }\r\n }\r\n return null;\r\n });\r\n " +
-" self.thumbnailUrl = ko.computed(function () {\r\n var enabled = s" +
-"elf.thumbnailEnabled();\r\n if (enabled > 0) {\r\n " +
-" return \'url(\' + urlPageThumbnail + \'?SessionId=\' + self.sessionId + \'&PageNumbe" +
-"r=\' + self.pageNumber + \'&NoCache=\' + enabled + \')\';\r\n }\r\n " +
-" return null;\r\n });\r\n }\r\n\r\n function parseLog(l" +
-"og) {\r\n if (log.ModuleId === 40 && log.Arguments && log.Arguments.len" +
-"gth > 0) {\r\n // find session\r\n var sessionId = log" +
-".Arguments[0];\r\n var session = vm.sessionIndex[sessionId];\r\n " +
-" if (!session && log.EventTypeId === 10) { // Starting Session (Ignore" +
-" \'partial\' sessions)\r\n session = new sessionViewModel(log.Arg" +
-"uments[1]);\r\n vm.sessionIndex[sessionId] = session;\r\n " +
-" vm.sessions.unshift(session);\r\n vm.noSessions(fal" +
-"se);\r\n }\r\n if (session) {\r\n swi" +
-"tch (log.EventTypeId) {\r\n case 10: // SessionStarting\r\n " +
-" session.startTime(log.FormattedTimestamp.substring(log" +
-".FormattedTimestamp.indexOf(\' \') + 1));\r\n break;\r\n " +
-" case 11: // SessionProgress\r\n se" +
-"ssion.progressValue(log.Arguments[1]);\r\n session.prog" +
-"ressStatus(log.Arguments[2]);\r\n break;\r\n " +
-" case 12: // SessionFinished\r\n session.sess" +
-"ionEnded(true);\r\n session.progressStatus(\'Import Fini" +
-"shed\');\r\n break;\r\n case 15: //" +
-" SessionWarning\r\n session.messages.unshift(log);\r\n " +
-" break;\r\n case 16: // SessionErro" +
-"r\r\n session.messages.unshift(log);\r\n " +
-" break;\r\n case 100: // ImportPageStarting\r\n " +
-" session.addSessionPage(new sessionPageViewModel(sessionI" +
-"d, log.Arguments[1]));\r\n break;\r\n " +
-" case 104: // ImportPageImageUpdate\r\n var p = sess" +
-"ion.sessionPagesIndex[log.Arguments[1]];\r\n if (p) {\r\n" +
-" p.updateThumbnail();\r\n " +
-" }\r\n break;\r\n case 105: // Im" +
-"portPageProgress\r\n var p = session.sessionPagesIndex[" +
-"log.Arguments[1]];\r\n if (p) {\r\n " +
-" p.progressValue(log.Arguments[2]);\r\n p." +
-"progressStatus(log.Arguments[3]);\r\n }\r\n " +
-" break;\r\n case 110: // ImportPageDetected\r\n " +
-" var p = session.sessionPagesIndex[log.Arguments[1]];\r" +
-"\n if (p) {\r\n p.documen" +
-"tTemplateId(log.Arguments[2]);\r\n p.documentTempla" +
-"te(log.Arguments[3]);\r\n p.assignedDataType(log.Ar" +
-"guments[4]);\r\n p.assignedDataId(log.Arguments[5])" +
-";\r\n p.assignedData(log.Arguments[6]);\r\n " +
-" p.detected(true);\r\n if (!is" +
-"Live) {\r\n p.updateThumbnail();\r\n " +
-" }\r\n }\r\n " +
-" session.messages.unshift(log);\r\n break;\r\n " +
-" case 115: // ImportPageUndetected\r\n var " +
-"p = session.sessionPagesIndex[log.Arguments[1]];\r\n if" +
-" (p) {\r\n p.undetected(true);\r\n " +
-" if (!isLive) {\r\n p.updateThumbna" +
-"il();\r\n }\r\n }\r\n " +
-" session.messages.unshift(log);\r\n " +
-" break;\r\n case 150: // Ignore: ImportPageUndetectedStored" +
-"\r\n break;\r\n default:\r\n " +
-" session.messages.unshift(log);\r\n }\r\n " +
-" }\r\n }\r\n }\r\n function init() {\r\n /" +
-"/ Create View Model\r\n vm = new pageViewModel();\r\n\r\n // Loa" +
-"d Logs\r\n var d = new Date();\r\n var loadData = {\r\n " +
-" Format: \"json\",\r\n Start: d.getFullYear() + \'-\' + (d.getMon" +
-"th() + 1) + \'-\' + d.getDate(),\r\n End: null,\r\n Modu" +
-"leId: 40,\r\n Take: 2000\r\n };\r\n $.ajax({\r\n " +
-" url: \'");
+"dSessionPage = function (sessionPage) {\r\n self.sessionPages.push(" +
+"sessionPage);\r\n self.sessionPagesIndex[sessionPage.pageNumber] = " +
+"sessionPage;\r\n }\r\n }\r\n function sessionPageViewModel(se" +
+"ssionId, pageNumber) {\r\n var self = this;\r\n\r\n self.session" +
+"Id = sessionId;\r\n self.pageNumber = pageNumber;\r\n self.tit" +
+"le = \'Page \' + pageNumber;\r\n self.progressStatus = ko.observable();\r\n" +
+" self.progressValue = ko.observable();\r\n self.undetected =" +
+" ko.observable(false);\r\n self.detected = ko.observable(false);\r\n " +
+" self.documentTemplateId = ko.observable();\r\n self.documentTemp" +
+"late = ko.observable();\r\n self.assignedDataType = ko.observable();\r\n " +
+" self.assignedDataId = ko.observable();\r\n self.assignedData" +
+" = ko.observable();\r\n self.thumbnailEnabled = ko.observable(0);\r\n " +
+" self.updateThumbnail = function () {\r\n self.thumbnailEnab" +
+"led(self.thumbnailEnabled() + 1);\r\n }\r\n self.documentTempl" +
+"ateUrl = ko.computed(function () {\r\n return urlDocumentTemplate +" +
+" self.documentTemplateId();\r\n });\r\n self.manuallyAssignUrl" +
+" = ko.computed(function () {\r\n return urlManuallyAssign + \'#\' + s" +
+"elf.sessionId + \'_\' + self.pageNumber;\r\n });\r\n self.assign" +
+"edDataUrl = ko.computed(function () {\r\n var t = self.assignedData" +
+"Type();\r\n var dId = self.assignedDataId();\r\n if (d" +
+"Id !== undefined) {\r\n switch (t) {\r\n c" +
+"ase \'Device\':\r\n return urlDeviceShow + dId;\r\n " +
+" case \'Job\':\r\n return urlJobShow + dId" +
+";\r\n case \'User\':\r\n if (dId.ind" +
+"exOf(\'\\\\\') < 0)\r\n return urlUserShow + dId;\r\n " +
+" else\r\n return urlUserShow" +
+" + dId.substr(dId.indexOf(\'\\\\\') + 1) + \'?domain=\' + dId.substr(0, dId.indexOf(\'\\" +
+"\\\'));\r\n }\r\n }\r\n return null;\r\n " +
+" });\r\n self.thumbnailUrl = ko.computed(function () {\r\n " +
+" var enabled = self.thumbnailEnabled();\r\n if (enabled >" +
+" 0) {\r\n return \'url(\' + urlPageThumbnail + \'?SessionId=\' + se" +
+"lf.sessionId + \'&PageNumber=\' + self.pageNumber + \'&NoCache=\' + enabled + \')\';\r\n" +
+" }\r\n return null;\r\n });\r\n }\r\n\r\n " +
+" function parseLog(log) {\r\n if (log.ModuleId === 40 && log.Argu" +
+"ments && log.Arguments.length > 0) {\r\n // find session\r\n " +
+" var sessionId = log.Arguments[0];\r\n var session = vm.sessi" +
+"onIndex[sessionId];\r\n if (!session && log.EventTypeId === 10) { /" +
+"/ Starting Session (Ignore \'partial\' sessions)\r\n session = ne" +
+"w sessionViewModel(log.Arguments[1]);\r\n vm.sessionIndex[sessi" +
+"onId] = session;\r\n vm.sessions.unshift(session);\r\n " +
+" vm.noSessions(false);\r\n }\r\n if (session) " +
+"{\r\n switch (log.EventTypeId) {\r\n case " +
+"10: // SessionStarting\r\n session.startTime(log.Format" +
+"tedTimestamp.substring(log.FormattedTimestamp.indexOf(\' \') + 1));\r\n " +
+" break;\r\n case 11: // SessionProgress\r\n " +
+" session.progressValue(log.Arguments[1]);\r\n " +
+" session.progressStatus(log.Arguments[2]);\r\n " +
+" break;\r\n case 12: // SessionFinished\r\n " +
+" session.sessionEnded(true);\r\n session.p" +
+"rogressStatus(\'Import Finished\');\r\n break;\r\n " +
+" case 15: // SessionWarning\r\n session.m" +
+"essages.unshift(log);\r\n break;\r\n " +
+" case 16: // SessionError\r\n session.messages.unshif" +
+"t(log);\r\n break;\r\n case 100: /" +
+"/ ImportPageStarting\r\n session.addSessionPage(new ses" +
+"sionPageViewModel(sessionId, log.Arguments[1]));\r\n br" +
+"eak;\r\n case 104: // ImportPageImageUpdate\r\n " +
+" var p = session.sessionPagesIndex[log.Arguments[1]];\r\n " +
+" if (p) {\r\n p.updateThumbnail();\r\n" +
+" }\r\n break;\r\n " +
+" case 105: // ImportPageProgress\r\n var p = " +
+"session.sessionPagesIndex[log.Arguments[1]];\r\n if (p)" +
+" {\r\n p.progressValue(log.Arguments[2]);\r\n " +
+" p.progressStatus(log.Arguments[3]);\r\n " +
+" }\r\n break;\r\n case 110" +
+": // ImportPageDetected\r\n var p = session.sessionPage" +
+"sIndex[log.Arguments[1]];\r\n if (p) {\r\n " +
+" p.documentTemplateId(log.Arguments[2]);\r\n " +
+" p.documentTemplate(log.Arguments[3]);\r\n " +
+" p.assignedDataType(log.Arguments[4]);\r\n p.assign" +
+"edDataId(log.Arguments[5]);\r\n p.assignedData(log." +
+"Arguments[6]);\r\n p.detected(true);\r\n " +
+" if (!isLive) {\r\n p.updateT" +
+"humbnail();\r\n }\r\n }\r\n " +
+" session.messages.unshift(log);\r\n " +
+" break;\r\n case 115: // ImportPageUndetected\r\n " +
+" var p = session.sessionPagesIndex[log.Arguments[1]];\r\n " +
+" if (p) {\r\n p.undetected(t" +
+"rue);\r\n if (!isLive) {\r\n " +
+" p.updateThumbnail();\r\n }\r\n " +
+" }\r\n session.messages.unshift(log);\r\n " +
+" break;\r\n case 150: // Ignore: " +
+"ImportPageUndetectedStored\r\n break;\r\n " +
+" default:\r\n session.messages.unshift(log);\r\n " +
+" }\r\n }\r\n }\r\n }\r\n functi" +
+"on init() {\r\n // Create View Model\r\n vm = new pageViewMode" +
+"l();\r\n\r\n // Load Logs\r\n var d = new Date();\r\n v" +
+"ar loadData = {\r\n Format: \"json\",\r\n Start: d.getFu" +
+"llYear() + \'-\' + (d.getMonth() + 1) + \'-\' + d.getDate(),\r\n End: n" +
+"ull,\r\n ModuleId: 40,\r\n Take: 2000\r\n };\r" +
+"\n $.ajax({\r\n url: \'");
- #line 288 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
+ #line 286 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
Write(Url.Action(MVC.API.Logging.RetrieveEvents()));
@@ -454,29 +453,28 @@ WriteLiteral(@"',
ko.applyBindings(vm);
// Init Persistent Connection
- liveConnection = $.connection('");
+ logHub = $.connection.logNotifications;
+ logHub.client.receiveLog = parseLog
+
+ $.connection.hub.qs = { LogModules: '");
- #line 308 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
- Write(Url.Content("~/API/Logging/Notifications"));
+ #line 309 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
+ Write(Disco.BI.DocumentTemplateBI.Importer.DocumentImporterLog.Current.LiveLogGroupName);
#line default
#line hidden
-WriteLiteral("\', { addToGroups: \'");
+WriteLiteral(@"' };
+ $.connection.hub.error(function (error) {
+ alert('Live-Log Error: ' + error);
+ });
-
- #line 308 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
- Write(Disco.BI.DocumentTemplateBI.Importer.DocumentImporterLog.Current.LiveLogGroupName);
-
-
- #line default
- #line hidden
-WriteLiteral(@"' });
- liveConnection.received(parseLog);
- liveConnection.error(function (e) { if (e.status != 200) alert('Live-Log Error: ' + e.statusText + ': ' + e.responseText); });
- isLive = true;
- liveConnection.start();
+ $.connection.hub.start()
+ .done(function () { isLive = true; })
+ .fail(function (error) {
+ alert('Live-Log Connection Error: ' + error);
+ });
}
init();
});
diff --git a/Disco.Web/Areas/Config/Views/Enrolment/Status.cshtml b/Disco.Web/Areas/Config/Views/Enrolment/Status.cshtml
index fa5e0548..8c3dd8a3 100644
--- a/Disco.Web/Areas/Config/Views/Enrolment/Status.cshtml
+++ b/Disco.Web/Areas/Config/Views/Enrolment/Status.cshtml
@@ -136,7 +136,7 @@
var hostDialogSessions = $('#dialogSession');
//var hostDialogSessionsProgress = $('#dialogSession').find('.sessionProgress');
var deviceModels = {};
- var liveConnection;
+ var logHub;
var deviceBaseUrl = '@(Url.Action(MVC.Device.Show()))/'
var deviceModelImageUrl = '@(Url.Action(MVC.API.DeviceModel.Image()))/'
var iconWarningUrl = 'url(@(Links.ClientSource.Style.Images.Status.warning32_png))';
@@ -356,10 +356,19 @@
vm.isotopeInited = true;
// Init Persistent Connection
- liveConnection = $.connection('@(Url.Content("~/API/Logging/Notifications"))', { addToGroups: '@(Disco.BI.DeviceBI.EnrolmentLog.Current.LiveLogGroupName)' });
- liveConnection.received(parseLog);
- liveConnection.error(function (e) { if (e.status != 200) alert('Live-Log Error: ' + e.statusText + ': ' + e.responseText); });
- liveConnection.start();
+ logHub = $.connection.logNotifications;
+ logHub.client.receiveLog = parseLog
+
+ $.connection.hub.qs = { LogModules: '@(Disco.BI.DeviceBI.EnrolmentLog.Current.LiveLogGroupName)' };
+ $.connection.hub.error(function (error) {
+ alert('Live-Log Error: ' + error);
+ });
+
+ $.connection.hub.start()
+ .done(function () { isLive = true; })
+ .fail(function (error) {
+ alert('Live-Log Connection Error: ' + error);
+ });
}
init();
});
diff --git a/Disco.Web/Areas/Config/Views/Enrolment/Status.generated.cs b/Disco.Web/Areas/Config/Views/Enrolment/Status.generated.cs
index f9aa4c5c..df3ab6cf 100644
--- a/Disco.Web/Areas/Config/Views/Enrolment/Status.generated.cs
+++ b/Disco.Web/Areas/Config/Views/Enrolment/Status.generated.cs
@@ -319,7 +319,7 @@ WriteLiteral(@">
var hostDialogSessions = $('#dialogSession');
//var hostDialogSessionsProgress = $('#dialogSession').find('.sessionProgress');
var deviceModels = {};
- var liveConnection;
+ var logHub;
var deviceBaseUrl = '");
@@ -520,28 +520,28 @@ WriteLiteral(@"',
vm.isotopeInited = true;
// Init Persistent Connection
- liveConnection = $.connection('");
+ logHub = $.connection.logNotifications;
+ logHub.client.receiveLog = parseLog
+
+ $.connection.hub.qs = { LogModules: '");
- #line 359 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
- Write(Url.Content("~/API/Logging/Notifications"));
+ #line 362 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
+ Write(Disco.BI.DeviceBI.EnrolmentLog.Current.LiveLogGroupName);
#line default
#line hidden
-WriteLiteral("\', { addToGroups: \'");
+WriteLiteral(@"' };
+ $.connection.hub.error(function (error) {
+ alert('Live-Log Error: ' + error);
+ });
-
- #line 359 "..\..\Areas\Config\Views\Enrolment\Status.cshtml"
- Write(Disco.BI.DeviceBI.EnrolmentLog.Current.LiveLogGroupName);
-
-
- #line default
- #line hidden
-WriteLiteral(@"' });
- liveConnection.received(parseLog);
- liveConnection.error(function (e) { if (e.status != 200) alert('Live-Log Error: ' + e.statusText + ': ' + e.responseText); });
- liveConnection.start();
+ $.connection.hub.start()
+ .done(function () { isLive = true; })
+ .fail(function (error) {
+ alert('Live-Log Connection Error: ' + error);
+ });
}
init();
});
diff --git a/Disco.Web/Controllers/DeviceController.cs b/Disco.Web/Controllers/DeviceController.cs
index 76f80ff1..9ca8c3bb 100644
--- a/Disco.Web/Controllers/DeviceController.cs
+++ b/Disco.Web/Controllers/DeviceController.cs
@@ -202,7 +202,9 @@ namespace Disco.Web.Controllers
Database.Configuration.LazyLoadingEnabled = true;
m.Device = Database.Devices
- .Include("DeviceModel").Include("DeviceDetails").Include("DeviceUserAssignments.AssignedUser").Include("DeviceAttachments")
+ .Include("DeviceModel").Include("DeviceProfile").Include("DeviceBatch").Include("DeviceDetails")
+ .Include("DeviceUserAssignments.AssignedUser").Include("AssignedUser").Include("DeviceCertificates")
+ .Include("DeviceAttachments.TechUser").Include("DeviceAttachments.DocumentTemplate")
.FirstOrDefault(d => d.SerialNumber == id);
if (m.Device == null)
diff --git a/Disco.Web/Controllers/JobController.cs b/Disco.Web/Controllers/JobController.cs
index 8b46d20a..cd7fa20f 100644
--- a/Disco.Web/Controllers/JobController.cs
+++ b/Disco.Web/Controllers/JobController.cs
@@ -294,10 +294,11 @@ namespace Disco.Web.Controllers
var m = new Models.Job.ShowModel();
- m.Job = (from j in Database.Jobs.Include("Device.DeviceModel").Include("Device.DeviceBatch").Include("DeviceHeldTechUser").Include("DeviceReadyForReturnTechUser").Include("DeviceReturnedTechUser")
- .Include("OpenedTechUser").Include("ClosedTechUser").Include("JobType").Include("JobSubTypes").Include("User").Include("JobLogs.TechUser")
- where (j.Id == id.Value)
- select j).FirstOrDefault();
+ m.Job = Database.Jobs
+ .Include("Device.DeviceModel").Include("Device.DeviceBatch").Include("DeviceHeldTechUser").Include("DeviceReadyForReturnTechUser").Include("DeviceReturnedTechUser")
+ .Include("OpenedTechUser").Include("ClosedTechUser").Include("JobType").Include("JobSubTypes").Include("User").Include("JobLogs.TechUser")
+ .Include("JobAttachments.TechUser").Include("JobAttachments.DocumentTemplate")
+ .FirstOrDefault(j => j.Id == id.Value);
if (m.Job == null)
throw new ArgumentException(string.Format("Unknown Job: [{0}]", id), "id");
diff --git a/Disco.Web/Controllers/UserController.cs b/Disco.Web/Controllers/UserController.cs
index 28895afe..53f1e592 100644
--- a/Disco.Web/Controllers/UserController.cs
+++ b/Disco.Web/Controllers/UserController.cs
@@ -56,7 +56,11 @@ namespace Disco.Web.Controllers
}
m.User = Database.Users
- .Include("DeviceUserAssignments.Device.DeviceModel").Include("UserAttachments")
+ .Include("DeviceUserAssignments.Device.DeviceModel")
+ .Include("DeviceUserAssignments.Device.DeviceProfile")
+ .Include("DeviceUserAssignments.Device.DeviceBatch")
+ .Include("UserAttachments.TechUser")
+ .Include("UserAttachments.DocumentTemplate")
.FirstOrDefault(um => um.UserId == id);
if (m.User == null)
diff --git a/Disco.Web/Views/Device/DeviceParts/_Resources.cshtml b/Disco.Web/Views/Device/DeviceParts/_Resources.cshtml
index f9d5e946..4f22d8bf 100644
--- a/Disco.Web/Views/Device/DeviceParts/_Resources.cshtml
+++ b/Disco.Web/Views/Device/DeviceParts/_Resources.cshtml
@@ -52,6 +52,7 @@
$(function () {
var $Attachments = $('#Attachments');
var $attachmentOutput = $Attachments.find('.attachmentOutput');
+ var $attachmentDownloadHost;
var $dialogUpload = null;
var $dialogRemoveAttachment = null;
@@ -114,7 +115,7 @@
e.attr('data-attachmentid', a.Id).attr('data-mimetype', a.MimeType).attr('href', '@(Url.Action(MVC.API.Device.AttachmentDownload()))/' + a.Id);
e.find('.icon img').attr('src', '@(Url.Action(MVC.API.Device.AttachmentThumbnail()))/' + a.Id);
- e.find('.comments').text(a.Comments);
+ e.find('.comments').text(a.Description);
e.find('.author').text(a.Author);
e.find('.timestamp').text(a.TimestampFull).attr('title', a.TimestampFull).livestamp(a.TimestampUnixEpoc);
if (canRemove)
@@ -126,7 +127,9 @@
if (!quick)
e.show('slow');
if (a.MimeType.toLowerCase().indexOf('image/') == 0)
- e.shadowbox({ gallery: 'attachments', player: 'img', title: a.Comments });
+ e.shadowbox({ gallery: 'attachments', player: 'img', title: a.Description });
+ else
+ e.click(onDownload);
}
function onRemoveAttachment(id) {
@@ -142,6 +145,30 @@
});
}
+ function onDownload() {
+ var $this = $(this);
+ var url = $this.attr('href');
+
+ if ($.connection && $.connection.hub && $.connection.hub.transport &&
+ $.connection.hub.transport.name == 'foreverFrame') {
+ // SignalR active with foreverFrame transport - use popup window
+ window.open(url, '_blank', 'height=150,width=250,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no');
+ } else {
+ // use iFrame
+ if (!$attachmentDownloadHost) {
+ $attachmentDownloadHost = $('
\r\n \r\n Attachments [");
- #line 285 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
+ #line 314 "..\..\Views\Device\DeviceParts\_Resources.cshtml"
Write(Model.Device.DeviceAttachments == null ? 0 : Model.Device.DeviceAttachments.Count);
diff --git a/Disco.Web/Views/Device/_DeviceTable.cshtml b/Disco.Web/Views/Device/_DeviceTable.cshtml
index 43b1c896..ddc8c6bf 100644
--- a/Disco.Web/Views/Device/_DeviceTable.cshtml
+++ b/Disco.Web/Views/Device/_DeviceTable.cshtml
@@ -19,6 +19,8 @@
Profile
|
+ Batch
+ |
Assigned User
|
Jobs
@@ -64,6 +66,16 @@
|
@item.DeviceProfileDescription
|
+
+ @if (item.DeviceBatchName != null)
+ {
+ @item.DeviceBatchName
+ }
+ else
+ {
+ N/A
+ }
+ |
@if (string.IsNullOrEmpty(item.AssignedUserId))
{
diff --git a/Disco.Web/Views/Device/_DeviceTable.generated.cs b/Disco.Web/Views/Device/_DeviceTable.generated.cs
index 6fe1c892..dd67f9c3 100644
--- a/Disco.Web/Views/Device/_DeviceTable.generated.cs
+++ b/Disco.Web/Views/Device/_DeviceTable.generated.cs
@@ -90,6 +90,8 @@ WriteLiteral(@">
| Profile
|
+ Batch
+ |
Assigned User
|
Jobs
@@ -100,13 +102,13 @@ WriteLiteral(@">
");
- #line 29 "..\..\Views\Device\_DeviceTable.cshtml"
+ #line 31 "..\..\Views\Device\_DeviceTable.cshtml"
#line default
#line hidden
- #line 29 "..\..\Views\Device\_DeviceTable.cshtml"
+ #line 31 "..\..\Views\Device\_DeviceTable.cshtml"
foreach (var item in Model)
{
@@ -115,40 +117,40 @@ WriteLiteral(@">
#line hidden
WriteLiteral(" | (item.DecommissionedDate.HasValue ? "decommissioned" : string.Empty
+ #line 33 "..\..\Views\Device\_DeviceTable.cshtml"
+, Tuple.Create(Tuple.Create("", 1031), Tuple.Create(item.DecommissionedDate.HasValue ? "decommissioned" : string.Empty
#line default
#line hidden
-, 973), false)
+, 1031), false)
);
WriteLiteral(">\r\n | \r\n");
- #line 33 "..\..\Views\Device\_DeviceTable.cshtml"
+ #line 35 "..\..\Views\Device\_DeviceTable.cshtml"
#line default
#line hidden
- #line 33 "..\..\Views\Device\_DeviceTable.cshtml"
+ #line 35 "..\..\Views\Device\_DeviceTable.cshtml"
if (canShowDevices)
{
#line default
#line hidden
- #line 34 "..\..\Views\Device\_DeviceTable.cshtml"
+ #line 36 "..\..\Views\Device\_DeviceTable.cshtml"
Write(Html.ActionLink(item.Id, MVC.Device.Show(item.Id)));
#line default
#line hidden
- #line 34 "..\..\Views\Device\_DeviceTable.cshtml"
+ #line 36 "..\..\Views\Device\_DeviceTable.cshtml"
}
else
{
@@ -156,14 +158,14 @@ WriteLiteral(">\r\n | \r\n");
#line default
#line hidden
- #line 36 "..\..\Views\Device\_DeviceTable.cshtml"
+ #line 38 "..\..\Views\Device\_DeviceTable.cshtml"
Write(item.Id);
#line default
#line hidden
- #line 36 "..\..\Views\Device\_DeviceTable.cshtml"
+ #line 38 "..\..\Views\Device\_DeviceTable.cshtml"
}
@@ -174,7 +176,7 @@ WriteLiteral(" | \r\n \r\n"
WriteLiteral(" ");
- #line 39 "..\..\Views\Device\_DeviceTable.cshtml"
+ #line 41 "..\..\Views\Device\_DeviceTable.cshtml"
Write(item.AssetNumber);
@@ -183,13 +185,13 @@ WriteLiteral(" ");
WriteLiteral("\r\n");
- #line 40 "..\..\Views\Device\_DeviceTable.cshtml"
+ #line 42 "..\..\Views\Device\_DeviceTable.cshtml"
#line default
#line hidden
- #line 40 "..\..\Views\Device\_DeviceTable.cshtml"
+ #line 42 "..\..\Views\Device\_DeviceTable.cshtml"
if (item.DecommissionedDate.HasValue)
{
@@ -204,7 +206,7 @@ WriteLiteral(">(Decommissioned\r\n");
WriteLiteral(" ");
- #line 42 "..\..\Views\Device\_DeviceTable.cshtml"
+ #line 44 "..\..\Views\Device\_DeviceTable.cshtml"
Write(CommonHelpers.FriendlyDate(item.DecommissionedDate.Value));
@@ -213,7 +215,7 @@ WriteLiteral(" ");
WriteLiteral(") ");
- #line 42 "..\..\Views\Device\_DeviceTable.cshtml"
+ #line 44 "..\..\Views\Device\_DeviceTable.cshtml"
}
@@ -222,13 +224,13 @@ WriteLiteral(") ");
WriteLiteral(" | \r\n \r\n");
- #line 45 "..\..\Views\Device\_DeviceTable.cshtml"
+ #line 47 "..\..\Views\Device\_DeviceTable.cshtml"
#line default
#line hidden
- #line 45 "..\..\Views\Device\_DeviceTable.cshtml"
+ #line 47 "..\..\Views\Device\_DeviceTable.cshtml"
if (string.IsNullOrWhiteSpace(item.ComputerName))
{
@@ -242,7 +244,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">Unknown\r\n");
- #line 48 "..\..\Views\Device\_DeviceTable.cshtml"
+ #line 50 "..\..\Views\Device\_DeviceTable.cshtml"
}
else
{
@@ -251,14 +253,14 @@ WriteLiteral(">Unknown\r\n");
#line default
#line hidden
- #line 51 "..\..\Views\Device\_DeviceTable.cshtml"
+ #line 53 "..\..\Views\Device\_DeviceTable.cshtml"
Write(item.ComputerName);
#line default
#line hidden
- #line 51 "..\..\Views\Device\_DeviceTable.cshtml"
+ #line 53 "..\..\Views\Device\_DeviceTable.cshtml"
}
@@ -268,13 +270,13 @@ WriteLiteral(">Unknown\r\n");
WriteLiteral(" | \r\n \r\n");
- #line 55 "..\..\Views\Device\_DeviceTable.cshtml"
+ #line 57 "..\..\Views\Device\_DeviceTable.cshtml"
#line default
#line hidden
- #line 55 "..\..\Views\Device\_DeviceTable.cshtml"
+ #line 57 "..\..\Views\Device\_DeviceTable.cshtml"
if (item.DeviceModelDescription != null)
{
@@ -284,7 +286,7 @@ WriteLiteral(" | \r\n \r\n"
WriteLiteral(" ");
- #line 57 "..\..\Views\Device\_DeviceTable.cshtml"
+ #line 59 "..\..\Views\Device\_DeviceTable.cshtml"
Write(item.DeviceModelDescription);
@@ -293,7 +295,7 @@ WriteLiteral(" ");
WriteLiteral("\r\n");
- #line 58 "..\..\Views\Device\_DeviceTable.cshtml"
+ #line 60 "..\..\Views\Device\_DeviceTable.cshtml"
}
else
{
@@ -308,7 +310,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">Unknown \r\n");
- #line 62 "..\..\Views\Device\_DeviceTable.cshtml"
+ #line 64 "..\..\Views\Device\_DeviceTable.cshtml"
}
@@ -319,7 +321,7 @@ WriteLiteral(" | \r\n \r\n"
WriteLiteral(" ");
- #line 65 "..\..\Views\Device\_DeviceTable.cshtml"
+ #line 67 "..\..\Views\Device\_DeviceTable.cshtml"
Write(item.DeviceProfileDescription);
@@ -328,13 +330,62 @@ WriteLiteral(" ");
WriteLiteral("\r\n | \r\n \r\n");
- #line 68 "..\..\Views\Device\_DeviceTable.cshtml"
+ #line 70 "..\..\Views\Device\_DeviceTable.cshtml"
#line default
#line hidden
- #line 68 "..\..\Views\Device\_DeviceTable.cshtml"
+ #line 70 "..\..\Views\Device\_DeviceTable.cshtml"
+ if (item.DeviceBatchName != null)
+ {
+
+
+ #line default
+ #line hidden
+WriteLiteral(" ");
+
+
+ #line 72 "..\..\Views\Device\_DeviceTable.cshtml"
+ Write(item.DeviceBatchName);
+
+
+ #line default
+ #line hidden
+WriteLiteral("\r\n");
+
+
+ #line 73 "..\..\Views\Device\_DeviceTable.cshtml"
+ }
+ else
+ {
+
+
+ #line default
+ #line hidden
+WriteLiteral(" N/A \r\n");
+
+
+ #line 77 "..\..\Views\Device\_DeviceTable.cshtml"
+ }
+
+
+ #line default
+ #line hidden
+WriteLiteral(" | \r\n \r\n");
+
+
+ #line 80 "..\..\Views\Device\_DeviceTable.cshtml"
+
+
+ #line default
+ #line hidden
+
+ #line 80 "..\..\Views\Device\_DeviceTable.cshtml"
if (string.IsNullOrEmpty(item.AssignedUserId))
{
@@ -348,7 +399,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">N/A \r\n");
- #line 71 "..\..\Views\Device\_DeviceTable.cshtml"
+ #line 83 "..\..\Views\Device\_DeviceTable.cshtml"
}
else
{
@@ -359,7 +410,7 @@ WriteLiteral(">N/A \r\n");
WriteLiteral(" ");
- #line 74 "..\..\Views\Device\_DeviceTable.cshtml"
+ #line 86 "..\..\Views\Device\_DeviceTable.cshtml"
if (canShowUsers)
{
@@ -367,14 +418,14 @@ WriteLiteral(" ");
#line default
#line hidden
- #line 76 "..\..\Views\Device\_DeviceTable.cshtml"
+ #line 88 "..\..\Views\Device\_DeviceTable.cshtml"
Write(Html.ActionLink(item.AssignedUserDescription, MVC.User.Show(item.AssignedUserId)));
#line default
#line hidden
- #line 76 "..\..\Views\Device\_DeviceTable.cshtml"
+ #line 88 "..\..\Views\Device\_DeviceTable.cshtml"
}
else
@@ -384,14 +435,14 @@ WriteLiteral(" ");
#line default
#line hidden
- #line 80 "..\..\Views\Device\_DeviceTable.cshtml"
+ #line 92 "..\..\Views\Device\_DeviceTable.cshtml"
Write(item.AssignedUserDescription);
#line default
#line hidden
- #line 80 "..\..\Views\Device\_DeviceTable.cshtml"
+ #line 92 "..\..\Views\Device\_DeviceTable.cshtml"
}
@@ -401,7 +452,7 @@ WriteLiteral(" ");
WriteLiteral(" \r\n");
- #line 83 "..\..\Views\Device\_DeviceTable.cshtml"
+ #line 95 "..\..\Views\Device\_DeviceTable.cshtml"
}
@@ -412,7 +463,7 @@ WriteLiteral(" | \r\n \r\n"
WriteLiteral(" ");
- #line 86 "..\..\Views\Device\_DeviceTable.cshtml"
+ #line 98 "..\..\Views\Device\_DeviceTable.cshtml"
Write(item.JobCount);
@@ -421,7 +472,7 @@ WriteLiteral(" ");
WriteLiteral("\r\n | \r\n
\r\n");
- #line 89 "..\..\Views\Device\_DeviceTable.cshtml"
+ #line 101 "..\..\Views\Device\_DeviceTable.cshtml"
}
@@ -430,7 +481,7 @@ WriteLiteral("\r\n \r\n \r\n
WriteLiteral(" \r\n \r\n");
- #line 92 "..\..\Views\Device\_DeviceTable.cshtml"
+ #line 104 "..\..\Views\Device\_DeviceTable.cshtml"
}
else
{
@@ -445,7 +496,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">No Devices Found\r\n");
- #line 96 "..\..\Views\Device\_DeviceTable.cshtml"
+ #line 108 "..\..\Views\Device\_DeviceTable.cshtml"
}
diff --git a/Disco.Web/Views/Job/JobParts/Resources.cshtml b/Disco.Web/Views/Job/JobParts/Resources.cshtml
index fd8ed51c..3557e50a 100644
--- a/Disco.Web/Views/Job/JobParts/Resources.cshtml
+++ b/Disco.Web/Views/Job/JobParts/Resources.cshtml
@@ -398,12 +398,6 @@
success: function (d) {
if (d == 'OK') {
// Should be removed via Repository Notifications
- //$this.hide(300).delay(300).queue(function () {
- // var $this = $(this);
- // if ($this.attr('data-mimetype').toLowerCase().indexOf('image/') == 0)
- // Shadowbox.removeCache(this);
- // $this.remove();
- //});
} else {
alert('Unable to remove attachment: ' + d);
}
@@ -468,7 +462,7 @@
e.attr('data-attachmentid', a.Id).attr('data-mimetype', a.MimeType).attr('href', '@(Url.Action(MVC.API.Job.AttachmentDownload()))/' + a.Id);
e.find('.icon img').attr('src', '@(Url.Action(MVC.API.Job.AttachmentThumbnail()))/' + a.Id);
- e.find('.comments').text(a.Comments);
+ e.find('.comments').text(a.Description);
e.find('.author').text(a.Author);
e.find('.timestamp').text(a.TimestampFull).attr('title', a.TimestampFull).livestamp(a.TimestampUnixEpoc);
if (canRemove)
@@ -480,10 +474,36 @@
if (!quick)
e.show('slow');
if (a.MimeType.toLowerCase().indexOf('image/') == 0)
- e.shadowbox({ gallery: 'attachments', player: 'img', title: a.Comments });
+ e.shadowbox({ gallery: 'attachments', player: 'img', title: a.Description });
+ else
+ e.click(onDownload);
}
}
+ function onDownload() {
+ var $this = $(this);
+ var url = $this.attr('href');
+
+ if ($.connection && $.connection.hub && $.connection.hub.transport &&
+ $.connection.hub.transport.name == 'foreverFrame') {
+ // SignalR active with foreverFrame transport - use popup window
+ window.open(url, '_blank', 'height=150,width=250,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no');
+ } else {
+ // use iFrame
+ if (!$attachmentDownloadHost) {
+ $attachmentDownloadHost = $('