27c21175d7
Migrate much of BI to Services. Added Wireless Profile Provider plugin feature. Added Certificate Authority Provider plugin feature. Modified Certificate Provider plugin feature. Database migration v17, for Device Profiles. Enrolment Client Updated to support CA Certificates, Wireless Profiles and Hardware Info. New Client Enrolment Protocol to support new features. Plugin Manifest Generator added to main solution. Improved AD search performance.
821 lines
40 KiB
Plaintext
821 lines
40 KiB
Plaintext
@model Disco.Web.Areas.Config.Models.DeviceProfile.ShowModel
|
|
@using Disco.Services.Devices.ManagedGroups;
|
|
@using Disco.Web.Areas.Config.Models.Shared;
|
|
@{
|
|
Authorization.Require(Claims.Config.DeviceProfile.Show);
|
|
|
|
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Profiles", MVC.Config.DeviceProfile.Index(null), Model.DeviceProfile.ToString());
|
|
|
|
var canConfig = Authorization.Has(Claims.Config.DeviceProfile.Configure);
|
|
var canConfigExpression = Authorization.Has(Claims.Config.DeviceProfile.ConfigureComputerNameTemplate);
|
|
var canDelete = (Authorization.Has(Claims.Config.DeviceProfile.Delete) && Model.CanDelete);
|
|
var canViewPlugins = Authorization.Has(Claims.Config.Plugin.Install);
|
|
|
|
var hideAdvanced =
|
|
Model.DeviceProfile.AssignedUsersLinkedGroup == null &&
|
|
Model.DeviceProfile.DevicesLinkedGroup == null;
|
|
|
|
if (canConfig)
|
|
{
|
|
Html.BundleDeferred("~/Style/Fancytree");
|
|
Html.BundleDeferred("~/ClientScripts/Modules/jQuery-Fancytree");
|
|
Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
|
|
}
|
|
}
|
|
<div id="configurationDeviceProfileShow" class="form@(hideAdvanced ? " Config_HideAdvanced" : null)" style="width: 640px">
|
|
<table>
|
|
<tr>
|
|
<th style="width: 170px;">
|
|
Id:
|
|
</th>
|
|
<td>
|
|
@Html.DisplayFor(model => model.DeviceProfile.Id)
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th>
|
|
Name:
|
|
</th>
|
|
<td>
|
|
@if (canConfig)
|
|
{
|
|
@Html.TextBoxFor(model => model.DeviceProfile.Name)
|
|
@AjaxHelpers.AjaxSave()
|
|
@AjaxHelpers.AjaxLoader()
|
|
<script type="text/javascript">
|
|
$(function () {
|
|
document.DiscoFunctions.PropertyChangeHelper(
|
|
$('#DeviceProfile_Name'),
|
|
'Name',
|
|
'@Url.Action(MVC.API.DeviceProfile.UpdateName(Model.DeviceProfile.Id))',
|
|
'ProfileName'
|
|
);
|
|
});
|
|
</script>
|
|
}
|
|
else
|
|
{
|
|
@Model.DeviceProfile.Name
|
|
}
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th>
|
|
Short Name:
|
|
</th>
|
|
<td>
|
|
@if (canConfig)
|
|
{
|
|
@Html.TextBoxFor(model => model.DeviceProfile.ShortName)
|
|
@AjaxHelpers.AjaxSave()
|
|
@AjaxHelpers.AjaxLoader()
|
|
<script type="text/javascript">
|
|
$(function () {
|
|
document.DiscoFunctions.PropertyChangeHelper(
|
|
$('#DeviceProfile_ShortName'),
|
|
'Short Name',
|
|
'@Url.Action(MVC.API.DeviceProfile.UpdateShortName(Model.DeviceProfile.Id))',
|
|
'ShortName'
|
|
);
|
|
});
|
|
</script>
|
|
}
|
|
else
|
|
{
|
|
@Model.DeviceProfile.ShortName
|
|
}
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th>
|
|
Description:
|
|
</th>
|
|
<td>
|
|
@if (canConfig)
|
|
{
|
|
@Html.EditorFor(model => model.DeviceProfile.Description)
|
|
@AjaxHelpers.AjaxSave()
|
|
@AjaxHelpers.AjaxLoader()
|
|
<script type="text/javascript">
|
|
$(function () {
|
|
document.DiscoFunctions.PropertyChangeHelper(
|
|
$('#DeviceProfile_Description'),
|
|
'Description',
|
|
'@Url.Action(MVC.API.DeviceProfile.UpdateDescription(Model.DeviceProfile.Id))',
|
|
'Description'
|
|
);
|
|
});
|
|
</script>
|
|
}
|
|
else
|
|
{
|
|
@Model.DeviceProfile.Description
|
|
}
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Members</th>
|
|
<td>
|
|
<div><strong>@Model.DeviceCount.ToString("n0")</strong> @(Model.DeviceCount == 1 ? "devices is a member" : "devices are members") of this profile.</div>
|
|
@if (Model.DeviceDecommissionedCount > 0)
|
|
{
|
|
<div class="smallMessage">@Model.DeviceDecommissionedCount.ToString("n0") @(Model.DeviceDecommissionedCount == 1 ? "device is" : "devices are") decommissioned.</div>
|
|
}
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th>
|
|
Distribution Type:
|
|
</th>
|
|
<td>
|
|
@if (canConfig)
|
|
{
|
|
@Html.DropDownList("DeviceProfile_DistributionType", Model.DeviceProfileDistributionTypes)
|
|
@AjaxHelpers.AjaxLoader()
|
|
<script type="text/javascript">
|
|
$(function () {
|
|
document.DiscoFunctions.PropertyChangeHelper(
|
|
$('#DeviceProfile_DistributionType'),
|
|
null,
|
|
'@Url.Action(MVC.API.DeviceProfile.UpdateDistributionType(Model.DeviceProfile.Id))',
|
|
'DistributionType'
|
|
);
|
|
});
|
|
</script>
|
|
}
|
|
else
|
|
{
|
|
@Model.DeviceProfile.DistributionType.ToString()
|
|
}
|
|
<div class="info-box">
|
|
<p class="fa-p">
|
|
<i class="fa fa-info-circle"></i>One-to-many devices are typically shared.
|
|
One-to-one devices are typically assigned to a user;
|
|
enrolment with a one-to-one device isn't considered complete until it is assigned.
|
|
</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th>
|
|
Address:
|
|
</th>
|
|
<td>
|
|
@if (canConfig)
|
|
{
|
|
@Html.DropDownListFor(m => m.DeviceProfile.DefaultOrganisationAddress, Model.OrganisationAddresses.ToSelectListItems(Model.DeviceProfile.DefaultOrganisationAddress, true, "None"))
|
|
@AjaxHelpers.AjaxLoader()
|
|
<script type="text/javascript">
|
|
$(function () {
|
|
document.DiscoFunctions.PropertyChangeHelper(
|
|
$('#DeviceProfile_DefaultOrganisationAddress'),
|
|
null,
|
|
'@Url.Action(MVC.API.DeviceProfile.UpdateDefaultOrganisationAddress(Model.DeviceProfile.Id))',
|
|
'DefaultOrganisationAddress'
|
|
);
|
|
});
|
|
</script>
|
|
}
|
|
else
|
|
{
|
|
if (Model.DefaultOrganisationAddress == null)
|
|
{
|
|
<span class="smallMessage"><None Specified></span>
|
|
}
|
|
else
|
|
{
|
|
@Model.DefaultOrganisationAddress.ToString()
|
|
}
|
|
}
|
|
<div class="info-box">
|
|
<p class="fa-p">
|
|
<i class="fa fa-info-circle"></i>The profile address is used to separate jobs for <a href="@Url.Action(MVC.Config.Organisation.Index())">multi-site mode</a>.
|
|
It is also suggested as the default address for warranty/repair actions.
|
|
</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Policies</th>
|
|
<td>
|
|
<div>
|
|
@if (canConfig)
|
|
{
|
|
<input id="DeviceProfile_ProvisionADAccount" type="checkbox" @(Model.DeviceProfile.ProvisionADAccount ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty)) />
|
|
<script type="text/javascript">
|
|
$(function () {
|
|
document.DiscoFunctions.PropertyChangeHelper(
|
|
$('#DeviceProfile_ProvisionADAccount'),
|
|
null,
|
|
'@Url.Action(MVC.API.DeviceProfile.UpdateProvisionADAccount(Model.DeviceProfile.Id))',
|
|
'ProvisionADAccount'
|
|
);
|
|
});
|
|
</script>
|
|
}
|
|
else
|
|
{
|
|
<input id="DeviceProfile_ProvisionADAccount" type="checkbox" @(Model.DeviceProfile.ProvisionADAccount ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty)) disabled="disabled" />
|
|
}
|
|
<label for="DeviceProfile_ProvisionADAccount">
|
|
Provision Active Directory Account
|
|
</label>
|
|
@AjaxHelpers.AjaxLoader()
|
|
<div class="info-box">
|
|
<p class="fa-p">
|
|
<i class="fa fa-info-circle"></i>When enabled an Active Directory account will be provisioned for the device when enrolment occurs
|
|
and the device will be joined to the domain (refer to the <code>Computer Name Template Expression</code> and the
|
|
<code>Organisational Unit</code> configuration options below).
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<div style="margin-top: 8px;">
|
|
@if (canConfig)
|
|
{
|
|
<input id="DeviceProfile_AssignedUserLocalAdmin" type="checkbox" @(Model.DeviceProfile.AssignedUserLocalAdmin ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty)) />
|
|
<script type="text/javascript">
|
|
$(function () {
|
|
document.DiscoFunctions.PropertyChangeHelper(
|
|
$('#DeviceProfile_AssignedUserLocalAdmin'),
|
|
null,
|
|
'@Url.Action(MVC.API.DeviceProfile.UpdateAssignedUserLocalAdmin(Model.DeviceProfile.Id))',
|
|
'AssignedUserLocalAdmin'
|
|
);
|
|
});
|
|
</script>
|
|
}
|
|
else
|
|
{
|
|
<input id="DeviceProfile_AssignedUserLocalAdmin" type="checkbox" @(Model.DeviceProfile.AssignedUserLocalAdmin ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty)) disabled="disabled" />
|
|
}
|
|
<label for="DeviceProfile_AssignedUserLocalAdmin">
|
|
Assigned User is Local Administrator
|
|
</label>
|
|
@AjaxHelpers.AjaxLoader()
|
|
<div class="info-box">
|
|
<p class="fa-p">
|
|
<i class="fa fa-info-circle"></i>When enabled the user assigned to the device will be added to the <code>Local Administrators</code> group during device enrolment.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<div style="margin-top: 8px;">
|
|
@if (canConfig)
|
|
{
|
|
<input id="DeviceProfile_AllowUntrustedReimageJobEnrolment" type="checkbox" @(Model.DeviceProfile.AllowUntrustedReimageJobEnrolment ? new MvcHtmlString("checked=\"checked\" ") : null) />
|
|
<script type="text/javascript">
|
|
$(function () {
|
|
document.DiscoFunctions.PropertyChangeHelper(
|
|
$('#DeviceProfile_AllowUntrustedReimageJobEnrolment'),
|
|
null,
|
|
'@Url.Action(MVC.API.DeviceProfile.UpdateAllowUntrustedReimageJobEnrolment(Model.DeviceProfile.Id))',
|
|
'AllowUntrustedReimageJobEnrolment'
|
|
);
|
|
});
|
|
</script>
|
|
}
|
|
else
|
|
{
|
|
<input id="DeviceProfile_AllowUntrustedReimageJobEnrolment" type="checkbox" @(Model.DeviceProfile.AllowUntrustedReimageJobEnrolment ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty)) disabled="disabled" />
|
|
}
|
|
<label for="DeviceProfile_AllowUntrustedReimageJobEnrolment">
|
|
Allow Untrusted Enrolment Where a <span class="code">'Software - Reimage'</span> Job is Open
|
|
</label>
|
|
@AjaxHelpers.AjaxLoader()
|
|
<div class="info-box">
|
|
<p class="fa-p">
|
|
<i class="fa fa-info-circle"></i>When enabled an untrusted device enrolment will be allowed if a <code>Software - Reimage</code> job is open for the device.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th>
|
|
Computer Name<br />
|
|
Template Expression:
|
|
</th>
|
|
<td>
|
|
@if (canConfig && canConfigExpression)
|
|
{
|
|
@Html.EditorFor(model => model.DeviceProfile.ComputerNameTemplate)
|
|
@AjaxHelpers.AjaxSave()
|
|
@AjaxHelpers.AjaxLoader()
|
|
<a id="expressionBrowserAnchor" href="@(Url.Action(MVC.Config.DocumentTemplate.ExpressionBrowser()))"> </a>
|
|
<script type="text/javascript">
|
|
$(function () {
|
|
var field = $('#DeviceProfile_ComputerNameTemplate');
|
|
var fieldOriginalWidth, fieldOriginalHeight;
|
|
|
|
document.DiscoFunctions.PropertyChangeHelper(
|
|
field,
|
|
'None',
|
|
'@Url.Action(MVC.API.DeviceProfile.UpdateComputerNameTemplate(Model.DeviceProfile.Id))',
|
|
'ComputerNameTemplate'
|
|
);
|
|
|
|
field.focus(function () {
|
|
fieldOriginalWidth = field.width();
|
|
fieldOriginalHeight = field.height();
|
|
field.css('overflow', 'visible').animate({ width: field.parent().width() - 52, height: 75 }, 200);
|
|
}).blur(function () {
|
|
field.css('overflow', 'hidden').animate({ width: fieldOriginalWidth, height: fieldOriginalHeight }, 200);
|
|
}).attr('placeholder', 'None').attr('spellcheck', 'false');
|
|
});
|
|
</script>
|
|
}
|
|
else
|
|
{
|
|
<div id="displayComputerNameTemplate" class="code">
|
|
@if (string.IsNullOrWhiteSpace(Model.DeviceProfile.ComputerNameTemplate))
|
|
{
|
|
<span class="smallMessage"><None Specified></span>
|
|
}
|
|
else
|
|
{
|
|
@Model.DeviceProfile.ComputerNameTemplate
|
|
}
|
|
</div>
|
|
}
|
|
<div style="margin-top: 8px;">
|
|
@if (canConfig)
|
|
{
|
|
<input id="DeviceProfile_EnforceComputerNameConvention" type="checkbox" @(Model.DeviceProfile.EnforceComputerNameConvention ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty)) />
|
|
<script type="text/javascript">
|
|
$(function () {
|
|
document.DiscoFunctions.PropertyChangeHelper(
|
|
$('#DeviceProfile_EnforceComputerNameConvention'),
|
|
null,
|
|
'@Url.Action(MVC.API.DeviceProfile.UpdateEnforceComputerNameConvention(Model.DeviceProfile.Id))',
|
|
'EnforceComputerNameConvention'
|
|
);
|
|
});
|
|
</script>
|
|
}
|
|
else
|
|
{
|
|
<input id="DeviceProfile_EnforceComputerNameConvention" type="checkbox" @(Model.DeviceProfile.EnforceComputerNameConvention ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty)) disabled="disabled" />
|
|
}
|
|
<label for="DeviceProfile_EnforceComputerNameConvention">
|
|
Enforce Naming Convention
|
|
</label>
|
|
@AjaxHelpers.AjaxLoader()
|
|
</div>
|
|
<div class="info-box">
|
|
<p class="fa-p">
|
|
<i class="fa fa-info-circle"></i>Computer names are only changed when Active Directory accounts are provisioned.
|
|
If the device has already joined the domain when enrolment occurs the name will remain the same unless Enforce Naming Convention is enabled.
|
|
</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th>
|
|
Organisational Unit:
|
|
</th>
|
|
<td>
|
|
@if (canConfig)
|
|
{
|
|
<div id="DeviceProfile_OrganisationalUnit" class="code" data-value="@Model.DeviceProfile.OrganisationalUnit">
|
|
<span>
|
|
@Model.FriendlyOrganisationalUnitName
|
|
</span>
|
|
</div>
|
|
<a id="changeOrganisationalUnit" href="#" class="button small">Change</a>@AjaxHelpers.AjaxLoader()
|
|
<div id="dialogOrganisationalUnit" title="Organisational Unit" class="dialog">
|
|
<div id="dialogOrganisationalUnit_Loading">
|
|
@AjaxHelpers.AjaxLoader() Loading Organisational Units
|
|
</div>
|
|
<div id="treeOrganisationalUnit" class="organisationalUnitTree">
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
$(function () {
|
|
var ouSetUrl = '@Url.Action(MVC.API.DeviceProfile.UpdateOrganisationalUnit(Model.DeviceProfile.Id, null, true))';
|
|
var ouValue = $('#DeviceProfile_OrganisationalUnit').attr('data-value');
|
|
var $ouTree = null;
|
|
var ouTree = null;
|
|
var $dialog = null;
|
|
var ouSet = function (ou) {
|
|
var url = ouSetUrl + '&' + $.param({ OrganisationalUnit: ou })
|
|
window.location.href = url;
|
|
}
|
|
var expandNodeTree = function (node) {
|
|
var parent = node.parent;
|
|
if (parent) {
|
|
expandNodeTree(parent);
|
|
parent.setExpanded(true, { noAnimation: true, noEvents: false });
|
|
}
|
|
}
|
|
var expandAndFocusNode = function (nodeKey) {
|
|
if (ouTree) {
|
|
var ouNode = ouTree.getNodeByKey(ouValue);
|
|
if (ouNode) {
|
|
expandNodeTree(ouNode);
|
|
ouNode.setFocus(true);
|
|
ouNode.setActive(true);
|
|
|
|
var li = ouNode.li;
|
|
var liOffset = li.offsetParent;
|
|
if (li.offsetTop + li.offsetHeight > liOffset.offsetHeight)
|
|
$(liOffset).animate({ 'scrollTop': li.offsetTop - liOffset.offsetHeight + li.offsetHeight + 4 }, 'fast');
|
|
}
|
|
}
|
|
}
|
|
var ouChange = function () {
|
|
if (!$dialog) {
|
|
|
|
$dialog = $('#dialogOrganisationalUnit').dialog({
|
|
autoOpen: false,
|
|
buttons: null,
|
|
draggable: false,
|
|
modal: true,
|
|
resizable: false,
|
|
width: 500,
|
|
height: 500
|
|
});
|
|
$loading = $('#dialogOrganisationalUnit_Loading');
|
|
$loading.find('i.ajaxLoading').show();
|
|
|
|
$ouTree = $('#treeOrganisationalUnit');
|
|
$dialog.css('overflow', 'visible');
|
|
$ouTree.css('height', '100%');
|
|
|
|
$.getJSON('@(Url.Action(MVC.API.System.DomainOrganisationalUnits()))', null, function (data) {
|
|
$loading.hide();
|
|
|
|
// Make 'Domains' unselectable
|
|
$.each(data, function (i, node) {
|
|
node.unselectable = true;
|
|
});
|
|
|
|
ouTree = $ouTree.fancytree({
|
|
source: data,
|
|
checkbox: false,
|
|
selectMode: 1,
|
|
keyboard: false,
|
|
fx: null
|
|
}).fancytree('getTree');
|
|
|
|
ouTree.$container.css('position', 'relative');
|
|
|
|
// Set Buttons
|
|
$dialog.dialog('option', 'buttons', {
|
|
'Use Default Container': function () {
|
|
var $this = $(this);
|
|
$this.css('overflow', 'hidden');
|
|
$this.dialog("disable");
|
|
$this.dialog("option", "buttons", null);
|
|
ouSet('');
|
|
},
|
|
'Save': function () {
|
|
var node = ouTree.getActiveNode();
|
|
if (node && node.key.substr(0, 3).toLowerCase() == 'ou=') {
|
|
var $this = $(this);
|
|
$this.css('overflow', 'hidden');
|
|
$this.dialog("disable");
|
|
$this.dialog("option", "buttons", null);
|
|
ouSet(node.key);
|
|
} else {
|
|
alert('Select an Organisational Unit to Save')
|
|
}
|
|
}
|
|
});
|
|
|
|
// Expand
|
|
expandAndFocusNode(ouValue);
|
|
|
|
ouTree.options.fx = { height: "toggle", duration: 200 };
|
|
});
|
|
}
|
|
$dialog.dialog('open');
|
|
|
|
if (ouTree) {
|
|
// Expand
|
|
expandAndFocusNode(ouValue);
|
|
}
|
|
|
|
return false;
|
|
};
|
|
|
|
$('#changeOrganisationalUnit').click(ouChange);
|
|
});
|
|
</script>
|
|
}
|
|
else
|
|
{
|
|
<div id="displayOrganisationalUnit" class="code">
|
|
<span>
|
|
@Model.FriendlyOrganisationalUnitName
|
|
</span>
|
|
</div>
|
|
}
|
|
<div style="margin-top: 8px;">
|
|
@if (canConfig)
|
|
{
|
|
<input id="DeviceProfile_EnforceOrganisationalUnit" type="checkbox" @(Model.DeviceProfile.EnforceOrganisationalUnit ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty)) />
|
|
<script type="text/javascript">
|
|
$(function () {
|
|
document.DiscoFunctions.PropertyChangeHelper(
|
|
$('#DeviceProfile_EnforceOrganisationalUnit'),
|
|
null,
|
|
'@Url.Action(MVC.API.DeviceProfile.UpdateEnforceOrganisationalUnit(Model.DeviceProfile.Id))',
|
|
'EnforceOrganisationalUnit'
|
|
);
|
|
});
|
|
</script>
|
|
}
|
|
else
|
|
{
|
|
<input id="DeviceProfile_EnforceOrganisationalUnit" type="checkbox" @(Model.DeviceProfile.EnforceOrganisationalUnit ? new MvcHtmlString("checked=\"checked\" ") : new MvcHtmlString(string.Empty)) disabled="disabled" />
|
|
}
|
|
<label for="DeviceProfile_EnforceOrganisationalUnit">
|
|
Enforce Organisational Unit
|
|
</label>
|
|
@AjaxHelpers.AjaxLoader()
|
|
</div>
|
|
<div class="info-box">
|
|
<p class="fa-p">
|
|
<i class="fa fa-info-circle"></i>When an Active Directory account is provisioned it will be placed in this container. This typically occurs
|
|
at device enrolment. If the device has already joined the domain and the <code>Enforce Organisational Unit</code> option is enabled
|
|
the Active Directory account will be moved into this organisational unit during enrolment.
|
|
</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th>
|
|
Provision Certificates:
|
|
@if (canConfig && (Model.CertificateProviders.Count > 0 || Model.CertificateAuthorityProviders.Count > 0))
|
|
{
|
|
<br />
|
|
@AjaxHelpers.AjaxLoader("DeviceProfile_CertificateProviders")
|
|
}
|
|
@if (canConfig && Model.CertificateProviders.Count > 0)
|
|
{
|
|
<script type="text/javascript">
|
|
$(function () {
|
|
var $container = $('#DeviceProfile_CertificateProviders');
|
|
|
|
$container.on('change', 'input', function () {
|
|
var $ajaxLoading = $('#DeviceProfile_CertificateProviders_loading').show();
|
|
|
|
var data = {
|
|
CertificateProviders: $('input:checked', $container).map(function () { return $(this).val() }).get().join(',')
|
|
};
|
|
$.getJSON('@(Url.Action(MVC.API.DeviceProfile.UpdateCertificateProviders(Model.DeviceProfile.Id)))', data, function (response, result) {
|
|
if (result != 'success' || response != 'OK') {
|
|
alert('Unable to change property "CertificateProviders":\n' + response);
|
|
$ajaxLoading.hide();
|
|
} else {
|
|
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
|
}
|
|
})
|
|
})
|
|
});
|
|
</script>
|
|
}
|
|
@if (canConfig && Model.CertificateProviders.Count > 0)
|
|
{
|
|
<script type="text/javascript">
|
|
$(function () {
|
|
var $container = $('#DeviceProfile_CertificateAuthorityProviders');
|
|
|
|
$container.on('change', 'input', function () {
|
|
var $ajaxLoading = $('#DeviceProfile_CertificateProviders_loading').show();
|
|
|
|
var data = {
|
|
CertificateAuthorityProviders: $('input:checked', $container).map(function () { return $(this).val() }).get().join(',')
|
|
};
|
|
$.getJSON('@(Url.Action(MVC.API.DeviceProfile.UpdateCertificateAuthorityProviders(Model.DeviceProfile.Id)))', data, function (response, result) {
|
|
if (result != 'success' || response != 'OK') {
|
|
alert('Unable to change property "CertificateAuthorityProviders":\n' + response);
|
|
$ajaxLoading.hide();
|
|
} else {
|
|
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
|
}
|
|
})
|
|
})
|
|
});
|
|
</script>
|
|
}
|
|
</th>
|
|
<td>
|
|
<h4>Device/Machine Certificates</h4>
|
|
@if (canConfig && Model.CertificateProviders.Count > 0)
|
|
{
|
|
@CommonHelpers.CheckBoxList("DeviceProfile_CertificateProviders", "DeviceProfile_CertificateProviders", Model.CertificateProviders.ToSelectListItems(Model.DeviceProfile.GetCertificateProviders()))
|
|
}
|
|
else
|
|
{
|
|
var certificateProviders = Model.DeviceProfile.GetCertificateProviders().ToList();
|
|
|
|
if (certificateProviders.Count == 0)
|
|
{
|
|
<span class="smallMessage"><None Allocated></span>
|
|
}
|
|
else
|
|
{
|
|
<ul>
|
|
@foreach (var certificateProvider in certificateProviders)
|
|
{
|
|
<li>@certificateProvider.Name</li>
|
|
}
|
|
</ul>
|
|
}
|
|
}
|
|
<h4 style="margin-top: 4px;">Authority Certificates</h4>
|
|
@if (canConfig && Model.CertificateAuthorityProviders.Count > 0)
|
|
{
|
|
@CommonHelpers.CheckBoxList("DeviceProfile_CertificateAuthorityProviders", "DeviceProfile_CertificateAuthorityProviders", Model.CertificateAuthorityProviders.ToSelectListItems(Model.DeviceProfile.GetCertificateAuthorityProviders()))
|
|
}
|
|
else
|
|
{
|
|
var certificateProviders = Model.DeviceProfile.GetCertificateAuthorityProviders().ToList();
|
|
|
|
if (certificateProviders.Count == 0)
|
|
{
|
|
<span class="smallMessage"><None Allocated></span>
|
|
}
|
|
else
|
|
{
|
|
<ul>
|
|
@foreach (var certificateProvider in certificateProviders)
|
|
{
|
|
<li>@certificateProvider.Name</li>
|
|
}
|
|
</ul>
|
|
}
|
|
}
|
|
@if (canViewPlugins)
|
|
{
|
|
<div class="info-box">
|
|
<p class="fa-p">
|
|
<i class="fa fa-info-circle"></i>View the <a href="@(Url.Action(MVC.Config.Plugins.Install()))">Plugin Catalogue</a> to discover and install certificate provider plugins.
|
|
</p>
|
|
</div>
|
|
}
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th>
|
|
Provision Wireless Profiles:
|
|
@if (canConfig && Model.WirelessProfileProviders.Count > 0)
|
|
{
|
|
<br />
|
|
@AjaxHelpers.AjaxLoader("DeviceProfile_WirelessProfileProviders")
|
|
<script type="text/javascript">
|
|
$(function () {
|
|
var $container = $('#DeviceProfile_WirelessProfileProviders');
|
|
|
|
$container.on('change', 'input', function () {
|
|
var $ajaxLoading = $('#DeviceProfile_WirelessProfileProviders_loading').show();
|
|
|
|
var data = {
|
|
WirelessProfileProviders: $('input:checked', $container).map(function () { return $(this).val() }).get().join(',')
|
|
};
|
|
$.getJSON('@(Url.Action(MVC.API.DeviceProfile.UpdateWirelessProfileProviders(Model.DeviceProfile.Id)))', data, function (response, result) {
|
|
if (result != 'success' || response != 'OK') {
|
|
alert('Unable to change property "WirelessProfileProviders":\n' + response);
|
|
$ajaxLoading.hide();
|
|
} else {
|
|
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
|
}
|
|
})
|
|
})
|
|
});
|
|
</script>
|
|
}
|
|
</th>
|
|
<td>
|
|
@if (canConfig && Model.WirelessProfileProviders.Count > 0)
|
|
{
|
|
@CommonHelpers.CheckBoxList("DeviceProfile_WirelessProfileProviders", "DeviceProfile_WirelessProfileProviders", Model.WirelessProfileProviders.ToSelectListItems(Model.DeviceProfile.GetWirelessProfileProviders()))
|
|
}
|
|
else
|
|
{
|
|
var wirelessProfileProviders = Model.DeviceProfile.GetWirelessProfileProviders().ToList();
|
|
|
|
if (wirelessProfileProviders.Count == 0)
|
|
{
|
|
<span class="smallMessage"><None Allocated></span>
|
|
}
|
|
else
|
|
{
|
|
<ul>
|
|
@foreach (var wirelessProfileProvider in wirelessProfileProviders)
|
|
{
|
|
<li>@wirelessProfileProvider.Name</li>
|
|
}
|
|
</ul>
|
|
}
|
|
}
|
|
@if (canViewPlugins)
|
|
{
|
|
<div class="info-box">
|
|
<p class="fa-p">
|
|
<i class="fa fa-info-circle"></i>View the <a href="@(Url.Action(MVC.Config.Plugins.Install()))">Plugin Catalogue</a> to discover and install wireless profile provider plugins.
|
|
</p>
|
|
</div>
|
|
}
|
|
</td>
|
|
</tr>
|
|
@if (hideAdvanced)
|
|
{
|
|
<tr>
|
|
<td colspan="2" style="text-align: right;">
|
|
<button id="Config_HideAdvanced_Show" class="button small">Show Advanced Options</button>
|
|
<script>
|
|
$(function () {
|
|
$('#Config_HideAdvanced_Show').click(function () {
|
|
var $this = $(this);
|
|
$this.closest('.Config_HideAdvanced').removeClass('Config_HideAdvanced');
|
|
$this.closest('tr').remove();
|
|
});
|
|
});
|
|
</script>
|
|
</td>
|
|
</tr>
|
|
}
|
|
<tr class="Config_HideAdvanced_Item">
|
|
<th>
|
|
Linked Groups:
|
|
</th>
|
|
<td>
|
|
<div>
|
|
@Html.Partial(MVC.Config.Shared.Views.LinkedGroupInstance, new LinkedGroupModel()
|
|
{
|
|
CanConfigure = canConfig,
|
|
CategoryDescription = DeviceProfileDevicesManagedGroup.GetCategoryDescription(Model.DeviceProfile),
|
|
Description = DeviceProfileDevicesManagedGroup.GetDescription(Model.DeviceProfile),
|
|
ManagedGroup = Model.DevicesLinkedGroup,
|
|
UpdateUrl = Url.Action(MVC.API.DeviceProfile.UpdateDevicesLinkedGroup(Model.DeviceProfile.Id, redirect: true))
|
|
})
|
|
@Html.Partial(MVC.Config.Shared.Views.LinkedGroupInstance, new LinkedGroupModel()
|
|
{
|
|
CanConfigure = canConfig,
|
|
CategoryDescription = DeviceProfileAssignedUsersManagedGroup.GetCategoryDescription(Model.DeviceProfile),
|
|
Description = DeviceProfileAssignedUsersManagedGroup.GetDescription(Model.DeviceProfile),
|
|
ManagedGroup = Model.AssignedUsersLinkedGroup,
|
|
UpdateUrl = Url.Action(MVC.API.DeviceProfile.UpdateAssignedUsersLinkedGroup(Model.DeviceProfile.Id, redirect: true))
|
|
})
|
|
@if (canConfig)
|
|
{
|
|
@Html.Partial(MVC.Config.Shared.Views.LinkedGroupShared)
|
|
}
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
@if (canDelete)
|
|
{
|
|
<div id="dialogConfirmDelete" title="Delete this Device Profile?">
|
|
<p>
|
|
<i class="fa fa-exclamation-triangle fa-lg warning"></i>
|
|
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 (canDelete)
|
|
{
|
|
@Html.ActionLinkButton("Delete", MVC.API.DeviceProfile.Delete(Model.DeviceProfile.Id, true), "buttonDelete")
|
|
}
|
|
@if (Authorization.Has(Claims.Device.Actions.Export))
|
|
{
|
|
@Html.ActionLinkButton("Export Devices", MVC.Device.Export(null, Disco.Models.Services.Devices.Exporting.DeviceExportTypes.Profile, Model.DeviceProfile.Id))
|
|
}
|
|
@if (Authorization.Has(Claims.Device.Search) && Model.DeviceCount > 0)
|
|
{
|
|
@Html.ActionLinkButton(string.Format("View {0} Device{1}", Model.DeviceCount, (Model.DeviceCount != 1 ? "s" : null)), MVC.Search.Query(Model.DeviceProfile.Id.ToString(), "DeviceProfile"))
|
|
}
|
|
</div>
|