Update: New Device UI
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
@model Disco.Web.Models.Device.ShowModel
|
||||
<div id="DeviceDetailTab-AssignmentHistory" class="DevicePart">
|
||||
@if (Model.Device.DeviceUserAssignments.Count > 0)
|
||||
{
|
||||
<table class="genericData">
|
||||
<tr>
|
||||
<th>User
|
||||
</th>
|
||||
<th>Assigned
|
||||
</th>
|
||||
<th>Unassigned
|
||||
</th>
|
||||
</tr>
|
||||
@foreach (var dua in Model.Device.DeviceUserAssignments.OrderByDescending(m => m.AssignedDate))
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@Html.ActionLink(dua.AssignedUser.ToString(), MVC.User.Show(dua.AssignedUserId))
|
||||
</td>
|
||||
<td>
|
||||
@CommonHelpers.FriendlyDate(dua.AssignedDate)
|
||||
</td>
|
||||
<td>
|
||||
@CommonHelpers.FriendlyDate(dua.UnassignedDate, "Current")
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="smallMessage">No Assignment History Available</span>
|
||||
}
|
||||
<script>
|
||||
$('#DeviceDetailTabItems').append('<li><a href="#DeviceDetailTab-AssignmentHistory">Assignment History [@(Model.Device.DeviceUserAssignments.Count)]</a></li>');
|
||||
</script>
|
||||
</div>
|
||||
@@ -0,0 +1,168 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18033
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Disco.Web.Views.Device.DeviceParts
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.Helpers;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Mvc.Ajax;
|
||||
using System.Web.Mvc.Html;
|
||||
using System.Web.Routing;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.WebPages;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Device/DeviceParts/AssignmentHistory.cshtml")]
|
||||
public partial class AssignmentHistory : System.Web.Mvc.WebViewPage<Disco.Web.Models.Device.ShowModel>
|
||||
{
|
||||
public AssignmentHistory()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
WriteLiteral("<div");
|
||||
|
||||
WriteLiteral(" id=\"DeviceDetailTab-AssignmentHistory\"");
|
||||
|
||||
WriteLiteral(" class=\"DevicePart\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 3 "..\..\Views\Device\DeviceParts\AssignmentHistory.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 3 "..\..\Views\Device\DeviceParts\AssignmentHistory.cshtml"
|
||||
if (Model.Device.DeviceUserAssignments.Count > 0)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <table");
|
||||
|
||||
WriteLiteral(" class=\"genericData\"");
|
||||
|
||||
WriteLiteral(">\r\n <tr>\r\n <th>User\r\n </th>\r\n " +
|
||||
" <th>Assigned\r\n </th>\r\n <th>Unassigned\r\n " +
|
||||
" </th>\r\n </tr>\r\n");
|
||||
|
||||
|
||||
#line 14 "..\..\Views\Device\DeviceParts\AssignmentHistory.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 14 "..\..\Views\Device\DeviceParts\AssignmentHistory.cshtml"
|
||||
foreach (var dua in Model.Device.DeviceUserAssignments.OrderByDescending(m => m.AssignedDate))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <tr>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 18 "..\..\Views\Device\DeviceParts\AssignmentHistory.cshtml"
|
||||
Write(Html.ActionLink(dua.AssignedUser.ToString(), MVC.User.Show(dua.AssignedUserId)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 21 "..\..\Views\Device\DeviceParts\AssignmentHistory.cshtml"
|
||||
Write(CommonHelpers.FriendlyDate(dua.AssignedDate));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 24 "..\..\Views\Device\DeviceParts\AssignmentHistory.cshtml"
|
||||
Write(CommonHelpers.FriendlyDate(dua.UnassignedDate, "Current"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
|
||||
|
||||
|
||||
#line 27 "..\..\Views\Device\DeviceParts\AssignmentHistory.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </table>\r\n");
|
||||
|
||||
|
||||
#line 29 "..\..\Views\Device\DeviceParts\AssignmentHistory.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <span");
|
||||
|
||||
WriteLiteral(" class=\"smallMessage\"");
|
||||
|
||||
WriteLiteral(">No Assignment History Available</span>\r\n");
|
||||
|
||||
|
||||
#line 33 "..\..\Views\Device\DeviceParts\AssignmentHistory.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <script>\r\n $(\'#DeviceDetailTabItems\').append(\'<li><a href=\"#DeviceDeta" +
|
||||
"ilTab-AssignmentHistory\">Assignment History [");
|
||||
|
||||
|
||||
#line 35 "..\..\Views\Device\DeviceParts\AssignmentHistory.cshtml"
|
||||
Write(Model.Device.DeviceUserAssignments.Count);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("]</a></li>\');\r\n </script>\r\n</div>\r\n");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -0,0 +1,44 @@
|
||||
@model Disco.Web.Models.Device.ShowModel
|
||||
<div id="DeviceDetailTab-Certificates" class="DevicePart">
|
||||
<div class="genericData certificateTable">
|
||||
@if (Model.Certificates.Count() > 0)
|
||||
{
|
||||
<table class="genericData certificateTable">
|
||||
<tr>
|
||||
<th>Name
|
||||
</th>
|
||||
<th>Enabled
|
||||
</th>
|
||||
<th>Allocated
|
||||
</th>
|
||||
<th>Expires
|
||||
</th>
|
||||
</tr>
|
||||
@foreach (var item in Model.Certificates)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@Html.ActionLink(item.Name, MVC.API.DeviceCertificate.Download(item.Id))
|
||||
</td>
|
||||
<td>
|
||||
@item.Enabled
|
||||
</td>
|
||||
<td>
|
||||
@CommonHelpers.FriendlyDate(item.AllocatedDate)
|
||||
</td>
|
||||
<td>
|
||||
@CommonHelpers.FriendlyDate(item.ExpirationDate)
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="smallMessage">No Certificates Allocated</span>
|
||||
}
|
||||
</div>
|
||||
<script>
|
||||
$('#DeviceDetailTabItems').append('<li><a href="#DeviceDetailTab-Certificates">Certificates [@(Model.Certificates.Count)]</a></li>');
|
||||
</script>
|
||||
</div>
|
||||
@@ -0,0 +1,192 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18033
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Disco.Web.Views.Device.DeviceParts
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.Helpers;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Mvc.Ajax;
|
||||
using System.Web.Mvc.Html;
|
||||
using System.Web.Routing;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.WebPages;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Device/DeviceParts/Certificates.cshtml")]
|
||||
public partial class Certificates : System.Web.Mvc.WebViewPage<Disco.Web.Models.Device.ShowModel>
|
||||
{
|
||||
public Certificates()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
WriteLiteral("<div");
|
||||
|
||||
WriteLiteral(" id=\"DeviceDetailTab-Certificates\"");
|
||||
|
||||
WriteLiteral(" class=\"DevicePart\"");
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"genericData certificateTable\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 4 "..\..\Views\Device\DeviceParts\Certificates.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 4 "..\..\Views\Device\DeviceParts\Certificates.cshtml"
|
||||
if (Model.Certificates.Count() > 0)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <table");
|
||||
|
||||
WriteLiteral(" class=\"genericData certificateTable\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
<tr>
|
||||
<th>Name
|
||||
</th>
|
||||
<th>Enabled
|
||||
</th>
|
||||
<th>Allocated
|
||||
</th>
|
||||
<th>Expires
|
||||
</th>
|
||||
</tr>
|
||||
");
|
||||
|
||||
|
||||
#line 17 "..\..\Views\Device\DeviceParts\Certificates.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 17 "..\..\Views\Device\DeviceParts\Certificates.cshtml"
|
||||
foreach (var item in Model.Certificates)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <tr>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 21 "..\..\Views\Device\DeviceParts\Certificates.cshtml"
|
||||
Write(Html.ActionLink(item.Name, MVC.API.DeviceCertificate.Download(item.Id)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 24 "..\..\Views\Device\DeviceParts\Certificates.cshtml"
|
||||
Write(item.Enabled);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 27 "..\..\Views\Device\DeviceParts\Certificates.cshtml"
|
||||
Write(CommonHelpers.FriendlyDate(item.AllocatedDate));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 30 "..\..\Views\Device\DeviceParts\Certificates.cshtml"
|
||||
Write(CommonHelpers.FriendlyDate(item.ExpirationDate));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
|
||||
|
||||
|
||||
#line 33 "..\..\Views\Device\DeviceParts\Certificates.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </table>\r\n");
|
||||
|
||||
|
||||
#line 35 "..\..\Views\Device\DeviceParts\Certificates.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <span");
|
||||
|
||||
WriteLiteral(" class=\"smallMessage\"");
|
||||
|
||||
WriteLiteral(">No Certificates Allocated</span>\r\n");
|
||||
|
||||
|
||||
#line 39 "..\..\Views\Device\DeviceParts\Certificates.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </div>\r\n <script>\r\n $(\'#DeviceDetailTabItems\').append(\'<li><a href=" +
|
||||
"\"#DeviceDetailTab-Certificates\">Certificates [");
|
||||
|
||||
|
||||
#line 42 "..\..\Views\Device\DeviceParts\Certificates.cshtml"
|
||||
Write(Model.Certificates.Count);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("]</a></li>\');\r\n </script>\r\n</div>");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -0,0 +1,9 @@
|
||||
@model Disco.Web.Models.Device.ShowModel
|
||||
<div id="DeviceDetailTab-Jobs" class="DevicePart">
|
||||
<div id="DeviceDetailTab-JobsContainer">
|
||||
@Html.Partial(MVC.Shared.Views._JobTable, Model.Jobs)
|
||||
</div>
|
||||
<script>
|
||||
$('#DeviceDetailTabItems').append('<li><a href="#DeviceDetailTab-Jobs">Jobs [@(Model.Device.Jobs == null ? 0 : Model.Device.Jobs.Count)]</a></li>');
|
||||
</script>
|
||||
</div>
|
||||
@@ -0,0 +1,79 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18033
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Disco.Web.Views.Device.DeviceParts
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.Helpers;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Mvc.Ajax;
|
||||
using System.Web.Mvc.Html;
|
||||
using System.Web.Routing;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.WebPages;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Device/DeviceParts/Jobs.cshtml")]
|
||||
public partial class Jobs : System.Web.Mvc.WebViewPage<Disco.Web.Models.Device.ShowModel>
|
||||
{
|
||||
public Jobs()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
WriteLiteral("<div");
|
||||
|
||||
WriteLiteral(" id=\"DeviceDetailTab-Jobs\"");
|
||||
|
||||
WriteLiteral(" class=\"DevicePart\"");
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" id=\"DeviceDetailTab-JobsContainer\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 4 "..\..\Views\Device\DeviceParts\Jobs.cshtml"
|
||||
Write(Html.Partial(MVC.Shared.Views._JobTable, Model.Jobs));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </div>\r\n <script>\r\n $(\'#DeviceDetailTabItems\').append(\'<li><a hre" +
|
||||
"f=\"#DeviceDetailTab-Jobs\">Jobs [");
|
||||
|
||||
|
||||
#line 7 "..\..\Views\Device\DeviceParts\Jobs.cshtml"
|
||||
Write(Model.Device.Jobs == null ? 0 : Model.Device.Jobs.Count);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("]</a></li>\');\r\n </script>\r\n</div>\r\n");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -2,78 +2,82 @@
|
||||
@{
|
||||
Html.BundleDeferred("~/Style/Shadowbox");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Shadowbox");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Silverlight");
|
||||
}
|
||||
<table id="deviceShowResources">
|
||||
<tr>
|
||||
<td id="Attachments">
|
||||
<div class="attachmentOutput">
|
||||
@if (Model.Device.DeviceAttachments != null)
|
||||
{
|
||||
foreach (var da in Model.Device.DeviceAttachments)
|
||||
<div id="DeviceDetailTab-Resources" class="DevicePart">
|
||||
<table id="deviceShowResources">
|
||||
<tr>
|
||||
<td id="Attachments">
|
||||
<div class="attachmentOutput">
|
||||
@if (Model.Device.DeviceAttachments != null)
|
||||
{
|
||||
<a href="@Url.Action(MVC.API.Device.AttachmentDownload(da.Id))" data-attachmentid="@da.Id" data-mimetype="@da.MimeType">
|
||||
<span class="icon" title="@da.Filename">
|
||||
<img alt="Attachment Thumbnail" src="@(Url.Action(MVC.API.Device.AttachmentThumbnail(da.Id)))" /></span>
|
||||
<span class="comments" title="@da.Comments">
|
||||
@{if (!string.IsNullOrEmpty(da.DocumentTemplateId))
|
||||
{ @da.DocumentTemplate.Description}
|
||||
else
|
||||
{ @da.Comments }}
|
||||
</span><span class="author">@da.TechUser.ToString()</span><span class="remove"></span><span class="timestamp" title="@da.Timestamp.ToFullDateTime()">@da.Timestamp.ToFuzzy()</span>
|
||||
</a>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
<div class="attachmentInput clearfix">
|
||||
<span class="action upload"></span><span class="action photo"></span>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
Shadowbox.init({
|
||||
skipSetup: true,
|
||||
modal: true
|
||||
});
|
||||
$(function () {
|
||||
if (!document.DiscoFunctions) {
|
||||
document.DiscoFunctions = {};
|
||||
}
|
||||
document.DiscoFunctions.addAttachment = addAttachment;
|
||||
|
||||
$Attachments = $('#Attachments');
|
||||
$attachmentOutput = $Attachments.find('.attachmentOutput');
|
||||
|
||||
$attachmentOutput.find('span.remove').click(removeAttachment);
|
||||
|
||||
$('#dialogUpload').dialog({ autoOpen: false,
|
||||
draggable: false,
|
||||
modal: true,
|
||||
resizable: false,
|
||||
width: 860,
|
||||
height: 550,
|
||||
close: function () {
|
||||
silverlightUploadAttachment.content.Navigator.Navigate('/Hidden');
|
||||
foreach (var da in Model.Device.DeviceAttachments)
|
||||
{
|
||||
<a href="@Url.Action(MVC.API.Device.AttachmentDownload(da.Id))" data-attachmentid="@da.Id" data-mimetype="@da.MimeType">
|
||||
<span class="icon" title="@da.Filename">
|
||||
<img alt="Attachment Thumbnail" src="@(Url.Action(MVC.API.Device.AttachmentThumbnail(da.Id)))" /></span>
|
||||
<span class="comments" title="@da.Comments">
|
||||
@{if (!string.IsNullOrEmpty(da.DocumentTemplateId))
|
||||
{ @da.DocumentTemplate.Description}
|
||||
else
|
||||
{ @da.Comments }}
|
||||
</span><span class="author">@da.TechUser.ToString()</span><span class="remove"></span><span class="timestamp" title="@da.Timestamp.ToFullDateTime()">@da.Timestamp.ToFuzzy()</span>
|
||||
</a>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
<div class="attachmentInput clearfix">
|
||||
<span class="action upload"></span><span class="action photo"></span>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
Shadowbox.init({
|
||||
skipSetup: true,
|
||||
modal: true
|
||||
});
|
||||
$(function () {
|
||||
if (!document.DiscoFunctions) {
|
||||
document.DiscoFunctions = {};
|
||||
}
|
||||
document.DiscoFunctions.addAttachment = addAttachment;
|
||||
|
||||
$('#dialogRemoveAttachment').dialog({
|
||||
resizable: false,
|
||||
height: 140,
|
||||
modal: true,
|
||||
autoOpen: false
|
||||
});
|
||||
$Attachments = $('#Attachments');
|
||||
$attachmentOutput = $Attachments.find('.attachmentOutput');
|
||||
|
||||
var onLoadNavigation = null;
|
||||
var isLoaded = null;
|
||||
Silverlight.createObject(
|
||||
'@(Links.ClientBin.Disco_Silverlight_AttachmentUpload_xap)',
|
||||
$attachmentOutput.find('span.remove').click(removeAttachment);
|
||||
|
||||
$('#dialogUpload').dialog({
|
||||
autoOpen: false,
|
||||
draggable: false,
|
||||
modal: true,
|
||||
resizable: false,
|
||||
width: 860,
|
||||
height: 550,
|
||||
close: function () {
|
||||
silverlightUploadAttachment.content.Navigator.Navigate('/Hidden');
|
||||
}
|
||||
});
|
||||
|
||||
$('#dialogRemoveAttachment').dialog({
|
||||
resizable: false,
|
||||
height: 140,
|
||||
modal: true,
|
||||
autoOpen: false
|
||||
});
|
||||
|
||||
var onLoadNavigation = null;
|
||||
var isLoaded = null;
|
||||
Silverlight.createObject(
|
||||
'@(Links.ClientBin.Disco_Silverlight_AttachmentUpload_xap)',
|
||||
$('#silverlightHostUploadAttachment').get(0),
|
||||
'silverlightUploadAttachment',
|
||||
{ width: '840px', height: '500px', background: 'white', version: '4.0.60310.0' },
|
||||
{ onLoad: function () {
|
||||
if (onLoadNavigation) {
|
||||
silverlightUploadAttachment.content.Navigator.Navigate(onLoadNavigation);
|
||||
isLoaded = true;
|
||||
{
|
||||
onLoad: function () {
|
||||
if (onLoadNavigation) {
|
||||
silverlightUploadAttachment.content.Navigator.Navigate(onLoadNavigation);
|
||||
isLoaded = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
'UploadUrl=@(Url.Action(MVC.API.Device.AttachmentUpload(Model.Device.SerialNumber, null)))'
|
||||
);
|
||||
@@ -168,7 +172,7 @@
|
||||
});
|
||||
|
||||
$dialogRemoveAttachment.dialog('open');
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -178,16 +182,21 @@
|
||||
$this.shadowbox({ gallery: 'attachments', player: 'img', title: $this.find('.comments').text() });
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div id="dialogUpload" title="Upload Attachment">
|
||||
<div id="silverlightHostUploadAttachment">
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div id="dialogUpload" title="Upload Attachment">
|
||||
<div id="silverlightHostUploadAttachment">
|
||||
</div>
|
||||
</div>
|
||||
<div id="dialogRemoveAttachment" title="Remove this Attachment?">
|
||||
<p>
|
||||
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
|
||||
Are you sure?
|
||||
</p>
|
||||
</div>
|
||||
<script>
|
||||
$('#DeviceDetailTabItems').append('<li><a href="#DeviceDetailTab-Resources" id="DeviceDetailTab-ResourcesLink">Attachments [@(Model.Device.DeviceAttachments == null ? 0 : Model.Device.DeviceAttachments.Count)]</a></li>');
|
||||
</script>
|
||||
</div>
|
||||
<div id="dialogRemoveAttachment" title="Remove this Attachment?">
|
||||
<p>
|
||||
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
|
||||
Are you sure?</p>
|
||||
</div>
|
||||
@@ -45,57 +45,64 @@ namespace Disco.Web.Views.Device.DeviceParts
|
||||
|
||||
Html.BundleDeferred("~/Style/Shadowbox");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Shadowbox");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Silverlight");
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n<table");
|
||||
WriteLiteral("\r\n<div");
|
||||
|
||||
WriteLiteral(" id=\"DeviceDetailTab-Resources\"");
|
||||
|
||||
WriteLiteral(" class=\"DevicePart\"");
|
||||
|
||||
WriteLiteral(">\r\n <table");
|
||||
|
||||
WriteLiteral(" id=\"deviceShowResources\"");
|
||||
|
||||
WriteLiteral(">\r\n <tr>\r\n <td");
|
||||
WriteLiteral(">\r\n <tr>\r\n <td");
|
||||
|
||||
WriteLiteral(" id=\"Attachments\"");
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"attachmentOutput\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 10 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
|
||||
#line 12 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 10 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
if (Model.Device.DeviceAttachments != null)
|
||||
{
|
||||
foreach (var da in Model.Device.DeviceAttachments)
|
||||
#line 12 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
if (Model.Device.DeviceAttachments != null)
|
||||
{
|
||||
foreach (var da in Model.Device.DeviceAttachments)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <a");
|
||||
WriteLiteral(" <a");
|
||||
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 476), Tuple.Create("\"", 536)
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 634), Tuple.Create("\"", 694)
|
||||
|
||||
#line 14 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 483), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Device.AttachmentDownload(da.Id))
|
||||
#line 16 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 641), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Device.AttachmentDownload(da.Id))
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 483), false)
|
||||
, 641), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" data-attachmentid=\"");
|
||||
|
||||
|
||||
#line 14 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
Write(da.Id);
|
||||
#line 16 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
Write(da.Id);
|
||||
|
||||
|
||||
#line default
|
||||
@@ -105,108 +112,108 @@ WriteLiteral("\"");
|
||||
WriteLiteral(" data-mimetype=\"");
|
||||
|
||||
|
||||
#line 14 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
Write(da.MimeType);
|
||||
#line 16 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
Write(da.MimeType);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(">\r\n <span");
|
||||
WriteLiteral(">\r\n <span");
|
||||
|
||||
WriteLiteral(" class=\"icon\"");
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 638), Tuple.Create("\"", 658)
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 800), Tuple.Create("\"", 820)
|
||||
|
||||
#line 15 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 646), Tuple.Create<System.Object, System.Int32>(da.Filename
|
||||
#line 17 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 808), Tuple.Create<System.Object, System.Int32>(da.Filename
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 646), false)
|
||||
, 808), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n <img");
|
||||
WriteLiteral(">\r\n <img");
|
||||
|
||||
WriteLiteral(" alt=\"Attachment Thumbnail\"");
|
||||
|
||||
WriteAttribute("src", Tuple.Create(" src=\"", 721), Tuple.Create("\"", 783)
|
||||
WriteAttribute("src", Tuple.Create(" src=\"", 887), Tuple.Create("\"", 949)
|
||||
|
||||
#line 16 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 727), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Device.AttachmentThumbnail(da.Id))
|
||||
#line 18 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 893), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Device.AttachmentThumbnail(da.Id))
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 727), false)
|
||||
, 893), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" /></span>\r\n <span");
|
||||
WriteLiteral(" /></span>\r\n <span");
|
||||
|
||||
WriteLiteral(" class=\"comments\"");
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 842), Tuple.Create("\"", 862)
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 1012), Tuple.Create("\"", 1032)
|
||||
|
||||
#line 17 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 850), Tuple.Create<System.Object, System.Int32>(da.Comments
|
||||
#line 19 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1020), Tuple.Create<System.Object, System.Int32>(da.Comments
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 850), false)
|
||||
, 1020), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 18 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
|
||||
#line 20 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 18 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
if (!string.IsNullOrEmpty(da.DocumentTemplateId))
|
||||
{
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 19 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
Write(da.DocumentTemplate.Description);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 19 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
#line 20 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
if (!string.IsNullOrEmpty(da.DocumentTemplateId))
|
||||
{
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 21 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
Write(da.Comments);
|
||||
Write(da.DocumentTemplate.Description);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 21 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </span><span");
|
||||
|
||||
#line 23 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
Write(da.Comments);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 23 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </span><span");
|
||||
|
||||
WriteLiteral(" class=\"author\"");
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 22 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
Write(da.TechUser.ToString());
|
||||
#line 24 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
Write(da.TechUser.ToString());
|
||||
|
||||
|
||||
#line default
|
||||
@@ -219,40 +226,40 @@ WriteLiteral("></span><span");
|
||||
|
||||
WriteLiteral(" class=\"timestamp\"");
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 1232), Tuple.Create("\"", 1270)
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 1422), Tuple.Create("\"", 1460)
|
||||
|
||||
#line 22 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1240), Tuple.Create<System.Object, System.Int32>(da.Timestamp.ToFullDateTime()
|
||||
#line 24 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1430), Tuple.Create<System.Object, System.Int32>(da.Timestamp.ToFullDateTime()
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 1240), false)
|
||||
, 1430), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 22 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
Write(da.Timestamp.ToFuzzy());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</span>\r\n </a> \r\n");
|
||||
|
||||
|
||||
#line 24 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
}
|
||||
}
|
||||
Write(da.Timestamp.ToFuzzy());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </div>\r\n <div");
|
||||
WriteLiteral("</span>\r\n </a> \r\n");
|
||||
|
||||
|
||||
#line 26 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </div>\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"attachmentInput clearfix\"");
|
||||
|
||||
WriteLiteral(">\r\n <span");
|
||||
WriteLiteral(">\r\n <span");
|
||||
|
||||
WriteLiteral(" class=\"action upload\"");
|
||||
|
||||
@@ -260,52 +267,35 @@ WriteLiteral("></span><span");
|
||||
|
||||
WriteLiteral(" class=\"action photo\"");
|
||||
|
||||
WriteLiteral("></span>\r\n </div>\r\n <script");
|
||||
WriteLiteral("></span>\r\n </div>\r\n <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
Shadowbox.init({
|
||||
skipSetup: true,
|
||||
modal: true
|
||||
});
|
||||
$(function () {
|
||||
if (!document.DiscoFunctions) {
|
||||
document.DiscoFunctions = {};
|
||||
}
|
||||
document.DiscoFunctions.addAttachment = addAttachment;
|
||||
|
||||
$Attachments = $('#Attachments');
|
||||
$attachmentOutput = $Attachments.find('.attachmentOutput');
|
||||
|
||||
$attachmentOutput.find('span.remove').click(removeAttachment);
|
||||
|
||||
$('#dialogUpload').dialog({ autoOpen: false,
|
||||
draggable: false,
|
||||
modal: true,
|
||||
resizable: false,
|
||||
width: 860,
|
||||
height: 550,
|
||||
close: function () {
|
||||
silverlightUploadAttachment.content.Navigator.Navigate('/Hidden');
|
||||
}
|
||||
});
|
||||
|
||||
$('#dialogRemoveAttachment').dialog({
|
||||
resizable: false,
|
||||
height: 140,
|
||||
modal: true,
|
||||
autoOpen: false
|
||||
});
|
||||
|
||||
var onLoadNavigation = null;
|
||||
var isLoaded = null;
|
||||
Silverlight.createObject(
|
||||
'");
|
||||
WriteLiteral(">\r\n Shadowbox.init({\r\n skipSetup: true," +
|
||||
"\r\n modal: true\r\n });\r\n " +
|
||||
" $(function () {\r\n if (!document.DiscoFunctions) {\r\n " +
|
||||
" document.DiscoFunctions = {};\r\n " +
|
||||
" }\r\n document.DiscoFunctions.addAttachment = addAttachmen" +
|
||||
"t;\r\n\r\n $Attachments = $(\'#Attachments\');\r\n " +
|
||||
" $attachmentOutput = $Attachments.find(\'.attachmentOutput\');\r\n\r\n " +
|
||||
" $attachmentOutput.find(\'span.remove\').click(removeAttachment);\r\n" +
|
||||
"\r\n $(\'#dialogUpload\').dialog({\r\n " +
|
||||
" autoOpen: false,\r\n draggable: false,\r\n " +
|
||||
" modal: true,\r\n resizable: false,\r\n " +
|
||||
" width: 860,\r\n height: 550,\r\n" +
|
||||
" close: function () {\r\n " +
|
||||
" silverlightUploadAttachment.content.Navigator.Navigate(\'/Hidden\');\r\n " +
|
||||
" }\r\n });\r\n\r\n $(\'#" +
|
||||
"dialogRemoveAttachment\').dialog({\r\n resizable: false," +
|
||||
"\r\n height: 140,\r\n modal: t" +
|
||||
"rue,\r\n autoOpen: false\r\n });\r\n" +
|
||||
"\r\n var onLoadNavigation = null;\r\n " +
|
||||
"var isLoaded = null;\r\n Silverlight.createObject(\r\n " +
|
||||
" \'");
|
||||
|
||||
|
||||
#line 67 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
Write(Links.ClientBin.Disco_Silverlight_AttachmentUpload_xap);
|
||||
#line 70 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
Write(Links.ClientBin.Disco_Silverlight_AttachmentUpload_xap);
|
||||
|
||||
|
||||
#line default
|
||||
@@ -314,17 +304,18 @@ WriteLiteral(@"',
|
||||
$('#silverlightHostUploadAttachment').get(0),
|
||||
'silverlightUploadAttachment',
|
||||
{ width: '840px', height: '500px', background: 'white', version: '4.0.60310.0' },
|
||||
{ onLoad: function () {
|
||||
if (onLoadNavigation) {
|
||||
silverlightUploadAttachment.content.Navigator.Navigate(onLoadNavigation);
|
||||
isLoaded = true;
|
||||
{
|
||||
onLoad: function () {
|
||||
if (onLoadNavigation) {
|
||||
silverlightUploadAttachment.content.Navigator.Navigate(onLoadNavigation);
|
||||
isLoaded = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
'UploadUrl=");
|
||||
|
||||
|
||||
#line 78 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
#line 82 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
Write(Url.Action(MVC.API.Device.AttachmentUpload(Model.Device.SerialNumber, null)));
|
||||
|
||||
|
||||
@@ -356,7 +347,7 @@ WriteLiteral(@"'
|
||||
url: '");
|
||||
|
||||
|
||||
#line 101 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
#line 105 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
Write(Url.Action(MVC.API.Device.Attachment()));
|
||||
|
||||
|
||||
@@ -374,7 +365,7 @@ WriteLiteral(@"',
|
||||
e.attr('data-attachmentid', a.Id).attr('data-mimetype', a.MimeType).attr('href', '");
|
||||
|
||||
|
||||
#line 110 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
#line 114 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
Write(Url.Action(MVC.API.Device.AttachmentDownload()));
|
||||
|
||||
|
||||
@@ -384,7 +375,7 @@ WriteLiteral("/\' + a.Id);\r\n e.find(\'.icon
|
||||
"\'");
|
||||
|
||||
|
||||
#line 111 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
#line 115 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
Write(Url.Action(MVC.API.Device.AttachmentThumbnail()));
|
||||
|
||||
|
||||
@@ -417,7 +408,7 @@ WriteLiteral("/\' + a.Id);\r\n e.find(\'.comm
|
||||
" $.ajax({\r\n url: \'");
|
||||
|
||||
|
||||
#line 143 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
#line 147 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
Write(Url.Action(MVC.API.Device.AttachmentRemove()));
|
||||
|
||||
|
||||
@@ -443,36 +434,47 @@ WriteLiteral("\',\r\n dataType: \'json\',\r\n
|
||||
" },\r\n \"Cancel\": function () {\r\n " +
|
||||
" $dialogRemoveAttachment.dialog(\"close\");\r\n " +
|
||||
" }\r\n });\r\n\r\n $dialogR" +
|
||||
"emoveAttachment.dialog(\'open\');\r\n \r\n " +
|
||||
" return false;\r\n }\r\n\r\n $attachmentOutput" +
|
||||
".children(\'a\').each(function () {\r\n $this = $(this);\r\n " +
|
||||
" if ($this.attr(\'data-mimetype\').toLowerCase().indexOf(\'imag" +
|
||||
"e/\') == 0)\r\n $this.shadowbox({ gallery: \'attachments\'" +
|
||||
", player: \'img\', title: $this.find(\'.comments\').text() });\r\n " +
|
||||
"});\r\n });\r\n </script>\r\n </td>\r\n </tr>\r\n</tab" +
|
||||
"le>\r\n<div");
|
||||
"emoveAttachment.dialog(\'open\');\r\n\r\n return false;\r\n " +
|
||||
" }\r\n\r\n $attachmentOutput.children(\'a\').each(func" +
|
||||
"tion () {\r\n $this = $(this);\r\n if " +
|
||||
"($this.attr(\'data-mimetype\').toLowerCase().indexOf(\'image/\') == 0)\r\n " +
|
||||
" $this.shadowbox({ gallery: \'attachments\', player: \'img\', title: " +
|
||||
"$this.find(\'.comments\').text() });\r\n });\r\n });" +
|
||||
"\r\n </script>\r\n </td>\r\n </tr>\r\n </table>\r\n " +
|
||||
" <div");
|
||||
|
||||
WriteLiteral(" id=\"dialogUpload\"");
|
||||
|
||||
WriteLiteral(" title=\"Upload Attachment\"");
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" id=\"silverlightHostUploadAttachment\"");
|
||||
|
||||
WriteLiteral(">\r\n </div>\r\n</div>\r\n<div");
|
||||
WriteLiteral(">\r\n </div>\r\n </div>\r\n <div");
|
||||
|
||||
WriteLiteral(" id=\"dialogRemoveAttachment\"");
|
||||
|
||||
WriteLiteral(" title=\"Remove this Attachment?\"");
|
||||
|
||||
WriteLiteral(">\r\n <p>\r\n <span");
|
||||
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>");
|
||||
WriteLiteral("></span>\r\n Are you sure?\r\n </p>\r\n </div>\r\n <script>\r\n " +
|
||||
" $(\'#DeviceDetailTabItems\').append(\'<li><a href=\"#DeviceDetailTab-Resources\" " +
|
||||
"id=\"DeviceDetailTab-ResourcesLink\">Attachments [");
|
||||
|
||||
|
||||
#line 200 "..\..\Views\Device\DeviceParts\Resources.cshtml"
|
||||
Write(Model.Device.DeviceAttachments == null ? 0 : Model.Device.DeviceAttachments.Count);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("]</a></li>\');\r\n </script>\r\n</div>\r\n");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,717 @@
|
||||
@model Disco.Web.Models.Device.ShowModel
|
||||
@{
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
|
||||
}
|
||||
<table id="Device_Show_Subjects">
|
||||
<tr>
|
||||
<td id="Device_Show_Details">
|
||||
<div>
|
||||
<div id="Device_Show_Details_Asset">
|
||||
<table class="none verticalHeadings">
|
||||
<tr>
|
||||
<td><span title="Computer Name">Name:</span>
|
||||
</td>
|
||||
<td>@if (string.IsNullOrWhiteSpace(Model.Device.ComputerName))
|
||||
{
|
||||
<span id="Device_Show_Details_Asset_NameUnknown" title="Computer Name" class="smallMessage"><Unknown/Not Allocated></span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<h4 id="Device_Show_Details_Asset_Name" title="Computer Name">@Model.Device.ComputerName</h4>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Asset:</td>
|
||||
<td>@Html.TextBoxFor(m => m.Device.AssetNumber, new { @class = "small discreet" }) @AjaxHelpers.AjaxSave() @AjaxHelpers.AjaxLoader()</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Location:</td>
|
||||
<td>@Html.TextBoxFor(m => m.Device.Location, new { @class = "small discreet" }) @AjaxHelpers.AjaxSave() @AjaxHelpers.AjaxLoader()</td>
|
||||
</tr>
|
||||
</table>
|
||||
<script>
|
||||
$(function () {
|
||||
document.DiscoFunctions.PropertyChangeHelper($('#Device_AssetNumber'), 'Unknown', '@Url.Action(MVC.API.Device.UpdateAssetNumber(Model.Device.SerialNumber, null))', 'AssetNumber');
|
||||
document.DiscoFunctions.PropertyChangeHelper($('#Device_Location'), 'Unknown', '@Url.Action(MVC.API.Device.UpdateLocation(Model.Device.SerialNumber, null))', 'Location');
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<div id="Device_Show_Details_Dates" class="status">
|
||||
<table class="none verticalHeadings">
|
||||
<tr>
|
||||
<td>Created:
|
||||
</td>
|
||||
<td><span id="Device_Show_Details_Dates_Created">@CommonHelpers.FriendlyDate(Model.Device.CreatedDate)</span></td>
|
||||
</tr>
|
||||
@if (Model.Device.DecommissionedDate.HasValue)
|
||||
{
|
||||
<tr>
|
||||
<td>Decommissioned:
|
||||
</td>
|
||||
<td><span id="Device_Show_Details_Dates_Decommissioned">@CommonHelpers.FriendlyDate(Model.Device.DecommissionedDate)</span></td>
|
||||
</tr>
|
||||
}
|
||||
|
||||
<tr>
|
||||
<td>Enrolled:
|
||||
</td>
|
||||
<td>
|
||||
@if (Model.Device.EnrolledDate.HasValue)
|
||||
{
|
||||
<text>First: </text><span id="Device_Show_Details_Asset_Enrolled_First">@CommonHelpers.FriendlyDate(Model.Device.EnrolledDate)</span>
|
||||
if (Model.Device.LastEnrolDate.HasValue && Model.Device.EnrolledDate.Value != Model.Device.LastEnrolDate.Value)
|
||||
{
|
||||
<br /><text>Last: </text><span id="Device_Show_Details_Asset_Enrolled_Last">@CommonHelpers.FriendlyDate(Model.Device.LastEnrolDate)</span>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<span id="Device_Show_Details_Asset_Enrolled_Never" class="smallMessage">Never</span>
|
||||
}
|
||||
@if (Model.Device.AllowUnauthenticatedEnrol)
|
||||
{
|
||||
<span id="Device_Show_Details_Asset_Enrolled_Trusted" title="Trusted Unauthenticated Enrolment is Allowed"></span>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
<div id="Device_Show_Details_Status" class="status">
|
||||
<table class="none verticalHeadings">
|
||||
<tr>
|
||||
<td><span title="Last Network Logon Date">Last Seen:</span>
|
||||
</td>
|
||||
<td>@{
|
||||
string lastSeenClass = null;
|
||||
if (Model.Device.LastNetworkLogonDate.HasValue)
|
||||
{
|
||||
if (Model.Device.LastNetworkLogonDate.Value < DateTime.Now.AddDays(-30))
|
||||
{
|
||||
lastSeenClass = "error";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Model.Device.LastNetworkLogonDate.Value < DateTime.Now.AddDays(-7))
|
||||
{
|
||||
lastSeenClass = "alert";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
<span id="Device_Show_Details_Status_LastSeen" class="@lastSeenClass">@CommonHelpers.FriendlyDate(Model.Device.LastNetworkLogonDate)</span></td>
|
||||
@if (!string.IsNullOrEmpty(Model.Device.ComputerName))
|
||||
{
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var updated = false;
|
||||
var span = $('#Device_Show_Details_Status_LastSeen');
|
||||
var spanProgress = null;
|
||||
|
||||
$.getJSON('@(Url.Action(MVC.API.Device.LastNetworkLogonDate(Model.Device.SerialNumber)))', function (response, result) {
|
||||
|
||||
updated = true;
|
||||
if (spanProgress)
|
||||
spanProgress.hide();
|
||||
|
||||
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.attr('title', response.Formatted).text(response.Friendly);
|
||||
}
|
||||
});
|
||||
window.setTimeout(function () {
|
||||
if (!updated) {
|
||||
spanProgress = $('<span>').addClass('ajaxHelperIcon ajaxLoading ajaxShowInitially').attr('title', 'Loading...').appendTo(span);
|
||||
}
|
||||
}, 250);
|
||||
});
|
||||
</script>
|
||||
}
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="status">
|
||||
@{
|
||||
var assignedUser = Model.Device.AssignedUser;
|
||||
}
|
||||
<table class="none verticalHeadings">
|
||||
<tr>
|
||||
<td>Assignment:
|
||||
</td>
|
||||
<td>
|
||||
@if (assignedUser != null)
|
||||
{
|
||||
<div id="Device_Show_User">
|
||||
<div id="Device_Show_User_DisplayName" title="Display Name">@Html.ActionLink(assignedUser.DisplayName, MVC.User.Show(assignedUser.Id))</div>
|
||||
<div id="Device_Show_User_Id" title="Id">@assignedUser.Id <span id="Device_Show_User_Type" title="Type">[@(assignedUser.Type)]</span></div>
|
||||
@if (!string.IsNullOrWhiteSpace(assignedUser.PhoneNumber))
|
||||
{
|
||||
<div id="Device_Show_User_PhoneNumber" title="Phone Number">@assignedUser.PhoneNumber</div>
|
||||
}
|
||||
@if (!string.IsNullOrWhiteSpace(assignedUser.EmailAddress))
|
||||
{
|
||||
<div id="Device_Show_User_EmailAddress" title="Email Address"><a href="mailto:@(Model.Device.AssignedUser.EmailAddress)">@assignedUser.EmailAddress</a></div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="smallMessage">Not Assigned</span>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="Device_Show_GenerateDocument_Container" class="status">
|
||||
@Html.DropDownList("Device_Show_GenerateDocument", Model.DocumentTemplatesSelectListItems)
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var generatePdfUrl = '@Url.Action(MVC.API.Device.GeneratePdf(Model.Device.SerialNumber.ToString(), null))?DocumentTemplateId=';
|
||||
var $documentTemplates = $('#Device_Show_GenerateDocument');
|
||||
$documentTemplates.change(function () {
|
||||
var v = $documentTemplates.val();
|
||||
if (v) {
|
||||
window.location.href = generatePdfUrl + v;
|
||||
$documentTemplates.val('').blur();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td id="Device_Show_Policies" rowspan="2">
|
||||
<div>
|
||||
<div id="Device_Show_Policies_Profile">
|
||||
<h2 title="Device Profile">@Html.ActionLink(Model.Device.DeviceProfile.Name, MVC.Config.DeviceProfile.Index(Model.Device.DeviceProfileId))</h2>
|
||||
<table class="none verticalHeadings">
|
||||
<tr>
|
||||
<td><span title="Distribution Type">Distribution:</span>
|
||||
</td>
|
||||
<td>@Model.Device.DeviceProfile.DistributionType.ToString()
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span title="Address">Address:</span>
|
||||
</td>
|
||||
<td>@{
|
||||
if (Model.DeviceProfileDefaultOrganisationAddress != null)
|
||||
{
|
||||
<span id="Device_Show_Policies_Profile_Address">@Model.DeviceProfileDefaultOrganisationAddress.Name</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span id="Device_Show_Policies_Profile_Address_None" class="smallMessage">None</span>
|
||||
}
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span title="Provision Active Directory Account">Provision Account:</span>
|
||||
</td>
|
||||
<td>@(Model.Device.DeviceProfile.ProvisionADAccount ? "Active Directory" : "No")
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span title="Allocate Certificates">Allocate Certificate:</span>
|
||||
</td>
|
||||
<td>@(Model.DeviceProfileCertificateProvider != null ? Model.DeviceProfileCertificateProvider.Name : "No")
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@if (Model.Device.CanUpdateDeviceProfile())
|
||||
{
|
||||
@Html.ActionLinkSmallButton("Update Profile", MVC.API.Device.UpdateDeviceProfileId(Model.Device.SerialNumber, null, true), "Device_Show_Policies_Profile_Actions_Update_Button")
|
||||
|
||||
<div id="Device_Show_Policies_Profile_Actions_Update_Dialog" class="dialog" title="Assign to Device Profile">
|
||||
<div>
|
||||
<ul class="none">
|
||||
@foreach (var dp in Model.DeviceProfiles.OrderBy(i => i.Name))
|
||||
{
|
||||
<li>
|
||||
<input type="radio" data-deviceprofileid="@dp.Id" name="DeviceProfile" id="DeviceProfile_@(dp.Id)" /><label for="DeviceProfile_@(dp.Id)" title="Distribution: @(dp.DistributionType)">@dp.Name</label></li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
var currentProfile = '@(Model.Device.DeviceProfileId)';
|
||||
var button = $('#Device_Show_Policies_Profile_Actions_Update_Button');
|
||||
var buttonDialog = null;
|
||||
var dialogInputs = null;
|
||||
var dialogContainers = null;
|
||||
|
||||
button.click(function () {
|
||||
|
||||
if (!buttonDialog) {
|
||||
buttonDialog = $('#Device_Show_Policies_Profile_Actions_Update_Dialog')
|
||||
.dialog({
|
||||
resizable: false,
|
||||
modal: true,
|
||||
maxHeight: 450,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
"Update Profile": function () {
|
||||
var deviceProfileId = dialogInputs.filter(':checked').attr('data-deviceprofileid');
|
||||
|
||||
if (deviceProfileId) {
|
||||
var $this = $(this);
|
||||
$this.dialog("disable");
|
||||
$this.dialog("option", "buttons", null);
|
||||
window.location.href = button.attr('href') + '&DeviceProfileId=' + deviceProfileId;
|
||||
} else {
|
||||
alert('A device profile must be selected');
|
||||
}
|
||||
},
|
||||
Cancel: function () {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
});
|
||||
dialogInputs = buttonDialog.find('input');
|
||||
dialogContainers = dialogInputs.closest('li');
|
||||
|
||||
dialogInputs.change(function () {
|
||||
dialogContainers.removeClass('selected');
|
||||
$(this).closest('li').addClass('selected');
|
||||
});
|
||||
}
|
||||
|
||||
dialogInputs.filter('[data-deviceprofileid=' + currentProfile + ']').prop('checked', true).change();
|
||||
|
||||
buttonDialog.dialog('open');
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
}
|
||||
</div>
|
||||
<div id="Device_Show_Policies_Batch" class="status">
|
||||
@if (Model.Device.DeviceBatchId.HasValue)
|
||||
{
|
||||
<h2 title="Device Batch">@Html.ActionLink(Model.Device.DeviceBatch.Name, MVC.Config.DeviceBatch.Index(Model.Device.DeviceBatchId.Value))</h2>
|
||||
<table class="none verticalHeadings">
|
||||
<tr>
|
||||
<td><span title="Purchased Date">Purchased:</span>
|
||||
</td>
|
||||
<td>@CommonHelpers.FriendlyDate(Model.Device.DeviceBatch.PurchaseDate)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span title="Supplier">Supplier:</span>
|
||||
</td>
|
||||
<td>@(Model.Device.DeviceBatch.Supplier ?? "Unknown")
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span title="Warranty Valid Until">Warranty Until:</span>
|
||||
</td>
|
||||
<td class="@(Model.Device.DeviceBatch.WarrantyValidUntil.HasValue && Model.Device.DeviceBatch.WarrantyValidUntil.Value < DateTime.Now ? "alert" : null)">@CommonHelpers.FriendlyDate(Model.Device.DeviceBatch.WarrantyValidUntil, "Unknown", null)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span title="Insurance Supplier">Insurance Supplier:</span>
|
||||
</td>
|
||||
<td>@(Model.Device.DeviceBatch.InsuranceSupplier ?? "Unknown")
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span title="Insured Until">Insured Until:</span>
|
||||
</td>
|
||||
<td class="@(Model.Device.DeviceBatch.InsuredUntil.HasValue && Model.Device.DeviceBatch.InsuredUntil.Value < DateTime.Now ? "alert" : null)">@CommonHelpers.FriendlyDate(Model.Device.DeviceBatch.InsuredUntil, "Unknown", null)
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
}
|
||||
else
|
||||
{
|
||||
<h2>Batch: <em>Not Associated</em></h2>
|
||||
}
|
||||
@if (Model.Device.CanUpdateDeviceBatch())
|
||||
{
|
||||
@Html.ActionLinkSmallButton("Update Batch", MVC.API.Device.UpdateDeviceBatchId(Model.Device.SerialNumber, null, true), "Device_Show_Policies_Batch_Actions_Update_Button")
|
||||
|
||||
<div id="Device_Show_Policies_Batch_Actions_Update_Dialog" class="dialog" title="Assign to Device Batch">
|
||||
<div>
|
||||
<ul class="none">
|
||||
@foreach (var db in Model.DeviceBatches.OrderBy(i => i.Name))
|
||||
{
|
||||
<li>
|
||||
<input type="radio" data-devicebatchid="@db.Id" name="DeviceBatch" id="DeviceBatch_@(db.Id)" /><label for="DeviceBatch_@(db.Id)" title="Purchased: @(db.PurchaseDate.ToFuzzy())">@db.Name</label></li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
var currentBatch = '@(Model.Device.DeviceBatchId)';
|
||||
var button = $('#Device_Show_Policies_Batch_Actions_Update_Button');
|
||||
var buttonDialog = null;
|
||||
var dialogInputs = null;
|
||||
var dialogContainers = null;
|
||||
|
||||
button.click(function () {
|
||||
|
||||
if (!buttonDialog) {
|
||||
buttonDialog = $('#Device_Show_Policies_Batch_Actions_Update_Dialog')
|
||||
.dialog({
|
||||
resizable: false,
|
||||
modal: true,
|
||||
maxHeight: 450,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
"Update Batch": function () {
|
||||
var deviceBatchId = dialogInputs.filter(':checked').attr('data-devicebatchid');
|
||||
|
||||
if (deviceBatchId) {
|
||||
var $this = $(this);
|
||||
$this.dialog("disable");
|
||||
$this.dialog("option", "buttons", null);
|
||||
window.location.href = button.attr('href') + '&DeviceBatchId=' + deviceBatchId;
|
||||
} else {
|
||||
alert('A device batch must be selected');
|
||||
}
|
||||
},
|
||||
Cancel: function () {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
});
|
||||
dialogInputs = buttonDialog.find('input');
|
||||
dialogContainers = dialogInputs.closest('li');
|
||||
|
||||
dialogInputs.change(function () {
|
||||
dialogContainers.removeClass('selected');
|
||||
$(this).closest('li').addClass('selected');
|
||||
});
|
||||
}
|
||||
|
||||
dialogInputs.filter('[data-devicebatchid=' + currentBatch + ']').prop('checked', true).change();
|
||||
|
||||
buttonDialog.dialog('open');
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td id="Device_Show_Aspects" rowspan="2">
|
||||
<div>
|
||||
<div id="Device_Show_Aspects_Model" class="clearfix">
|
||||
<h2 id="Device_Show_Aspects_Model_Description" title="Model Description">@Html.ActionLink(Model.Device.DeviceModel.ToString(), MVC.Config.DeviceModel.Index(Model.Device.DeviceModelId))</h2>
|
||||
<img id="Device_Show_Aspects_Model_Image" alt="Model Image" src="@Url.Action(MVC.API.DeviceModel.Image(Model.Device.DeviceModelId, Model.Device.DeviceModel.ImageHash()))" />
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="Device_Show_Subjects_Actions">
|
||||
<td id="Device_Show_Device_Actions">
|
||||
@if (Model.Device.CanCreateJob())
|
||||
{
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Disco-CreateJob");
|
||||
@Html.ActionLinkSmallButton("Create Job", MVC.Job.Create(Model.Device.SerialNumber, Model.Device.AssignedUserId), "buttonCreateJob")
|
||||
}
|
||||
@if (Model.Device.CanUpdateAssignment())
|
||||
{
|
||||
@Html.ActionLinkSmallButton("Update Assignment", MVC.API.Device.UpdateAssignedUserId(Model.Device.SerialNumber, null, true), "Device_Show_User_Actions_Assign_Button")
|
||||
<div id="Device_Show_User_Actions_Assign_Dialog" class="dialog" title="Assign this Device?">
|
||||
<p>
|
||||
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
|
||||
Assign to User:
|
||||
<input id="Device_Show_User_Actions_Assign_UserId" type="text" />
|
||||
</p>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var button = $('#Device_Show_User_Actions_Assign_Button');
|
||||
var buttonDialog = null;
|
||||
var inputUserId = null;
|
||||
|
||||
var dialogButtons = {
|
||||
@{
|
||||
if (assignedUser != null)
|
||||
{
|
||||
<text>
|
||||
"Unassign": function () {
|
||||
var $this = $(this);
|
||||
$this.dialog("disable");
|
||||
$this.dialog("option", "buttons", null);
|
||||
window.location.href = button.attr('href');
|
||||
},
|
||||
</text>
|
||||
}
|
||||
}
|
||||
"Assign": function () {
|
||||
var $this = $(this);
|
||||
var userId = inputUserId.val();
|
||||
if (userId) {
|
||||
$this.dialog("disable");
|
||||
$this.dialog("option", "buttons", null);
|
||||
window.location.href = button.attr('href') + '&AssignedUserId=' + userId;
|
||||
} else {
|
||||
alert('Enter a user to assign this device');
|
||||
}
|
||||
},
|
||||
Cancel: function () {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
|
||||
button.click(function () {
|
||||
if (!buttonDialog) {
|
||||
buttonDialog = $('#Device_Show_User_Actions_Assign_Dialog')
|
||||
.dialog({
|
||||
resizable: false,
|
||||
height: 160,
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
buttons: dialogButtons
|
||||
});
|
||||
inputUserId = $('#Device_Show_User_Actions_Assign_UserId');
|
||||
inputUserId.focus(function () { inputUserId.select() })
|
||||
.autocomplete({
|
||||
source: '@(Url.Action(MVC.API.User.UpstreamUsers()))',
|
||||
minLength: 2,
|
||||
select: function (e, ui) {
|
||||
inputUserId.val(ui.item.Id);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
inputUserId.data('ui-autocomplete')._renderItem = function (ul, item) {
|
||||
return $("<li>")
|
||||
.data("item.autocomplete", item)
|
||||
.append("<a><strong>" + item.DisplayName + "</strong><br>" + item.Id + " (" + item.Type + ")</a>")
|
||||
.appendTo(ul);
|
||||
};
|
||||
}
|
||||
buttonDialog.dialog('open');
|
||||
inputUserId.focus();
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
}
|
||||
@if (Model.Device.CanUpdateTrustEnrol())
|
||||
{
|
||||
@Html.ActionLinkSmallButton("Trust Enrol", MVC.API.Device.UpdateAllowUnauthenticatedEnrol(Model.Device.SerialNumber, true.ToString(), true), "Device_Show_Device_Actions_TrustEnrol_Button")
|
||||
<div id="Device_Show_Device_Actions_TrustEnrol_Dialog" title="Trust this Device?">
|
||||
<div class="ui-widget">
|
||||
<div class="ui-state-highlight ui-corner-all" style="padding: 6px;">
|
||||
<div style="padding-bottom: 6px;">
|
||||
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
|
||||
This action will allow a device <em>claiming</em> to have the Serial Number '@(Model.Device.SerialNumber)' to be enrolled without authentication.
|
||||
</div>
|
||||
<strong>Are you sure you want to allow an unauthenticated enrolment?</strong>
|
||||
</div>
|
||||
</div>
|
||||
<div class="smallMessage" style="margin-top: 10px; font-size: 1em;">
|
||||
Devices flagged as 'trusted' are allowed a single-use device enrolment without providing authentication (for example: Active Directory Computer Account).<br />
|
||||
Once a devices enrol, their trust setting is reset and additional enrolments need to be authenticated (domain joined) or manually trusted again.
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var button = $('#Device_Show_Device_Actions_TrustEnrol_Button');
|
||||
var buttonDialog = $('#Device_Show_Device_Actions_TrustEnrol_Dialog');
|
||||
var buttonLink = button.attr('href');
|
||||
button.attr('href', '#');
|
||||
button.click(function () {
|
||||
buttonDialog.dialog('open');
|
||||
return false;
|
||||
});
|
||||
buttonDialog.dialog({
|
||||
resizable: false,
|
||||
width: 400,
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
"Trust": function () {
|
||||
var $this = $(this);
|
||||
$this.dialog("disable");
|
||||
$this.dialog("option", "buttons", null);
|
||||
window.location.href = buttonLink;
|
||||
},
|
||||
Cancel: function () {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
}
|
||||
@if (Model.Device.CanUpdateUntrustEnrol())
|
||||
{
|
||||
@Html.ActionLinkSmallButton("Untrust Enrol", MVC.API.Device.UpdateAllowUnauthenticatedEnrol(Model.Device.SerialNumber, false.ToString(), true), "Device_Show_Device_Actions_UntrustEnrol_Button")
|
||||
<div id="Device_Show_Device_Actions_UntrustEnrol_Dialog" title="Untrust this Device?">
|
||||
<div style="padding-bottom: 6px;">
|
||||
<span class="ui-icon ui-icon-info" style="float: left; margin: 0 7px 20px 0;"></span>
|
||||
This action will require the device to enrol with authentication (for example: domain joined).
|
||||
</div>
|
||||
<strong>Are you sure you want to require an authenticated enrolment?</strong>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var button = $('#Device_Show_Device_Actions_UntrustEnrol_Button');
|
||||
var buttonDialog = $('#Device_Show_Device_Actions_UntrustEnrol_Dialog');
|
||||
var buttonLink = button.attr('href');
|
||||
button.attr('href', '#');
|
||||
button.click(function () {
|
||||
buttonDialog.dialog('open');
|
||||
return false;
|
||||
});
|
||||
buttonDialog.dialog({
|
||||
resizable: false,
|
||||
width: 400,
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
"Untrust": function () {
|
||||
var $this = $(this);
|
||||
$this.dialog("disable");
|
||||
$this.dialog("option", "buttons", null);
|
||||
window.location.href = buttonLink;
|
||||
},
|
||||
Cancel: function () {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
}
|
||||
@if (Model.Device.CanDecommission())
|
||||
{
|
||||
@Html.ActionLinkSmallButton("Decommission", MVC.API.Device.Decommission(Model.Device.SerialNumber, true), "Device_Show_Device_Actions_Decommission_Button")
|
||||
<div id="Device_Show_Device_Actions_Decommission_Dialog" class="dialog" title="Decommission this Device?">
|
||||
<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 button = $('#Device_Show_Device_Actions_Decommission_Button');
|
||||
var buttonDialog = null;
|
||||
|
||||
button.click(function () {
|
||||
|
||||
if (!buttonDialog) {
|
||||
buttonDialog = $('#Device_Show_Device_Actions_Decommission_Dialog')
|
||||
.dialog({
|
||||
resizable: false,
|
||||
height: 140,
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
"Decommission": function () {
|
||||
var $this = $(this);
|
||||
$this.dialog("disable");
|
||||
$this.dialog("option", "buttons", null);
|
||||
window.location.href = button.attr('href');
|
||||
},
|
||||
Cancel: function () {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
buttonDialog.dialog('open');
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
}
|
||||
@if (Model.Device.CanRecommission())
|
||||
{
|
||||
@Html.ActionLinkSmallButton("Recommission", MVC.API.Device.Recommission(Model.Device.SerialNumber, true), "Device_Show_Device_Actions_Recommission_Button")
|
||||
<div id="Device_Show_Device_Actions_Recommission_Dialog" title="Recommission this Device?">
|
||||
<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 button = $('#Device_Show_Device_Actions_Recommission_Button');
|
||||
var buttonDialog = $('#Device_Show_Device_Actions_Recommission_Dialog');
|
||||
var buttonLink = button.attr('href');
|
||||
button.attr('href', '#');
|
||||
button.click(function () {
|
||||
buttonDialog.dialog('open');
|
||||
return false;
|
||||
});
|
||||
buttonDialog.dialog({
|
||||
resizable: false,
|
||||
height: 140,
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
"Recommission": function () {
|
||||
var $this = $(this);
|
||||
$this.dialog("disable");
|
||||
$this.dialog("option", "buttons", null);
|
||||
window.location.href = buttonLink;
|
||||
},
|
||||
Cancel: function () {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
}
|
||||
@if (Model.Device.CanDelete())
|
||||
{
|
||||
@Html.ActionLinkSmallButton("Delete Device", MVC.API.Device.Delete(Model.Device.SerialNumber, true), "Device_Show_Device_Actions_Delete_Button")
|
||||
<div id="Device_Show_Device_Actions_Delete_Dialog" title="Delete this Device?">
|
||||
<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.<br />
|
||||
Jobs linked to this Device (but not to a User) will be deleted also.<br />
|
||||
Are you sure?
|
||||
</p>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var button = $('#Device_Show_Device_Actions_Delete_Button');
|
||||
var buttonDialog = $('#Device_Show_Device_Actions_Delete_Dialog');
|
||||
var buttonLink = button.attr('href');
|
||||
button.attr('href', '#');
|
||||
button.click(function () {
|
||||
buttonDialog.dialog('open');
|
||||
return false;
|
||||
});
|
||||
buttonDialog.dialog({
|
||||
resizable: false,
|
||||
height: 200,
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
"Delete": function () {
|
||||
var $this = $(this);
|
||||
$this.dialog("disable");
|
||||
$this.dialog("option", "buttons", null);
|
||||
window.location.href = buttonLink;
|
||||
},
|
||||
Cancel: function () {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user