@model Disco.Web.Models.Device.ShowModel @using Disco.Services.Users.UserFlags; @{ Authorization.Require(Claims.Device.Show); Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers"); }
Name: @if (string.IsNullOrWhiteSpace(Model.Device.ComputerName)) { <Unknown/None> } else {

@Model.Device.ComputerName

}
Domain: @if (string.IsNullOrWhiteSpace(Model.Device.ComputerDomainName)) { <None> } else {

@Model.Device.ComputerDomainName

}
Asset: @if (Authorization.Has(Claims.Device.Properties.AssetNumber)) { @Html.TextBoxFor(m => m.Device.AssetNumber, new { @class = "small discreet" }) @AjaxHelpers.AjaxSave() @AjaxHelpers.AjaxLoader() } else { @(Model.Device.AssetNumber ?? "Unknown") }
Location: @if (Authorization.Has(Claims.Device.Properties.Location)) { @Html.TextBoxFor(m => m.Device.Location, new { @class = "small discreet" }) @AjaxHelpers.AjaxSave() @AjaxHelpers.AjaxLoader() } else { @(Model.Device.Location ?? "Unknown") }
@if (Authorization.HasAny(Claims.Device.Properties.AssetNumber, Claims.Device.Properties.Location)) { }
@if (Model.Device.DecommissionedDate.HasValue) { }
Created: @CommonHelpers.FriendlyDate(Model.Device.CreatedDate)
Decommissioned: @CommonHelpers.FriendlyDate(Model.Device.DecommissionedDate)
Enrolled: @if (Model.Device.EnrolledDate.HasValue) { First: @CommonHelpers.FriendlyDate(Model.Device.EnrolledDate) if (Model.Device.LastEnrolDate.HasValue && Model.Device.EnrolledDate.Value != Model.Device.LastEnrolDate.Value) {
Last: @CommonHelpers.FriendlyDate(Model.Device.LastEnrolDate) } } else { Never } @if (Model.Device.AllowUnauthenticatedEnrol) { }
@if (!string.IsNullOrEmpty(Model.Device.ComputerName)) { }
Last Seen: @{ 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"; } } } } @CommonHelpers.FriendlyDate(Model.Device.LastNetworkLogonDate)
@{ var assignedUser = Model.Device.AssignedUser; }
Assignment: @if (assignedUser != null) {
@if (Model.HasAssignedUserPhoto) {
}
@if (Authorization.Has(Claims.User.Show)) { @Html.ActionLink(assignedUser.DisplayName, MVC.User.Show(assignedUser.UserId)) } else { @assignedUser.DisplayName }
@assignedUser.FriendlyId()
@if (Authorization.Has(Claims.User.ShowDetails)) { if (!string.IsNullOrWhiteSpace(assignedUser.PhoneNumber)) { } if (!string.IsNullOrWhiteSpace(assignedUser.EmailAddress)) { } } @if (assignedUser.UserFlagAssignments.CanShowAny()) {
@foreach (var flag in assignedUser.UserFlagAssignments.Where(f => !f.RemovedDate.HasValue).Select(f => Tuple.Create(f, UserFlagService.GetUserFlag(f.UserFlagId)))) { if (flag.Item2.permission.CanShow()) { @flag.Item2.flag.Name@if (flag.Item1.Comments != null) {@flag.Item1.Comments.ToHtmlComment()}@CommonHelpers.FriendlyDateAndUser(flag.Item1.AddedDate, flag.Item1.AddedUserId) } }
} @if (Model.AssignedUserDetails != null && Model.AssignedUserDetails.Count(d => !d.Key.EndsWith("&")) > 0) {
@foreach (var detail in Model.AssignedUserDetails.Where(d => !d.Key.EndsWith("&"))) {
@detail.Key.TrimEnd('*'): @if (detail.Key.EndsWith("*")) { [reveal] } else { @Html.Partial(MVC.Shared.Views._CustomDetailValueRender, detail) }
}
}
} else { Not Assigned }
@if (Authorization.Has(Claims.Device.Actions.GenerateDocuments)) {
@Html.Partial(MVC.Shared.Views._GenerateDocumentControl, Model.GenerateDocumentControlModel)
}

@if (Authorization.Has(Claims.Config.DeviceProfile.Show)) { @Html.ActionLink(Model.Device.DeviceProfile.Name, MVC.Config.DeviceProfile.Index(Model.Device.DeviceProfileId)) } else { @Model.Device.DeviceProfile.Name }

Distribution: @Model.Device.DeviceProfile.DistributionType.ToString()
Address: @{ if (Model.DeviceProfileDefaultOrganisationAddress != null) { @Model.DeviceProfileDefaultOrganisationAddress.Name } else { None } }
Provision Account: @(Model.Device.DeviceProfile.ProvisionADAccount ? "Active Directory" : "No")
Certificates: @(Model.DeviceProfileCertificateProviders != null ? string.Join(", ", Model.DeviceProfileCertificateProviders.Select(c => c.Name)) : "None Provisioned")
Wireless Profiles: @(Model.DeviceProfileWirelessProfileProviders != null ? string.Join(", ", Model.DeviceProfileWirelessProfileProviders.Select(c => c.Name)) : "None Provisioned")
@if (Model.Device.CanUpdateDeviceProfile()) {
@using (Html.BeginForm(MVC.API.Device.UpdateDeviceProfileId(Model.Device.SerialNumber, redirect: true))) {
@Html.AntiForgeryToken()
    @foreach (var dp in Model.DeviceProfiles.OrderBy(i => i.Name)) { var isDecommissioned = Model.DecommissionedDeviceProfileIds.Contains(dp.Id);
  • if (isDecommissioned) { } }
@if (Model.DecommissionedDeviceProfileIds.Count > 0) { Show Decommissioned }
}
}
@if (Model.Device.DeviceBatchId.HasValue) {

@if (Authorization.Has(Claims.Config.DeviceBatch.Show)) { @Html.ActionLink(Model.Device.DeviceBatch.Name, MVC.Config.DeviceBatch.Index(Model.Device.DeviceBatchId.Value)) } else { @Model.Device.DeviceBatch.Name }

Purchased: @CommonHelpers.FriendlyDate(Model.Device.DeviceBatch.PurchaseDate)
Supplier: @(Model.Device.DeviceBatch.Supplier ?? "Unknown")
Warranty Until: @CommonHelpers.FriendlyDate(Model.Device.DeviceBatch.WarrantyValidUntil, "Unknown", null)
Insurance Supplier: @(Model.Device.DeviceBatch.InsuranceSupplier ?? "Unknown")
Insured Until: @CommonHelpers.FriendlyDate(Model.Device.DeviceBatch.InsuredUntil, "Unknown", null)
} else {

Batch: Not Associated

} @if (Model.Device.CanUpdateDeviceBatch()) {
@using (Html.BeginForm(MVC.API.Device.UpdateDeviceBatchId(Model.Device.SerialNumber, null, true))) { @Html.AntiForgeryToken()
    @foreach (var db in Model.DeviceBatches.OrderBy(i => i.Name)) { var isDecommissioned = Model.DecommissionedDeviceBatchIds.Contains(db.Id);
  • if (isDecommissioned) { } }
} @if (Model.DecommissionedDeviceBatchIds.Count > 0) { Show Decommissioned }
}

@if (Authorization.Has(Claims.Config.DeviceModel.Show)) { @Html.ActionLink(Model.Device.DeviceModel.ToString(), MVC.Config.DeviceModel.Index(Model.Device.DeviceModelId)) } else { @Model.Device.DeviceModel.ToString() }

Model Image
@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()) { Update Assignment

 Assign to User:


@using (Html.BeginForm(MVC.API.Device.UpdateAssignedUserId(Model.Device.SerialNumber, redirect: true))) { @Html.AntiForgeryToken() }
} @if (Model.AvailableDeviceFlags != null && Model.AvailableDeviceFlags.Count > 0) {
@using (Html.BeginForm(MVC.API.DeviceFlagAssignment.AddDevice())) { @Html.AntiForgeryToken()
@foreach (var flag in Model.AvailableDeviceFlags.OrderBy(jq => jq.Name)) {
@flag.Name
}

Comments

Remove On

12:00 AM
}
} @if (Model.Device.CanUpdateTrustEnrol()) {
@using (Html.BeginForm(MVC.API.Device.UpdateAllowUnauthenticatedEnrol(Model.Device.SerialNumber, true.ToString(), true))) { @Html.AntiForgeryToken() }

Devices flagged as 'trusted' are allowed a single-use device enrolment without providing authentication (for example: Active Directory Computer Account).

Once a device enrols, its trust setting is reset and additional enrolments need to be authenticated (domain joined) or manually trusted again.

This action will allow a device claiming to have the Serial Number '@(Model.Device.SerialNumber)' to be enrolled without authentication.

Are you sure you want to allow an unauthenticated enrolment?
} @if (Model.Device.CanUpdateUntrustEnrol()) {
@using (Html.BeginForm(MVC.API.Device.UpdateAllowUnauthenticatedEnrol(Model.Device.SerialNumber, false.ToString(), true))) { @Html.AntiForgeryToken() }

This action will require the device to enrol with authentication (for example: domain joined).

Are you sure you want to require an authenticated enrolment?
} @if (Model.Device.CanDecommission()) {
@using (Html.BeginForm(MVC.API.Device.Decommission(Model.Device.SerialNumber, null, true))) { @Html.AntiForgeryToken()
 Why is this device to be decommissioned?
    @foreach (DecommissionReasons decommissionReason in Enum.GetValues(typeof(DecommissionReasons)).Cast().OrderBy(r => r.ToString())) {
  • }
}
} @if (Model.Device.CanRecommission()) {
@using (Html.BeginForm(MVC.API.Device.Recommission(Model.Device.SerialNumber, true))) { @Html.AntiForgeryToken() }

 Are you sure?

} @if (Model.Device.CanDelete()) {
@using (Html.BeginForm(MVC.API.Device.Delete(Model.Device.SerialNumber, true))) { @Html.AntiForgeryToken() }

  This item will be permanently deleted and cannot be recovered.
Jobs linked to this Device (but not to a User) will be deleted also.
Are you sure?

}