Update: New Device UI
This commit is contained in:
@@ -10,10 +10,38 @@ namespace Disco.BI.Extensions
|
||||
{
|
||||
public static class DeviceActionExtensions
|
||||
{
|
||||
public static bool IsDecommissioned(this Device d)
|
||||
{
|
||||
return d.DecommissionedDate.HasValue;
|
||||
}
|
||||
|
||||
public static bool CanCreateJob(this Device d)
|
||||
{
|
||||
return !d.DecommissionedDate.HasValue;
|
||||
return !d.IsDecommissioned();
|
||||
}
|
||||
|
||||
public static bool CanUpdateAssignment(this Device d)
|
||||
{
|
||||
return !d.IsDecommissioned();
|
||||
}
|
||||
|
||||
public static bool CanUpdateDeviceProfile(this Device d)
|
||||
{
|
||||
return !d.IsDecommissioned();
|
||||
}
|
||||
|
||||
public static bool CanUpdateDeviceBatch(this Device d)
|
||||
{
|
||||
return !d.IsDecommissioned();
|
||||
}
|
||||
|
||||
public static bool CanUpdateTrustEnrol(this Device d)
|
||||
{
|
||||
return !d.IsDecommissioned() && !d.AllowUnauthenticatedEnrol;
|
||||
}
|
||||
public static bool CanUpdateUntrustEnrol(this Device d)
|
||||
{
|
||||
return !d.IsDecommissioned() && d.AllowUnauthenticatedEnrol;
|
||||
}
|
||||
|
||||
#region Decommission
|
||||
|
||||
@@ -178,5 +178,15 @@ namespace Disco.BI.Extensions
|
||||
return null;
|
||||
}
|
||||
|
||||
public static string Status(this Device Device)
|
||||
{
|
||||
if (Device.DecommissionedDate.HasValue)
|
||||
return "Decommissioned";
|
||||
|
||||
if (!Device.EnrolledDate.HasValue)
|
||||
return "Not Enrolled";
|
||||
|
||||
return "Active";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ using System.Text;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Data.Repository;
|
||||
using Disco.Data.Configuration.Modules;
|
||||
using Disco.Models.BI.Config;
|
||||
|
||||
namespace Disco.BI.Extensions
|
||||
{
|
||||
@@ -17,6 +18,18 @@ namespace Disco.BI.Extensions
|
||||
Expressions.ExpressionCache.InvalidateKey(ComputerNameExpressionCacheModule, deviceProfile.Id.ToString());
|
||||
}
|
||||
|
||||
public static OrganisationAddress DefaultOrganisationAddressDetails(this DeviceProfile deviceProfile, DiscoDataContext dbContext)
|
||||
{
|
||||
if (deviceProfile.DefaultOrganisationAddress.HasValue)
|
||||
{
|
||||
return dbContext.DiscoConfiguration.OrganisationAddresses.GetAddress(deviceProfile.DefaultOrganisationAddress.Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool CanDelete(this DeviceProfile dp, DiscoDataContext dbContext)
|
||||
{
|
||||
// Can't Delete Default Profile (Id: 1)
|
||||
|
||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.2.0606.1909")]
|
||||
[assembly: AssemblyFileVersion("1.2.0606.1909")]
|
||||
[assembly: AssemblyVersion("1.2.0618.1707")]
|
||||
[assembly: AssemblyFileVersion("1.2.0618.1707")]
|
||||
Reference in New Issue
Block a user