initial source commit

This commit is contained in:
Gary Sharp
2013-02-01 12:35:28 +11:00
parent 543a005d31
commit 0a93429800
1103 changed files with 285609 additions and 0 deletions
@@ -0,0 +1,43 @@
@model Disco.Models.Repository.DeviceProfile
@{
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Profiles", MVC.Config.DeviceProfile.Index(null), "Create");
}
@using (Html.BeginForm())
{
<div class="form" style="width: 450px">
<table>
<tr>
<th>
Name:
</th>
<td>
@Html.TextBoxFor(model => model.Name)<br />@Html.ValidationMessageFor(model => model.Name)
</td>
</tr>
<tr>
<th>
Short Name:
</th>
<td>@Html.TextBoxFor(model => model.ShortName)<br />@Html.ValidationMessageFor(model => model.ShortName)
</td>
</tr>
<tr>
<th>
Description:
</th>
<td>@Html.TextBoxFor(model => model.Description)<br />@Html.ValidationMessageFor(model => model.Description)
</td>
</tr>
</table>
<input type="hidden" name="ComputerNameTemplate" value="DeviceProfile.ShortName + '-' + SerialNumber" />
<input type="hidden" name="ProvisionADAccount" value="True" />
<p class="actions">
<input type="submit" class="button" value="Create" />
</p>
</div>
<script type="text/javascript">
$(function () {
$('#Name').focus().select();
});
</script>
}
@@ -0,0 +1,174 @@
#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.DeviceProfile
{
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/DeviceProfile/Create.cshtml")]
public class Create : System.Web.Mvc.WebViewPage<Disco.Models.Repository.DeviceProfile>
{
public Create()
{
}
public override void Execute()
{
#line 2 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Profiles", MVC.Config.DeviceProfile.Index(null), "Create");
#line default
#line hidden
WriteLiteral("\r\n");
#line 5 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
using (Html.BeginForm())
{
#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 N" +
"ame:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 14 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
Write(Html.TextBoxFor(model => model.Name));
#line default
#line hidden
WriteLiteral("<br />");
#line 14 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
Write(Html.ValidationMessageFor(model => model.Name));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
">\r\n Short Name:\r\n </th>\r\n <td>");
#line 21 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
Write(Html.TextBoxFor(model => model.ShortName));
#line default
#line hidden
WriteLiteral("<br />");
#line 21 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
Write(Html.ValidationMessageFor(model => model.ShortName));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
">\r\n Description:\r\n </th>\r\n <td>" +
"");
#line 28 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
Write(Html.TextBoxFor(model => model.Description));
#line default
#line hidden
WriteLiteral("<br />");
#line 28 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
Write(Html.ValidationMessageFor(model => model.Description));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n </table>\r\n <input");
WriteLiteral(" type=\"hidden\"");
WriteLiteral(" name=\"ComputerNameTemplate\"");
WriteLiteral(" value=\"DeviceProfile.ShortName + \'-\' + SerialNumber\"");
WriteLiteral(" />\r\n <input");
WriteLiteral(" type=\"hidden\"");
WriteLiteral(" name=\"ProvisionADAccount\"");
WriteLiteral(" value=\"True\"");
WriteLiteral(" />\r\n <p");
WriteLiteral(" class=\"actions\"");
WriteLiteral(">\r\n <input");
WriteLiteral(" type=\"submit\"");
WriteLiteral(" class=\"button\"");
WriteLiteral(" value=\"Create\"");
WriteLiteral(" />\r\n </p>\r\n </div>\r\n");
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(">\r\n $(function () {\r\n $(\'#Name\').focus().select();\r\n });" +
"\r\n </script>\r\n");
#line 43 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
}
#line default
#line hidden
}
}
}
#pragma warning restore 1591
@@ -0,0 +1,60 @@
@model Disco.Web.Areas.Config.Models.DeviceProfile.DefaultsModel
@{
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Profiles", MVC.Config.DeviceProfile.Index(null), "Defaults");
}
<div class="form" style="width: 600px">
<table>
<tr>
<th class="name" style="width: 230px">
Default Profile:
</th>
<td class="value">
@Html.DropDownListFor(m => m.Default, Model.DeviceProfiles.ToSelectListItems(Model.Default))
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
$('#Default').change(function () {
$this = $(this);
$ajaxLoading = $this.next('.ajaxLoading').show();
var data = { id: $this.val() };
$.getJSON('@(Url.Action(MVC.API.DeviceProfile.Default()))', data, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Default Device Profile:\n' + response);
$ajaxLoading.hide();
} else {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
});
});
});
</script>
</td>
</tr>
<tr>
<th class="name">
Default Add Device Offline Profile:
</th>
<td class="value">
@Html.DropDownListFor(m => m.DefaultAddDeviceOffline, Model.DeviceProfilesAndNone.ToSelectListItems(Model.DefaultAddDeviceOffline))
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
$('#DefaultAddDeviceOffline').change(function () {
$this = $(this);
$ajaxLoading = $this.next('.ajaxLoading').show();
var data = { id: $this.val() };
$.getJSON('@(Url.Action(MVC.API.DeviceProfile.DefaultAddDeviceOffline()))', data, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Default Add Device Offline Device Profile:\n' + response);
$ajaxLoading.hide();
} else {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
});
});
});
</script>
</td>
</tr>
</table>
</div>
@@ -0,0 +1,192 @@
#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.DeviceProfile
{
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/DeviceProfile/Defaults.cshtml")]
public class Defaults : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.DeviceProfile.DefaultsModel>
{
public Defaults()
{
}
public override void Execute()
{
#line 2 "..\..\Areas\Config\Views\DeviceProfile\Defaults.cshtml"
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Profiles", MVC.Config.DeviceProfile.Index(null), "Defaults");
#line default
#line hidden
WriteLiteral("\r\n<div");
WriteLiteral(" class=\"form\"");
WriteLiteral(" style=\"width: 600px\"");
WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th");
WriteLiteral(" class=\"name\"");
WriteLiteral(" style=\"width: 230px\"");
WriteLiteral(">\r\n Default Profile:\r\n </th>\r\n <td");
WriteLiteral(" class=\"value\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 12 "..\..\Areas\Config\Views\DeviceProfile\Defaults.cshtml"
Write(Html.DropDownListFor(m => m.Default, Model.DeviceProfiles.ToSelectListItems(Model.Default)));
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 13 "..\..\Areas\Config\Views\DeviceProfile\Defaults.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
WriteLiteral("\r\n <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
$('#Default').change(function () {
$this = $(this);
$ajaxLoading = $this.next('.ajaxLoading').show();
var data = { id: $this.val() };
$.getJSON('");
#line 20 "..\..\Areas\Config\Views\DeviceProfile\Defaults.cshtml"
Write(Url.Action(MVC.API.DeviceProfile.Default()));
#line default
#line hidden
WriteLiteral(@"', data, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Default Device Profile:\n' + response);
$ajaxLoading.hide();
} else {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
});
});
});
</script>
</td>
</tr>
<tr>
<th");
WriteLiteral(" class=\"name\"");
WriteLiteral(">\r\n Default Add Device Offline Profile:\r\n </th>\r\n " +
" <td");
WriteLiteral(" class=\"value\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 38 "..\..\Areas\Config\Views\DeviceProfile\Defaults.cshtml"
Write(Html.DropDownListFor(m => m.DefaultAddDeviceOffline, Model.DeviceProfilesAndNone.ToSelectListItems(Model.DefaultAddDeviceOffline)));
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 39 "..\..\Areas\Config\Views\DeviceProfile\Defaults.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
WriteLiteral("\r\n <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
$('#DefaultAddDeviceOffline').change(function () {
$this = $(this);
$ajaxLoading = $this.next('.ajaxLoading').show();
var data = { id: $this.val() };
$.getJSON('");
#line 46 "..\..\Areas\Config\Views\DeviceProfile\Defaults.cshtml"
Write(Url.Action(MVC.API.DeviceProfile.DefaultAddDeviceOffline()));
#line default
#line hidden
WriteLiteral(@"', data, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Default Add Device Offline Device Profile:\n' + response);
$ajaxLoading.hide();
} else {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
});
});
});
</script>
</td>
</tr>
</table>
</div>
");
}
}
}
#pragma warning restore 1591
@@ -0,0 +1,9 @@
@model Disco.Web.Areas.Config.Models.DeviceProfile.IndexModel
@{
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Profiles");
}
@Html.Partial(MVC.Config.DeviceProfile.Views._Table, Model, new ViewDataDictionary())
<div class="actionBar">
@Html.ActionLinkButton("Modify Default Profiles", MVC.Config.DeviceProfile.Defaults())
@Html.ActionLinkButton("Create Device Profile", MVC.Config.DeviceProfile.Create())
</div>
@@ -0,0 +1,91 @@
#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.DeviceProfile
{
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/DeviceProfile/Index.cshtml")]
public class Index : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.DeviceProfile.IndexModel>
{
public Index()
{
}
public override void Execute()
{
#line 2 "..\..\Areas\Config\Views\DeviceProfile\Index.cshtml"
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Profiles");
#line default
#line hidden
WriteLiteral("\r\n");
#line 5 "..\..\Areas\Config\Views\DeviceProfile\Index.cshtml"
Write(Html.Partial(MVC.Config.DeviceProfile.Views._Table, Model, new ViewDataDictionary()));
#line default
#line hidden
WriteLiteral("\r\n<div");
WriteLiteral(" class=\"actionBar\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 7 "..\..\Areas\Config\Views\DeviceProfile\Index.cshtml"
Write(Html.ActionLinkButton("Modify Default Profiles", MVC.Config.DeviceProfile.Defaults()));
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 8 "..\..\Areas\Config\Views\DeviceProfile\Index.cshtml"
Write(Html.ActionLinkButton("Create Device Profile", MVC.Config.DeviceProfile.Create()));
#line default
#line hidden
WriteLiteral("\r\n</div>\r\n");
}
}
}
#pragma warning restore 1591
@@ -0,0 +1,536 @@
@model Disco.Web.Areas.Config.Models.DeviceProfile.ShowModel
@{
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Profiles", MVC.Config.DeviceProfile.Index(null), Model.DeviceProfile.ToString());
Html.BundleDeferred("~/Style/jQueryUI/dynatree");
Html.BundleDeferred("~/ClientScripts/Modules/jQueryUI-DynaTree");
}
<div id="configurationDeviceProfileShow" class="form" style="width: 600px">
<table>
<tr>
<th>
Id:
</th>
<td>
@Html.DisplayFor(model => model.DeviceProfile.Id)
</td>
</tr>
<tr>
<th>
Name:
</th>
<td>@Html.TextBoxFor(model => model.DeviceProfile.Name)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
var $Name = $('#DeviceProfile_Name');
var $NameAjaxSave = $Name.next('.ajaxSave');
$Name
.watermark('Profile Short Name')
.focus(function () { $Name.select() })
.keydown(function (e) {
$NameAjaxSave.show();
if (e.which == 13) {
$(this).blur();
}
}).blur(function () {
$NameAjaxSave.hide();
})
.change(function () {
$NameAjaxSave.hide();
var $ajaxLoading = $NameAjaxSave.next('.ajaxLoading').show();
var data = { ProfileName: $Name.val() };
$.ajax({
url: '@Url.Action(MVC.API.DeviceProfile.UpdateName(Model.DeviceProfile.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 name: ' + d);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update name: ' + textStatus);
$ajaxLoading.hide();
}
});
});
});
</script>
</td>
</tr>
<tr>
<th>
Short Name:
</th>
<td>@Html.TextBoxFor(model => model.DeviceProfile.ShortName)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
var $ShortName = $('#DeviceProfile_ShortName');
var $ShortNameAjaxSave = $ShortName.next('.ajaxSave');
$ShortName
.watermark('Profile Short Name')
.focus(function () { $ShortName.select() })
.keydown(function (e) {
$ShortNameAjaxSave.show();
if (e.which == 13) {
$(this).blur();
}
}).blur(function () {
$ShortNameAjaxSave.hide();
})
.change(function () {
$ShortNameAjaxSave.hide();
var $ajaxLoading = $ShortNameAjaxSave.next('.ajaxLoading').show();
var data = { ShortName: $ShortName.val() };
$.ajax({
url: '@Url.Action(MVC.API.DeviceProfile.UpdateShortName(Model.DeviceProfile.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 short name: ' + d);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update short name: ' + textStatus);
$ajaxLoading.hide();
}
});
});
});
</script>
</td>
</tr>
<tr>
<th>
Description:
</th>
<td>@Html.TextBoxFor(model => model.DeviceProfile.Description)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
var $Description = $('#DeviceProfile_Description');
var $DescriptionAjaxSave = $Description.next('.ajaxSave');
$Description
.watermark('Profile 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.DeviceProfile.UpdateDescription(Model.DeviceProfile.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>
Distribution Type:
</th>
<td>
@Html.DropDownList("DeviceProfile_DistributionType", Model.DeviceProfileDistributionTypes)
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
$('#DeviceProfile_DistributionType').change(function () {
var $this = $(this);
var $ajaxLoading = $this.next('.ajaxLoading').show();
var data = { DistributionType: $this.val() };
$.getJSON('@Url.Action(MVC.API.DeviceProfile.UpdateDistributionType(Model.DeviceProfile.Id))', data, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Distribution Type:\n' + response);
$ajaxLoading.hide();
} else {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
});
});
});
</script>
</td>
</tr>
<tr>
<th>
Address:
</th>
<td>
@Html.DropDownListFor(m => m.DeviceProfile.DefaultOrganisationAddress, Model.OrganisationAddresses.ToSelectListItems(Model.DeviceProfile.DefaultOrganisationAddress, true, "None"))
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
$('#DeviceProfile_DefaultOrganisationAddress').change(function () {
var $this = $(this);
var $ajaxLoading = $this.next('.ajaxLoading').show();
var data = { DefaultOrganisationAddress: $this.val() };
$.getJSON('@Url.Action(MVC.API.DeviceProfile.UpdateDefaultOrganisationAddress(Model.DeviceProfile.Id))', data, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Address:\n' + response);
$ajaxLoading.hide();
} else {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
});
});
});
</script>
</td>
</tr>
<tr>
<th>
Allocate Certificates:
</th>
<td>
@Html.DropDownListFor(model => model.DeviceProfile.CertificateProviderId, Model.CertificateProviders.ToSelectListItems(null, true, "Not Allocated"))
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
var $field = $('#DeviceProfile_CertificateProviderId');
var $ajaxLoading = $field.next('.ajaxLoading');
$field
.change(function () {
$ajaxLoading.show();
var data = { CertificateProviderId: $field.val() };
$.ajax({
url: '@Url.Action(MVC.API.DeviceProfile.UpdateCertificateProviderId(Model.DeviceProfile.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 Certificate Provider Id: ' + d);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update Certificate Provider Id: ' + textStatus);
$ajaxLoading.hide();
}
});
});
});
</script>
</td>
</tr>
<tr>
<th>
Computer Name Template Expression:
</th>
<td>@Html.TextBoxFor(model => model.DeviceProfile.ComputerNameTemplate)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<a id="expressionBrowserAnchor" href="@(Url.Action(MVC.Config.DocumentTemplate.ExpressionBrowser()))">
&nbsp;</a>
<script type="text/javascript">
$(function () {
var $ComputerNameTemplate = $('#DeviceProfile_ComputerNameTemplate');
var $ajaxSave = $ComputerNameTemplate.next('.ajaxSave');
$ComputerNameTemplate
.focus(function () { $ComputerNameTemplate.select() })
.keydown(function (e) {
$ajaxSave.show();
if (e.which == 13) {
$(this).blur();
}
}).blur(function () {
$ajaxSave.hide();
})
.change(function () {
$ajaxSave.hide();
var $ajaxLoading = $ajaxSave.next('.ajaxLoading').show();
var data = { ComputerNameTemplate: $ComputerNameTemplate.val() };
$.ajax({
url: '@(Url.Action(MVC.API.DeviceProfile.UpdateComputerNameTemplate(Model.DeviceProfile.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 computer name template: ' + d);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update computer name template: ' + textStatus);
$ajaxLoading.hide();
}
});
});
});
</script>
<div style="margin-top: 8px;">
<label for="DeviceProfile_ProvisionADAccount">
Provision Active Directory Account:
</label>
<input id="DeviceProfile_ProvisionADAccount" type="checkbox" @(Model.DeviceProfile.ProvisionADAccount ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty))/>
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
$('#DeviceProfile_ProvisionADAccount').click(function () {
var $this = $(this);
var $ajaxLoading = $this.next('.ajaxLoading').show();
var data = { ProvisionADAccount: $this.is(':checked') };
$.getJSON('@Url.Action(MVC.API.DeviceProfile.UpdateProvisionADAccount(Model.DeviceProfile.Id))', data, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Provision AD Account:\n' + response);
$ajaxLoading.hide();
} else {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
});
});
});
</script>
</div>
<div style="margin-top: 8px;">
<label for="DeviceProfile_EnforceComputerNameConvention">
Enforce Naming Convention:
</label>
<input id="DeviceProfile_EnforceComputerNameConvention" type="checkbox" @(Model.DeviceProfile.EnforceComputerNameConvention ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty))/>
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
$('#DeviceProfile_EnforceComputerNameConvention').click(function () {
var $this = $(this);
var $ajaxLoading = $this.next('.ajaxLoading').show();
var data = { EnforceComputerNameConvention: $this.is(':checked') };
$.getJSON('@Url.Action(MVC.API.DeviceProfile.UpdateEnforceComputerNameConvention(Model.DeviceProfile.Id))', data, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Enforce Computer Name Convention:\n' + response);
$ajaxLoading.hide();
} else {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
});
});
});
</script>
</div>
</td>
</tr>
<tr>
<th>
Default Organisational Unit:
</th>
<td>
@Html.HiddenFor(model => model.DeviceProfile.OrganisationalUnit)
<div id="displayOrganisationalUnit">
</div>
<a id="changeOrganisationalUnit" href="#">Change</a>@AjaxHelpers.AjaxLoader()
<div id="dialogOrganisationalUnit" title="Default Organisational Unit">
<div id="treeOrganisationalUnit">
</div>
</div>
<script type="text/javascript">
$(function () {
var ouValue = $('#DeviceProfile_OrganisationalUnit');
var ouDisplay = $('#displayOrganisationalUnit');
var ouTree = $('#treeOrganisationalUnit');
var ouChangeLink = $('#changeOrganisationalUnit');
var ouTreeLoaded = false;
var ouFriendlyName = function (ou) {
return ou.replace(/ou=/gi, '').split(',').reverse().join(' > ');
};
var updateDisplayOrganisationalUnit = function () {
var value = ouValue.val();
if (value) {
ouDisplay.text(ouFriendlyName(value));
} else {
ouDisplay.text('{Default Computers Container}');
}
};
var ouSet = function (ou) {
$ajaxLoading = ouChangeLink.next('.ajaxLoading').show();
var data = { OrganisationalUnit: ou };
$.getJSON('@Url.Action(MVC.API.DeviceProfile.UpdateOrganisationalUnit(Model.DeviceProfile.Id, null))', data, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Organisational Unit:\n' + response);
$ajaxLoading.hide();
} else {
ouValue.val(ou);
updateDisplayOrganisationalUnit();
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
});
}
var ouUpdateTree = function () {
var dynaTree = ouTree.dynatree("getTree");
var value = ouValue.val();
if (value) {
dynaTree.activateKey(value);
} else {
var activeNode = dynaTree.getActiveNode();
if (activeNode)
activeNode.deactivate();
}
}
var ouDialog = $('#dialogOrganisationalUnit').dialog({
autoOpen: false,
buttons: {
'Use Default Container': function () {
ouSet('');
$(this).dialog("close");
},
'Save': function () {
var node = ouTree.dynatree("getTree").getActiveNode();
if (node) {
ouSet(node.data.key);
$(this).dialog("close");
} else {
alert('Select an Organisational Unit to Save')
}
}
},
draggable: false,
modal: true,
resizable: false,
width: 400,
height: 400
});
var ouChange = function () {
if (!ouTreeLoaded) {
$.getJSON('@(Url.Action(MVC.API.DeviceProfile.OrganisationalUnits()))', null, function (data) {
var dynatreeDataTransformer = function (element) {
var child = {
title: element.Name,
key: element.Path,
isFolder: true
}
if (element.Children) {
child.children = [];
for (var i = 0; i < element.Children.length; i++) {
child.children.push(dynatreeDataTransformer(element.Children[i]));
}
}
return child;
};
var dynatreeData = [];
for (var i = 0; i < data.length; i++) {
dynatreeData.push(dynatreeDataTransformer(data[i]));
}
ouTree.dynatree({
children: dynatreeData,
onActivate: function (node) {
//alert('node selected: ' + node.data.key);
}
});
ouTreeLoaded = true;
ouUpdateTree();
});
} else {
ouUpdateTree();
}
ouDialog.dialog('open');
};
ouChangeLink.click(ouChange);
updateDisplayOrganisationalUnit();
});
</script>
<div style="margin-top: 8px;">
<label for="DeviceProfile_EnforceOrganisationalUnit">
Enforce:
</label>
<input id="DeviceProfile_EnforceOrganisationalUnit" type="checkbox" @(Model.DeviceProfile.EnforceOrganisationalUnit ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty))/>
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
$('#DeviceProfile_EnforceOrganisationalUnit').click(function () {
var $this = $(this);
var $ajaxLoading = $this.next('.ajaxLoading').show();
var data = { EnforceOrganisationalUnit: $this.is(':checked') };
$.getJSON('@Url.Action(MVC.API.DeviceProfile.UpdateEnforceOrganisationalUnit(Model.DeviceProfile.Id))', data, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Enforce Organisation Unit:\n' + response);
$ajaxLoading.hide();
} else {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
});
});
});
</script>
</div>
</td>
</tr>
</table>
</div>
<div id="dialogConfirmDelete" title="Delete this Device Profile?">
<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>
<script type="text/javascript">
$(function () {
var button = $('#buttonDelete');
var buttonLink = button.attr('href');
button.attr('href', '#');
button.click(function () {
$("#dialogConfirmDelete").dialog('open');
});
$("#dialogConfirmDelete").dialog({
resizable: false,
height: 140,
modal: true,
autoOpen: false,
buttons: {
"Delete": function () {
$(this).dialog('disable');
window.location.href = buttonLink;
},
Cancel: function () {
$(this).dialog("close");
}
}
});
});
</script>
<div class="actionBar">
@if (Model.CanDelete)
{
@Html.ActionLinkButton("Delete", MVC.API.DeviceProfile.Delete(Model.DeviceProfile.Id, true), "buttonDelete")
}
@Html.ActionLinkButton("View Devices", MVC.Search.Query(Model.DeviceProfile.Id.ToString(), "DeviceProfile"))
</div>
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,15 @@
@model Disco.Web.Areas.Config.Models.DeviceProfile.IndexModel
@if (DiscoApplication.MultiSiteMode)
{
var deviceProfilesGrouped = Model.DeviceProfiles.OrderBy(i => i.AddressName).GroupBy(i => i.AddressName);
foreach (var deviceProfilesGroup in deviceProfilesGrouped)
{
if (deviceProfilesGroup.Key != null)
{ <h2>@deviceProfilesGroup.Key</h2> }
@Html.Partial(MVC.Config.DeviceProfile.Views._TableRender, deviceProfilesGroup, new ViewDataDictionary())
}
}
else
{
@Html.Partial(MVC.Config.DeviceProfile.Views._TableRender, Model.DeviceProfiles, new ViewDataDictionary())
}
@@ -0,0 +1,109 @@
#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.DeviceProfile
{
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/DeviceProfile/_Table.cshtml")]
public class Table : System.Web.Mvc.WebViewPage<Disco.Web.Areas.Config.Models.DeviceProfile.IndexModel>
{
public Table()
{
}
public override void Execute()
{
#line 2 "..\..\Areas\Config\Views\DeviceProfile\_Table.cshtml"
if (DiscoApplication.MultiSiteMode)
{
var deviceProfilesGrouped = Model.DeviceProfiles.OrderBy(i => i.AddressName).GroupBy(i => i.AddressName);
foreach (var deviceProfilesGroup in deviceProfilesGrouped)
{
if (deviceProfilesGroup.Key != null)
{
#line default
#line hidden
WriteLiteral(" <h2>");
#line 8 "..\..\Areas\Config\Views\DeviceProfile\_Table.cshtml"
Write(deviceProfilesGroup.Key);
#line default
#line hidden
WriteLiteral("</h2> ");
#line 8 "..\..\Areas\Config\Views\DeviceProfile\_Table.cshtml"
}
#line default
#line hidden
#line 9 "..\..\Areas\Config\Views\DeviceProfile\_Table.cshtml"
Write(Html.Partial(MVC.Config.DeviceProfile.Views._TableRender, deviceProfilesGroup, new ViewDataDictionary()));
#line default
#line hidden
#line 9 "..\..\Areas\Config\Views\DeviceProfile\_Table.cshtml"
}
}
else
{
#line default
#line hidden
#line 14 "..\..\Areas\Config\Views\DeviceProfile\_Table.cshtml"
Write(Html.Partial(MVC.Config.DeviceProfile.Views._TableRender, Model.DeviceProfiles, new ViewDataDictionary()));
#line default
#line hidden
#line 14 "..\..\Areas\Config\Views\DeviceProfile\_Table.cshtml"
}
#line default
#line hidden
}
}
}
#pragma warning restore 1591
@@ -0,0 +1,39 @@
@model IEnumerable<Disco.Web.Areas.Config.Models.DeviceProfile._IndexModelDeviceProfile>
<table class="tableData deviceProfileTable">
<tr>
<th class="name">
Name
</th>
<th class="description">
Description
</th>
<th class="type">
Type
</th>
<th class="deviceCount">
Device Count
</th>
</tr>
@foreach (var item in Model)
{
<tr>
<td>
@Html.ActionLink(item.Name, MVC.Config.DeviceProfile.Index(item.Id))
</td>
<td>
@Html.DisplayFor(modelItem => item.Description)
</td>
<td>
@Html.DisplayFor(modelItem => item.DistributionType)
</td>
<td>
@item.DeviceCount.ToString("n0")
@if (item.DeviceDecommissionedCount > 0)
{
<span class="smallMessage" title="@(item.DeviceDecommissionedCount) Decommissioned">
(@(item.DeviceDecommissionedCount))</span>
}
</td>
</tr>
}
</table>
@@ -0,0 +1,186 @@
#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.DeviceProfile
{
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/DeviceProfile/_TableRender.cshtml")]
public class TableRender : System.Web.Mvc.WebViewPage<IEnumerable<Disco.Web.Areas.Config.Models.DeviceProfile._IndexModelDeviceProfile>>
{
public TableRender()
{
}
public override void Execute()
{
WriteLiteral("<table");
WriteLiteral(" class=\"tableData deviceProfileTable\"");
WriteLiteral(">\r\n <tr>\r\n <th");
WriteLiteral(" class=\"name\"");
WriteLiteral(">\r\n Name\r\n </th>\r\n <th");
WriteLiteral(" class=\"description\"");
WriteLiteral(">\r\n Description\r\n </th>\r\n <th");
WriteLiteral(" class=\"type\"");
WriteLiteral(">\r\n Type\r\n </th>\r\n <th");
WriteLiteral(" class=\"deviceCount\"");
WriteLiteral(">\r\n Device Count\r\n </th>\r\n </tr>\r\n");
#line 17 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
#line default
#line hidden
#line 17 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
foreach (var item in Model)
{
#line default
#line hidden
WriteLiteral(" <tr>\r\n <td>\r\n");
WriteLiteral(" ");
#line 21 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
Write(Html.ActionLink(item.Name, MVC.Config.DeviceProfile.Index(item.Id)));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n <td>\r\n");
WriteLiteral(" ");
#line 24 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
Write(Html.DisplayFor(modelItem => item.Description));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n <td>\r\n");
WriteLiteral(" ");
#line 27 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
Write(Html.DisplayFor(modelItem => item.DistributionType));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n <td>\r\n");
WriteLiteral(" ");
#line 30 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
Write(item.DeviceCount.ToString("n0"));
#line default
#line hidden
WriteLiteral("\r\n");
#line 31 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
#line default
#line hidden
#line 31 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
if (item.DeviceDecommissionedCount > 0)
{
#line default
#line hidden
WriteLiteral(" <span");
WriteLiteral(" class=\"smallMessage\"");
WriteAttribute("title", Tuple.Create(" title=\"", 1005), Tuple.Create("\"", 1061)
#line 33 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
, Tuple.Create(Tuple.Create("", 1013), Tuple.Create<System.Object, System.Int32>(item.DeviceDecommissionedCount
#line default
#line hidden
, 1013), false)
, Tuple.Create(Tuple.Create(" ", 1046), Tuple.Create("Decommissioned", 1047), true)
);
WriteLiteral(">\r\n (");
#line 34 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
Write(item.DeviceDecommissionedCount);
#line default
#line hidden
WriteLiteral(")</span>\r\n");
#line 35 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n");
#line 38 "..\..\Areas\Config\Views\DeviceProfile\_TableRender.cshtml"
}
#line default
#line hidden
WriteLiteral("</table>\r\n");
}
}
}
#pragma warning restore 1591