diff --git a/Disco.Web/Areas/Config/Views/DocumentTemplate/ImportStatus.cshtml b/Disco.Web/Areas/Config/Views/DocumentTemplate/ImportStatus.cshtml index 7d774139..77630b67 100644 --- a/Disco.Web/Areas/Config/Views/DocumentTemplate/ImportStatus.cshtml +++ b/Disco.Web/Areas/Config/Views/DocumentTemplate/ImportStatus.cshtml @@ -38,7 +38,7 @@ Manually Assign Page
- Document: + Document:
Target:
@@ -307,15 +307,35 @@ logHub.client.receiveLog = parseLog $.connection.hub.qs = { LogModules: '@(Disco.BI.DocumentTemplateBI.DocumentsLog.Current.LiveLogGroupName)' }; - $.connection.hub.error(function (error) { - alert('Live-Log Error: ' + error); - }); + $.connection.hub.error(onHubFailed); $.connection.hub.start() .done(function () { isLive = true; }) - .fail(function (error) { - alert('Live-Log Connection Error: ' + error); - }); + .fail(onHubFailed); + + function onHubFailed(error) { + // Show Dialog Message + if ($('.disconnected-dialog').length == 0) { + $('
') + .addClass('dialog disconnected-dialog') + .html('

Disconnected from the Disco ICT Server

This page is not receiving live updates. Please ensure you are connected to the server, then refresh this page to enable features.
') + .dialog({ + resizable: false, + title: 'Disconnected', + width: 400, + modal: true, + buttons: { + 'Refresh Now': function () { + $(this).dialog('option', 'buttons', null); + window.location.reload(true); + }, + 'Close': function () { + $(this).dialog('destroy'); + } + } + }); + } + } } init(); }); diff --git a/Disco.Web/Areas/Config/Views/DocumentTemplate/ImportStatus.generated.cs b/Disco.Web/Areas/Config/Views/DocumentTemplate/ImportStatus.generated.cs index dee3d33a..532d95e7 100644 --- a/Disco.Web/Areas/Config/Views/DocumentTemplate/ImportStatus.generated.cs +++ b/Disco.Web/Areas/Config/Views/DocumentTemplate/ImportStatus.generated.cs @@ -157,7 +157,7 @@ WriteLiteral(">\r\n Document:
\r\n \r\n

\r\n

\r\n \r\n

\r\n

\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r WriteLiteral(" class=\"icon\""); -WriteLiteral(">\r\n  \r\n \r\n " + -"  \r\n \r\n Message\r\n \r\n " + -" \r\n \r\n \r\n Message\r\n \r\n \r\n " + +" \r\n \r\n No logs\r\n \r\n " + -" No logs\r\n \r\n \r\n \r\n \r\n " + " \r\n \r\n \r\n " + @@ -323,7 +310,7 @@ WriteLiteral(@"> var deviceBaseUrl = '"); - #line 140 "..\..\Areas\Config\Views\Enrolment\Status.cshtml" + #line 107 "..\..\Areas\Config\Views\Enrolment\Status.cshtml" Write(Url.Action(MVC.Device.Show())); @@ -332,7 +319,7 @@ WriteLiteral(@"> WriteLiteral("/\'\r\n var deviceModelImageUrl = \'"); - #line 141 "..\..\Areas\Config\Views\Enrolment\Status.cshtml" + #line 108 "..\..\Areas\Config\Views\Enrolment\Status.cshtml" Write(Url.Action(MVC.API.DeviceModel.Image())); @@ -341,7 +328,7 @@ WriteLiteral("/\'\r\n var deviceModelImageUrl = \'"); WriteLiteral("/\'\r\n var iconWarningUrl = \'url("); - #line 142 "..\..\Areas\Config\Views\Enrolment\Status.cshtml" + #line 109 "..\..\Areas\Config\Views\Enrolment\Status.cshtml" Write(Links.ClientSource.Style.Images.Status.warning32_png); @@ -350,7 +337,7 @@ WriteLiteral("/\'\r\n var iconWarningUrl = \'url("); WriteLiteral(")\';\r\n var iconErrorUrl = \'url("); - #line 143 "..\..\Areas\Config\Views\Enrolment\Status.cshtml" + #line 110 "..\..\Areas\Config\Views\Enrolment\Status.cshtml" Write(Links.ClientSource.Style.Images.Status.fail32_png); @@ -453,7 +440,7 @@ WriteLiteral(")\';\r\n\r\n function pageViewModel() {\r\n var " vm = new pageViewModel();\r\n $.ajax({\r\n url: \'"); - #line 307 "..\..\Areas\Config\Views\Enrolment\Status.cshtml" + #line 274 "..\..\Areas\Config\Views\Enrolment\Status.cshtml" Write(Url.Action(MVC.API.DeviceModel.Index())); @@ -487,7 +474,7 @@ WriteLiteral(@"', url: '"); - #line 332 "..\..\Areas\Config\Views\Enrolment\Status.cshtml" + #line 299 "..\..\Areas\Config\Views\Enrolment\Status.cshtml" Write(Url.Action(MVC.API.Logging.RetrieveEvents())); @@ -526,27 +513,32 @@ WriteLiteral(@"', $.connection.hub.qs = { LogModules: '"); - #line 362 "..\..\Areas\Config\Views\Enrolment\Status.cshtml" + #line 329 "..\..\Areas\Config\Views\Enrolment\Status.cshtml" Write(Disco.BI.DeviceBI.EnrolmentLog.Current.LiveLogGroupName); #line default #line hidden -WriteLiteral(@"' }; - $.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(); - }); - -"); +WriteLiteral("\' };\r\n $.connection.hub.error(onHubFailed);\r\n\r\n $.connectio" + +"n.hub.start()\r\n .done(function () { isLive = true; })\r\n " + +" .fail(onHubFailed);\r\n\r\n function onHubFailed(error) {\r\n " + +" // Show Dialog Message\r\n if ($(\'.disconnected-dialog\').le" + +"ngth == 0) {\r\n $(\'
\')\r\n .addClass(" + +"\'dialog disconnected-dialog\')\r\n .html(\'

Disconnected from the Disco ICT Server

This page" + +" is not receiving live updates. Please ensure you are connected to the server, t" + +"hen refresh this page to enable features.
\')\r\n .dial" + +"og({\r\n resizable: false,\r\n " + +" title: \'Disconnected\',\r\n width: 400,\r\n " + +" modal: true,\r\n buttons: {\r\n " + +" \'Refresh Now\': function () {\r\n " + +" $(this).dialog(\'option\', \'buttons\', null);\r\n " + +" window.location.reload(true);\r\n },\r\n " + +" \'Close\': function () {\r\n " + +" $(this).dialog(\'destroy\');\r\n }\r\n " + +" }\r\n });\r\n }\r\n }" + +"\r\n }\r\n init();\r\n });\r\n\r\n"); } } diff --git a/Disco.Web/Areas/Config/Views/Shared/LogEvents.cshtml b/Disco.Web/Areas/Config/Views/Shared/LogEvents.cshtml index 32bfce68..c40fd9be 100644 --- a/Disco.Web/Areas/Config/Views/Shared/LogEvents.cshtml +++ b/Disco.Web/Areas/Config/Views/Shared/LogEvents.cshtml @@ -120,13 +120,33 @@ }; $.connection.hub.qs = {LogModules: logModuleLiveGroupName}; - $.connection.hub.error(function(error){ - alert('Live-Log Error: '+error); - }); + $.connection.hub.error(onHubFailed); - $.connection.hub.start().fail(function(error){ - alert('Live-Log Connection Error: '+error); - }); + $.connection.hub.start().fail(onHubFailed); + + function onHubFailed(error) { + // Show Dialog Message + if ($('.disconnected-dialog').length == 0) { + $('
') + .addClass('dialog disconnected-dialog') + .html('

Disconnected from the Disco ICT Server

This page is not receiving live updates. Please ensure you are connected to the server, then refresh this page to enable features.
') + .dialog({ + resizable: false, + title: 'Disconnected', + width: 400, + modal: true, + buttons: { + 'Refresh Now': function () { + $(this).dialog('option', 'buttons', null); + window.location.reload(true); + }, + 'Close': function () { + $(this).dialog('destroy'); + } + } + }); + } + } } } diff --git a/Disco.Web/Areas/Config/Views/Shared/LogEvents.generated.cs b/Disco.Web/Areas/Config/Views/Shared/LogEvents.generated.cs index 35cfb980..ccede635 100644 --- a/Disco.Web/Areas/Config/Views/Shared/LogEvents.generated.cs +++ b/Disco.Web/Areas/Config/Views/Shared/LogEvents.generated.cs @@ -329,12 +329,29 @@ WriteLiteral("\',\r\n dataType: \'json\',\r\n "ge.UseDisplay) logsViewModel.EventLogs.unshift(message);\r\n " + " if (liveEventReceivedFunction) liveEventReceivedFunction(message);\r\n " + " };\r\n\r\n $.connection.hub.qs = {LogModules: logModule" + -"LiveGroupName};\r\n $.connection.hub.error(function(error){\r\n " + -" alert(\'Live-Log Error: \'+error);\r\n });\r" + -"\n\r\n $.connection.hub.start().fail(function(error){\r\n " + -" alert(\'Live-Log Connection Error: \'+error);\r\n " + -"});\r\n }\r\n }\r\n\r\n loadInitialData();\r\n " + -" });\r\n \r\n
\r\n"); +"LiveGroupName};\r\n $.connection.hub.error(onHubFailed);\r\n\r\n " + +" $.connection.hub.start().fail(onHubFailed);\r\n\r\n " + +" function onHubFailed(error) {\r\n // Show Dialog Messag" + +"e\r\n if ($(\'.disconnected-dialog\').length == 0) {\r\n " + +" $(\'
\')\r\n .addClass(\'dial" + +"og disconnected-dialog\')\r\n .html(\'

Disconnected from the Disco ICT Server

This p" + +"age is not receiving live updates. Please ensure you are connected to the server" + +", then refresh this page to enable features.
\')\r\n " + +" .dialog({\r\n resizable: false,\r\n " + +" title: \'Disconnected\',\r\n " + +" width: 400,\r\n modal: true,\r\n " + +" buttons: {\r\n \'" + +"Refresh Now\': function () {\r\n $(this)" + +".dialog(\'option\', \'buttons\', null);\r\n " + +" window.location.reload(true);\r\n },\r\n " + +" \'Close\': function () {\r\n " + +" $(this).dialog(\'destroy\');\r\n " + +" }\r\n }\r\n " + +" });\r\n }\r\n }\r\n }\r\n" + +" }\r\n\r\n loadInitialData();\r\n });\r\n \r\n\r\n"); } } diff --git a/Disco.Web/Areas/Config/Views/Shared/TaskStatus.cshtml b/Disco.Web/Areas/Config/Views/Shared/TaskStatus.cshtml index daddf94f..a8b72e13 100644 --- a/Disco.Web/Areas/Config/Views/Shared/TaskStatus.cshtml +++ b/Disco.Web/Areas/Config/Views/Shared/TaskStatus.cshtml @@ -247,14 +247,34 @@ notificationsHub.client.updateTaskStatus = vm.Update; $.connection.hub.qs = { TaskSessionId: sessionId }; - $.connection.hub.error(function (error) { - alert('Live-Status Error: ' + error); - }); + $.connection.hub.error(onHubFailed); $.connection.hub.start() - .fail(function (error) { - alert('Live-Status Connection Error: ' + error); - }); + .fail(onHubFailed); + } + + function onHubFailed(error) { + // Show Dialog Message + if ($('.disconnected-dialog').length == 0) { + $('
') + .addClass('dialog disconnected-dialog') + .html('

Disconnected from the Disco ICT Server

This page is not receiving live updates. Please ensure you are connected to the server, then refresh this page to enable features.
') + .dialog({ + resizable: false, + title: 'Disconnected', + width: 400, + modal: true, + buttons: { + 'Refresh Now': function () { + $(this).dialog('option', 'buttons', null); + window.location.reload(true); + }, + 'Close': function () { + $(this).dialog('destroy'); + } + } + }); + } } }); diff --git a/Disco.Web/Areas/Config/Views/Shared/TaskStatus.generated.cs b/Disco.Web/Areas/Config/Views/Shared/TaskStatus.generated.cs index 4a3bf44a..e2bead73 100644 --- a/Disco.Web/Areas/Config/Views/Shared/TaskStatus.generated.cs +++ b/Disco.Web/Areas/Config/Views/Shared/TaskStatus.generated.cs @@ -281,11 +281,24 @@ WriteLiteral("\';\r\n\r\n var view = $(\'#Logging_Task_Status\');\r\n "n.scheduledTaskNotifications;\r\n notificationsHub.client.initializeTas" + "kStatus = vm.Initialize;\r\n notificationsHub.client.updateTaskStatus =" + " vm.Update;\r\n\r\n $.connection.hub.qs = { TaskSessionId: sessionId };\r\n" + -" $.connection.hub.error(function (error) {\r\n alert(\'Li" + -"ve-Status Error: \' + error);\r\n });\r\n\r\n $.connection.hub.st" + -"art()\r\n .fail(function (error) {\r\n alert(\'Live" + -"-Status Connection Error: \' + error);\r\n });\r\n }\r\n\r\n });" + -"\r\n\r\n"); +" $.connection.hub.error(onHubFailed);\r\n\r\n $.connection.hub" + +".start()\r\n .fail(onHubFailed);\r\n }\r\n\r\n function onH" + +"ubFailed(error) {\r\n // Show Dialog Message\r\n if ($(\'.disco" + +"nnected-dialog\').length == 0) {\r\n $(\'
\')\r\n " + +" .addClass(\'dialog disconnected-dialog\')\r\n .html(\'

Disconnected from the Disco ICT Server

Th" + +"is page is not receiving live updates. Please ensure you are connected to the se" + +"rver, then refresh this page to enable features.
\')\r\n .d" + +"ialog({\r\n resizable: false,\r\n titl" + +"e: \'Disconnected\',\r\n width: 400,\r\n " + +" modal: true,\r\n buttons: {\r\n \'" + +"Refresh Now\': function () {\r\n $(this).dialog(\'opt" + +"ion\', \'buttons\', null);\r\n window.location.reload(" + +"true);\r\n },\r\n \'Close\': fun" + +"ction () {\r\n $(this).dialog(\'destroy\');\r\n " + +" }\r\n }\r\n });\r\n " + +" }\r\n }\r\n\r\n });\r\n\r\n"); } } diff --git a/Disco.Web/Areas/Public/Views/HeldDevices/Noticeboard.cshtml b/Disco.Web/Areas/Public/Views/HeldDevices/Noticeboard.cshtml index 006fcb11..f0cf13e4 100644 --- a/Disco.Web/Areas/Public/Views/HeldDevices/Noticeboard.cshtml +++ b/Disco.Web/Areas/Public/Views/HeldDevices/Noticeboard.cshtml @@ -351,7 +351,7 @@ } window.setTimeout(function () { - window.location.href = window.location.href; + window.location.reload(true); }, 10000); } diff --git a/Disco.Web/Areas/Public/Views/HeldDevices/Noticeboard.generated.cs b/Disco.Web/Areas/Public/Views/HeldDevices/Noticeboard.generated.cs index d924aab5..4dcdc5ed 100644 --- a/Disco.Web/Areas/Public/Views/HeldDevices/Noticeboard.generated.cs +++ b/Disco.Web/Areas/Public/Views/HeldDevices/Noticeboard.generated.cs @@ -394,52 +394,51 @@ WriteLiteral("\', null, function (data) {\r\n\r\n var inProce "\r\n $(\'body\').addClass(\'status-error\');\r\n $" + ".connection.hub.stop();\r\n } catch (e) {\r\n // I" + "gnore\r\n }\r\n\r\n window.setTimeout(function () {\r\n " + -" window.location.href = window.location.href;\r\n }" + -", 10000);\r\n }\r\n\r\n // Helpers\r\n function rotateA" + -"rray(koArray, element) {\r\n var items = koArray();\r\n\r\n " + -" if (items.length <= 1)\r\n return 0;\r\n\r\n if " + -"(element.height() < (element.parent().height() - 30)) {\r\n\r\n i" + -"f (findUnsortedArrayTopIndex(items) !== 0)\r\n koArray.sort" + -"(sortFunction);\r\n\r\n // Don\'t rotate if small & sorted correct" + -"ly\r\n return;\r\n }\r\n\r\n // Move La" + -"st Item to Top\r\n var item = koArray.pop();\r\n koArr" + -"ay.unshift(item);\r\n }\r\n function removeItemFromArray(koArr" + -"ay, deviceSerialNumber) {\r\n var items = koArray();\r\n " + -" for (var i = 0; i < items.length; i++) {\r\n if (items[i].De" + -"viceSerialNumber == deviceSerialNumber) {\r\n koArray.splic" + -"e(i, 1);\r\n items = koArray();\r\n i-" + -"-;\r\n }\r\n }\r\n }\r\n functio" + -"n findUnsortedArrayTopIndex(items) {\r\n // Only one Item\r\n " + -" if (items.length <= 1)\r\n return 0;\r\n\r\n " + -" for (var i = 1; i < items.length; i++) {\r\n var s = sortFunct" + -"ion(items[i - 1], items[i]);\r\n if (s > 0)\r\n " + -" return i;\r\n }\r\n\r\n return 0;\r\n }\r\n" + -" function findSortedInsertIndex(koArray, heldDeviceItem) {\r\n " + -" var items = koArray();\r\n var startIndex = findUnsortedArra" + -"yTopIndex(items);\r\n for (var i = startIndex; i < items.length; i+" + -"+) {\r\n var s = sortFunction(heldDeviceItem, items[i]);\r\n " + -" if (s <= 0)\r\n return i;\r\n }" + -"\r\n if (startIndex !== 0) {\r\n for (var i = 0; i" + -" < startIndex; i++) {\r\n var s = sortFunction(heldDeviceIt" + -"em, items[i]);\r\n if (s <= 0)\r\n " + -" return i;\r\n }\r\n return startIndex;\r\n " + -" } else {\r\n return -1;\r\n }\r\n " + -" }\r\n function sortFunction(l, r) {\r\n return l.Devic" + -"eDescription.toLowerCase() == r.DeviceDescription.toLowerCase() ? 0 : (l.DeviceD" + -"escription.toLowerCase() < r.DeviceDescription.toLowerCase() ? -1 : 1)\r\n " + -" }\r\n function isInProcess(i) {\r\n return !i.ReadyFor" + -"Return && !i.WaitingForUserAction;\r\n }\r\n function isReadyF" + -"orReturn(i) {\r\n return i.ReadyForReturn && !i.WaitingForUserActio" + -"n;\r\n }\r\n function isWaitingForUserAction(i) {\r\n " + -" return i.WaitingForUserAction;\r\n }\r\n function getQuer" + -"yStringParameters() {\r\n\r\n if (window.location.search.length === 0" + -")\r\n return null;\r\n\r\n var params = {};\r\n " + -" window.location.search.substr(1).split(\"&\").forEach(function (pair) {\r\n" + -" if (pair === \"\") return;\r\n var parts = pa" + -"ir.split(\"=\");\r\n params[parts[0]] = parts[1] && decodeURIComp" + -"onent(parts[1].replace(/\\+/g, \" \"));\r\n });\r\n retur" + -"n params;\r\n }\r\n\r\n init();\r\n });\r\n \r\n\r\n"); +" window.location.reload(true);\r\n }, 10000);\r\n " + +" }\r\n\r\n // Helpers\r\n function rotateArray(koArray, e" + +"lement) {\r\n var items = koArray();\r\n\r\n if (items.l" + +"ength <= 1)\r\n return 0;\r\n\r\n if (element.height" + +"() < (element.parent().height() - 30)) {\r\n\r\n if (findUnsorted" + +"ArrayTopIndex(items) !== 0)\r\n koArray.sort(sortFunction);" + +"\r\n\r\n // Don\'t rotate if small & sorted correctly\r\n " + +" return;\r\n }\r\n\r\n // Move Last Item to Top\r" + +"\n var item = koArray.pop();\r\n koArray.unshift(item" + +");\r\n }\r\n function removeItemFromArray(koArray, deviceSeria" + +"lNumber) {\r\n var items = koArray();\r\n for (var i =" + +" 0; i < items.length; i++) {\r\n if (items[i].DeviceSerialNumbe" + +"r == deviceSerialNumber) {\r\n koArray.splice(i, 1);\r\n " + +" items = koArray();\r\n i--;\r\n " + +" }\r\n }\r\n }\r\n function findUnsortedA" + +"rrayTopIndex(items) {\r\n // Only one Item\r\n if (ite" + +"ms.length <= 1)\r\n return 0;\r\n\r\n for (var i = 1" + +"; i < items.length; i++) {\r\n var s = sortFunction(items[i - 1" + +"], items[i]);\r\n if (s > 0)\r\n return i;" + +"\r\n }\r\n\r\n return 0;\r\n }\r\n fun" + +"ction findSortedInsertIndex(koArray, heldDeviceItem) {\r\n var item" + +"s = koArray();\r\n var startIndex = findUnsortedArrayTopIndex(items" + +");\r\n for (var i = startIndex; i < items.length; i++) {\r\n " + +" var s = sortFunction(heldDeviceItem, items[i]);\r\n " + +"if (s <= 0)\r\n return i;\r\n }\r\n " + +" if (startIndex !== 0) {\r\n for (var i = 0; i < startIndex; " + +"i++) {\r\n var s = sortFunction(heldDeviceItem, items[i]);\r" + +"\n if (s <= 0)\r\n return i;\r\n " + +" }\r\n return startIndex;\r\n } el" + +"se {\r\n return -1;\r\n }\r\n }\r\n " + +" function sortFunction(l, r) {\r\n return l.DeviceDescription.to" + +"LowerCase() == r.DeviceDescription.toLowerCase() ? 0 : (l.DeviceDescription.toLo" + +"werCase() < r.DeviceDescription.toLowerCase() ? -1 : 1)\r\n }\r\n " + +" function isInProcess(i) {\r\n return !i.ReadyForReturn && !i.Wa" + +"itingForUserAction;\r\n }\r\n function isReadyForReturn(i) {\r\n" + +" return i.ReadyForReturn && !i.WaitingForUserAction;\r\n " + +" }\r\n function isWaitingForUserAction(i) {\r\n return i.W" + +"aitingForUserAction;\r\n }\r\n function getQueryStringParamete" + +"rs() {\r\n\r\n if (window.location.search.length === 0)\r\n " + +" return null;\r\n\r\n var params = {};\r\n window" + +".location.search.substr(1).split(\"&\").forEach(function (pair) {\r\n " + +" if (pair === \"\") return;\r\n var parts = pair.split(\"=\");\r" + +"\n params[parts[0]] = parts[1] && decodeURIComponent(parts[1]." + +"replace(/\\+/g, \" \"));\r\n });\r\n return params;\r\n " + +" }\r\n\r\n init();\r\n });\r\n \r\n\r\n"); } } diff --git a/Disco.Web/Areas/Public/Views/UserHeldDevices/Noticeboard.cshtml b/Disco.Web/Areas/Public/Views/UserHeldDevices/Noticeboard.cshtml index 30c6e2ab..a168fe45 100644 --- a/Disco.Web/Areas/Public/Views/UserHeldDevices/Noticeboard.cshtml +++ b/Disco.Web/Areas/Public/Views/UserHeldDevices/Noticeboard.cshtml @@ -351,7 +351,7 @@ } window.setTimeout(function () { - window.location.href = window.location.href; + window.location.reload(true); }, 10000); } diff --git a/Disco.Web/Areas/Public/Views/UserHeldDevices/Noticeboard.generated.cs b/Disco.Web/Areas/Public/Views/UserHeldDevices/Noticeboard.generated.cs index 77b8e6b2..bbada500 100644 --- a/Disco.Web/Areas/Public/Views/UserHeldDevices/Noticeboard.generated.cs +++ b/Disco.Web/Areas/Public/Views/UserHeldDevices/Noticeboard.generated.cs @@ -394,51 +394,51 @@ WriteLiteral("\', null, function (data) {\r\n\r\n var inProce " try {\r\n $(\'body\').addClass(\'status-error\');\r\n " + " $.connection.hub.stop();\r\n } catch (e) {\r\n " + " // Ignore\r\n }\r\n\r\n window.setTimeout(function (" + -") {\r\n window.location.href = window.location.href;\r\n " + -" }, 10000);\r\n }\r\n\r\n // Helpers\r\n function" + -" rotateArray(koArray, element) {\r\n var items = koArray();\r\n\r\n " + -" if (items.length <= 1)\r\n return 0;\r\n\r\n " + -" if (element.height() < (element.parent().height() - 30)) {\r\n\r\n " + -" if (findUnsortedArrayTopIndex(items) !== 0)\r\n koAr" + -"ray.sort(sortFunction);\r\n\r\n // Don\'t rotate if small & sorted" + -" correctly\r\n return;\r\n }\r\n\r\n //" + -" Move Last Item to Top\r\n var item = koArray.pop();\r\n " + -" koArray.unshift(item);\r\n }\r\n function removeItemFromArr" + -"ay(koArray, UserId) {\r\n var items = koArray();\r\n f" + -"or (var i = 0; i < items.length; i++) {\r\n if (items[i].UserId" + -" == UserId) {\r\n koArray.splice(i, 1);\r\n " + -" items = koArray();\r\n i--;\r\n }\r\n " + -" }\r\n }\r\n function findUnsortedArrayTopIndex(" + -"items) {\r\n // Only one Item\r\n if (items.length <= " + -"1)\r\n return 0;\r\n\r\n for (var i = 1; i < items.l" + -"ength; i++) {\r\n var s = sortFunction(items[i - 1], items[i]);" + -"\r\n if (s > 0)\r\n return i;\r\n " + -" }\r\n\r\n return 0;\r\n }\r\n function findSor" + -"tedInsertIndex(koArray, heldDeviceItem) {\r\n var items = koArray()" + -";\r\n var startIndex = findUnsortedArrayTopIndex(items);\r\n " + -" for (var i = startIndex; i < items.length; i++) {\r\n va" + -"r s = sortFunction(heldDeviceItem, items[i]);\r\n if (s <= 0)\r\n" + -" return i;\r\n }\r\n if (startI" + -"ndex !== 0) {\r\n for (var i = 0; i < startIndex; i++) {\r\n " + -" var s = sortFunction(heldDeviceItem, items[i]);\r\n " + -" if (s <= 0)\r\n return i;\r\n " + -" }\r\n return startIndex;\r\n } else {\r\n " + -" return -1;\r\n }\r\n }\r\n function " + -"sortFunction(l, r) {\r\n return l.UserIdFriendly.toLowerCase() == r" + -".UserIdFriendly.toLowerCase() ? 0 : (l.UserIdFriendly.toLowerCase() < r.UserIdFr" + -"iendly.toLowerCase() ? -1 : 1)\r\n }\r\n function isInProcess(" + -"i) {\r\n return !i.ReadyForReturn && !i.WaitingForUserAction;\r\n " + -" }\r\n function isReadyForReturn(i) {\r\n return i." + -"ReadyForReturn && !i.WaitingForUserAction;\r\n }\r\n function " + -"isWaitingForUserAction(i) {\r\n return i.WaitingForUserAction;\r\n " + -" }\r\n function getQueryStringParameters() {\r\n\r\n " + -" if (window.location.search.length === 0)\r\n return null;\r\n\r\n " + -" var params = {};\r\n window.location.search.substr(1" + -").split(\"&\").forEach(function (pair) {\r\n if (pair === \"\") ret" + -"urn;\r\n var parts = pair.split(\"=\");\r\n para" + -"ms[parts[0]] = parts[1] && decodeURIComponent(parts[1].replace(/\\+/g, \" \"));\r\n " + -" });\r\n return params;\r\n }\r\n\r\n " + -"init();\r\n });\r\n \r\n\r\n\r\n"); +") {\r\n window.location.reload(true);\r\n }, 10000" + +");\r\n }\r\n\r\n // Helpers\r\n function rotateArray(ko" + +"Array, element) {\r\n var items = koArray();\r\n\r\n if " + +"(items.length <= 1)\r\n return 0;\r\n\r\n if (elemen" + +"t.height() < (element.parent().height() - 30)) {\r\n\r\n if (find" + +"UnsortedArrayTopIndex(items) !== 0)\r\n koArray.sort(sortFu" + +"nction);\r\n\r\n // Don\'t rotate if small & sorted correctly\r\n " + +" return;\r\n }\r\n\r\n // Move Last Item" + +" to Top\r\n var item = koArray.pop();\r\n koArray.unsh" + +"ift(item);\r\n }\r\n function removeItemFromArray(koArray, Use" + +"rId) {\r\n var items = koArray();\r\n for (var i = 0; " + +"i < items.length; i++) {\r\n if (items[i].UserId == UserId) {\r\n" + +" koArray.splice(i, 1);\r\n items = k" + +"oArray();\r\n i--;\r\n }\r\n " + +"}\r\n }\r\n function findUnsortedArrayTopIndex(items) {\r\n " + +" // Only one Item\r\n if (items.length <= 1)\r\n " + +" return 0;\r\n\r\n for (var i = 1; i < items.length; i++) {\r\n" + +" var s = sortFunction(items[i - 1], items[i]);\r\n " + +" if (s > 0)\r\n return i;\r\n }\r\n\r\n " + +" return 0;\r\n }\r\n function findSortedInsertIndex(" + +"koArray, heldDeviceItem) {\r\n var items = koArray();\r\n " + +" var startIndex = findUnsortedArrayTopIndex(items);\r\n for (var" + +" i = startIndex; i < items.length; i++) {\r\n var s = sortFunct" + +"ion(heldDeviceItem, items[i]);\r\n if (s <= 0)\r\n " + +" return i;\r\n }\r\n if (startIndex !== 0) {\r\n" + +" for (var i = 0; i < startIndex; i++) {\r\n " + +" var s = sortFunction(heldDeviceItem, items[i]);\r\n if " + +"(s <= 0)\r\n return i;\r\n }\r\n " + +" return startIndex;\r\n } else {\r\n re" + +"turn -1;\r\n }\r\n }\r\n function sortFunction(l," + +" r) {\r\n return l.UserIdFriendly.toLowerCase() == r.UserIdFriendly" + +".toLowerCase() ? 0 : (l.UserIdFriendly.toLowerCase() < r.UserIdFriendly.toLowerC" + +"ase() ? -1 : 1)\r\n }\r\n function isInProcess(i) {\r\n " + +" return !i.ReadyForReturn && !i.WaitingForUserAction;\r\n }\r\n " + +" function isReadyForReturn(i) {\r\n return i.ReadyForReturn " + +"&& !i.WaitingForUserAction;\r\n }\r\n function isWaitingForUse" + +"rAction(i) {\r\n return i.WaitingForUserAction;\r\n }\r\n " + +" function getQueryStringParameters() {\r\n\r\n if (window.loc" + +"ation.search.length === 0)\r\n return null;\r\n\r\n " + +"var params = {};\r\n window.location.search.substr(1).split(\"&\").fo" + +"rEach(function (pair) {\r\n if (pair === \"\") return;\r\n " + +" var parts = pair.split(\"=\");\r\n params[parts[0]] = " + +"parts[1] && decodeURIComponent(parts[1].replace(/\\+/g, \" \"));\r\n }" + +");\r\n return params;\r\n }\r\n\r\n init();\r\n " + +" });\r\n \r\n\r\n\r\n"); } } diff --git a/Disco.Web/Views/Device/DeviceParts/_Resources.cshtml b/Disco.Web/Views/Device/DeviceParts/_Resources.cshtml index 96271223..8110e644 100644 --- a/Disco.Web/Views/Device/DeviceParts/_Resources.cshtml +++ b/Disco.Web/Views/Device/DeviceParts/_Resources.cshtml @@ -92,7 +92,7 @@ if ($('.disconnected-dialog').length == 0) { $('
') .addClass('dialog disconnected-dialog') - .html('

Disconnected from the Disco ICT Server

Please ensure you are connected to the server, then refresh this page to enable features.
') + .html('

Disconnected from the Disco ICT Server

This page is not receiving live updates. Please ensure you are connected to the server, then refresh this page to enable features.
') .dialog({ resizable: false, title: 'Disconnected', @@ -101,7 +101,7 @@ buttons: { 'Refresh Now': function () { $(this).dialog('option', 'buttons', null); - window.location.href = window.location.href; + window.location.reload(true); }, 'Close': function () { $(this).dialog('destroy'); diff --git a/Disco.Web/Views/Device/DeviceParts/_Resources.generated.cs b/Disco.Web/Views/Device/DeviceParts/_Resources.generated.cs index e522aba4..7bff8e44 100644 --- a/Disco.Web/Views/Device/DeviceParts/_Resources.generated.cs +++ b/Disco.Web/Views/Device/DeviceParts/_Resources.generated.cs @@ -415,23 +415,24 @@ WriteLiteral("\' };\r\n $.connection.hub.error(onHubF "(\'dialog disconnected-dialog\')\r\n .html(\'<" + "h3>Disconnected from the Disco ICT Server
Please ensure you are connected to the server, then refresh this page to" + -" enable features.
\')\r\n .dialog({\r\n " + -" resizable: false,\r\n " + -" title: \'Disconnected\',\r\n " + -" width: 400,\r\n modal: tru" + -"e,\r\n buttons: {\r\n " + -" \'Refresh Now\': function () {\r\n " + -" $(this).dialog(\'option\', \'buttons\', null);\r\n " + -" window.location.href = window.loca" + -"tion.href;\r\n },\r\n " + -" \'Close\': function () {\r\n " + -" $(this).dialog(\'destroy\');\r\n " + -" }\r\n }\r\n " + -" });\r\n }\r\n " + -" }\r\n\r\n function onAddAttachment(" + -"id, quick) {\r\n var data = { id: id };\r\n " + -" $.ajax({\r\n url: \'"); +"h3>
This page is not receiving live updates. Please ensure you are connected" + +" to the server, then refresh this page to enable features.
\')\r\n " + +" .dialog({\r\n " + +" resizable: false,\r\n title: \'Discon" + +"nected\',\r\n width: 400,\r\n " + +" modal: true,\r\n " + +" buttons: {\r\n \'Refresh No" + +"w\': function () {\r\n $(this).d" + +"ialog(\'option\', \'buttons\', null);\r\n " + +" window.location.reload(true);\r\n " + +" },\r\n \'Close\': function () {" + +"\r\n $(this).dialog(\'destroy\');" + +"\r\n }\r\n " + +" }\r\n });\r\n " + +" }\r\n }\r\n\r\n " + +" function onAddAttachment(id, quick) {\r\n var data" + +" = { id: id };\r\n $.ajax({\r\n " + +" url: \'"); #line 117 "..\..\Views\Device\DeviceParts\_Resources.cshtml" diff --git a/Disco.Web/Views/Job/JobParts/Resources.cshtml b/Disco.Web/Views/Job/JobParts/Resources.cshtml index d390d793..511eb717 100644 --- a/Disco.Web/Views/Job/JobParts/Resources.cshtml +++ b/Disco.Web/Views/Job/JobParts/Resources.cshtml @@ -600,7 +600,7 @@ if ($('.disconnected-dialog').length == 0) { $('
') .addClass('dialog disconnected-dialog') - .html('

Disconnected from the Disco ICT Server

Please ensure you are connected to the server, then refresh this page to enable features.
') + .html('

Disconnected from the Disco ICT Server

This page is not receiving live updates. Please ensure you are connected to the server, then refresh this page to enable features.
') .dialog({ resizable: false, title: 'Disconnected', @@ -609,7 +609,7 @@ buttons: { 'Refresh Now': function () { $(this).dialog('option', 'buttons', null); - window.location.href = window.location.href; + window.location.reload(true); }, 'Close': function () { $(this).dialog('destroy'); diff --git a/Disco.Web/Views/Job/JobParts/Resources.generated.cs b/Disco.Web/Views/Job/JobParts/Resources.generated.cs index 2c2d760e..c403847f 100644 --- a/Disco.Web/Views/Job/JobParts/Resources.generated.cs +++ b/Disco.Web/Views/Job/JobParts/Resources.generated.cs @@ -1412,18 +1412,19 @@ WriteLiteral("\r\n $.connection.hub.qs = { JobId: jobId };\r\n " .addClass(\'dialog disconnected-dialog\')\r\n " + ".html(\'

Disconnected from the Disco ICT " + -"Server

Please ensure you are connected to the server, then refresh this" + -" page to enable features.
\')\r\n .dialog({\r\n " + -" resizable: false,\r\n title: \'Disconn" + -"ected\',\r\n width: 400,\r\n mo" + -"dal: true,\r\n buttons: {\r\n " + -" \'Refresh Now\': function () {\r\n $(this).di" + -"alog(\'option\', \'buttons\', null);\r\n window.loc" + -"ation.href = window.location.href;\r\n },\r\n " + -" \'Close\': function () {\r\n " + -" $(this).dialog(\'destroy\');\r\n }\r\n " + -" }\r\n });\r\n }\r\n }\r" + -"\n\r\n //#endregion\r\n });\r\n \r\n"); +"Server
This page is not receiving live updates. Please ensure you are c" + +"onnected to the server, then refresh this page to enable features.
\')\r\n " + +" .dialog({\r\n resizable: false,\r\n " + +" title: \'Disconnected\',\r\n wi" + +"dth: 400,\r\n modal: true,\r\n " + +" buttons: {\r\n \'Refresh Now\': function () {\r\n " + +" $(this).dialog(\'option\', \'buttons\', null);\r\n " + +" window.location.reload(true);\r\n " + +" },\r\n \'Close\': function () {\r\n " + +" $(this).dialog(\'destroy\');\r\n " + +" }\r\n }\r\n });\r\n " + +" }\r\n }\r\n\r\n //#endregion\r\n });\r\n \r\n"); #line 625 "..\..\Views\Job\JobParts\Resources.cshtml" diff --git a/Disco.Web/Views/User/UserParts/_Resources.cshtml b/Disco.Web/Views/User/UserParts/_Resources.cshtml index 94cbb7ff..e7a76540 100644 --- a/Disco.Web/Views/User/UserParts/_Resources.cshtml +++ b/Disco.Web/Views/User/UserParts/_Resources.cshtml @@ -90,7 +90,7 @@ if ($('.disconnected-dialog').length == 0) { $('
') .addClass('dialog disconnected-dialog') - .html('

Disconnected from the Disco ICT Server

Please ensure you are connected to the server, then refresh this page to enable features.
') + .html('

Disconnected from the Disco ICT Server

This page is not receiving live updates. Please ensure you are connected to the server, then refresh this page to enable features.
') .dialog({ resizable: false, title: 'Disconnected', @@ -99,7 +99,7 @@ buttons: { 'Refresh Now': function () { $(this).dialog('option', 'buttons', null); - window.location.href = window.location.href; + window.location.reload(true); }, 'Close': function () { $(this).dialog('destroy'); diff --git a/Disco.Web/Views/User/UserParts/_Resources.generated.cs b/Disco.Web/Views/User/UserParts/_Resources.generated.cs index 99b70940..ada03750 100644 --- a/Disco.Web/Views/User/UserParts/_Resources.generated.cs +++ b/Disco.Web/Views/User/UserParts/_Resources.generated.cs @@ -413,23 +413,24 @@ WriteLiteral("\' };\r\n $.connection.hub.error(onHubF "(\'dialog disconnected-dialog\')\r\n .html(\'<" + "h3>Disconnected from the Disco ICT Server
Please ensure you are connected to the server, then refresh this page to" + -" enable features.
\')\r\n .dialog({\r\n " + -" resizable: false,\r\n " + -" title: \'Disconnected\',\r\n " + -" width: 400,\r\n modal: tru" + -"e,\r\n buttons: {\r\n " + -" \'Refresh Now\': function () {\r\n " + -" $(this).dialog(\'option\', \'buttons\', null);\r\n " + -" window.location.href = window.loca" + -"tion.href;\r\n },\r\n " + -" \'Close\': function () {\r\n " + -" $(this).dialog(\'destroy\');\r\n " + -" }\r\n }\r\n " + -" });\r\n }\r\n " + -" }\r\n\r\n function onAddAttachment(" + -"id, quick) {\r\n var data = { id: id };\r\n " + -" $.ajax({\r\n url: \'"); +"h3>
This page is not receiving live updates. Please ensure you are connected" + +" to the server, then refresh this page to enable features.
\')\r\n " + +" .dialog({\r\n " + +" resizable: false,\r\n title: \'Discon" + +"nected\',\r\n width: 400,\r\n " + +" modal: true,\r\n " + +" buttons: {\r\n \'Refresh No" + +"w\': function () {\r\n $(this).d" + +"ialog(\'option\', \'buttons\', null);\r\n " + +" window.location.reload(true);\r\n " + +" },\r\n \'Close\': function () {" + +"\r\n $(this).dialog(\'destroy\');" + +"\r\n }\r\n " + +" }\r\n });\r\n " + +" }\r\n }\r\n\r\n " + +" function onAddAttachment(id, quick) {\r\n var data" + +" = { id: id };\r\n $.ajax({\r\n " + +" url: \'"); #line 115 "..\..\Views\User\UserParts\_Resources.cshtml"