Unified SignalR disconnected/error dialogs
Dialogs (with a refresh option) appear whenever the SignalR client disconnects or encounters an error. Nonsensical error messages replaced. Page refresh technique changed to allow for urls containing fragment hashes.
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
<a target="_blank" href="#" data-bind="attr: { href: manuallyAssignUrl }, visible: $parent.sessionEnded">Manually Assign Page</a>
|
||||
</div>
|
||||
<div data-bind="visible: detected">
|
||||
Document: <a target="_blank" href="#" data-bind="text: documentTemplate, attr: { href: documentTemplateUrl }"></a>
|
||||
Document: <a target="_blank" href="#" data-bind="text: documentTemplate, attr: { href: documentTemplateUrl }"></a>
|
||||
<br />
|
||||
Target: <a target="_blank" href="#" data-bind="text: assignedData, attr: { href: assignedDataUrl }"></a>
|
||||
</div>
|
||||
@@ -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) {
|
||||
$('<div>')
|
||||
.addClass('dialog disconnected-dialog')
|
||||
.html('<h3><span class="fa-stack fa-lg"><i class="fa fa-wifi fa-stack-1x"></i><i class="fa fa-ban fa-stack-2x error"></i></span>Disconnected from the Disco ICT Server</h3><div>This page is not receiving live updates. Please ensure you are connected to the server, then refresh this page to enable features.</div>')
|
||||
.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();
|
||||
});
|
||||
|
||||
@@ -157,7 +157,7 @@ WriteLiteral(">\r\n Document: <a");
|
||||
|
||||
WriteLiteral(" target=\"_blank\"");
|
||||
|
||||
WriteLiteral(" href=\"#\"");
|
||||
WriteLiteral(" href=\"#\"");
|
||||
|
||||
WriteLiteral(" data-bind=\"text: documentTemplate, attr: { href: documentTemplateUrl }\"");
|
||||
|
||||
@@ -471,21 +471,26 @@ WriteLiteral(@"',
|
||||
|
||||
#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();
|
||||
});
|
||||
</script>
|
||||
");
|
||||
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 $(\'<div>\')\r\n .addClass(" +
|
||||
"\'dialog disconnected-dialog\')\r\n .html(\'<h3><span class=\"f" +
|
||||
"a-stack fa-lg\"><i class=\"fa fa-wifi fa-stack-1x\"></i><i class=\"fa fa-ban fa-stac" +
|
||||
"k-2x error\"></i></span>Disconnected from the Disco ICT Server</h3><div>This page" +
|
||||
" is not receiving live updates. Please ensure you are connected to the server, t" +
|
||||
"hen refresh this page to enable features.</div>\')\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</script>\r\n");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -286,7 +286,7 @@
|
||||
dialog.dialog("option", "buttons", null);
|
||||
|
||||
// Refresh Page
|
||||
window.location.href = window.location.href;
|
||||
window.location.reload(true);
|
||||
}
|
||||
|
||||
function saveChanges() {
|
||||
|
||||
@@ -1012,21 +1012,21 @@ WriteLiteral(" <script>\r\n
|
||||
"el() {\r\n dialog.dialog(\"disable\")" +
|
||||
";\r\n dialog.dialog(\"option\", \"butt" +
|
||||
"ons\", null);\r\n\r\n // Refresh Page\r" +
|
||||
"\n window.location.href = window.l" +
|
||||
"ocation.href;\r\n }\r\n\r\n " +
|
||||
" function saveChanges() {\r\n " +
|
||||
" var form = dialog.find(\'form\');\r\n\r\n " +
|
||||
" $(\'input.jobType:unchecked\').each(function () {\r\n " +
|
||||
" $(\'#SubTypes_\' + $(this).val()).fi" +
|
||||
"nd(\'input\').prop(\'checked\', false);\r\n " +
|
||||
" });\r\n\r\n form.submit();\r\n\r\n " +
|
||||
" dialog.dialog(\"disable\");\r\n " +
|
||||
" dialog.dialog(\"option\", \"buttons\", null" +
|
||||
");\r\n }\r\n\r\n " +
|
||||
" $(function () {\r\n " +
|
||||
" $(\'#Config_DocumentTemplates_JobSubTypes_Update\').click(showDialog);\r\n " +
|
||||
" });\r\n\r\n " +
|
||||
" })();\r\n </script>\r\n");
|
||||
"\n window.location.reload(true);\r\n" +
|
||||
" }\r\n\r\n " +
|
||||
" function saveChanges() {\r\n " +
|
||||
" var form = dialog.find(\'form\');\r\n\r\n " +
|
||||
" $(\'input.jobType:unchecked\').each(function () {\r\n " +
|
||||
" $(\'#SubTypes_\' + $(this).val()).find(\'input\').pro" +
|
||||
"p(\'checked\', false);\r\n });\r\n\r\n " +
|
||||
" form.submit();\r\n\r\n " +
|
||||
" dialog.dialog(\"disable\");\r\n " +
|
||||
" dialog.dialog(\"option\", \"buttons\", null);\r\n " +
|
||||
" }\r\n\r\n " +
|
||||
" $(function () {\r\n $(\'#Config_Do" +
|
||||
"cumentTemplates_JobSubTypes_Update\').click(showDialog);\r\n " +
|
||||
" });\r\n\r\n })();\r\n " +
|
||||
" </script>\r\n");
|
||||
|
||||
|
||||
#line 311 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
@@ -1959,16 +1959,16 @@ WriteLiteral(" id=\"dialogBulkGenerate\"");
|
||||
|
||||
WriteLiteral(" class=\"hiddenDialog\"");
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 38168), Tuple.Create("\"", 38219)
|
||||
, Tuple.Create(Tuple.Create("", 38176), Tuple.Create("Bulk", 38176), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 38180), Tuple.Create("Generate:", 38181), true)
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 38153), Tuple.Create("\"", 38204)
|
||||
, Tuple.Create(Tuple.Create("", 38161), Tuple.Create("Bulk", 38161), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 38165), Tuple.Create("Generate:", 38166), true)
|
||||
|
||||
#line 683 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
, Tuple.Create(Tuple.Create(" ", 38190), Tuple.Create<System.Object, System.Int32>(Model.DocumentTemplate.Id
|
||||
, Tuple.Create(Tuple.Create(" ", 38175), Tuple.Create<System.Object, System.Int32>(Model.DocumentTemplate.Id
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 38191), false)
|
||||
, 38176), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
Reference in New Issue
Block a user