Fix: Javascript Bugs

jQuery v1.9 migrations; Isotope Update
This commit is contained in:
Gary Sharp
2013-02-19 19:17:06 +11:00
parent a76cd8c829
commit 20a12c1c99
60 changed files with 15323 additions and 15642 deletions
+2 -2
View File
@@ -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.0219.1605")]
[assembly: AssemblyFileVersion("1.2.0219.1605")]
[assembly: AssemblyVersion("1.2.0219.1854")]
[assembly: AssemblyFileVersion("1.2.0219.1854")]
Binary file not shown.
+2 -2
View File
@@ -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.0219.1551")]
[assembly: AssemblyFileVersion("1.2.0219.1551")]
[assembly: AssemblyVersion("1.2.0219.1813")]
[assembly: AssemblyFileVersion("1.2.0219.1813")]
@@ -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.0219.1551")]
[assembly: AssemblyFileVersion("1.2.0219.1551")]
[assembly: AssemblyVersion("1.2.0219.1813")]
[assembly: AssemblyFileVersion("1.2.0219.1813")]
+2 -2
View File
@@ -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.0219.1605")]
[assembly: AssemblyFileVersion("1.2.0219.1605")]
[assembly: AssemblyVersion("1.2.0219.1854")]
[assembly: AssemblyFileVersion("1.2.0219.1854")]
+2 -2
View File
@@ -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.0219.1605")]
[assembly: AssemblyFileVersion("1.2.0219.1605")]
[assembly: AssemblyVersion("1.2.0219.1854")]
[assembly: AssemblyFileVersion("1.2.0219.1854")]
+2 -2
View File
@@ -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.0219.1605")]
[assembly: AssemblyFileVersion("1.2.0219.1605")]
[assembly: AssemblyVersion("1.2.0219.1854")]
[assembly: AssemblyFileVersion("1.2.0219.1854")]
@@ -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.0219.1605")]
[assembly: AssemblyFileVersion("1.2.0219.1605")]
[assembly: AssemblyVersion("1.2.0219.1854")]
[assembly: AssemblyFileVersion("1.2.0219.1854")]
@@ -1,270 +1,271 @@
@model Disco.Web.Areas.Config.Models.DeviceModel.DeviceComponentsModel
@{
Html.BundleDeferred("~/ClientScripts/Modules/Disco-jQueryExtensions");
}
<table id="deviceComponents" data-devicemodelid="@(Model.DeviceModelId.HasValue ? Model.DeviceModelId.Value.ToString() : string.Empty)">
<tr>
<th>
Description
</th>
<th>
Cost
</th>
<th>
Job Types
</th>
<th class="actions">
&nbsp;
</th>
</tr>
@foreach (var item in Model.DeviceComponents)
{
<tr data-devicecomponentid="@item.Id">
<td>
<input type="text" class="description" value="@item.Description" />
</td>
<td>
<input type="text" class="cost" value="@item.Cost.ToString("C")" />
</td>
<td>
<span class="edit@(item.JobSubTypes.Count > 0 ? " editAlert" : string.Empty)"></span>
</td>
<td>
<span class="remove"></span>
</td>
</tr>
}
<tr>
<td colspan="4">
<a href="#" id="addDeviceComponent">Add Component</a>
</td>
</tr>
</table>
<script type="text/javascript">
$(function () {
var $deviceComponents = $('#deviceComponents');
$('#addDeviceComponent').click(function () {
var dc = $('<tr><td><input type="text" class="description" /></td><td><input type="text" class="cost" /></td><td><span class="edit"></span></td><td><span class="remove"></span></td></tr>');
dc.find('input').focus(function () { $(this).select() })
dc.insertBefore($deviceComponents.find('tr').last());
dc.find('input.description').focus();
return false;
});
var removeComponentConfirmed = function (id, row) {
var data = { id: id };
$.ajax({
url: '@Url.Action(MVC.API.DeviceModel.ComponentRemove())',
dataType: 'json',
data: data,
success: function (d) {
if (d == 'OK') {
row.remove();
} else {
alert('Unable to remove component: ' + d);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to remove component: ' + textStatus);
}
});
}
var removeComponent = function () {
var componentRow = $(this).closest('tr');
var id = componentRow.attr('data-devicecomponentid');
if (id) {
var dialog = $("#dialogConfirmRemove");
var buttons = dialog.dialog("option", "buttons");
buttons['Remove'] = function () { removeComponentConfirmed(id, componentRow); $(this).dialog("close"); };
var buttons = dialog.dialog("option", "buttons", buttons);
dialog.dialog('open');
} else {
// New - Remove
componentRow.remove();
}
}
var updateComponent = function () {
var componentRow = $(this).closest('tr');
componentRow.find('input').attr('disabled', true).addClass('updating');
var id = componentRow.attr('data-devicecomponentid');
if (id) {
// Update
var data = {
id: id,
Description: componentRow.find('input.description').val(),
Cost: componentRow.find('input.cost').val()
};
$.ajax({
url: '@Url.Action(MVC.API.DeviceModel.ComponentUpdate())',
dataType: 'json',
type: 'POST',
data: data,
success: function (d) {
componentRow.find('input').attr('disabled', false).removeClass('updating');
if (d.Result == 'OK') {
componentRow.find('input.description').val(d.Component.Description);
componentRow.find('input.cost').val(d.Component.Cost);
} else {
alert('Unable to update component: ' + d.Result);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update component: ' + textStatus);
}
});
} else {
// Add
id = componentRow.closest('table').attr('data-devicemodelid');
var data = {
id: id,
Description: componentRow.find('input.description').val(),
Cost: componentRow.find('input.cost').val()
};
$.ajax({
url: '@Url.Action(MVC.API.DeviceModel.ComponentAdd(null, null, null))',
dataType: 'json',
type: 'POST',
data: data,
success: function (d) {
componentRow.find('input').attr('disabled', false).removeClass('updating');
if (d.Result == 'OK') {
componentRow.attr('data-devicecomponentid', d.Component.Id);
componentRow.find('input.description').val(d.Component.Description);
componentRow.find('input.cost').val(d.Component.Cost);
} else {
alert('Unable to add component: ' + d.Result);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to add component: ' + textStatus);
}
});
}
}
var editComponentJobTypes = function () {
var edit$this = $(this);
var componentRow = edit$this.closest('tr');
var id = componentRow.attr('data-devicecomponentid');
if (id) {
var data = {
id: id
};
$.ajax({
url: '@Url.Action(MVC.API.DeviceModel.Component())',
dataType: 'json',
data: data,
success: function (d) {
componentRow.find('input').attr('disabled', false).removeClass('updating');
if (d.Result == 'OK') {
$dialogUpdateJobTypes = $('#dialogUpdateJobTypes');
$dialogUpdateJobTypes.find('input:checked').each(function () { $(this).attr('checked', false) });
for (var i = 0; i < d.Component.JobSubTypes.length; i++) {
var sjt = d.Component.JobSubTypes[i];
$dialogUpdateJobTypes.find('#SubTypes_' + sjt).attr('checked', true);
}
$('#CheckboxBulkSelect_dialogUpdateJobTypes').checkboxBulkSelect('update');
var buttons = $dialogUpdateJobTypes.dialog("option", "buttons");
buttons['Save'] = function () {
$dialogUpdateJobTypes.dialog("disable");
var selectedSJTs = [];
$dialogUpdateJobTypes.find('input:checked').each(function () { selectedSJTs.push($(this).val()) });
var data = {
id: id,
JobSubTypes: selectedSJTs
};
$.ajax({
url: '@Url.Action(MVC.API.DeviceModel.ComponentUpdateJobSubTypes())',
dataType: 'json',
type: 'POST',
traditional: true,
data: data,
success: function (d) {
if (d.Result == 'OK') {
if (d.Component.JobSubTypes.length > 0) {
edit$this.addClass('editAlert');
} else {
edit$this.removeClass('editAlert');
}
$dialogUpdateJobTypes.dialog("enable");
$dialogUpdateJobTypes.dialog("close");
} else {
alert('Unable to update component sub types: ' + d.Result);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update component sub types: ' + textStatus);
}
});
};
var buttons = $dialogUpdateJobTypes.dialog("option", "buttons", buttons);
$dialogUpdateJobTypes.dialog('open');
} else {
alert('Unable to load component: ' + d.Result);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to load component: ' + textStatus);
}
});
}
}
$("#dialogConfirmRemove").dialog({
resizable: false,
height: 140,
modal: true,
autoOpen: false,
buttons: {
"Remove": function () {
$(this).dialog("close");
},
Cancel: function () {
$(this).dialog("close");
}
}
});
$('#dialogUpdateJobTypes').dialog({
resizable: false,
modal: true,
autoOpen: false,
width: 550,
buttons: {
"Save": function () {
$(this).dialog("close");
},
Cancel: function () {
$(this).dialog("close");
}
}
});
$('#CheckboxBulkSelect_dialogUpdateJobTypes').checkboxBulkSelect({ parentSelector: 'div' });
$deviceComponents.find('input').live('change', updateComponent).focus(function () { $(this).select() });
$deviceComponents.find('span.remove').live('click', removeComponent);
$deviceComponents.find('span.edit').live('click', editComponentJobTypes);
});
</script>
<div id="dialogUpdateJobTypes" title="Update Job Types">
<div>
<h2>
Hardware Non-Warranty Job Types</h2>
@CommonHelpers.CheckBoxList("SubTypes", Model.JobSubTypes.ToSelectListItems(), 2)
<br />
<span id="CheckboxBulkSelect_dialogUpdateJobTypes" class="checkboxBulkSelectContainer">
</span>
</div>
</div>
<div id="dialogConfirmRemove" title="Delete this Component?">
<p>
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
This item will be permanently deleted and cannot be recovered. Are you sure?</p>
</div>
@model Disco.Web.Areas.Config.Models.DeviceModel.DeviceComponentsModel
@{
Html.BundleDeferred("~/ClientScripts/Modules/Disco-jQueryExtensions");
}
<table id="deviceComponents" data-devicemodelid="@(Model.DeviceModelId.HasValue ? Model.DeviceModelId.Value.ToString() : string.Empty)">
<tr>
<th>
Description
</th>
<th>
Cost
</th>
<th>
Job Types
</th>
<th class="actions">
&nbsp;
</th>
</tr>
@foreach (var item in Model.DeviceComponents)
{
<tr data-devicecomponentid="@item.Id">
<td>
<input type="text" class="description" value="@item.Description" />
</td>
<td>
<input type="text" class="cost" value="@item.Cost.ToString("C")" />
</td>
<td>
<span class="edit@(item.JobSubTypes.Count > 0 ? " editAlert" : string.Empty)"></span>
</td>
<td>
<span class="remove"></span>
</td>
</tr>
}
<tr>
<td colspan="4">
<a href="#" id="addDeviceComponent">Add Component</a>
</td>
</tr>
</table>
<script type="text/javascript">
$(function () {
var $deviceComponents = $('#deviceComponents');
$('#addDeviceComponent').click(function () {
var dc = $('<tr><td><input type="text" class="description" /></td><td><input type="text" class="cost" /></td><td><span class="edit"></span></td><td><span class="remove"></span></td></tr>');
dc.find('input').focus(function () { $(this).select() })
dc.insertBefore($deviceComponents.find('tr').last());
dc.find('input.description').focus();
return false;
});
var removeComponentConfirmed = function (id, row) {
var data = { id: id };
$.ajax({
url: '@Url.Action(MVC.API.DeviceModel.ComponentRemove())',
dataType: 'json',
data: data,
success: function (d) {
if (d == 'OK') {
row.remove();
} else {
alert('Unable to remove component: ' + d);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to remove component: ' + textStatus);
}
});
}
var removeComponent = function () {
var componentRow = $(this).closest('tr');
var id = componentRow.attr('data-devicecomponentid');
if (id) {
var dialog = $("#dialogConfirmRemove");
var buttons = dialog.dialog("option", "buttons");
buttons['Remove'] = function () { removeComponentConfirmed(id, componentRow); $(this).dialog("close"); };
var buttons = dialog.dialog("option", "buttons", buttons);
dialog.dialog('open');
} else {
// New - Remove
componentRow.remove();
}
}
var updateComponent = function () {
var componentRow = $(this).closest('tr');
componentRow.find('input').attr('disabled', true).addClass('updating');
var id = componentRow.attr('data-devicecomponentid');
if (id) {
// Update
var data = {
id: id,
Description: componentRow.find('input.description').val(),
Cost: componentRow.find('input.cost').val()
};
$.ajax({
url: '@Url.Action(MVC.API.DeviceModel.ComponentUpdate())',
dataType: 'json',
type: 'POST',
data: data,
success: function (d) {
componentRow.find('input').attr('disabled', false).removeClass('updating');
if (d.Result == 'OK') {
componentRow.find('input.description').val(d.Component.Description);
componentRow.find('input.cost').val(d.Component.Cost);
} else {
alert('Unable to update component: ' + d.Result);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update component: ' + textStatus);
}
});
} else {
// Add
id = componentRow.closest('table').attr('data-devicemodelid');
var data = {
id: id,
Description: componentRow.find('input.description').val(),
Cost: componentRow.find('input.cost').val()
};
$.ajax({
url: '@Url.Action(MVC.API.DeviceModel.ComponentAdd(null, null, null))',
dataType: 'json',
type: 'POST',
data: data,
success: function (d) {
componentRow.find('input').attr('disabled', false).removeClass('updating');
if (d.Result == 'OK') {
componentRow.attr('data-devicecomponentid', d.Component.Id);
componentRow.find('input.description').val(d.Component.Description);
componentRow.find('input.cost').val(d.Component.Cost);
} else {
alert('Unable to add component: ' + d.Result);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to add component: ' + textStatus);
}
});
}
}
var editComponentJobTypes = function () {
var edit$this = $(this);
var componentRow = edit$this.closest('tr');
var id = componentRow.attr('data-devicecomponentid');
if (id) {
var data = {
id: id
};
$.ajax({
url: '@Url.Action(MVC.API.DeviceModel.Component())',
dataType: 'json',
data: data,
success: function (d) {
componentRow.find('input').attr('disabled', false).removeClass('updating');
if (d.Result == 'OK') {
$dialogUpdateJobTypes = $('#dialogUpdateJobTypes');
$dialogUpdateJobTypes.find('input:checked').each(function () { $(this).prop('checked', false) });
for (var i = 0; i < d.Component.JobSubTypes.length; i++) {
var sjt = d.Component.JobSubTypes[i];
$dialogUpdateJobTypes.find('#SubTypes_' + sjt).prop('checked', true);
}
$('#CheckboxBulkSelect_dialogUpdateJobTypes').checkboxBulkSelect('update');
var buttons = $dialogUpdateJobTypes.dialog("option", "buttons");
buttons['Save'] = function () {
$dialogUpdateJobTypes.dialog("disable");
var selectedSJTs = [];
$dialogUpdateJobTypes.find('input:checked').each(function () { selectedSJTs.push($(this).val()) });
var data = {
id: id,
JobSubTypes: selectedSJTs
};
$.ajax({
url: '@Url.Action(MVC.API.DeviceModel.ComponentUpdateJobSubTypes())',
dataType: 'json',
type: 'POST',
traditional: true,
data: data,
success: function (d) {
if (d.Result == 'OK') {
if (d.Component.JobSubTypes.length > 0) {
edit$this.addClass('editAlert');
} else {
edit$this.removeClass('editAlert');
}
$dialogUpdateJobTypes.dialog("enable");
$dialogUpdateJobTypes.dialog("close");
} else {
alert('Unable to update component sub types: ' + d.Result);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update component sub types: ' + textStatus);
}
});
};
var buttons = $dialogUpdateJobTypes.dialog("option", "buttons", buttons);
$dialogUpdateJobTypes.dialog('open');
} else {
alert('Unable to load component: ' + d.Result);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to load component: ' + textStatus);
}
});
}
}
$("#dialogConfirmRemove").dialog({
resizable: false,
height: 140,
modal: true,
autoOpen: false,
buttons: {
"Remove": function () {
$(this).dialog("close");
},
Cancel: function () {
$(this).dialog("close");
}
}
});
$('#dialogUpdateJobTypes').dialog({
resizable: false,
modal: true,
autoOpen: false,
width: 550,
buttons: {
"Save": function () {
$(this).dialog("close");
},
Cancel: function () {
$(this).dialog("close");
}
}
});
$('#CheckboxBulkSelect_dialogUpdateJobTypes').checkboxBulkSelect({ parentSelector: 'div' });
$deviceComponents.on('change', 'input', updateComponent);
$deviceComponents.on('focus', 'input', function () { $(this).select(); });
$deviceComponents.on('click', 'span.remove', removeComponent);
$deviceComponents.on('click', 'span.edit', editComponentJobTypes);
});
</script>
<div id="dialogUpdateJobTypes" title="Update Job Types">
<div>
<h2>
Hardware Non-Warranty Job Types</h2>
@CommonHelpers.CheckBoxList("SubTypes", Model.JobSubTypes.ToSelectListItems(), 2)
<br />
<span id="CheckboxBulkSelect_dialogUpdateJobTypes" class="checkboxBulkSelectContainer">
</span>
</div>
</div>
<div id="dialogConfirmRemove" title="Delete this Component?">
<p>
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
This item will be permanently deleted and cannot be recovered. Are you sure?</p>
</div>
@@ -1,412 +1,412 @@
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17929
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Disco.Web.Areas.Config.Views.DeviceModel
{
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", "1.5.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DeviceModel/_DeviceComponentsTable.cshtml")]
public class DeviceComponentsTable : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.DeviceModel.DeviceComponentsModel>
{
public DeviceComponentsTable()
{
}
public override void Execute()
{
#line 2 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
Html.BundleDeferred("~/ClientScripts/Modules/Disco-jQueryExtensions");
#line default
#line hidden
WriteLiteral("\r\n<table");
WriteLiteral(" id=\"deviceComponents\"");
WriteLiteral(" data-devicemodelid=\"");
#line 5 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
Write(Model.DeviceModelId.HasValue ? Model.DeviceModelId.Value.ToString() : string.Empty);
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(">\r\n <tr>\r\n <th>\r\n Description\r\n </th>\r\n <th>\r\n" +
" Cost\r\n </th>\r\n <th>\r\n Job Types\r\n </" +
"th>\r\n <th");
WriteLiteral(" class=\"actions\"");
WriteLiteral(">\r\n &nbsp;\r\n </th>\r\n </tr>\r\n");
#line 20 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
#line default
#line hidden
#line 20 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
foreach (var item in Model.DeviceComponents)
{
#line default
#line hidden
WriteLiteral(" <tr");
WriteLiteral(" data-devicecomponentid=\"");
#line 22 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
Write(item.Id);
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(">\r\n <td>\r\n <input");
WriteLiteral(" type=\"text\"");
WriteLiteral(" class=\"description\"");
WriteAttribute("value", Tuple.Create(" value=\"", 710), Tuple.Create("\"", 735)
#line 24 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
, Tuple.Create(Tuple.Create("", 718), Tuple.Create<System.Object, System.Int32>(item.Description
#line default
#line hidden
, 718), false)
);
WriteLiteral(" />\r\n </td>\r\n <td>\r\n <input");
WriteLiteral(" type=\"text\"");
WriteLiteral(" class=\"cost\"");
WriteAttribute("value", Tuple.Create(" value=\"", 825), Tuple.Create("\"", 857)
#line 27 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
, Tuple.Create(Tuple.Create("", 833), Tuple.Create<System.Object, System.Int32>(item.Cost.ToString("C")
#line default
#line hidden
, 833), false)
);
WriteLiteral(" />\r\n </td>\r\n <td>\r\n <span");
WriteAttribute("class", Tuple.Create(" class=\"", 921), Tuple.Create("\"", 992)
, Tuple.Create(Tuple.Create("", 929), Tuple.Create("edit", 929), true)
#line 30 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
, Tuple.Create(Tuple.Create("", 933), Tuple.Create<System.Object, System.Int32>(item.JobSubTypes.Count > 0 ? " editAlert" : string.Empty
#line default
#line hidden
, 933), false)
);
WriteLiteral("></span>\r\n </td>\r\n <td>\r\n <span");
WriteLiteral(" class=\"remove\"");
WriteLiteral("></span>\r\n </td>\r\n </tr>\r\n");
#line 36 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
}
#line default
#line hidden
WriteLiteral(" <tr>\r\n <td");
WriteLiteral(" colspan=\"4\"");
WriteLiteral(">\r\n <a");
WriteLiteral(" href=\"#\"");
WriteLiteral(" id=\"addDeviceComponent\"");
WriteLiteral(">Add Component</a>\r\n </td>\r\n </tr>\r\n</table>\r\n<script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
var $deviceComponents = $('#deviceComponents');
$('#addDeviceComponent').click(function () {
var dc = $('<tr><td><input type=""text"" class=""description"" /></td><td><input type=""text"" class=""cost"" /></td><td><span class=""edit""></span></td><td><span class=""remove""></span></td></tr>');
dc.find('input').focus(function () { $(this).select() })
dc.insertBefore($deviceComponents.find('tr').last());
dc.find('input.description').focus();
return false;
});
var removeComponentConfirmed = function (id, row) {
var data = { id: id };
$.ajax({
url: '");
#line 58 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
Write(Url.Action(MVC.API.DeviceModel.ComponentRemove()));
#line default
#line hidden
WriteLiteral("\',\r\n dataType: \'json\',\r\n data: data,\r\n " +
" success: function (d) {\r\n if (d == \'OK\') {\r\n " +
" row.remove();\r\n } else {\r\n a" +
"lert(\'Unable to remove component: \' + d);\r\n }\r\n " +
" },\r\n error: function (jqXHR, textStatus, errorThrown) {\r\n " +
" alert(\'Unable to remove component: \' + textStatus);\r\n " +
" }\r\n });\r\n }\r\n var removeComponent = function () {\r\n " +
" var componentRow = $(this).closest(\'tr\');\r\n var id = compo" +
"nentRow.attr(\'data-devicecomponentid\');\r\n if (id) {\r\n " +
"var dialog = $(\"#dialogConfirmRemove\");\r\n var buttons = dialog.di" +
"alog(\"option\", \"buttons\");\r\n buttons[\'Remove\'] = function () { re" +
"moveComponentConfirmed(id, componentRow); $(this).dialog(\"close\"); };\r\n " +
" var buttons = dialog.dialog(\"option\", \"buttons\", buttons);\r\n " +
" dialog.dialog(\'open\');\r\n } else {\r\n // New - Remove" +
"\r\n componentRow.remove();\r\n }\r\n }\r\n var " +
"updateComponent = function () {\r\n var componentRow = $(this).closest(" +
"\'tr\');\r\n componentRow.find(\'input\').attr(\'disabled\', true).addClass(\'" +
"updating\');\r\n\r\n var id = componentRow.attr(\'data-devicecomponentid\');" +
"\r\n if (id) {\r\n // Update\r\n var data = {" +
"\r\n id: id,\r\n Description: componentRow.fin" +
"d(\'input.description\').val(),\r\n Cost: componentRow.find(\'inpu" +
"t.cost\').val()\r\n };\r\n $.ajax({\r\n " +
" url: \'");
#line 100 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
Write(Url.Action(MVC.API.DeviceModel.ComponentUpdate()));
#line default
#line hidden
WriteLiteral(@"',
dataType: 'json',
type: 'POST',
data: data,
success: function (d) {
componentRow.find('input').attr('disabled', false).removeClass('updating');
if (d.Result == 'OK') {
componentRow.find('input.description').val(d.Component.Description);
componentRow.find('input.cost').val(d.Component.Cost);
} else {
alert('Unable to update component: ' + d.Result);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update component: ' + textStatus);
}
});
} else {
// Add
id = componentRow.closest('table').attr('data-devicemodelid');
var data = {
id: id,
Description: componentRow.find('input.description').val(),
Cost: componentRow.find('input.cost').val()
};
$.ajax({
url: '");
#line 126 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
Write(Url.Action(MVC.API.DeviceModel.ComponentAdd(null, null, null)));
#line default
#line hidden
WriteLiteral(@"',
dataType: 'json',
type: 'POST',
data: data,
success: function (d) {
componentRow.find('input').attr('disabled', false).removeClass('updating');
if (d.Result == 'OK') {
componentRow.attr('data-devicecomponentid', d.Component.Id);
componentRow.find('input.description').val(d.Component.Description);
componentRow.find('input.cost').val(d.Component.Cost);
} else {
alert('Unable to add component: ' + d.Result);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to add component: ' + textStatus);
}
});
}
}
var editComponentJobTypes = function () {
var edit$this = $(this);
var componentRow = edit$this.closest('tr');
var id = componentRow.attr('data-devicecomponentid');
if (id) {
var data = {
id: id
};
$.ajax({
url: '");
#line 157 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
Write(Url.Action(MVC.API.DeviceModel.Component()));
#line default
#line hidden
WriteLiteral("\',\r\n dataType: \'json\',\r\n data: data,\r\n " +
" success: function (d) {\r\n componentRow.fin" +
"d(\'input\').attr(\'disabled\', false).removeClass(\'updating\');\r\n " +
" if (d.Result == \'OK\') {\r\n $dialogUpdateJobTypes " +
"= $(\'#dialogUpdateJobTypes\');\r\n $dialogUpdateJobTypes" +
".find(\'input:checked\').each(function () { $(this).attr(\'checked\', false) });\r\n " +
" for (var i = 0; i < d.Component.JobSubTypes.length; i+" +
"+) {\r\n var sjt = d.Component.JobSubTypes[i];\r\n " +
" $dialogUpdateJobTypes.find(\'#SubTypes_\' + sjt).attr" +
"(\'checked\', true);\r\n }\r\n $" +
"(\'#CheckboxBulkSelect_dialogUpdateJobTypes\').checkboxBulkSelect(\'update\');\r\n " +
" var buttons = $dialogUpdateJobTypes.dialog(\"option\", \"bu" +
"ttons\");\r\n buttons[\'Save\'] = function () {\r\n " +
" $dialogUpdateJobTypes.dialog(\"disable\");\r\n " +
" var selectedSJTs = [];\r\n $dialog" +
"UpdateJobTypes.find(\'input:checked\').each(function () { selectedSJTs.push($(this" +
").val()) });\r\n\r\n var data = {\r\n " +
" id: id,\r\n JobSubTypes: sele" +
"ctedSJTs\r\n };\r\n $." +
"ajax({\r\n url: \'");
#line 181 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
Write(Url.Action(MVC.API.DeviceModel.ComponentUpdateJobSubTypes()));
#line default
#line hidden
WriteLiteral("\',\r\n dataType: \'json\',\r\n " +
" type: \'POST\',\r\n traditional: tr" +
"ue,\r\n data: data,\r\n " +
" success: function (d) {\r\n if (d" +
".Result == \'OK\') {\r\n if (d.Component." +
"JobSubTypes.length > 0) {\r\n edit$" +
"this.addClass(\'editAlert\');\r\n } else " +
"{\r\n edit$this.removeClass(\'editAl" +
"ert\');\r\n }\r\n " +
" $dialogUpdateJobTypes.dialog(\"enable\");\r\n " +
" $dialogUpdateJobTypes.dialog(\"close\");\r\n " +
" } else {\r\n al" +
"ert(\'Unable to update component sub types: \' + d.Result);\r\n " +
" }\r\n },\r\n " +
" error: function (jqXHR, textStatus, errorThrown) {\r\n " +
" alert(\'Unable to update component sub types: \' + t" +
"extStatus);\r\n }\r\n " +
" });\r\n };\r\n var buttons" +
" = $dialogUpdateJobTypes.dialog(\"option\", \"buttons\", buttons);\r\n " +
" $dialogUpdateJobTypes.dialog(\'open\');\r\n } els" +
"e {\r\n alert(\'Unable to load component: \' + d.Result);" +
"\r\n }\r\n },\r\n error: " +
"function (jqXHR, textStatus, errorThrown) {\r\n alert(\'Unab" +
"le to load component: \' + textStatus);\r\n }\r\n }" +
");\r\n }\r\n\r\n }\r\n\r\n $(\"#dialogConfirmRemove\").dialog({\r\n " +
" resizable: false,\r\n height: 140,\r\n modal: true,\r" +
"\n autoOpen: false,\r\n buttons: {\r\n \"Remove\":" +
" function () {\r\n $(this).dialog(\"close\");\r\n }," +
"\r\n Cancel: function () {\r\n $(this).dialog(\"clo" +
"se\");\r\n }\r\n }\r\n });\r\n\r\n $(\'#dialogUpdate" +
"JobTypes\').dialog({\r\n resizable: false,\r\n modal: true,\r\n " +
" autoOpen: false,\r\n width: 550,\r\n buttons: {\r\n " +
" \"Save\": function () {\r\n $(this).dialog(\"close\");" +
"\r\n },\r\n Cancel: function () {\r\n " +
" $(this).dialog(\"close\");\r\n }\r\n }\r\n });\r\n\r\n " +
" $(\'#CheckboxBulkSelect_dialogUpdateJobTypes\').checkboxBulkSelect({ parentSel" +
"ector: \'div\' });\r\n\r\n $deviceComponents.find(\'input\').live(\'change\', updat" +
"eComponent).focus(function () { $(this).select() });\r\n $deviceComponents." +
"find(\'span.remove\').live(\'click\', removeComponent);\r\n $deviceComponents.f" +
"ind(\'span.edit\').live(\'click\', editComponentJobTypes);\r\n\r\n });\r\n</script>\r\n<d" +
"iv");
WriteLiteral(" id=\"dialogUpdateJobTypes\"");
WriteLiteral(" title=\"Update Job Types\"");
WriteLiteral(">\r\n <div>\r\n <h2>\r\n Hardware Non-Warranty Job Types</h2>\r\n");
WriteLiteral(" ");
#line 260 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
Write(CommonHelpers.CheckBoxList("SubTypes", Model.JobSubTypes.ToSelectListItems(), 2));
#line default
#line hidden
WriteLiteral("\r\n <br />\r\n <span");
WriteLiteral(" id=\"CheckboxBulkSelect_dialogUpdateJobTypes\"");
WriteLiteral(" class=\"checkboxBulkSelectContainer\"");
WriteLiteral(">\r\n </span>\r\n </div>\r\n</div>\r\n<div");
WriteLiteral(" id=\"dialogConfirmRemove\"");
WriteLiteral(" title=\"Delete this Component?\"");
WriteLiteral(">\r\n <p>\r\n <span");
WriteLiteral(" class=\"ui-icon ui-icon-alert\"");
WriteLiteral(" style=\"float: left; margin: 0 7px 20px 0;\"");
WriteLiteral("></span>\r\n This item will be permanently deleted and cannot be recovered. " +
"Are you sure?</p>\r\n</div>\r\n");
}
}
}
#pragma warning restore 1591
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17929
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Disco.Web.Areas.Config.Views.DeviceModel
{
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", "1.5.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DeviceModel/_DeviceComponentsTable.cshtml")]
public class DeviceComponentsTable : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.DeviceModel.DeviceComponentsModel>
{
public DeviceComponentsTable()
{
}
public override void Execute()
{
#line 2 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
Html.BundleDeferred("~/ClientScripts/Modules/Disco-jQueryExtensions");
#line default
#line hidden
WriteLiteral("\r\n<table");
WriteLiteral(" id=\"deviceComponents\"");
WriteLiteral(" data-devicemodelid=\"");
#line 5 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
Write(Model.DeviceModelId.HasValue ? Model.DeviceModelId.Value.ToString() : string.Empty);
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(">\r\n <tr>\r\n <th>\r\n Description\r\n </th>\r\n <th>\r\n" +
" Cost\r\n </th>\r\n <th>\r\n Job Types\r\n </" +
"th>\r\n <th");
WriteLiteral(" class=\"actions\"");
WriteLiteral(">\r\n &nbsp;\r\n </th>\r\n </tr>\r\n");
#line 20 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
#line default
#line hidden
#line 20 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
foreach (var item in Model.DeviceComponents)
{
#line default
#line hidden
WriteLiteral(" <tr");
WriteLiteral(" data-devicecomponentid=\"");
#line 22 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
Write(item.Id);
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(">\r\n <td>\r\n <input");
WriteLiteral(" type=\"text\"");
WriteLiteral(" class=\"description\"");
WriteAttribute("value", Tuple.Create(" value=\"", 710), Tuple.Create("\"", 735)
#line 24 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
, Tuple.Create(Tuple.Create("", 718), Tuple.Create<System.Object, System.Int32>(item.Description
#line default
#line hidden
, 718), false)
);
WriteLiteral(" />\r\n </td>\r\n <td>\r\n <input");
WriteLiteral(" type=\"text\"");
WriteLiteral(" class=\"cost\"");
WriteAttribute("value", Tuple.Create(" value=\"", 825), Tuple.Create("\"", 857)
#line 27 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
, Tuple.Create(Tuple.Create("", 833), Tuple.Create<System.Object, System.Int32>(item.Cost.ToString("C")
#line default
#line hidden
, 833), false)
);
WriteLiteral(" />\r\n </td>\r\n <td>\r\n <span");
WriteAttribute("class", Tuple.Create(" class=\"", 921), Tuple.Create("\"", 992)
, Tuple.Create(Tuple.Create("", 929), Tuple.Create("edit", 929), true)
#line 30 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
, Tuple.Create(Tuple.Create("", 933), Tuple.Create<System.Object, System.Int32>(item.JobSubTypes.Count > 0 ? " editAlert" : string.Empty
#line default
#line hidden
, 933), false)
);
WriteLiteral("></span>\r\n </td>\r\n <td>\r\n <span");
WriteLiteral(" class=\"remove\"");
WriteLiteral("></span>\r\n </td>\r\n </tr>\r\n");
#line 36 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
}
#line default
#line hidden
WriteLiteral(" <tr>\r\n <td");
WriteLiteral(" colspan=\"4\"");
WriteLiteral(">\r\n <a");
WriteLiteral(" href=\"#\"");
WriteLiteral(" id=\"addDeviceComponent\"");
WriteLiteral(">Add Component</a>\r\n </td>\r\n </tr>\r\n</table>\r\n<script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
var $deviceComponents = $('#deviceComponents');
$('#addDeviceComponent').click(function () {
var dc = $('<tr><td><input type=""text"" class=""description"" /></td><td><input type=""text"" class=""cost"" /></td><td><span class=""edit""></span></td><td><span class=""remove""></span></td></tr>');
dc.find('input').focus(function () { $(this).select() })
dc.insertBefore($deviceComponents.find('tr').last());
dc.find('input.description').focus();
return false;
});
var removeComponentConfirmed = function (id, row) {
var data = { id: id };
$.ajax({
url: '");
#line 58 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
Write(Url.Action(MVC.API.DeviceModel.ComponentRemove()));
#line default
#line hidden
WriteLiteral("\',\r\n dataType: \'json\',\r\n data: data,\r\n " +
" success: function (d) {\r\n if (d == \'OK\') {\r\n " +
" row.remove();\r\n } else {\r\n a" +
"lert(\'Unable to remove component: \' + d);\r\n }\r\n " +
" },\r\n error: function (jqXHR, textStatus, errorThrown) {\r\n " +
" alert(\'Unable to remove component: \' + textStatus);\r\n " +
" }\r\n });\r\n }\r\n var removeComponent = function () {\r\n " +
" var componentRow = $(this).closest(\'tr\');\r\n var id = compo" +
"nentRow.attr(\'data-devicecomponentid\');\r\n if (id) {\r\n " +
"var dialog = $(\"#dialogConfirmRemove\");\r\n var buttons = dialog.di" +
"alog(\"option\", \"buttons\");\r\n buttons[\'Remove\'] = function () { re" +
"moveComponentConfirmed(id, componentRow); $(this).dialog(\"close\"); };\r\n " +
" var buttons = dialog.dialog(\"option\", \"buttons\", buttons);\r\n " +
" dialog.dialog(\'open\');\r\n } else {\r\n // New - Remove" +
"\r\n componentRow.remove();\r\n }\r\n }\r\n var " +
"updateComponent = function () {\r\n var componentRow = $(this).closest(" +
"\'tr\');\r\n componentRow.find(\'input\').attr(\'disabled\', true).addClass(\'" +
"updating\');\r\n\r\n var id = componentRow.attr(\'data-devicecomponentid\');" +
"\r\n if (id) {\r\n // Update\r\n var data = {" +
"\r\n id: id,\r\n Description: componentRow.fin" +
"d(\'input.description\').val(),\r\n Cost: componentRow.find(\'inpu" +
"t.cost\').val()\r\n };\r\n $.ajax({\r\n " +
" url: \'");
#line 100 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
Write(Url.Action(MVC.API.DeviceModel.ComponentUpdate()));
#line default
#line hidden
WriteLiteral(@"',
dataType: 'json',
type: 'POST',
data: data,
success: function (d) {
componentRow.find('input').attr('disabled', false).removeClass('updating');
if (d.Result == 'OK') {
componentRow.find('input.description').val(d.Component.Description);
componentRow.find('input.cost').val(d.Component.Cost);
} else {
alert('Unable to update component: ' + d.Result);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update component: ' + textStatus);
}
});
} else {
// Add
id = componentRow.closest('table').attr('data-devicemodelid');
var data = {
id: id,
Description: componentRow.find('input.description').val(),
Cost: componentRow.find('input.cost').val()
};
$.ajax({
url: '");
#line 126 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
Write(Url.Action(MVC.API.DeviceModel.ComponentAdd(null, null, null)));
#line default
#line hidden
WriteLiteral(@"',
dataType: 'json',
type: 'POST',
data: data,
success: function (d) {
componentRow.find('input').attr('disabled', false).removeClass('updating');
if (d.Result == 'OK') {
componentRow.attr('data-devicecomponentid', d.Component.Id);
componentRow.find('input.description').val(d.Component.Description);
componentRow.find('input.cost').val(d.Component.Cost);
} else {
alert('Unable to add component: ' + d.Result);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to add component: ' + textStatus);
}
});
}
}
var editComponentJobTypes = function () {
var edit$this = $(this);
var componentRow = edit$this.closest('tr');
var id = componentRow.attr('data-devicecomponentid');
if (id) {
var data = {
id: id
};
$.ajax({
url: '");
#line 157 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
Write(Url.Action(MVC.API.DeviceModel.Component()));
#line default
#line hidden
WriteLiteral("\',\r\n dataType: \'json\',\r\n data: data,\r\n " +
" success: function (d) {\r\n componentRow.fin" +
"d(\'input\').attr(\'disabled\', false).removeClass(\'updating\');\r\n " +
" if (d.Result == \'OK\') {\r\n $dialogUpdateJobTypes " +
"= $(\'#dialogUpdateJobTypes\');\r\n $dialogUpdateJobTypes" +
".find(\'input:checked\').each(function () { $(this).prop(\'checked\', false) });\r\n " +
" for (var i = 0; i < d.Component.JobSubTypes.length; i+" +
"+) {\r\n var sjt = d.Component.JobSubTypes[i];\r\n " +
" $dialogUpdateJobTypes.find(\'#SubTypes_\' + sjt).prop" +
"(\'checked\', true);\r\n }\r\n $" +
"(\'#CheckboxBulkSelect_dialogUpdateJobTypes\').checkboxBulkSelect(\'update\');\r\n " +
" var buttons = $dialogUpdateJobTypes.dialog(\"option\", \"bu" +
"ttons\");\r\n buttons[\'Save\'] = function () {\r\n " +
" $dialogUpdateJobTypes.dialog(\"disable\");\r\n " +
" var selectedSJTs = [];\r\n $dialog" +
"UpdateJobTypes.find(\'input:checked\').each(function () { selectedSJTs.push($(this" +
").val()) });\r\n\r\n var data = {\r\n " +
" id: id,\r\n JobSubTypes: sele" +
"ctedSJTs\r\n };\r\n $." +
"ajax({\r\n url: \'");
#line 181 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
Write(Url.Action(MVC.API.DeviceModel.ComponentUpdateJobSubTypes()));
#line default
#line hidden
WriteLiteral("\',\r\n dataType: \'json\',\r\n " +
" type: \'POST\',\r\n traditional: tr" +
"ue,\r\n data: data,\r\n " +
" success: function (d) {\r\n if (d" +
".Result == \'OK\') {\r\n if (d.Component." +
"JobSubTypes.length > 0) {\r\n edit$" +
"this.addClass(\'editAlert\');\r\n } else " +
"{\r\n edit$this.removeClass(\'editAl" +
"ert\');\r\n }\r\n " +
" $dialogUpdateJobTypes.dialog(\"enable\");\r\n " +
" $dialogUpdateJobTypes.dialog(\"close\");\r\n " +
" } else {\r\n al" +
"ert(\'Unable to update component sub types: \' + d.Result);\r\n " +
" }\r\n },\r\n " +
" error: function (jqXHR, textStatus, errorThrown) {\r\n " +
" alert(\'Unable to update component sub types: \' + t" +
"extStatus);\r\n }\r\n " +
" });\r\n };\r\n var buttons" +
" = $dialogUpdateJobTypes.dialog(\"option\", \"buttons\", buttons);\r\n " +
" $dialogUpdateJobTypes.dialog(\'open\');\r\n } els" +
"e {\r\n alert(\'Unable to load component: \' + d.Result);" +
"\r\n }\r\n },\r\n error: " +
"function (jqXHR, textStatus, errorThrown) {\r\n alert(\'Unab" +
"le to load component: \' + textStatus);\r\n }\r\n }" +
");\r\n }\r\n\r\n }\r\n\r\n $(\"#dialogConfirmRemove\").dialog({\r\n " +
" resizable: false,\r\n height: 140,\r\n modal: true,\r" +
"\n autoOpen: false,\r\n buttons: {\r\n \"Remove\":" +
" function () {\r\n $(this).dialog(\"close\");\r\n }," +
"\r\n Cancel: function () {\r\n $(this).dialog(\"clo" +
"se\");\r\n }\r\n }\r\n });\r\n\r\n $(\'#dialogUpdate" +
"JobTypes\').dialog({\r\n resizable: false,\r\n modal: true,\r\n " +
" autoOpen: false,\r\n width: 550,\r\n buttons: {\r\n " +
" \"Save\": function () {\r\n $(this).dialog(\"close\");" +
"\r\n },\r\n Cancel: function () {\r\n " +
" $(this).dialog(\"close\");\r\n }\r\n }\r\n });\r\n\r\n " +
" $(\'#CheckboxBulkSelect_dialogUpdateJobTypes\').checkboxBulkSelect({ parentSel" +
"ector: \'div\' });\r\n\r\n $deviceComponents.on(\'change\', \'input\', updateCompon" +
"ent);\r\n $deviceComponents.on(\'focus\', \'input\', function () { $(this).sele" +
"ct(); });\r\n\r\n $deviceComponents.on(\'click\', \'span.remove\', removeComponen" +
"t);\r\n $deviceComponents.on(\'click\', \'span.edit\', editComponentJobTypes);\r" +
"\n });\r\n</script>\r\n<div");
WriteLiteral(" id=\"dialogUpdateJobTypes\"");
WriteLiteral(" title=\"Update Job Types\"");
WriteLiteral(">\r\n <div>\r\n <h2>\r\n Hardware Non-Warranty Job Types</h2>\r\n");
WriteLiteral(" ");
#line 261 "..\..\Areas\Config\Views\DeviceModel\_DeviceComponentsTable.cshtml"
Write(CommonHelpers.CheckBoxList("SubTypes", Model.JobSubTypes.ToSelectListItems(), 2));
#line default
#line hidden
WriteLiteral("\r\n <br />\r\n <span");
WriteLiteral(" id=\"CheckboxBulkSelect_dialogUpdateJobTypes\"");
WriteLiteral(" class=\"checkboxBulkSelectContainer\"");
WriteLiteral(">\r\n </span>\r\n </div>\r\n</div>\r\n<div");
WriteLiteral(" id=\"dialogConfirmRemove\"");
WriteLiteral(" title=\"Delete this Component?\"");
WriteLiteral(">\r\n <p>\r\n <span");
WriteLiteral(" class=\"ui-icon ui-icon-alert\"");
WriteLiteral(" style=\"float: left; margin: 0 7px 20px 0;\"");
WriteLiteral("></span>\r\n This item will be permanently deleted and cannot be recovered. " +
"Are you sure?</p>\r\n</div>\r\n");
}
}
}
#pragma warning restore 1591
@@ -1,322 +1,322 @@
@{
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");
}
<h2>
Documents Imported Today
</h2>
<div id="importStatus">
<div id="noSessions" data-bind="visible: noSessions">
<h3>
No imported documents today</h3>
</div>
<div id="sessions" data-bind="visible: !noSessions(), foreach: {data: sessions, afterRender: sessionRendered}"
style="display: none">
<div class="session">
<div class="clearfix">
<div class="sessionLeftPane">
<h3>
<span data-bind="text: title"></span>
</h3>
</div>
<div class="sessionRightPane">
<p class="sessionStart" data-bind="text: startTime">
</p>
<p class="sessionStatus" data-bind="text: progressStatus">
</p>
<div data-bind="visible: !sessionEnded(), progressValue: progressValue" class="sessionProgress">
</div>
</div>
</div>
<div class="sessionPages clearfix" data-bind="foreach: {data: sessionPages}">
<div class="sessionPage" data-bind="style: {backgroundImage: thumbnailUrl}">
<div class="sessionPageDetails">
<h3 data-bind="text: title">
</h3>
<div data-bind="visible: undetected">
Disco QR-Code not found<br />
<a target="_blank" data-bind="attr: {href: manuallyAssignUrl}, visible: $parent.sessionEnded">Manually Assign Page</a>
</div>
<div data-bind="visible: detected">
Document: <a target="_blank" data-bind="text: documentTemplate, attr: {href: documentTemplateUrl}">
</a>
<br />
Target: <a target="_blank" data-bind="text: assignedData, attr: {href: assignedDataUrl}">
</a>
</div>
<div data-bind="visible: !(detected() || undetected())">
<p class="sessionStatus" data-bind="text: progressStatus">
</p>
<div data-bind="progressValue: progressValue" class="sessionProgress">
</div>
</div>
</div>
</div>
</div>
<div class="sessionInfoMessages">
<table class="logEventsViewport">
<thead>
<tr>
<th class="icon">
&nbsp;
</th>
<th class="message">
Message
</th>
</tr>
</thead>
</table>
<div class="logEventsViewportContainer">
<div class="logEventsViewportNoLogs" data-bind="visible: messages().length == 0"
style="display: none">
No logs
</div>
<table class="logEventsViewport" data-bind="visible: messages().length > 0" style="display: none">
<tbody data-bind="foreach: messages">
<tr>
<td class="icon" data-bind="attr: {title: FormattedTimestamp}, css: {information: EventTypeSeverity == 0, warning: EventTypeSeverity == 1, error: EventTypeSeverity == 2}">
&nbsp;
</td>
<td class="message" data-bind="text: FormattedMessage, attr: {title: EventTypeName}">
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
ko.bindingHandlers.progressValue = {
update: function (element, valueAccessor, allBindingsAccessor, viewModel) {
var v = ko.utils.unwrapObservable(valueAccessor());
var vInt = parseInt(v);
if (vInt >= 0) {
$element = $(element);
if (!$element.is('.ui-progressbar'))
$element.progressbar();
$(element).progressbar('option', 'value', vInt);
}
}
};
</script>
<script type="text/javascript">
$(function () {
var vm;
var host = $('#importStatus');
var hostSessions = $('#sessions');
var liveConnection;
var urlDeviceShow = '@(Url.Action(MVC.Device.Show()))/'
var urlJobShow = '@(Url.Action(MVC.Job.Show()))/'
var urlUserShow = '@(Url.Action(MVC.User.Show()))/'
var urlPageThumbnail = '@(Url.Action(MVC.API.DocumentTemplate.ImporterThumbnail()))/'
var urlDocumentTemplate = '@(Url.Action(MVC.Config.DocumentTemplate.Index()))/';
var urlManuallyAssign = '@(Url.Action(MVC.Config.DocumentTemplate.UndetectedPages()))';
var iconErrorUrl = 'url(@(Links.ClientSource.Style.Images.Status.fail32_png))';
var isLive = false;
function pageViewModel() {
var self = this;
self.noSessions = ko.observable(true);
self.sessions = ko.observableArray();
self.sessionIndex = {};
self.sessionRendered = function (e, d) {
if (!d.sessionEnded()) {
d.progressbar = $(e).find('.sessionProgress').progressbar();
}
};
}
function sessionViewModel(id) {
var self = this;
self.title = ko.observable(id);
self.messages = ko.observableArray();
self.progressStatus = ko.observable();
self.progressValue = ko.observable();
self.startTime = ko.observable();
self.sessionEnded = ko.observable(false);
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) {
var self = this;
self.sessionId = sessionId;
self.pageNumber = pageNumber;
self.title = 'Page ' + pageNumber;
self.progressStatus = ko.observable();
self.progressValue = ko.observable();
self.undetected = ko.observable(false);
self.detected = ko.observable(false);
self.documentTemplateId = ko.observable();
self.documentTemplate = ko.observable();
self.assignedDataType = ko.observable();
self.assignedDataId = ko.observable();
self.assignedData = ko.observable();
self.thumbnailEnabled = ko.observable(0);
self.updateThumbnail = function () {
self.thumbnailEnabled(self.thumbnailEnabled() + 1);
}
self.documentTemplateUrl = ko.computed(function () {
return urlDocumentTemplate + self.documentTemplateId();
});
self.manuallyAssignUrl = ko.computed(function () {
return urlManuallyAssign + '#' + self.sessionId + '_' + self.pageNumber;
});
self.assignedDataUrl = ko.computed(function () {
var t = self.assignedDataType();
var dId = self.assignedDataId();
switch (t) {
case 'Device':
return urlDeviceShow + dId;
case 'Job':
return urlJobShow + dId;
case 'User':
return urlUserShow + dId;
}
return null;
});
self.thumbnailUrl = ko.computed(function () {
var enabled = self.thumbnailEnabled();
if (enabled > 0) {
return 'url(' + urlPageThumbnail + '?SessionId=' + self.sessionId + '&PageNumber=' + self.pageNumber + '&NoCache=' + enabled + ')';
}
return null;
});
}
function parseLog(log) {
if (log.ModuleId === 40 && log.Arguments && log.Arguments.length > 0) {
// find session
var sessionId = log.Arguments[0];
var session = vm.sessionIndex[sessionId];
if (!session && log.EventTypeId === 10) { // Starting Session (Ignore 'partial' sessions)
session = new sessionViewModel(log.Arguments[1]);
vm.sessionIndex[sessionId] = session;
vm.sessions.unshift(session);
vm.noSessions(false);
}
if (session) {
switch (log.EventTypeId) {
case 10: // SessionStarting
session.startTime(log.FormattedTimestamp.substring(log.FormattedTimestamp.indexOf(' ') + 1));
break;
case 11: // SessionProgress
session.progressValue(log.Arguments[1]);
session.progressStatus(log.Arguments[2]);
break;
case 12: // SessionFinished
session.sessionEnded(true);
session.progressStatus('Import Finished');
break;
case 15: // SessionWarning
session.messages.unshift(log);
break;
case 16: // SessionError
session.messages.unshift(log);
break;
case 100: // ImportPageStarting
session.addSessionPage(new sessionPageViewModel(sessionId, log.Arguments[1]));
break;
case 104: // ImportPageImageUpdate
var p = session.sessionPagesIndex[log.Arguments[1]];
if (p) {
p.updateThumbnail();
}
break;
case 105: // ImportPageProgress
var p = session.sessionPagesIndex[log.Arguments[1]];
if (p) {
p.progressValue(log.Arguments[2]);
p.progressStatus(log.Arguments[3]);
}
break;
case 110: // ImportPageDetected
var p = session.sessionPagesIndex[log.Arguments[1]];
if (p) {
p.documentTemplateId(log.Arguments[2]);
p.documentTemplate(log.Arguments[3]);
p.assignedDataType(log.Arguments[4]);
p.assignedDataId(log.Arguments[5]);
p.assignedData(log.Arguments[6]);
p.detected(true);
if (!isLive) {
p.updateThumbnail();
}
}
session.messages.unshift(log);
break;
case 115: // ImportPageUndetected
var p = session.sessionPagesIndex[log.Arguments[1]];
if (p) {
p.undetected(true);
if (!isLive) {
p.updateThumbnail();
}
}
session.messages.unshift(log);
break;
case 150: // Ignore: ImportPageUndetectedStored
break;
default:
session.messages.unshift(log);
}
}
}
}
function init() {
// Create View Model
vm = new pageViewModel();
// Load Logs
var d = new Date();
var loadData = {
Format: "json",
Start: d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate(),
End: null,
ModuleId: 40,
Take: 2000
};
$.ajax({
url: '@(Url.Action(MVC.API.Logging.RetrieveEvents()))',
dataType: 'json',
type: 'POST',
traditional: true,
data: loadData,
success: init_loadedLogs,
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to retrieve logs: ' + errorThrown);
}
});
}
function init_loadedLogs(logs) {
logs.reverse();
for (var i = 0; i < logs.length; i++) {
parseLog(logs[i]);
}
// Bind
ko.applyBindings(vm);
// Init Persistent Connection
liveConnection = $.connection('@(Url.Content("~/API/Logging/Notifications"))');
liveConnection.received(parseLog);
liveConnection.error(function (e) { alert('Live-Log Error: ' + e) });
isLive = true;
liveConnection.start(function () {
liveConnection.send('/addToGroups:@(Disco.BI.DocumentTemplateBI.Importer.DocumentImporterLog.Current.LiveLogGroupName)');
});
}
init();
});
</script>
@{
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");
}
<h2>
Documents Imported Today
</h2>
<div id="importStatus">
<div id="noSessions" data-bind="visible: noSessions">
<h3>
No imported documents today</h3>
</div>
<div id="sessions" data-bind="visible: !noSessions(), foreach: {data: sessions, afterRender: sessionRendered}"
style="display: none">
<div class="session">
<div class="clearfix">
<div class="sessionLeftPane">
<h3>
<span data-bind="text: title"></span>
</h3>
</div>
<div class="sessionRightPane">
<p class="sessionStart" data-bind="text: startTime">
</p>
<p class="sessionStatus" data-bind="text: progressStatus">
</p>
<div data-bind="visible: !sessionEnded(), progressValue: progressValue" class="sessionProgress">
</div>
</div>
</div>
<div class="sessionPages clearfix" data-bind="foreach: {data: sessionPages}">
<div class="sessionPage" data-bind="style: {backgroundImage: thumbnailUrl}">
<div class="sessionPageDetails">
<h3 data-bind="text: title">
</h3>
<div data-bind="visible: undetected">
Disco QR-Code not found<br />
<a target="_blank" data-bind="attr: {href: manuallyAssignUrl}, visible: $parent.sessionEnded">Manually Assign Page</a>
</div>
<div data-bind="visible: detected">
Document: <a target="_blank" data-bind="text: documentTemplate, attr: {href: documentTemplateUrl}">
</a>
<br />
Target: <a target="_blank" data-bind="text: assignedData, attr: {href: assignedDataUrl}">
</a>
</div>
<div data-bind="visible: !(detected() || undetected())">
<p class="sessionStatus" data-bind="text: progressStatus">
</p>
<div data-bind="progressValue: progressValue" class="sessionProgress">
</div>
</div>
</div>
</div>
</div>
<div class="sessionInfoMessages">
<table class="logEventsViewport">
<thead>
<tr>
<th class="icon">
&nbsp;
</th>
<th class="message">
Message
</th>
</tr>
</thead>
</table>
<div class="logEventsViewportContainer">
<div class="logEventsViewportNoLogs" data-bind="visible: messages().length == 0"
style="display: none">
No logs
</div>
<table class="logEventsViewport" data-bind="visible: messages().length > 0" style="display: none">
<tbody data-bind="foreach: messages">
<tr>
<td class="icon" data-bind="attr: {title: FormattedTimestamp}, css: {information: EventTypeSeverity == 0, warning: EventTypeSeverity == 1, error: EventTypeSeverity == 2}">
&nbsp;
</td>
<td class="message" data-bind="text: FormattedMessage, attr: {title: EventTypeName}">
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
ko.bindingHandlers.progressValue = {
update: function (element, valueAccessor, allBindingsAccessor, viewModel) {
var v = ko.utils.unwrapObservable(valueAccessor());
var vInt = parseInt(v);
if (vInt >= 0) {
$element = $(element);
if (!$element.is('.ui-progressbar'))
$element.progressbar();
$(element).progressbar('option', 'value', vInt);
}
}
};
</script>
<script type="text/javascript">
$(function () {
var vm;
var host = $('#importStatus');
var hostSessions = $('#sessions');
var liveConnection;
var urlDeviceShow = '@(Url.Action(MVC.Device.Show()))/'
var urlJobShow = '@(Url.Action(MVC.Job.Show()))/'
var urlUserShow = '@(Url.Action(MVC.User.Show()))/'
var urlPageThumbnail = '@(Url.Action(MVC.API.DocumentTemplate.ImporterThumbnail()))/'
var urlDocumentTemplate = '@(Url.Action(MVC.Config.DocumentTemplate.Index()))/';
var urlManuallyAssign = '@(Url.Action(MVC.Config.DocumentTemplate.UndetectedPages()))';
var iconErrorUrl = 'url(@(Links.ClientSource.Style.Images.Status.fail32_png))';
var isLive = false;
function pageViewModel() {
var self = this;
self.noSessions = ko.observable(true);
self.sessions = ko.observableArray();
self.sessionIndex = {};
self.sessionRendered = function (e, d) {
if (!d.sessionEnded()) {
d.progressbar = $(e).find('.sessionProgress').progressbar();
}
};
}
function sessionViewModel(id) {
var self = this;
self.title = ko.observable(id);
self.messages = ko.observableArray();
self.progressStatus = ko.observable();
self.progressValue = ko.observable();
self.startTime = ko.observable();
self.sessionEnded = ko.observable(false);
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) {
var self = this;
self.sessionId = sessionId;
self.pageNumber = pageNumber;
self.title = 'Page ' + pageNumber;
self.progressStatus = ko.observable();
self.progressValue = ko.observable();
self.undetected = ko.observable(false);
self.detected = ko.observable(false);
self.documentTemplateId = ko.observable();
self.documentTemplate = ko.observable();
self.assignedDataType = ko.observable();
self.assignedDataId = ko.observable();
self.assignedData = ko.observable();
self.thumbnailEnabled = ko.observable(0);
self.updateThumbnail = function () {
self.thumbnailEnabled(self.thumbnailEnabled() + 1);
}
self.documentTemplateUrl = ko.computed(function () {
return urlDocumentTemplate + self.documentTemplateId();
});
self.manuallyAssignUrl = ko.computed(function () {
return urlManuallyAssign + '#' + self.sessionId + '_' + self.pageNumber;
});
self.assignedDataUrl = ko.computed(function () {
var t = self.assignedDataType();
var dId = self.assignedDataId();
switch (t) {
case 'Device':
return urlDeviceShow + dId;
case 'Job':
return urlJobShow + dId;
case 'User':
return urlUserShow + dId;
}
return null;
});
self.thumbnailUrl = ko.computed(function () {
var enabled = self.thumbnailEnabled();
if (enabled > 0) {
return 'url(' + urlPageThumbnail + '?SessionId=' + self.sessionId + '&PageNumber=' + self.pageNumber + '&NoCache=' + enabled + ')';
}
return null;
});
}
function parseLog(log) {
if (log.ModuleId === 40 && log.Arguments && log.Arguments.length > 0) {
// find session
var sessionId = log.Arguments[0];
var session = vm.sessionIndex[sessionId];
if (!session && log.EventTypeId === 10) { // Starting Session (Ignore 'partial' sessions)
session = new sessionViewModel(log.Arguments[1]);
vm.sessionIndex[sessionId] = session;
vm.sessions.unshift(session);
vm.noSessions(false);
}
if (session) {
switch (log.EventTypeId) {
case 10: // SessionStarting
session.startTime(log.FormattedTimestamp.substring(log.FormattedTimestamp.indexOf(' ') + 1));
break;
case 11: // SessionProgress
session.progressValue(log.Arguments[1]);
session.progressStatus(log.Arguments[2]);
break;
case 12: // SessionFinished
session.sessionEnded(true);
session.progressStatus('Import Finished');
break;
case 15: // SessionWarning
session.messages.unshift(log);
break;
case 16: // SessionError
session.messages.unshift(log);
break;
case 100: // ImportPageStarting
session.addSessionPage(new sessionPageViewModel(sessionId, log.Arguments[1]));
break;
case 104: // ImportPageImageUpdate
var p = session.sessionPagesIndex[log.Arguments[1]];
if (p) {
p.updateThumbnail();
}
break;
case 105: // ImportPageProgress
var p = session.sessionPagesIndex[log.Arguments[1]];
if (p) {
p.progressValue(log.Arguments[2]);
p.progressStatus(log.Arguments[3]);
}
break;
case 110: // ImportPageDetected
var p = session.sessionPagesIndex[log.Arguments[1]];
if (p) {
p.documentTemplateId(log.Arguments[2]);
p.documentTemplate(log.Arguments[3]);
p.assignedDataType(log.Arguments[4]);
p.assignedDataId(log.Arguments[5]);
p.assignedData(log.Arguments[6]);
p.detected(true);
if (!isLive) {
p.updateThumbnail();
}
}
session.messages.unshift(log);
break;
case 115: // ImportPageUndetected
var p = session.sessionPagesIndex[log.Arguments[1]];
if (p) {
p.undetected(true);
if (!isLive) {
p.updateThumbnail();
}
}
session.messages.unshift(log);
break;
case 150: // Ignore: ImportPageUndetectedStored
break;
default:
session.messages.unshift(log);
}
}
}
}
function init() {
// Create View Model
vm = new pageViewModel();
// Load Logs
var d = new Date();
var loadData = {
Format: "json",
Start: d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate(),
End: null,
ModuleId: 40,
Take: 2000
};
$.ajax({
url: '@(Url.Action(MVC.API.Logging.RetrieveEvents()))',
dataType: 'json',
type: 'POST',
traditional: true,
data: loadData,
success: init_loadedLogs,
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to retrieve logs: ' + errorThrown);
}
});
}
function init_loadedLogs(logs) {
logs.reverse();
for (var i = 0; i < logs.length; i++) {
parseLog(logs[i]);
}
// Bind
ko.applyBindings(vm);
// Init Persistent Connection
liveConnection = $.connection('@(Url.Content("~/API/Logging/Notifications"))');
liveConnection.received(parseLog);
liveConnection.error(function (e) { if (e.status != 200) alert('Live-Log Error: ' + e.statusText + ': ' + e.responseText); });
isLive = true;
liveConnection.start(function () {
liveConnection.send('/addToGroups:@(Disco.BI.DocumentTemplateBI.Importer.DocumentImporterLog.Current.LiveLogGroupName)');
});
}
init();
});
</script>
@@ -1,484 +1,484 @@
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17929
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Disco.Web.Areas.Config.Views.DocumentTemplate
{
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", "1.5.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DocumentTemplate/ImportStatus.cshtml")]
public class ImportStatus : System.Web.Mvc.WebViewPage<dynamic>
{
public ImportStatus()
{
}
public override void Execute()
{
#line 1 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
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");
#line default
#line hidden
WriteLiteral("\r\n<h2>\r\n Documents Imported Today\r\n</h2>\r\n<div");
WriteLiteral(" id=\"importStatus\"");
WriteLiteral(">\r\n <div");
WriteLiteral(" id=\"noSessions\"");
WriteLiteral(" data-bind=\"visible: noSessions\"");
WriteLiteral(">\r\n <h3>\r\n No imported documents today</h3>\r\n </div>\r\n <d" +
"iv");
WriteLiteral(" id=\"sessions\"");
WriteLiteral(" data-bind=\"visible: !noSessions(), foreach: {data: sessions, afterRender: sessio" +
"nRendered}\"");
WriteLiteral("\r\n style=\"display: none\"");
WriteLiteral(">\r\n <div");
WriteLiteral(" class=\"session\"");
WriteLiteral(">\r\n <div");
WriteLiteral(" class=\"clearfix\"");
WriteLiteral(">\r\n <div");
WriteLiteral(" class=\"sessionLeftPane\"");
WriteLiteral(">\r\n <h3>\r\n <span");
WriteLiteral(" data-bind=\"text: title\"");
WriteLiteral("></span>\r\n </h3>\r\n </div>\r\n <div" +
"");
WriteLiteral(" class=\"sessionRightPane\"");
WriteLiteral(">\r\n <p");
WriteLiteral(" class=\"sessionStart\"");
WriteLiteral(" data-bind=\"text: startTime\"");
WriteLiteral(">\r\n </p>\r\n <p");
WriteLiteral(" class=\"sessionStatus\"");
WriteLiteral(" data-bind=\"text: progressStatus\"");
WriteLiteral(">\r\n </p>\r\n <div");
WriteLiteral(" data-bind=\"visible: !sessionEnded(), progressValue: progressValue\"");
WriteLiteral(" class=\"sessionProgress\"");
WriteLiteral(">\r\n </div>\r\n </div>\r\n </div>\r\n " +
" <div");
WriteLiteral(" class=\"sessionPages clearfix\"");
WriteLiteral(" data-bind=\"foreach: {data: sessionPages}\"");
WriteLiteral(">\r\n <div");
WriteLiteral(" class=\"sessionPage\"");
WriteLiteral(" data-bind=\"style: {backgroundImage: thumbnailUrl}\"");
WriteLiteral(">\r\n <div");
WriteLiteral(" class=\"sessionPageDetails\"");
WriteLiteral(">\r\n <h3");
WriteLiteral(" data-bind=\"text: title\"");
WriteLiteral(">\r\n </h3>\r\n <div");
WriteLiteral(" data-bind=\"visible: undetected\"");
WriteLiteral(">\r\n Disco QR-Code not found<br />\r\n " +
" <a");
WriteLiteral(" target=\"_blank\"");
WriteLiteral(" data-bind=\"attr: {href: manuallyAssignUrl}, visible: $parent.sessionEnded\"");
WriteLiteral(">Manually Assign Page</a>\r\n </div>\r\n " +
" <div");
WriteLiteral(" data-bind=\"visible: detected\"");
WriteLiteral(">\r\n Document: <a");
WriteLiteral(" target=\"_blank\"");
WriteLiteral(" data-bind=\"text: documentTemplate, attr: {href: documentTemplateUrl}\"");
WriteLiteral(">\r\n </a>\r\n <br />\r\n " +
" Target: <a");
WriteLiteral(" target=\"_blank\"");
WriteLiteral(" data-bind=\"text: assignedData, attr: {href: assignedDataUrl}\"");
WriteLiteral(">\r\n </a>\r\n </div>\r\n " +
" <div");
WriteLiteral(" data-bind=\"visible: !(detected() || undetected())\"");
WriteLiteral(">\r\n <p");
WriteLiteral(" class=\"sessionStatus\"");
WriteLiteral(" data-bind=\"text: progressStatus\"");
WriteLiteral(">\r\n </p>\r\n <div");
WriteLiteral(" data-bind=\"progressValue: progressValue\"");
WriteLiteral(" class=\"sessionProgress\"");
WriteLiteral(">\r\n </div>\r\n </div>\r\n " +
" </div>\r\n </div>\r\n </div>\r\n <div");
WriteLiteral(" class=\"sessionInfoMessages\"");
WriteLiteral(">\r\n <table");
WriteLiteral(" class=\"logEventsViewport\"");
WriteLiteral(">\r\n <thead>\r\n <tr>\r\n " +
" <th");
WriteLiteral(" class=\"icon\"");
WriteLiteral(">\r\n &nbsp;\r\n </th>\r\n " +
" <th");
WriteLiteral(" class=\"message\"");
WriteLiteral(">\r\n Message\r\n </th>\r\n " +
" </tr>\r\n </thead>\r\n </tab" +
"le>\r\n <div");
WriteLiteral(" class=\"logEventsViewportContainer\"");
WriteLiteral(">\r\n <div");
WriteLiteral(" class=\"logEventsViewportNoLogs\"");
WriteLiteral(" data-bind=\"visible: messages().length == 0\"");
WriteLiteral("\r\n style=\"display: none\"");
WriteLiteral(">\r\n No logs\r\n </div>\r\n " +
" <table");
WriteLiteral(" class=\"logEventsViewport\"");
WriteLiteral(" data-bind=\"visible: messages().length > 0\"");
WriteLiteral(" style=\"display: none\"");
WriteLiteral(">\r\n <tbody");
WriteLiteral(" data-bind=\"foreach: messages\"");
WriteLiteral(">\r\n <tr>\r\n <td");
WriteLiteral(" class=\"icon\"");
WriteLiteral(" data-bind=\"attr: {title: FormattedTimestamp}, css: {information: EventTypeSeveri" +
"ty == 0, warning: EventTypeSeverity == 1, error: EventTypeSeverity == 2}\"");
WriteLiteral(">\r\n &nbsp;\r\n </" +
"td>\r\n <td");
WriteLiteral(" class=\"message\"");
WriteLiteral(" data-bind=\"text: FormattedMessage, attr: {title: EventTypeName}\"");
WriteLiteral(">\r\n </td>\r\n </tr>\r\n " +
" </tbody>\r\n </table>\r\n </di" +
"v>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n<script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
ko.bindingHandlers.progressValue = {
update: function (element, valueAccessor, allBindingsAccessor, viewModel) {
var v = ko.utils.unwrapObservable(valueAccessor());
var vInt = parseInt(v);
if (vInt >= 0) {
$element = $(element);
if (!$element.is('.ui-progressbar'))
$element.progressbar();
$(element).progressbar('option', 'value', vInt);
}
}
};
</script>
<script");
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 = \'");
#line 111 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
Write(Url.Action(MVC.Device.Show()));
#line default
#line hidden
WriteLiteral("/\'\r\n var urlJobShow = \'");
#line 112 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
Write(Url.Action(MVC.Job.Show()));
#line default
#line hidden
WriteLiteral("/\'\r\n var urlUserShow = \'");
#line 113 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
Write(Url.Action(MVC.User.Show()));
#line default
#line hidden
WriteLiteral("/\'\r\n var urlPageThumbnail = \'");
#line 114 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
Write(Url.Action(MVC.API.DocumentTemplate.ImporterThumbnail()));
#line default
#line hidden
WriteLiteral("/\'\r\n var urlDocumentTemplate = \'");
#line 115 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
Write(Url.Action(MVC.Config.DocumentTemplate.Index()));
#line default
#line hidden
WriteLiteral("/\';\r\n var urlManuallyAssign = \'");
#line 116 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
Write(Url.Action(MVC.Config.DocumentTemplate.UndetectedPages()));
#line default
#line hidden
WriteLiteral("\';\r\n var iconErrorUrl = \'url(");
#line 117 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
Write(Links.ClientSource.Style.Images.Status.fail32_png);
#line default
#line hidden
WriteLiteral(")\';\r\n var isLive = false;\r\n\r\n function pageViewModel() {\r\n " +
" var self = this;\r\n\r\n self.noSessions = ko.observable(true);\r\n " +
" self.sessions = ko.observableArray();\r\n self.sessionIndex = {}" +
";\r\n\r\n self.sessionRendered = function (e, d) {\r\n if (!" +
"d.sessionEnded()) {\r\n d.progressbar = $(e).find(\'.sessionProg" +
"ress\').progressbar();\r\n }\r\n };\r\n }\r\n fun" +
"ction sessionViewModel(id) {\r\n var self = this;\r\n\r\n self.t" +
"itle = ko.observable(id);\r\n self.messages = ko.observableArray();\r\n " +
" self.progressStatus = ko.observable();\r\n self.progressValue" +
" = ko.observable();\r\n self.startTime = ko.observable();\r\n " +
"self.sessionEnded = ko.observable(false);\r\n\r\n self.sessionPages = ko." +
"observableArray();\r\n self.sessionPagesIndex = {};\r\n self.a" +
"ddSessionPage = function (sessionPage) {\r\n //if (isLive) {\r\n " +
" self.sessionPages.push(sessionPage);\r\n self.sessionPag" +
"esIndex[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.progress" +
"Value = ko.observable();\r\n self.undetected = ko.observable(false);\r\n " +
" self.detected = ko.observable(false);\r\n self.documentTempl" +
"ateId = ko.observable();\r\n self.documentTemplate = ko.observable();\r\n" +
" self.assignedDataType = ko.observable();\r\n self.assignedD" +
"ataId = ko.observable();\r\n self.assignedData = ko.observable();\r\n " +
" self.thumbnailEnabled = ko.observable(0);\r\n self.updateThumbn" +
"ail = function () {\r\n self.thumbnailEnabled(self.thumbnailEnabled" +
"() + 1);\r\n }\r\n self.documentTemplateUrl = ko.computed(func" +
"tion () {\r\n return urlDocumentTemplate + self.documentTemplateId(" +
");\r\n });\r\n self.manuallyAssignUrl = ko.computed(function (" +
") {\r\n return urlManuallyAssign + \'#\' + self.sessionId + \'_\' + sel" +
"f.pageNumber;\r\n });\r\n self.assignedDataUrl = ko.computed(f" +
"unction () {\r\n var t = self.assignedDataType();\r\n " +
"var dId = self.assignedDataId();\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 return urlUserShow + dId;\r" +
"\n }\r\n return null;\r\n });\r\n s" +
"elf.thumbnailUrl = ko.computed(function () {\r\n var enabled = self" +
".thumbnailEnabled();\r\n if (enabled > 0) {\r\n re" +
"turn \'url(\' + urlPageThumbnail + \'?SessionId=\' + self.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.Arguments && log.Arguments.length" +
" > 0) {\r\n // find session\r\n var sessionId = log.Ar" +
"guments[0];\r\n var session = vm.sessionIndex[sessionId];\r\n " +
" if (!session && log.EventTypeId === 10) { // Starting Session (Ignore \'p" +
"artial\' sessions)\r\n session = new sessionViewModel(log.Argume" +
"nts[1]);\r\n vm.sessionIndex[sessionId] = 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.FormattedTimestamp.substring(log.Fo" +
"rmattedTimestamp.indexOf(\' \') + 1));\r\n break;\r\n " +
" case 11: // SessionProgress\r\n sessi" +
"on.progressValue(log.Arguments[1]);\r\n session.progres" +
"sStatus(log.Arguments[2]);\r\n break;\r\n " +
" case 12: // SessionFinished\r\n session.session" +
"Ended(true);\r\n session.progressStatus(\'Import Finishe" +
"d\');\r\n break;\r\n case 15: // Se" +
"ssionWarning\r\n session.messages.unshift(log);\r\n " +
" break;\r\n case 16: // SessionError\r\n" +
" session.messages.unshift(log);\r\n " +
" break;\r\n case 100: // ImportPageStarting\r\n " +
" session.addSessionPage(new sessionPageViewModel(sessionId, " +
"log.Arguments[1]));\r\n break;\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: // Impor" +
"tPageProgress\r\n var p = session.sessionPagesIndex[log" +
".Arguments[1]];\r\n if (p) {\r\n " +
" p.progressValue(log.Arguments[2]);\r\n p.pro" +
"gressStatus(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.documentTe" +
"mplateId(log.Arguments[2]);\r\n p.documentTemplate(" +
"log.Arguments[3]);\r\n p.assignedDataType(log.Argum" +
"ents[4]);\r\n p.assignedDataId(log.Arguments[5]);\r\n" +
" p.assignedData(log.Arguments[6]);\r\n " +
" p.detected(true);\r\n if (!isLiv" +
"e) {\r\n p.updateThumbnail();\r\n " +
" }\r\n }\r\n se" +
"ssion.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.updateThumbnail(" +
");\r\n }\r\n }\r\n " +
" session.messages.unshift(log);\r\n br" +
"eak;\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 // C" +
"reate View Model\r\n vm = new pageViewModel();\r\n\r\n // Load L" +
"ogs\r\n var d = new Date();\r\n var loadData = {\r\n " +
" Format: \"json\",\r\n Start: d.getFullYear() + \'-\' + (d.getMonth(" +
") + 1) + \'-\' + d.getDate(),\r\n End: null,\r\n ModuleI" +
"d: 40,\r\n Take: 2000\r\n };\r\n $.ajax({\r\n " +
" url: \'");
#line 292 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
Write(Url.Action(MVC.API.Logging.RetrieveEvents()));
#line default
#line hidden
WriteLiteral(@"',
dataType: 'json',
type: 'POST',
traditional: true,
data: loadData,
success: init_loadedLogs,
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to retrieve logs: ' + errorThrown);
}
});
}
function init_loadedLogs(logs) {
logs.reverse();
for (var i = 0; i < logs.length; i++) {
parseLog(logs[i]);
}
// Bind
ko.applyBindings(vm);
// Init Persistent Connection
liveConnection = $.connection('");
#line 312 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
Write(Url.Content("~/API/Logging/Notifications"));
#line default
#line hidden
WriteLiteral(@"');
liveConnection.received(parseLog);
liveConnection.error(function (e) { alert('Live-Log Error: ' + e) });
isLive = true;
liveConnection.start(function () {
liveConnection.send('/addToGroups:");
#line 317 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
Write(Disco.BI.DocumentTemplateBI.Importer.DocumentImporterLog.Current.LiveLogGroupName);
#line default
#line hidden
WriteLiteral("\');\r\n });\r\n }\r\n init();\r\n });\r\n</script>\r\n");
}
}
}
#pragma warning restore 1591
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17929
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Disco.Web.Areas.Config.Views.DocumentTemplate
{
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", "1.5.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DocumentTemplate/ImportStatus.cshtml")]
public class ImportStatus : System.Web.Mvc.WebViewPage<dynamic>
{
public ImportStatus()
{
}
public override void Execute()
{
#line 1 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
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");
#line default
#line hidden
WriteLiteral("\r\n<h2>\r\n Documents Imported Today\r\n</h2>\r\n<div");
WriteLiteral(" id=\"importStatus\"");
WriteLiteral(">\r\n <div");
WriteLiteral(" id=\"noSessions\"");
WriteLiteral(" data-bind=\"visible: noSessions\"");
WriteLiteral(">\r\n <h3>\r\n No imported documents today</h3>\r\n </div>\r\n <d" +
"iv");
WriteLiteral(" id=\"sessions\"");
WriteLiteral(" data-bind=\"visible: !noSessions(), foreach: {data: sessions, afterRender: sessio" +
"nRendered}\"");
WriteLiteral("\r\n style=\"display: none\"");
WriteLiteral(">\r\n <div");
WriteLiteral(" class=\"session\"");
WriteLiteral(">\r\n <div");
WriteLiteral(" class=\"clearfix\"");
WriteLiteral(">\r\n <div");
WriteLiteral(" class=\"sessionLeftPane\"");
WriteLiteral(">\r\n <h3>\r\n <span");
WriteLiteral(" data-bind=\"text: title\"");
WriteLiteral("></span>\r\n </h3>\r\n </div>\r\n <div" +
"");
WriteLiteral(" class=\"sessionRightPane\"");
WriteLiteral(">\r\n <p");
WriteLiteral(" class=\"sessionStart\"");
WriteLiteral(" data-bind=\"text: startTime\"");
WriteLiteral(">\r\n </p>\r\n <p");
WriteLiteral(" class=\"sessionStatus\"");
WriteLiteral(" data-bind=\"text: progressStatus\"");
WriteLiteral(">\r\n </p>\r\n <div");
WriteLiteral(" data-bind=\"visible: !sessionEnded(), progressValue: progressValue\"");
WriteLiteral(" class=\"sessionProgress\"");
WriteLiteral(">\r\n </div>\r\n </div>\r\n </div>\r\n " +
" <div");
WriteLiteral(" class=\"sessionPages clearfix\"");
WriteLiteral(" data-bind=\"foreach: {data: sessionPages}\"");
WriteLiteral(">\r\n <div");
WriteLiteral(" class=\"sessionPage\"");
WriteLiteral(" data-bind=\"style: {backgroundImage: thumbnailUrl}\"");
WriteLiteral(">\r\n <div");
WriteLiteral(" class=\"sessionPageDetails\"");
WriteLiteral(">\r\n <h3");
WriteLiteral(" data-bind=\"text: title\"");
WriteLiteral(">\r\n </h3>\r\n <div");
WriteLiteral(" data-bind=\"visible: undetected\"");
WriteLiteral(">\r\n Disco QR-Code not found<br />\r\n " +
" <a");
WriteLiteral(" target=\"_blank\"");
WriteLiteral(" data-bind=\"attr: {href: manuallyAssignUrl}, visible: $parent.sessionEnded\"");
WriteLiteral(">Manually Assign Page</a>\r\n </div>\r\n " +
" <div");
WriteLiteral(" data-bind=\"visible: detected\"");
WriteLiteral(">\r\n Document: <a");
WriteLiteral(" target=\"_blank\"");
WriteLiteral(" data-bind=\"text: documentTemplate, attr: {href: documentTemplateUrl}\"");
WriteLiteral(">\r\n </a>\r\n <br />\r\n " +
" Target: <a");
WriteLiteral(" target=\"_blank\"");
WriteLiteral(" data-bind=\"text: assignedData, attr: {href: assignedDataUrl}\"");
WriteLiteral(">\r\n </a>\r\n </div>\r\n " +
" <div");
WriteLiteral(" data-bind=\"visible: !(detected() || undetected())\"");
WriteLiteral(">\r\n <p");
WriteLiteral(" class=\"sessionStatus\"");
WriteLiteral(" data-bind=\"text: progressStatus\"");
WriteLiteral(">\r\n </p>\r\n <div");
WriteLiteral(" data-bind=\"progressValue: progressValue\"");
WriteLiteral(" class=\"sessionProgress\"");
WriteLiteral(">\r\n </div>\r\n </div>\r\n " +
" </div>\r\n </div>\r\n </div>\r\n <div");
WriteLiteral(" class=\"sessionInfoMessages\"");
WriteLiteral(">\r\n <table");
WriteLiteral(" class=\"logEventsViewport\"");
WriteLiteral(">\r\n <thead>\r\n <tr>\r\n " +
" <th");
WriteLiteral(" class=\"icon\"");
WriteLiteral(">\r\n &nbsp;\r\n </th>\r\n " +
" <th");
WriteLiteral(" class=\"message\"");
WriteLiteral(">\r\n Message\r\n </th>\r\n " +
" </tr>\r\n </thead>\r\n </tab" +
"le>\r\n <div");
WriteLiteral(" class=\"logEventsViewportContainer\"");
WriteLiteral(">\r\n <div");
WriteLiteral(" class=\"logEventsViewportNoLogs\"");
WriteLiteral(" data-bind=\"visible: messages().length == 0\"");
WriteLiteral("\r\n style=\"display: none\"");
WriteLiteral(">\r\n No logs\r\n </div>\r\n " +
" <table");
WriteLiteral(" class=\"logEventsViewport\"");
WriteLiteral(" data-bind=\"visible: messages().length > 0\"");
WriteLiteral(" style=\"display: none\"");
WriteLiteral(">\r\n <tbody");
WriteLiteral(" data-bind=\"foreach: messages\"");
WriteLiteral(">\r\n <tr>\r\n <td");
WriteLiteral(" class=\"icon\"");
WriteLiteral(" data-bind=\"attr: {title: FormattedTimestamp}, css: {information: EventTypeSeveri" +
"ty == 0, warning: EventTypeSeverity == 1, error: EventTypeSeverity == 2}\"");
WriteLiteral(">\r\n &nbsp;\r\n </" +
"td>\r\n <td");
WriteLiteral(" class=\"message\"");
WriteLiteral(" data-bind=\"text: FormattedMessage, attr: {title: EventTypeName}\"");
WriteLiteral(">\r\n </td>\r\n </tr>\r\n " +
" </tbody>\r\n </table>\r\n </di" +
"v>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n<script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
ko.bindingHandlers.progressValue = {
update: function (element, valueAccessor, allBindingsAccessor, viewModel) {
var v = ko.utils.unwrapObservable(valueAccessor());
var vInt = parseInt(v);
if (vInt >= 0) {
$element = $(element);
if (!$element.is('.ui-progressbar'))
$element.progressbar();
$(element).progressbar('option', 'value', vInt);
}
}
};
</script>
<script");
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 = \'");
#line 111 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
Write(Url.Action(MVC.Device.Show()));
#line default
#line hidden
WriteLiteral("/\'\r\n var urlJobShow = \'");
#line 112 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
Write(Url.Action(MVC.Job.Show()));
#line default
#line hidden
WriteLiteral("/\'\r\n var urlUserShow = \'");
#line 113 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
Write(Url.Action(MVC.User.Show()));
#line default
#line hidden
WriteLiteral("/\'\r\n var urlPageThumbnail = \'");
#line 114 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
Write(Url.Action(MVC.API.DocumentTemplate.ImporterThumbnail()));
#line default
#line hidden
WriteLiteral("/\'\r\n var urlDocumentTemplate = \'");
#line 115 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
Write(Url.Action(MVC.Config.DocumentTemplate.Index()));
#line default
#line hidden
WriteLiteral("/\';\r\n var urlManuallyAssign = \'");
#line 116 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
Write(Url.Action(MVC.Config.DocumentTemplate.UndetectedPages()));
#line default
#line hidden
WriteLiteral("\';\r\n var iconErrorUrl = \'url(");
#line 117 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
Write(Links.ClientSource.Style.Images.Status.fail32_png);
#line default
#line hidden
WriteLiteral(")\';\r\n var isLive = false;\r\n\r\n function pageViewModel() {\r\n " +
" var self = this;\r\n\r\n self.noSessions = ko.observable(true);\r\n " +
" self.sessions = ko.observableArray();\r\n self.sessionIndex = {}" +
";\r\n\r\n self.sessionRendered = function (e, d) {\r\n if (!" +
"d.sessionEnded()) {\r\n d.progressbar = $(e).find(\'.sessionProg" +
"ress\').progressbar();\r\n }\r\n };\r\n }\r\n fun" +
"ction sessionViewModel(id) {\r\n var self = this;\r\n\r\n self.t" +
"itle = ko.observable(id);\r\n self.messages = ko.observableArray();\r\n " +
" self.progressStatus = ko.observable();\r\n self.progressValue" +
" = ko.observable();\r\n self.startTime = ko.observable();\r\n " +
"self.sessionEnded = ko.observable(false);\r\n\r\n self.sessionPages = ko." +
"observableArray();\r\n self.sessionPagesIndex = {};\r\n self.a" +
"ddSessionPage = function (sessionPage) {\r\n //if (isLive) {\r\n " +
" self.sessionPages.push(sessionPage);\r\n self.sessionPag" +
"esIndex[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.progress" +
"Value = ko.observable();\r\n self.undetected = ko.observable(false);\r\n " +
" self.detected = ko.observable(false);\r\n self.documentTempl" +
"ateId = ko.observable();\r\n self.documentTemplate = ko.observable();\r\n" +
" self.assignedDataType = ko.observable();\r\n self.assignedD" +
"ataId = ko.observable();\r\n self.assignedData = ko.observable();\r\n " +
" self.thumbnailEnabled = ko.observable(0);\r\n self.updateThumbn" +
"ail = function () {\r\n self.thumbnailEnabled(self.thumbnailEnabled" +
"() + 1);\r\n }\r\n self.documentTemplateUrl = ko.computed(func" +
"tion () {\r\n return urlDocumentTemplate + self.documentTemplateId(" +
");\r\n });\r\n self.manuallyAssignUrl = ko.computed(function (" +
") {\r\n return urlManuallyAssign + \'#\' + self.sessionId + \'_\' + sel" +
"f.pageNumber;\r\n });\r\n self.assignedDataUrl = ko.computed(f" +
"unction () {\r\n var t = self.assignedDataType();\r\n " +
"var dId = self.assignedDataId();\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 return urlUserShow + dId;\r" +
"\n }\r\n return null;\r\n });\r\n s" +
"elf.thumbnailUrl = ko.computed(function () {\r\n var enabled = self" +
".thumbnailEnabled();\r\n if (enabled > 0) {\r\n re" +
"turn \'url(\' + urlPageThumbnail + \'?SessionId=\' + self.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.Arguments && log.Arguments.length" +
" > 0) {\r\n // find session\r\n var sessionId = log.Ar" +
"guments[0];\r\n var session = vm.sessionIndex[sessionId];\r\n " +
" if (!session && log.EventTypeId === 10) { // Starting Session (Ignore \'p" +
"artial\' sessions)\r\n session = new sessionViewModel(log.Argume" +
"nts[1]);\r\n vm.sessionIndex[sessionId] = 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.FormattedTimestamp.substring(log.Fo" +
"rmattedTimestamp.indexOf(\' \') + 1));\r\n break;\r\n " +
" case 11: // SessionProgress\r\n sessi" +
"on.progressValue(log.Arguments[1]);\r\n session.progres" +
"sStatus(log.Arguments[2]);\r\n break;\r\n " +
" case 12: // SessionFinished\r\n session.session" +
"Ended(true);\r\n session.progressStatus(\'Import Finishe" +
"d\');\r\n break;\r\n case 15: // Se" +
"ssionWarning\r\n session.messages.unshift(log);\r\n " +
" break;\r\n case 16: // SessionError\r\n" +
" session.messages.unshift(log);\r\n " +
" break;\r\n case 100: // ImportPageStarting\r\n " +
" session.addSessionPage(new sessionPageViewModel(sessionId, " +
"log.Arguments[1]));\r\n break;\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: // Impor" +
"tPageProgress\r\n var p = session.sessionPagesIndex[log" +
".Arguments[1]];\r\n if (p) {\r\n " +
" p.progressValue(log.Arguments[2]);\r\n p.pro" +
"gressStatus(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.documentTe" +
"mplateId(log.Arguments[2]);\r\n p.documentTemplate(" +
"log.Arguments[3]);\r\n p.assignedDataType(log.Argum" +
"ents[4]);\r\n p.assignedDataId(log.Arguments[5]);\r\n" +
" p.assignedData(log.Arguments[6]);\r\n " +
" p.detected(true);\r\n if (!isLiv" +
"e) {\r\n p.updateThumbnail();\r\n " +
" }\r\n }\r\n se" +
"ssion.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.updateThumbnail(" +
");\r\n }\r\n }\r\n " +
" session.messages.unshift(log);\r\n br" +
"eak;\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 // C" +
"reate View Model\r\n vm = new pageViewModel();\r\n\r\n // Load L" +
"ogs\r\n var d = new Date();\r\n var loadData = {\r\n " +
" Format: \"json\",\r\n Start: d.getFullYear() + \'-\' + (d.getMonth(" +
") + 1) + \'-\' + d.getDate(),\r\n End: null,\r\n ModuleI" +
"d: 40,\r\n Take: 2000\r\n };\r\n $.ajax({\r\n " +
" url: \'");
#line 292 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
Write(Url.Action(MVC.API.Logging.RetrieveEvents()));
#line default
#line hidden
WriteLiteral(@"',
dataType: 'json',
type: 'POST',
traditional: true,
data: loadData,
success: init_loadedLogs,
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to retrieve logs: ' + errorThrown);
}
});
}
function init_loadedLogs(logs) {
logs.reverse();
for (var i = 0; i < logs.length; i++) {
parseLog(logs[i]);
}
// Bind
ko.applyBindings(vm);
// Init Persistent Connection
liveConnection = $.connection('");
#line 312 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
Write(Url.Content("~/API/Logging/Notifications"));
#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(function () {
liveConnection.send('/addToGroups:");
#line 317 "..\..\Areas\Config\Views\DocumentTemplate\ImportStatus.cshtml"
Write(Disco.BI.DocumentTemplateBI.Importer.DocumentImporterLog.Current.LiveLogGroupName);
#line default
#line hidden
WriteLiteral("\');\r\n });\r\n }\r\n init();\r\n });\r\n</script>\r\n");
}
}
}
#pragma warning restore 1591
@@ -1,362 +1,362 @@
@model Disco.Web.Areas.Config.Models.DocumentTemplate.ShowModel
@{
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Document Templates", MVC.Config.DocumentTemplate.Index(null), Model.DocumentTemplate.Description);
}
<div class="form" style="width: 650px">
<table>
<tr>
<th>
Id:
</th>
<td>@Html.DisplayFor(model => model.DocumentTemplate.Id)
</td>
</tr>
<tr>
<th>
Stored Instances:
</th>
<td>@Html.DisplayFor(model => model.StoredInstanceCount)
</td>
</tr>
<tr>
<th>
Description:
</th>
<td>@Html.TextBoxFor(model => model.DocumentTemplate.Description)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
var $Description = $('#DocumentTemplate_Description');
var $DescriptionAjaxSave = $Description.next('.ajaxSave');
$Description
.watermark('Description')
.focus(function () { $Description.select() })
.keydown(function (e) {
$DescriptionAjaxSave.show();
if (e.which == 13) {
$(this).blur();
}
}).blur(function () {
$DescriptionAjaxSave.hide();
})
.change(function () {
$DescriptionAjaxSave.hide();
var $ajaxLoading = $DescriptionAjaxSave.next('.ajaxLoading').show();
var data = { Description: $Description.val() };
$.ajax({
url: '@Url.Action(MVC.API.DocumentTemplate.UpdateDescription(Model.DocumentTemplate.Id))',
dataType: 'json',
data: data,
success: function (d) {
if (d == 'OK') {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
} else {
$ajaxLoading.hide();
alert('Unable to update description: ' + d);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update description: ' + textStatus);
$ajaxLoading.hide();
}
});
});
});
</script>
</td>
</tr>
<tr>
<th>
Always Flatten Form:
</th>
<td>
<input id="DocumentTemplate_FlattenForm" type="checkbox" @(Model.DocumentTemplate.FlattenForm ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty))/>
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
$('#DocumentTemplate_FlattenForm').click(function () {
var $this = $(this);
var $ajaxLoading = $this.next('.ajaxLoading').show();
var data = { FlattenForm: $this.is(':checked') };
$.getJSON('@(Url.Action(MVC.API.DocumentTemplate.UpdateFlattenForm(Model.DocumentTemplate.Id)))', data, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Flatten Form:\n' + response);
$ajaxLoading.hide();
} else {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
});
});
});
</script>
</td>
</tr>
<tr>
<th>
Scope:
</th>
<td>
@Html.DropDownListFor(model => model.DocumentTemplate.Scope, Model.Scopes.ToSelectListItems(null))
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
var $scope = $('#DocumentTemplate_Scope');
$scope.change(function () {
var $ajaxLoading = $scope.next('.ajaxLoading').show();
var data = { Scope: $scope.val() };
$.ajax({
url: '@Url.Action(MVC.API.DocumentTemplate.UpdateScope(Model.DocumentTemplate.Id))',
dataType: 'json',
data: data,
success: function (d) {
if (d == 'OK') {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
scopeChange();
} else {
$ajaxLoading.hide();
alert('Unable to update scope: ' + d);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update scope: ' + textStatus);
$ajaxLoading.hide();
}
});
});
var $trJobTypes = $('#trJobTypes');
var $trJobTypeActions = $('#trJobTypeActions');
var $jobTypes = $trJobTypes.find('input[type="checkbox"]');
$jobTypes.change(jobTypesChange);
function scopeChange() {
if ($scope.val() == 'Job') {
$trJobTypes.show();
$trJobTypeActions.show();
jobTypesChange();
} else {
$trJobTypes.hide();
$trJobTypeActions.hide();
$jobTypes.filter(':checked').each(function () {
$(this).attr('checked', false);
});
$('.jobSubTypes').hide().find('input[type="checkbox"]:checked').each(function () {
$(this).attr('checked', false);
});
}
}
function jobTypesChange() {
$('.jobSubTypes').hide();
$jobTypes.filter(':checked').each(function () {
$('#trJobSubType' + $(this).val()).show();
});
}
$('#TypeAction_Save').click(function () {
var data = { SubTypes: [] };
var $ajaxLoading = $('#TypeAction_Save').next('.ajaxLoading').show();
$jobTypes.filter(':checked').each(function () {
var $this = $(this);
$('#trJobSubType' + $this.val()).find('input[type="checkbox"]:checked').each(function () {
data.SubTypes.push($(this).val());
});
});
$.ajax({
url: '@Url.Action(MVC.API.DocumentTemplate.UpdateSubTypes(Model.DocumentTemplate.Id))',
dataType: 'json',
type: 'POST',
traditional: true,
data: data,
success: function (d) {
if (d == 'OK') {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
scopeChange();
} else {
$ajaxLoading.hide();
alert('Unable to update job types: ' + d);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update job types: ' + textStatus);
$ajaxLoading.hide();
}
});
return false;
});
scopeChange();
});
</script>
</td>
</tr>
<tr id="trJobTypes">
<th class="name">
Types:
</th>
<td class="value">
@CommonHelpers.CheckBoxList("Types", Model.JobTypes.ToSelectListItems(Model.Types), 2)
</td>
</tr>
@foreach (var jt in Model.JobTypes)
{
<tr id="trJobSubType@(jt.Id)" class="jobSubTypes">
<th class="name">
@jt.Description<br />
Sub Types<br />
@CommonHelpers.CheckboxBulkSelect(string.Format("CheckboxBulkSelect_{0}", jt.Id))
</th>
<td class="value">
@CommonHelpers.CheckBoxList("SubTypes", Model.JobSubTypes.Where(jst => jst.JobTypeId == jt.Id).ToList().ToSelectListItems(Model.SubTypes), 2)
</td>
</tr>
}
<tr id="trJobTypeActions">
<th class="name">
</th>
<td class="value">
<a id="TypeAction_Save" href="#" class="button">Save Job Types</a>@AjaxHelpers.AjaxLoader()
</td>
</tr>
<tr>
<th>
Template PDF
</th>
<td>
@Html.ActionLink("Download Template", MVC.API.DocumentTemplate.Template(Model.DocumentTemplate.Id))
<br />
@using (Html.BeginForm(MVC.API.DocumentTemplate.Template(Model.DocumentTemplate.Id, true, null), FormMethod.Post, new { enctype = "multipart/form-data" }))
{
<input type="file" name="Template" id="Template" style="width: 250px;" />
<input class="button" type="submit" value="Upload" />
}
<script type="text/javascript">
$(function () {
var $template = $('#Template');
$template.closest('form').submit(function () {
if ($template.val() == '') {
alert('A template file is required to upload.');
return false;
}
});
});
</script>
</td>
</tr>
<tr>
<th>
Filter Expression:
</th>
<td>@Html.TextBoxFor(model => model.DocumentTemplate.FilterExpression)
@AjaxHelpers.AjaxRemove()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
var $FilterExpression = $('#DocumentTemplate_FilterExpression');
var $ajaxLoading = $FilterExpression.nextAll('.ajaxLoading').first();
var $ajaxRemove = $FilterExpression.nextAll('.ajaxRemove').first();
$FilterExpression
.watermark('Filter Expression')
.focus(function () { $FilterExpression.select() })
.keydown(function (e) {
if (e.which == 13) {
$(this).blur();
}
}).change(function () {
updateFilterExpression($FilterExpression.val());
});
if ($FilterExpression.val() != '')
$ajaxRemove.show();
$ajaxRemove.click(function () {
updateFilterExpression('');
$FilterExpression.val('');
});
var updateFilterExpression = function (filterExpression) {
$ajaxLoading.show();
$ajaxRemove.hide();
var data = { FilterExpression: filterExpression };
$.ajax({
url: '@Url.Action(MVC.API.DocumentTemplate.UpdateFilterExpression(Model.DocumentTemplate.Id))',
dataType: 'json',
data: data,
success: function (d) {
if (d == 'OK') {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
if (data.FilterExpression != '')
$ajaxRemove.fadeIn('fast');
} else {
$ajaxLoading.hide();
alert('Unable to update filter expression: ' + d);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update filter expression: ' + textStatus);
$ajaxLoading.hide();
}
});
};
});
</script>
</td>
</tr>
<tr>
<th>
Bulk Generate
</th>
<td>
@using (Html.BeginForm(MVC.API.DocumentTemplate.BulkGenerate(Model.DocumentTemplate.Id), FormMethod.Post))
{
<textarea name="DataIds"></textarea>
<input class="button" type="submit" value="Generate" />
}
</td>
</tr>
</table>
</div>
<h2>
Template Expressions</h2>
@Html.Partial(MVC.Config.DocumentTemplate.Views._ExpressionsTable, Model.TemplateExpressions)
<div id="dialogConfirmDelete" title="Delete this Document Template?">
<p>
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 100px 0;">
</span>This item will be permanently deleted and cannot be recovered.<br />
<em>This <strong>will not delete attachments</strong> which have already been imported,
but any generated documents will no longer be automatically imported.</em><br />
Are you sure?</p>
</div>
<script type="text/javascript">
$(function () {
var button = $('#buttonDelete');
var buttonDialog = $("#dialogConfirmDelete");
var buttonLink = button.attr('href');
button.attr('href', '#');
button.click(function () {
buttonDialog.dialog('open');
return false;
});
buttonDialog.dialog({
resizable: false,
modal: true,
autoOpen: false,
buttons: {
"Delete": function () {
$this = $(this);
$this.dialog('disable');
$this.dialog("option", "buttons", null);
window.location.href = buttonLink;
},
Cancel: function () {
$(this).dialog("close");
}
}
});
});
</script>
<div class="actionBar">
@Html.ActionLinkButton("Expression Browser", MVC.Config.DocumentTemplate.ExpressionBrowser())
@Html.ActionLinkButton("Delete", MVC.API.DocumentTemplate.Delete(Model.DocumentTemplate.Id, true), "buttonDelete")
</div>
@model Disco.Web.Areas.Config.Models.DocumentTemplate.ShowModel
@{
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Document Templates", MVC.Config.DocumentTemplate.Index(null), Model.DocumentTemplate.Description);
}
<div class="form" style="width: 650px">
<table>
<tr>
<th>
Id:
</th>
<td>@Html.DisplayFor(model => model.DocumentTemplate.Id)
</td>
</tr>
<tr>
<th>
Stored Instances:
</th>
<td>@Html.DisplayFor(model => model.StoredInstanceCount)
</td>
</tr>
<tr>
<th>
Description:
</th>
<td>@Html.TextBoxFor(model => model.DocumentTemplate.Description)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
var $Description = $('#DocumentTemplate_Description');
var $DescriptionAjaxSave = $Description.next('.ajaxSave');
$Description
.watermark('Description')
.focus(function () { $Description.select() })
.keydown(function (e) {
$DescriptionAjaxSave.show();
if (e.which == 13) {
$(this).blur();
}
}).blur(function () {
$DescriptionAjaxSave.hide();
})
.change(function () {
$DescriptionAjaxSave.hide();
var $ajaxLoading = $DescriptionAjaxSave.next('.ajaxLoading').show();
var data = { Description: $Description.val() };
$.ajax({
url: '@Url.Action(MVC.API.DocumentTemplate.UpdateDescription(Model.DocumentTemplate.Id))',
dataType: 'json',
data: data,
success: function (d) {
if (d == 'OK') {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
} else {
$ajaxLoading.hide();
alert('Unable to update description: ' + d);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update description: ' + textStatus);
$ajaxLoading.hide();
}
});
});
});
</script>
</td>
</tr>
<tr>
<th>
Always Flatten Form:
</th>
<td>
<input id="DocumentTemplate_FlattenForm" type="checkbox" @(Model.DocumentTemplate.FlattenForm ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty))/>
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
$('#DocumentTemplate_FlattenForm').click(function () {
var $this = $(this);
var $ajaxLoading = $this.next('.ajaxLoading').show();
var data = { FlattenForm: $this.is(':checked') };
$.getJSON('@(Url.Action(MVC.API.DocumentTemplate.UpdateFlattenForm(Model.DocumentTemplate.Id)))', data, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Flatten Form:\n' + response);
$ajaxLoading.hide();
} else {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
});
});
});
</script>
</td>
</tr>
<tr>
<th>
Scope:
</th>
<td>
@Html.DropDownListFor(model => model.DocumentTemplate.Scope, Model.Scopes.ToSelectListItems(null))
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
var $scope = $('#DocumentTemplate_Scope');
$scope.change(function () {
var $ajaxLoading = $scope.next('.ajaxLoading').show();
var data = { Scope: $scope.val() };
$.ajax({
url: '@Url.Action(MVC.API.DocumentTemplate.UpdateScope(Model.DocumentTemplate.Id))',
dataType: 'json',
data: data,
success: function (d) {
if (d == 'OK') {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
scopeChange();
} else {
$ajaxLoading.hide();
alert('Unable to update scope: ' + d);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update scope: ' + textStatus);
$ajaxLoading.hide();
}
});
});
var $trJobTypes = $('#trJobTypes');
var $trJobTypeActions = $('#trJobTypeActions');
var $jobTypes = $trJobTypes.find('input[type="checkbox"]');
$jobTypes.change(jobTypesChange);
function scopeChange() {
if ($scope.val() == 'Job') {
$trJobTypes.show();
$trJobTypeActions.show();
jobTypesChange();
} else {
$trJobTypes.hide();
$trJobTypeActions.hide();
$jobTypes.filter(':checked').each(function () {
$(this).prop('checked', false);
});
$('.jobSubTypes').hide().find('input[type="checkbox"]:checked').each(function () {
$(this).prop('checked', false);
});
}
}
function jobTypesChange() {
$('.jobSubTypes').hide();
$jobTypes.filter(':checked').each(function () {
$('#trJobSubType' + $(this).val()).show();
});
}
$('#TypeAction_Save').click(function () {
var data = { SubTypes: [] };
var $ajaxLoading = $('#TypeAction_Save').next('.ajaxLoading').show();
$jobTypes.filter(':checked').each(function () {
var $this = $(this);
$('#trJobSubType' + $this.val()).find('input[type="checkbox"]:checked').each(function () {
data.SubTypes.push($(this).val());
});
});
$.ajax({
url: '@Url.Action(MVC.API.DocumentTemplate.UpdateSubTypes(Model.DocumentTemplate.Id))',
dataType: 'json',
type: 'POST',
traditional: true,
data: data,
success: function (d) {
if (d == 'OK') {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
scopeChange();
} else {
$ajaxLoading.hide();
alert('Unable to update job types: ' + d);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update job types: ' + textStatus);
$ajaxLoading.hide();
}
});
return false;
});
scopeChange();
});
</script>
</td>
</tr>
<tr id="trJobTypes">
<th class="name">
Types:
</th>
<td class="value">
@CommonHelpers.CheckBoxList("Types", Model.JobTypes.ToSelectListItems(Model.Types), 2)
</td>
</tr>
@foreach (var jt in Model.JobTypes)
{
<tr id="trJobSubType@(jt.Id)" class="jobSubTypes">
<th class="name">
@jt.Description<br />
Sub Types<br />
@CommonHelpers.CheckboxBulkSelect(string.Format("CheckboxBulkSelect_{0}", jt.Id))
</th>
<td class="value">
@CommonHelpers.CheckBoxList("SubTypes", Model.JobSubTypes.Where(jst => jst.JobTypeId == jt.Id).ToList().ToSelectListItems(Model.SubTypes), 2)
</td>
</tr>
}
<tr id="trJobTypeActions">
<th class="name">
</th>
<td class="value">
<a id="TypeAction_Save" href="#" class="button">Save Job Types</a>@AjaxHelpers.AjaxLoader()
</td>
</tr>
<tr>
<th>
Template PDF
</th>
<td>
@Html.ActionLink("Download Template", MVC.API.DocumentTemplate.Template(Model.DocumentTemplate.Id))
<br />
@using (Html.BeginForm(MVC.API.DocumentTemplate.Template(Model.DocumentTemplate.Id, true, null), FormMethod.Post, new { enctype = "multipart/form-data" }))
{
<input type="file" name="Template" id="Template" style="width: 250px;" />
<input class="button" type="submit" value="Upload" />
}
<script type="text/javascript">
$(function () {
var $template = $('#Template');
$template.closest('form').submit(function () {
if ($template.val() == '') {
alert('A template file is required to upload.');
return false;
}
});
});
</script>
</td>
</tr>
<tr>
<th>
Filter Expression:
</th>
<td>@Html.TextBoxFor(model => model.DocumentTemplate.FilterExpression)
@AjaxHelpers.AjaxRemove()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
var $FilterExpression = $('#DocumentTemplate_FilterExpression');
var $ajaxLoading = $FilterExpression.nextAll('.ajaxLoading').first();
var $ajaxRemove = $FilterExpression.nextAll('.ajaxRemove').first();
$FilterExpression
.watermark('Filter Expression')
.focus(function () { $FilterExpression.select() })
.keydown(function (e) {
if (e.which == 13) {
$(this).blur();
}
}).change(function () {
updateFilterExpression($FilterExpression.val());
});
if ($FilterExpression.val() != '')
$ajaxRemove.show();
$ajaxRemove.click(function () {
updateFilterExpression('');
$FilterExpression.val('');
});
var updateFilterExpression = function (filterExpression) {
$ajaxLoading.show();
$ajaxRemove.hide();
var data = { FilterExpression: filterExpression };
$.ajax({
url: '@Url.Action(MVC.API.DocumentTemplate.UpdateFilterExpression(Model.DocumentTemplate.Id))',
dataType: 'json',
data: data,
success: function (d) {
if (d == 'OK') {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
if (data.FilterExpression != '')
$ajaxRemove.fadeIn('fast');
} else {
$ajaxLoading.hide();
alert('Unable to update filter expression: ' + d);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update filter expression: ' + textStatus);
$ajaxLoading.hide();
}
});
};
});
</script>
</td>
</tr>
<tr>
<th>
Bulk Generate
</th>
<td>
@using (Html.BeginForm(MVC.API.DocumentTemplate.BulkGenerate(Model.DocumentTemplate.Id), FormMethod.Post))
{
<textarea name="DataIds"></textarea>
<input class="button" type="submit" value="Generate" />
}
</td>
</tr>
</table>
</div>
<h2>
Template Expressions</h2>
@Html.Partial(MVC.Config.DocumentTemplate.Views._ExpressionsTable, Model.TemplateExpressions)
<div id="dialogConfirmDelete" title="Delete this Document Template?">
<p>
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 100px 0;">
</span>This item will be permanently deleted and cannot be recovered.<br />
<em>This <strong>will not delete attachments</strong> which have already been imported,
but any generated documents will no longer be automatically imported.</em><br />
Are you sure?</p>
</div>
<script type="text/javascript">
$(function () {
var button = $('#buttonDelete');
var buttonDialog = $("#dialogConfirmDelete");
var buttonLink = button.attr('href');
button.attr('href', '#');
button.click(function () {
buttonDialog.dialog('open');
return false;
});
buttonDialog.dialog({
resizable: false,
modal: true,
autoOpen: false,
buttons: {
"Delete": function () {
$this = $(this);
$this.dialog('disable');
$this.dialog("option", "buttons", null);
window.location.href = buttonLink;
},
Cancel: function () {
$(this).dialog("close");
}
}
});
});
</script>
<div class="actionBar">
@Html.ActionLinkButton("Expression Browser", MVC.Config.DocumentTemplate.ExpressionBrowser())
@Html.ActionLinkButton("Delete", MVC.API.DocumentTemplate.Delete(Model.DocumentTemplate.Id, true), "buttonDelete")
</div>
File diff suppressed because it is too large Load Diff
@@ -1,370 +1,370 @@
@{
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Enrolment", MVC.Config.Enrolment.Index(), "Status");
Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR");
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-Isotope");
}
<div id="enrolStatus">
<div id="noSessions" data-bind="visible: noSessions">
<h2>
No enrolment sessions today</h2>
</div>
<div id="sessions" data-bind="visible: !noSessions(), foreach: {data: sessions, afterRender: sessionRendered, afterAdd: sessionAdded}"
style="display: none">
<div class="session" data-bind="style: {backgroundImage: deviceModelImageUrl}, click: select">
<h3>
<span data-bind="text: title"></span><span class="details" data-bind="text: '(' + deviceModelDescription() + ')'">
</span>
</h3>
<p class="sessionStart" data-bind="text: startTime">
</p>
<p class="sessionStatus" data-bind="text: progressStatus">
</p>
<div data-bind="visible: !sessionEnded(), progressValue: progressValue" class="sessionProgress">
</div>
</div>
</div>
<div id="dialogSession" data-bind="with: currentSession">
<div class="sessionHeader clearfix" data-bind="style: {backgroundImage: deviceModelImageUrl}">
<h2>
<a href="" target="_blank" data-bind="text: title, attr: {href: deviceUrl}"></a>
</h2>
<h3 data-bind="text: deviceModelDescription">
</h3>
<table data-bind="if: sessionDeviceInfo">
<tr>
<th style="width: 128px">
Computer Name:
</th>
<td data-bind="text: sessionDeviceInfo().Arguments[3]">
</td>
</tr>
<tr>
<th style="width: 128px">
UUID:
</th>
<td data-bind="text: sessionDeviceInfo().Arguments[2]">
</td>
</tr>
<tr>
<th style="width: 128px">
LAN Mac Address:
</th>
<td data-bind="text: sessionDeviceInfo().Arguments[4]">
</td>
</tr>
<tr>
<th style="width: 128px">
WLAN Mac Address:
</th>
<td data-bind="text: sessionDeviceInfo().Arguments[5]">
</td>
</tr>
<tr>
<th style="width: 128px">
Manufacturer/Model:
</th>
<td data-bind="text: sessionDeviceInfo().Arguments[6] + ' ' + sessionDeviceInfo().Arguments[7]">
</td>
</tr>
</table>
</div>
<div class="sessionProgress clearfix">
<p class="sessionStart" data-bind="text: startTime">
</p>
<p class="sessionStatus" data-bind="text: progressStatus">
</p>
<div data-bind="visible: !sessionEnded(), progressValue: progressValue">
</div>
</div>
<div class="sessionInfoContainer clearfix">
<div class="sessionInfoMessages">
<table class="logEventsViewport">
<thead>
<tr>
<th class="icon">
&nbsp;
</th>
<th class="message">
Message
</th>
</tr>
</thead>
</table>
<div class="logEventsViewportContainer">
<div class="logEventsViewportNoLogs" data-bind="visible: messages().length == 0"
style="display: none">
No logs
</div>
<table class="logEventsViewport" data-bind="visible: messages().length > 0" style="display: none">
<tbody data-bind="foreach: messages">
<tr>
<td class="icon" data-bind="attr: {title: FormattedTimestamp}, css: {information: EventTypeSeverity == 0, warning: EventTypeSeverity == 1, error: EventTypeSeverity == 2}">
&nbsp;
</td>
<td class="message" data-bind="text: FormattedMessage, attr: {title: EventTypeName}">
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="sessionInfoConsole" data-bind="foreach: console">
<span data-bind="text: Arguments[1]"></span>
</div>
</div>
</div>
</div>
<script type="text/javascript">
ko.bindingHandlers.progressValue = {
update: function (element, valueAccessor, allBindingsAccessor, viewModel) {
var v = ko.utils.unwrapObservable(valueAccessor());
var vInt = parseInt(v);
if (vInt >= 0) {
$element = $(element);
if (!$element.is('.ui-progressbar'))
$element.progressbar();
$(element).progressbar('option', 'value', vInt);
}
}
};
</script>
<script type="text/javascript">
$(function () {
var vm;
var host = $('#enrolStatus');
var hostSessions = $('#sessions');
var hostDialogSessions = $('#dialogSession');
//var hostDialogSessionsProgress = $('#dialogSession').find('.sessionProgress');
var deviceModels = {};
var liveConnection;
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))';
var iconErrorUrl = 'url(@(Links.ClientSource.Style.Images.Status.fail32_png))';
function pageViewModel() {
var self = this;
self.noSessions = ko.observable(true);
self.sessions = ko.observableArray();
self.sessionIndex = {};
self.isotopeInited = false;
self.currentSession = ko.observable();
self.sessionRendered = function (e, d) {
if (!d.sessionEnded()) {
d.progressbar = $(e).find('.sessionProgress').progressbar();
}
};
self.sessionAdded = function (e, d) {
if (self.isotopeInited) {
hostSessions.isotope('reloadItems').isotope({ sortBy: 'original-order' });
}
};
}
function sessionViewModel(id) {
var self = this;
self.title = ko.observable(id);
self.messages = ko.observableArray();
self.console = ko.observableArray();
self.serialNumber = ko.observable();
self.sessionDeviceInfo = ko.observable();
self.progressStatus = ko.observable();
self.progressValue = ko.observable();
self.startTime = ko.observable();
self.sessionEnded = ko.observable(false);
self.progressbar = null;
self.hasError = ko.observable(false);
self.hasWarning = ko.observable(false);
self.deviceModelId = ko.observable();
self.deviceModelDescription = ko.computed(function () {
var deviceModelId = self.deviceModelId();
var sessionDeviceInfo = self.sessionDeviceInfo();
if (deviceModelId) {
var dm = deviceModels[deviceModelId];
if (dm) {
if (dm.Description)
return dm.Description;
else
return dm.Manufacturer + ' ' + dm.Model;
}
}
if (sessionDeviceInfo) {
return sessionDeviceInfo.Arguments[6] + ' ' + sessionDeviceInfo.Arguments[7];
}
});
self.deviceUrl = ko.computed(function () {
var serialNumber = self.serialNumber();
if (serialNumber)
return deviceBaseUrl + serialNumber;
else
return null;
});
self.deviceModelImageUrl = ko.computed(function () {
var deviceModelImage;
if (self.deviceModelId())
deviceModelImage = 'url(' + deviceModelImageUrl + self.deviceModelId() + ')';
else
deviceModelImage = 'url(' + deviceModelImageUrl + ')';
if (self.hasError())
return iconErrorUrl + ', ' + deviceModelImage;
else
if (self.hasWarning())
return iconWarningUrl + ', ' + deviceModelImage;
else
return 'none, ' + deviceModelImage;
});
self.select = function (e, d) {
vm.currentSession(self);
hostDialogSessions.dialog('open');
hostDialogSessions.dialog('option', 'title', 'Device Enrolment: ' + self.title());
}
}
function parseLog(log) {
if (log.ModuleId === 50 && log.Arguments && log.Arguments.length > 0) {
// find session
var sessionId = log.Arguments[0];
var session = vm.sessionIndex[sessionId];
if (!session && log.EventTypeId === 10) { // Starting Session (Ignore 'partial' sessions)
session = new sessionViewModel(sessionId);
vm.sessionIndex[sessionId] = session;
vm.sessions.unshift(session);
vm.noSessions(false);
}
if (session) {
switch (log.EventTypeId) {
case 10: // SessionStarting
session.title(log.Arguments[1]);
session.startTime(log.FormattedTimestamp.substring(log.FormattedTimestamp.indexOf(' ') + 1));
session.messages.unshift(log);
break;
case 11: // SessionProgress
//session.progressbar.progressbar('option', 'value', log.Arguments[1]);
session.progressValue(log.Arguments[1]);
session.progressStatus(log.Arguments[2]);
break;
case 12: // SessionDevice
session.title(log.Arguments[1]);
session.serialNumber(log.Arguments[1]);
if (log.Arguments.length >= 3 && log.Arguments[2])
session.deviceModelId(log.Arguments[2]);
break;
break;
case 13: // SessionDeviceInfo
session.title(log.Arguments[1]);
session.serialNumber(log.Arguments[1]);
session.sessionDeviceInfo(log);
if (log.Arguments.length >= 10 && log.Arguments[9])
session.deviceModelId(log.Arguments[9]);
break;
case 20: // SessionFinished
session.sessionEnded(true);
if (session.hasError())
session.progressStatus('Enrolment Finished with an Error');
else
if (session.hasWarning())
session.progressStatus('Enrolment Finished with a Warning');
else
session.progressStatus('Enrolment Finished Successfully');
session.messages.unshift(log);
break;
case 21: // SessionDiagnosticInformation
session.console.push(log);
break;
case 22: // SessionWarning
session.hasWarning(true);
session.messages.unshift(log);
break;
case 23: // SessionError
case 24: // SessionErrorWithInner
case 25: // SessionClientError
session.hasError(true);
session.messages.unshift(log);
break;
default:
session.messages.unshift(log);
}
}
}
}
function init() {
hostDialogSessions.dialog({
modal: true,
height: 664,
width: 900,
resizable: false,
autoOpen: false,
buttons: { 'Close': function () { $(this).dialog('close'); } }
});
//hostDialogSessionsProgress.progressbar();
// Create View Model
vm = new pageViewModel();
$.ajax({
url: '@(Url.Action(MVC.API.DeviceModel.Index()))',
dataType: 'json',
type: 'POST',
success: init_loadedDeviceModels,
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to retrieve device models: ' + errorThrown);
}
});
}
function init_loadedDeviceModels(models) {
for (var i = 0; i < models.length; i++) {
var m = models[i];
deviceModels[m.Id] = m;
}
// Load Logs
var d = new Date();
var loadData = {
Format: "json",
Start: d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate(),
End: null,
ModuleId: 50,
Take: 2000
};
$.ajax({
url: '@(Url.Action(MVC.API.Logging.RetrieveEvents()))',
dataType: 'json',
type: 'POST',
traditional: true,
data: loadData,
success: init_loadedLogs,
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to retrieve logs: ' + errorThrown);
}
});
}
function init_loadedLogs(logs) {
logs.reverse();
for (var i = 0; i < logs.length; i++) {
parseLog(logs[i]);
}
// Bind
ko.applyBindings(vm);
// Isotope
hostSessions.isotope({
itemSelector: '.session',
layoutMode: 'fitRows'
});
vm.isotopeInited = true;
// Init Persistent Connection
liveConnection = $.connection('@(Url.Content("~/API/Logging/Notifications"))');
liveConnection.received(parseLog);
liveConnection.error(function (e) { alert('Live-Log Error: ' + e) });
liveConnection.start(function () {
liveConnection.send('/addToGroups:@(Disco.BI.DeviceBI.EnrolmentLog.Current.LiveLogGroupName)');
});
}
init();
});
</script>
@{
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Enrolment", MVC.Config.Enrolment.Index(), "Status");
Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR");
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-Isotope");
}
<div id="enrolStatus">
<div id="noSessions" data-bind="visible: noSessions">
<h2>
No enrolment sessions today</h2>
</div>
<div id="sessions" data-bind="visible: !noSessions(), foreach: {data: sessions, afterRender: sessionRendered, afterAdd: sessionAdded}"
style="display: none">
<div class="session" data-bind="style: {backgroundImage: deviceModelImageUrl}, click: select">
<h3>
<span data-bind="text: title"></span><span class="details" data-bind="text: '(' + deviceModelDescription() + ')'">
</span>
</h3>
<p class="sessionStart" data-bind="text: startTime">
</p>
<p class="sessionStatus" data-bind="text: progressStatus">
</p>
<div data-bind="visible: !sessionEnded(), progressValue: progressValue" class="sessionProgress">
</div>
</div>
</div>
<div id="dialogSession" data-bind="with: currentSession">
<div class="sessionHeader clearfix" data-bind="style: {backgroundImage: deviceModelImageUrl}">
<h2>
<a href="" target="_blank" data-bind="text: title, attr: {href: deviceUrl}"></a>
</h2>
<h3 data-bind="text: deviceModelDescription">
</h3>
<table data-bind="if: sessionDeviceInfo">
<tr>
<th style="width: 128px">
Computer Name:
</th>
<td data-bind="text: sessionDeviceInfo().Arguments[3]">
</td>
</tr>
<tr>
<th style="width: 128px">
UUID:
</th>
<td data-bind="text: sessionDeviceInfo().Arguments[2]">
</td>
</tr>
<tr>
<th style="width: 128px">
LAN Mac Address:
</th>
<td data-bind="text: sessionDeviceInfo().Arguments[4]">
</td>
</tr>
<tr>
<th style="width: 128px">
WLAN Mac Address:
</th>
<td data-bind="text: sessionDeviceInfo().Arguments[5]">
</td>
</tr>
<tr>
<th style="width: 128px">
Manufacturer/Model:
</th>
<td data-bind="text: sessionDeviceInfo().Arguments[6] + ' ' + sessionDeviceInfo().Arguments[7]">
</td>
</tr>
</table>
</div>
<div class="sessionProgress clearfix">
<p class="sessionStart" data-bind="text: startTime">
</p>
<p class="sessionStatus" data-bind="text: progressStatus">
</p>
<div data-bind="visible: !sessionEnded(), progressValue: progressValue">
</div>
</div>
<div class="sessionInfoContainer clearfix">
<div class="sessionInfoMessages">
<table class="logEventsViewport">
<thead>
<tr>
<th class="icon">
&nbsp;
</th>
<th class="message">
Message
</th>
</tr>
</thead>
</table>
<div class="logEventsViewportContainer">
<div class="logEventsViewportNoLogs" data-bind="visible: messages().length == 0"
style="display: none">
No logs
</div>
<table class="logEventsViewport" data-bind="visible: messages().length > 0" style="display: none">
<tbody data-bind="foreach: messages">
<tr>
<td class="icon" data-bind="attr: {title: FormattedTimestamp}, css: {information: EventTypeSeverity == 0, warning: EventTypeSeverity == 1, error: EventTypeSeverity == 2}">
&nbsp;
</td>
<td class="message" data-bind="text: FormattedMessage, attr: {title: EventTypeName}">
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="sessionInfoConsole" data-bind="foreach: console">
<span data-bind="text: Arguments[1]"></span>
</div>
</div>
</div>
</div>
<script type="text/javascript">
ko.bindingHandlers.progressValue = {
update: function (element, valueAccessor, allBindingsAccessor, viewModel) {
var v = ko.utils.unwrapObservable(valueAccessor());
var vInt = parseInt(v);
if (vInt >= 0) {
$element = $(element);
if (!$element.is('.ui-progressbar'))
$element.progressbar();
$(element).progressbar('option', 'value', vInt);
}
}
};
</script>
<script type="text/javascript">
$(function () {
var vm;
var host = $('#enrolStatus');
var hostSessions = $('#sessions');
var hostDialogSessions = $('#dialogSession');
//var hostDialogSessionsProgress = $('#dialogSession').find('.sessionProgress');
var deviceModels = {};
var liveConnection;
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))';
var iconErrorUrl = 'url(@(Links.ClientSource.Style.Images.Status.fail32_png))';
function pageViewModel() {
var self = this;
self.noSessions = ko.observable(true);
self.sessions = ko.observableArray();
self.sessionIndex = {};
self.isotopeInited = false;
self.currentSession = ko.observable();
self.sessionRendered = function (e, d) {
if (!d.sessionEnded()) {
d.progressbar = $(e).find('.sessionProgress').progressbar();
}
};
self.sessionAdded = function (e, d) {
if (self.isotopeInited) {
hostSessions.isotope('reloadItems').isotope({ sortBy: 'original-order' });
}
};
}
function sessionViewModel(id) {
var self = this;
self.title = ko.observable(id);
self.messages = ko.observableArray();
self.console = ko.observableArray();
self.serialNumber = ko.observable();
self.sessionDeviceInfo = ko.observable();
self.progressStatus = ko.observable();
self.progressValue = ko.observable();
self.startTime = ko.observable();
self.sessionEnded = ko.observable(false);
self.progressbar = null;
self.hasError = ko.observable(false);
self.hasWarning = ko.observable(false);
self.deviceModelId = ko.observable();
self.deviceModelDescription = ko.computed(function () {
var deviceModelId = self.deviceModelId();
var sessionDeviceInfo = self.sessionDeviceInfo();
if (deviceModelId) {
var dm = deviceModels[deviceModelId];
if (dm) {
if (dm.Description)
return dm.Description;
else
return dm.Manufacturer + ' ' + dm.Model;
}
}
if (sessionDeviceInfo) {
return sessionDeviceInfo.Arguments[6] + ' ' + sessionDeviceInfo.Arguments[7];
}
});
self.deviceUrl = ko.computed(function () {
var serialNumber = self.serialNumber();
if (serialNumber)
return deviceBaseUrl + serialNumber;
else
return null;
});
self.deviceModelImageUrl = ko.computed(function () {
var deviceModelImage;
if (self.deviceModelId())
deviceModelImage = 'url(' + deviceModelImageUrl + self.deviceModelId() + ')';
else
deviceModelImage = 'url(' + deviceModelImageUrl + ')';
if (self.hasError())
return iconErrorUrl + ', ' + deviceModelImage;
else
if (self.hasWarning())
return iconWarningUrl + ', ' + deviceModelImage;
else
return 'none, ' + deviceModelImage;
});
self.select = function (e, d) {
vm.currentSession(self);
hostDialogSessions.dialog('open');
hostDialogSessions.dialog('option', 'title', 'Device Enrolment: ' + self.title());
}
}
function parseLog(log) {
if (log.ModuleId === 50 && log.Arguments && log.Arguments.length > 0) {
// find session
var sessionId = log.Arguments[0];
var session = vm.sessionIndex[sessionId];
if (!session && log.EventTypeId === 10) { // Starting Session (Ignore 'partial' sessions)
session = new sessionViewModel(sessionId);
vm.sessionIndex[sessionId] = session;
vm.sessions.unshift(session);
vm.noSessions(false);
}
if (session) {
switch (log.EventTypeId) {
case 10: // SessionStarting
session.title(log.Arguments[1]);
session.startTime(log.FormattedTimestamp.substring(log.FormattedTimestamp.indexOf(' ') + 1));
session.messages.unshift(log);
break;
case 11: // SessionProgress
//session.progressbar.progressbar('option', 'value', log.Arguments[1]);
session.progressValue(log.Arguments[1]);
session.progressStatus(log.Arguments[2]);
break;
case 12: // SessionDevice
session.title(log.Arguments[1]);
session.serialNumber(log.Arguments[1]);
if (log.Arguments.length >= 3 && log.Arguments[2])
session.deviceModelId(log.Arguments[2]);
break;
break;
case 13: // SessionDeviceInfo
session.title(log.Arguments[1]);
session.serialNumber(log.Arguments[1]);
session.sessionDeviceInfo(log);
if (log.Arguments.length >= 10 && log.Arguments[9])
session.deviceModelId(log.Arguments[9]);
break;
case 20: // SessionFinished
session.sessionEnded(true);
if (session.hasError())
session.progressStatus('Enrolment Finished with an Error');
else
if (session.hasWarning())
session.progressStatus('Enrolment Finished with a Warning');
else
session.progressStatus('Enrolment Finished Successfully');
session.messages.unshift(log);
break;
case 21: // SessionDiagnosticInformation
session.console.push(log);
break;
case 22: // SessionWarning
session.hasWarning(true);
session.messages.unshift(log);
break;
case 23: // SessionError
case 24: // SessionErrorWithInner
case 25: // SessionClientError
session.hasError(true);
session.messages.unshift(log);
break;
default:
session.messages.unshift(log);
}
}
}
}
function init() {
hostDialogSessions.dialog({
modal: true,
height: 664,
width: 900,
resizable: false,
autoOpen: false,
buttons: { 'Close': function () { $(this).dialog('close'); } }
});
//hostDialogSessionsProgress.progressbar();
// Create View Model
vm = new pageViewModel();
$.ajax({
url: '@(Url.Action(MVC.API.DeviceModel.Index()))',
dataType: 'json',
type: 'POST',
success: init_loadedDeviceModels,
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to retrieve device models: ' + errorThrown);
}
});
}
function init_loadedDeviceModels(models) {
for (var i = 0; i < models.length; i++) {
var m = models[i];
deviceModels[m.Id] = m;
}
// Load Logs
var d = new Date();
var loadData = {
Format: "json",
Start: d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate(),
End: null,
ModuleId: 50,
Take: 2000
};
$.ajax({
url: '@(Url.Action(MVC.API.Logging.RetrieveEvents()))',
dataType: 'json',
type: 'POST',
traditional: true,
data: loadData,
success: init_loadedLogs,
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to retrieve logs: ' + errorThrown);
}
});
}
function init_loadedLogs(logs) {
logs.reverse();
for (var i = 0; i < logs.length; i++) {
parseLog(logs[i]);
}
// Bind
ko.applyBindings(vm);
// Isotope
hostSessions.isotope({
itemSelector: '.session',
layoutMode: 'fitRows'
});
vm.isotopeInited = true;
// Init Persistent Connection
liveConnection = $.connection('@(Url.Content("~/API/Logging/Notifications"))');
liveConnection.received(parseLog);
liveConnection.error(function (e) { if (e.status != 200) alert('Live-Log Error: ' + e.statusText + ': ' + e.responseText); });
liveConnection.start(function () {
liveConnection.send('/addToGroups:@(Disco.BI.DeviceBI.EnrolmentLog.Current.LiveLogGroupName)');
});
}
init();
});
</script>
File diff suppressed because it is too large Load Diff
+164 -164
View File
@@ -1,164 +1,164 @@
@model Disco.Web.Areas.Config.Models.Logging.IndexModel
@using Disco.Services.Logging
@{
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Logging");
Html.BundleDeferred("~/ClientScripts/Modules/jQueryUI-TimePicker");
}
@using (Html.BeginForm(MVC.API.Logging.RetrieveEvents()))
{
<div class="form" style="width: 520px;">
<h2>
Export Logs</h2>
<table>
<tr>
<th style="width: 105px;">
Start Filter
</th>
<td>
<input id="filterStart" type="text" name="Start" />
<span class="smallMessage">* Optional</span>
</td>
</tr>
<tr>
<th>
End Filter
</th>
<td>
<input id="filterEnd" type="text" name="End" />
<span class="smallMessage">* Optional</span>
</td>
</tr>
<tr>
<th>
Limit Filter
</th>
<td>
<select name="Take">
<option selected="selected" value="">- All Events -</option>
<option value="1000">1,000 Events</option>
<option value="500">500 Events</option>
<option value="100">100 Events</option>
<option value="50">50 Events</option>
<option value="10">10 Events</option>
</select>
</td>
</tr>
<tr>
<th>
Module Filter
</th>
<td>
<select id="moduleId" name="ModuleId">
<option value="" selected="selected">- All Modules -</option>
@foreach (var lm in Model.LogModules.Keys.OrderBy(lm => lm.ModuleDescription))
{
<option value="@lm.ModuleId">@lm.ModuleDescription</option>
}
</select>
</td>
</tr>
<tr id="trLogModuleEventTypes" style="display: none">
<th>
Event Type Filter <span style="display: block;" class="checkboxBulkSelectContainer">
Select: <a id="eventTypesSelectAll" href="#">ALL</a> | <a id="eventTypesSelectNone"
href="#">NONE</a></span>
</th>
<td>
@{int uniqueIdSeed = 0;
}
@foreach (var lm in Model.LogModules)
{
<div data-logmoduleid="@lm.Key.ModuleId" class="logModuleEventTypes">
@CommonHelpers.CheckBoxList("EventTypeIds", lm.Value.ToSelectListItems(), 2, false, uniqueIdSeed)
</div>
uniqueIdSeed += lm.Value.Count;
}
</td>
</tr>
<tr>
<th>
</th>
<td>
@Html.Hidden("Format", "CSV")
<input type="submit" class="button" value="Download CSV" />
</td>
</tr>
</table>
<script type="text/javascript">
$(function () {
var filterStart = $('#filterStart').watermark('Start').datetimepicker({
ampm: true,
stepMinute: 1,
changeYear: true,
changeMonth: true,
dateFormat: 'yy/mm/dd'
});
var filterEnd = $('#filterEnd').watermark('End').datetimepicker({
ampm: true,
stepMinute: 1,
changeYear: true,
changeMonth: true,
dateFormat: 'yy/mm/dd'
});
var moduleId = $('#moduleId');
var trLogModuleEventTypes = $('#trLogModuleEventTypes');
var logModuleEventTypes = trLogModuleEventTypes.find('.logModuleEventTypes').hide();
var logModuleEventTypeCheckboxes = logModuleEventTypes.find('input[type="checkbox"]');
moduleId.change(function () {
// Unselect All
logModuleEventTypes.slideUp();
logModuleEventTypeCheckboxes.filter(':checked').attr('checked', false);
var selectedModule = moduleId.val();
if (selectedModule) {
trLogModuleEventTypes.show();
var selectedModuleEventTypes = logModuleEventTypes.filter('[data-logmoduleid="' + selectedModule + '"]');
if (selectedModuleEventTypes.length > 0) {
var selectedModuleEventTypeCheckboxes = selectedModuleEventTypes.find('input[type="checkbox"]');
selectedModuleEventTypeCheckboxes.attr('checked', true);
trLogModuleEventTypes.show();
selectedModuleEventTypes.slideDown();
} else {
trLogModuleEventTypes.hide();
}
} else {
trLogModuleEventTypes.hide();
}
});
$('#eventTypesSelectAll').click(function () {
var selectedModule = moduleId.val();
if (selectedModule) {
var selectedModuleEventTypes = logModuleEventTypes.filter('[data-logmoduleid="' + selectedModule + '"]');
if (selectedModuleEventTypes.length > 0) {
var selectedModuleEventTypeCheckboxes = selectedModuleEventTypes.find('input[type="checkbox"]');
selectedModuleEventTypeCheckboxes.attr('checked', true);
}
}
return false;
});
$('#eventTypesSelectNone').click(function () {
var selectedModule = moduleId.val();
if (selectedModule) {
var selectedModuleEventTypes = logModuleEventTypes.filter('[data-logmoduleid="' + selectedModule + '"]');
if (selectedModuleEventTypes.length > 0) {
var selectedModuleEventTypeCheckboxes = selectedModuleEventTypes.find('input[type="checkbox"]');
selectedModuleEventTypeCheckboxes.attr('checked', false);
}
}
return false;
});
});
</script>
</div>
}
<h2>
Live Logging</h2>
@Html.Partial(MVC.Config.Shared.Views.LogEvents, new Disco.Web.Areas.Config.Models.Shared.LogEventsModel()
{
IsLive = true,
TakeFilter = 100,
StartFilter = DateTime.Today.AddDays(-1),
ViewPortHeight = 450
})
@model Disco.Web.Areas.Config.Models.Logging.IndexModel
@using Disco.Services.Logging
@{
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Logging");
Html.BundleDeferred("~/ClientScripts/Modules/jQueryUI-TimePicker");
}
@using (Html.BeginForm(MVC.API.Logging.RetrieveEvents()))
{
<div class="form" style="width: 520px;">
<h2>
Export Logs</h2>
<table>
<tr>
<th style="width: 105px;">
Start Filter
</th>
<td>
<input id="filterStart" type="text" name="Start" />
<span class="smallMessage">* Optional</span>
</td>
</tr>
<tr>
<th>
End Filter
</th>
<td>
<input id="filterEnd" type="text" name="End" />
<span class="smallMessage">* Optional</span>
</td>
</tr>
<tr>
<th>
Limit Filter
</th>
<td>
<select name="Take">
<option selected="selected" value="">- All Events -</option>
<option value="1000">1,000 Events</option>
<option value="500">500 Events</option>
<option value="100">100 Events</option>
<option value="50">50 Events</option>
<option value="10">10 Events</option>
</select>
</td>
</tr>
<tr>
<th>
Module Filter
</th>
<td>
<select id="moduleId" name="ModuleId">
<option value="" selected="selected">- All Modules -</option>
@foreach (var lm in Model.LogModules.Keys.OrderBy(lm => lm.ModuleDescription))
{
<option value="@lm.ModuleId">@lm.ModuleDescription</option>
}
</select>
</td>
</tr>
<tr id="trLogModuleEventTypes" style="display: none">
<th>
Event Type Filter <span style="display: block;" class="checkboxBulkSelectContainer">
Select: <a id="eventTypesSelectAll" href="#">ALL</a> | <a id="eventTypesSelectNone"
href="#">NONE</a></span>
</th>
<td>
@{int uniqueIdSeed = 0;
}
@foreach (var lm in Model.LogModules)
{
<div data-logmoduleid="@lm.Key.ModuleId" class="logModuleEventTypes">
@CommonHelpers.CheckBoxList("EventTypeIds", lm.Value.ToSelectListItems(), 2, false, uniqueIdSeed)
</div>
uniqueIdSeed += lm.Value.Count;
}
</td>
</tr>
<tr>
<th>
</th>
<td>
@Html.Hidden("Format", "CSV")
<input type="submit" class="button" value="Download CSV" />
</td>
</tr>
</table>
<script type="text/javascript">
$(function () {
var filterStart = $('#filterStart').watermark('Start').datetimepicker({
ampm: true,
stepMinute: 1,
changeYear: true,
changeMonth: true,
dateFormat: 'yy/mm/dd'
});
var filterEnd = $('#filterEnd').watermark('End').datetimepicker({
ampm: true,
stepMinute: 1,
changeYear: true,
changeMonth: true,
dateFormat: 'yy/mm/dd'
});
var moduleId = $('#moduleId');
var trLogModuleEventTypes = $('#trLogModuleEventTypes');
var logModuleEventTypes = trLogModuleEventTypes.find('.logModuleEventTypes').hide();
var logModuleEventTypeCheckboxes = logModuleEventTypes.find('input[type="checkbox"]');
moduleId.change(function () {
// Unselect All
logModuleEventTypes.slideUp();
logModuleEventTypeCheckboxes.filter(':checked').prop('checked', false);
var selectedModule = moduleId.val();
if (selectedModule) {
trLogModuleEventTypes.show();
var selectedModuleEventTypes = logModuleEventTypes.filter('[data-logmoduleid="' + selectedModule + '"]');
if (selectedModuleEventTypes.length > 0) {
var selectedModuleEventTypeCheckboxes = selectedModuleEventTypes.find('input[type="checkbox"]');
selectedModuleEventTypeCheckboxes.prop('checked', true);
trLogModuleEventTypes.show();
selectedModuleEventTypes.slideDown();
} else {
trLogModuleEventTypes.hide();
}
} else {
trLogModuleEventTypes.hide();
}
});
$('#eventTypesSelectAll').click(function () {
var selectedModule = moduleId.val();
if (selectedModule) {
var selectedModuleEventTypes = logModuleEventTypes.filter('[data-logmoduleid="' + selectedModule + '"]');
if (selectedModuleEventTypes.length > 0) {
var selectedModuleEventTypeCheckboxes = selectedModuleEventTypes.find('input[type="checkbox"]');
selectedModuleEventTypeCheckboxes.prop('checked', true);
}
}
return false;
});
$('#eventTypesSelectNone').click(function () {
var selectedModule = moduleId.val();
if (selectedModule) {
var selectedModuleEventTypes = logModuleEventTypes.filter('[data-logmoduleid="' + selectedModule + '"]');
if (selectedModuleEventTypes.length > 0) {
var selectedModuleEventTypeCheckboxes = selectedModuleEventTypes.find('input[type="checkbox"]');
selectedModuleEventTypeCheckboxes.prop('checked', false);
}
}
return false;
});
});
</script>
</div>
}
<h2>
Live Logging</h2>
@Html.Partial(MVC.Config.Shared.Views.LogEvents, new Disco.Web.Areas.Config.Models.Shared.LogEventsModel()
{
IsLive = true,
TakeFilter = 100,
StartFilter = DateTime.Today.AddDays(-1),
ViewPortHeight = 450
})
@@ -1,388 +1,388 @@
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17929
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Disco.Web.Areas.Config.Views.Logging
{
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;
#line 2 "..\..\Areas\Config\Views\Logging\Index.cshtml"
using Disco.Services.Logging;
#line default
#line hidden
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/Logging/Index.cshtml")]
public class Index : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.Logging.IndexModel>
{
public Index()
{
}
public override void Execute()
{
#line 3 "..\..\Areas\Config\Views\Logging\Index.cshtml"
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Logging");
Html.BundleDeferred("~/ClientScripts/Modules/jQueryUI-TimePicker");
#line default
#line hidden
WriteLiteral("\r\n");
#line 7 "..\..\Areas\Config\Views\Logging\Index.cshtml"
using (Html.BeginForm(MVC.API.Logging.RetrieveEvents()))
{
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" class=\"form\"");
WriteLiteral(" style=\"width: 520px;\"");
WriteLiteral(">\r\n <h2>\r\n Export Logs</h2>\r\n <table>\r\n <tr>\r" +
"\n <th");
WriteLiteral(" style=\"width: 105px;\"");
WriteLiteral(">\r\n Start Filter\r\n </th>\r\n <td>\r" +
"\n <input");
WriteLiteral(" id=\"filterStart\"");
WriteLiteral(" type=\"text\"");
WriteLiteral(" name=\"Start\"");
WriteLiteral(" />\r\n <span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">* Optional</span>\r\n </td>\r\n </tr>\r\n <tr>\r\n " +
" <th>\r\n End Filter\r\n </th>\r\n " +
" <td>\r\n <input");
WriteLiteral(" id=\"filterEnd\"");
WriteLiteral(" type=\"text\"");
WriteLiteral(" name=\"End\"");
WriteLiteral(" />\r\n <span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">* Optional</span>\r\n </td>\r\n </tr>\r\n <tr>\r\n " +
" <th>\r\n Limit Filter\r\n </th>\r\n " +
" <td>\r\n <select");
WriteLiteral(" name=\"Take\"");
WriteLiteral(">\r\n <option");
WriteLiteral(" selected=\"selected\"");
WriteLiteral(" value=\"\"");
WriteLiteral(">- All Events -</option>\r\n <option");
WriteLiteral(" value=\"1000\"");
WriteLiteral(">1,000 Events</option>\r\n <option");
WriteLiteral(" value=\"500\"");
WriteLiteral(">500 Events</option>\r\n <option");
WriteLiteral(" value=\"100\"");
WriteLiteral(">100 Events</option>\r\n <option");
WriteLiteral(" value=\"50\"");
WriteLiteral(">50 Events</option>\r\n <option");
WriteLiteral(" value=\"10\"");
WriteLiteral(">10 Events</option>\r\n </select>\r\n </td>\r\n " +
" </tr>\r\n <tr>\r\n <th>\r\n Module " +
"Filter\r\n </th>\r\n <td>\r\n <select" +
"");
WriteLiteral(" id=\"moduleId\"");
WriteLiteral(" name=\"ModuleId\"");
WriteLiteral(">\r\n <option");
WriteLiteral(" value=\"\"");
WriteLiteral(" selected=\"selected\"");
WriteLiteral(">- All Modules -</option>\r\n");
#line 53 "..\..\Areas\Config\Views\Logging\Index.cshtml"
#line default
#line hidden
#line 53 "..\..\Areas\Config\Views\Logging\Index.cshtml"
foreach (var lm in Model.LogModules.Keys.OrderBy(lm => lm.ModuleDescription))
{
#line default
#line hidden
WriteLiteral(" <option");
WriteAttribute("value", Tuple.Create(" value=\"", 2126), Tuple.Create("\"", 2146)
#line 55 "..\..\Areas\Config\Views\Logging\Index.cshtml"
, Tuple.Create(Tuple.Create("", 2134), Tuple.Create<System.Object, System.Int32>(lm.ModuleId
#line default
#line hidden
, 2134), false)
);
WriteLiteral(">");
#line 55 "..\..\Areas\Config\Views\Logging\Index.cshtml"
Write(lm.ModuleDescription);
#line default
#line hidden
WriteLiteral("</option> \r\n");
#line 56 "..\..\Areas\Config\Views\Logging\Index.cshtml"
}
#line default
#line hidden
WriteLiteral(" </select>\r\n </td>\r\n </tr>\r\n " +
" <tr");
WriteLiteral(" id=\"trLogModuleEventTypes\"");
WriteLiteral(" style=\"display: none\"");
WriteLiteral(">\r\n <th>\r\n Event Type Filter <span");
WriteLiteral(" style=\"display: block;\"");
WriteLiteral(" class=\"checkboxBulkSelectContainer\"");
WriteLiteral(">\r\n Select: <a");
WriteLiteral(" id=\"eventTypesSelectAll\"");
WriteLiteral(" href=\"#\"");
WriteLiteral(">ALL</a> | <a");
WriteLiteral(" id=\"eventTypesSelectNone\"");
WriteLiteral("\r\n href=\"#\"");
WriteLiteral(">NONE</a></span>\r\n </th>\r\n <td>\r\n");
#line 67 "..\..\Areas\Config\Views\Logging\Index.cshtml"
#line default
#line hidden
#line 67 "..\..\Areas\Config\Views\Logging\Index.cshtml"
int uniqueIdSeed = 0;
#line default
#line hidden
WriteLiteral("\r\n");
#line 69 "..\..\Areas\Config\Views\Logging\Index.cshtml"
#line default
#line hidden
#line 69 "..\..\Areas\Config\Views\Logging\Index.cshtml"
foreach (var lm in Model.LogModules)
{
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" data-logmoduleid=\"");
#line 71 "..\..\Areas\Config\Views\Logging\Index.cshtml"
Write(lm.Key.ModuleId);
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(" class=\"logModuleEventTypes\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 72 "..\..\Areas\Config\Views\Logging\Index.cshtml"
Write(CommonHelpers.CheckBoxList("EventTypeIds", lm.Value.ToSelectListItems(), 2, false, uniqueIdSeed));
#line default
#line hidden
WriteLiteral("\r\n </div>\r\n");
#line 74 "..\..\Areas\Config\Views\Logging\Index.cshtml"
uniqueIdSeed += lm.Value.Count;
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n <th>\r" +
"\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 82 "..\..\Areas\Config\Views\Logging\Index.cshtml"
Write(Html.Hidden("Format", "CSV"));
#line default
#line hidden
WriteLiteral("\r\n <input");
WriteLiteral(" type=\"submit\"");
WriteLiteral(" class=\"button\"");
WriteLiteral(" value=\"Download CSV\"");
WriteLiteral(" />\r\n </td>\r\n </tr>\r\n </table>\r\n <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(">\r\n $(function () {\r\n var filterStart = $(\'#filterStart" +
"\').watermark(\'Start\').datetimepicker({\r\n ampm: true,\r\n " +
" stepMinute: 1,\r\n changeYear: true,\r\n " +
" changeMonth: true,\r\n dateFormat: \'yy/mm/dd\'\r\n " +
" });\r\n var filterEnd = $(\'#filterEnd\').watermark(\'End\').da" +
"tetimepicker({\r\n ampm: true,\r\n stepMinute:" +
" 1,\r\n changeYear: true,\r\n changeMonth: tru" +
"e,\r\n dateFormat: \'yy/mm/dd\'\r\n });\r\n " +
" var moduleId = $(\'#moduleId\');\r\n var trLogModuleEventTypes =" +
" $(\'#trLogModuleEventTypes\');\r\n var logModuleEventTypes = trLogMo" +
"duleEventTypes.find(\'.logModuleEventTypes\').hide();\r\n var logModu" +
"leEventTypeCheckboxes = logModuleEventTypes.find(\'input[type=\"checkbox\"]\');\r\n\r\n " +
" moduleId.change(function () {\r\n // Unselect Al" +
"l\r\n logModuleEventTypes.slideUp();\r\n logMo" +
"duleEventTypeCheckboxes.filter(\':checked\').attr(\'checked\', false);\r\n " +
" var selectedModule = moduleId.val();\r\n if (selectedMo" +
"dule) {\r\n trLogModuleEventTypes.show();\r\n " +
" var selectedModuleEventTypes = logModuleEventTypes.filter(\'[data-logmodu" +
"leid=\"\' + selectedModule + \'\"]\');\r\n if (selectedModuleEve" +
"ntTypes.length > 0) {\r\n var selectedModuleEventTypeCh" +
"eckboxes = selectedModuleEventTypes.find(\'input[type=\"checkbox\"]\');\r\n " +
" selectedModuleEventTypeCheckboxes.attr(\'checked\', true);\r\n " +
" trLogModuleEventTypes.show();\r\n " +
" selectedModuleEventTypes.slideDown();\r\n } else {\r\n " +
" trLogModuleEventTypes.hide();\r\n }\r" +
"\n } else {\r\n trLogModuleEventTypes.hid" +
"e();\r\n }\r\n });\r\n\r\n $(\'#eventTyp" +
"esSelectAll\').click(function () {\r\n var selectedModule = modu" +
"leId.val();\r\n if (selectedModule) {\r\n " +
"var selectedModuleEventTypes = logModuleEventTypes.filter(\'[data-logmoduleid=\"\' " +
"+ selectedModule + \'\"]\');\r\n if (selectedModuleEventTypes." +
"length > 0) {\r\n var selectedModuleEventTypeCheckboxes" +
" = selectedModuleEventTypes.find(\'input[type=\"checkbox\"]\');\r\n " +
" selectedModuleEventTypeCheckboxes.attr(\'checked\', true);\r\n " +
" }\r\n }\r\n return false;\r\n " +
" });\r\n $(\'#eventTypesSelectNone\').click(function () {\r\n " +
" var selectedModule = moduleId.val();\r\n if (s" +
"electedModule) {\r\n var selectedModuleEventTypes = logModu" +
"leEventTypes.filter(\'[data-logmoduleid=\"\' + selectedModule + \'\"]\');\r\n " +
" if (selectedModuleEventTypes.length > 0) {\r\n " +
" var selectedModuleEventTypeCheckboxes = selectedModuleEventTypes.find(\'inpu" +
"t[type=\"checkbox\"]\');\r\n selectedModuleEventTypeCheckb" +
"oxes.attr(\'checked\', false);\r\n }\r\n }\r\n" +
" return false;\r\n });\r\n\r\n });\r\n " +
" </script>\r\n </div>\r\n");
#line 155 "..\..\Areas\Config\Views\Logging\Index.cshtml"
}
#line default
#line hidden
WriteLiteral("<h2>\r\n Live Logging</h2>\r\n");
#line 158 "..\..\Areas\Config\Views\Logging\Index.cshtml"
Write(Html.Partial(MVC.Config.Shared.Views.LogEvents, new Disco.Web.Areas.Config.Models.Shared.LogEventsModel()
{
IsLive = true,
TakeFilter = 100,
StartFilter = DateTime.Today.AddDays(-1),
ViewPortHeight = 450
}));
#line default
#line hidden
WriteLiteral("\r\n");
}
}
}
#pragma warning restore 1591
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17929
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Disco.Web.Areas.Config.Views.Logging
{
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;
#line 2 "..\..\Areas\Config\Views\Logging\Index.cshtml"
using Disco.Services.Logging;
#line default
#line hidden
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/Logging/Index.cshtml")]
public class Index : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.Logging.IndexModel>
{
public Index()
{
}
public override void Execute()
{
#line 3 "..\..\Areas\Config\Views\Logging\Index.cshtml"
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Logging");
Html.BundleDeferred("~/ClientScripts/Modules/jQueryUI-TimePicker");
#line default
#line hidden
WriteLiteral("\r\n");
#line 7 "..\..\Areas\Config\Views\Logging\Index.cshtml"
using (Html.BeginForm(MVC.API.Logging.RetrieveEvents()))
{
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" class=\"form\"");
WriteLiteral(" style=\"width: 520px;\"");
WriteLiteral(">\r\n <h2>\r\n Export Logs</h2>\r\n <table>\r\n <tr>\r" +
"\n <th");
WriteLiteral(" style=\"width: 105px;\"");
WriteLiteral(">\r\n Start Filter\r\n </th>\r\n <td>\r" +
"\n <input");
WriteLiteral(" id=\"filterStart\"");
WriteLiteral(" type=\"text\"");
WriteLiteral(" name=\"Start\"");
WriteLiteral(" />\r\n <span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">* Optional</span>\r\n </td>\r\n </tr>\r\n <tr>\r\n " +
" <th>\r\n End Filter\r\n </th>\r\n " +
" <td>\r\n <input");
WriteLiteral(" id=\"filterEnd\"");
WriteLiteral(" type=\"text\"");
WriteLiteral(" name=\"End\"");
WriteLiteral(" />\r\n <span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">* Optional</span>\r\n </td>\r\n </tr>\r\n <tr>\r\n " +
" <th>\r\n Limit Filter\r\n </th>\r\n " +
" <td>\r\n <select");
WriteLiteral(" name=\"Take\"");
WriteLiteral(">\r\n <option");
WriteLiteral(" selected=\"selected\"");
WriteLiteral(" value=\"\"");
WriteLiteral(">- All Events -</option>\r\n <option");
WriteLiteral(" value=\"1000\"");
WriteLiteral(">1,000 Events</option>\r\n <option");
WriteLiteral(" value=\"500\"");
WriteLiteral(">500 Events</option>\r\n <option");
WriteLiteral(" value=\"100\"");
WriteLiteral(">100 Events</option>\r\n <option");
WriteLiteral(" value=\"50\"");
WriteLiteral(">50 Events</option>\r\n <option");
WriteLiteral(" value=\"10\"");
WriteLiteral(">10 Events</option>\r\n </select>\r\n </td>\r\n " +
" </tr>\r\n <tr>\r\n <th>\r\n Module " +
"Filter\r\n </th>\r\n <td>\r\n <select" +
"");
WriteLiteral(" id=\"moduleId\"");
WriteLiteral(" name=\"ModuleId\"");
WriteLiteral(">\r\n <option");
WriteLiteral(" value=\"\"");
WriteLiteral(" selected=\"selected\"");
WriteLiteral(">- All Modules -</option>\r\n");
#line 53 "..\..\Areas\Config\Views\Logging\Index.cshtml"
#line default
#line hidden
#line 53 "..\..\Areas\Config\Views\Logging\Index.cshtml"
foreach (var lm in Model.LogModules.Keys.OrderBy(lm => lm.ModuleDescription))
{
#line default
#line hidden
WriteLiteral(" <option");
WriteAttribute("value", Tuple.Create(" value=\"", 2126), Tuple.Create("\"", 2146)
#line 55 "..\..\Areas\Config\Views\Logging\Index.cshtml"
, Tuple.Create(Tuple.Create("", 2134), Tuple.Create<System.Object, System.Int32>(lm.ModuleId
#line default
#line hidden
, 2134), false)
);
WriteLiteral(">");
#line 55 "..\..\Areas\Config\Views\Logging\Index.cshtml"
Write(lm.ModuleDescription);
#line default
#line hidden
WriteLiteral("</option> \r\n");
#line 56 "..\..\Areas\Config\Views\Logging\Index.cshtml"
}
#line default
#line hidden
WriteLiteral(" </select>\r\n </td>\r\n </tr>\r\n " +
" <tr");
WriteLiteral(" id=\"trLogModuleEventTypes\"");
WriteLiteral(" style=\"display: none\"");
WriteLiteral(">\r\n <th>\r\n Event Type Filter <span");
WriteLiteral(" style=\"display: block;\"");
WriteLiteral(" class=\"checkboxBulkSelectContainer\"");
WriteLiteral(">\r\n Select: <a");
WriteLiteral(" id=\"eventTypesSelectAll\"");
WriteLiteral(" href=\"#\"");
WriteLiteral(">ALL</a> | <a");
WriteLiteral(" id=\"eventTypesSelectNone\"");
WriteLiteral("\r\n href=\"#\"");
WriteLiteral(">NONE</a></span>\r\n </th>\r\n <td>\r\n");
#line 67 "..\..\Areas\Config\Views\Logging\Index.cshtml"
#line default
#line hidden
#line 67 "..\..\Areas\Config\Views\Logging\Index.cshtml"
int uniqueIdSeed = 0;
#line default
#line hidden
WriteLiteral("\r\n");
#line 69 "..\..\Areas\Config\Views\Logging\Index.cshtml"
#line default
#line hidden
#line 69 "..\..\Areas\Config\Views\Logging\Index.cshtml"
foreach (var lm in Model.LogModules)
{
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" data-logmoduleid=\"");
#line 71 "..\..\Areas\Config\Views\Logging\Index.cshtml"
Write(lm.Key.ModuleId);
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(" class=\"logModuleEventTypes\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 72 "..\..\Areas\Config\Views\Logging\Index.cshtml"
Write(CommonHelpers.CheckBoxList("EventTypeIds", lm.Value.ToSelectListItems(), 2, false, uniqueIdSeed));
#line default
#line hidden
WriteLiteral("\r\n </div>\r\n");
#line 74 "..\..\Areas\Config\Views\Logging\Index.cshtml"
uniqueIdSeed += lm.Value.Count;
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n <th>\r" +
"\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 82 "..\..\Areas\Config\Views\Logging\Index.cshtml"
Write(Html.Hidden("Format", "CSV"));
#line default
#line hidden
WriteLiteral("\r\n <input");
WriteLiteral(" type=\"submit\"");
WriteLiteral(" class=\"button\"");
WriteLiteral(" value=\"Download CSV\"");
WriteLiteral(" />\r\n </td>\r\n </tr>\r\n </table>\r\n <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(">\r\n $(function () {\r\n var filterStart = $(\'#filterStart" +
"\').watermark(\'Start\').datetimepicker({\r\n ampm: true,\r\n " +
" stepMinute: 1,\r\n changeYear: true,\r\n " +
" changeMonth: true,\r\n dateFormat: \'yy/mm/dd\'\r\n " +
" });\r\n var filterEnd = $(\'#filterEnd\').watermark(\'End\').da" +
"tetimepicker({\r\n ampm: true,\r\n stepMinute:" +
" 1,\r\n changeYear: true,\r\n changeMonth: tru" +
"e,\r\n dateFormat: \'yy/mm/dd\'\r\n });\r\n " +
" var moduleId = $(\'#moduleId\');\r\n var trLogModuleEventTypes =" +
" $(\'#trLogModuleEventTypes\');\r\n var logModuleEventTypes = trLogMo" +
"duleEventTypes.find(\'.logModuleEventTypes\').hide();\r\n var logModu" +
"leEventTypeCheckboxes = logModuleEventTypes.find(\'input[type=\"checkbox\"]\');\r\n\r\n " +
" moduleId.change(function () {\r\n // Unselect Al" +
"l\r\n logModuleEventTypes.slideUp();\r\n logMo" +
"duleEventTypeCheckboxes.filter(\':checked\').prop(\'checked\', false);\r\n " +
" var selectedModule = moduleId.val();\r\n if (selectedMo" +
"dule) {\r\n trLogModuleEventTypes.show();\r\n " +
" var selectedModuleEventTypes = logModuleEventTypes.filter(\'[data-logmodu" +
"leid=\"\' + selectedModule + \'\"]\');\r\n if (selectedModuleEve" +
"ntTypes.length > 0) {\r\n var selectedModuleEventTypeCh" +
"eckboxes = selectedModuleEventTypes.find(\'input[type=\"checkbox\"]\');\r\n " +
" selectedModuleEventTypeCheckboxes.prop(\'checked\', true);\r\n " +
" trLogModuleEventTypes.show();\r\n " +
" selectedModuleEventTypes.slideDown();\r\n } else {\r\n " +
" trLogModuleEventTypes.hide();\r\n }\r" +
"\n } else {\r\n trLogModuleEventTypes.hid" +
"e();\r\n }\r\n });\r\n\r\n $(\'#eventTyp" +
"esSelectAll\').click(function () {\r\n var selectedModule = modu" +
"leId.val();\r\n if (selectedModule) {\r\n " +
"var selectedModuleEventTypes = logModuleEventTypes.filter(\'[data-logmoduleid=\"\' " +
"+ selectedModule + \'\"]\');\r\n if (selectedModuleEventTypes." +
"length > 0) {\r\n var selectedModuleEventTypeCheckboxes" +
" = selectedModuleEventTypes.find(\'input[type=\"checkbox\"]\');\r\n " +
" selectedModuleEventTypeCheckboxes.prop(\'checked\', true);\r\n " +
" }\r\n }\r\n return false;\r\n " +
" });\r\n $(\'#eventTypesSelectNone\').click(function () {\r\n " +
" var selectedModule = moduleId.val();\r\n if (s" +
"electedModule) {\r\n var selectedModuleEventTypes = logModu" +
"leEventTypes.filter(\'[data-logmoduleid=\"\' + selectedModule + \'\"]\');\r\n " +
" if (selectedModuleEventTypes.length > 0) {\r\n " +
" var selectedModuleEventTypeCheckboxes = selectedModuleEventTypes.find(\'inpu" +
"t[type=\"checkbox\"]\');\r\n selectedModuleEventTypeCheckb" +
"oxes.prop(\'checked\', false);\r\n }\r\n }\r\n" +
" return false;\r\n });\r\n\r\n });\r\n " +
" </script>\r\n </div>\r\n");
#line 155 "..\..\Areas\Config\Views\Logging\Index.cshtml"
}
#line default
#line hidden
WriteLiteral("<h2>\r\n Live Logging</h2>\r\n");
#line 158 "..\..\Areas\Config\Views\Logging\Index.cshtml"
Write(Html.Partial(MVC.Config.Shared.Views.LogEvents, new Disco.Web.Areas.Config.Models.Shared.LogEventsModel()
{
IsLive = true,
TakeFilter = 100,
StartFilter = DateTime.Today.AddDays(-1),
ViewPortHeight = 450
}));
#line default
#line hidden
WriteLiteral("\r\n");
}
}
}
#pragma warning restore 1591
@@ -242,7 +242,7 @@
function updateWithLive() {
liveConnection = $.connection('@(Url.Content("~/API/Logging/TaskStatusNotifications"))');
liveConnection.received(update_Received);
liveConnection.error(function (e) { alert('Live-Status Error: ' + e) });
liveConnection.error(function (e) { if (e.status != 200) alert('Live-Status Error: ' + e.statusText + ': ' + e.responseText); });
liveConnection.start(function () {
liveConnection.send('/addToGroups:' + sessionId);
updateWithAjax();
@@ -294,7 +294,7 @@ WriteLiteral("\';\r\n\r\n var view = $(\'#scheduledTaskStatus\');\r\n
#line hidden
WriteLiteral(@"');
liveConnection.received(update_Received);
liveConnection.error(function (e) { alert('Live-Status Error: ' + e) });
liveConnection.error(function (e) { if (e.status != 200) alert('Live-Status Error: ' + e.statusText + ': ' + e.responseText); });
liveConnection.start(function () {
liveConnection.send('/addToGroups:' + sessionId);
updateWithAjax();
@@ -101,7 +101,7 @@
}
},
Cancel: function () {
uninstallPluginData.removeAttr('checked');
uninstallPluginData.prop('checked', false);
$('#uninstallPluginDataAlert').hide();
$(this).dialog("close");
}
@@ -125,7 +125,7 @@
$(this).dialog("disable");
},
Cancel: function () {
uninstallPluginData.removeAttr('checked');
uninstallPluginData.prop('checked', false);
$('#uninstallPluginDataAlert').hide();
$(this).dialog("close");
}
@@ -383,33 +383,33 @@ WriteLiteral("/\';\r\n var uninstallPlugin, uninstallPluginData,
"stallPluginDataConfirm.hide();\r\n\r\n $dialogConfirm" +
".dialog(\'open\');\r\n $(this).dialog(\"close\");\r\n " +
" }\r\n },\r\n C" +
"ancel: function () {\r\n uninstallPluginData.removeAttr" +
"(\'checked\');\r\n $(\'#uninstallPluginDataAlert\').hide();" +
"\r\n $(this).dialog(\"close\");\r\n " +
"}\r\n }\r\n });\r\n\r\n $dialogConfirm " +
"= $(\'#dialogUninstallPluginConfirm\').dialog({\r\n resizable: fa" +
"lse,\r\n modal: true,\r\n width: 350,\r\n " +
" autoOpen: false,\r\n buttons: {\r\n " +
" \"Confirm Uninstall\": function () {\r\n var url =" +
" uninstallUrl + pluginId;\r\n if (pluginUninstallData)\r" +
"\n url += \'?UninstallData=true\'\r\n " +
" else\r\n url += \'?UninstallData=false\'\r\n" +
"\r\n window.location.href = url;\r\n " +
" $(this).dialog(\"disable\");\r\n },\r\n " +
" Cancel: function () {\r\n uninstallPluginData.re" +
"moveAttr(\'checked\');\r\n $(\'#uninstallPluginDataAlert\')" +
".hide();\r\n $(this).dialog(\"close\");\r\n " +
" }\r\n }\r\n });\r\n\r\n uninsta" +
"llPlugin = $(\'#uninstallPlugin\');\r\n uninstallPluginData = $(\'#uni" +
"nstallPluginData\');\r\n uninstallPluginConfirm = $(\'#uninstallPlugi" +
"nConfirm\');\r\n uninstallPluginDataConfirm = $(\'#uninstallPluginDat" +
"aConfirm\');\r\n\r\n $(\'#buttonUninstall\').click(function () {\r\n " +
" $dialog.dialog(\'open\');\r\n return false;\r\n " +
" });\r\n\r\n $(\'#uninstallPluginData\').change(function () {\r" +
"\n if ($(this).is(\':checked\')) {\r\n $(\'#" +
"uninstallPluginDataAlert\').slideDown();\r\n } else {\r\n " +
" $(\'#uninstallPluginDataAlert\').slideUp();\r\n }\r" +
"\n });\r\n });\r\n </script>\r\n");
"ancel: function () {\r\n uninstallPluginData.prop(\'chec" +
"ked\', false);\r\n $(\'#uninstallPluginDataAlert\').hide()" +
";\r\n $(this).dialog(\"close\");\r\n " +
" }\r\n }\r\n });\r\n\r\n $dialogConfirm" +
" = $(\'#dialogUninstallPluginConfirm\').dialog({\r\n resizable: f" +
"alse,\r\n modal: true,\r\n width: 350,\r\n " +
" autoOpen: false,\r\n buttons: {\r\n " +
" \"Confirm Uninstall\": function () {\r\n var url " +
"= uninstallUrl + pluginId;\r\n if (pluginUninstallData)" +
"\r\n url += \'?UninstallData=true\'\r\n " +
" else\r\n url += \'?UninstallData=false\'\r" +
"\n\r\n window.location.href = url;\r\n " +
" $(this).dialog(\"disable\");\r\n },\r\n " +
" Cancel: function () {\r\n uninstallPluginData.p" +
"rop(\'checked\', false);\r\n $(\'#uninstallPluginDataAlert" +
"\').hide();\r\n $(this).dialog(\"close\");\r\n " +
" }\r\n }\r\n });\r\n\r\n unins" +
"tallPlugin = $(\'#uninstallPlugin\');\r\n uninstallPluginData = $(\'#u" +
"ninstallPluginData\');\r\n uninstallPluginConfirm = $(\'#uninstallPlu" +
"ginConfirm\');\r\n uninstallPluginDataConfirm = $(\'#uninstallPluginD" +
"ataConfirm\');\r\n\r\n $(\'#buttonUninstall\').click(function () {\r\n " +
" $dialog.dialog(\'open\');\r\n return false;\r\n " +
" });\r\n\r\n $(\'#uninstallPluginData\').change(function () " +
"{\r\n if ($(this).is(\':checked\')) {\r\n $(" +
"\'#uninstallPluginDataAlert\').slideDown();\r\n } else {\r\n " +
" $(\'#uninstallPluginDataAlert\').slideUp();\r\n " +
"}\r\n });\r\n });\r\n </script>\r\n");
#line 154 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
@@ -1,143 +1,135 @@
@model Disco.Web.Areas.Config.Models.Shared.LogEventsModel
@{
Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR");
var uniqueId = Guid.NewGuid().ToString("N");
}
<div id="LogEvents_@(uniqueId)" class="logEventsViewport">
<table class="logEventsViewport">
<thead>
<tr>
<th class="icon">
&nbsp;
</th>
<th class="timestamp">
Date/Time
</th>
<th class="eventType">
Event Type
</th>
<th class="message">
Message
</th>
</tr>
</thead>
</table>
<div class="logEventsViewportContainer" style="@(Model.ViewPortWidth.HasValue ? string.Format("width:{0}px;", Model.ViewPortWidth.Value) : null)@(Model.ViewPortHeight.HasValue ? string.Format("height:{0}px;", Model.ViewPortHeight.Value - 18) : null)">
<div class="logEventsViewportNoLogs" data-bind="visible: EventLogs().length == 0"
style="display: none">
No logs
</div>
<table class="logEventsViewport" data-bind="visible: EventLogs().length > 0" style="display: none">
<tbody data-bind="foreach: EventLogs">
<tr>
<td class="icon" data-bind="css: {information: EventTypeSeverity == 0, warning: EventTypeSeverity == 1, error: EventTypeSeverity == 2}">
&nbsp;
</td>
<td class="timestamp" data-bind="text: FormattedTimestamp">
</td>
<td class="eventType" data-bind="text: EventTypeName, attr: {title: ModuleDescription}">
</td>
<td class="message" data-bind="text: FormattedMessage, attr: {title: $parent.LogArguments($data)}">
</td>
</tr>
</tbody>
</table>
</div>
@{
var serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
var eventTypesFilterJson = (Model.EventTypesFilter != null) ? serializer.Serialize(Model.EventTypesFilter.Select(et => et.Id).ToArray()) : "null";
}
<script type="text/javascript">
$(function () {
var logEventsHost = $('LogEvents_@(uniqueId)');
var logModuleId = '@(Model.ModuleFilter != null ? Model.ModuleFilter.ModuleId.ToString() : null)';
var logModuleLiveGroupName = '@(Model.ModuleFilter != null ? Model.ModuleFilter.LiveLogGroupName : Disco.Services.Logging.LogContext.LiveLogAllEventsGroupName)';
var logEventTypeFiltered = @(eventTypesFilterJson);
var logStartFiler = @(AjaxHelpers.JsonDate(Model.StartFilter));
var logEndFiler = @(AjaxHelpers.JsonDate(Model.EndFilter));
var logTakeFiler = '@(Model.TakeFilter)';
var liveConnection = null;
var liveEventReceivedFunction = '@(Model.JavascriptLiveEventFunctionName)';
var useLive = ('True'==='@(Model.IsLive)');
// View Model
var logsViewModel;
function LogsViewModel(initialLogs){
var self = this;
self.EventLogs = ko.observableArray(initialLogs);
self.LogArguments = function(log){
if (log.Arguments)
return log.Arguments.join('\n');
else
return null;
};
}
function formatDate(d){
if (d){
return d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate() + ' ' + d.getHours() + ':'+d.getMinutes()+':'+d.getSeconds();
}else{
return null;
}
}
function loadInitialData(){
// Load Data
var loadData = {
Format: "json",
Start: formatDate(logStartFiler),
End: logEndFiler,
ModuleId: logModuleId,
Take: logTakeFiler
};
if (logEventTypeFiltered)
loadData["EventTypeIds"] = logEventTypeFiltered;
$.ajax({
url: '@(Url.Action(MVC.API.Logging.RetrieveEvents()))',
dataType: 'json',
type: 'POST',
data: loadData,
success: function (d) {
initLogs(d);
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to retrieve logs: ' + textStatus);
}
});
}
function initLogs(loadedLogs){
logsViewModel = new LogsViewModel(loadedLogs);
ko.applyBindings(logsViewModel, logEventsHost.get(0));
if (useLive){
if (liveEventReceivedFunction){
if (!document.DiscoFunctions) document.DiscoFunctions = {};
if (!document.DiscoFunctions.LogEventsFunctions) document.DiscoFunctions.LogEventsFunctions = {};
if (document.DiscoFunctions.LogEventsFunctions[liveEventReceivedFunction]){
liveEventReceivedFunction = document.DiscoFunctions.LogEventsFunctions[liveEventReceivedFunction];
}else{
liveEventReceivedFunction = null;
}
}
liveConnection = $.connection('@(Url.Content("~/API/Logging/Notifications"))');
liveConnection.received(logReceived);
liveConnection.error(function(e){alert('Live-Log Error: '+e)});
liveConnection.start(function(){
if (logModuleLiveGroupName){
liveConnection.send('/addToGroups:' + logModuleLiveGroupName);
}
});
}
}
function logReceived(log){
if (log.UseDisplay) logsViewModel.EventLogs.unshift(log);
if (liveEventReceivedFunction) liveEventReceivedFunction(log);
}
loadInitialData();
});
</script>
</div>
@model Disco.Web.Areas.Config.Models.Shared.LogEventsModel
@{
Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR");
var uniqueId = Guid.NewGuid().ToString("N");
}
<div id="LogEvents_@(uniqueId)" class="logEventsViewport">
<table class="logEventsViewport">
<thead>
<tr>
<th class="icon">&nbsp;
</th>
<th class="timestamp">Date/Time
</th>
<th class="eventType">Event Type
</th>
<th class="message">Message
</th>
</tr>
</thead>
</table>
<div class="logEventsViewportContainer" style="@(Model.ViewPortWidth.HasValue ? string.Format("width:{0}px;", Model.ViewPortWidth.Value) : null)@(Model.ViewPortHeight.HasValue ? string.Format("height:{0}px;", Model.ViewPortHeight.Value - 18) : null)">
<div class="logEventsViewportNoLogs" data-bind="visible: EventLogs().length == 0"
style="display: none">
No logs
</div>
<table class="logEventsViewport" data-bind="visible: EventLogs().length > 0" style="display: none">
<tbody data-bind="foreach: EventLogs">
<tr>
<td class="icon" data-bind="css: {information: EventTypeSeverity == 0, warning: EventTypeSeverity == 1, error: EventTypeSeverity == 2}">&nbsp;
</td>
<td class="timestamp" data-bind="text: FormattedTimestamp"></td>
<td class="eventType" data-bind="text: EventTypeName, attr: {title: ModuleDescription}"></td>
<td class="message" data-bind="text: FormattedMessage, attr: {title: $parent.LogArguments($data)}"></td>
</tr>
</tbody>
</table>
</div>
@{
var serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
var eventTypesFilterJson = (Model.EventTypesFilter != null) ? serializer.Serialize(Model.EventTypesFilter.Select(et => et.Id).ToArray()) : "null";
}
<script type="text/javascript">
$(function () {
var logEventsHost = $('LogEvents_@(uniqueId)');
var logModuleId = '@(Model.ModuleFilter != null ? Model.ModuleFilter.ModuleId.ToString() : null)';
var logModuleLiveGroupName = '@(Model.ModuleFilter != null ? Model.ModuleFilter.LiveLogGroupName : Disco.Services.Logging.LogContext.LiveLogAllEventsGroupName)';
var logEventTypeFiltered = @(eventTypesFilterJson);
var logStartFiler = @(AjaxHelpers.JsonDate(Model.StartFilter));
var logEndFiler = @(AjaxHelpers.JsonDate(Model.EndFilter));
var logTakeFiler = '@(Model.TakeFilter)';
var liveConnection = null;
var liveEventReceivedFunction = '@(Model.JavascriptLiveEventFunctionName)';
var useLive = ('True'==='@(Model.IsLive)');
// View Model
var logsViewModel;
function LogsViewModel(initialLogs){
var self = this;
self.EventLogs = ko.observableArray(initialLogs);
self.LogArguments = function(log){
if (log.Arguments)
return log.Arguments.join('\n');
else
return null;
};
}
function formatDate(d){
if (d){
return d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate() + ' ' + d.getHours() + ':'+d.getMinutes()+':'+d.getSeconds();
}else{
return null;
}
}
function loadInitialData(){
// Load Data
var loadData = {
Format: "json",
Start: formatDate(logStartFiler),
End: logEndFiler,
ModuleId: logModuleId,
Take: logTakeFiler
};
if (logEventTypeFiltered)
loadData["EventTypeIds"] = logEventTypeFiltered;
$.ajax({
url: '@(Url.Action(MVC.API.Logging.RetrieveEvents()))',
dataType: 'json',
type: 'POST',
data: loadData,
success: function (d) {
initLogs(d);
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to retrieve logs: ' + textStatus);
}
});
}
function initLogs(loadedLogs){
logsViewModel = new LogsViewModel(loadedLogs);
ko.applyBindings(logsViewModel, logEventsHost.get(0));
if (useLive){
if (liveEventReceivedFunction){
if (!document.DiscoFunctions) document.DiscoFunctions = {};
if (!document.DiscoFunctions.LogEventsFunctions) document.DiscoFunctions.LogEventsFunctions = {};
if (document.DiscoFunctions.LogEventsFunctions[liveEventReceivedFunction]){
liveEventReceivedFunction = document.DiscoFunctions.LogEventsFunctions[liveEventReceivedFunction];
}else{
liveEventReceivedFunction = null;
}
}
liveConnection = $.connection('@(Url.Content("~/API/Logging/Notifications"))');
liveConnection.received(logReceived);
liveConnection.error(function(e){if (e.status != 200) alert('Live-Log Error: '+e.statusText +': '+e.responseText);});
liveConnection.start(function(){
if (logModuleLiveGroupName){
liveConnection.send('/addToGroups:' + logModuleLiveGroupName);
}
});
}
}
function logReceived(log){
if (log.UseDisplay) logsViewModel.EventLogs.unshift(log);
if (liveEventReceivedFunction) liveEventReceivedFunction(log);
}
loadInitialData();
});
</script>
</div>
@@ -1,365 +1,364 @@
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17929
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Disco.Web.Areas.Config.Views.Shared
{
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", "1.5.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/Shared/LogEvents.cshtml")]
public class LogEvents : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.Shared.LogEventsModel>
{
public LogEvents()
{
}
public override void Execute()
{
#line 2 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR");
var uniqueId = Guid.NewGuid().ToString("N");
#line default
#line hidden
WriteLiteral("\r\n<div");
WriteAttribute("id", Tuple.Create(" id=\"", 251), Tuple.Create("\"", 277)
, Tuple.Create(Tuple.Create("", 256), Tuple.Create("LogEvents_", 256), true)
#line 7 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
, Tuple.Create(Tuple.Create("", 266), Tuple.Create<System.Object, System.Int32>(uniqueId
#line default
#line hidden
, 266), false)
);
WriteLiteral(" class=\"logEventsViewport\"");
WriteLiteral(">\r\n <table");
WriteLiteral(" class=\"logEventsViewport\"");
WriteLiteral(">\r\n <thead>\r\n <tr>\r\n <th");
WriteLiteral(" class=\"icon\"");
WriteLiteral(">\r\n &nbsp;\r\n </th>\r\n <th");
WriteLiteral(" class=\"timestamp\"");
WriteLiteral(">\r\n Date/Time\r\n </th>\r\n <th");
WriteLiteral(" class=\"eventType\"");
WriteLiteral(">\r\n Event Type\r\n </th>\r\n <th");
WriteLiteral(" class=\"message\"");
WriteLiteral(">\r\n Message\r\n </th>\r\n </tr>\r\n " +
" </thead>\r\n </table>\r\n <div");
WriteLiteral(" class=\"logEventsViewportContainer\"");
WriteAttribute("style", Tuple.Create(" style=\"", 840), Tuple.Create("\"", 1050)
#line 26 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
, Tuple.Create(Tuple.Create("", 848), Tuple.Create<System.Object, System.Int32>(Model.ViewPortWidth.HasValue ? string.Format("width:{0}px;", Model.ViewPortWidth.Value) : null
#line default
#line hidden
, 848), false)
#line 26 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
, Tuple.Create(Tuple.Create("", 945), Tuple.Create<System.Object, System.Int32>(Model.ViewPortHeight.HasValue ? string.Format("height:{0}px;", Model.ViewPortHeight.Value - 18) : null
#line default
#line hidden
, 945), false)
);
WriteLiteral(">\r\n <div");
WriteLiteral(" class=\"logEventsViewportNoLogs\"");
WriteLiteral(" data-bind=\"visible: EventLogs().length == 0\"");
WriteLiteral("\r\n style=\"display: none\"");
WriteLiteral(">\r\n No logs\r\n </div>\r\n <table");
WriteLiteral(" class=\"logEventsViewport\"");
WriteLiteral(" data-bind=\"visible: EventLogs().length > 0\"");
WriteLiteral(" style=\"display: none\"");
WriteLiteral(">\r\n <tbody");
WriteLiteral(" data-bind=\"foreach: EventLogs\"");
WriteLiteral(">\r\n <tr>\r\n <td");
WriteLiteral(" class=\"icon\"");
WriteLiteral(" data-bind=\"css: {information: EventTypeSeverity == 0, warning: EventTypeSeverity" +
" == 1, error: EventTypeSeverity == 2}\"");
WriteLiteral(">\r\n &nbsp;\r\n </td>\r\n " +
" <td");
WriteLiteral(" class=\"timestamp\"");
WriteLiteral(" data-bind=\"text: FormattedTimestamp\"");
WriteLiteral(">\r\n </td>\r\n <td");
WriteLiteral(" class=\"eventType\"");
WriteLiteral(" data-bind=\"text: EventTypeName, attr: {title: ModuleDescription}\"");
WriteLiteral(">\r\n </td>\r\n <td");
WriteLiteral(" class=\"message\"");
WriteLiteral(" data-bind=\"text: FormattedMessage, attr: {title: $parent.LogArguments($data)}\"");
WriteLiteral(">\r\n </td>\r\n </tr>\r\n </tbody>\r\n " +
" </table>\r\n </div>\r\n");
#line 47 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
#line default
#line hidden
#line 47 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
var serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
var eventTypesFilterJson = (Model.EventTypesFilter != null) ? serializer.Serialize(Model.EventTypesFilter.Select(et => et.Id).ToArray()) : "null";
#line default
#line hidden
WriteLiteral("\r\n <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(">\r\n $(function () {\r\n var logEventsHost = $(\'LogEvents_");
#line 53 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
Write(uniqueId);
#line default
#line hidden
WriteLiteral("\');\r\n var logModuleId = \'");
#line 54 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
Write(Model.ModuleFilter != null ? Model.ModuleFilter.ModuleId.ToString() : null);
#line default
#line hidden
WriteLiteral("\';\r\n var logModuleLiveGroupName = \'");
#line 55 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
Write(Model.ModuleFilter != null ? Model.ModuleFilter.LiveLogGroupName : Disco.Services.Logging.LogContext.LiveLogAllEventsGroupName);
#line default
#line hidden
WriteLiteral("\';\r\n var logEventTypeFiltered = ");
#line 56 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
Write(eventTypesFilterJson);
#line default
#line hidden
WriteLiteral(";\r\n var logStartFiler = ");
#line 57 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
Write(AjaxHelpers.JsonDate(Model.StartFilter));
#line default
#line hidden
WriteLiteral(";\r\n var logEndFiler = ");
#line 58 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
Write(AjaxHelpers.JsonDate(Model.EndFilter));
#line default
#line hidden
WriteLiteral(";\r\n var logTakeFiler = \'");
#line 59 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
Write(Model.TakeFilter);
#line default
#line hidden
WriteLiteral("\';\r\n var liveConnection = null;\r\n var liveEventReceivedFunc" +
"tion = \'");
#line 61 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
Write(Model.JavascriptLiveEventFunctionName);
#line default
#line hidden
WriteLiteral("\';\r\n var useLive = (\'True\'===\'");
#line 62 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
Write(Model.IsLive);
#line default
#line hidden
WriteLiteral(@"');
// View Model
var logsViewModel;
function LogsViewModel(initialLogs){
var self = this;
self.EventLogs = ko.observableArray(initialLogs);
self.LogArguments = function(log){
if (log.Arguments)
return log.Arguments.join('\n');
else
return null;
};
}
function formatDate(d){
if (d){
return d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate() + ' ' + d.getHours() + ':'+d.getMinutes()+':'+d.getSeconds();
}else{
return null;
}
}
function loadInitialData(){
// Load Data
var loadData = {
Format: ""json"",
Start: formatDate(logStartFiler),
End: logEndFiler,
ModuleId: logModuleId,
Take: logTakeFiler
};
if (logEventTypeFiltered)
loadData[""EventTypeIds""] = logEventTypeFiltered;
$.ajax({
url: '");
#line 96 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
Write(Url.Action(MVC.API.Logging.RetrieveEvents()));
#line default
#line hidden
WriteLiteral(@"',
dataType: 'json',
type: 'POST',
data: loadData,
success: function (d) {
initLogs(d);
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to retrieve logs: ' + textStatus);
}
});
}
function initLogs(loadedLogs){
logsViewModel = new LogsViewModel(loadedLogs);
ko.applyBindings(logsViewModel, logEventsHost.get(0));
if (useLive){
if (liveEventReceivedFunction){
if (!document.DiscoFunctions) document.DiscoFunctions = {};
if (!document.DiscoFunctions.LogEventsFunctions) document.DiscoFunctions.LogEventsFunctions = {};
if (document.DiscoFunctions.LogEventsFunctions[liveEventReceivedFunction]){
liveEventReceivedFunction = document.DiscoFunctions.LogEventsFunctions[liveEventReceivedFunction];
}else{
liveEventReceivedFunction = null;
}
}
liveConnection = $.connection('");
#line 124 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
Write(Url.Content("~/API/Logging/Notifications"));
#line default
#line hidden
WriteLiteral(@"');
liveConnection.received(logReceived);
liveConnection.error(function(e){alert('Live-Log Error: '+e)});
liveConnection.start(function(){
if (logModuleLiveGroupName){
liveConnection.send('/addToGroups:' + logModuleLiveGroupName);
}
});
}
}
function logReceived(log){
if (log.UseDisplay) logsViewModel.EventLogs.unshift(log);
if (liveEventReceivedFunction) liveEventReceivedFunction(log);
}
loadInitialData();
});
</script>
</div>
");
}
}
}
#pragma warning restore 1591
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17929
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Disco.Web.Areas.Config.Views.Shared
{
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", "1.5.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/Shared/LogEvents.cshtml")]
public class LogEvents : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.Shared.LogEventsModel>
{
public LogEvents()
{
}
public override void Execute()
{
#line 2 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
Html.BundleDeferred("~/ClientScripts/Modules/Knockout");
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR");
var uniqueId = Guid.NewGuid().ToString("N");
#line default
#line hidden
WriteLiteral("\r\n<div");
WriteAttribute("id", Tuple.Create(" id=\"", 251), Tuple.Create("\"", 277)
, Tuple.Create(Tuple.Create("", 256), Tuple.Create("LogEvents_", 256), true)
#line 7 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
, Tuple.Create(Tuple.Create("", 266), Tuple.Create<System.Object, System.Int32>(uniqueId
#line default
#line hidden
, 266), false)
);
WriteLiteral(" class=\"logEventsViewport\"");
WriteLiteral(">\r\n <table");
WriteLiteral(" class=\"logEventsViewport\"");
WriteLiteral(">\r\n <thead>\r\n <tr>\r\n <th");
WriteLiteral(" class=\"icon\"");
WriteLiteral(">&nbsp;\r\n </th>\r\n <th");
WriteLiteral(" class=\"timestamp\"");
WriteLiteral(">Date/Time\r\n </th>\r\n <th");
WriteLiteral(" class=\"eventType\"");
WriteLiteral(">Event Type\r\n </th>\r\n <th");
WriteLiteral(" class=\"message\"");
WriteLiteral(">Message\r\n </th>\r\n </tr>\r\n </thead>\r\n </table" +
">\r\n <div");
WriteLiteral(" class=\"logEventsViewportContainer\"");
WriteAttribute("style", Tuple.Create(" style=\"", 752), Tuple.Create("\"", 962)
#line 22 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
, Tuple.Create(Tuple.Create("", 760), Tuple.Create<System.Object, System.Int32>(Model.ViewPortWidth.HasValue ? string.Format("width:{0}px;", Model.ViewPortWidth.Value) : null
#line default
#line hidden
, 760), false)
#line 22 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
, Tuple.Create(Tuple.Create("", 857), Tuple.Create<System.Object, System.Int32>(Model.ViewPortHeight.HasValue ? string.Format("height:{0}px;", Model.ViewPortHeight.Value - 18) : null
#line default
#line hidden
, 857), false)
);
WriteLiteral(">\r\n <div");
WriteLiteral(" class=\"logEventsViewportNoLogs\"");
WriteLiteral(" data-bind=\"visible: EventLogs().length == 0\"");
WriteLiteral("\r\n style=\"display: none\"");
WriteLiteral(">\r\n No logs\r\n </div>\r\n <table");
WriteLiteral(" class=\"logEventsViewport\"");
WriteLiteral(" data-bind=\"visible: EventLogs().length > 0\"");
WriteLiteral(" style=\"display: none\"");
WriteLiteral(">\r\n <tbody");
WriteLiteral(" data-bind=\"foreach: EventLogs\"");
WriteLiteral(">\r\n <tr>\r\n <td");
WriteLiteral(" class=\"icon\"");
WriteLiteral(" data-bind=\"css: {information: EventTypeSeverity == 0, warning: EventTypeSeverity" +
" == 1, error: EventTypeSeverity == 2}\"");
WriteLiteral(">&nbsp;\r\n </td>\r\n <td");
WriteLiteral(" class=\"timestamp\"");
WriteLiteral(" data-bind=\"text: FormattedTimestamp\"");
WriteLiteral("></td>\r\n <td");
WriteLiteral(" class=\"eventType\"");
WriteLiteral(" data-bind=\"text: EventTypeName, attr: {title: ModuleDescription}\"");
WriteLiteral("></td>\r\n <td");
WriteLiteral(" class=\"message\"");
WriteLiteral(" data-bind=\"text: FormattedMessage, attr: {title: $parent.LogArguments($data)}\"");
WriteLiteral("></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </div>" +
"\r\n");
#line 39 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
#line default
#line hidden
#line 39 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
var serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
var eventTypesFilterJson = (Model.EventTypesFilter != null) ? serializer.Serialize(Model.EventTypesFilter.Select(et => et.Id).ToArray()) : "null";
#line default
#line hidden
WriteLiteral("\r\n <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(">\r\n $(function () {\r\n var logEventsHost = $(\'LogEvents_");
#line 45 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
Write(uniqueId);
#line default
#line hidden
WriteLiteral("\');\r\n var logModuleId = \'");
#line 46 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
Write(Model.ModuleFilter != null ? Model.ModuleFilter.ModuleId.ToString() : null);
#line default
#line hidden
WriteLiteral("\';\r\n var logModuleLiveGroupName = \'");
#line 47 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
Write(Model.ModuleFilter != null ? Model.ModuleFilter.LiveLogGroupName : Disco.Services.Logging.LogContext.LiveLogAllEventsGroupName);
#line default
#line hidden
WriteLiteral("\';\r\n var logEventTypeFiltered = ");
#line 48 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
Write(eventTypesFilterJson);
#line default
#line hidden
WriteLiteral(";\r\n var logStartFiler = ");
#line 49 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
Write(AjaxHelpers.JsonDate(Model.StartFilter));
#line default
#line hidden
WriteLiteral(";\r\n var logEndFiler = ");
#line 50 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
Write(AjaxHelpers.JsonDate(Model.EndFilter));
#line default
#line hidden
WriteLiteral(";\r\n var logTakeFiler = \'");
#line 51 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
Write(Model.TakeFilter);
#line default
#line hidden
WriteLiteral("\';\r\n var liveConnection = null;\r\n var liveEventReceivedFunc" +
"tion = \'");
#line 53 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
Write(Model.JavascriptLiveEventFunctionName);
#line default
#line hidden
WriteLiteral("\';\r\n var useLive = (\'True\'===\'");
#line 54 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
Write(Model.IsLive);
#line default
#line hidden
WriteLiteral(@"');
// View Model
var logsViewModel;
function LogsViewModel(initialLogs){
var self = this;
self.EventLogs = ko.observableArray(initialLogs);
self.LogArguments = function(log){
if (log.Arguments)
return log.Arguments.join('\n');
else
return null;
};
}
function formatDate(d){
if (d){
return d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate() + ' ' + d.getHours() + ':'+d.getMinutes()+':'+d.getSeconds();
}else{
return null;
}
}
function loadInitialData(){
// Load Data
var loadData = {
Format: ""json"",
Start: formatDate(logStartFiler),
End: logEndFiler,
ModuleId: logModuleId,
Take: logTakeFiler
};
if (logEventTypeFiltered)
loadData[""EventTypeIds""] = logEventTypeFiltered;
$.ajax({
url: '");
#line 88 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
Write(Url.Action(MVC.API.Logging.RetrieveEvents()));
#line default
#line hidden
WriteLiteral(@"',
dataType: 'json',
type: 'POST',
data: loadData,
success: function (d) {
initLogs(d);
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to retrieve logs: ' + textStatus);
}
});
}
function initLogs(loadedLogs){
logsViewModel = new LogsViewModel(loadedLogs);
ko.applyBindings(logsViewModel, logEventsHost.get(0));
if (useLive){
if (liveEventReceivedFunction){
if (!document.DiscoFunctions) document.DiscoFunctions = {};
if (!document.DiscoFunctions.LogEventsFunctions) document.DiscoFunctions.LogEventsFunctions = {};
if (document.DiscoFunctions.LogEventsFunctions[liveEventReceivedFunction]){
liveEventReceivedFunction = document.DiscoFunctions.LogEventsFunctions[liveEventReceivedFunction];
}else{
liveEventReceivedFunction = null;
}
}
liveConnection = $.connection('");
#line 116 "..\..\Areas\Config\Views\Shared\LogEvents.cshtml"
Write(Url.Content("~/API/Logging/Notifications"));
#line default
#line hidden
WriteLiteral(@"');
liveConnection.received(logReceived);
liveConnection.error(function(e){if (e.status != 200) alert('Live-Log Error: '+e.statusText +': '+e.responseText);});
liveConnection.start(function(){
if (logModuleLiveGroupName){
liveConnection.send('/addToGroups:' + logModuleLiveGroupName);
}
});
}
}
function logReceived(log){
if (log.UseDisplay) logsViewModel.EventLogs.unshift(log);
if (liveEventReceivedFunction) liveEventReceivedFunction(log);
}
loadInitialData();
});
</script>
</div>
");
}
}
}
#pragma warning restore 1591
@@ -1,46 +1,48 @@
///#source 1 1 /ClientSource/Scripts/Modules/Disco-CreateJob/disco.createjob.js
/// <reference path="../../Core/jquery-1.8.1.js" />
/// <reference path="../../Core/jquery-ui-1.8.23.js" />
(function ($, window, document) {
$(function () {
var createJobDialog = null;
var dialogMethods = {
close: function () {
createJobDialog.dialog('close');
},
setButtons: function (buttons) {
if (createJobDialog)
createJobDialog.dialog('option', 'buttons', buttons);
}
}
// Create Job Button
$('#buttonCreateJob').click(function () {
var $this = $(this);
var href = $this.attr('href');
var iframe = $('<iframe>').attr({ 'src': href }).width('100%').height('100%').css('border', 'none');
createJobDialog = $('<div>').attr('id', 'createJobDialog').width('100%').height('100%')
.appendTo(document)
.append(iframe)
.dialog({
resizable: false,
draggable: false,
modal: true,
autoOpen: true,
title: 'Create Job',
width: 850,
height: $(window).height() - 50,
close: function () {
createJobDialog.find('iframe').attr('src', 'about:blank');
createJobDialog.dialog('destroy').remove();
createJobDialog = null;
},
buttons: {}
});
createJobDialog[0].discoDialogMethods = dialogMethods;
return false;
});
})
})($, window, document);
///#source 1 1 /ClientSource/Scripts/Modules/Disco-CreateJob/disco.createjob.js
/// <reference path="../../Core/jquery-1.8.1.js" />
/// <reference path="../../Core/jquery-ui-1.8.23.js" />
(function ($, window, document) {
$(function () {
var createJobDialog = null;
var dialogMethods = {
close: function () {
createJobDialog.dialog('close');
},
setButtons: function (buttons) {
if (createJobDialog)
createJobDialog.dialog('option', 'buttons', buttons);
}
}
// Create Job Button
$('#buttonCreateJob').click(function () {
var $this = $(this);
var href = $this.attr('href');
createJobDialog = $('<div>').attr('id', 'createJobDialog').width('100%').height('100%').appendTo(document.body);
createJobDialog.dialog({
resizable: false,
draggable: false,
modal: true,
autoOpen: true,
title: 'Create Job',
width: 850,
height: $(window).height() - 50,
close: function () {
createJobDialog.find('iframe').attr('src', 'about:blank');
createJobDialog.dialog('destroy').remove();
createJobDialog = null;
},
buttons: {}
});
var iframe = $('<iframe>').attr({ 'src': href }).width('100%').height('100%').css('border', 'none').appendTo(createJobDialog);
createJobDialog[0].discoDialogMethods = dialogMethods;
return false;
});
})
})($, window, document);
@@ -1,2 +1,2 @@
(function(n,t,i){n(function(){var r=null,u={close:function(){r.dialog("close")},setButtons:function(n){r&&r.dialog("option","buttons",n)}};n("#buttonCreateJob").click(function(){var f=n(this),e=f.attr("href"),o=n("<iframe>").attr({src:e}).width("100%").height("100%").css("border","none");return r=n("<div>").attr("id","createJobDialog").width("100%").height("100%").appendTo(i).append(o).dialog({resizable:!1,draggable:!1,modal:!0,autoOpen:!0,title:"Create Job",width:850,height:n(t).height()-50,close:function(){r.find("iframe").attr("src","about:blank"),r.dialog("destroy").remove(),r=null},buttons:{}}),r[0].discoDialogMethods=u,!1})})})($,window,document);
(function(n,t,i){n(function(){var r=null,u={close:function(){r.dialog("close")},setButtons:function(n){r&&r.dialog("option","buttons",n)}};n("#buttonCreateJob").click(function(){var f=n(this),e=f.attr("href"),o;return r=n("<div>").attr("id","createJobDialog").width("100%").height("100%").appendTo(i.body),r.dialog({resizable:!1,draggable:!1,modal:!0,autoOpen:!0,title:"Create Job",width:850,height:n(t).height()-50,close:function(){r.find("iframe").attr("src","about:blank"),r.dialog("destroy").remove(),r=null},buttons:{}}),o=n("<iframe>").attr({src:e}).width("100%").height("100%").css("border","none").appendTo(r),r[0].discoDialogMethods=u,!1})})})($,window,document);
//@ sourceMappingURL=Disco-CreateJob.min.js.map
@@ -1,8 +1,8 @@
{
"version":3,
"file":"Disco-CreateJob.min.js",
"lineCount":1,
"mappings":"CAGC,QAAS,CAACA,CAAC,CAAEC,CAAM,CAAEC,CAAZ,CAAsB,CAC5BF,CAAC,CAAC,QAAS,CAAA,CAAG,CACV,IAAIG,EAAkB,KAClBC,EAAgB,CAChB,KAAK,CAAEC,QAAS,CAAA,CAAG,CACfF,CAAeG,OAAO,CAAC,OAAD,CADP,CAElB,CACD,UAAU,CAAEC,QAAS,CAACC,CAAD,CAAU,CACvBL,C,EACAA,CAAeG,OAAO,CAAC,QAAQ,CAAE,SAAS,CAAEE,CAAtB,CAFC,CAJf,CADM,CAY1BR,CAAC,CAAC,kBAAD,CAAoBS,MAAM,CAAC,QAAS,CAAA,CAAG,CACpC,IAAIC,EAAQV,CAAC,CAAC,IAAD,EACTW,EAAOD,CAAKE,KAAK,CAAC,MAAD,EACjBC,EAASb,CAAC,CAAC,UAAD,CAAYY,KAAK,CAAC,CAAE,GAAK,CAAED,CAAT,CAAD,CAAiBG,MAAM,CAAC,MAAD,CAAQC,OAAO,CAAC,MAAD,CAAQC,IAAI,CAAC,QAAQ,CAAE,MAAX,CAF9D,CAuBnB,OApBAb,CAAgB,CAAEH,CAAC,CAAC,OAAD,CAASY,KAAK,CAAC,IAAI,CAAE,iBAAP,CAAyBE,MAAM,CAAC,MAAD,CAAQC,OAAO,CAAC,MAAD,CAC3EE,SAAS,CAACf,CAAD,CACTgB,OAAO,CAACL,CAAD,CACPP,OAAO,CAAC,CACJ,SAAS,CAAE,CAAA,CAAK,CAChB,SAAS,CAAE,CAAA,CAAK,CAChB,KAAK,CAAE,CAAA,CAAI,CACX,QAAQ,CAAE,CAAA,CAAI,CACd,KAAK,CAAE,YAAY,CACnB,KAAK,CAAE,GAAG,CACV,MAAM,CAAEN,CAAC,CAACC,CAAD,CAAQc,OAAO,CAAA,CAAG,CAAE,EAAE,CAC/B,KAAK,CAAEV,QAAS,CAAA,CAAG,CACfF,CAAegB,KAAK,CAAC,QAAD,CAAUP,KAAK,CAAC,KAAK,CAAE,aAAR,CAAsB,CACzDT,CAAeG,OAAO,CAAC,SAAD,CAAWc,OAAO,CAAA,CAAE,CAC1CjB,CAAgB,CAAE,IAHH,CAIlB,CACD,OAAO,CAAE,CAAA,CAbL,CAAD,CAcL,CACNA,CAAgB,CAAA,CAAA,CAAEkB,mBAAoB,CAAEjB,CAAa,CAE9C,CAAA,CAxB6B,CAAb,CAbjB,CAAb,CAD2B,EAyC9B,CAACJ,CAAC,CAAEC,MAAM,CAAEC,QAAZ,CAAqB",
"sources":["/ClientSource/Scripts/Modules/Disco-CreateJob/disco.createjob.js"],
"names":["$","window","document","createJobDialog","dialogMethods","close","dialog","setButtons","buttons","click","$this","href","attr","iframe","width","height","css","appendTo","append","find","remove","discoDialogMethods"]
}
{
"version":3,
"file":"Disco-CreateJob.min.js",
"lineCount":1,
"mappings":"CAGC,QAAS,CAACA,CAAC,CAAEC,CAAM,CAAEC,CAAZ,CAAsB,CAC5BF,CAAC,CAAC,QAAS,CAAA,CAAG,CACV,IAAIG,EAAkB,KAClBC,EAAgB,CAChB,KAAK,CAAEC,QAAS,CAAA,CAAG,CACfF,CAAeG,OAAO,CAAC,OAAD,CADP,CAElB,CACD,UAAU,CAAEC,QAAS,CAACC,CAAD,CAAU,CACvBL,C,EACAA,CAAeG,OAAO,CAAC,QAAQ,CAAE,SAAS,CAAEE,CAAtB,CAFC,CAJf,CADM,CAY1BR,CAAC,CAAC,kBAAD,CAAoBS,MAAM,CAAC,QAAS,CAAA,CAAG,CACpC,IAAIC,EAAQV,CAAC,CAAC,IAAD,EACTW,EAAOD,CAAKE,KAAK,CAAC,MAAD,EAoBjBC,CArBe,CAyBnB,OAtBAV,CAAgB,CAAEH,CAAC,CAAC,OAAD,CAASY,KAAK,CAAC,IAAI,CAAE,iBAAP,CAAyBE,MAAM,CAAC,MAAD,CAAQC,OAAO,CAAC,MAAD,CAAQC,SAAS,CAACd,CAAQe,KAAT,CAAe,CAE/Gd,CAAeG,OAAO,CAAC,CACnB,SAAS,CAAE,CAAA,CAAK,CAChB,SAAS,CAAE,CAAA,CAAK,CAChB,KAAK,CAAE,CAAA,CAAI,CACX,QAAQ,CAAE,CAAA,CAAI,CACd,KAAK,CAAE,YAAY,CACnB,KAAK,CAAE,GAAG,CACV,MAAM,CAAEN,CAAC,CAACC,CAAD,CAAQc,OAAO,CAAA,CAAG,CAAE,EAAE,CAC/B,KAAK,CAAEV,QAAS,CAAA,CAAG,CACfF,CAAee,KAAK,CAAC,QAAD,CAAUN,KAAK,CAAC,KAAK,CAAE,aAAR,CAAsB,CACzDT,CAAeG,OAAO,CAAC,SAAD,CAAWa,OAAO,CAAA,CAAE,CAC1ChB,CAAgB,CAAE,IAHH,CAIlB,CACD,OAAO,CAAE,CAAA,CAbU,CAAD,CAcpB,CAEEU,CAAO,CAAEb,CAAC,CAAC,UAAD,CAAYY,KAAK,CAAC,CAAE,GAAK,CAAED,CAAT,CAAD,CAAiBG,MAAM,CAAC,MAAD,CAAQC,OAAO,CAAC,MAAD,CAAQK,IAAI,CAAC,QAAQ,CAAE,MAAX,CAAkBJ,SAAS,CAACb,CAAD,C,CAE5GA,CAAgB,CAAA,CAAA,CAAEkB,mBAAoB,CAAEjB,CAAa,CAE9C,CAAA,CA1B6B,CAAb,CAbjB,CAAb,CAD2B,EA2C9B,CAACJ,CAAC,CAAEC,MAAM,CAAEC,QAAZ,CAAqB",
"sources":["/ClientSource/Scripts/Modules/Disco-CreateJob/disco.createjob.js"],
"names":["$","window","document","createJobDialog","dialogMethods","close","dialog","setButtons","buttons","click","$this","href","attr","iframe","width","height","appendTo","body","find","remove","css","discoDialogMethods"]
}
@@ -1,45 +1,47 @@
/// <reference path="../../Core/jquery-1.8.1.js" />
/// <reference path="../../Core/jquery-ui-1.8.23.js" />
(function ($, window, document) {
$(function () {
var createJobDialog = null;
var dialogMethods = {
close: function () {
createJobDialog.dialog('close');
},
setButtons: function (buttons) {
if (createJobDialog)
createJobDialog.dialog('option', 'buttons', buttons);
}
}
// Create Job Button
$('#buttonCreateJob').click(function () {
var $this = $(this);
var href = $this.attr('href');
var iframe = $('<iframe>').attr({ 'src': href }).width('100%').height('100%').css('border', 'none');
createJobDialog = $('<div>').attr('id', 'createJobDialog').width('100%').height('100%')
.appendTo(document)
.append(iframe)
.dialog({
resizable: false,
draggable: false,
modal: true,
autoOpen: true,
title: 'Create Job',
width: 850,
height: $(window).height() - 50,
close: function () {
createJobDialog.find('iframe').attr('src', 'about:blank');
createJobDialog.dialog('destroy').remove();
createJobDialog = null;
},
buttons: {}
});
createJobDialog[0].discoDialogMethods = dialogMethods;
return false;
});
})
/// <reference path="../../Core/jquery-1.8.1.js" />
/// <reference path="../../Core/jquery-ui-1.8.23.js" />
(function ($, window, document) {
$(function () {
var createJobDialog = null;
var dialogMethods = {
close: function () {
createJobDialog.dialog('close');
},
setButtons: function (buttons) {
if (createJobDialog)
createJobDialog.dialog('option', 'buttons', buttons);
}
}
// Create Job Button
$('#buttonCreateJob').click(function () {
var $this = $(this);
var href = $this.attr('href');
createJobDialog = $('<div>').attr('id', 'createJobDialog').width('100%').height('100%').appendTo(document.body);
createJobDialog.dialog({
resizable: false,
draggable: false,
modal: true,
autoOpen: true,
title: 'Create Job',
width: 850,
height: $(window).height() - 50,
close: function () {
createJobDialog.find('iframe').attr('src', 'about:blank');
createJobDialog.dialog('destroy').remove();
createJobDialog = null;
},
buttons: {}
});
var iframe = $('<iframe>').attr({ 'src': href }).width('100%').height('100%').css('border', 'none').appendTo(createJobDialog);
createJobDialog[0].discoDialogMethods = dialogMethods;
return false;
});
})
})($, window, document);
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
@@ -1463,6 +1463,11 @@ footer a:visited,
footer a:active,
#footer a:active {
color: #777;
}
footer a:link,
#footer a:link,
footer a:active,
#footer a:active {
text-decoration: underline;
}
footer a:hover,
File diff suppressed because one or more lines are too long
+13 -5
View File
@@ -1,15 +1,22 @@
.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;
}
.tableDataDark {
border: solid 1px #8db2d8;
border-collapse: collapse;
@@ -97,11 +104,12 @@ table.deviceShow td.model {
table.deviceShow td.model table td {
text-align: center;
}
table.deviceShow #deviceBatchDetails {
table.deviceShow #deviceBatchSummary {
display: none;
font-size: 0.9em;
}
table.deviceShow #deviceBatchEdit {
table.deviceShow #deviceBatchDetails,
table.deviceShow #deviceProfileDetails {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACQElEQVQ4EQXBT4uVVRwA4Od3znnn3pkmi4poFQRFNYuMoAyirAnqI7Rr20dxX7iUFkmLaNNCglaRGGRaQUSZCFLUwlD8MzN6733P+fU8cer02TOHh/dfnue+mnvXx9DnYYw0j05QS1GjmLaqxdZkqpWIxUM7yx/bVNvrx/ee37u/Wtn0ofdu3gzzPMyjE7RStFoc2922WExaqaZFc/Xa9dZ6xjMvvfCsu4dHNn2Y+9DnbrMeNqMTTKWordpeTJbLyaJVOztbrlz7+7l272jt8u9/2WxmBAEASEgiJACmWt05XGvbuw/n/jsnLCcEoCNQkIAAQNIH/3x+I9sYaXuLY/MN7qPN7D5Obrh7Dw2BBCRL1ssnQYtIPXHxlLHztfHf09p7X8l5Zfy0Lx6tDACMmYM39P0zQmo50hhoa2XvirzwFDBmlkN58Q9mAHTylxPGIHNotVVTo6+O+P4D+gElKI2D4/qFV4CxZnqEfkQtAqVUrQQxqPufAjBWYmtbff8LAAAAuaa2hTbG0OHyx/rRVR7cUt89Ix/cMS58xM4TAMCYWd/m7c9EDK2WYmp48Kf62mn9u5OMoC1xXX31LDMABnnpQ5JAK0EUcr0xvt0XuUtM5BCxNn54iwTA6MxdFJTQosRyQpz8RF0V2kwtoj4m3jxPVgBAsjVMhVCW7c7tm79+ee783qabQZLZpSCCJEqkJDMjSmQRWjHdvPHvb+3w4O43ly79fKuPXMuUSIxMMkEpNTOHzIwoJVvUjLAs1cX/AdqeHE5xuOGdAAAAAElFTkSuQmCC) /*Images/Actions/editForm.png*/;
}
a.unlocked16 {
+141 -141
View File
@@ -1,142 +1,142 @@
@import "Shared";
// Device Show
table.deviceShow
{
td.details{
padding: 0;
&>table {
.tableDataVertical;
}
}
td.model {
width: 300px;
table {
td {
text-align: center;
}
}
}
#deviceBatchDetails {
display: none;
font-size: 0.9em;
}
#deviceBatchEdit {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACQElEQVQ4EQXBT4uVVRwA4Od3znnn3pkmi4poFQRFNYuMoAyirAnqI7Rr20dxX7iUFkmLaNNCglaRGGRaQUSZCFLUwlD8MzN6733P+fU8cer02TOHh/dfnue+mnvXx9DnYYw0j05QS1GjmLaqxdZkqpWIxUM7yx/bVNvrx/ee37u/Wtn0ofdu3gzzPMyjE7RStFoc2922WExaqaZFc/Xa9dZ6xjMvvfCsu4dHNn2Y+9DnbrMeNqMTTKWordpeTJbLyaJVOztbrlz7+7l272jt8u9/2WxmBAEASEgiJACmWt05XGvbuw/n/jsnLCcEoCNQkIAAQNIH/3x+I9sYaXuLY/MN7qPN7D5Obrh7Dw2BBCRL1ssnQYtIPXHxlLHztfHf09p7X8l5Zfy0Lx6tDACMmYM39P0zQmo50hhoa2XvirzwFDBmlkN58Q9mAHTylxPGIHNotVVTo6+O+P4D+gElKI2D4/qFV4CxZnqEfkQtAqVUrQQxqPufAjBWYmtbff8LAAAAuaa2hTbG0OHyx/rRVR7cUt89Ix/cMS58xM4TAMCYWd/m7c9EDK2WYmp48Kf62mn9u5OMoC1xXX31LDMABnnpQ5JAK0EUcr0xvt0XuUtM5BCxNn54iwTA6MxdFJTQosRyQpz8RF0V2kwtoj4m3jxPVgBAsjVMhVCW7c7tm79+ee783qabQZLZpSCCJEqkJDMjSmQRWjHdvPHvb+3w4O43ly79fKuPXMuUSIxMMkEpNTOHzIwoJVvUjLAs1cX/AdqeHE5xuOGdAAAAAElFTkSuQmCC) /*Images/Actions/editForm.png*/;
}
}
a.unlocked16 {
height: 16px;
width: 16px;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACWUlEQVQ4y6XRXWiSURgHcJsXa4WNNuuyiy6CoAupixERoXXhmljuxaJiFrVA1i72cVFCOSMt8rNt2YfGO5g5Z1NstWW+c4ZBq4QpqMkEbZDSCObAMprjdf90sIjxsgUdODd/zvmd5zwPCwDrf/aGB7q6utgmk8ngdruzVqt10eVyTWu1Wuk/AXK5vMpoNPpjsRgGbU8/9fbdH/J4PAuRSARKpfLKhoBYLG595nTCaDSZVjPp6TPbHQ5H0mAwfBeJRHXrAp0dna9JcqCguX2H/Xd+S625aLFYQBDE8XWBd+8/TI6Njc+vzcfGX4nLX4FOp5OuC0wGAlS53NzaPPAm2Gi32+H3+5tYJEl+pigKoVAIPp+PnpqaosPhMF1uHB2Px2mv14vya6VgMKhhHGN3d/dSMplENptFIpHA3NwcCoUCSqUSKqvScZVKBbPZHGQEFApFMZ1OI5PJIBqNrkD5fB40Ta8AlcrUajVsNpufEbh+42YxHEkh+/UbUqlZpGd/lAH8WTMzMzDd64d7NMAMDOobi/OpHqh6rqK9jcCvBQncQzK0Xm5DPn0BJ4lz6GgVIkedYAaamxqK0dEDePl4FziczehTsZGLs7BnNwdiwRac4lejvp6La83VzABv/8FF/qG9oD/WQS/fhNptHEw8rEJiuAo7ubXACAtH9m0Fu2YHxQzweEuEVIYnaiFmvQ04f1aItksi5KaP4ZFGjDB5GG/7j4LL5YYYgZYW2c/yiJbv6h/A0EvC4RjGiOsFnK4J+KgABmyjsDufL0skki8CgYCoXOLz+TWrwG+kXMkgQ6yv+QAAAABJRU5ErkJggg==) /*Images/Actions/unlocked.png*/;
display: inline-block;
text-decoration: none !important;
}
a.locked16 {
height: 16px;
width: 16px;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACgklEQVQ4y5XSXUhTYRgH8OkItViSri676CIIupC6kIjIrQTNtLbhMEOLmjGsi1CiJoULZmEpW4l5RDehkR/owJNF+3DLliMd6GDWcrFNyNEceAarZZuc7d8xSNQzgx54Lt6v3/vxvBwAnI3Z0NDAJQiifWJiImgwGOIkScasVuuMWq2u3Dp3LTc15HJ5Zk9PzzhFURh79fpTr7avv4voHns/ORkJh8NQqVTX/wmIxWLZW5sNBNGt3tgvrareYzQavVqt9nt5eXnetkCTosk4OkrGWh485G7dqfXR4yvMlSCVSs9sC3z2frFOTU0vp7ur2TJe4XA4oNFoKrcFZl0us9lsodIBk44PpSaTCXa7vSwtoNPpAsxqOJ1OBAIBOhKJ0PF4nE6lUjQzTq+srKR8Ph/m5uaSS0tLLSygsbFx1ev1IhgMwuPxIBQKIRaLIZlM4m+4XC4olUp0dna+YwEKhSLh9/uxuLgIt9v9B4pGo6Bpeh1YOx1TSuj1+nEWcPfe/cSsy4fgtzB8vgX4F34wADbF/Pw81JoOGEgbG3jeVppY9jVD2XwbN+ol+BURwdBfC1ldPaL+ywi5ZTgvuYibshJQ5nNsQFxWmHCTRzHWvR88XjaeKrmgPnJw8AAPFcKdzANkQCrIQn4+H3fEWWyg4MixuOD4IdDTeWiTZyB3Nw+Wrkx4BjOxj5+LW1XZwDAHJw/vAjdnr5kNFBSsSipr0asqwcKbQlyqLkH91bOgZk6DaKlgfuAFzOpOwN5xCnw+37kOFBcX7ygqKrpWU1P7kylPqrXtGdqf6DAwMIjhkZcYGrHAZLbBYrGhT0/ixdBoSiQSfRUKhRKBQJDDSffr/id/A3fSz48XbZuBAAAAAElFTkSuQmCC) /*Images/Actions/locked.png*/;
display: inline-block;
text-decoration: none !important;
}
#deviceShowResources {
margin-top: 10px;
#Attachments {
padding: 0;
border: 1px solid @SubtleBorderColour;
div.attachmentOutput {
height: 115px;
overflow: auto;
font-size: 0.95em;
&>a{
display: block;
float: left;
height: 48px;
width: 221px;
padding: 2px;
margin: 2px;
font-size: 0.9em;
border: 1px solid #fff;
color: #000;
text-decoration: none;
span.comments, span.author, span.timestamp {
display: block;
float: left;
width: 168px;
overflow: hidden;
height: 16px;
}
span.author {
color: #888;
width: 150px;
}
span.timestamp {
color: #888;
font-style: italic;
}
span.icon {
display: block;
float: left;
height: 48px;
width: 48px;
margin-right: 2px;
img {
height: 48px;
width: 48px;
}
}
&:hover {
background-color: @SubtleColour;
border: 1px solid @SubtleBorderColour;
.border-radius(3px);
span.remove {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADHklEQVQ4T22SeUgUcRTHZ/aY2dnZLdfWI4KuP+zQsja7KMraXaMsOrUghe6DMjNXN7LlSyt2EHZAqbgdZFRQ/xR0QGVqZmi6h2mnVHYYBboVbgvS8evtSkHWF74w897nvTfv9xuO+48uRAyMrpqSnNSYssD6wJxqrUxISjonG6P7cv/otNZgfDR/cXrPwcO72dXrYK5TYKXlYMdLEUShw2uZu9wl6KP61oV1NiJmaFfGKhvLtYNtziJvA9u0FWzj1t73bTvAbHZ0LF2R55INw/8qPiboI9/PnpPH5i1C98RpaCP3TJ6On8kpYMlWfJthwSvLfAQnTQebtxBtU2fkH1JqjX8aVA0alvY13oQXsUPgWbkar5o8eEjgZ0MsvpAfWlPRTjFf5hq8jRmMwKhEXIkatCJcfICXjI8NsbsbVRJq4xIQCATAGIP/wwe4x09GU4IJne86wrFAMIgHI8fCp9KgQR/pcPKaaK5YKU24IehwjFPijCCiBXvwk+CQuzreo/Ptu/DzD/ITZxEuiRqcIPayQoMiXpzIOVWSuYSm2zkVijkFXBwHT64N/s4ufO7uDtvv98OXZ0cF5UqJ2UtsGS+gkBetnF0lWQrVEhZzPLZTsoigihHxeNbcjJevX+Nlezuet7bifMI4HKVcEU3fTJyDVyGfF1O4HKXGVCZosY4aZBNQPHoM6quq4aWi1qdPw/a2tKLhbi1KEidgFzFrid2nUCMntMIGTjCe1OgcRyhRNmQ4am7eRmVdHercHrizsuHZkoX7Hg9u1d6Fr9GLK4mTsJ/YEqXo2MgJvX/nLrWUVklrXJB1qN/jRLXbDU92DqoJrCF7qVENNWncfwAX+/XDNZpeoBB7rzGkTE4wuCS9rVkp4o5CgC/ZDB/t2UZ+QW6hT26ZZUYVXV8THWC5WsqnmgF/GoSUwQuDK7T9c98IMjpoalCtBYuMATMORI9Gj48Ua1dKqBBkWyYvDPur+LfSOXUkRN2yexFRBf64eHyflYLvMy34NGosGgwxBU5BTkvvO/l/WkIHu14lm3bqjGa7bDBvUMumpRTry4X0C+L3YvcBfxOhAAAAAElFTkSuQmCC) /*Images/Actions/removeSubtle.png*/;
}
}
span.remove {
display: block;
float: left;
height: 16px;
width: 16px;
margin-left: 2px;
&:hover {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADG0lEQVQ4y3WTCUhUURSG35vlvnnzZsoJQyMo2nTMKdsXEtOcjKxogwhKaDFNysysJooQRzTLbIFScVrIaMEiElqgMjUzsnEWl1apbNG0dCqcJiarv+NEgWEPfnj3nO/+5567cAC4f3XOb5ChfFrkemvMgn0PoufllhkmJZ2R/Mf0xfYanFTr9A/nL77ozT3oxZVrgOUEUFAEHC2AJz3zm8M495KFaUf3aXDaLyCqc+WqdqSZgKRk0iZg/UYgcePv8aYtwFYTWpYu/2CRdMZeBkeYdmTrrDnvEbsIXZNnoInknRqOn5ExQORsdEcY8dI4H54p4UDsQjRNj+g8IFfr/xqUDx5W8iV0Ap4HDoV9xWq8rLWjnsBPukB8JtXPnodmijnj1uBNwBC4Q8JQOnBwqc9gLy/qH+kCvVaFiKogA9xuN3o+V1sbbOOnotYwAR1vW3wxt8eDB/qxcCpUqNEO6DbzKgOXJxcTrjMNjnBynGICGtIz8JPgHnW2tKLjzVvf/w/SY3MWLggqHCP2skyFLF7YwJkV4p58qm7iFMjjZLBQV/a0rXB1dOJTV5dPLpcLzm0mFFOugJhsYgt5hkxeyOVMCjEnUyliMcdjMyWzCCoODsXTujq8ePUKL5qb8ayxEWcN43CYcllUPYm43bwC23lhP5cqV60rZGrEk0EKAXmjx+B+eQUcNKnxyROfHA2NqLlThfywidhJzFpi98iUSO1pIYFj+uMqzbdDlCgcOhyVN26hrLoa1TY7bMkpsG9Ixj27HTer7sBpdaA0bApyiM2XC92JHDP4jnGnUiwpozbOSRrczzCjwmaDPSUVFQRWkhxkVEkm1py9KOnXD1ep+i6ZcPnvPYjj2AiLqG2vkwu4LWNwRkbDSX02kZ6TGmjJDVHRKKfjq6UNLFKKHTQnqNdVXsmz8GJ1/3evmYQWCnuUamBAAOA/CF6VFu0Ua5aLKGZSexzPZvX5mJZxylHpgub8Xb+BX11BofgeFYPvM434GDIWNbqAr2YmlSzjWPB/X+MfLaGNXaeQ4ndo/LNNki47QSnFL+VYSF/sL7crTEWWnWvrAAAAAElFTkSuQmCC) /*Images/Actions/remove.png*/;
}
}
}
}
div.attachmentInput {
border-top: 1px solid @SubtleBorderColour;
height: 40px;
background-color: #fff;
padding: 3px;
span.action {
display: block;
margin: 2px 4px 0 0;
height: 32px;
width: 32px;
cursor: pointer;
float: right;
border: 1px solid #fff;
padding: 3px;
background-repeat: no-repeat;
background-position: 2px 3px;
&:hover {
background-color: @SubtleColour;
border: 1px solid @SubtleBorderColour;
.border-radius(3px);
}
}
span.upload {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAFPUlEQVRYw7VXayzkVxRfy4yKTj0aj6JWJISuR9EiWj5IFZt4pB+kLYmdbEJEJpp2daeIJkRNMx7xqFcl0iXxaKwVj8ishhG+eARr10wY6hVMx3gM1mNxeo7YRDfzNr3Jyfzn/u/939899/x+59xbAHDLEIbNxNHRMSQ5OTmvuLi4pbS0tDU1NbXA3d09FN8ZqZxniMVZLJZvSUnJ0NHREVA7PDwEhUIBb1pNTU2PtbW1+/8CwMvLiz07O/uKFqqrq9sNDAzstLCw4Jubm/Pd3NyeZGdnb56dncH09LQUQfgaFIC9vX30+vr6uUwmg5CQkD509Rdo75HL0W6jWaJF+/n5CRcXF0EgEEiMjIw+MAgAbM7d3d1/y6QywAU68b+NmrFeYWFhwtPTU8jIyKi/MQDaXU5OjoDcHhsb+4x2fdX/jqqAwxbf0dFxNj4+vofPtjcCgO7+gRbn8/lSS0vLjPT09KrOp09F/f39S9XV1QOhoaFsXITxFoD3cfcv8MgA2RKuNwAzM7MgsVh8MDAwAAkJCRI8230CIxKJYHh4GLa2ti4jv6CggI7F7BoABlJ0cHNzEzA4v9ELADar1tZWkVQqBS6Xe4G/F/Pz8xAdHT2KwZWN7zkODg7NVVVVr87PzyErK6vp2lxTnDO2vLwMOCZeLwBsNvu3K9fDxMQEjI2NgZ2dXSl+3OnaQtZo3Pr6+qNt+TZ4enreu+q/09nZuUdeQrA+OgNwdXX9en9/H5qbm+Hx48dAO/fw8PiddqbEUyyMg66VlRVg379fQ32+vr4Z5Lnc3Nzn/zkabRY3MTHxmJmZ2UExgfz8fKBAiomJ+Usd9fCcc+fm5gDluB3HOSLwtcnJSXB2dv5JJxoS5crLy58dHx9DXl4eLCwsAMquFPs/VjcvPDy8dHV1FeLi4v7E6O+V4e7j4+MHiQ06AYiIiPiRzh2TC/T19YFQKASUWo4G0GZlZWUvpqamyAOLBATnb2N/sE5S7OTk9KVcLn/d09MDlZWVl+fu4+PTSIKjbh7GRuqCZIGSEAwNDV2gPgDmgYc6J6PMzMxW0nDk9MXa2hqkpaW9vB7xyozBYNzt7e3dHRkZuQxYiURCUv2HKtBqzx75yk1MTFwmFzY1Nb1G+sRrcL1RFpcr2NzYgNraWlheWgIOhyOmvKFXPYDtM3S/ggLP1tb2F3WFBZm/v/93BLaxsRFGR0ehoaHhBEF/pXYNdRUOj8cTUgCi0hHlWGqLEgvW5+j2EwrS9vb2SwB29vY/a2SZqhcoJFxaHClH0fuppqjHceO0exKpJXQ96kQ/9r+rFwAmkxmMCeeIdoGUe6gFVX8lnpPrUbCAV8iT4eKfaJVflHUidxtp9ygiAk2Uo927uLhUFBUVnVDkd3V1nZuamj7QOsEpy3iYNJZINq2srBK0zJKeKDT/EGVR8yk/3L4JgLuDg4PHLS0tB/j8oTYfSUpKqtuWyyElJeWltnPUAfDHKD5FEaHgs9T0gYCAAA4lJ6yEdnF8hM7lnRIAd1D5VijfI/eDNVRH/pjfD0jzsS54pFd9qQQAMygoqJ3Eh1dYSKU2U0WKdseiQ0QlVmRkJI0zNwiAKxAxWD5t7ezsAGa1IaTiR9dLK6xyvu3q7pYeHhwAFqQktZ56l/cqAJgaGxt/z+cXHSr2FEA3n8qKihEsRnoxOCUbqPVkmOdXcGzoje6U6vhNRWZUVNTztra2szmxGIhmVAei6u17e3s/wfchN77UarrxknvRHuAFtMjGxqacwWQ8omjXlBsMAuAtMMYEyFDX+Tf2LzGXbu1DZYkMAAAAAElFTkSuQmCC) /*Images/Actions/attach.png*/;
}
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*/;
}
}
}
@import "Shared";
// Device Show
table.deviceShow
{
td.details{
padding: 0;
&>table {
.tableDataVertical;
}
}
td.model {
width: 300px;
table {
td {
text-align: center;
}
}
}
#deviceBatchSummary {
display: none;
font-size: 0.9em;
}
#deviceBatchDetails, #deviceProfileDetails {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACQElEQVQ4EQXBT4uVVRwA4Od3znnn3pkmi4poFQRFNYuMoAyirAnqI7Rr20dxX7iUFkmLaNNCglaRGGRaQUSZCFLUwlD8MzN6733P+fU8cer02TOHh/dfnue+mnvXx9DnYYw0j05QS1GjmLaqxdZkqpWIxUM7yx/bVNvrx/ee37u/Wtn0ofdu3gzzPMyjE7RStFoc2922WExaqaZFc/Xa9dZ6xjMvvfCsu4dHNn2Y+9DnbrMeNqMTTKWordpeTJbLyaJVOztbrlz7+7l272jt8u9/2WxmBAEASEgiJACmWt05XGvbuw/n/jsnLCcEoCNQkIAAQNIH/3x+I9sYaXuLY/MN7qPN7D5Obrh7Dw2BBCRL1ssnQYtIPXHxlLHztfHf09p7X8l5Zfy0Lx6tDACMmYM39P0zQmo50hhoa2XvirzwFDBmlkN58Q9mAHTylxPGIHNotVVTo6+O+P4D+gElKI2D4/qFV4CxZnqEfkQtAqVUrQQxqPufAjBWYmtbff8LAAAAuaa2hTbG0OHyx/rRVR7cUt89Ix/cMS58xM4TAMCYWd/m7c9EDK2WYmp48Kf62mn9u5OMoC1xXX31LDMABnnpQ5JAK0EUcr0xvt0XuUtM5BCxNn54iwTA6MxdFJTQosRyQpz8RF0V2kwtoj4m3jxPVgBAsjVMhVCW7c7tm79+ee783qabQZLZpSCCJEqkJDMjSmQRWjHdvPHvb+3w4O43ly79fKuPXMuUSIxMMkEpNTOHzIwoJVvUjLAs1cX/AdqeHE5xuOGdAAAAAElFTkSuQmCC) /*Images/Actions/editForm.png*/;
}
}
a.unlocked16 {
height: 16px;
width: 16px;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACWUlEQVQ4y6XRXWiSURgHcJsXa4WNNuuyiy6CoAupixERoXXhmljuxaJiFrVA1i72cVFCOSMt8rNt2YfGO5g5Z1NstWW+c4ZBq4QpqMkEbZDSCObAMprjdf90sIjxsgUdODd/zvmd5zwPCwDrf/aGB7q6utgmk8ngdruzVqt10eVyTWu1Wuk/AXK5vMpoNPpjsRgGbU8/9fbdH/J4PAuRSARKpfLKhoBYLG595nTCaDSZVjPp6TPbHQ5H0mAwfBeJRHXrAp0dna9JcqCguX2H/Xd+S625aLFYQBDE8XWBd+8/TI6Njc+vzcfGX4nLX4FOp5OuC0wGAlS53NzaPPAm2Gi32+H3+5tYJEl+pigKoVAIPp+PnpqaosPhMF1uHB2Px2mv14vya6VgMKhhHGN3d/dSMplENptFIpHA3NwcCoUCSqUSKqvScZVKBbPZHGQEFApFMZ1OI5PJIBqNrkD5fB40Ta8AlcrUajVsNpufEbh+42YxHEkh+/UbUqlZpGd/lAH8WTMzMzDd64d7NMAMDOobi/OpHqh6rqK9jcCvBQncQzK0Xm5DPn0BJ4lz6GgVIkedYAaamxqK0dEDePl4FziczehTsZGLs7BnNwdiwRac4lejvp6La83VzABv/8FF/qG9oD/WQS/fhNptHEw8rEJiuAo7ubXACAtH9m0Fu2YHxQzweEuEVIYnaiFmvQ04f1aItksi5KaP4ZFGjDB5GG/7j4LL5YYYgZYW2c/yiJbv6h/A0EvC4RjGiOsFnK4J+KgABmyjsDufL0skki8CgYCoXOLz+TWrwG+kXMkgQ6yv+QAAAABJRU5ErkJggg==) /*Images/Actions/unlocked.png*/;
display: inline-block;
text-decoration: none !important;
}
a.locked16 {
height: 16px;
width: 16px;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACgklEQVQ4y5XSXUhTYRgH8OkItViSri676CIIupC6kIjIrQTNtLbhMEOLmjGsi1CiJoULZmEpW4l5RDehkR/owJNF+3DLliMd6GDWcrFNyNEceAarZZuc7d8xSNQzgx54Lt6v3/vxvBwAnI3Z0NDAJQiifWJiImgwGOIkScasVuuMWq2u3Dp3LTc15HJ5Zk9PzzhFURh79fpTr7avv4voHns/ORkJh8NQqVTX/wmIxWLZW5sNBNGt3tgvrareYzQavVqt9nt5eXnetkCTosk4OkrGWh485G7dqfXR4yvMlSCVSs9sC3z2frFOTU0vp7ur2TJe4XA4oNFoKrcFZl0us9lsodIBk44PpSaTCXa7vSwtoNPpAsxqOJ1OBAIBOhKJ0PF4nE6lUjQzTq+srKR8Ph/m5uaSS0tLLSygsbFx1ev1IhgMwuPxIBQKIRaLIZlM4m+4XC4olUp0dna+YwEKhSLh9/uxuLgIt9v9B4pGo6Bpeh1YOx1TSuj1+nEWcPfe/cSsy4fgtzB8vgX4F34wADbF/Pw81JoOGEgbG3jeVppY9jVD2XwbN+ol+BURwdBfC1ldPaL+ywi5ZTgvuYibshJQ5nNsQFxWmHCTRzHWvR88XjaeKrmgPnJw8AAPFcKdzANkQCrIQn4+H3fEWWyg4MixuOD4IdDTeWiTZyB3Nw+Wrkx4BjOxj5+LW1XZwDAHJw/vAjdnr5kNFBSsSipr0asqwcKbQlyqLkH91bOgZk6DaKlgfuAFzOpOwN5xCnw+37kOFBcX7ygqKrpWU1P7kylPqrXtGdqf6DAwMIjhkZcYGrHAZLbBYrGhT0/ixdBoSiQSfRUKhRKBQJDDSffr/id/A3fSz48XbZuBAAAAAElFTkSuQmCC) /*Images/Actions/locked.png*/;
display: inline-block;
text-decoration: none !important;
}
#deviceShowResources {
margin-top: 10px;
#Attachments {
padding: 0;
border: 1px solid @SubtleBorderColour;
div.attachmentOutput {
height: 115px;
overflow: auto;
font-size: 0.95em;
&>a{
display: block;
float: left;
height: 48px;
width: 221px;
padding: 2px;
margin: 2px;
font-size: 0.9em;
border: 1px solid #fff;
color: #000;
text-decoration: none;
span.comments, span.author, span.timestamp {
display: block;
float: left;
width: 168px;
overflow: hidden;
height: 16px;
}
span.author {
color: #888;
width: 150px;
}
span.timestamp {
color: #888;
font-style: italic;
}
span.icon {
display: block;
float: left;
height: 48px;
width: 48px;
margin-right: 2px;
img {
height: 48px;
width: 48px;
}
}
&:hover {
background-color: @SubtleColour;
border: 1px solid @SubtleBorderColour;
.border-radius(3px);
span.remove {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADHklEQVQ4T22SeUgUcRTHZ/aY2dnZLdfWI4KuP+zQsja7KMraXaMsOrUghe6DMjNXN7LlSyt2EHZAqbgdZFRQ/xR0QGVqZmi6h2mnVHYYBboVbgvS8evtSkHWF74w897nvTfv9xuO+48uRAyMrpqSnNSYssD6wJxqrUxISjonG6P7cv/otNZgfDR/cXrPwcO72dXrYK5TYKXlYMdLEUShw2uZu9wl6KP61oV1NiJmaFfGKhvLtYNtziJvA9u0FWzj1t73bTvAbHZ0LF2R55INw/8qPiboI9/PnpPH5i1C98RpaCP3TJ6On8kpYMlWfJthwSvLfAQnTQebtxBtU2fkH1JqjX8aVA0alvY13oQXsUPgWbkar5o8eEjgZ0MsvpAfWlPRTjFf5hq8jRmMwKhEXIkatCJcfICXjI8NsbsbVRJq4xIQCATAGIP/wwe4x09GU4IJne86wrFAMIgHI8fCp9KgQR/pcPKaaK5YKU24IehwjFPijCCiBXvwk+CQuzreo/Ptu/DzD/ITZxEuiRqcIPayQoMiXpzIOVWSuYSm2zkVijkFXBwHT64N/s4ufO7uDtvv98OXZ0cF5UqJ2UtsGS+gkBetnF0lWQrVEhZzPLZTsoigihHxeNbcjJevX+Nlezuet7bifMI4HKVcEU3fTJyDVyGfF1O4HKXGVCZosY4aZBNQPHoM6quq4aWi1qdPw/a2tKLhbi1KEidgFzFrid2nUCMntMIGTjCe1OgcRyhRNmQ4am7eRmVdHercHrizsuHZkoX7Hg9u1d6Fr9GLK4mTsJ/YEqXo2MgJvX/nLrWUVklrXJB1qN/jRLXbDU92DqoJrCF7qVENNWncfwAX+/XDNZpeoBB7rzGkTE4wuCS9rVkp4o5CgC/ZDB/t2UZ+QW6hT26ZZUYVXV8THWC5WsqnmgF/GoSUwQuDK7T9c98IMjpoalCtBYuMATMORI9Gj48Ua1dKqBBkWyYvDPur+LfSOXUkRN2yexFRBf64eHyflYLvMy34NGosGgwxBU5BTkvvO/l/WkIHu14lm3bqjGa7bDBvUMumpRTry4X0C+L3YvcBfxOhAAAAAElFTkSuQmCC) /*Images/Actions/removeSubtle.png*/;
}
}
span.remove {
display: block;
float: left;
height: 16px;
width: 16px;
margin-left: 2px;
&:hover {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADG0lEQVQ4y3WTCUhUURSG35vlvnnzZsoJQyMo2nTMKdsXEtOcjKxogwhKaDFNysysJooQRzTLbIFScVrIaMEiElqgMjUzsnEWl1apbNG0dCqcJiarv+NEgWEPfnj3nO/+5567cAC4f3XOb5ChfFrkemvMgn0PoufllhkmJZ2R/Mf0xfYanFTr9A/nL77ozT3oxZVrgOUEUFAEHC2AJz3zm8M495KFaUf3aXDaLyCqc+WqdqSZgKRk0iZg/UYgcePv8aYtwFYTWpYu/2CRdMZeBkeYdmTrrDnvEbsIXZNnoInknRqOn5ExQORsdEcY8dI4H54p4UDsQjRNj+g8IFfr/xqUDx5W8iV0Ap4HDoV9xWq8rLWjnsBPukB8JtXPnodmijnj1uBNwBC4Q8JQOnBwqc9gLy/qH+kCvVaFiKogA9xuN3o+V1sbbOOnotYwAR1vW3wxt8eDB/qxcCpUqNEO6DbzKgOXJxcTrjMNjnBynGICGtIz8JPgHnW2tKLjzVvf/w/SY3MWLggqHCP2skyFLF7YwJkV4p58qm7iFMjjZLBQV/a0rXB1dOJTV5dPLpcLzm0mFFOugJhsYgt5hkxeyOVMCjEnUyliMcdjMyWzCCoODsXTujq8ePUKL5qb8ayxEWcN43CYcllUPYm43bwC23lhP5cqV60rZGrEk0EKAXmjx+B+eQUcNKnxyROfHA2NqLlThfywidhJzFpi98iUSO1pIYFj+uMqzbdDlCgcOhyVN26hrLoa1TY7bMkpsG9Ixj27HTer7sBpdaA0bApyiM2XC92JHDP4jnGnUiwpozbOSRrczzCjwmaDPSUVFQRWkhxkVEkm1py9KOnXD1ep+i6ZcPnvPYjj2AiLqG2vkwu4LWNwRkbDSX02kZ6TGmjJDVHRKKfjq6UNLFKKHTQnqNdVXsmz8GJ1/3evmYQWCnuUamBAAOA/CF6VFu0Ua5aLKGZSexzPZvX5mJZxylHpgub8Xb+BX11BofgeFYPvM434GDIWNbqAr2YmlSzjWPB/X+MfLaGNXaeQ4ndo/LNNki47QSnFL+VYSF/sL7crTEWWnWvrAAAAAElFTkSuQmCC) /*Images/Actions/remove.png*/;
}
}
}
}
div.attachmentInput {
border-top: 1px solid @SubtleBorderColour;
height: 40px;
background-color: #fff;
padding: 3px;
span.action {
display: block;
margin: 2px 4px 0 0;
height: 32px;
width: 32px;
cursor: pointer;
float: right;
border: 1px solid #fff;
padding: 3px;
background-repeat: no-repeat;
background-position: 2px 3px;
&:hover {
background-color: @SubtleColour;
border: 1px solid @SubtleBorderColour;
.border-radius(3px);
}
}
span.upload {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAFPUlEQVRYw7VXayzkVxRfy4yKTj0aj6JWJISuR9EiWj5IFZt4pB+kLYmdbEJEJpp2daeIJkRNMx7xqFcl0iXxaKwVj8ishhG+eARr10wY6hVMx3gM1mNxeo7YRDfzNr3Jyfzn/u/939899/x+59xbAHDLEIbNxNHRMSQ5OTmvuLi4pbS0tDU1NbXA3d09FN8ZqZxniMVZLJZvSUnJ0NHREVA7PDwEhUIBb1pNTU2PtbW1+/8CwMvLiz07O/uKFqqrq9sNDAzstLCw4Jubm/Pd3NyeZGdnb56dncH09LQUQfgaFIC9vX30+vr6uUwmg5CQkD509Rdo75HL0W6jWaJF+/n5CRcXF0EgEEiMjIw+MAgAbM7d3d1/y6QywAU68b+NmrFeYWFhwtPTU8jIyKi/MQDaXU5OjoDcHhsb+4x2fdX/jqqAwxbf0dFxNj4+vofPtjcCgO7+gRbn8/lSS0vLjPT09KrOp09F/f39S9XV1QOhoaFsXITxFoD3cfcv8MgA2RKuNwAzM7MgsVh8MDAwAAkJCRI8230CIxKJYHh4GLa2ti4jv6CggI7F7BoABlJ0cHNzEzA4v9ELADar1tZWkVQqBS6Xe4G/F/Pz8xAdHT2KwZWN7zkODg7NVVVVr87PzyErK6vp2lxTnDO2vLwMOCZeLwBsNvu3K9fDxMQEjI2NgZ2dXSl+3OnaQtZo3Pr6+qNt+TZ4enreu+q/09nZuUdeQrA+OgNwdXX9en9/H5qbm+Hx48dAO/fw8PiddqbEUyyMg66VlRVg379fQ32+vr4Z5Lnc3Nzn/zkabRY3MTHxmJmZ2UExgfz8fKBAiomJ+Usd9fCcc+fm5gDluB3HOSLwtcnJSXB2dv5JJxoS5crLy58dHx9DXl4eLCwsAMquFPs/VjcvPDy8dHV1FeLi4v7E6O+V4e7j4+MHiQ06AYiIiPiRzh2TC/T19YFQKASUWo4G0GZlZWUvpqamyAOLBATnb2N/sE5S7OTk9KVcLn/d09MDlZWVl+fu4+PTSIKjbh7GRuqCZIGSEAwNDV2gPgDmgYc6J6PMzMxW0nDk9MXa2hqkpaW9vB7xyozBYNzt7e3dHRkZuQxYiURCUv2HKtBqzx75yk1MTFwmFzY1Nb1G+sRrcL1RFpcr2NzYgNraWlheWgIOhyOmvKFXPYDtM3S/ggLP1tb2F3WFBZm/v/93BLaxsRFGR0ehoaHhBEF/pXYNdRUOj8cTUgCi0hHlWGqLEgvW5+j2EwrS9vb2SwB29vY/a2SZqhcoJFxaHClH0fuppqjHceO0exKpJXQ96kQ/9r+rFwAmkxmMCeeIdoGUe6gFVX8lnpPrUbCAV8iT4eKfaJVflHUidxtp9ygiAk2Uo927uLhUFBUVnVDkd3V1nZuamj7QOsEpy3iYNJZINq2srBK0zJKeKDT/EGVR8yk/3L4JgLuDg4PHLS0tB/j8oTYfSUpKqtuWyyElJeWltnPUAfDHKD5FEaHgs9T0gYCAAA4lJ6yEdnF8hM7lnRIAd1D5VijfI/eDNVRH/pjfD0jzsS54pFd9qQQAMygoqJ3Eh1dYSKU2U0WKdseiQ0QlVmRkJI0zNwiAKxAxWD5t7ezsAGa1IaTiR9dLK6xyvu3q7pYeHhwAFqQktZ56l/cqAJgaGxt/z+cXHSr2FEA3n8qKihEsRnoxOCUbqPVkmOdXcGzoje6U6vhNRWZUVNTztra2szmxGIhmVAei6u17e3s/wfchN77UarrxknvRHuAFtMjGxqacwWQ8omjXlBsMAuAtMMYEyFDX+Tf2LzGXbu1DZYkMAAAAAElFTkSuQmCC) /*Images/Actions/attach.png*/;
}
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*/;
}
}
}
}
File diff suppressed because one or more lines are too long
-5
View File
@@ -146,11 +146,6 @@
#Job_Show #Job_Show_Subjects #Job_Show_Job #Job_Show_GenerateDocument_Container #Job_Show_GenerateDocument {
padding: 0;
}
#Job_Show #Job_Show_Subjects #Job_Show_Job #Job_Show_GenerateDocument_Container #Job_Show_GenerateDocument_Status {
padding: 0;
display: none;
white-space: nowrap;
}
#Job_Show #Job_Show_Subjects #Job_Show_Device > div {
padding-left: 102px;
min-height: 100px;
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+5
View File
@@ -285,6 +285,11 @@ footer a:visited,
footer a:active,
#footer a:active {
color: #777;
}
footer a:link,
#footer a:link,
footer a:active,
#footer a:active {
text-decoration: underline;
}
footer a:hover,
+3
View File
@@ -251,6 +251,9 @@ footer, #footer
&:link, &:visited, &:active
{
color: #777;
}
&:link, &:active
{
text-decoration: underline;
}
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -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.0219.1605")]
[assembly: AssemblyFileVersion("1.2.0219.1605")]
[assembly: AssemblyVersion("1.2.0219.1854")]
[assembly: AssemblyFileVersion("1.2.0219.1854")]
+114 -114
View File
@@ -1,114 +1,114 @@
@model Disco.Web.Models.Device.AddOfflineModel
@{
ViewBag.Title = Html.ToBreadcrumb("Devices", MVC.Device.Index(), "Add Offline");
}
@using (Html.BeginForm())
{
@Html.ValidationSummary(true)
<div class="form" style="width: 450px">
<table>
<tr>
<th>
Serial Number:
</th>
<td>
@Html.TextBoxFor(model => model.Device.SerialNumber)<br />
@Html.ValidationMessageFor(model => model.Device.SerialNumber)
</td>
</tr>
<tr>
<th>
Asset Number:
</th>
<td>@Html.TextBoxFor(model => model.Device.AssetNumber)<br />
@Html.ValidationMessageFor(model => model.Device.AssetNumber)
</td>
</tr>
<tr>
<th>
Location:
</th>
<td>@Html.TextBoxFor(model => model.Device.Location)<br />
@Html.ValidationMessageFor(model => model.Device.Location)
</td>
</tr>
<tr>
<th>
Device Batch:
</th>
<td>
@Html.DropDownListFor(model => model.Device.DeviceBatchId, Model.DeviceBatches) <br />
@Html.ValidationMessageFor(model => model.Device.DeviceBatchId)
</td>
</tr>
<tr>
<th>
Device Profile:
</th>
<td>
@Html.DropDownListFor(model => model.Device.DeviceProfileId, Model.DeviceProfiles.ToSelectListItems(Model.DefaultDeviceProfileId))<br />
@Html.ValidationMessageFor(model => model.Device.DeviceProfileId)
</td>
</tr>
<tr>
<th>
Assigned User:
</th>
<td>
@Html.TextBoxFor(model => model.Device.AssignedUserId)<br />
@Html.ValidationMessageFor(model => model.Device.AssignedUserId)
</td>
</tr>
</table>
<p class="actions">
<input type="submit" class="button" value="Add" />
</p>
<script type="text/javascript">
$(function () {
$SerialNumber = $('#Device_SerialNumber');
$AssetNumber = $('#Device_AssetNumber');
$Location = $('#Device_Location');
$AssignedUserId = $('#Device_AssignedUserId');
$SerialNumber.focus().keydown(function (e) {
if (e.which == 13) {
$AssignedUserId.focus();
return false;
}
});
$AssetNumber.keydown(function (e) {
if (e.which == 13) {
$Location.focus();
return false;
}
});
$Location.keydown(function (e) {
if (e.which == 13) {
$AssignedUserId.focus();
return false;
}
});
$AssignedUserId
.watermark('Search Users')
.focus(function () { $AssignedUserId.select() })
.autocomplete({
source: '@(Url.Action(MVC.API.User.UpstreamUsers()))',
minLength: 2,
focus: function (e, ui) {
$AssignedUserId.val(ui.item.DisplayName + ' (' + ui.item.Id + ')');
return false;
},
select: function (e, ui) {
$AssignedUserId.val(ui.item.Id).blur();
return false;
}
}).data('autocomplete')._renderItem = function (ul, item) {
return $("<li></li>")
.data("item.autocomplete", item)
.append("<a><strong>" + item.DisplayName + "</strong><br>" + item.Id + " (" + item.Type + ")</a>")
.appendTo(ul);
};
});
</script>
</div>
}
@model Disco.Web.Models.Device.AddOfflineModel
@{
ViewBag.Title = Html.ToBreadcrumb("Devices", MVC.Device.Index(), "Add Offline");
}
@using (Html.BeginForm())
{
@Html.ValidationSummary(true)
<div class="form" style="width: 450px">
<table>
<tr>
<th>
Serial Number:
</th>
<td>
@Html.TextBoxFor(model => model.Device.SerialNumber)<br />
@Html.ValidationMessageFor(model => model.Device.SerialNumber)
</td>
</tr>
<tr>
<th>
Asset Number:
</th>
<td>@Html.TextBoxFor(model => model.Device.AssetNumber)<br />
@Html.ValidationMessageFor(model => model.Device.AssetNumber)
</td>
</tr>
<tr>
<th>
Location:
</th>
<td>@Html.TextBoxFor(model => model.Device.Location)<br />
@Html.ValidationMessageFor(model => model.Device.Location)
</td>
</tr>
<tr>
<th>
Device Batch:
</th>
<td>
@Html.DropDownListFor(model => model.Device.DeviceBatchId, Model.DeviceBatches) <br />
@Html.ValidationMessageFor(model => model.Device.DeviceBatchId)
</td>
</tr>
<tr>
<th>
Device Profile:
</th>
<td>
@Html.DropDownListFor(model => model.Device.DeviceProfileId, Model.DeviceProfiles.ToSelectListItems(Model.DefaultDeviceProfileId))<br />
@Html.ValidationMessageFor(model => model.Device.DeviceProfileId)
</td>
</tr>
<tr>
<th>
Assigned User:
</th>
<td>
@Html.TextBoxFor(model => model.Device.AssignedUserId)<br />
@Html.ValidationMessageFor(model => model.Device.AssignedUserId)
</td>
</tr>
</table>
<p class="actions">
<input type="submit" class="button" value="Add" />
</p>
<script type="text/javascript">
$(function () {
$SerialNumber = $('#Device_SerialNumber');
$AssetNumber = $('#Device_AssetNumber');
$Location = $('#Device_Location');
$AssignedUserId = $('#Device_AssignedUserId');
$SerialNumber.focus().keydown(function (e) {
if (e.which == 13) {
$AssignedUserId.focus();
return false;
}
});
$AssetNumber.keydown(function (e) {
if (e.which == 13) {
$Location.focus();
return false;
}
});
$Location.keydown(function (e) {
if (e.which == 13) {
$AssignedUserId.focus();
return false;
}
});
$AssignedUserId
.watermark('Search Users')
.focus(function () { $AssignedUserId.select() })
.autocomplete({
source: '@(Url.Action(MVC.API.User.UpstreamUsers()))',
minLength: 2,
focus: function (e, ui) {
$AssignedUserId.val(ui.item.DisplayName + ' (' + ui.item.Id + ')');
return false;
},
select: function (e, ui) {
$AssignedUserId.val(ui.item.Id).blur();
return false;
}
}).data('ui-autocomplete')._renderItem = function (ul, item) {
return $("<li></li>")
.data("item.autocomplete", item)
.append("<a><strong>" + item.DisplayName + "</strong><br>" + item.Id + " (" + item.Type + ")</a>")
.appendTo(ul);
};
});
</script>
</div>
}
+304 -304
View File
@@ -1,304 +1,304 @@
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17929
//
// 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", "1.5.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Device/AddOffline.cshtml")]
public class AddOffline : System.Web.Mvc.WebViewPage<Disco.Web.Models.Device.AddOfflineModel>
{
public AddOffline()
{
}
public override void Execute()
{
#line 2 "..\..\Views\Device\AddOffline.cshtml"
ViewBag.Title = Html.ToBreadcrumb("Devices", MVC.Device.Index(), "Add Offline");
#line default
#line hidden
WriteLiteral("\r\n");
#line 5 "..\..\Views\Device\AddOffline.cshtml"
using (Html.BeginForm())
{
#line default
#line hidden
#line 7 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.ValidationSummary(true));
#line default
#line hidden
#line 7 "..\..\Views\Device\AddOffline.cshtml"
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" class=\"form\"");
WriteLiteral(" style=\"width: 450px\"");
WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th>\r\n S" +
"erial Number:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 15 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.TextBoxFor(model => model.Device.SerialNumber));
#line default
#line hidden
WriteLiteral("<br />\r\n");
WriteLiteral(" ");
#line 16 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.ValidationMessageFor(model => model.Device.SerialNumber));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
">\r\n Asset Number:\r\n </th>\r\n <td" +
">");
#line 23 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.TextBoxFor(model => model.Device.AssetNumber));
#line default
#line hidden
WriteLiteral("<br />\r\n");
WriteLiteral(" ");
#line 24 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.ValidationMessageFor(model => model.Device.AssetNumber));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
">\r\n Location:\r\n </th>\r\n <td>");
#line 31 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.TextBoxFor(model => model.Device.Location));
#line default
#line hidden
WriteLiteral("<br />\r\n");
WriteLiteral(" ");
#line 32 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.ValidationMessageFor(model => model.Device.Location));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
">\r\n Device Batch:\r\n </th>\r\n <td" +
">\r\n");
WriteLiteral(" ");
#line 40 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.DropDownListFor(model => model.Device.DeviceBatchId, Model.DeviceBatches));
#line default
#line hidden
WriteLiteral(" <br />\r\n");
WriteLiteral(" ");
#line 41 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.ValidationMessageFor(model => model.Device.DeviceBatchId));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
">\r\n Device Profile:\r\n </th>\r\n <" +
"td>\r\n");
WriteLiteral(" ");
#line 49 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.DropDownListFor(model => model.Device.DeviceProfileId, Model.DeviceProfiles.ToSelectListItems(Model.DefaultDeviceProfileId)));
#line default
#line hidden
WriteLiteral("<br />\r\n");
WriteLiteral(" ");
#line 50 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.ValidationMessageFor(model => model.Device.DeviceProfileId));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
">\r\n Assigned User:\r\n </th>\r\n <t" +
"d>\r\n");
WriteLiteral(" ");
#line 58 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.TextBoxFor(model => model.Device.AssignedUserId));
#line default
#line hidden
WriteLiteral("<br />\r\n");
WriteLiteral(" ");
#line 59 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.ValidationMessageFor(model => model.Device.AssignedUserId));
#line default
#line hidden
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=\"Add\"");
WriteLiteral(" />\r\n </p>\r\n <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
$SerialNumber = $('#Device_SerialNumber');
$AssetNumber = $('#Device_AssetNumber');
$Location = $('#Device_Location');
$AssignedUserId = $('#Device_AssignedUserId');
$SerialNumber.focus().keydown(function (e) {
if (e.which == 13) {
$AssignedUserId.focus();
return false;
}
});
$AssetNumber.keydown(function (e) {
if (e.which == 13) {
$Location.focus();
return false;
}
});
$Location.keydown(function (e) {
if (e.which == 13) {
$AssignedUserId.focus();
return false;
}
});
$AssignedUserId
.watermark('Search Users')
.focus(function () { $AssignedUserId.select() })
.autocomplete({
source: '");
#line 95 "..\..\Views\Device\AddOffline.cshtml"
Write(Url.Action(MVC.API.User.UpstreamUsers()));
#line default
#line hidden
WriteLiteral(@"',
minLength: 2,
focus: function (e, ui) {
$AssignedUserId.val(ui.item.DisplayName + ' (' + ui.item.Id + ')');
return false;
},
select: function (e, ui) {
$AssignedUserId.val(ui.item.Id).blur();
return false;
}
}).data('autocomplete')._renderItem = function (ul, item) {
return $(""<li></li>"")
.data(""item.autocomplete"", item)
.append(""<a><strong>"" + item.DisplayName + ""</strong><br>"" + item.Id + "" ("" + item.Type + "")</a>"")
.appendTo(ul);
};
});
</script>
</div>
");
#line 114 "..\..\Views\Device\AddOffline.cshtml"
}
#line default
#line hidden
}
}
}
#pragma warning restore 1591
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17929
//
// 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", "1.5.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Device/AddOffline.cshtml")]
public class AddOffline : System.Web.Mvc.WebViewPage<Disco.Web.Models.Device.AddOfflineModel>
{
public AddOffline()
{
}
public override void Execute()
{
#line 2 "..\..\Views\Device\AddOffline.cshtml"
ViewBag.Title = Html.ToBreadcrumb("Devices", MVC.Device.Index(), "Add Offline");
#line default
#line hidden
WriteLiteral("\r\n");
#line 5 "..\..\Views\Device\AddOffline.cshtml"
using (Html.BeginForm())
{
#line default
#line hidden
#line 7 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.ValidationSummary(true));
#line default
#line hidden
#line 7 "..\..\Views\Device\AddOffline.cshtml"
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" class=\"form\"");
WriteLiteral(" style=\"width: 450px\"");
WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th>\r\n S" +
"erial Number:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 15 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.TextBoxFor(model => model.Device.SerialNumber));
#line default
#line hidden
WriteLiteral("<br />\r\n");
WriteLiteral(" ");
#line 16 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.ValidationMessageFor(model => model.Device.SerialNumber));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
">\r\n Asset Number:\r\n </th>\r\n <td" +
">");
#line 23 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.TextBoxFor(model => model.Device.AssetNumber));
#line default
#line hidden
WriteLiteral("<br />\r\n");
WriteLiteral(" ");
#line 24 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.ValidationMessageFor(model => model.Device.AssetNumber));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
">\r\n Location:\r\n </th>\r\n <td>");
#line 31 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.TextBoxFor(model => model.Device.Location));
#line default
#line hidden
WriteLiteral("<br />\r\n");
WriteLiteral(" ");
#line 32 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.ValidationMessageFor(model => model.Device.Location));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
">\r\n Device Batch:\r\n </th>\r\n <td" +
">\r\n");
WriteLiteral(" ");
#line 40 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.DropDownListFor(model => model.Device.DeviceBatchId, Model.DeviceBatches));
#line default
#line hidden
WriteLiteral(" <br />\r\n");
WriteLiteral(" ");
#line 41 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.ValidationMessageFor(model => model.Device.DeviceBatchId));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
">\r\n Device Profile:\r\n </th>\r\n <" +
"td>\r\n");
WriteLiteral(" ");
#line 49 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.DropDownListFor(model => model.Device.DeviceProfileId, Model.DeviceProfiles.ToSelectListItems(Model.DefaultDeviceProfileId)));
#line default
#line hidden
WriteLiteral("<br />\r\n");
WriteLiteral(" ");
#line 50 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.ValidationMessageFor(model => model.Device.DeviceProfileId));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
">\r\n Assigned User:\r\n </th>\r\n <t" +
"d>\r\n");
WriteLiteral(" ");
#line 58 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.TextBoxFor(model => model.Device.AssignedUserId));
#line default
#line hidden
WriteLiteral("<br />\r\n");
WriteLiteral(" ");
#line 59 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.ValidationMessageFor(model => model.Device.AssignedUserId));
#line default
#line hidden
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=\"Add\"");
WriteLiteral(" />\r\n </p>\r\n <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
$SerialNumber = $('#Device_SerialNumber');
$AssetNumber = $('#Device_AssetNumber');
$Location = $('#Device_Location');
$AssignedUserId = $('#Device_AssignedUserId');
$SerialNumber.focus().keydown(function (e) {
if (e.which == 13) {
$AssignedUserId.focus();
return false;
}
});
$AssetNumber.keydown(function (e) {
if (e.which == 13) {
$Location.focus();
return false;
}
});
$Location.keydown(function (e) {
if (e.which == 13) {
$AssignedUserId.focus();
return false;
}
});
$AssignedUserId
.watermark('Search Users')
.focus(function () { $AssignedUserId.select() })
.autocomplete({
source: '");
#line 95 "..\..\Views\Device\AddOffline.cshtml"
Write(Url.Action(MVC.API.User.UpstreamUsers()));
#line default
#line hidden
WriteLiteral(@"',
minLength: 2,
focus: function (e, ui) {
$AssignedUserId.val(ui.item.DisplayName + ' (' + ui.item.Id + ')');
return false;
},
select: function (e, ui) {
$AssignedUserId.val(ui.item.Id).blur();
return false;
}
}).data('ui-autocomplete')._renderItem = function (ul, item) {
return $(""<li></li>"")
.data(""item.autocomplete"", item)
.append(""<a><strong>"" + item.DisplayName + ""</strong><br>"" + item.Id + "" ("" + item.Type + "")</a>"")
.appendTo(ul);
};
});
</script>
</div>
");
#line 114 "..\..\Views\Device\AddOffline.cshtml"
}
#line default
#line hidden
}
}
}
#pragma warning restore 1591
+478 -467
View File
@@ -1,467 +1,478 @@
@model Disco.Web.Models.Device.ShowModel
@{
ViewBag.Title = Html.ToBreadcrumb("Devices", MVC.Device.Index(), string.Format("{0} ({1})", Model.Device.ComputerName, Model.Device.SerialNumber));
Html.BundleDeferred("~/ClientScripts/Modules/Silverlight");
}
<table class="deviceShow">
<tr>
<td class="details">
<table>
<tr>
<th class="name">
Computer Name:
</th>
<td class="value">
@if (string.IsNullOrWhiteSpace(Model.Device.ComputerName))
{
<span class="smallMessage">&lt;Unknown/Not Allocated&gt;</span>
}
else
{
@Model.Device.ComputerName
}
</td>
</tr>
<tr>
<th class="name">
Asset Number:
</th>
<td class="value">
@Html.TextBoxFor(m => m.Device.AssetNumber)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
var $ajaxSave = $('#Device_AssetNumber').next('.ajaxSave');
$('#Device_AssetNumber').watermark('Asset Number').keydown(function (e) {
$ajaxSave.show();
if (e.which == 13) {
$(this).blur();
}
}).change(function () {
var $this = $(this);
$ajaxSave.hide();
var $ajaxLoading = $ajaxSave.next('.ajaxLoading').show();
var data = { AssetNumber: $this.val() };
$.getJSON('@(Url.Action(@MVC.API.Device.UpdateAssetNumber(Model.Device.SerialNumber)))', data, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Asset Number:\n' + response);
$ajaxLoading.hide();
} else {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
});
}).blur(function () {
$ajaxSave.hide();
}).focus(function () {
$(this).select();
});
});
</script>
</td>
</tr>
<tr>
<th class="name">
Location:
</th>
<td class="value">
@Html.TextBoxFor(m => m.Device.Location)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
var $ajaxSave = $('#Device_Location').next('.ajaxSave');
$('#Device_Location').watermark('Location').keydown(function (e) {
$ajaxSave.show();
if (e.which == 13) {
$(this).blur();
}
}).change(function () {
var $this = $(this);
$ajaxSave.hide();
var $ajaxLoading = $ajaxSave.next('.ajaxLoading').show();
var data = { Location: $this.val() };
$.getJSON('@(Url.Action(@MVC.API.Device.UpdateLocation(Model.Device.SerialNumber)))', data, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Location:\n' + response);
$ajaxLoading.hide();
} else {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
});
}).blur(function () {
$ajaxSave.hide();
}).focus(function () {
$(this).select();
});
});
</script>
</td>
</tr>
<tr>
<th class="name">
Batch:
</th>
<td class="value">
@Html.DropDownListFor(m => m.Device.DeviceBatchId, Model.DeviceBatches)
@AjaxHelpers.AjaxLoader() <span id="deviceBatchEdit" class="icon16" title="Edit">
</span>
<script type="text/javascript">
$(function () {
var $DeviceBatchId = $('#Device_DeviceBatchId');
var $DeviceBatchDetails = $('#deviceBatchDetails');
var $DeviceBatchEdit = $('#deviceBatchEdit');
var jsonDate = function (json, unknownValue) {
if (json && json.indexOf('') == 0) {
return $.datepicker.formatDate('yy-mm-dd', new Date(parseInt(json.substr(6, json.length - 8))));
} else
return unknownValue;
}
var updateDetails = function (deviceBatchId) {
$.getJSON('@(Url.Action(MVC.API.DeviceBatch.Index()))/' + deviceBatchId, function (response, result) {
if (result == 'success') {
if (response.Supplier)
$DeviceBatchDetails.find('.supplier').text(response.Supplier);
else
$DeviceBatchDetails.find('.supplier').text('Unknown');
$DeviceBatchDetails.find('.purchaseDate').text(jsonDate(response.PurchaseDate, 'Unknown'));
$DeviceBatchDetails.find('.warrantyValidUntil').text(jsonDate(response.WarrantyValidUntil, 'Unknown'));
if (response.InsuranceSupplier)
$DeviceBatchDetails.find('.insuranceSupplier').text(response.InsuranceSupplier);
else
$DeviceBatchDetails.find('.insuranceSupplier').text('Unknown');
$DeviceBatchDetails.find('.insuredUntil').text(jsonDate(response.InsuredUntil, 'Unknown'));
$DeviceBatchDetails.slideDown('fast');
$DeviceBatchEdit.fadeIn();
} else {
alert('Unable to load Device Batch details:\n' + response);
}
});
};
$DeviceBatchEdit.click(function () {
window.location.href = '@(Url.Action(MVC.Config.DeviceBatch.Index(null)))/' + $DeviceBatchId.val();
});
$DeviceBatchId.change(function () {
var $this = $(this);
var $ajaxLoading = $this.next('.ajaxLoading').show();
$DeviceBatchDetails.hide();
$DeviceBatchEdit.hide();
var data = { DeviceBatchId: $this.val() };
$.getJSON('@(Url.Action(MVC.API.Device.UpdateDeviceBatchId(Model.Device.SerialNumber)))', data, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Device Batch:\n' + response);
$ajaxLoading.hide();
} else {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
if ($DeviceBatchId.val())
updateDetails($DeviceBatchId.val());
}
});
});
$DeviceBatchEdit.hide();
if ($DeviceBatchId.val())
updateDetails($DeviceBatchId.val());
});
</script>
<div id="deviceBatchDetails">
<table class="sub">
<tr>
<th style="width: 50px">
<strong>Purchased:</strong>
</th>
<td>
Supplier: <span class="supplier"></span>
<br />
On: <span class="purchaseDate"></span>
</td>
<th style="width: 50px">
<strong>Warranty:</strong>
</th>
<td>
Valid Until: <span class="warrantyValidUntil"></span>
</td>
<th style="width: 50px">
<strong>Insurance:</strong>
</th>
<td>
Supplier: <span class="insuranceSupplier"></span>
<br />
Until: <span class="insuredUntil"></span>
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<th class="name">
Profile:
</th>
<td class="value">
@if (Model.Device.DecommissionedDate.HasValue)
{
@Model.Device.DeviceProfile.ToString()
}
else
{
@Html.DropDownListFor(m => m.Device.DeviceProfileId, Model.DeviceProfiles.ToSelectListItems(Model.Device.DeviceProfile))
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
$('#Device_DeviceProfileId').change(function () {
var $this = $(this);
var $ajaxLoading = $this.next('.ajaxLoading').show();
var data = { DeviceProfileId: $this.val() };
$.getJSON('@(Url.Action(MVC.API.Device.UpdateDeviceProfileId(Model.Device.SerialNumber)))', data, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Device Profile:\n' + response);
$ajaxLoading.hide();
} else {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
});
});
});
</script>
}
</td>
</tr>
<tr>
<th class="name">
Created:
</th>
<td class="value">
@CommonHelpers.FriendlyDate(Model.Device.CreatedDate)
</td>
</tr>
<tr>
<th class="name">
Enrolment:
</th>
<td class="value">
First:
@CommonHelpers.FriendlyDate(Model.Device.EnrolledDate)
@if (Model.Device.AllowUnauthenticatedEnrol)
{
<a class="unlocked16" href="@Url.Action(MVC.API.Device.UpdateAllowUnauthenticatedEnrol(Model.Device.SerialNumber, "false", true))" title="Unauthenticated Enrolment is Allowed">
&nbsp;</a>
}
else
{
<a class="locked16" href="@Url.Action(MVC.API.Device.UpdateAllowUnauthenticatedEnrol(Model.Device.SerialNumber, "true", true))" title="Unauthenticated Enrolment is Blocked">
&nbsp;</a>
}
<br />
Last:
@CommonHelpers.FriendlyDate(Model.Device.LastEnrolDate)
</td>
</tr>
<tr>
<th class="name">
Decommissioned:
</th>
<td class="value">
@CommonHelpers.FriendlyDate(Model.Device.DecommissionedDate)
</td>
</tr>
<tr>
<th class="name">
Last Network Logon:
</th>
<td class="value">
<span id="lastNetworkLogonDate" class="nowrap">@CommonHelpers.FriendlyDate(Model.Device.LastNetworkLogonDate)</span>
@if (!string.IsNullOrEmpty(Model.Device.ComputerName))
{
<script type="text/javascript">
$(function () {
var span = $('#lastNetworkLogonDate');
$('<span>').addClass('ajaxHelperIcon ajaxLoading ajaxShowInitially').attr('title', 'Loading...').appendTo(span);
$.getJSON('@(Url.Action(MVC.API.Device.LastNetworkLogonDate(Model.Device.SerialNumber)))', function (response, result) {
if (result != 'success') {
alert('Unable to retrieve latest network logon date:\n' + response);
$('<span>').addClass('smallMessage').text('[may not be current]').appendTo(span);
} else {
span.find('.ajaxLoading').hide();
span.attr('title', response.Formatted).text(response.Friendly);
}
});
});
</script>
}
</td>
</tr>
@if (!Model.Device.DecommissionedDate.HasValue)
{
<tr>
<th class="name">
Assigned User:
</th>
<td class="value">
@Html.TextBoxFor(m => m.Device.AssignedUser, new { userId = Model.Device.AssignedUserId })
@AjaxHelpers.AjaxRemove()
@AjaxHelpers.AjaxLoader()
<br />
<a href="#" id="Device_AssignedUser_History_Trigger" class="smallLink">Show Assignment
History (<span id="Device_AssignedUser_History_RecordCount"></span>)</a> <span id="Device_AssignedUser_History_None"
class="smallMessage" style="display: none">No Assignment History Available</span>
<div id="dialogRemoveAssignedUser" title="Remove this Device Assignment?">
<p>
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
Are you sure?</p>
</div>
<script type="text/javascript">
$(function () {
// Common Objects
var $assignedUser = $('#Device_AssignedUser');
var $ajaxLoading = $assignedUser.nextAll('.ajaxLoading').first();
var $ajaxRemove = $assignedUser.nextAll('.ajaxRemove').first();
// Assign User
$assignedUser
.watermark('No Assigned User')
.focus(function () { $assignedUser.select() })
.autocomplete({
source: '@(Url.Action(MVC.API.User.UpstreamUsers()))',
minLength: 2,
focus: function (e, ui) {
$assignedUser.val(ui.item.DisplayName + ' (' + ui.item.Id + ')');
return false;
},
select: function (e, ui) {
updateAssignedUser(ui.item.Id);
$assignedUser.val(ui.item.DisplayName + ' (' + ui.item.Id + ')');
return false;
}
})
.data('autocomplete')._renderItem = function (ul, item) {
return $("<li></li>")
.data("item.autocomplete", item)
.append("<a><strong>" + item.DisplayName + "</strong><br>" + item.Id + " (" + item.Type + ")</a>")
.appendTo(ul);
};
var $dialogRemoveAssignedUser = $('#dialogRemoveAssignedUser');
$dialogRemoveAssignedUser.dialog({
resizable: false,
height: 140,
modal: true,
autoOpen: false,
buttons: {
"Remove": function () {
updateAssignedUser('');
$assignedUser.val('');
$dialogRemoveAssignedUser.dialog("close");
},
"Cancel": function () {
$dialogRemoveAssignedUser.dialog("close");
}
}
});
// Un-Assign User
if ($assignedUser.val() != '')
$ajaxRemove.show();
$ajaxRemove.click(function () {
$dialogRemoveAssignedUser.dialog('open');
return false;
});
// History
var deviceUserAssignmentCount = @(Model.Device.DeviceUserAssignments.Count);
if (deviceUserAssignmentCount > 0) {
$('#Device_AssignedUser_History_Trigger').click(function () {
$(this).hide();
$('#Device_AssignedUser_History_Host').show();
$('#Device_AssignedUser_History').slideDown('slow');
return false;
});
var recordCountText = deviceUserAssignmentCount + ' record';
if (deviceUserAssignmentCount != 1)
recordCountText += 's';
$('#Device_AssignedUser_History_RecordCount').text(recordCountText)
}
else {
$('#Device_AssignedUser_History_Trigger').hide();
$('#Device_AssignedUser_History_None').show();
};
function updateAssignedUser(userId) {
$ajaxLoading.show();
$ajaxRemove.hide();
var data = { AssignedUserId: userId };
$.getJSON('@(Url.Action(MVC.API.Device.UpdateAssignedUserId(Model.Device.SerialNumber)))', data, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Assigned User:\n' + response);
$ajaxLoading.hide();
} else {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
if (userId != '')
$ajaxRemove.fadeIn('fast');
}
});
}
});
</script>
</td>
</tr>
}
<tr id="Device_AssignedUser_History_Host" style="@(Model.Device.DecommissionedDate.HasValue ? "" : "display: none")">
<td colspan="2">
<div id="Device_AssignedUser_History" style="@(Model.Device.DecommissionedDate.HasValue ? "" : "display: none")">
<h2>
Assigned User History</h2>
@Html.Partial(MVC.Device.Views._DeviceUserAssignmentHistoryTable, Model.Device)
</div>
</td>
</tr>
<tr>
<th class="name">
Generate Documents:
</th>
<td class="value" colspan="3">
@Html.DropDownList("DocumentTemplates", Model.DocumentTemplatesSelectListItems)
<script type="text/javascript">
$(function () {
var generatePdfUrl = '@Url.Action(MVC.API.Device.GeneratePdf(Model.Device.SerialNumber, null))?DocumentTemplateId=';
var $documentTemplates = $('#DocumentTemplates');
$documentTemplates.change(function () {
var v = $documentTemplates.val();
if (v) {
window.location.href = generatePdfUrl + v;
$documentTemplates.val('');
}
});
});
</script>
</td>
</tr>
</table>
</td>
<td class="model">
<table>
<tr>
<td class="subtleHighlight">
<img alt="Model Image" src="@Url.Action(MVC.API.DeviceModel.Image(Model.Device.DeviceModelId, Model.Device.DeviceModel.ImageHash()))" />
<h2>
<a href="@(Url.Action(MVC.Config.DeviceModel.Index(Model.Device.DeviceModelId)))">@Model.Device.DeviceModel.ToString()</a></h2>
</td>
</tr>
</table>
</td>
</tr>
</table>
<h2>
Certificates</h2>
@Html.Partial(MVC.Device.Views._CertificateTable, Model.Certificates)
<h2>
Attachments</h2>
@Html.Partial(MVC.Device.Views.DeviceParts.Resources, Model)
<h2>
Jobs</h2>
@Html.Partial(MVC.Shared.Views._JobTable, Model.Jobs)
@Html.Partial(MVC.Device.Views._DeviceActions, Model.Device)
@model Disco.Web.Models.Device.ShowModel
@{
ViewBag.Title = Html.ToBreadcrumb("Devices", MVC.Device.Index(), string.Format("{0} ({1})", Model.Device.ComputerName, Model.Device.SerialNumber));
Html.BundleDeferred("~/ClientScripts/Modules/Silverlight");
}
<table class="deviceShow">
<tr>
<td class="details">
<table>
<tr>
<th class="name">
Computer Name:
</th>
<td class="value">
@if (string.IsNullOrWhiteSpace(Model.Device.ComputerName))
{
<span class="smallMessage">&lt;Unknown/Not Allocated&gt;</span>
}
else
{
@Model.Device.ComputerName
}
</td>
</tr>
<tr>
<th class="name">
Asset Number:
</th>
<td class="value">
@Html.TextBoxFor(m => m.Device.AssetNumber)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
var $ajaxSave = $('#Device_AssetNumber').next('.ajaxSave');
$('#Device_AssetNumber').watermark('Asset Number').keydown(function (e) {
$ajaxSave.show();
if (e.which == 13) {
$(this).blur();
}
}).change(function () {
var $this = $(this);
$ajaxSave.hide();
var $ajaxLoading = $ajaxSave.next('.ajaxLoading').show();
var data = { AssetNumber: $this.val() };
$.getJSON('@(Url.Action(@MVC.API.Device.UpdateAssetNumber(Model.Device.SerialNumber)))', data, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Asset Number:\n' + response);
$ajaxLoading.hide();
} else {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
});
}).blur(function () {
$ajaxSave.hide();
}).focus(function () {
$(this).select();
});
});
</script>
</td>
</tr>
<tr>
<th class="name">
Location:
</th>
<td class="value">
@Html.TextBoxFor(m => m.Device.Location)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
var $ajaxSave = $('#Device_Location').next('.ajaxSave');
$('#Device_Location').watermark('Location').keydown(function (e) {
$ajaxSave.show();
if (e.which == 13) {
$(this).blur();
}
}).change(function () {
var $this = $(this);
$ajaxSave.hide();
var $ajaxLoading = $ajaxSave.next('.ajaxLoading').show();
var data = { Location: $this.val() };
$.getJSON('@(Url.Action(@MVC.API.Device.UpdateLocation(Model.Device.SerialNumber)))', data, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Location:\n' + response);
$ajaxLoading.hide();
} else {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
});
}).blur(function () {
$ajaxSave.hide();
}).focus(function () {
$(this).select();
});
});
</script>
</td>
</tr>
<tr>
<th class="name">
Batch:
</th>
<td class="value">
@Html.DropDownListFor(m => m.Device.DeviceBatchId, Model.DeviceBatches)
@AjaxHelpers.AjaxLoader() <span id="deviceBatchDetails" class="icon16" title="Batch Details"></span>
<script type="text/javascript">
$(function () {
var $DeviceBatchId = $('#Device_DeviceBatchId');
var $DeviceBatchDetails = $('#deviceBatchDetails');
var $DeviceBatchSummary = $('#deviceBatchSummary');
var initUpdate = false;
var jsonDate = function (json, unknownValue) {
if (json && json.indexOf('') == 0) {
return $.datepicker.formatDate('yy-mm-dd', new Date(parseInt(json.substr(6, json.length - 8))));
} else
return unknownValue;
}
var updateDetails = function (deviceBatchId) {
$.getJSON('@(Url.Action(MVC.API.DeviceBatch.Index()))/' + deviceBatchId, function (response, result) {
if (result == 'success') {
if (response.Supplier)
$DeviceBatchSummary.find('.supplier').text(response.Supplier);
else
$DeviceBatchSummary.find('.supplier').text('Unknown');
$DeviceBatchSummary.find('.purchaseDate').text(jsonDate(response.PurchaseDate, 'Unknown'));
$DeviceBatchSummary.find('.warrantyValidUntil').text(jsonDate(response.WarrantyValidUntil, 'Unknown'));
if (response.InsuranceSupplier)
$DeviceBatchSummary.find('.insuranceSupplier').text(response.InsuranceSupplier);
else
$DeviceBatchSummary.find('.insuranceSupplier').text('Unknown');
$DeviceBatchSummary.find('.insuredUntil').text(jsonDate(response.InsuredUntil, 'Unknown'));
if (initUpdate){
$DeviceBatchSummary.show();
$DeviceBatchDetails.show();
initUpdate = false;
}else{
$DeviceBatchSummary.slideDown('fast');
$DeviceBatchDetails.fadeIn();
}
} else {
alert('Unable to load Device Batch details:\n' + response);
}
});
};
$DeviceBatchDetails.click(function () {
window.location.href = '@(Url.Action(MVC.Config.DeviceBatch.Index(null)))/' + $DeviceBatchId.val();
});
$DeviceBatchId.change(function () {
var $this = $(this);
var $ajaxLoading = $this.next('.ajaxLoading').show();
$DeviceBatchSummary.hide();
$DeviceBatchDetails.hide();
var data = { DeviceBatchId: $this.val() };
$.getJSON('@(Url.Action(MVC.API.Device.UpdateDeviceBatchId(Model.Device.SerialNumber)))', data, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Device Batch:\n' + response);
$ajaxLoading.hide();
} else {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
if ($DeviceBatchId.val())
updateDetails($DeviceBatchId.val());
}
});
});
$DeviceBatchSummary.hide();
if ($DeviceBatchId.val()){
initUpdate = true;
updateDetails($DeviceBatchId.val());
}
});
</script>
<div id="deviceBatchSummary">
<table class="sub">
<tr>
<th style="width: 50px">
<strong>Purchased:</strong>
</th>
<td>
Supplier: <span class="supplier"></span>
<br />
On: <span class="purchaseDate"></span>
</td>
<th style="width: 50px">
<strong>Warranty:</strong>
</th>
<td>
Valid Until: <span class="warrantyValidUntil"></span>
</td>
<th style="width: 50px">
<strong>Insurance:</strong>
</th>
<td>
Supplier: <span class="insuranceSupplier"></span>
<br />
Until: <span class="insuredUntil"></span>
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<th class="name">
Profile:
</th>
<td class="value">
@if (Model.Device.DecommissionedDate.HasValue)
{
@Model.Device.DeviceProfile.ToString()
}
else
{
@Html.DropDownListFor(m => m.Device.DeviceProfileId, Model.DeviceProfiles.ToSelectListItems(Model.Device.DeviceProfile))
@AjaxHelpers.AjaxLoader()<span id="deviceProfileDetails" class="icon16" title="Profile Details"></span>
<script type="text/javascript">
$(function () {
$('#Device_DeviceProfileId').change(function () {
var $this = $(this);
var $ajaxLoading = $this.next('.ajaxLoading').show();
var data = { DeviceProfileId: $this.val() };
$.getJSON('@(Url.Action(MVC.API.Device.UpdateDeviceProfileId(Model.Device.SerialNumber)))', data, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Device Profile:\n' + response);
$ajaxLoading.hide();
} else {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
});
});
$('#deviceProfileDetails').click(function(){
window.location.href = '@(Url.Action(MVC.Config.DeviceProfile.Index(null)))/' + $('#Device_DeviceProfileId').val();
});
});
</script>
}
</td>
</tr>
<tr>
<th class="name">
Created:
</th>
<td class="value">
@CommonHelpers.FriendlyDate(Model.Device.CreatedDate)
</td>
</tr>
<tr>
<th class="name">
Enrolment:
</th>
<td class="value">
First:
@CommonHelpers.FriendlyDate(Model.Device.EnrolledDate)
@if (Model.Device.AllowUnauthenticatedEnrol)
{
<a class="unlocked16" href="@Url.Action(MVC.API.Device.UpdateAllowUnauthenticatedEnrol(Model.Device.SerialNumber, "false", true))" title="Unauthenticated Enrolment is Allowed">
&nbsp;</a>
}
else
{
<a class="locked16" href="@Url.Action(MVC.API.Device.UpdateAllowUnauthenticatedEnrol(Model.Device.SerialNumber, "true", true))" title="Unauthenticated Enrolment is Blocked">
&nbsp;</a>
}
<br />
Last:
@CommonHelpers.FriendlyDate(Model.Device.LastEnrolDate)
</td>
</tr>
<tr>
<th class="name">
Decommissioned:
</th>
<td class="value">
@CommonHelpers.FriendlyDate(Model.Device.DecommissionedDate)
</td>
</tr>
<tr>
<th class="name">
Last Network Logon:
</th>
<td class="value">
<span id="lastNetworkLogonDate" class="nowrap">@CommonHelpers.FriendlyDate(Model.Device.LastNetworkLogonDate)</span>
@if (!string.IsNullOrEmpty(Model.Device.ComputerName))
{
<script type="text/javascript">
$(function () {
var span = $('#lastNetworkLogonDate');
$('<span>').addClass('ajaxHelperIcon ajaxLoading ajaxShowInitially').attr('title', 'Loading...').appendTo(span);
$.getJSON('@(Url.Action(MVC.API.Device.LastNetworkLogonDate(Model.Device.SerialNumber)))', function (response, result) {
if (result != 'success') {
alert('Unable to retrieve latest network logon date:\n' + response);
$('<span>').addClass('smallMessage').text('[may not be current]').appendTo(span);
} else {
span.find('.ajaxLoading').hide();
span.attr('title', response.Formatted).text(response.Friendly);
}
});
});
</script>
}
</td>
</tr>
@if (!Model.Device.DecommissionedDate.HasValue)
{
<tr>
<th class="name">
Assigned User:
</th>
<td class="value">
@Html.TextBoxFor(m => m.Device.AssignedUser, new { userId = Model.Device.AssignedUserId })
@AjaxHelpers.AjaxRemove()
@AjaxHelpers.AjaxLoader()
<br />
<a href="#" id="Device_AssignedUser_History_Trigger" class="smallLink">Show Assignment
History (<span id="Device_AssignedUser_History_RecordCount"></span>)</a> <span id="Device_AssignedUser_History_None"
class="smallMessage" style="display: none">No Assignment History Available</span>
<div id="dialogRemoveAssignedUser" title="Remove this Device Assignment?">
<p>
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
Are you sure?</p>
</div>
<script type="text/javascript">
$(function () {
// Common Objects
var $assignedUser = $('#Device_AssignedUser');
var $ajaxLoading = $assignedUser.nextAll('.ajaxLoading').first();
var $ajaxRemove = $assignedUser.nextAll('.ajaxRemove').first();
// Assign User
$assignedUser
.watermark('No Assigned User')
.focus(function () { $assignedUser.select() })
.autocomplete({
source: '@(Url.Action(MVC.API.User.UpstreamUsers()))',
minLength: 2,
focus: function (e, ui) {
$assignedUser.val(ui.item.DisplayName + ' (' + ui.item.Id + ')');
return false;
},
select: function (e, ui) {
updateAssignedUser(ui.item.Id);
$assignedUser.val(ui.item.DisplayName + ' (' + ui.item.Id + ')');
return false;
}
})
.data('ui-autocomplete')._renderItem = function (ul, item) {
return $("<li></li>")
.data("item.autocomplete", item)
.append("<a><strong>" + item.DisplayName + "</strong><br>" + item.Id + " (" + item.Type + ")</a>")
.appendTo(ul);
};
var $dialogRemoveAssignedUser = $('#dialogRemoveAssignedUser');
$dialogRemoveAssignedUser.dialog({
resizable: false,
height: 140,
modal: true,
autoOpen: false,
buttons: {
"Remove": function () {
updateAssignedUser('');
$assignedUser.val('');
$dialogRemoveAssignedUser.dialog("close");
},
"Cancel": function () {
$dialogRemoveAssignedUser.dialog("close");
}
}
});
// Un-Assign User
if ($assignedUser.val() != '')
$ajaxRemove.show();
$ajaxRemove.click(function () {
$dialogRemoveAssignedUser.dialog('open');
return false;
});
// History
var deviceUserAssignmentCount = @(Model.Device.DeviceUserAssignments.Count);
if (deviceUserAssignmentCount > 0) {
$('#Device_AssignedUser_History_Trigger').click(function () {
$(this).hide();
$('#Device_AssignedUser_History_Host').show();
$('#Device_AssignedUser_History').slideDown('slow');
return false;
});
var recordCountText = deviceUserAssignmentCount + ' record';
if (deviceUserAssignmentCount != 1)
recordCountText += 's';
$('#Device_AssignedUser_History_RecordCount').text(recordCountText)
}
else {
$('#Device_AssignedUser_History_Trigger').hide();
$('#Device_AssignedUser_History_None').show();
};
function updateAssignedUser(userId) {
$ajaxLoading.show();
$ajaxRemove.hide();
var data = { AssignedUserId: userId };
$.getJSON('@(Url.Action(MVC.API.Device.UpdateAssignedUserId(Model.Device.SerialNumber)))', data, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Assigned User:\n' + response);
$ajaxLoading.hide();
} else {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
if (userId != '')
$ajaxRemove.fadeIn('fast');
}
});
}
});
</script>
</td>
</tr>
}
<tr id="Device_AssignedUser_History_Host" style="@(Model.Device.DecommissionedDate.HasValue ? "" : "display: none")">
<td colspan="2">
<div id="Device_AssignedUser_History" style="@(Model.Device.DecommissionedDate.HasValue ? "" : "display: none")">
<h2>
Assigned User History</h2>
@Html.Partial(MVC.Device.Views._DeviceUserAssignmentHistoryTable, Model.Device)
</div>
</td>
</tr>
<tr>
<th class="name">
Generate Documents:
</th>
<td class="value" colspan="3">
@Html.DropDownList("DocumentTemplates", Model.DocumentTemplatesSelectListItems)
<script type="text/javascript">
$(function () {
var generatePdfUrl = '@Url.Action(MVC.API.Device.GeneratePdf(Model.Device.SerialNumber, null))?DocumentTemplateId=';
var $documentTemplates = $('#DocumentTemplates');
$documentTemplates.change(function () {
var v = $documentTemplates.val();
if (v) {
window.location.href = generatePdfUrl + v;
$documentTemplates.val('');
}
});
});
</script>
</td>
</tr>
</table>
</td>
<td class="model">
<table>
<tr>
<td class="subtleHighlight">
<img alt="Model Image" src="@Url.Action(MVC.API.DeviceModel.Image(Model.Device.DeviceModelId, Model.Device.DeviceModel.ImageHash()))" />
<h2>
<a href="@(Url.Action(MVC.Config.DeviceModel.Index(Model.Device.DeviceModelId)))">@Model.Device.DeviceModel.ToString()</a></h2>
</td>
</tr>
</table>
</td>
</tr>
</table>
<h2>
Certificates</h2>
@Html.Partial(MVC.Device.Views._CertificateTable, Model.Certificates)
<h2>
Attachments</h2>
@Html.Partial(MVC.Device.Views.DeviceParts.Resources, Model)
<h2>
Jobs</h2>
@Html.Partial(MVC.Shared.Views._JobTable, Model.Jobs)
@Html.Partial(MVC.Device.Views._DeviceActions, Model.Device)
File diff suppressed because it is too large Load Diff
-58
View File
@@ -1,58 +0,0 @@
@model Disco.Web.Models.Job.CreateModel
@{
ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), "Create");
}
@using (Html.BeginForm(MVC.Job.Create(), FormMethod.Post))
{
@Html.ValidationSummary(false)
@Html.HiddenFor(m => m.DeviceSerialNumber)
@Html.HiddenFor(m => m.UserId)
<div id="createDialog" class="form" style="width: 650px">
<table>
<tr>
<td colspan="2">
@Html.Partial(MVC.Job.Views._CreateSubject, Model)
</td>
</tr>
<tr id="trJobType">
<th class="name">
Type:
</th>
<td class="value">
@CommonHelpers.RadioButtonList("Type", Model.JobTypes.ToSelectListItems(Model.Type), 2)
</td>
</tr>
@foreach (var jt in Model.JobTypes)
{
<tr id="trJobSubType@(jt.Id)" class="jobSubTypes">
<th class="name">
@jt.Description<br />
Sub Types
</th>
<td class="value">
@CommonHelpers.CheckBoxList("SubTypes", Model.JobSubTypes.Where(jst => jst.JobTypeId == jt.Id).ToList().ToSelectListItems(Model.SubTypes), 2)
</td>
</tr>
}
</table>
<p class="actions">
<input type="submit" class="button" value="Create" />
</p>
<script type="text/javascript">
$(function () {
$trJobType = $('#trJobType');
$jobTypes = $trJobType.find('input[type="radio"]');
$jobTypes.change(jobTypeChange);
jobTypeChange();
function jobTypeChange() {
$('.jobSubTypes').hide();
var jobType = $jobTypes.filter(':checked').val();
$('#trJobSubType' + jobType).show();
}
});
</script>
</div>
}
+301 -301
View File
@@ -1,301 +1,301 @@
@model Disco.Web.Models.Job.CreateModel
@{
Layout = "~/Views/Shared/_DialogLayout.cshtml";
ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), "Create");
}
<div id="createJob_Container">
@using (Html.BeginForm(MVC.Job.Create(), FormMethod.Post))
{
@Html.HiddenFor(m => m.DeviceSerialNumber)
@Html.HiddenFor(m => m.UserId)
@Html.HiddenFor(m => m.QuickLogDestinationUrl)
@Html.Partial(MVC.Job.Views._CreateSubject, Model)
@Html.ValidationSummary(true)
<div class="createJob_Component">
<div id="createJob_Type">
<h3>Type</h3>
@Html.ValidationMessageFor(m => m.Type)
@CommonHelpers.RadioButtonList("Type", Model.JobTypes.ToSelectListItems(Model.Type), 3)
@Html.ValidationMessageFor(m => m.SubTypes)
</div>
<div id="createJob_SubTypes">
@foreach (var jt in Model.JobTypes)
{
<div id="createJob_SubType_@(jt.Id)" class="createJob_SubType">
<div class="createJob_SubTypes">
@CommonHelpers.CheckBoxList("SubTypes", Model.JobSubTypes.Where(jst => jst.JobTypeId == jt.Id).ToList().ToSelectListItems(Model.SubTypes), 3)
</div>
</div>
}
</div>
</div>
<div id="createJob_DeviceHeldContainer" class="createJob_Component">
@Html.ValidationMessageFor(m => m.DeviceHeld)
@Html.HiddenFor(m => m.DeviceHeld)
<table>
<tr>
<td>
<h3>Device Held</h3>
</td>
<td>
<input id="createJob_DeviceHeld" name="_DeviceHeld" type="radio" value="true" /><label for="createJob_DeviceHeld">Held</label>
</td>
<td>
<input id="createJob_DeviceNotHeld" name="_DeviceHeld" type="radio" value="false" /><label for="createJob_DeviceNotHeld">Not Held</label>
</td>
</tr>
</table>
</div>
<div id="createJob_CommentsContainer" class="createJob_Component">
<table>
<tr>
<td>
<h3>Comments</h3>
</td>
<td>
@Html.EditorFor(m => m.Comments)
</td>
</tr>
</table>
</div>
<div id="createJob_QuickLogContainer" class="createJob_Component">
<div id="createJob_QuickLogAutoCloseContainer">
<h3>Quick Log</h3>
<input id="createJob_QuickLog" name="QuickLog" type="checkbox" value="true" /><label for="createJob_QuickLog">Automatically close this job</label>
</div>
<div id="createJob_QuickLogTaskTimeContainer">
<h3>Task Time</h3>
@Html.ValidationMessageFor(m => m.QuickLogTaskTimeMinutes)
<input type="radio" id="createJob_TaskTime10" name="QuickLogTaskTimeMinutes" value="10" /><label for="createJob_TaskTime10"> 10 Minutes</label>
<input type="radio" id="createJob_TaskTime30" name="QuickLogTaskTimeMinutes" value="30" /><label for="createJob_TaskTime30"> 30 Minutes</label>
<input type="radio" id="createJob_TaskTime60" name="QuickLogTaskTimeMinutes" value="60" /><label for="createJob_TaskTime60"> 1 Hour</label>
<input type="radio" id="createJob_TaskTime120" name="QuickLogTaskTimeMinutes" value="120" /><label for="createJob_TaskTime120"> 2 Hours</label>
<input type="radio" id="createJob_TaskTimeOther" name="QuickLogTaskTimeMinutes" value="" /><label for="createJob_TaskTimeOther"> Other</label>
<span id="createJob_TaskTimeOtherMinutesContainer">
<input type="number" id="createJob_TaskTimeOtherMinutes" name="QuickLogTaskTimeMinutesOther" value="" disabled="disabled" />
Minutes
</span>
</div>
</div>
}
<script type="text/javascript">
$(function () {
var discoDialogMethods;
var init = true;
//#region Parent Dialog
if (window.parent && window.parent.document) {
$('#QuickLogDestinationUrl').val(window.parent.window.location.href);
var parentDialog = $('#createJobDialog', window.parent.document);
if (parentDialog.length > 0) {
discoDialogMethods = parentDialog[0].discoDialogMethods;
var buttons = {
"Create Job": function () {
createJobForm.submit()
},
Cancel: function () {
discoDialogMethods.close();
}
}
discoDialogMethods.setButtons(buttons);
}
}
//#endregion
var createJobForm = $('form');
var validator = createJobForm.data('validator');
var unobtrusiveValidation = createJobForm.data('unobtrusiveValidation');
// Validate all Fields
validator.settings.ignore = '';
//#region Job Type/SubTypes
var $jobTypeContainer = $('#createJob_Type');
var $typeValidationMessage = $('[data-valmsg-for="Type"]', $jobTypeContainer)
var $subTypesValidationMessage = $('[data-valmsg-for="SubTypes"]', $jobTypeContainer)
var $jobTypes = $jobTypeContainer.find('input[type="radio"]').change(jobTypeChange);
$('#createJob_SubTypes').find('input[type="checkbox"]').change(jobSubTypeHighlight).each(jobSubTypeHighlight);
jobTypeChange();
function jobSubTypeHighlight() {
var $this = $(this);
if ($this.is(':checked'))
$this.closest('li').addClass('highlight');
else
$this.closest('li').removeClass('highlight');
}
function jobTypeChange() {
var $checkedItem = $jobTypes.filter(':checked');
$jobTypes.closest('li').removeClass('highlight');
$checkedItem.closest('li').addClass('highlight');
if (init) {
var jobType = $checkedItem.val();
$('#createJob_SubType_' + jobType).show();
} else {
$('#createJob_SubTypes').find('.createJob_SubType:visible').slideUp();
var jobType = $checkedItem.val();
$('#createJob_SubType_' + jobType).slideDown();
}
}
var additionalValidation = function (form) {
var isValid = true;
// Validate Type
var typeValue = $jobTypes.filter(':checked').val();
if (typeValue) {
$typeValidationMessage.removeClass('field-validation-error').addClass('field-validation-valid');
// Validate SubTypes
if ($('#createJob_SubType_' + typeValue).find('input:checked').length > 0) {
$subTypesValidationMessage.removeClass('field-validation-error').addClass('field-validation-valid');
} else {
$subTypesValidationMessage.text('At least one Job Sub Type is required').removeClass('field-validation-valid').addClass('field-validation-error');
isValid = false;
}
} else {
$typeValidationMessage.text('A Job Type is required').removeClass('field-validation-valid').addClass('field-validation-error');
isValid = false;
}
// Validate QuickLog Task Time
if ($quickLog.is(':checked')) {
var selectedTime = $quickLogTaskTimes.filter(':checked');
if (selectedTime.length > 0) {
if (selectedTime.val() === '') {
// Handle 'Other'
var otherTime = parseInt($quickLogTaskTimeOtherMinutes.val());
if (!otherTime || otherTime <= 0) {
$quickLogTaskTimeValidationMessage.text('A Task Time is required').removeClass('field-validation-valid').addClass('field-validation-error');
isValid = false;
}
} else {
$quickLogTaskTimeValidationMessage.removeClass('field-validation-valid').addClass('field-validation-error');
}
} else {
$quickLogTaskTimeValidationMessage.text('A Task Time is required').removeClass('field-validation-valid').addClass('field-validation-error');
isValid = false;
}
} else {
$quickLogTaskTimeValidationMessage.removeClass('field-validation-valid').addClass('field-validation-error');
}
return isValid;
}
validator.settings.submitHandler = function (form) {
if (additionalValidation()) {
discoDialogMethods.setButtons({});
form.submit();
}
}
//#endregion
//#region DeviceHeld
var $deviceHeld = $('#DeviceHeld');
if ($('#DeviceSerialNumber').val()) {
switch ($deviceHeld.val()) {
case 'True':
$('#createJob_DeviceHeld').attr('checked', 'checked');
$('#createJob_DeviceNotHeld').attr('checked', null);
break;
case 'False':
$('#createJob_DeviceHeld').attr('checked', null);
$('#createJob_DeviceNotHeld').attr('checked', 'checked');
break;
default:
$('#createJob_DeviceHeld').attr('checked', null);
$('#createJob_DeviceNotHeld').attr('checked', null);
break;
}
$('#createJob_DeviceHeldContainer').find('input[type="radio"]').change(function () {
// Update Hidden Field with Boolean Value
// Set DeviceHeld
var deviceHeldValue = '';
if ($('#createJob_DeviceHeld').is(':checked'))
deviceHeldValue = 'True';
if ($('#createJob_DeviceNotHeld').is(':checked'))
deviceHeldValue = 'False';
$deviceHeld.val(deviceHeldValue).change();
});
} else {
// No Device Associated
$deviceHeld.val('False');
$('#createJob_DeviceHeldContainer').hide();
}
//#endregion
//#region QuickLog
var $quickLog = $('#createJob_QuickLog');
var $quickLogContainer = $('#createJob_QuickLogContainer');
var $quickLogTaskTimeContainer = $('#createJob_QuickLogTaskTimeContainer');
var $quickLogTaskTimes = $quickLogTaskTimeContainer.find('input[type="radio"]');
var $quickLogTaskTimeOtherMinutes = $('#createJob_TaskTimeOtherMinutes');
var $quickLogTaskTimeValidationMessage = $quickLogTaskTimeContainer.find('[data-valmsg-for="QuickLogTaskTimeMinutes"]');
$deviceHeld.change(validateQuickLog);
$jobTypes.change(validateQuickLog);
validateQuickLog();
function validateQuickLog() {
var quickLogAllowed = false;
if ($deviceHeld.val() === 'True') {
quickLogAllowed = false;
} else {
var selectedType = $jobTypes.filter(':checked').val();
switch (selectedType) {
case 'HMisc':
case 'SApp':
case 'SImg':
case 'SOS':
case 'UMgmt':
quickLogAllowed = true;
break;
default:
quickLogAllowed = false;
break;
}
}
if (quickLogAllowed) {
$quickLogContainer.slideDown();
} else {
if (init)
$quickLogContainer.hide();
else
$quickLogContainer.slideUp();
$quickLog.attr('checked', null).change();
}
}
$quickLog.change(function () {
if ($(this).is(':checked')) {
$quickLogTaskTimeContainer.slideDown();
} else {
$quickLogTaskTimeContainer.slideUp();
}
});
$quickLogTaskTimes.change(function () {
if ($quickLogTaskTimes.filter(':checked').val() === "") {
$('#createJob_TaskTimeOtherMinutesContainer').show();
$quickLogTaskTimeOtherMinutes.attr('disabled', null).focus().select();
} else {
$('#createJob_TaskTimeOtherMinutesContainer').hide();
$quickLogTaskTimeOtherMinutes.attr('disabled', 'disabled');
}
});
//#endregion
init = false;
});
</script>
</div>
@model Disco.Web.Models.Job.CreateModel
@{
Layout = "~/Views/Shared/_DialogLayout.cshtml";
ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), "Create");
}
<div id="createJob_Container">
@using (Html.BeginForm(MVC.Job.Create(), FormMethod.Post))
{
@Html.HiddenFor(m => m.DeviceSerialNumber)
@Html.HiddenFor(m => m.UserId)
@Html.HiddenFor(m => m.QuickLogDestinationUrl)
@Html.Partial(MVC.Job.Views._CreateSubject, Model)
@Html.ValidationSummary(true)
<div class="createJob_Component">
<div id="createJob_Type">
<h3>Type</h3>
@Html.ValidationMessageFor(m => m.Type)
@CommonHelpers.RadioButtonList("Type", Model.JobTypes.ToSelectListItems(Model.Type), 3)
@Html.ValidationMessageFor(m => m.SubTypes)
</div>
<div id="createJob_SubTypes">
@foreach (var jt in Model.JobTypes)
{
<div id="createJob_SubType_@(jt.Id)" class="createJob_SubType">
<div class="createJob_SubTypes">
@CommonHelpers.CheckBoxList("SubTypes", Model.JobSubTypes.Where(jst => jst.JobTypeId == jt.Id).ToList().ToSelectListItems(Model.SubTypes), 3)
</div>
</div>
}
</div>
</div>
<div id="createJob_DeviceHeldContainer" class="createJob_Component">
@Html.ValidationMessageFor(m => m.DeviceHeld)
@Html.HiddenFor(m => m.DeviceHeld)
<table>
<tr>
<td>
<h3>Device Held</h3>
</td>
<td>
<input id="createJob_DeviceHeld" name="_DeviceHeld" type="radio" value="true" /><label for="createJob_DeviceHeld">Held</label>
</td>
<td>
<input id="createJob_DeviceNotHeld" name="_DeviceHeld" type="radio" value="false" /><label for="createJob_DeviceNotHeld">Not Held</label>
</td>
</tr>
</table>
</div>
<div id="createJob_CommentsContainer" class="createJob_Component">
<table>
<tr>
<td>
<h3>Comments</h3>
</td>
<td>
@Html.EditorFor(m => m.Comments)
</td>
</tr>
</table>
</div>
<div id="createJob_QuickLogContainer" class="createJob_Component">
<div id="createJob_QuickLogAutoCloseContainer">
<h3>Quick Log</h3>
<input id="createJob_QuickLog" name="QuickLog" type="checkbox" value="true" /><label for="createJob_QuickLog">Automatically close this job</label>
</div>
<div id="createJob_QuickLogTaskTimeContainer">
<h3>Task Time</h3>
@Html.ValidationMessageFor(m => m.QuickLogTaskTimeMinutes)
<input type="radio" id="createJob_TaskTime10" name="QuickLogTaskTimeMinutes" value="10" /><label for="createJob_TaskTime10"> 10 Minutes</label>
<input type="radio" id="createJob_TaskTime30" name="QuickLogTaskTimeMinutes" value="30" /><label for="createJob_TaskTime30"> 30 Minutes</label>
<input type="radio" id="createJob_TaskTime60" name="QuickLogTaskTimeMinutes" value="60" /><label for="createJob_TaskTime60"> 1 Hour</label>
<input type="radio" id="createJob_TaskTime120" name="QuickLogTaskTimeMinutes" value="120" /><label for="createJob_TaskTime120"> 2 Hours</label>
<input type="radio" id="createJob_TaskTimeOther" name="QuickLogTaskTimeMinutes" value="" /><label for="createJob_TaskTimeOther"> Other</label>
<span id="createJob_TaskTimeOtherMinutesContainer">
<input type="number" id="createJob_TaskTimeOtherMinutes" name="QuickLogTaskTimeMinutesOther" value="" disabled="disabled" />
Minutes
</span>
</div>
</div>
}
<script type="text/javascript">
$(function () {
var discoDialogMethods;
var init = true;
//#region Parent Dialog
if (window.parent && window.parent.document) {
$('#QuickLogDestinationUrl').val(window.parent.window.location.href);
var parentDialog = $('#createJobDialog', window.parent.document);
if (parentDialog.length > 0) {
discoDialogMethods = parentDialog[0].discoDialogMethods;
var buttons = {
"Create Job": function () {
createJobForm.submit()
},
Cancel: function () {
discoDialogMethods.close();
}
}
discoDialogMethods.setButtons(buttons);
}
}
//#endregion
var createJobForm = $('form');
var validator = createJobForm.data('validator');
var unobtrusiveValidation = createJobForm.data('unobtrusiveValidation');
// Validate all Fields
validator.settings.ignore = '';
//#region Job Type/SubTypes
var $jobTypeContainer = $('#createJob_Type');
var $typeValidationMessage = $('[data-valmsg-for="Type"]', $jobTypeContainer)
var $subTypesValidationMessage = $('[data-valmsg-for="SubTypes"]', $jobTypeContainer)
var $jobTypes = $jobTypeContainer.find('input[type="radio"]').change(jobTypeChange);
$('#createJob_SubTypes').find('input[type="checkbox"]').change(jobSubTypeHighlight).each(jobSubTypeHighlight);
jobTypeChange();
function jobSubTypeHighlight() {
var $this = $(this);
if ($this.is(':checked'))
$this.closest('li').addClass('highlight');
else
$this.closest('li').removeClass('highlight');
}
function jobTypeChange() {
var $checkedItem = $jobTypes.filter(':checked');
$jobTypes.closest('li').removeClass('highlight');
$checkedItem.closest('li').addClass('highlight');
if (init) {
var jobType = $checkedItem.val();
$('#createJob_SubType_' + jobType).show();
} else {
$('#createJob_SubTypes').find('.createJob_SubType:visible').slideUp();
var jobType = $checkedItem.val();
$('#createJob_SubType_' + jobType).slideDown();
}
}
var additionalValidation = function (form) {
var isValid = true;
// Validate Type
var typeValue = $jobTypes.filter(':checked').val();
if (typeValue) {
$typeValidationMessage.removeClass('field-validation-error').addClass('field-validation-valid');
// Validate SubTypes
if ($('#createJob_SubType_' + typeValue).find('input:checked').length > 0) {
$subTypesValidationMessage.removeClass('field-validation-error').addClass('field-validation-valid');
} else {
$subTypesValidationMessage.text('At least one Job Sub Type is required').removeClass('field-validation-valid').addClass('field-validation-error');
isValid = false;
}
} else {
$typeValidationMessage.text('A Job Type is required').removeClass('field-validation-valid').addClass('field-validation-error');
isValid = false;
}
// Validate QuickLog Task Time
if ($quickLog.is(':checked')) {
var selectedTime = $quickLogTaskTimes.filter(':checked');
if (selectedTime.length > 0) {
if (selectedTime.val() === '') {
// Handle 'Other'
var otherTime = parseInt($quickLogTaskTimeOtherMinutes.val());
if (!otherTime || otherTime <= 0) {
$quickLogTaskTimeValidationMessage.text('A Task Time is required').removeClass('field-validation-valid').addClass('field-validation-error');
isValid = false;
}
} else {
$quickLogTaskTimeValidationMessage.removeClass('field-validation-valid').addClass('field-validation-error');
}
} else {
$quickLogTaskTimeValidationMessage.text('A Task Time is required').removeClass('field-validation-valid').addClass('field-validation-error');
isValid = false;
}
} else {
$quickLogTaskTimeValidationMessage.removeClass('field-validation-valid').addClass('field-validation-error');
}
return isValid;
}
validator.settings.submitHandler = function (form) {
if (additionalValidation()) {
discoDialogMethods.setButtons({});
form.submit();
}
}
//#endregion
//#region DeviceHeld
var $deviceHeld = $('#DeviceHeld');
if ($('#DeviceSerialNumber').val()) {
switch ($deviceHeld.val()) {
case 'True':
$('#createJob_DeviceHeld').prop('checked', true);
$('#createJob_DeviceNotHeld').prop('checked', false);
break;
case 'False':
$('#createJob_DeviceHeld').prop('checked', false);
$('#createJob_DeviceNotHeld').prop('checked', true);
break;
default:
$('#createJob_DeviceHeld').prop('checked', false);
$('#createJob_DeviceNotHeld').prop('checked', false);
break;
}
$('#createJob_DeviceHeldContainer').find('input[type="radio"]').change(function () {
// Update Hidden Field with Boolean Value
// Set DeviceHeld
var deviceHeldValue = '';
if ($('#createJob_DeviceHeld').is(':checked'))
deviceHeldValue = 'True';
if ($('#createJob_DeviceNotHeld').is(':checked'))
deviceHeldValue = 'False';
$deviceHeld.val(deviceHeldValue).change();
});
} else {
// No Device Associated
$deviceHeld.val('False');
$('#createJob_DeviceHeldContainer').hide();
}
//#endregion
//#region QuickLog
var $quickLog = $('#createJob_QuickLog');
var $quickLogContainer = $('#createJob_QuickLogContainer');
var $quickLogTaskTimeContainer = $('#createJob_QuickLogTaskTimeContainer');
var $quickLogTaskTimes = $quickLogTaskTimeContainer.find('input[type="radio"]');
var $quickLogTaskTimeOtherMinutes = $('#createJob_TaskTimeOtherMinutes');
var $quickLogTaskTimeValidationMessage = $quickLogTaskTimeContainer.find('[data-valmsg-for="QuickLogTaskTimeMinutes"]');
$deviceHeld.change(validateQuickLog);
$jobTypes.change(validateQuickLog);
validateQuickLog();
function validateQuickLog() {
var quickLogAllowed = false;
if ($deviceHeld.val() === 'True') {
quickLogAllowed = false;
} else {
var selectedType = $jobTypes.filter(':checked').val();
switch (selectedType) {
case 'HMisc':
case 'SApp':
case 'SImg':
case 'SOS':
case 'UMgmt':
quickLogAllowed = true;
break;
default:
quickLogAllowed = false;
break;
}
}
if (quickLogAllowed) {
$quickLogContainer.slideDown();
} else {
if (init)
$quickLogContainer.hide();
else
$quickLogContainer.slideUp();
$quickLog.prop('checked', false).change();
}
}
$quickLog.change(function () {
if ($(this).is(':checked')) {
$quickLogTaskTimeContainer.slideDown();
} else {
$quickLogTaskTimeContainer.slideUp();
}
});
$quickLogTaskTimes.change(function () {
if ($quickLogTaskTimes.filter(':checked').val() === "") {
$('#createJob_TaskTimeOtherMinutesContainer').show();
$quickLogTaskTimeOtherMinutes.attr('disabled', null).focus().select();
} else {
$('#createJob_TaskTimeOtherMinutesContainer').hide();
$quickLogTaskTimeOtherMinutes.attr('disabled', 'disabled');
}
});
//#endregion
init = false;
});
</script>
</div>
File diff suppressed because it is too large Load Diff
+187 -184
View File
@@ -1,184 +1,187 @@
@model Disco.Web.Models.Job.ShowModel
@{
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-NumberFormatter");
}
<table id="jobComponents">
<tr>
<th>
Description
</th>
<th>
Cost
</th>
<th class="actions">
&nbsp;
</th>
</tr>
@foreach (var jc in Model.Job.JobComponents)
{
<tr data-jobcomponentid="@jc.Id">
<td>
<input type="text" class="description" value="@jc.Description" />
</td>
<td>
<input type="text" class="cost" value="@jc.Cost.ToString("C")" />
</td>
<td>
<span class="remove"></span>
</td>
</tr>
}
<tr>
<td>
<a href="#" id="jobComponentsAdd">Add Component</a>
</td>
<td colspan="2" class="totalCost">
Total: <span id="jobComponentsTotalCost"></span>
</td>
</tr>
</table>
<div id="dialogRemoveComponent" title="Remove this Component?">
<p>
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
Are you sure?</p>
</div>
<script type="text/javascript">
$(function () {
var $jobComponents = $('#jobComponents');
$jobComponents.find('input').live('change', updateComponent).focus(function () { $(this).select() }).filter('.cost');
$jobComponents.find('span.remove').live('click', removeComponent);
$('#jobComponentsAdd').click(function () {
var jc = $('<tr><td><input type="text" class="description" /></td><td><input type="text" class="cost" /></td><td><span class="remove"></span></td></tr>');
jc.find('input').focus(function () { $(this).select() })
jc.insertBefore($jobComponents.find('tr').last());
jc.find('input.description').focus();
return false;
});
$('#dialogRemoveComponent').dialog({
resizable: false,
height: 140,
modal: true,
autoOpen: false
});
function removeComponent() {
var componentRow = $(this).closest('tr');
var id = componentRow.attr('data-jobcomponentid');
if (id) {
var data = { id: id };
var $dialogRemoveComponent = $('#dialogRemoveComponent');
$dialogRemoveComponent.dialog("enable");
$dialogRemoveComponent.dialog('option', 'buttons', {
"Remove": function () {
$dialogRemoveComponent.dialog("disable");
$dialogRemoveComponent.dialog("option", "buttons", null);
$.ajax({
url: '@Url.Action(MVC.API.Job.ComponentRemove())',
dataType: 'json',
data: data,
success: function (d) {
if (d == 'OK') {
componentRow.remove();
updateTotalCost();
} else {
alert('Unable to remove component: ' + d);
}
$dialogRemoveComponent.dialog("close");
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to remove component: ' + textStatus);
$dialogRemoveComponent.dialog("close");
}
});
},
Cancel: function () {
$dialogRemoveComponent.dialog("close");
}
});
$dialogRemoveComponent.dialog('open');
} else {
// New - Remove
componentRow.remove();
updateTotalCost();
}
}
function updateTotalCost() {
var totalCost = 0;
$jobComponents.find('input.cost').each(function () {
var v = $(this).val();
v = $.parseNumber(v, { format: '#,##0.00', locale: 'au' });
if (!isNaN(v))
totalCost += v;
});
var totalCostFormatted = $.formatNumber(totalCost, { format: '#,##0.00', locale: 'au' });
$('#jobComponentsTotalCost').text('$' + totalCostFormatted);
}
function updateComponent() {
var componentRow = $(this).closest('tr');
componentRow.find('input').attr('disabled', true).addClass('updating');
var id = componentRow.attr('data-jobcomponentid');
if (id) {
// Update
var data = {
id: id,
Description: componentRow.find('input.description').val(),
Cost: componentRow.find('input.cost').val()
};
$.ajax({
url: '@Url.Action(MVC.API.Job.ComponentUpdate())',
dataType: 'json',
data: data,
success: function (d) {
componentRow.find('input').attr('disabled', false).removeClass('updating');
if (d.Result == 'OK') {
componentRow.find('input.description').val(d.Component.Description);
componentRow.find('input.cost').val(d.Component.Cost);
} else {
alert('Unable to update component: ' + d.Result);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update component: ' + textStatus);
}
});
} else {
// Add
var data = {
id: id,
Description: componentRow.find('input.description').val(),
Cost: componentRow.find('input.cost').val()
};
$.ajax({
url: '@Url.Action(MVC.API.Job.ComponentAdd(Model.Job.Id, null, null))',
dataType: 'json',
data: data,
success: function (d) {
componentRow.find('input').attr('disabled', false).removeClass('updating');
if (d.Result == 'OK') {
componentRow.attr('data-jobcomponentid', d.Component.Id);
componentRow.find('input.description').val(d.Component.Description);
componentRow.find('input.cost').val(d.Component.Cost);
} else {
alert('Unable to add component: ' + d.Result);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to add component: ' + textStatus);
}
});
}
updateTotalCost();
}
updateTotalCost();
});
</script>
@model Disco.Web.Models.Job.ShowModel
@{
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-NumberFormatter");
}
<table id="jobComponents">
<tr>
<th>
Description
</th>
<th>
Cost
</th>
<th class="actions">
&nbsp;
</th>
</tr>
@foreach (var jc in Model.Job.JobComponents)
{
<tr data-jobcomponentid="@jc.Id">
<td>
<input type="text" class="description" value="@jc.Description" />
</td>
<td>
<input type="text" class="cost" value="@jc.Cost.ToString("C")" />
</td>
<td>
<span class="remove"></span>
</td>
</tr>
}
<tr>
<td>
<a href="#" id="jobComponentsAdd">Add Component</a>
</td>
<td colspan="2" class="totalCost">
Total: <span id="jobComponentsTotalCost"></span>
</td>
</tr>
</table>
<div id="dialogRemoveComponent" title="Remove this Component?">
<p>
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
Are you sure?</p>
</div>
<script type="text/javascript">
$(function () {
var $jobComponents = $('#jobComponents');
$jobComponents.on('change', 'input', updateComponent);
$jobComponents.on('focus', 'input', function () { $(this).select() });
$jobComponents.on('click', 'span.remove', removeComponent);
$('#jobComponentsAdd').click(function () {
var jc = $('<tr><td><input type="text" class="description" /></td><td><input type="text" class="cost" /></td><td><span class="remove"></span></td></tr>');
jc.find('input').focus(function () { $(this).select() })
jc.insertBefore($jobComponents.find('tr').last());
jc.find('input.description').focus();
return false;
});
$('#dialogRemoveComponent').dialog({
resizable: false,
height: 140,
modal: true,
autoOpen: false
});
function removeComponent() {
var componentRow = $(this).closest('tr');
var id = componentRow.attr('data-jobcomponentid');
if (id) {
var data = { id: id };
var $dialogRemoveComponent = $('#dialogRemoveComponent');
$dialogRemoveComponent.dialog("enable");
$dialogRemoveComponent.dialog('option', 'buttons', {
"Remove": function () {
$dialogRemoveComponent.dialog("disable");
$dialogRemoveComponent.dialog("option", "buttons", null);
$.ajax({
url: '@Url.Action(MVC.API.Job.ComponentRemove())',
dataType: 'json',
data: data,
success: function (d) {
if (d == 'OK') {
componentRow.remove();
updateTotalCost();
} else {
alert('Unable to remove component: ' + d);
}
$dialogRemoveComponent.dialog("close");
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to remove component: ' + textStatus);
$dialogRemoveComponent.dialog("close");
}
});
},
Cancel: function () {
$dialogRemoveComponent.dialog("close");
}
});
$dialogRemoveComponent.dialog('open');
} else {
// New - Remove
componentRow.remove();
updateTotalCost();
}
}
function updateTotalCost() {
var totalCost = 0;
$jobComponents.find('input.cost').each(function () {
var v = $(this).val();
v = $.parseNumber(v, { format: '#,##0.00', locale: 'au' });
if (!isNaN(v))
totalCost += v;
});
var totalCostFormatted = $.formatNumber(totalCost, { format: '#,##0.00', locale: 'au' });
$('#jobComponentsTotalCost').text('$' + totalCostFormatted);
}
function updateComponent() {
var componentRow = $(this).closest('tr');
componentRow.find('input').attr('disabled', true).addClass('updating');
var id = componentRow.attr('data-jobcomponentid');
if (id) {
// Update
var data = {
id: id,
Description: componentRow.find('input.description').val(),
Cost: componentRow.find('input.cost').val()
};
$.ajax({
url: '@Url.Action(MVC.API.Job.ComponentUpdate())',
dataType: 'json',
data: data,
success: function (d) {
componentRow.find('input').attr('disabled', false).removeClass('updating');
if (d.Result == 'OK') {
componentRow.find('input.description').val(d.Component.Description);
componentRow.find('input.cost').val(d.Component.Cost);
} else {
alert('Unable to update component: ' + d.Result);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update component: ' + textStatus);
}
});
} else {
// Add
var data = {
id: id,
Description: componentRow.find('input.description').val(),
Cost: componentRow.find('input.cost').val()
};
$.ajax({
url: '@Url.Action(MVC.API.Job.ComponentAdd(Model.Job.Id, null, null))',
dataType: 'json',
data: data,
success: function (d) {
componentRow.find('input').attr('disabled', false).removeClass('updating');
if (d.Result == 'OK') {
componentRow.attr('data-jobcomponentid', d.Component.Id);
componentRow.find('input.description').val(d.Component.Description);
componentRow.find('input.cost').val(d.Component.Cost);
} else {
alert('Unable to add component: ' + d.Result);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to add component: ' + textStatus);
}
});
}
updateTotalCost();
}
updateTotalCost();
});
</script>
@@ -1,294 +1,295 @@
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17929
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Disco.Web.Views.Job.JobParts
{
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", "1.5.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Job/JobParts/Components.cshtml")]
public class Components : System.Web.Mvc.WebViewPage<Disco.Web.Models.Job.ShowModel>
{
public Components()
{
}
public override void Execute()
{
#line 2 "..\..\Views\Job\JobParts\Components.cshtml"
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-NumberFormatter");
#line default
#line hidden
WriteLiteral("\r\n<table");
WriteLiteral(" id=\"jobComponents\"");
WriteLiteral(">\r\n <tr>\r\n <th>\r\n Description\r\n </th>\r\n <th>\r\n" +
" Cost\r\n </th>\r\n <th");
WriteLiteral(" class=\"actions\"");
WriteLiteral(">\r\n &nbsp;\r\n </th>\r\n </tr>\r\n");
#line 17 "..\..\Views\Job\JobParts\Components.cshtml"
#line default
#line hidden
#line 17 "..\..\Views\Job\JobParts\Components.cshtml"
foreach (var jc in Model.Job.JobComponents)
{
#line default
#line hidden
WriteLiteral(" <tr");
WriteLiteral(" data-jobcomponentid=\"");
#line 19 "..\..\Views\Job\JobParts\Components.cshtml"
Write(jc.Id);
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(">\r\n <td>\r\n <input");
WriteLiteral(" type=\"text\"");
WriteLiteral(" class=\"description\"");
WriteAttribute("value", Tuple.Create(" value=\"", 513), Tuple.Create("\"", 536)
#line 21 "..\..\Views\Job\JobParts\Components.cshtml"
, Tuple.Create(Tuple.Create("", 521), Tuple.Create<System.Object, System.Int32>(jc.Description
#line default
#line hidden
, 521), false)
);
WriteLiteral(" />\r\n </td>\r\n <td>\r\n <input");
WriteLiteral(" type=\"text\"");
WriteLiteral(" class=\"cost\"");
WriteAttribute("value", Tuple.Create(" value=\"", 626), Tuple.Create("\"", 656)
#line 24 "..\..\Views\Job\JobParts\Components.cshtml"
, Tuple.Create(Tuple.Create("", 634), Tuple.Create<System.Object, System.Int32>(jc.Cost.ToString("C")
#line default
#line hidden
, 634), false)
);
WriteLiteral(" />\r\n </td>\r\n <td>\r\n <span");
WriteLiteral(" class=\"remove\"");
WriteLiteral("></span>\r\n </td>\r\n </tr>\r\n");
#line 30 "..\..\Views\Job\JobParts\Components.cshtml"
}
#line default
#line hidden
WriteLiteral(" <tr>\r\n <td>\r\n <a");
WriteLiteral(" href=\"#\"");
WriteLiteral(" id=\"jobComponentsAdd\"");
WriteLiteral(">Add Component</a>\r\n </td>\r\n <td");
WriteLiteral(" colspan=\"2\"");
WriteLiteral(" class=\"totalCost\"");
WriteLiteral(">\r\n Total: <span");
WriteLiteral(" id=\"jobComponentsTotalCost\"");
WriteLiteral("></span>\r\n </td>\r\n </tr>\r\n</table>\r\n<div");
WriteLiteral(" id=\"dialogRemoveComponent\"");
WriteLiteral(" title=\"Remove this Component?\"");
WriteLiteral(">\r\n <p>\r\n <span");
WriteLiteral(" class=\"ui-icon ui-icon-alert\"");
WriteLiteral(" style=\"float: left; margin: 0 7px 20px 0;\"");
WriteLiteral("></span>\r\n Are you sure?</p>\r\n</div>\r\n<script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(">\r\n $(function () {\r\n var $jobComponents = $(\'#jobComponents\');\r\n\r\n " +
" $jobComponents.find(\'input\').live(\'change\', updateComponent).focus(function " +
"() { $(this).select() }).filter(\'.cost\');\r\n $jobComponents.find(\'span.rem" +
"ove\').live(\'click\', removeComponent);\r\n\r\n $(\'#jobComponentsAdd\').click(fu" +
"nction () {\r\n var jc = $(\'<tr><td><input type=\"text\" class=\"descripti" +
"on\" /></td><td><input type=\"text\" class=\"cost\" /></td><td><span class=\"remove\"><" +
"/span></td></tr>\');\r\n jc.find(\'input\').focus(function () { $(this).se" +
"lect() })\r\n jc.insertBefore($jobComponents.find(\'tr\').last());\r\n " +
" jc.find(\'input.description\').focus();\r\n return false;\r\n " +
" });\r\n\r\n $(\'#dialogRemoveComponent\').dialog({\r\n resizable: fal" +
"se,\r\n height: 140,\r\n modal: true,\r\n autoOpen: f" +
"alse\r\n });\r\n\r\n function removeComponent() {\r\n var compo" +
"nentRow = $(this).closest(\'tr\');\r\n var id = componentRow.attr(\'data-j" +
"obcomponentid\');\r\n if (id) {\r\n var data = { id: id };\r" +
"\n\r\n var $dialogRemoveComponent = $(\'#dialogRemoveComponent\');\r\n " +
" $dialogRemoveComponent.dialog(\"enable\");\r\n $dialogR" +
"emoveComponent.dialog(\'option\', \'buttons\', {\r\n \"Remove\": func" +
"tion () {\r\n $dialogRemoveComponent.dialog(\"disable\");\r\n " +
" $dialogRemoveComponent.dialog(\"option\", \"buttons\", null);\r" +
"\n $.ajax({\r\n url: \'");
#line 80 "..\..\Views\Job\JobParts\Components.cshtml"
Write(Url.Action(MVC.API.Job.ComponentRemove()));
#line default
#line hidden
WriteLiteral("\',\r\n dataType: \'json\',\r\n da" +
"ta: data,\r\n success: function (d) {\r\n " +
" if (d == \'OK\') {\r\n componentR" +
"ow.remove();\r\n updateTotalCost();\r\n " +
" } else {\r\n alert(\'Unabl" +
"e to remove component: \' + d);\r\n }\r\n " +
" $dialogRemoveComponent.dialog(\"close\");\r\n " +
" },\r\n error: function (jqXHR, textStatus, erro" +
"rThrown) {\r\n alert(\'Unable to remove component: \'" +
" + textStatus);\r\n $dialogRemoveComponent.dialog(\"" +
"close\");\r\n }\r\n });\r\n " +
" },\r\n Cancel: function () {\r\n " +
" $dialogRemoveComponent.dialog(\"close\");\r\n }\r\n " +
" });\r\n\r\n $dialogRemoveComponent.dialog(\'open\');\r\n\r\n } " +
"else {\r\n // New - Remove\r\n componentRow.remove();\r" +
"\n updateTotalCost();\r\n }\r\n }\r\n function " +
"updateTotalCost() {\r\n var totalCost = 0;\r\n\r\n $jobComponent" +
"s.find(\'input.cost\').each(function () {\r\n var v = $(this).val();\r" +
"\n v = $.parseNumber(v, { format: \'#,##0.00\', locale: \'au\' });\r\n " +
" if (!isNaN(v))\r\n totalCost += v;\r\n }" +
");\r\n var totalCostFormatted = $.formatNumber(totalCost, { format: \'#," +
"##0.00\', locale: \'au\' });\r\n $(\'#jobComponentsTotalCost\').text(\'$\' + t" +
"otalCostFormatted);\r\n }\r\n function updateComponent() {\r\n " +
" var componentRow = $(this).closest(\'tr\');\r\n\r\n componentRow.find(\'in" +
"put\').attr(\'disabled\', true).addClass(\'updating\');\r\n\r\n var id = compo" +
"nentRow.attr(\'data-jobcomponentid\');\r\n if (id) {\r\n // " +
"Update\r\n var data = {\r\n id: id,\r\n " +
" Description: componentRow.find(\'input.description\').val(),\r\n " +
" Cost: componentRow.find(\'input.cost\').val()\r\n };\r\n " +
" $.ajax({\r\n url: \'");
#line 137 "..\..\Views\Job\JobParts\Components.cshtml"
Write(Url.Action(MVC.API.Job.ComponentUpdate()));
#line default
#line hidden
WriteLiteral(@"',
dataType: 'json',
data: data,
success: function (d) {
componentRow.find('input').attr('disabled', false).removeClass('updating');
if (d.Result == 'OK') {
componentRow.find('input.description').val(d.Component.Description);
componentRow.find('input.cost').val(d.Component.Cost);
} else {
alert('Unable to update component: ' + d.Result);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update component: ' + textStatus);
}
});
} else {
// Add
var data = {
id: id,
Description: componentRow.find('input.description').val(),
Cost: componentRow.find('input.cost').val()
};
$.ajax({
url: '");
#line 161 "..\..\Views\Job\JobParts\Components.cshtml"
Write(Url.Action(MVC.API.Job.ComponentAdd(Model.Job.Id, null, null)));
#line default
#line hidden
WriteLiteral(@"',
dataType: 'json',
data: data,
success: function (d) {
componentRow.find('input').attr('disabled', false).removeClass('updating');
if (d.Result == 'OK') {
componentRow.attr('data-jobcomponentid', d.Component.Id);
componentRow.find('input.description').val(d.Component.Description);
componentRow.find('input.cost').val(d.Component.Cost);
} else {
alert('Unable to add component: ' + d.Result);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to add component: ' + textStatus);
}
});
}
updateTotalCost();
}
updateTotalCost();
});
</script>
");
}
}
}
#pragma warning restore 1591
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17929
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Disco.Web.Views.Job.JobParts
{
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", "1.5.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Job/JobParts/Components.cshtml")]
public class Components : System.Web.Mvc.WebViewPage<Disco.Web.Models.Job.ShowModel>
{
public Components()
{
}
public override void Execute()
{
#line 2 "..\..\Views\Job\JobParts\Components.cshtml"
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-NumberFormatter");
#line default
#line hidden
WriteLiteral("\r\n<table");
WriteLiteral(" id=\"jobComponents\"");
WriteLiteral(">\r\n <tr>\r\n <th>\r\n Description\r\n </th>\r\n <th>\r\n" +
" Cost\r\n </th>\r\n <th");
WriteLiteral(" class=\"actions\"");
WriteLiteral(">\r\n &nbsp;\r\n </th>\r\n </tr>\r\n");
#line 17 "..\..\Views\Job\JobParts\Components.cshtml"
#line default
#line hidden
#line 17 "..\..\Views\Job\JobParts\Components.cshtml"
foreach (var jc in Model.Job.JobComponents)
{
#line default
#line hidden
WriteLiteral(" <tr");
WriteLiteral(" data-jobcomponentid=\"");
#line 19 "..\..\Views\Job\JobParts\Components.cshtml"
Write(jc.Id);
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(">\r\n <td>\r\n <input");
WriteLiteral(" type=\"text\"");
WriteLiteral(" class=\"description\"");
WriteAttribute("value", Tuple.Create(" value=\"", 513), Tuple.Create("\"", 536)
#line 21 "..\..\Views\Job\JobParts\Components.cshtml"
, Tuple.Create(Tuple.Create("", 521), Tuple.Create<System.Object, System.Int32>(jc.Description
#line default
#line hidden
, 521), false)
);
WriteLiteral(" />\r\n </td>\r\n <td>\r\n <input");
WriteLiteral(" type=\"text\"");
WriteLiteral(" class=\"cost\"");
WriteAttribute("value", Tuple.Create(" value=\"", 626), Tuple.Create("\"", 656)
#line 24 "..\..\Views\Job\JobParts\Components.cshtml"
, Tuple.Create(Tuple.Create("", 634), Tuple.Create<System.Object, System.Int32>(jc.Cost.ToString("C")
#line default
#line hidden
, 634), false)
);
WriteLiteral(" />\r\n </td>\r\n <td>\r\n <span");
WriteLiteral(" class=\"remove\"");
WriteLiteral("></span>\r\n </td>\r\n </tr>\r\n");
#line 30 "..\..\Views\Job\JobParts\Components.cshtml"
}
#line default
#line hidden
WriteLiteral(" <tr>\r\n <td>\r\n <a");
WriteLiteral(" href=\"#\"");
WriteLiteral(" id=\"jobComponentsAdd\"");
WriteLiteral(">Add Component</a>\r\n </td>\r\n <td");
WriteLiteral(" colspan=\"2\"");
WriteLiteral(" class=\"totalCost\"");
WriteLiteral(">\r\n Total: <span");
WriteLiteral(" id=\"jobComponentsTotalCost\"");
WriteLiteral("></span>\r\n </td>\r\n </tr>\r\n</table>\r\n<div");
WriteLiteral(" id=\"dialogRemoveComponent\"");
WriteLiteral(" title=\"Remove this Component?\"");
WriteLiteral(">\r\n <p>\r\n <span");
WriteLiteral(" class=\"ui-icon ui-icon-alert\"");
WriteLiteral(" style=\"float: left; margin: 0 7px 20px 0;\"");
WriteLiteral("></span>\r\n Are you sure?</p>\r\n</div>\r\n<script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(">\r\n $(function () {\r\n var $jobComponents = $(\'#jobComponents\');\r\n\r\n " +
" $jobComponents.on(\'change\', \'input\', updateComponent);\r\n $jobComponen" +
"ts.on(\'focus\', \'input\', function () { $(this).select() });\r\n\r\n\r\n $jobComp" +
"onents.on(\'click\', \'span.remove\', removeComponent);\r\n\r\n $(\'#jobComponents" +
"Add\').click(function () {\r\n var jc = $(\'<tr><td><input type=\"text\" cl" +
"ass=\"description\" /></td><td><input type=\"text\" class=\"cost\" /></td><td><span cl" +
"ass=\"remove\"></span></td></tr>\');\r\n jc.find(\'input\').focus(function (" +
") { $(this).select() })\r\n jc.insertBefore($jobComponents.find(\'tr\').l" +
"ast());\r\n jc.find(\'input.description\').focus();\r\n return f" +
"alse;\r\n });\r\n\r\n $(\'#dialogRemoveComponent\').dialog({\r\n " +
"resizable: false,\r\n height: 140,\r\n modal: true,\r\n " +
" autoOpen: false\r\n });\r\n\r\n function removeComponent() {\r\n " +
" var componentRow = $(this).closest(\'tr\');\r\n var id = componentRo" +
"w.attr(\'data-jobcomponentid\');\r\n if (id) {\r\n var data " +
"= { id: id };\r\n\r\n var $dialogRemoveComponent = $(\'#dialogRemoveCo" +
"mponent\');\r\n $dialogRemoveComponent.dialog(\"enable\");\r\n " +
" $dialogRemoveComponent.dialog(\'option\', \'buttons\', {\r\n " +
"\"Remove\": function () {\r\n $dialogRemoveComponent.dialog(\"" +
"disable\");\r\n $dialogRemoveComponent.dialog(\"option\", \"but" +
"tons\", null);\r\n $.ajax({\r\n url" +
": \'");
#line 83 "..\..\Views\Job\JobParts\Components.cshtml"
Write(Url.Action(MVC.API.Job.ComponentRemove()));
#line default
#line hidden
WriteLiteral("\',\r\n dataType: \'json\',\r\n da" +
"ta: data,\r\n success: function (d) {\r\n " +
" if (d == \'OK\') {\r\n componentR" +
"ow.remove();\r\n updateTotalCost();\r\n " +
" } else {\r\n alert(\'Unabl" +
"e to remove component: \' + d);\r\n }\r\n " +
" $dialogRemoveComponent.dialog(\"close\");\r\n " +
" },\r\n error: function (jqXHR, textStatus, erro" +
"rThrown) {\r\n alert(\'Unable to remove component: \'" +
" + textStatus);\r\n $dialogRemoveComponent.dialog(\"" +
"close\");\r\n }\r\n });\r\n " +
" },\r\n Cancel: function () {\r\n " +
" $dialogRemoveComponent.dialog(\"close\");\r\n }\r\n " +
" });\r\n\r\n $dialogRemoveComponent.dialog(\'open\');\r\n\r\n } " +
"else {\r\n // New - Remove\r\n componentRow.remove();\r" +
"\n updateTotalCost();\r\n }\r\n }\r\n function " +
"updateTotalCost() {\r\n var totalCost = 0;\r\n\r\n $jobComponent" +
"s.find(\'input.cost\').each(function () {\r\n var v = $(this).val();\r" +
"\n v = $.parseNumber(v, { format: \'#,##0.00\', locale: \'au\' });\r\n " +
" if (!isNaN(v))\r\n totalCost += v;\r\n }" +
");\r\n var totalCostFormatted = $.formatNumber(totalCost, { format: \'#," +
"##0.00\', locale: \'au\' });\r\n $(\'#jobComponentsTotalCost\').text(\'$\' + t" +
"otalCostFormatted);\r\n }\r\n function updateComponent() {\r\n " +
" var componentRow = $(this).closest(\'tr\');\r\n\r\n componentRow.find(\'in" +
"put\').attr(\'disabled\', true).addClass(\'updating\');\r\n\r\n var id = compo" +
"nentRow.attr(\'data-jobcomponentid\');\r\n if (id) {\r\n // " +
"Update\r\n var data = {\r\n id: id,\r\n " +
" Description: componentRow.find(\'input.description\').val(),\r\n " +
" Cost: componentRow.find(\'input.cost\').val()\r\n };\r\n " +
" $.ajax({\r\n url: \'");
#line 140 "..\..\Views\Job\JobParts\Components.cshtml"
Write(Url.Action(MVC.API.Job.ComponentUpdate()));
#line default
#line hidden
WriteLiteral(@"',
dataType: 'json',
data: data,
success: function (d) {
componentRow.find('input').attr('disabled', false).removeClass('updating');
if (d.Result == 'OK') {
componentRow.find('input.description').val(d.Component.Description);
componentRow.find('input.cost').val(d.Component.Cost);
} else {
alert('Unable to update component: ' + d.Result);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update component: ' + textStatus);
}
});
} else {
// Add
var data = {
id: id,
Description: componentRow.find('input.description').val(),
Cost: componentRow.find('input.cost').val()
};
$.ajax({
url: '");
#line 164 "..\..\Views\Job\JobParts\Components.cshtml"
Write(Url.Action(MVC.API.Job.ComponentAdd(Model.Job.Id, null, null)));
#line default
#line hidden
WriteLiteral(@"',
dataType: 'json',
data: data,
success: function (d) {
componentRow.find('input').attr('disabled', false).removeClass('updating');
if (d.Result == 'OK') {
componentRow.attr('data-jobcomponentid', d.Component.Id);
componentRow.find('input.description').val(d.Component.Description);
componentRow.find('input.cost').val(d.Component.Cost);
} else {
alert('Unable to add component: ' + d.Result);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to add component: ' + textStatus);
}
});
}
updateTotalCost();
}
updateTotalCost();
});
</script>
");
}
}
}
#pragma warning restore 1591
+90 -90
View File
@@ -1,90 +1,90 @@
@model Disco.Web.Models.Job.ShowModel
@{
var validFlags = Model.Job.ValidFlagsGrouped();
}
<div id="jobDetailTab-Flags" class="jobPart">
<table id="jobFlags">
@foreach (var flagGroup in validFlags)
{
<tr>
<th>
<span class="flagGroupName">@flagGroup.Key</span><br />
@AjaxHelpers.AjaxLoader()
</th>
<td>
@foreach (var flagItem in flagGroup.Value)
{
<div>
<input type="checkbox" value="@flagItem.Item1" id="jobFlag_@(flagItem.Item1)" @(flagItem.Item3 ? new HtmlString("checked=\"checked\"") : new HtmlString(string.Empty)) /><label id="jobFlagLabel_@(flagItem.Item1)" for="jobFlag_@(flagItem.Item1)">@flagItem.Item2</label></div>
}
</td>
</tr>
}
</table>
<div id="dialogFlagsAction" title="Add Flag">
@using (Html.BeginForm(MVC.API.Job.UpdateFlag(Model.Job.Id, null, null, true)))
{
<input id="dialogFlagsActionFlag" type="hidden" name="Flag" value="0" />
<h3>
Reason:</h3>
<p>
<textarea name="Reason" class="block"></textarea>
</p>
}
</div>
<script type="text/javascript">
$('#jobDetailTabItems').append('<li><a href="#jobDetailTab-Flags">Flags</a></li>');
$(function () {
var $flagCheckboxes = $('#jobFlags').find('input[type="checkbox"]');
var $dialogFlagsAction = $('#dialogFlagsAction');
var $flagCheckbox;
var updateFlags = function () {
$flagCheckbox = $(this);
var flagValue = $flagCheckbox.val();
if ($flagCheckbox.is(':checked')) {
// Add
$('#dialogFlagsActionFlag').val(flagValue);
var title = 'Add Flag: ' + $flagCheckbox.closest('tr').find('th .flagGroupName').text() + ': ' + $('#jobFlagLabel_' + flagValue).text();
$dialogFlagsAction.dialog('option', 'title', title);
$dialogFlagsAction.dialog('open');
} else {
// Remove
var $ajaxLoading = $flagCheckbox.closest('tr').find('span.ajaxLoading');
$ajaxLoading.show();
$.getJSON('@(Url.Action(MVC.API.Job.UpdateFlag(Model.Job.Id, null, null, false)))', { Flag: '-' + flagValue }, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Flag:\n' + response);
$ajaxLoading.hide();
} else {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
})
}
};
$dialogFlagsAction.dialog({
resizable: false,
height: 240,
modal: true,
autoOpen: false,
buttons: {
"Add": function () {
var $this = $(this);
$this.dialog("disable");
$this.dialog("option", "buttons", null);
$this.find('form').first().submit();
},
Cancel: function () {
$(this).dialog("close");
}
},
close: function () {
$flagCheckbox.attr('checked', false);
}
});
$flagCheckboxes.click(updateFlags);
});
</script>
</div>
@model Disco.Web.Models.Job.ShowModel
@{
var validFlags = Model.Job.ValidFlagsGrouped();
}
<div id="jobDetailTab-Flags" class="jobPart">
<table id="jobFlags">
@foreach (var flagGroup in validFlags)
{
<tr>
<th>
<span class="flagGroupName">@flagGroup.Key</span><br />
@AjaxHelpers.AjaxLoader()
</th>
<td>
@foreach (var flagItem in flagGroup.Value)
{
<div>
<input type="checkbox" value="@flagItem.Item1" id="jobFlag_@(flagItem.Item1)" @(flagItem.Item3 ? new HtmlString("checked=\"checked\"") : new HtmlString(string.Empty)) /><label id="jobFlagLabel_@(flagItem.Item1)" for="jobFlag_@(flagItem.Item1)">@flagItem.Item2</label></div>
}
</td>
</tr>
}
</table>
<div id="dialogFlagsAction" title="Add Flag">
@using (Html.BeginForm(MVC.API.Job.UpdateFlag(Model.Job.Id, null, null, true)))
{
<input id="dialogFlagsActionFlag" type="hidden" name="Flag" value="0" />
<h3>
Reason:</h3>
<p>
<textarea name="Reason" class="block"></textarea>
</p>
}
</div>
<script type="text/javascript">
$('#jobDetailTabItems').append('<li><a href="#jobDetailTab-Flags">Flags</a></li>');
$(function () {
var $flagCheckboxes = $('#jobFlags').find('input[type="checkbox"]');
var $dialogFlagsAction = $('#dialogFlagsAction');
var $flagCheckbox;
var updateFlags = function () {
$flagCheckbox = $(this);
var flagValue = $flagCheckbox.val();
if ($flagCheckbox.is(':checked')) {
// Add
$('#dialogFlagsActionFlag').val(flagValue);
var title = 'Add Flag: ' + $flagCheckbox.closest('tr').find('th .flagGroupName').text() + ': ' + $('#jobFlagLabel_' + flagValue).text();
$dialogFlagsAction.dialog('option', 'title', title);
$dialogFlagsAction.dialog('open');
} else {
// Remove
var $ajaxLoading = $flagCheckbox.closest('tr').find('span.ajaxLoading');
$ajaxLoading.show();
$.getJSON('@(Url.Action(MVC.API.Job.UpdateFlag(Model.Job.Id, null, null, false)))', { Flag: '-' + flagValue }, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Flag:\n' + response);
$ajaxLoading.hide();
} else {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
})
}
};
$dialogFlagsAction.dialog({
resizable: false,
height: 240,
modal: true,
autoOpen: false,
buttons: {
"Add": function () {
var $this = $(this);
$this.dialog("disable");
$this.dialog("option", "buttons", null);
$this.find('form').first().submit();
},
Cancel: function () {
$(this).dialog("close");
}
},
close: function () {
$flagCheckbox.prop('checked', false);
}
});
$flagCheckboxes.click(updateFlags);
});
</script>
</div>
+327 -327
View File
@@ -1,327 +1,327 @@
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17929
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Disco.Web.Views.Job.JobParts
{
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", "1.5.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Job/JobParts/Flags.cshtml")]
public class Flags : System.Web.Mvc.WebViewPage<Disco.Web.Models.Job.ShowModel>
{
public Flags()
{
}
public override void Execute()
{
#line 2 "..\..\Views\Job\JobParts\Flags.cshtml"
var validFlags = Model.Job.ValidFlagsGrouped();
#line default
#line hidden
WriteLiteral("\r\n<div");
WriteLiteral(" id=\"jobDetailTab-Flags\"");
WriteLiteral(" class=\"jobPart\"");
WriteLiteral(">\r\n <table");
WriteLiteral(" id=\"jobFlags\"");
WriteLiteral(">\r\n");
#line 7 "..\..\Views\Job\JobParts\Flags.cshtml"
#line default
#line hidden
#line 7 "..\..\Views\Job\JobParts\Flags.cshtml"
foreach (var flagGroup in validFlags)
{
#line default
#line hidden
WriteLiteral(" <tr>\r\n <th>\r\n <span");
WriteLiteral(" class=\"flagGroupName\"");
WriteLiteral(">");
#line 11 "..\..\Views\Job\JobParts\Flags.cshtml"
Write(flagGroup.Key);
#line default
#line hidden
WriteLiteral("</span><br />\r\n");
WriteLiteral(" ");
#line 12 "..\..\Views\Job\JobParts\Flags.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
WriteLiteral("\r\n </th>\r\n <td>\r\n");
#line 15 "..\..\Views\Job\JobParts\Flags.cshtml"
#line default
#line hidden
#line 15 "..\..\Views\Job\JobParts\Flags.cshtml"
foreach (var flagItem in flagGroup.Value)
{
#line default
#line hidden
WriteLiteral(" <div>\r\n <input");
WriteLiteral(" type=\"checkbox\"");
WriteAttribute("value", Tuple.Create(" value=\"", 609), Tuple.Create("\"", 632)
#line 18 "..\..\Views\Job\JobParts\Flags.cshtml"
, Tuple.Create(Tuple.Create("", 617), Tuple.Create<System.Object, System.Int32>(flagItem.Item1
#line default
#line hidden
, 617), false)
);
WriteAttribute("id", Tuple.Create(" id=\"", 633), Tuple.Create("\"", 663)
, Tuple.Create(Tuple.Create("", 638), Tuple.Create("jobFlag_", 638), true)
#line 18 "..\..\Views\Job\JobParts\Flags.cshtml"
, Tuple.Create(Tuple.Create("", 646), Tuple.Create<System.Object, System.Int32>(flagItem.Item1
#line default
#line hidden
, 646), false)
);
WriteLiteral(" ");
#line 18 "..\..\Views\Job\JobParts\Flags.cshtml"
Write(flagItem.Item3 ? new HtmlString("checked=\"checked\"") : new HtmlString(string.Empty));
#line default
#line hidden
WriteLiteral(" /><label");
WriteAttribute("id", Tuple.Create(" id=\"", 762), Tuple.Create("\"", 797)
, Tuple.Create(Tuple.Create("", 767), Tuple.Create("jobFlagLabel_", 767), true)
#line 18 "..\..\Views\Job\JobParts\Flags.cshtml"
, Tuple.Create(Tuple.Create("", 780), Tuple.Create<System.Object, System.Int32>(flagItem.Item1
#line default
#line hidden
, 780), false)
);
WriteAttribute("for", Tuple.Create(" for=\"", 798), Tuple.Create("\"", 829)
, Tuple.Create(Tuple.Create("", 804), Tuple.Create("jobFlag_", 804), true)
#line 18 "..\..\Views\Job\JobParts\Flags.cshtml"
, Tuple.Create(Tuple.Create("", 812), Tuple.Create<System.Object, System.Int32>(flagItem.Item1
#line default
#line hidden
, 812), false)
);
WriteLiteral(">");
#line 18 "..\..\Views\Job\JobParts\Flags.cshtml"
Write(flagItem.Item2);
#line default
#line hidden
WriteLiteral("</label></div>\r\n");
#line 19 "..\..\Views\Job\JobParts\Flags.cshtml"
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n");
#line 22 "..\..\Views\Job\JobParts\Flags.cshtml"
}
#line default
#line hidden
WriteLiteral(" </table>\r\n <div");
WriteLiteral(" id=\"dialogFlagsAction\"");
WriteLiteral(" title=\"Add Flag\"");
WriteLiteral(">\r\n");
#line 25 "..\..\Views\Job\JobParts\Flags.cshtml"
#line default
#line hidden
#line 25 "..\..\Views\Job\JobParts\Flags.cshtml"
using (Html.BeginForm(MVC.API.Job.UpdateFlag(Model.Job.Id, null, null, true)))
{
#line default
#line hidden
WriteLiteral(" <input");
WriteLiteral(" id=\"dialogFlagsActionFlag\"");
WriteLiteral(" type=\"hidden\"");
WriteLiteral(" name=\"Flag\"");
WriteLiteral(" value=\"0\"");
WriteLiteral(" />\r\n");
WriteLiteral(" <h3>\r\n Reason:</h3>\r\n");
WriteLiteral(" <p>\r\n <textarea");
WriteLiteral(" name=\"Reason\"");
WriteLiteral(" class=\"block\"");
WriteLiteral("></textarea>\r\n </p>\r\n");
#line 33 "..\..\Views\Job\JobParts\Flags.cshtml"
}
#line default
#line hidden
WriteLiteral(" </div>\r\n <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$('#jobDetailTabItems').append('<li><a href=""#jobDetailTab-Flags"">Flags</a></li>');
$(function () {
var $flagCheckboxes = $('#jobFlags').find('input[type=""checkbox""]');
var $dialogFlagsAction = $('#dialogFlagsAction');
var $flagCheckbox;
var updateFlags = function () {
$flagCheckbox = $(this);
var flagValue = $flagCheckbox.val();
if ($flagCheckbox.is(':checked')) {
// Add
$('#dialogFlagsActionFlag').val(flagValue);
var title = 'Add Flag: ' + $flagCheckbox.closest('tr').find('th .flagGroupName').text() + ': ' + $('#jobFlagLabel_' + flagValue).text();
$dialogFlagsAction.dialog('option', 'title', title);
$dialogFlagsAction.dialog('open');
} else {
// Remove
var $ajaxLoading = $flagCheckbox.closest('tr').find('span.ajaxLoading');
$ajaxLoading.show();
$.getJSON('");
#line 56 "..\..\Views\Job\JobParts\Flags.cshtml"
Write(Url.Action(MVC.API.Job.UpdateFlag(Model.Job.Id, null, null, false)));
#line default
#line hidden
WriteLiteral(@"', { Flag: '-' + flagValue }, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Flag:\n' + response);
$ajaxLoading.hide();
} else {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
})
}
};
$dialogFlagsAction.dialog({
resizable: false,
height: 240,
modal: true,
autoOpen: false,
buttons: {
""Add"": function () {
var $this = $(this);
$this.dialog(""disable"");
$this.dialog(""option"", ""buttons"", null);
$this.find('form').first().submit();
},
Cancel: function () {
$(this).dialog(""close"");
}
},
close: function () {
$flagCheckbox.attr('checked', false);
}
});
$flagCheckboxes.click(updateFlags);
});
</script>
</div>
");
}
}
}
#pragma warning restore 1591
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17929
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Disco.Web.Views.Job.JobParts
{
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", "1.5.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Job/JobParts/Flags.cshtml")]
public class Flags : System.Web.Mvc.WebViewPage<Disco.Web.Models.Job.ShowModel>
{
public Flags()
{
}
public override void Execute()
{
#line 2 "..\..\Views\Job\JobParts\Flags.cshtml"
var validFlags = Model.Job.ValidFlagsGrouped();
#line default
#line hidden
WriteLiteral("\r\n<div");
WriteLiteral(" id=\"jobDetailTab-Flags\"");
WriteLiteral(" class=\"jobPart\"");
WriteLiteral(">\r\n <table");
WriteLiteral(" id=\"jobFlags\"");
WriteLiteral(">\r\n");
#line 7 "..\..\Views\Job\JobParts\Flags.cshtml"
#line default
#line hidden
#line 7 "..\..\Views\Job\JobParts\Flags.cshtml"
foreach (var flagGroup in validFlags)
{
#line default
#line hidden
WriteLiteral(" <tr>\r\n <th>\r\n <span");
WriteLiteral(" class=\"flagGroupName\"");
WriteLiteral(">");
#line 11 "..\..\Views\Job\JobParts\Flags.cshtml"
Write(flagGroup.Key);
#line default
#line hidden
WriteLiteral("</span><br />\r\n");
WriteLiteral(" ");
#line 12 "..\..\Views\Job\JobParts\Flags.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
WriteLiteral("\r\n </th>\r\n <td>\r\n");
#line 15 "..\..\Views\Job\JobParts\Flags.cshtml"
#line default
#line hidden
#line 15 "..\..\Views\Job\JobParts\Flags.cshtml"
foreach (var flagItem in flagGroup.Value)
{
#line default
#line hidden
WriteLiteral(" <div>\r\n <input");
WriteLiteral(" type=\"checkbox\"");
WriteAttribute("value", Tuple.Create(" value=\"", 609), Tuple.Create("\"", 632)
#line 18 "..\..\Views\Job\JobParts\Flags.cshtml"
, Tuple.Create(Tuple.Create("", 617), Tuple.Create<System.Object, System.Int32>(flagItem.Item1
#line default
#line hidden
, 617), false)
);
WriteAttribute("id", Tuple.Create(" id=\"", 633), Tuple.Create("\"", 663)
, Tuple.Create(Tuple.Create("", 638), Tuple.Create("jobFlag_", 638), true)
#line 18 "..\..\Views\Job\JobParts\Flags.cshtml"
, Tuple.Create(Tuple.Create("", 646), Tuple.Create<System.Object, System.Int32>(flagItem.Item1
#line default
#line hidden
, 646), false)
);
WriteLiteral(" ");
#line 18 "..\..\Views\Job\JobParts\Flags.cshtml"
Write(flagItem.Item3 ? new HtmlString("checked=\"checked\"") : new HtmlString(string.Empty));
#line default
#line hidden
WriteLiteral(" /><label");
WriteAttribute("id", Tuple.Create(" id=\"", 762), Tuple.Create("\"", 797)
, Tuple.Create(Tuple.Create("", 767), Tuple.Create("jobFlagLabel_", 767), true)
#line 18 "..\..\Views\Job\JobParts\Flags.cshtml"
, Tuple.Create(Tuple.Create("", 780), Tuple.Create<System.Object, System.Int32>(flagItem.Item1
#line default
#line hidden
, 780), false)
);
WriteAttribute("for", Tuple.Create(" for=\"", 798), Tuple.Create("\"", 829)
, Tuple.Create(Tuple.Create("", 804), Tuple.Create("jobFlag_", 804), true)
#line 18 "..\..\Views\Job\JobParts\Flags.cshtml"
, Tuple.Create(Tuple.Create("", 812), Tuple.Create<System.Object, System.Int32>(flagItem.Item1
#line default
#line hidden
, 812), false)
);
WriteLiteral(">");
#line 18 "..\..\Views\Job\JobParts\Flags.cshtml"
Write(flagItem.Item2);
#line default
#line hidden
WriteLiteral("</label></div>\r\n");
#line 19 "..\..\Views\Job\JobParts\Flags.cshtml"
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n");
#line 22 "..\..\Views\Job\JobParts\Flags.cshtml"
}
#line default
#line hidden
WriteLiteral(" </table>\r\n <div");
WriteLiteral(" id=\"dialogFlagsAction\"");
WriteLiteral(" title=\"Add Flag\"");
WriteLiteral(">\r\n");
#line 25 "..\..\Views\Job\JobParts\Flags.cshtml"
#line default
#line hidden
#line 25 "..\..\Views\Job\JobParts\Flags.cshtml"
using (Html.BeginForm(MVC.API.Job.UpdateFlag(Model.Job.Id, null, null, true)))
{
#line default
#line hidden
WriteLiteral(" <input");
WriteLiteral(" id=\"dialogFlagsActionFlag\"");
WriteLiteral(" type=\"hidden\"");
WriteLiteral(" name=\"Flag\"");
WriteLiteral(" value=\"0\"");
WriteLiteral(" />\r\n");
WriteLiteral(" <h3>\r\n Reason:</h3>\r\n");
WriteLiteral(" <p>\r\n <textarea");
WriteLiteral(" name=\"Reason\"");
WriteLiteral(" class=\"block\"");
WriteLiteral("></textarea>\r\n </p>\r\n");
#line 33 "..\..\Views\Job\JobParts\Flags.cshtml"
}
#line default
#line hidden
WriteLiteral(" </div>\r\n <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$('#jobDetailTabItems').append('<li><a href=""#jobDetailTab-Flags"">Flags</a></li>');
$(function () {
var $flagCheckboxes = $('#jobFlags').find('input[type=""checkbox""]');
var $dialogFlagsAction = $('#dialogFlagsAction');
var $flagCheckbox;
var updateFlags = function () {
$flagCheckbox = $(this);
var flagValue = $flagCheckbox.val();
if ($flagCheckbox.is(':checked')) {
// Add
$('#dialogFlagsActionFlag').val(flagValue);
var title = 'Add Flag: ' + $flagCheckbox.closest('tr').find('th .flagGroupName').text() + ': ' + $('#jobFlagLabel_' + flagValue).text();
$dialogFlagsAction.dialog('option', 'title', title);
$dialogFlagsAction.dialog('open');
} else {
// Remove
var $ajaxLoading = $flagCheckbox.closest('tr').find('span.ajaxLoading');
$ajaxLoading.show();
$.getJSON('");
#line 56 "..\..\Views\Job\JobParts\Flags.cshtml"
Write(Url.Action(MVC.API.Job.UpdateFlag(Model.Job.Id, null, null, false)));
#line default
#line hidden
WriteLiteral(@"', { Flag: '-' + flagValue }, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Flag:\n' + response);
$ajaxLoading.hide();
} else {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
})
}
};
$dialogFlagsAction.dialog({
resizable: false,
height: 240,
modal: true,
autoOpen: false,
buttons: {
""Add"": function () {
var $this = $(this);
$this.dialog(""disable"");
$this.dialog(""option"", ""buttons"", null);
$this.find('form').first().submit();
},
Cancel: function () {
$(this).dialog(""close"");
}
},
close: function () {
$flagCheckbox.prop('checked', false);
}
});
$flagCheckboxes.click(updateFlags);
});
</script>
</div>
");
}
}
}
#pragma warning restore 1591
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -1,34 +0,0 @@
@model Disco.Web.Models.Job.CreateModel
<table class="subtleHighlight">
<tr>
<td style="width: 50%">
<h2>
Device</h2>
@if (Model.Device == null)
{
<span class="smallMessage">No Device referenced to this Job</span>
}
else
{
<span><strong>Serial Number:</strong> @Html.ActionLink(Model.Device.SerialNumber, MVC.Device.Show(Model.Device.SerialNumber))</span><br />
<span><strong>Name:</strong> @Model.Device.ComputerName</span><br />
<span><strong>Model:</strong> @Model.Device.DeviceModel.ToString()</span><br />
<img alt="Model Image" src="@Url.Action(MVC.API.DeviceModel.Image(Model.Device.DeviceModelId, Model.Device.DeviceModel.ImageHash()))" />
}
</td>
<td style="width: 50%">
<h2>
User</h2>
@if (Model.User == null)
{
<span class="smallMessage">No User referenced to this Job</span>
}
else
{
<span><strong>Id:</strong> @Html.ActionLink(Model.User.Id, MVC.User.Show(Model.User.Id))</span><br />
<span><strong>Name:</strong> @Model.User.DisplayName</span><br />
<span><strong>Type:</strong> @Model.User.Type</span>
}
</td>
</tr>
</table>
@@ -1,229 +0,0 @@
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17929
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Disco.Web.Views.Job
{
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.Optimization;
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", "1.5.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Job/_CreateSubject-Old.cshtml")]
public class CreateSubject_Old : System.Web.Mvc.WebViewPage<Disco.Web.Models.Job.CreateModel>
{
public CreateSubject_Old()
{
}
public override void Execute()
{
WriteLiteral("<table");
WriteLiteral(" class=\"subtleHighlight\"");
WriteLiteral(">\r\n <tr>\r\n <td");
WriteLiteral(" style=\"width: 50%\"");
WriteLiteral(">\r\n <h2>\r\n Device</h2>\r\n");
#line 7 "..\..\Views\Job\_CreateSubject-Old.cshtml"
#line default
#line hidden
#line 7 "..\..\Views\Job\_CreateSubject-Old.cshtml"
if (Model.Device == null)
{
#line default
#line hidden
WriteLiteral(" <span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">No Device referenced to this Job</span>\r\n");
#line 10 "..\..\Views\Job\_CreateSubject-Old.cshtml"
}
else
{
#line default
#line hidden
WriteLiteral(" <span><strong>Serial Number:</strong> ");
#line 13 "..\..\Views\Job\_CreateSubject-Old.cshtml"
Write(Html.ActionLink(Model.Device.SerialNumber, MVC.Device.Show(Model.Device.SerialNumber)));
#line default
#line hidden
WriteLiteral("</span>");
WriteLiteral("<br />\r\n");
WriteLiteral(" <span><strong>Name:</strong> ");
#line 14 "..\..\Views\Job\_CreateSubject-Old.cshtml"
Write(Model.Device.ComputerName);
#line default
#line hidden
WriteLiteral("</span>");
WriteLiteral("<br />\r\n");
WriteLiteral(" <span><strong>Model:</strong> ");
#line 15 "..\..\Views\Job\_CreateSubject-Old.cshtml"
Write(Model.Device.DeviceModel.ToString());
#line default
#line hidden
WriteLiteral("</span>");
WriteLiteral("<br />\r\n");
WriteLiteral(" <img");
WriteLiteral(" alt=\"Model Image\"");
WriteAttribute("src", Tuple.Create(" src=\"", 730), Tuple.Create("\"", 840)
#line 16 "..\..\Views\Job\_CreateSubject-Old.cshtml"
, Tuple.Create(Tuple.Create("", 736), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DeviceModel.Image(Model.Device.DeviceModelId, Model.Device.DeviceModel.ImageHash()))
#line default
#line hidden
, 736), false)
);
WriteLiteral(" />\r\n");
#line 17 "..\..\Views\Job\_CreateSubject-Old.cshtml"
}
#line default
#line hidden
WriteLiteral(" </td>\r\n <td");
WriteLiteral(" style=\"width: 50%\"");
WriteLiteral(">\r\n <h2>\r\n User</h2>\r\n");
#line 22 "..\..\Views\Job\_CreateSubject-Old.cshtml"
#line default
#line hidden
#line 22 "..\..\Views\Job\_CreateSubject-Old.cshtml"
if (Model.User == null)
{
#line default
#line hidden
WriteLiteral(" <span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">No User referenced to this Job</span>\r\n");
#line 25 "..\..\Views\Job\_CreateSubject-Old.cshtml"
}
else
{
#line default
#line hidden
WriteLiteral(" <span><strong>Id:</strong> ");
#line 28 "..\..\Views\Job\_CreateSubject-Old.cshtml"
Write(Html.ActionLink(Model.User.Id, MVC.User.Show(Model.User.Id)));
#line default
#line hidden
WriteLiteral("</span>");
WriteLiteral("<br />\r\n");
WriteLiteral(" <span><strong>Name:</strong> ");
#line 29 "..\..\Views\Job\_CreateSubject-Old.cshtml"
Write(Model.User.DisplayName);
#line default
#line hidden
WriteLiteral("</span>");
WriteLiteral("<br />\r\n");
WriteLiteral(" <span><strong>Type:</strong> ");
#line 30 "..\..\Views\Job\_CreateSubject-Old.cshtml"
Write(Model.User.Type);
#line default
#line hidden
WriteLiteral("</span>\r\n");
#line 31 "..\..\Views\Job\_CreateSubject-Old.cshtml"
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n</table>");
}
}
}
#pragma warning restore 1591
+1 -1
View File
@@ -10,7 +10,7 @@
<add key="PreserveLoginUrl" value="true" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
<add key="DiscoIgnoreVersionUpdate" value="false" />
<add key="DiscoIgnoreVersionUpdate" value="true" />
</appSettings>
<connectionStrings>
<add name="DiscoDataContext" connectionString="data source=(local);Initial Catalog=Disco;Integrated Security=True;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />