qol: formatting

This commit is contained in:
Gary Sharp
2025-07-20 13:47:56 +10:00
parent 49da389c2c
commit 5792771ea1
158 changed files with 693 additions and 679 deletions
+3 -3
View File
@@ -1,10 +1,10 @@
using System; using Disco.Client.Extensions;
using Newtonsoft.Json;
using System;
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;
using System.Net; using System.Net;
using System.Reflection; using System.Reflection;
using Disco.Client.Extensions;
using Newtonsoft.Json;
namespace Disco.Client namespace Disco.Client
{ {
@@ -8,13 +8,13 @@ namespace Disco.Client.Extensions
{ {
public static class ClientServicesExtensions public static class ClientServicesExtensions
{ {
//#if DEBUG //#if DEBUG
// public const string ServicePathAuthenticatedTemplate = "http://WS-GSHARP:57252/Services/Client/Authenticated/{0}"; // public const string ServicePathAuthenticatedTemplate = "http://WS-GSHARP:57252/Services/Client/Authenticated/{0}";
// public const string ServicePathUnauthenticatedTemplate = "http://WS-GSHARP:57252/Services/Client/Unauthenticated/{0}"; // public const string ServicePathUnauthenticatedTemplate = "http://WS-GSHARP:57252/Services/Client/Unauthenticated/{0}";
//#else //#else
public const string ServicePathAuthenticatedTemplate = "http://DISCO:9292/Services/Client/Authenticated/{0}"; public const string ServicePathAuthenticatedTemplate = "http://DISCO:9292/Services/Client/Authenticated/{0}";
public const string ServicePathUnauthenticatedTemplate = "http://DISCO:9292/Services/Client/Unauthenticated/{0}"; public const string ServicePathUnauthenticatedTemplate = "http://DISCO:9292/Services/Client/Unauthenticated/{0}";
//#endif //#endif
public static ResponseType Post<ResponseType>(this ServiceBase<ResponseType> Service, bool Authenticated) public static ResponseType Post<ResponseType>(this ServiceBase<ResponseType> Service, bool Authenticated)
{ {
+2 -2
View File
@@ -1,5 +1,5 @@
using System.Text; using Disco.Models.ClientServices;
using Disco.Models.ClientServices; using System.Text;
namespace Disco.Client.Extensions namespace Disco.Client.Extensions
{ {
+3 -3
View File
@@ -1,9 +1,9 @@
using System; using Disco.Client.Extensions;
using Disco.Client.Interop;
using System;
using System.Reflection; using System.Reflection;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using Disco.Client.Extensions;
using Disco.Client.Interop;
namespace Disco.Client namespace Disco.Client
{ {
+3 -3
View File
@@ -1,8 +1,8 @@
using System; using Disco.Client.Extensions;
using Disco.Models.ClientServices;
using System;
using System.Linq; using System.Linq;
using System.Net; using System.Net;
using Disco.Models.ClientServices;
using Disco.Client.Extensions;
namespace Disco.Client namespace Disco.Client
{ {
+8 -8
View File
@@ -1,11 +1,11 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq; using System.Linq;
using System.Net;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using System.Net;
using System.IO;
using System.Diagnostics;
namespace Disco.ClientBootstrapper namespace Disco.ClientBootstrapper
{ {
@@ -20,13 +20,13 @@ namespace Disco.ClientBootstrapper
private StringBuilder errorMessage; private StringBuilder errorMessage;
private Process clientProcess; private Process clientProcess;
//#if DEBUG //#if DEBUG
// public const string DiscoServerName = "WS-GSHARP"; // public const string DiscoServerName = "WS-GSHARP";
// public const int DiscoServerPort = 57252; // public const int DiscoServerPort = 57252;
//#else //#else
public const string DiscoServerName = "DISCO"; public const string DiscoServerName = "DISCO";
public const int DiscoServerPort = 9292; public const int DiscoServerPort = 9292;
//#endif //#endif
public BootstrapperLoop(IStatus StatusUI, LoopCompleteCallback Callback) public BootstrapperLoop(IStatus StatusUI, LoopCompleteCallback Callback)
{ {
@@ -1,9 +1,9 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO;
using System.Linq; using System.Linq;
using System.Security.Cryptography.X509Certificates; using System.Security.Cryptography.X509Certificates;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.IO;
namespace Disco.ClientBootstrapper.Interop namespace Disco.ClientBootstrapper.Interop
{ {
@@ -40,14 +40,16 @@ namespace Disco.ClientBootstrapper.Interop
{ {
var wirelessConnectionStatus = WirelessConnectionStatus; var wirelessConnectionStatus = WirelessConnectionStatus;
} }
catch (Exception) { catch (Exception)
{
IsWireless = false; IsWireless = false;
}; }
} }
public int WirelessConnectionStatus public int WirelessConnectionStatus
{ {
get { get
{
if (IsWireless) if (IsWireless)
{ {
IntPtr handle = IntPtr.Zero; IntPtr handle = IntPtr.Zero;
@@ -1,8 +1,8 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Net.NetworkInformation;
using System.Management; using System.Management;
using System.Net.NetworkInformation;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Xml; using System.Xml;
@@ -30,7 +30,7 @@ namespace Disco.ClientBootstrapper.Interop
private static extern int LookupPrivilegeValue(string lpsystemname, string lpname, [MarshalAs(UnmanagedType.Struct)] ref LUID lpLuid); private static extern int LookupPrivilegeValue(string lpsystemname, string lpname, [MarshalAs(UnmanagedType.Struct)] ref LUID lpLuid);
[DllImport("advapi32.dll", CharSet = CharSet.Auto)] [DllImport("advapi32.dll", CharSet = CharSet.Auto)]
private static extern int AdjustTokenPrivileges(int tokenhandle, int disableprivs, [MarshalAs(UnmanagedType.Struct)]ref TOKEN_PRIVILEGES Newstate, int bufferlength, int PreivousState, int Returnlength); private static extern int AdjustTokenPrivileges(int tokenhandle, int disableprivs, [MarshalAs(UnmanagedType.Struct)] ref TOKEN_PRIVILEGES Newstate, int bufferlength, int PreivousState, int Returnlength);
[DllImport("advapi32.dll", CharSet = CharSet.Auto, SetLastError = true)] [DllImport("advapi32.dll", CharSet = CharSet.Auto, SetLastError = true)]
private static extern int RegLoadKey(uint hKey, string lpSubKey, string lpFile); private static extern int RegLoadKey(uint hKey, string lpSubKey, string lpFile);
@@ -649,7 +649,8 @@ namespace Disco.ClientBootstrapper.Interop.WIMInterop
///Private null constructor ///Private null constructor
///</summary> ///</summary>
private private
NativeMethods() { } NativeMethods()
{ }
[DllImport("Wimgapi.dll", ExactSpelling = true, [DllImport("Wimgapi.dll", ExactSpelling = true,
EntryPoint = "WIMCreateFile", EntryPoint = "WIMCreateFile",
+10 -11
View File
@@ -118,18 +118,17 @@ namespace Disco.ClientBootstrapper
SleepThread(4000, true); SleepThread(4000, true);
Interop.ShutdownInterop.Shutdown(); Interop.ShutdownInterop.Shutdown();
} }
else if (PostBootstrapperActions.Contains("Reboot"))
{
Status.UpdateStatus("System Preparation (Bootstrapper)", "Rebooting; Finished...", string.Empty, false, 0);
SleepThread(4000, true);
Interop.ShutdownInterop.Reboot();
}
else else
if (PostBootstrapperActions.Contains("Reboot")) {
{ Status.UpdateStatus("System Preparation (Bootstrapper)", "Starting System; Finished...", string.Empty, false, 0);
Status.UpdateStatus("System Preparation (Bootstrapper)", "Rebooting; Finished...", string.Empty, false, 0); SleepThread(2000, true);
SleepThread(4000, true); }
Interop.ShutdownInterop.Reboot();
}
else
{
Status.UpdateStatus("System Preparation (Bootstrapper)", "Starting System; Finished...", string.Empty, false, 0);
SleepThread(2000, true);
}
} }
else else
{ {
@@ -35,7 +35,8 @@ namespace Disco.Data.Configuration.Modules
public bool? SearchAllServers public bool? SearchAllServers
{ {
get { get
{
var value = Get<bool?>(null); var value = Get<bool?>(null);
/// migrate <see cref="SearchAllForestServers"/> /// migrate <see cref="SearchAllForestServers"/>
@@ -1,7 +1,7 @@
using System; using Microsoft.Win32;
using System.Data.Entity.Infrastructure; using System;
using Microsoft.Win32;
using System.Data.Common; using System.Data.Common;
using System.Data.Entity.Infrastructure;
using System.Security; using System.Security;
namespace Disco.Data.Repository namespace Disco.Data.Repository
@@ -1,11 +1,11 @@
using System; using Disco.Models.Repository;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data.Entity.Infrastructure;
using System.Data.Objects;
using System.Linq; using System.Linq;
using System.Reactive.Subjects; using System.Reactive.Subjects;
using System.Data.Entity.Infrastructure;
using System.Collections.Concurrent;
using System.Data.Objects;
using Disco.Models.Repository;
namespace Disco.Data.Repository.Monitor namespace Disco.Data.Repository.Monitor
{ {
@@ -52,7 +52,8 @@ namespace Disco.Data.Repository.Monitor
return (T)dbEntityState.CurrentValues[PropertyName]; return (T)dbEntityState.CurrentValues[PropertyName];
} }
public void ExecuteAfterCommit(Action<RepositoryMonitorEvent> action){ public void ExecuteAfterCommit(Action<RepositoryMonitorEvent> action)
{
if (afterCommit) if (afterCommit)
{ {
// Execute Immediately // Execute Immediately
@@ -3,7 +3,7 @@
public class ComputerSystem public class ComputerSystem
{ {
public string ChassisSKUNumber { get; set; } public string ChassisSKUNumber { get; set; }
public short? CurrentTimeZone { get; set;} public short? CurrentTimeZone { get; set; }
public string Description { get; set; } public string Description { get; set; }
public string[] OEMStringArray { get; set; } public string[] OEMStringArray { get; set; }
public string PCSystemType { get; set; } public string PCSystemType { get; set; }
+1 -1
View File
@@ -1,8 +1,8 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
namespace Disco.Models.Repository namespace Disco.Models.Repository
{ {
+1 -1
View File
@@ -1,8 +1,8 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
namespace Disco.Models.Repository namespace Disco.Models.Repository
{ {
@@ -42,7 +42,7 @@ namespace Disco.Models.Services.Users.Contact
return false; return false;
} }
var result = match.Value; var result = match.Value;
var name = default(string); var name = default(string);
if (match.Index > 0) if (match.Index > 0)
{ {
@@ -1,14 +1,18 @@
using RazorGenerator.Mvc;
using System.Web; using System.Web;
using System.Web.Mvc; using System.Web.Mvc;
using System.Web.WebPages; using System.Web.WebPages;
using RazorGenerator.Mvc;
[assembly: WebActivatorEx.PostApplicationStartMethod(typeof(Disco.Services.App_Start.RazorGeneratorMvcStart), "Start")] [assembly: WebActivatorEx.PostApplicationStartMethod(typeof(Disco.Services.App_Start.RazorGeneratorMvcStart), "Start")]
namespace Disco.Services.App_Start { namespace Disco.Services.App_Start
public static class RazorGeneratorMvcStart { {
public static void Start() { public static class RazorGeneratorMvcStart
var engine = new PrecompiledMvcEngine(typeof(RazorGeneratorMvcStart).Assembly) { {
public static void Start()
{
var engine = new PrecompiledMvcEngine(typeof(RazorGeneratorMvcStart).Assembly)
{
UsePhysicalViewsIfNewer = HttpContext.Current.Request.IsLocal UsePhysicalViewsIfNewer = HttpContext.Current.Request.IsLocal
}; };
@@ -1,5 +1,5 @@
using Disco.Models.Services.Authorization; using Disco.Models.Repository;
using Disco.Models.Repository; using Disco.Models.Services.Authorization;
using Disco.Services.Authorization.Roles; using Disco.Services.Authorization.Roles;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@@ -49,15 +49,15 @@ namespace Disco.Services.Authorization
public IClaimNavigatorItem BuildClaimTree(RoleClaims RoleClaims) public IClaimNavigatorItem BuildClaimTree(RoleClaims RoleClaims)
{ {
return new ClaimNavigatorItem() return new ClaimNavigatorItem()
{ {
Key = Key, Key = Key,
Name = Name, Name = Name,
Description = Description, Description = Description,
Hidden = Hidden, Hidden = Hidden,
accessor = accessor, accessor = accessor,
Value = accessor == null ? (bool?)null : accessor(RoleClaims), Value = accessor == null ? (bool?)null : accessor(RoleClaims),
Children = Children == null ? null : Children.Cast<ClaimNavigatorItem>().Select(c => c.BuildClaimTree(RoleClaims)).ToList() Children = Children == null ? null : Children.Cast<ClaimNavigatorItem>().Select(c => c.BuildClaimTree(RoleClaims)).ToList()
}; };
} }
public IClaimNavigatorItem BuildClaimTree(IEnumerable<RoleClaims> RoleClaims) public IClaimNavigatorItem BuildClaimTree(IEnumerable<RoleClaims> RoleClaims)
@@ -30,11 +30,10 @@ namespace Disco.Services.Authorization
if (UserService.CurrentAuthorization == null) if (UserService.CurrentAuthorization == null)
resultMessage = AuthorizationToken.RequireAuthenticationMessage; resultMessage = AuthorizationToken.RequireAuthenticationMessage;
else if (string.IsNullOrEmpty(authorizedClaim))
resultMessage = AuthorizationToken.RequireDiscoAuthorizationMessage;
else else
if (string.IsNullOrEmpty(authorizedClaim)) resultMessage = AuthorizationToken.BuildRequireMessage(authorizedClaim);
resultMessage = AuthorizationToken.RequireDiscoAuthorizationMessage;
else
resultMessage = AuthorizationToken.BuildRequireMessage(authorizedClaim);
return resultMessage; return resultMessage;
} }
@@ -1,11 +1,11 @@
using Disco.Data.Repository; using Disco.Data.Repository;
using Disco.Models.Services.Authorization;
using Disco.Models.Repository; using Disco.Models.Repository;
using Disco.Models.Services.Authorization;
using Disco.Services.Interop.ActiveDirectory;
using Newtonsoft.Json;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Disco.Services.Interop.ActiveDirectory;
using Newtonsoft.Json;
namespace Disco.Services.Authorization.Roles namespace Disco.Services.Authorization.Roles
{ {
@@ -1,5 +1,5 @@
using Disco.Models.Services.Authorization; using Disco.Models.Repository;
using Disco.Models.Repository; using Disco.Models.Services.Authorization;
using Newtonsoft.Json; using Newtonsoft.Json;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@@ -8,7 +8,7 @@ namespace Disco.Services.Devices.DeviceFlags
{ {
public override string TaskName { get { return "Device Flags - Delete Flag"; } } public override string TaskName { get { return "Device Flags - Delete Flag"; } }
public override bool SingleInstanceTask { get { return false; }} public override bool SingleInstanceTask { get { return false; } }
public override bool CancelInitiallySupported { get { return false; } } public override bool CancelInitiallySupported { get { return false; } }
public override bool LogExceptionsOnly { get { return true; } } public override bool LogExceptionsOnly { get { return true; } }
@@ -270,7 +270,7 @@ namespace Disco.Services.Documents.AttachmentImport
{ {
var rules = Identifier.DocumentTemplate.GetOnImportUserFlagRules(); var rules = Identifier.DocumentTemplate.GetOnImportUserFlagRules();
foreach ( var rule in rules) foreach (var rule in rules)
{ {
rule.Apply(Database, Identifier.Target, creatorUser); rule.Apply(Database, Identifier.Target, creatorUser);
} }
@@ -20,9 +20,8 @@ namespace Disco.Services.Expressions
{ {
if (expressionParseException == null) if (expressionParseException == null)
return null; return null;
else else if (evaluateParseException == null)
if (evaluateParseException == null) evaluateParseException = EvaluateExpressionParseException.FromRecognitionException(expressionParseException, Source);
evaluateParseException = EvaluateExpressionParseException.FromRecognitionException(expressionParseException, Source);
return evaluateParseException; return evaluateParseException;
} }
} }
@@ -53,7 +53,8 @@ namespace Disco.Services.Expressions.Extensions.ImageResultImplementations
{ {
maxWidth = images.Sum(i => i.Width); maxWidth = images.Sum(i => i.Width);
maxHeight = images.Max(i => i.Height); maxHeight = images.Max(i => i.Height);
}else if (MontageVerticalLayout) }
else if (MontageVerticalLayout)
{ {
maxWidth = images.Max(i => i.Width); maxWidth = images.Max(i => i.Width);
maxHeight = images.Sum(i => i.Height); maxHeight = images.Sum(i => i.Height);
@@ -2,14 +2,14 @@ using System.Collections;
namespace Disco.Services.Expressions namespace Disco.Services.Expressions
{ {
public interface IExpressionPart public interface IExpressionPart
{ {
string RawSource { get; set; } string RawSource { get; set; }
string Source { get; set; } string Source { get; set; }
bool ErrorsAllowed { get; set; } bool ErrorsAllowed { get; set; }
bool ParseError { get; } bool ParseError { get; }
string ParseErrorMessage { get; } string ParseErrorMessage { get; }
bool IsDynamic { get; set; } bool IsDynamic { get; set; }
object Evaluate(object ExpressionContext, IDictionary Variables); object Evaluate(object ExpressionContext, IDictionary Variables);
} }
} }
@@ -1,9 +1,9 @@
using System; using Disco.Data.Repository;
using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Reactive.Subjects; using System.Reactive.Subjects;
using Disco.Data.Repository;
namespace Disco.Services.Interop.ActiveDirectory namespace Disco.Services.Interop.ActiveDirectory
{ {
@@ -15,9 +15,9 @@ using System.Text;
namespace Disco.Services.Interop.DiscoServices namespace Disco.Services.Interop.DiscoServices
{ {
using StatisticInt = UpdateRequestV2.StatisticInt; using StatisticInt = UpdateRequestV2.StatisticInt;
using StatisticIntPair = UpdateRequestV2.StatisticIntPair;
using StatisticJob = UpdateRequestV2.StatisticJob; using StatisticJob = UpdateRequestV2.StatisticJob;
using StatisticString = UpdateRequestV2.StatisticString; using StatisticString = UpdateRequestV2.StatisticString;
using StatisticIntPair = UpdateRequestV2.StatisticIntPair;
public static class UpdateQuery public static class UpdateQuery
{ {
@@ -264,7 +264,7 @@ namespace Disco.Services
foreach (var j in items) foreach (var j in items)
{ {
j.UserFriendlyId =j.UserId == null ? null : ActiveDirectory.FriendlyAccountId(j.UserId); j.UserFriendlyId = j.UserId == null ? null : ActiveDirectory.FriendlyAccountId(j.UserId);
j.OpenedTechUserFriendlyId = ActiveDirectory.FriendlyAccountId(j.OpenedTechUserId); j.OpenedTechUserFriendlyId = ActiveDirectory.FriendlyAccountId(j.OpenedTechUserId);
if (j.DeviceAddressId.HasValue) if (j.DeviceAddressId.HasValue)
@@ -8,7 +8,7 @@ namespace Disco.Services.Jobs.JobQueues
{ {
public override string TaskName { get { return "Job Queues - Delete Queue"; } } public override string TaskName { get { return "Job Queues - Delete Queue"; } }
public override bool SingleInstanceTask { get { return false; }} public override bool SingleInstanceTask { get { return false; } }
public override bool CancelInitiallySupported { get { return false; } } public override bool CancelInitiallySupported { get { return false; } }
public override bool LogExceptionsOnly { get { return true; } } public override bool LogExceptionsOnly { get { return true; } }
+1 -1
View File
@@ -2,6 +2,7 @@
using Disco.Data.Repository.Monitor; using Disco.Data.Repository.Monitor;
using Disco.Models.Repository; using Disco.Models.Repository;
using Disco.Services.Authorization; using Disco.Services.Authorization;
using Disco.Services.Users;
using Disco.Services.Web.Signalling; using Disco.Services.Web.Signalling;
using Microsoft.AspNet.SignalR; using Microsoft.AspNet.SignalR;
using Microsoft.AspNet.SignalR.Hubs; using Microsoft.AspNet.SignalR.Hubs;
@@ -9,7 +10,6 @@ using System;
using System.Linq; using System.Linq;
using System.Reactive.Linq; using System.Reactive.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Disco.Services.Users;
namespace Disco.Services.Jobs namespace Disco.Services.Jobs
{ {
+8 -8
View File
@@ -1,12 +1,12 @@
using System; using Disco.Data.Repository;
using System.Collections.Generic; using Newtonsoft.Json;
using System.Linq;
using Disco.Data.Repository;
using System.IO;
using System.Data.SqlServerCe;
using Quartz; using Quartz;
using Quartz.Impl; using Quartz.Impl;
using Newtonsoft.Json; using System;
using System.Collections.Generic;
using System.Data.SqlServerCe;
using System.IO;
using System.Linq;
namespace Disco.Services.Logging namespace Disco.Services.Logging
{ {
@@ -50,7 +50,7 @@ namespace Disco.Services.Logging
var appDomain = AppDomain.CurrentDomain; var appDomain = AppDomain.CurrentDomain;
var servicesAssemblyName = typeof(LogContext).Assembly.GetName().Name; var servicesAssemblyName = typeof(LogContext).Assembly.GetName().Name;
var logModuleTypes = appDomain.GetAssemblies() var logModuleTypes = appDomain.GetAssemblies()
.Where(a => !a.GlobalAssemblyCache && !a.IsDynamic && .Where(a => !a.GlobalAssemblyCache && !a.IsDynamic &&
(a.GetName().Name == servicesAssemblyName || a.GetReferencedAssemblies().Any(ra => ra.Name == servicesAssemblyName))) (a.GetName().Name == servicesAssemblyName || a.GetReferencedAssemblies().Any(ra => ra.Name == servicesAssemblyName)))
.SelectMany(a => a.GetTypes()) .SelectMany(a => a.GetTypes())
+2 -2
View File
@@ -1,5 +1,5 @@
using Quartz; using Disco.Data.Repository;
using Disco.Data.Repository; using Quartz;
namespace Disco.Services.Logging namespace Disco.Services.Logging
{ {
+1 -1
View File
@@ -15,7 +15,7 @@ namespace Disco.Services.Logging.Models
public int EventTypeId { get; set; } public int EventTypeId { get; set; }
[Required] [Required]
public DateTime Timestamp { get; set; } public DateTime Timestamp { get; set; }
[Column(TypeName="ntext"), MaxLength] [Column(TypeName = "ntext"), MaxLength]
public string Arguments { get; set; } public string Arguments { get; set; }
} }
} }
@@ -1,13 +1,13 @@
using System.Linq; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
namespace Disco.Services.Logging.Models namespace Disco.Services.Logging.Models
{ {
[Table("EventTypes")] [Table("EventTypes")]
public class LogEventType public class LogEventType
{ {
[Required, Key, Column(Order=0), DatabaseGenerated(DatabaseGeneratedOption.None)] [Required, Key, Column(Order = 0), DatabaseGenerated(DatabaseGeneratedOption.None)]
public int ModuleId { get; set; } public int ModuleId { get; set; }
[Required, Key, Column(Order = 1), DatabaseGenerated(DatabaseGeneratedOption.None)] [Required, Key, Column(Order = 1), DatabaseGenerated(DatabaseGeneratedOption.None)]
public int Id { get; set; } public int Id { get; set; }
@@ -1,6 +1,6 @@
using System; using Disco.Models.Exporting;
using Disco.Models.Exporting;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
namespace Disco.Services.Logging.Models namespace Disco.Services.Logging.Models
{ {
+4 -4
View File
@@ -1,9 +1,9 @@
using System; using Microsoft.Win32.SafeHandles;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using Microsoft.Win32.SafeHandles;
using System.Runtime.InteropServices;
using System.IO; using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Web.Mvc; using System.Web.Mvc;
namespace Disco.Services.Logging namespace Disco.Services.Logging
@@ -90,7 +90,8 @@ namespace Disco.Services.Plugins.Features.DetailsProvider
return user.UserDetails return user.UserDetails
.Where(d => string.Equals(d.Scope, DetailsScope, StringComparison.Ordinal)) .Where(d => string.Equals(d.Scope, DetailsScope, StringComparison.Ordinal))
.ToDictionary(d => d.Key, d => d.Value, StringComparer.OrdinalIgnoreCase); .ToDictionary(d => d.Key, d => d.Value, StringComparer.OrdinalIgnoreCase);
} else }
else
{ {
return database.UserDetails return database.UserDetails
.Where(d => d.UserId == user.UserId && .Where(d => d.UserId == user.UserId &&
@@ -1,7 +1,7 @@
using System; using Disco.Models.UI;
using System.Web.Mvc;
using Disco.Models.UI;
using Disco.Services.Plugins.Features.UIExtension.Results; using Disco.Services.Plugins.Features.UIExtension.Results;
using System;
using System.Web.Mvc;
namespace Disco.Services.Plugins.Features.UIExtension namespace Disco.Services.Plugins.Features.UIExtension
{ {
@@ -19,7 +19,8 @@ namespace Disco.Services.Plugins.Features.UIExtension
} }
public UIExtensionFeature() public UIExtensionFeature()
{ {
plugin = new Lazy<WebHelper>(new Func<WebHelper>(() => { plugin = new Lazy<WebHelper>(new Func<WebHelper>(() =>
{
if (Context == null) if (Context == null)
throw new InvalidOperationException("The Context property is not initialized"); throw new InvalidOperationException("The Context property is not initialized");
@@ -1,9 +1,9 @@
using System; using Disco.Models.UI;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Web; using System.Web;
using System.Web.Mvc; using System.Web.Mvc;
using Disco.Models.UI;
namespace Disco.Services.Plugins.Features.UIExtension namespace Disco.Services.Plugins.Features.UIExtension
{ {
@@ -1,10 +1,10 @@
using System; using Disco.Data.Repository;
using Disco.Models.BI.Config;
using Disco.Models.Repository;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Web.Mvc; using System.Web.Mvc;
using Disco.Data.Repository;
using Disco.Models.BI.Config;
using Disco.Models.Repository;
namespace Disco.Services.Plugins.Features.WarrantyProvider namespace Disco.Services.Plugins.Features.WarrantyProvider
{ {
+3 -3
View File
@@ -1,12 +1,12 @@
using System; using Disco.Data.Repository;
using Disco.Data.Repository;
using Disco.Services.Tasks; using Disco.Services.Tasks;
using System;
namespace Disco.Services.Plugins namespace Disco.Services.Plugins
{ {
public abstract class Plugin : IDisposable public abstract class Plugin : IDisposable
{ {
public PluginManifest Manifest {get; internal set;} public PluginManifest Manifest { get; internal set; }
#region Lifecycle #region Lifecycle
// Events/Triggers for Custom Plugin Initialization (Optional) // Events/Triggers for Custom Plugin Initialization (Optional)
@@ -1,6 +1,6 @@
using System; using Disco.Data.Repository;
using System;
using System.Web.Mvc; using System.Web.Mvc;
using Disco.Data.Repository;
namespace Disco.Services.Plugins namespace Disco.Services.Plugins
{ {
+8 -8
View File
@@ -1,13 +1,13 @@
using System; using Disco.Services.Web.Bundles;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO;
using System.Web.Mvc;
using System.Web.WebPages;
using System.Web.Routing;
using System.Web;
using System.Web.Mvc.Html;
using System.Globalization; using System.Globalization;
using Disco.Services.Web.Bundles; using System.IO;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Html;
using System.Web.Routing;
using System.Web.WebPages;
namespace Disco.Services.Plugins namespace Disco.Services.Plugins
{ {
+3 -3
View File
@@ -1,11 +1,11 @@
using System; using Disco.Data.Repository;
using Disco.Data.Repository; using System;
namespace Disco.Services.Plugins namespace Disco.Services.Plugins
{ {
public abstract class PluginFeature : IDisposable public abstract class PluginFeature : IDisposable
{ {
public PluginFeatureManifest Manifest {get; internal set;} public PluginFeatureManifest Manifest { get; internal set; }
// Allow Custom Initialization (Optional) // Allow Custom Initialization (Optional)
public virtual void Initialize(DiscoDataContext Database) { return; } public virtual void Initialize(DiscoDataContext Database) { return; }
@@ -1,7 +1,7 @@
using System; using Disco.Data.Repository;
using System.Linq;
using Disco.Data.Repository;
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Linq;
namespace Disco.Services.Plugins namespace Disco.Services.Plugins
{ {
+6 -6
View File
@@ -1,4 +1,9 @@
using System; using Disco.Data.Repository;
using Disco.Services.Authorization;
using Disco.Services.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
@@ -6,11 +11,6 @@ using System.Reflection;
using System.Security.Cryptography; using System.Security.Cryptography;
using System.Web; using System.Web;
using System.Web.Mvc; using System.Web.Mvc;
using Disco.Data.Repository;
using Disco.Services.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Disco.Services.Authorization;
using System.Web.Routing; using System.Web.Routing;
namespace Disco.Services.Plugins namespace Disco.Services.Plugins
+3 -2
View File
@@ -6,7 +6,7 @@ namespace Disco.Services.Plugins
{ {
private Lazy<WebPageHelper<T>> _plugin; private Lazy<WebPageHelper<T>> _plugin;
public PluginManifest Manifest {get;private set;} public PluginManifest Manifest { get; private set; }
public WebPageHelper<T> Plugin public WebPageHelper<T> Plugin
{ {
get get
@@ -20,7 +20,8 @@ namespace Disco.Services.Plugins
var self = GetType(); var self = GetType();
Manifest = Plugins.GetPlugin(self.Assembly); Manifest = Plugins.GetPlugin(self.Assembly);
_plugin = new Lazy<WebPageHelper<T>>(() => { _plugin = new Lazy<WebPageHelper<T>>(() =>
{
if (Context == null) if (Context == null)
throw new InvalidOperationException("The WebViewPage Context property is not initialized"); throw new InvalidOperationException("The WebViewPage Context property is not initialized");
+243 -243
View File
@@ -1,7 +1,7 @@
using System; using Disco.Services.Logging;
using System.Collections.Generic;
using Disco.Services.Logging;
using Disco.Services.Logging.Models; using Disco.Services.Logging.Models;
using System;
using System.Collections.Generic;
using System.Reflection; using System.Reflection;
namespace Disco.Services.Plugins namespace Disco.Services.Plugins
@@ -180,249 +180,249 @@ namespace Disco.Services.Plugins
{ {
return new List<LogEventType> return new List<LogEventType>
{ {
new LogEventType
{
Id = (int)EventTypeIds.InitializingPlugins,
ModuleId = _ModuleId,
Name = "Initializing Plugins",
Format = "Starting plugin discovery and initialization from: {0}",
Severity = (int)LogEventType.Severities.Information,
UseLive = false,
UsePersist = true,
UseDisplay = true
},
new LogEventType
{
Id = (int)EventTypeIds.InitializingPluginAssembly,
ModuleId = _ModuleId,
Name = "Initializing Plugin Assembly",
Format = "Initializing Plugin Assembly: [{0}] From '{1}'",
Severity = (int)LogEventType.Severities.Information,
UseLive = false,
UsePersist = true,
UseDisplay = true
},
new LogEventType
{
Id = (int)EventTypeIds.InitializedPlugin,
ModuleId = _ModuleId,
Name = "Initialized Plugin",
Format = "Initialized Plugin: '{0} (v{1})' [{2}] From '{3}'",
Severity = (int)LogEventType.Severities.Information,
UseLive = false,
UsePersist = true,
UseDisplay = true
},
new LogEventType new LogEventType
{ {
Id = (int)EventTypeIds.InitializedPluginFeature, Id = (int)EventTypeIds.InitializingPlugins,
ModuleId = _ModuleId, ModuleId = _ModuleId,
Name = "Initialized Plugin Feature", Name = "Initializing Plugins",
Format = "Initialized Plugin Feature: '{1}' From '{0}'", Format = "Starting plugin discovery and initialization from: {0}",
Severity = (int)LogEventType.Severities.Information, Severity = (int)LogEventType.Severities.Information,
UseLive = false, UseLive = false,
UsePersist = true, UsePersist = true,
UseDisplay = true UseDisplay = true
}, },
new LogEventType
{
Id = (int)EventTypeIds.InitializeWarning,
ModuleId = _ModuleId,
Name = "Initialize Warning",
Format = "Initialize Warning: {0}",
Severity = (int)LogEventType.Severities.Warning,
UseLive = false,
UsePersist = true,
UseDisplay = true
},
new LogEventType
{
Id = (int)EventTypeIds.InitializeError,
ModuleId = _ModuleId,
Name = "Initialize Error",
Format = "Initialize Error: {0}",
Severity = (int)LogEventType.Severities.Error,
UseLive = false,
UsePersist = true,
UseDisplay = true
},
new LogEventType
{
Id = (int)EventTypeIds.InitializeException,
ModuleId = _ModuleId,
Name = "Initialize Exception",
Format = "Exception: {0}; {1}: {2}; {3}",
Severity = (int)LogEventType.Severities.Error,
UseLive = false,
UsePersist = true,
UseDisplay = true
},
new LogEventType
{
Id = (int)EventTypeIds.InitializeExceptionWithInner,
ModuleId = _ModuleId,
Name = "Initialize Exception with Inner Exception",
Format = "Exception: {0}; {1}: {2}; {3}; Inner: {4}: {5}; {6}",
Severity = (int)LogEventType.Severities.Error,
UseLive = false,
UsePersist = true,
UseDisplay = true
},
new LogEventType
{
Id = (int)EventTypeIds.PluginException,
ModuleId = _ModuleId,
Name = "Plugin Exception",
Format = "Exception: {0}; {1}: {2}; {3}",
Severity = (int)LogEventType.Severities.Error,
UseLive = true,
UsePersist = true,
UseDisplay = true
},
new LogEventType
{
Id = (int)EventTypeIds.PluginExceptionWithInner,
ModuleId = _ModuleId,
Name = "Plugin Exception with Inner Exception",
Format = "Exception: {0}; {1}: {2}; {3}; Inner: {4}: {5}; {6}",
Severity = (int)LogEventType.Severities.Error,
UseLive = true,
UsePersist = true,
UseDisplay = true
},
new LogEventType new LogEventType
{ {
Id = (int)EventTypeIds.PluginWarning, Id = (int)EventTypeIds.InitializingPluginAssembly,
ModuleId = _ModuleId, ModuleId = _ModuleId,
Name = "Plugin Warning", Name = "Initializing Plugin Assembly",
Format = "{0} [{1} v{2}]: {3}", Format = "Initializing Plugin Assembly: [{0}] From '{1}'",
Severity = (int)LogEventType.Severities.Warning, Severity = (int)LogEventType.Severities.Information,
UseLive = true, UseLive = false,
UsePersist = true, UsePersist = true,
UseDisplay = true UseDisplay = true
}, },
new LogEventType new LogEventType
{ {
Id = (int)EventTypeIds.PluginMessage, Id = (int)EventTypeIds.InitializedPlugin,
ModuleId = _ModuleId, ModuleId = _ModuleId,
Name = "Plugin Message", Name = "Initialized Plugin",
Format = "{0} [{1} v{2}]: {3}", Format = "Initialized Plugin: '{0} (v{1})' [{2}] From '{3}'",
Severity = (int)LogEventType.Severities.Information, Severity = (int)LogEventType.Severities.Information,
UseLive = true, UseLive = false,
UsePersist = true, UsePersist = true,
UseDisplay = true UseDisplay = true
}, },
new LogEventType new LogEventType
{ {
Id = (int)EventTypeIds.PluginReferenceAssemblyLoaded, Id = (int)EventTypeIds.InitializedPluginFeature,
ModuleId = _ModuleId, ModuleId = _ModuleId,
Name = "Plugin Reference Assembly Loaded", Name = "Initialized Plugin Feature",
Format = "Loaded Plugin Reference Assembly: [{0}] From: '{1}'; Requested by: [{2}]", Format = "Initialized Plugin Feature: '{1}' From '{0}'",
Severity = (int)LogEventType.Severities.Information, Severity = (int)LogEventType.Severities.Information,
UseLive = true, UseLive = false,
UsePersist = true, UsePersist = true,
UseDisplay = true UseDisplay = true
}, },
new LogEventType new LogEventType
{ {
Id = (int)EventTypeIds.PluginConfigurationLoaded, Id = (int)EventTypeIds.InitializeWarning,
ModuleId = _ModuleId, ModuleId = _ModuleId,
Name = "Plugin Configuration Loaded", Name = "Initialize Warning",
Format = "Plugin Configuration Loaded: [{0}] by [{1}]", Format = "Initialize Warning: {0}",
Severity = (int)LogEventType.Severities.Information, Severity = (int)LogEventType.Severities.Warning,
UseLive = true, UseLive = false,
UsePersist = true, UsePersist = true,
UseDisplay = true UseDisplay = true
}, },
new LogEventType new LogEventType
{ {
Id = (int)EventTypeIds.PluginConfigurationSaved, Id = (int)EventTypeIds.InitializeError,
ModuleId = _ModuleId, ModuleId = _ModuleId,
Name = "Plugin Configuration Saved", Name = "Initialize Error",
Format = "Plugin Configuration Saved: [{0}] by [{1}]", Format = "Initialize Error: {0}",
Severity = (int)LogEventType.Severities.Information, Severity = (int)LogEventType.Severities.Error,
UseLive = true, UseLive = false,
UsePersist = true, UsePersist = true,
UseDisplay = true UseDisplay = true
}, },
new LogEventType new LogEventType
{ {
Id = (int)EventTypeIds.PluginWebControllerAccessed, Id = (int)EventTypeIds.InitializeException,
ModuleId = _ModuleId, ModuleId = _ModuleId,
Name = "Plugin Web Controller Accessed", Name = "Initialize Exception",
Format = "Plugin Web Controller Accessed: Plugin [{0}], Action [{1}], By [{2}]", Format = "Exception: {0}; {1}: {2}; {3}",
Severity = (int)LogEventType.Severities.Information, Severity = (int)LogEventType.Severities.Error,
UseLive = true, UseLive = false,
UsePersist = true, UsePersist = true,
UseDisplay = true UseDisplay = true
}, },
new LogEventType new LogEventType
{ {
Id = (int)EventTypeIds.Installing, Id = (int)EventTypeIds.InitializeExceptionWithInner,
ModuleId = _ModuleId, ModuleId = _ModuleId,
Name = "Installing Plugin", Name = "Initialize Exception with Inner Exception",
Format = "Installing Plugin: {2} [{0} v{1}]", Format = "Exception: {0}; {1}: {2}; {3}; Inner: {4}: {5}; {6}",
Severity = (int)LogEventType.Severities.Information, Severity = (int)LogEventType.Severities.Error,
UseLive = true, UseLive = false,
UsePersist = true, UsePersist = true,
UseDisplay = true UseDisplay = true
}, },
new LogEventType new LogEventType
{ {
Id = (int)EventTypeIds.Installed, Id = (int)EventTypeIds.PluginException,
ModuleId = _ModuleId, ModuleId = _ModuleId,
Name = "Plugin Installed", Name = "Plugin Exception",
Format = "Plugin Installed: {2} [{0} v{1}], Location: {3}", Format = "Exception: {0}; {1}: {2}; {3}",
Severity = (int)LogEventType.Severities.Information, Severity = (int)LogEventType.Severities.Error,
UseLive = true, UseLive = true,
UsePersist = true, UsePersist = true,
UseDisplay = true UseDisplay = true
}, },
new LogEventType new LogEventType
{ {
Id = (int)EventTypeIds.BeforeUpdate, Id = (int)EventTypeIds.PluginExceptionWithInner,
ModuleId = _ModuleId, ModuleId = _ModuleId,
Name = "Updating Plugin", Name = "Plugin Exception with Inner Exception",
Format = "Updating Plugin: {1} [{0}], v{3} -> v{4}, Location: {2}", Format = "Exception: {0}; {1}: {2}; {3}; Inner: {4}: {5}; {6}",
Severity = (int)LogEventType.Severities.Information, Severity = (int)LogEventType.Severities.Error,
UseLive = true, UseLive = true,
UsePersist = true, UsePersist = true,
UseDisplay = true UseDisplay = true
}, },
new LogEventType new LogEventType
{ {
Id = (int)EventTypeIds.AfterUpdate, Id = (int)EventTypeIds.PluginWarning,
ModuleId = _ModuleId, ModuleId = _ModuleId,
Name = "Plugin Updated", Name = "Plugin Warning",
Format = "Plugin Updated: {1} [{0}], v{3} -> v{4}, Location: {2}", Format = "{0} [{1} v{2}]: {3}",
Severity = (int)LogEventType.Severities.Information, Severity = (int)LogEventType.Severities.Warning,
UseLive = false, UseLive = true,
UsePersist = true, UsePersist = true,
UseDisplay = true UseDisplay = true
}, },
new LogEventType new LogEventType
{ {
Id = (int)EventTypeIds.Uninstalling, Id = (int)EventTypeIds.PluginMessage,
ModuleId = _ModuleId, ModuleId = _ModuleId,
Name = "Uninstalling Plugin", Name = "Plugin Message",
Format = "Uninstalling Plugin: {1} [{0} v{3}], Location: {2}, UninstallData: {4}", Format = "{0} [{1} v{2}]: {3}",
Severity = (int)LogEventType.Severities.Information, Severity = (int)LogEventType.Severities.Information,
UseLive = true, UseLive = true,
UsePersist = true, UsePersist = true,
UseDisplay = true UseDisplay = true
}, },
new LogEventType new LogEventType
{ {
Id = (int)EventTypeIds.Uninstalled, Id = (int)EventTypeIds.PluginReferenceAssemblyLoaded,
ModuleId = _ModuleId, ModuleId = _ModuleId,
Name = "Plugin Uninstalled", Name = "Plugin Reference Assembly Loaded",
Format = "Plugin Uninstalled: {1} [{0} v{3}], Location: {2}, UninstallData: {4}", Format = "Loaded Plugin Reference Assembly: [{0}] From: '{1}'; Requested by: [{2}]",
Severity = (int)LogEventType.Severities.Information, Severity = (int)LogEventType.Severities.Information,
UseLive = false, UseLive = true,
UsePersist = true, UsePersist = true,
UseDisplay = true UseDisplay = true
} },
}; new LogEventType
{
Id = (int)EventTypeIds.PluginConfigurationLoaded,
ModuleId = _ModuleId,
Name = "Plugin Configuration Loaded",
Format = "Plugin Configuration Loaded: [{0}] by [{1}]",
Severity = (int)LogEventType.Severities.Information,
UseLive = true,
UsePersist = true,
UseDisplay = true
},
new LogEventType
{
Id = (int)EventTypeIds.PluginConfigurationSaved,
ModuleId = _ModuleId,
Name = "Plugin Configuration Saved",
Format = "Plugin Configuration Saved: [{0}] by [{1}]",
Severity = (int)LogEventType.Severities.Information,
UseLive = true,
UsePersist = true,
UseDisplay = true
},
new LogEventType
{
Id = (int)EventTypeIds.PluginWebControllerAccessed,
ModuleId = _ModuleId,
Name = "Plugin Web Controller Accessed",
Format = "Plugin Web Controller Accessed: Plugin [{0}], Action [{1}], By [{2}]",
Severity = (int)LogEventType.Severities.Information,
UseLive = true,
UsePersist = true,
UseDisplay = true
},
new LogEventType
{
Id = (int)EventTypeIds.Installing,
ModuleId = _ModuleId,
Name = "Installing Plugin",
Format = "Installing Plugin: {2} [{0} v{1}]",
Severity = (int)LogEventType.Severities.Information,
UseLive = true,
UsePersist = true,
UseDisplay = true
},
new LogEventType
{
Id = (int)EventTypeIds.Installed,
ModuleId = _ModuleId,
Name = "Plugin Installed",
Format = "Plugin Installed: {2} [{0} v{1}], Location: {3}",
Severity = (int)LogEventType.Severities.Information,
UseLive = true,
UsePersist = true,
UseDisplay = true
},
new LogEventType
{
Id = (int)EventTypeIds.BeforeUpdate,
ModuleId = _ModuleId,
Name = "Updating Plugin",
Format = "Updating Plugin: {1} [{0}], v{3} -> v{4}, Location: {2}",
Severity = (int)LogEventType.Severities.Information,
UseLive = true,
UsePersist = true,
UseDisplay = true
},
new LogEventType
{
Id = (int)EventTypeIds.AfterUpdate,
ModuleId = _ModuleId,
Name = "Plugin Updated",
Format = "Plugin Updated: {1} [{0}], v{3} -> v{4}, Location: {2}",
Severity = (int)LogEventType.Severities.Information,
UseLive = false,
UsePersist = true,
UseDisplay = true
},
new LogEventType
{
Id = (int)EventTypeIds.Uninstalling,
ModuleId = _ModuleId,
Name = "Uninstalling Plugin",
Format = "Uninstalling Plugin: {1} [{0} v{3}], Location: {2}, UninstallData: {4}",
Severity = (int)LogEventType.Severities.Information,
UseLive = true,
UsePersist = true,
UseDisplay = true
},
new LogEventType
{
Id = (int)EventTypeIds.Uninstalled,
ModuleId = _ModuleId,
Name = "Plugin Uninstalled",
Format = "Plugin Uninstalled: {1} [{0} v{3}], Location: {2}, UninstallData: {4}",
Severity = (int)LogEventType.Severities.Information,
UseLive = false,
UsePersist = true,
UseDisplay = true
}
};
} }
} }
} }
+2 -1
View File
@@ -139,7 +139,8 @@ namespace Disco.Services.Plugins
pluginPackagesLocation = database.DiscoConfiguration.PluginPackagesLocation; pluginPackagesLocation = database.DiscoConfiguration.PluginPackagesLocation;
installedPluginManifests = OfflineInstalledPlugins(database); installedPluginManifests = OfflineInstalledPlugins(database);
if (installedPluginManifests.Count > 0){ if (installedPluginManifests.Count > 0)
{
libraryManifest = PluginLibrary.LoadManifest(database); libraryManifest = PluginLibrary.LoadManifest(database);
libraryIncompatibility = libraryManifest.LoadIncompatibilityData(); libraryIncompatibility = libraryManifest.LoadIncompatibilityData();
} }
+1 -1
View File
@@ -18,7 +18,7 @@ namespace Disco.Services.Tasks
string FinishedMessage { get; } string FinishedMessage { get; }
string FinishedUrl { get; } string FinishedUrl { get; }
Exception TaskException { get; } Exception TaskException { get; }
void UpdateStatus(byte Progress); void UpdateStatus(byte Progress);
void UpdateStatus(double Progress); void UpdateStatus(double Progress);
@@ -3,8 +3,8 @@ using Microsoft.AspNet.SignalR;
using Microsoft.AspNet.SignalR.Hubs; using Microsoft.AspNet.SignalR.Hubs;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Reactive.Linq;
using System.Linq; using System.Linq;
using System.Reactive.Linq;
namespace Disco.Services.Tasks namespace Disco.Services.Tasks
{ {
+4 -4
View File
@@ -1,9 +1,9 @@
using System; using Disco.Data.Repository;
using System.Collections.Generic;
using System.Linq;
using Quartz; using Quartz;
using Quartz.Impl; using Quartz.Impl;
using Disco.Data.Repository; using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection; using System.Reflection;
namespace Disco.Services.Tasks namespace Disco.Services.Tasks
+101 -101
View File
@@ -1,10 +1,10 @@
using System; using Disco.Services.Logging;
using Disco.Services.Logging.Models;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data; using System.Data;
using System.Data.Entity.Validation; using System.Data.Entity.Validation;
using System.Text; using System.Text;
using Disco.Services.Logging;
using Disco.Services.Logging.Models;
namespace Disco.Services.Tasks namespace Disco.Services.Tasks
{ {
@@ -128,83 +128,83 @@ namespace Disco.Services.Tasks
{ {
return new List<LogEventType> return new List<LogEventType>
{ {
new LogEventType
{
Id = (int)EventTypeIds.InitializingScheduledTasks,
ModuleId = _ModuleId,
Name = "Initializing Scheduled Tasks",
Format = "Starting Scheduled Task discovery and initialization",
Severity = (int)LogEventType.Severities.Information,
UseLive = false,
UsePersist = true,
UseDisplay = true
},
new LogEventType
{
Id = (int)EventTypeIds.InitializeException,
ModuleId = _ModuleId,
Name = "Initialize Exception",
Format = "Exception: {0}: {1}; {2}",
Severity = (int)LogEventType.Severities.Error,
UseLive = false,
UsePersist = true,
UseDisplay = true
},
new LogEventType
{
Id = (int)EventTypeIds.InitializeExceptionWithInner,
ModuleId = _ModuleId,
Name = "Initialize Exception with Inner Exception",
Format = "Exception: {0}: {1}; {2}; Inner: {3}: {4}; {5}",
Severity = (int)LogEventType.Severities.Error,
UseLive = false,
UsePersist = true,
UseDisplay = true
},
new LogEventType new LogEventType
{ {
Id = (int)EventTypeIds.InitializeScheduledTasksException, Id = (int)EventTypeIds.InitializingScheduledTasks,
ModuleId = _ModuleId, ModuleId = _ModuleId,
Name = "Initialize Task Exception", Name = "Initializing Scheduled Tasks",
Format = "[{0}] At '{1}'; Exception: {2}: {3}; {4}", Format = "Starting Scheduled Task discovery and initialization",
Severity = (int)LogEventType.Severities.Error, Severity = (int)LogEventType.Severities.Information,
UseLive = false, UseLive = false,
UsePersist = true, UsePersist = true,
UseDisplay = true UseDisplay = true
}, },
new LogEventType new LogEventType
{ {
Id = (int)EventTypeIds.InitializeScheduledTasksExceptionWithInner, Id = (int)EventTypeIds.InitializeException,
ModuleId = _ModuleId, ModuleId = _ModuleId,
Name = "Initialize Task Exception with Inner Exception", Name = "Initialize Exception",
Format = "[{0}] At '{1}'; Exception: {2}: {3}; {4}; Inner: {5}: {6}; {7}", Format = "Exception: {0}: {1}; {2}",
Severity = (int)LogEventType.Severities.Error, Severity = (int)LogEventType.Severities.Error,
UseLive = false, UseLive = false,
UsePersist = true, UsePersist = true,
UseDisplay = true UseDisplay = true
}, },
new LogEventType new LogEventType
{ {
Id = (int)EventTypeIds.ScheduledTasksException, Id = (int)EventTypeIds.InitializeExceptionWithInner,
ModuleId = _ModuleId, ModuleId = _ModuleId,
Name = "Scheduled Task Exception", Name = "Initialize Exception with Inner Exception",
Format = "Task Name: {0}; SessionId: {1}; At: '{2}'; Exception: {3}: {4}; {5}", Format = "Exception: {0}: {1}; {2}; Inner: {3}: {4}; {5}",
Severity = (int)LogEventType.Severities.Error, Severity = (int)LogEventType.Severities.Error,
UseLive = true, UseLive = false,
UsePersist = true, UsePersist = true,
UseDisplay = true UseDisplay = true
}, },
new LogEventType new LogEventType
{ {
Id = (int)EventTypeIds.ScheduledTasksExceptionWithInner, Id = (int)EventTypeIds.InitializeScheduledTasksException,
ModuleId = _ModuleId, ModuleId = _ModuleId,
Name = "Scheduled Task Exception with Inner Exception", Name = "Initialize Task Exception",
Format = "Task Name: {0}; SessionId: {1}; At: '{2}'; Exception: {3}: {4}; {5}; Inner: {6}: {7}; {8}", Format = "[{0}] At '{1}'; Exception: {2}: {3}; {4}",
Severity = (int)LogEventType.Severities.Error, Severity = (int)LogEventType.Severities.Error,
UseLive = true, UseLive = false,
UsePersist = true, UsePersist = true,
UseDisplay = true UseDisplay = true
}, },
new LogEventType
{
Id = (int)EventTypeIds.InitializeScheduledTasksExceptionWithInner,
ModuleId = _ModuleId,
Name = "Initialize Task Exception with Inner Exception",
Format = "[{0}] At '{1}'; Exception: {2}: {3}; {4}; Inner: {5}: {6}; {7}",
Severity = (int)LogEventType.Severities.Error,
UseLive = false,
UsePersist = true,
UseDisplay = true
},
new LogEventType
{
Id = (int)EventTypeIds.ScheduledTasksException,
ModuleId = _ModuleId,
Name = "Scheduled Task Exception",
Format = "Task Name: {0}; SessionId: {1}; At: '{2}'; Exception: {3}: {4}; {5}",
Severity = (int)LogEventType.Severities.Error,
UseLive = true,
UsePersist = true,
UseDisplay = true
},
new LogEventType
{
Id = (int)EventTypeIds.ScheduledTasksExceptionWithInner,
ModuleId = _ModuleId,
Name = "Scheduled Task Exception with Inner Exception",
Format = "Task Name: {0}; SessionId: {1}; At: '{2}'; Exception: {3}: {4}; {5}; Inner: {6}: {7}; {8}",
Severity = (int)LogEventType.Severities.Error,
UseLive = true,
UsePersist = true,
UseDisplay = true
},
new LogEventType new LogEventType
{ {
Id = (int)EventTypeIds.ScheduledTasksWarning, Id = (int)EventTypeIds.ScheduledTasksWarning,
@@ -227,28 +227,28 @@ namespace Disco.Services.Tasks
UsePersist = true, UsePersist = true,
UseDisplay = true UseDisplay = true
}, },
new LogEventType new LogEventType
{ {
Id = (int)EventTypeIds.ScheduledTaskExecuted, Id = (int)EventTypeIds.ScheduledTaskExecuted,
ModuleId = _ModuleId, ModuleId = _ModuleId,
Name = "Scheduled Task Started", Name = "Scheduled Task Started",
Format = "Scheduled Task Started: {0}; Session Id: {1}", Format = "Scheduled Task Started: {0}; Session Id: {1}",
Severity = (int)LogEventType.Severities.Information, Severity = (int)LogEventType.Severities.Information,
UseLive = true, UseLive = true,
UsePersist = true, UsePersist = true,
UseDisplay = true UseDisplay = true
}, },
new LogEventType new LogEventType
{ {
Id = (int)EventTypeIds.ScheduledTaskFinished, Id = (int)EventTypeIds.ScheduledTaskFinished,
ModuleId = _ModuleId, ModuleId = _ModuleId,
Name = "Scheduled Task Finished", Name = "Scheduled Task Finished",
Format = "Scheduled Task Finished: {0}; Session Id: {1}", Format = "Scheduled Task Finished: {0}; Session Id: {1}",
Severity = (int)LogEventType.Severities.Information, Severity = (int)LogEventType.Severities.Information,
UseLive = true, UseLive = true,
UsePersist = true, UsePersist = true,
UseDisplay = true UseDisplay = true
} }
}; };
} }
} }
@@ -8,7 +8,7 @@ namespace Disco.Services.Users.UserFlags
{ {
public override string TaskName { get { return "User Flags - Delete Flag"; } } public override string TaskName { get { return "User Flags - Delete Flag"; } }
public override bool SingleInstanceTask { get { return false; }} public override bool SingleInstanceTask { get { return false; } }
public override bool CancelInitiallySupported { get { return false; } } public override bool CancelInitiallySupported { get { return false; } }
public override bool LogExceptionsOnly { get { return true; } } public override bool LogExceptionsOnly { get { return true; } }
@@ -1,5 +1,5 @@
using Disco.Services.Authorization; using Disco.Models.Repository;
using Disco.Models.Repository; using Disco.Services.Authorization;
using Disco.Services.Users; using Disco.Services.Users;
namespace Disco.Services.Web namespace Disco.Services.Web
@@ -1,8 +1,8 @@
using System; using Disco.Services.Plugins;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Web.Mvc; using System.Web.Mvc;
using Disco.Services.Plugins;
namespace Disco.Web.Extensions namespace Disco.Web.Extensions
{ {
@@ -1,7 +1,7 @@
using System.Collections.Generic; using Disco.Models.Repository;
using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Web.Mvc; using System.Web.Mvc;
using Disco.Models.Repository;
namespace Disco.Web.Extensions namespace Disco.Web.Extensions
{ {
@@ -1,7 +1,7 @@
using System.Collections.Generic; using Disco.Models.Repository;
using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Web.Mvc; using System.Web.Mvc;
using Disco.Models.Repository;
namespace Disco.Web.Extensions namespace Disco.Web.Extensions
{ {
@@ -1,7 +1,7 @@
using System.Collections.Generic; using Disco.Models.Repository;
using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Web.Mvc; using System.Web.Mvc;
using Disco.Models.Repository;
namespace Disco.Web.Extensions namespace Disco.Web.Extensions
{ {
@@ -1,7 +1,7 @@
using System.Collections.Generic; using Disco.Models.Repository;
using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Web.Mvc; using System.Web.Mvc;
using Disco.Models.Repository;
namespace Disco.Web.Extensions namespace Disco.Web.Extensions
{ {
@@ -1,6 +1,6 @@
using System.Collections.Generic; using Disco.Models.Repository;
using System.Collections.Generic;
using System.Linq; using System.Linq;
using Disco.Models.Repository;
using System.Web.Mvc; using System.Web.Mvc;
namespace Disco.Web.Extensions namespace Disco.Web.Extensions
@@ -1,7 +1,7 @@
using System; using Newtonsoft.Json;
using System;
using System.Text; using System.Text;
using System.Web.Mvc; using System.Web.Mvc;
using Newtonsoft.Json;
namespace Disco.Web.Extensions namespace Disco.Web.Extensions
{ {
@@ -1,9 +1,9 @@
using System; using System;
using System.Web.Mvc;
using System.Web;
using System.Web.WebPages;
using System.IO;
using System.Globalization; using System.Globalization;
using System.IO;
using System.Web;
using System.Web.Mvc;
using System.Web.WebPages;
namespace Disco.Web.Extensions namespace Disco.Web.Extensions
{ {
@@ -2,8 +2,8 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Linq.Expressions; using System.Linq.Expressions;
using System.Web.Mvc.Html;
using System.Web.Mvc; using System.Web.Mvc;
using System.Web.Mvc.Html;
namespace Disco.Web.Extensions namespace Disco.Web.Extensions
{ {
@@ -1,6 +1,6 @@
using RazorGenerator.Mvc;
using System.Web.Mvc; using System.Web.Mvc;
using System.Web.WebPages; using System.Web.WebPages;
using RazorGenerator.Mvc;
[assembly: WebActivatorEx.PostApplicationStartMethod(typeof(Disco.Web.RazorGeneratorMvcStart), "Start")] [assembly: WebActivatorEx.PostApplicationStartMethod(typeof(Disco.Web.RazorGeneratorMvcStart), "Start")]
@@ -1263,7 +1263,8 @@ namespace Disco.Web.Areas.API.Controllers
Scope = $"User Detail '{key}' didn't match any users{(string.IsNullOrWhiteSpace(value) ? null : $" with the value '{value}'")}", Scope = $"User Detail '{key}' didn't match any users{(string.IsNullOrWhiteSpace(value) ? null : $" with the value '{value}'")}",
IsError = true, IsError = true,
}); });
} else }
else
{ {
foreach (var user in details.Select(d => d.User).Distinct()) foreach (var user in details.Select(d => d.User).Distinct())
{ {
@@ -1431,7 +1432,7 @@ namespace Disco.Web.Areas.API.Controllers
UiUrl = handler.GenerationOptionsUi == null ? null : Url.Action(MVC.API.DocumentTemplate.GenerateDocumentHandlerUi(template.Id, target.AttachmentReferenceId, f.Id)), UiUrl = handler.GenerationOptionsUi == null ? null : Url.Action(MVC.API.DocumentTemplate.GenerateDocumentHandlerUi(template.Id, target.AttachmentReferenceId, f.Id)),
Icon = handler.GenerationOptionsIcon, Icon = handler.GenerationOptionsIcon,
}); });
}; }
return Enumerable.Empty<DocumentHandlerModel>(); return Enumerable.Empty<DocumentHandlerModel>();
}).ToList(); }).ToList();
@@ -246,7 +246,7 @@ namespace Disco.Web.Areas.API.Controllers
public virtual async Task<ActionResult> AttachmentOnlineUploadSession(string id, string domain) public virtual async Task<ActionResult> AttachmentOnlineUploadSession(string id, string domain)
{ {
var userId = ActiveDirectory.ParseDomainAccountId(id, domain); var userId = ActiveDirectory.ParseDomainAccountId(id, domain);
if (!UserService.TryGetUser(userId, Database, false,out var user)) if (!UserService.TryGetUser(userId, Database, false, out var user))
throw new InvalidOperationException("Unknown User"); throw new InvalidOperationException("Unknown User");
try try
@@ -1,6 +1,6 @@
using System.Collections.Generic; using Disco.Services.Logging;
using System.Collections.Generic;
using System.Linq; using System.Linq;
using Disco.Services.Logging;
namespace Disco.Web.Areas.API.Models.Logs namespace Disco.Web.Areas.API.Models.Logs
{ {
@@ -138,7 +138,7 @@ namespace Disco.Web.Areas.Config
context.MapRoute( context.MapRoute(
"Config_Plugins", "Config_Plugins",
"Config/Plugins", "Config/Plugins",
new { controller = "Plugins", action = "Index"} new { controller = "Plugins", action = "Index" }
); );
context.MapRoute( context.MapRoute(
"Config_Plugins_Install", "Config_Plugins_Install",
@@ -15,10 +15,10 @@ namespace Disco.Web.Areas.Config.Controllers
public virtual ActionResult Index() public virtual ActionResult Index()
{ {
IndexViewModel vm = new IndexViewModel() IndexViewModel vm = new IndexViewModel()
{ {
PluginManifests = Plugins.GetPlugins(), PluginManifests = Plugins.GetPlugins(),
PluginLibrary = PluginLibrary.LoadManifest(Database) PluginLibrary = PluginLibrary.LoadManifest(Database)
}; };
return View(vm); return View(vm);
} }
@@ -1,7 +1,7 @@
using System.Collections.Generic; using Disco.Models.Services.Authorization;
using Disco.Models.UI.Config.AuthorizationRole; using Disco.Models.UI.Config.AuthorizationRole;
using Disco.Models.Services.Authorization;
using Disco.Web.Areas.API.Models.Shared; using Disco.Web.Areas.API.Models.Shared;
using System.Collections.Generic;
namespace Disco.Web.Areas.Config.Models.AuthorizationRole namespace Disco.Web.Areas.Config.Models.AuthorizationRole
{ {
@@ -1,7 +1,7 @@
using System.Collections.Generic; using Disco.Data.Repository;
using System.Linq;
using Disco.Data.Repository;
using Disco.Models.UI.Config.DeviceBatch; using Disco.Models.UI.Config.DeviceBatch;
using System.Collections.Generic;
using System.Linq;
namespace Disco.Web.Areas.Config.Models.DeviceBatch namespace Disco.Web.Areas.Config.Models.DeviceBatch
{ {
@@ -1,6 +1,6 @@
using System; using Disco.Models.UI.Config.DeviceBatch;
using System;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Disco.Models.UI.Config.DeviceBatch;
namespace Disco.Web.Areas.Config.Models.DeviceBatch namespace Disco.Web.Areas.Config.Models.DeviceBatch
{ {
@@ -1,7 +1,7 @@
using System.Collections.Generic; using Disco.Data.Repository;
using System.Linq;
using Disco.Data.Repository;
using Disco.Models.UI.Config.DeviceModel; using Disco.Models.UI.Config.DeviceModel;
using System.Collections.Generic;
using System.Linq;
namespace Disco.Web.Areas.Config.Models.DeviceModel namespace Disco.Web.Areas.Config.Models.DeviceModel
{ {
@@ -1,9 +1,9 @@
using System.Collections.Generic; using Disco.Data.Repository;
using Disco.Models.UI.Config.DocumentTemplate;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq; using System.Linq;
using System.Web; using System.Web;
using System.ComponentModel.DataAnnotations;
using Disco.Data.Repository;
using Disco.Models.UI.Config.DocumentTemplate;
namespace Disco.Web.Areas.Config.Models.DocumentTemplate namespace Disco.Web.Areas.Config.Models.DocumentTemplate
{ {
@@ -1,7 +1,7 @@
using System.Collections.Generic; using Disco.Models.UI.Config.Logging;
using Disco.Services.Logging; using Disco.Services.Logging;
using Disco.Services.Logging.Models; using Disco.Services.Logging.Models;
using Disco.Models.UI.Config.Logging; using System.Collections.Generic;
namespace Disco.Web.Areas.Config.Models.Logging namespace Disco.Web.Areas.Config.Models.Logging
{ {
@@ -1,14 +1,14 @@
using System.Collections.Generic; using Disco.Models.BI.Config;
using Disco.Models.BI.Config;
using System.ComponentModel.DataAnnotations;
using Disco.Models.UI.Config.Organisation; using Disco.Models.UI.Config.Organisation;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace Disco.Web.Areas.Config.Models.Organisation namespace Disco.Web.Areas.Config.Models.Organisation
{ {
public class IndexModel : ConfigOrganisationIndexModel public class IndexModel : ConfigOrganisationIndexModel
{ {
public string OrganisationName { get; set; } public string OrganisationName { get; set; }
[Display(Name="Enabled")] [Display(Name = "Enabled")]
public bool MultiSiteMode { get; set; } public bool MultiSiteMode { get; set; }
public List<OrganisationAddress> OrganisationAddresses { get; set; } public List<OrganisationAddress> OrganisationAddresses { get; set; }
} }
@@ -23,7 +23,7 @@ namespace Disco.Web.Areas.Config.Models.Plugins
if (PluginLibrary == null || PluginLibrary.Plugins == null || PluginLibrary.Plugins.Count == 0 || if (PluginLibrary == null || PluginLibrary.Plugins == null || PluginLibrary.Plugins.Count == 0 ||
PluginManifests == null || PluginManifests.Count == 0) PluginManifests == null || PluginManifests.Count == 0)
{ {
_PluginUpdates = new Dictionary<PluginManifest,Tuple<PluginLibraryItemV2,PluginLibraryItemReleaseV2>>(); // No Updates _PluginUpdates = new Dictionary<PluginManifest, Tuple<PluginLibraryItemV2, PluginLibraryItemReleaseV2>>(); // No Updates
} }
else else
{ {
@@ -77,7 +77,7 @@ namespace Disco.Web.Areas.Config.Models.SystemConfig
#region Active Directory #region Active Directory
[Display(Name="Search All Servers")] [Display(Name = "Search All Servers")]
public bool ADSearchAllServers { get; set; } public bool ADSearchAllServers { get; set; }
public List<ADDomain> ADDomains { get; set; } public List<ADDomain> ADDomains { get; set; }
@@ -20,14 +20,14 @@ namespace Disco.Web.Areas.Public.Models.UserHeldDevices
public UserHeldDeviceModel ToUserHeldDeviceModel(DiscoDataContext Database) public UserHeldDeviceModel ToUserHeldDeviceModel(DiscoDataContext Database)
{ {
var uhdm = new UserHeldDeviceModel() var uhdm = new UserHeldDeviceModel()
{ {
UserId = UserId, UserId = UserId,
UserDisplayName = UserDisplayName, UserDisplayName = UserDisplayName,
ReadyForReturn = ReadyForReturn, ReadyForReturn = ReadyForReturn,
WaitingForUserAction = WaitingForUserAction, WaitingForUserAction = WaitingForUserAction,
DeviceProfileId = DeviceProfileId, DeviceProfileId = DeviceProfileId,
DeviceAddress = (DeviceAddressId.HasValue ? Database.DiscoConfiguration.OrganisationAddresses.GetAddress(DeviceAddressId.Value)?.ShortName : string.Empty) DeviceAddress = (DeviceAddressId.HasValue ? Database.DiscoConfiguration.OrganisationAddresses.GetAddress(DeviceAddressId.Value)?.ShortName : string.Empty)
}; };
var n = DateTime.Now; var n = DateTime.Now;
if (!ReadyForReturn && EstimatedReturnTime.HasValue && EstimatedReturnTime.Value > n) if (!ReadyForReturn && EstimatedReturnTime.HasValue && EstimatedReturnTime.Value > n)
{ {
@@ -67,7 +67,8 @@ namespace Disco.Web.Controllers
{ {
if (!Request.IsLocal && !ServerIsCoreSKU.Value && !("true".Equals(ConfigurationManager.AppSettings["DiscoAllowRemoteMaintenance"], StringComparison.OrdinalIgnoreCase))) if (!Request.IsLocal && !ServerIsCoreSKU.Value && !("true".Equals(ConfigurationManager.AppSettings["DiscoAllowRemoteMaintenance"], StringComparison.OrdinalIgnoreCase)))
{ {
filterContext.Result = new ContentResult() { filterContext.Result = new ContentResult()
{
Content = "Initial Configuration of Disco ICT is only allowed via a localhost connection", Content = "Initial Configuration of Disco ICT is only allowed via a localhost connection",
ContentType = "text/plain" ContentType = "text/plain"
}; };
@@ -1,10 +1,10 @@
using System; using Disco.Services.Authorization;
using Disco.Services.Interop;
using Disco.Services.Plugins;
using Disco.Services.Users;
using System;
using System.IO; using System.IO;
using System.Web.Mvc; using System.Web.Mvc;
using Disco.Services.Plugins;
using Disco.Services.Authorization;
using Disco.Services.Users;
using Disco.Services.Interop;
namespace Disco.Web.Controllers namespace Disco.Web.Controllers
{ {
+2 -2
View File
@@ -1,5 +1,5 @@
using System.Collections.Generic; using Disco.Models.UI.Device;
using Disco.Models.UI.Device; using System.Collections.Generic;
namespace Disco.Web.Models.Device namespace Disco.Web.Models.Device
{ {
@@ -73,7 +73,7 @@ namespace Disco.Web.Models.InitialConfig
[CustomValidation(typeof(DatabaseModel), "SqlAuthRequired", ErrorMessage = "When using SQL Authentication a Username is required")] [CustomValidation(typeof(DatabaseModel), "SqlAuthRequired", ErrorMessage = "When using SQL Authentication a Username is required")]
public string Auth_SQL_Username { get; set; } public string Auth_SQL_Username { get; set; }
[DataType(DataType.Password), CustomValidation(typeof(DatabaseModel), "SqlAuthRequired", ErrorMessage="When using SQL Authentication a Password is required")] [DataType(DataType.Password), CustomValidation(typeof(DatabaseModel), "SqlAuthRequired", ErrorMessage = "When using SQL Authentication a Password is required")]
public string Auth_SQL_Password { get; set; } public string Auth_SQL_Password { get; set; }
public List<SelectListItem> AuthMethods public List<SelectListItem> AuthMethods
+1 -1
View File
@@ -1,6 +1,6 @@
using Disco.Models.ClientServices; using Disco.Models.ClientServices;
using Disco.Models.Services.Jobs.Statistics;
using Disco.Models.Services.Jobs.JobLists; using Disco.Models.Services.Jobs.JobLists;
using Disco.Models.Services.Jobs.Statistics;
using Disco.Models.UI.Job; using Disco.Models.UI.Job;
using System.Collections.Generic; using System.Collections.Generic;
+1 -1
View File
@@ -6,8 +6,8 @@ using Newtonsoft.Json;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Data.Entity; using System.Data.Entity;
using System.Linq;
namespace Disco.Web.Models.Job namespace Disco.Web.Models.Job
{ {
+2 -1
View File
@@ -82,7 +82,8 @@ namespace Disco.Web.Models.Job
try try
{ {
UserService.GetUser(jobUserId, Database, true); UserService.GetUser(jobUserId, Database, true);
} catch (Exception) {} }
catch (Exception) { }
} }
Job = Database.Jobs Job = Database.Jobs
+2 -2
View File
@@ -1,5 +1,5 @@
using Disco.Models.Services.Searching; using Disco.Models.Services.Jobs.JobLists;
using Disco.Models.Services.Jobs.JobLists; using Disco.Models.Services.Searching;
using Disco.Models.UI.Search; using Disco.Models.UI.Search;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;