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
@@ -1,14 +1,18 @@
using RazorGenerator.Mvc;
using System.Web;
using System.Web.Mvc;
using System.Web.WebPages;
using RazorGenerator.Mvc;
[assembly: WebActivatorEx.PostApplicationStartMethod(typeof(Disco.Services.App_Start.RazorGeneratorMvcStart), "Start")]
namespace Disco.Services.App_Start {
public static class RazorGeneratorMvcStart {
public static void Start() {
var engine = new PrecompiledMvcEngine(typeof(RazorGeneratorMvcStart).Assembly) {
namespace Disco.Services.App_Start
{
public static class RazorGeneratorMvcStart
{
public static void Start()
{
var engine = new PrecompiledMvcEngine(typeof(RazorGeneratorMvcStart).Assembly)
{
UsePhysicalViewsIfNewer = HttpContext.Current.Request.IsLocal
};
@@ -43,7 +43,7 @@ namespace Disco.Services.Authorization
Name = "Access Denied",
Format = "User: {0}; Resource: {1}; Reason: {2}",
Severity = (int)LogEventType.Severities.Warning,
UseLive = true, UsePersist = true, UseDisplay = true
UseLive = true, UsePersist = true, UseDisplay = true
},
new LogEventType() {
Id = (int)EventTypeIds.RoleCreated,
@@ -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 System;
using System.Collections.Generic;
@@ -9,7 +9,7 @@ namespace Disco.Services.Authorization
public class ClaimNavigatorItem : IClaimNavigatorItem
{
private Func<RoleClaims, bool> accessor { get; set; }
public string Key { get; private set; }
public string Name { get; private set; }
public string Description { get; private set; }
@@ -49,15 +49,15 @@ namespace Disco.Services.Authorization
public IClaimNavigatorItem BuildClaimTree(RoleClaims RoleClaims)
{
return new ClaimNavigatorItem()
{
Key = Key,
Name = Name,
Description = Description,
Hidden = Hidden,
accessor = accessor,
Value = accessor == null ? (bool?)null : accessor(RoleClaims),
Children = Children == null ? null : Children.Cast<ClaimNavigatorItem>().Select(c => c.BuildClaimTree(RoleClaims)).ToList()
};
{
Key = Key,
Name = Name,
Description = Description,
Hidden = Hidden,
accessor = accessor,
Value = accessor == null ? (bool?)null : accessor(RoleClaims),
Children = Children == null ? null : Children.Cast<ClaimNavigatorItem>().Select(c => c.BuildClaimTree(RoleClaims)).ToList()
};
}
public IClaimNavigatorItem BuildClaimTree(IEnumerable<RoleClaims> RoleClaims)
@@ -30,11 +30,10 @@ namespace Disco.Services.Authorization
if (UserService.CurrentAuthorization == null)
resultMessage = AuthorizationToken.RequireAuthenticationMessage;
else if (string.IsNullOrEmpty(authorizedClaim))
resultMessage = AuthorizationToken.RequireDiscoAuthorizationMessage;
else
if (string.IsNullOrEmpty(authorizedClaim))
resultMessage = AuthorizationToken.RequireDiscoAuthorizationMessage;
else
resultMessage = AuthorizationToken.BuildRequireMessage(authorizedClaim);
resultMessage = AuthorizationToken.BuildRequireMessage(authorizedClaim);
return resultMessage;
}
@@ -26,7 +26,7 @@
[ClaimDetails("Bulk Generate Document Templates", "Can bulk generate document templates")]
public bool BulkGenerate { get; set; }
[ClaimDetails("Export Attachment Instances", "Can export document attachment instances")]
public bool Export { get; set; }
@@ -8,7 +8,7 @@
[ClaimDetails("Configure Proxy Settings", "Can configure the proxy settings")]
public bool ConfigureProxy { get; set; }
[ClaimDetails("Configure Email Settings", "Can configure the email settings")]
public bool ConfigureEmail { get; set; }
@@ -24,7 +24,7 @@
public bool DevicesReadyForReturn { get; set; }
[ClaimDetails("Devices Awaiting Repair List", "Can show list")]
public bool DevicesAwaitingRepair { get; set; }
[ClaimDetails("Awaiting Finance List", "Can show list")]
public bool AwaitingFinance { get; set; }
@@ -36,7 +36,7 @@
public bool AwaitingFinanceInsuranceProcessing { get; set; }
[ClaimDetails("Awaiting Finance Agreement Breach List", "Can show list (NOTE: Requires Awaiting Finance List)")]
public bool AwaitingFinanceAgreementBreach { get; set; }
[ClaimDetails("Awaiting User Action List", "Can show list")]
public bool AwaitingUserAction { get; set; }
[ClaimDetails("Recently Closed List", "Can show list")]
@@ -17,7 +17,7 @@
public bool ShowSImg { get; set; }
[ClaimDetails("Show Software - Operating System Jobs", "Can show jobs of this type")]
public bool ShowSOS { get; set; }
[ClaimDetails("Show User Management Jobs", "Can show jobs of this type")]
public bool ShowUMgmt { get; set; }
@@ -1,11 +1,11 @@
using Disco.Data.Repository;
using Disco.Models.Services.Authorization;
using Disco.Models.Repository;
using Disco.Models.Services.Authorization;
using Disco.Services.Interop.ActiveDirectory;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using Disco.Services.Interop.ActiveDirectory;
using Newtonsoft.Json;
namespace Disco.Services.Authorization.Roles
{
@@ -156,7 +156,7 @@ namespace Disco.Services.Authorization.Roles
{
// Determine roles which need migration from DBv11 -> DBv14
var affectedRoles_DBv14 = Database.AuthorizationRoles.Where(r => !r.ClaimsJson.Contains("MyJobs")).ToList();
// Determine roles which need migration from DBv14 -> DBv15
var affectedRoles_DBv15 = Database.AuthorizationRoles.Where(r => !r.ClaimsJson.Contains("RepairProviderDetails")).ToList();
@@ -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 System;
using System.Collections.Generic;
@@ -20,7 +20,7 @@ namespace Disco.Services.Authorization.Roles
return FromAuthorizationRole(Role, claims);
}
internal static RoleToken FromAuthorizationRole(AuthorizationRole Role, RoleClaims Claims)
{
string[] sg = (Role.SubjectIds == null ? new string[0] : Role.SubjectIds.Split(',').ToArray());
@@ -111,7 +111,7 @@ namespace Disco.Services.Devices.DeviceFlags
var assignment = (DeviceFlagAssignment)Event.Entity;
var domainId = assignment.Device?.DeviceDomainId;
if (!ActiveDirectory.IsValidDomainAccountId(domainId))
return;
domainId += "$";
@@ -189,7 +189,7 @@ namespace Disco.Services.Devices.DeviceFlags
status.UpdateStatus((chunkIndexOffset + index) * progressInterval, $"Removing Flag: {flagAssignment.Device}");
flagAssignment.OnRemoveUnsafe(database, technician);
return flagAssignment;
}).ToList();
@@ -8,7 +8,7 @@ namespace Disco.Services.Devices.DeviceFlags
{
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 LogExceptionsOnly { get { return true; } }
@@ -168,7 +168,7 @@ namespace Disco.Services.Devices.Enrolment
Request.Hardware.Model,
Request.Hardware.ModelType);
}
public static void LogSessionProgress(string SessionId, int Progress, string Status)
{
Log(EventTypeIds.SessionProgress, new object[]
@@ -35,7 +35,7 @@ namespace Disco.Services.Devices.Importing.Fields
else if (ExistingDevice != null)
{
var detail = ExistingDevice.DeviceDetails.FirstOrDefault(dd => dd.Scope == DeviceDetail.ScopeHardware && dd.Key == DeviceDetail.HardwareKeyACAdapter);
if (detail == null && parsedValue == null)
return Success(EntityState.Unchanged);
else if (detail == null && parsedValue != null)
@@ -35,7 +35,7 @@ namespace Disco.Services.Devices.Importing.Fields
else if (ExistingDevice != null)
{
var detail = ExistingDevice.DeviceDetails.FirstOrDefault(dd => dd.Scope == DeviceDetail.ScopeHardware && dd.Key == DeviceDetail.HardwareKeyWLanMacAddress);
if (detail == null && parsedValue == null)
return Success(EntityState.Unchanged);
else if (detail == null && parsedValue != null)
@@ -16,7 +16,7 @@ namespace Disco.Services.Devices.ManagedGroups
private const string DescriptionFormat = "Devices within the {0} Batch will have their assigned users added to this Active Directory group.";
private const string CategoryDescriptionFormat = "Assigned Users Linked Group";
private const string GroupDescriptionFormat = "{0} [Device Batch Assigned Users]";
private static Lazy<IObservable<RepositoryMonitorEvent>> RepositoryEvents;
private IDisposable repositorySubscription;
@@ -16,7 +16,7 @@ namespace Disco.Services.Devices.ManagedGroups
private const string DescriptionFormat = "Devices within the {0} Profile will have their assigned users added to this Active Directory group.";
private const string CategoryDescriptionFormat = "Assigned Users Linked Group";
private const string GroupDescriptionFormat = "{0} [Device Profile Assigned Users]";
private static Lazy<IObservable<RepositoryMonitorEvent>> RepositoryEvents;
private IDisposable repositorySubscription;
@@ -16,7 +16,7 @@ namespace Disco.Services.Devices.ManagedGroups
private const string DescriptionFormat = "Devices within the {0} Profile will be added to this Active Directory group.";
private const string CategoryDescriptionFormat = "Devices Linked Group";
private const string GroupDescriptionFormat = "{0} [Device Profile Devices]";
private static Lazy<IObservable<RepositoryMonitorEvent>> RepositoryEvents;
private IDisposable repositorySubscription;
@@ -270,7 +270,7 @@ namespace Disco.Services.Documents.AttachmentImport
{
var rules = Identifier.DocumentTemplate.GetOnImportUserFlagRules();
foreach ( var rule in rules)
foreach (var rule in rules)
{
rule.Apply(Database, Identifier.Target, creatorUser);
}
+1 -1
View File
@@ -249,7 +249,7 @@ namespace Disco.Services.Documents
{
var query = database.UserAttachments
.Include(a => a.User);
if (Options.HasDeviceOptions())
query = query.Include(a => a.User.DeviceUserAssignments.Select(u => u.Device));
if (Options.HasDeviceBatchOptions())
@@ -20,9 +20,8 @@ namespace Disco.Services.Expressions
{
if (expressionParseException == null)
return null;
else
if (evaluateParseException == null)
evaluateParseException = EvaluateExpressionParseException.FromRecognitionException(expressionParseException, Source);
else if (evaluateParseException == null)
evaluateParseException = EvaluateExpressionParseException.FromRecognitionException(expressionParseException, Source);
return evaluateParseException;
}
}
@@ -24,10 +24,10 @@ namespace Disco.Services.Expressions.Extensions.ImageResultImplementations
public override MemoryStream GetImage(out int width, out int height)
{
var image = Image;
width = image.Width;
height = image.Height;
return OutputBitmapImage(image);
}
}
@@ -53,7 +53,8 @@ namespace Disco.Services.Expressions.Extensions.ImageResultImplementations
{
maxWidth = images.Sum(i => i.Width);
maxHeight = images.Max(i => i.Height);
}else if (MontageVerticalLayout)
}
else if (MontageVerticalLayout)
{
maxWidth = images.Max(i => i.Width);
maxHeight = images.Sum(i => i.Height);
@@ -2,14 +2,14 @@ using System.Collections;
namespace Disco.Services.Expressions
{
public interface IExpressionPart
{
public interface IExpressionPart
{
string RawSource { get; set; }
string Source { get; set; }
string Source { get; set; }
bool ErrorsAllowed { get; set; }
bool ParseError { get; }
string ParseErrorMessage { get; }
bool IsDynamic { get; set; }
object Evaluate(object ExpressionContext, IDictionary Variables);
}
bool IsDynamic { get; set; }
object Evaluate(object ExpressionContext, IDictionary Variables);
}
}
@@ -50,7 +50,7 @@ namespace Disco
IEnumerator IEnumerable.GetEnumerator()
=> new OneOfEnumerator(instance);
private struct OneOfEnumerator : IEnumerator<T>
{
private readonly T instance;
@@ -178,7 +178,7 @@ namespace Disco.Services
public static void DrawImageResized(this Graphics graphics, Image SourceImage, float Scale, float LocationX, float LocationY)
{
RectangleF clipBounds = graphics.VisibleClipBounds;
float width = SourceImage.Width * Scale,
height = SourceImage.Height * Scale,
x = LocationX,
@@ -63,7 +63,7 @@ namespace Disco.Services.Interop.ActiveDirectory
ADDomain deviceDomain;
ActiveDirectory.ParseDomainAccountId(Device.DeviceDomainId + "$", out deviceSamAccountName, out deviceDomain);
var ldapFilter = string.Format(ldapFilterTemplate, ADHelpers.EscapeLdapQuery(deviceSamAccountName));
IEnumerable<ADDomainController> domainControllers;
@@ -12,7 +12,7 @@ namespace Disco.Services.Interop.ActiveDirectory
private ConcurrentDictionary<SecurityIdentifier, Tuple<ADGroup, DateTime>> securityIdentifierCache;
private ConcurrentDictionary<string, Tuple<ADGroup, DateTime>> distinguishedNameCache;
private const long CacheTimeoutTicks = 6000000000; // 10 Minutes
private const int CacheCleanIntervalMinutes = 15;
private DateTime cacheCleanNext;
private object cacheCleanLock = new object();
@@ -1,9 +1,9 @@
using System;
using Disco.Data.Repository;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Reactive.Subjects;
using Disco.Data.Repository;
namespace Disco.Services.Interop.ActiveDirectory
{
@@ -468,7 +468,7 @@ namespace Disco.Services.Interop.ActiveDirectory
{
return new ADManagedGroupScheduledActionItem[]
{
new ADManagedGroupScheduledActionItem(ManagedGroup, ActionType, InvokingIdentifier)
new ADManagedGroupScheduledActionItem(ManagedGroup, ActionType, InvokingIdentifier)
};
}
}
@@ -8,7 +8,7 @@ namespace Disco.Services.Interop.ActiveDirectory
string DistinguishedName { get; }
SecurityIdentifier SecurityIdentifier { get; }
string Id { get; }
string SamAccountName { get; }
@@ -15,9 +15,9 @@ using System.Text;
namespace Disco.Services.Interop.DiscoServices
{
using StatisticInt = UpdateRequestV2.StatisticInt;
using StatisticIntPair = UpdateRequestV2.StatisticIntPair;
using StatisticJob = UpdateRequestV2.StatisticJob;
using StatisticString = UpdateRequestV2.StatisticString;
using StatisticIntPair = UpdateRequestV2.StatisticIntPair;
public static class UpdateQuery
{
+1 -1
View File
@@ -83,7 +83,7 @@ namespace Disco.Services
public static string JobStatusDescription(string StatusId, Job j)
=> JobStatusDescription(StatusId, j?.DeviceHeld, j?.JobMetaWarranty?.ExternalName, j?.JobMetaNonWarranty?.RepairerName);
public static string JobStatusDescription(string StatusId, JobTableStatusItemModel j)
=> JobStatusDescription(StatusId, j?.DeviceHeld, j?.JobMetaWarranty_ExternalName, j?.JobMetaNonWarranty_RepairerName);
@@ -264,7 +264,7 @@ namespace Disco.Services
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);
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 bool SingleInstanceTask { get { return false; }}
public override bool SingleInstanceTask { get { return false; } }
public override bool CancelInitiallySupported { get { return false; } }
public override bool LogExceptionsOnly { get { return true; } }
+1 -1
View File
@@ -2,6 +2,7 @@
using Disco.Data.Repository.Monitor;
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Users;
using Disco.Services.Web.Signalling;
using Microsoft.AspNet.SignalR;
using Microsoft.AspNet.SignalR.Hubs;
@@ -9,7 +10,6 @@ using System;
using System.Linq;
using System.Reactive.Linq;
using System.Threading.Tasks;
using Disco.Services.Users;
namespace Disco.Services.Jobs
{
@@ -19,7 +19,7 @@ namespace Disco.Services.Jobs.Noticeboards
"DeviceSerialNumber",
"UserId",
"ExpectedClosedDate",
"ClosedDate",
"ClosedDate",
"WaitingForUserAction",
"DeviceHeld",
"DeviceReadyForReturn",
+8 -8
View File
@@ -1,12 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Disco.Data.Repository;
using System.IO;
using System.Data.SqlServerCe;
using Disco.Data.Repository;
using Newtonsoft.Json;
using Quartz;
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
{
@@ -50,7 +50,7 @@ namespace Disco.Services.Logging
var appDomain = AppDomain.CurrentDomain;
var servicesAssemblyName = typeof(LogContext).Assembly.GetName().Name;
var logModuleTypes = appDomain.GetAssemblies()
var logModuleTypes = appDomain.GetAssemblies()
.Where(a => !a.GlobalAssemblyCache && !a.IsDynamic &&
(a.GetName().Name == servicesAssemblyName || a.GetReferencedAssemblies().Any(ra => ra.Name == servicesAssemblyName)))
.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
{
+1 -1
View File
@@ -15,7 +15,7 @@ namespace Disco.Services.Logging.Models
public int EventTypeId { get; set; }
[Required]
public DateTime Timestamp { get; set; }
[Column(TypeName="ntext"), MaxLength]
[Column(TypeName = "ntext"), MaxLength]
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.Linq;
namespace Disco.Services.Logging.Models
{
[Table("EventTypes")]
public class LogEventType
{
[Required, Key, Column(Order=0), DatabaseGenerated(DatabaseGeneratedOption.None)]
[Required, Key, Column(Order = 0), DatabaseGenerated(DatabaseGeneratedOption.None)]
public int ModuleId { get; set; }
[Required, Key, Column(Order = 1), DatabaseGenerated(DatabaseGeneratedOption.None)]
public int Id { get; set; }
@@ -17,7 +17,7 @@ namespace Disco.Services.Logging.Models
public int Severity { get; set; }
[MaxLength(1024)]
public string Format { get; set; }
[NotMapped]
public bool UsePersist { get; set; }
[NotMapped]
@@ -1,6 +1,6 @@
using System;
using Disco.Models.Exporting;
using Disco.Models.Exporting;
using Newtonsoft.Json;
using System;
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.Linq;
using Microsoft.Win32.SafeHandles;
using System.Runtime.InteropServices;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Web.Mvc;
namespace Disco.Services.Logging
@@ -90,7 +90,8 @@ namespace Disco.Services.Plugins.Features.DetailsProvider
return user.UserDetails
.Where(d => string.Equals(d.Scope, DetailsScope, StringComparison.Ordinal))
.ToDictionary(d => d.Key, d => d.Value, StringComparer.OrdinalIgnoreCase);
} else
}
else
{
return database.UserDetails
.Where(d => d.UserId == user.UserId &&
@@ -15,7 +15,7 @@ namespace Disco.Services.Plugins.Features.RepairProvider
/// The repairer identifier. Used to link this provider to any <see cref="Models.Repository.RepairerName"/>. This identifier is used to automatically set the RepairerName when a job is submitted using this plugin.
/// </summary>
public abstract string ProviderId { get; }
#region Job Submission
/// <summary>
@@ -64,7 +64,7 @@ namespace Disco.Services.Plugins.Features.RepairProvider
public virtual Tuple<Type, dynamic> JobDetails(DiscoDataContext Database, Controller controller, Job Job)
{
return null;
}
}
#endregion
@@ -1,7 +1,7 @@
using System;
using System.Web.Mvc;
using Disco.Models.UI;
using Disco.Models.UI;
using Disco.Services.Plugins.Features.UIExtension.Results;
using System;
using System.Web.Mvc;
namespace Disco.Services.Plugins.Features.UIExtension
{
@@ -19,7 +19,8 @@ namespace Disco.Services.Plugins.Features.UIExtension
}
public UIExtensionFeature()
{
plugin = new Lazy<WebHelper>(new Func<WebHelper>(() => {
plugin = new Lazy<WebHelper>(new Func<WebHelper>(() =>
{
if (Context == null)
throw new InvalidOperationException("The Context property is not initialized");
@@ -5,7 +5,7 @@ namespace Disco.Services.Plugins.Features.UIExtension
public abstract class UIExtensionResult
{
public PluginFeatureManifest Source { get; private set; }
public UIExtensionResult(PluginFeatureManifest Source)
{
this.Source = Source;
@@ -1,9 +1,9 @@
using System;
using Disco.Models.UI;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Web;
using System.Web.Mvc;
using Disco.Models.UI;
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.Linq;
using System.Web.Mvc;
using Disco.Data.Repository;
using Disco.Models.BI.Config;
using Disco.Models.Repository;
namespace Disco.Services.Plugins.Features.WarrantyProvider
{
+1 -1
View File
@@ -72,7 +72,7 @@ namespace Disco.Services.Plugins
Status.UpdateStatus(20, $"{packageManifest.Name} [{packageManifest.Id} v{packageManifest.Version.ToString(4)}] by {packageManifest.Author}", "Initializing Install Environment");
PluginsLog.LogInstalling(packageManifest);
lock (Plugins._PluginLock)
{
if (!Plugins.PluginsLoaded)
+3 -3
View File
@@ -1,12 +1,12 @@
using System;
using Disco.Data.Repository;
using Disco.Data.Repository;
using Disco.Services.Tasks;
using System;
namespace Disco.Services.Plugins
{
public abstract class Plugin : IDisposable
{
public PluginManifest Manifest {get; internal set;}
public PluginManifest Manifest { get; internal set; }
#region Lifecycle
// Events/Triggers for Custom Plugin Initialization (Optional)
@@ -1,6 +1,6 @@
using System;
using Disco.Data.Repository;
using System;
using System.Web.Mvc;
using Disco.Data.Repository;
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.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 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
{
+3 -3
View File
@@ -1,11 +1,11 @@
using System;
using Disco.Data.Repository;
using Disco.Data.Repository;
using System;
namespace Disco.Services.Plugins
{
public abstract class PluginFeature : IDisposable
{
public PluginFeatureManifest Manifest {get; internal set;}
public PluginFeatureManifest Manifest { get; internal set; }
// Allow Custom Initialization (Optional)
public virtual void Initialize(DiscoDataContext Database) { return; }
@@ -1,7 +1,7 @@
using System;
using System.Linq;
using Disco.Data.Repository;
using Disco.Data.Repository;
using Newtonsoft.Json;
using System;
using System.Linq;
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.IO;
using System.Linq;
@@ -6,11 +11,6 @@ using System.Reflection;
using System.Security.Cryptography;
using System.Web;
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;
namespace Disco.Services.Plugins
+3 -2
View File
@@ -6,7 +6,7 @@ namespace Disco.Services.Plugins
{
private Lazy<WebPageHelper<T>> _plugin;
public PluginManifest Manifest {get;private set;}
public PluginManifest Manifest { get; private set; }
public WebPageHelper<T> Plugin
{
get
@@ -20,7 +20,8 @@ namespace Disco.Services.Plugins
var self = GetType();
Manifest = Plugins.GetPlugin(self.Assembly);
_plugin = new Lazy<WebPageHelper<T>>(() => {
_plugin = new Lazy<WebPageHelper<T>>(() =>
{
if (Context == null)
throw new InvalidOperationException("The WebViewPage Context property is not initialized");
+243 -243
View File
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using Disco.Services.Logging;
using Disco.Services.Logging;
using Disco.Services.Logging.Models;
using System;
using System.Collections.Generic;
using System.Reflection;
namespace Disco.Services.Plugins
@@ -180,249 +180,249 @@ namespace Disco.Services.Plugins
{
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
{
Id = (int)EventTypeIds.InitializedPluginFeature,
ModuleId = _ModuleId,
Name = "Initialized Plugin Feature",
Format = "Initialized Plugin Feature: '{1}' From '{0}'",
Severity = (int)LogEventType.Severities.Information,
UseLive = false,
UsePersist = 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
},
{
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.PluginWarning,
ModuleId = _ModuleId,
Name = "Plugin Warning",
Format = "{0} [{1} v{2}]: {3}",
Severity = (int)LogEventType.Severities.Warning,
UseLive = true,
UsePersist = true,
UseDisplay = true
},
{
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.PluginMessage,
ModuleId = _ModuleId,
Name = "Plugin Message",
Format = "{0} [{1} v{2}]: {3}",
Severity = (int)LogEventType.Severities.Information,
UseLive = true,
UsePersist = true,
UseDisplay = true
},
new LogEventType
{
Id = (int)EventTypeIds.PluginReferenceAssemblyLoaded,
ModuleId = _ModuleId,
Name = "Plugin Reference Assembly Loaded",
Format = "Loaded Plugin Reference Assembly: [{0}] From: '{1}'; Requested by: [{2}]",
Severity = (int)LogEventType.Severities.Information,
UseLive = true,
UsePersist = 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
}
};
{
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
{
Id = (int)EventTypeIds.InitializedPluginFeature,
ModuleId = _ModuleId,
Name = "Initialized Plugin Feature",
Format = "Initialized Plugin Feature: '{1}' From '{0}'",
Severity = (int)LogEventType.Severities.Information,
UseLive = false,
UsePersist = 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
{
Id = (int)EventTypeIds.PluginWarning,
ModuleId = _ModuleId,
Name = "Plugin Warning",
Format = "{0} [{1} v{2}]: {3}",
Severity = (int)LogEventType.Severities.Warning,
UseLive = true,
UsePersist = true,
UseDisplay = true
},
new LogEventType
{
Id = (int)EventTypeIds.PluginMessage,
ModuleId = _ModuleId,
Name = "Plugin Message",
Format = "{0} [{1} v{2}]: {3}",
Severity = (int)LogEventType.Severities.Information,
UseLive = true,
UsePersist = true,
UseDisplay = true
},
new LogEventType
{
Id = (int)EventTypeIds.PluginReferenceAssemblyLoaded,
ModuleId = _ModuleId,
Name = "Plugin Reference Assembly Loaded",
Format = "Loaded Plugin Reference Assembly: [{0}] From: '{1}'; Requested by: [{2}]",
Severity = (int)LogEventType.Severities.Information,
UseLive = true,
UsePersist = 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;
installedPluginManifests = OfflineInstalledPlugins(database);
if (installedPluginManifests.Count > 0){
if (installedPluginManifests.Count > 0)
{
libraryManifest = PluginLibrary.LoadManifest(database);
libraryIncompatibility = libraryManifest.LoadIncompatibilityData();
}
+2 -2
View File
@@ -17,8 +17,8 @@ namespace Disco.Services.Tasks
string FinishedMessage { get; }
string FinishedUrl { get; }
Exception TaskException { get; }
Exception TaskException { get; }
void UpdateStatus(byte Progress);
void UpdateStatus(double Progress);
@@ -3,8 +3,8 @@ using Microsoft.AspNet.SignalR;
using Microsoft.AspNet.SignalR.Hubs;
using System;
using System.Collections.Generic;
using System.Reactive.Linq;
using System.Linq;
using System.Reactive.Linq;
namespace Disco.Services.Tasks
{
+4 -4
View File
@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Disco.Data.Repository;
using Quartz;
using Quartz.Impl;
using Disco.Data.Repository;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace Disco.Services.Tasks
+102 -102
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.Data;
using System.Data.Entity.Validation;
using System.Text;
using Disco.Services.Logging;
using Disco.Services.Logging.Models;
namespace Disco.Services.Tasks
{
@@ -128,83 +128,83 @@ namespace Disco.Services.Tasks
{
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
{
Id = (int)EventTypeIds.InitializeScheduledTasksException,
ModuleId = _ModuleId,
Name = "Initialize Task Exception",
Format = "[{0}] At '{1}'; Exception: {2}: {3}; {4}",
Severity = (int)LogEventType.Severities.Error,
UseLive = false,
UsePersist = 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
},
{
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
{
Id = (int)EventTypeIds.InitializeScheduledTasksException,
ModuleId = _ModuleId,
Name = "Initialize Task Exception",
Format = "[{0}] At '{1}'; Exception: {2}: {3}; {4}",
Severity = (int)LogEventType.Severities.Error,
UseLive = false,
UsePersist = 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
{
Id = (int)EventTypeIds.ScheduledTasksWarning,
@@ -226,29 +226,29 @@ namespace Disco.Services.Tasks
UseLive = true,
UsePersist = true,
UseDisplay = true
},
new LogEventType
{
Id = (int)EventTypeIds.ScheduledTaskExecuted,
ModuleId = _ModuleId,
Name = "Scheduled Task Started",
Format = "Scheduled Task Started: {0}; Session Id: {1}",
Severity = (int)LogEventType.Severities.Information,
UseLive = true,
UsePersist = true,
UseDisplay = true
},
new LogEventType
{
Id = (int)EventTypeIds.ScheduledTaskFinished,
ModuleId = _ModuleId,
Name = "Scheduled Task Finished",
Format = "Scheduled Task Finished: {0}; Session Id: {1}",
Severity = (int)LogEventType.Severities.Information,
UseLive = true,
UsePersist = true,
UseDisplay = true
}
},
new LogEventType
{
Id = (int)EventTypeIds.ScheduledTaskExecuted,
ModuleId = _ModuleId,
Name = "Scheduled Task Started",
Format = "Scheduled Task Started: {0}; Session Id: {1}",
Severity = (int)LogEventType.Severities.Information,
UseLive = true,
UsePersist = true,
UseDisplay = true
},
new LogEventType
{
Id = (int)EventTypeIds.ScheduledTaskFinished,
ModuleId = _ModuleId,
Name = "Scheduled Task Finished",
Format = "Scheduled Task Finished: {0}; Session Id: {1}",
Severity = (int)LogEventType.Severities.Information,
UseLive = true,
UsePersist = true,
UseDisplay = true
}
};
}
}
@@ -189,7 +189,7 @@ namespace Disco.Services.Users.UserFlags
Status.UpdateStatus((chunkIndexOffset + index) * progressInterval, $"Removing Flag: {flagAssignment.User.ToString()}");
flagAssignment.OnRemoveUnsafe(Database, Technician);
return flagAssignment;
}).ToList();
@@ -8,7 +8,7 @@ namespace Disco.Services.Users.UserFlags
{
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 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;
namespace Disco.Services.Web
@@ -25,7 +25,7 @@ namespace Disco.Services.Web
public static void BundleDeferred(this HtmlHelper htmlHelper, string BundleUrl)
=> htmlHelper.ViewContext.HttpContext.BundleDeferred(BundleUrl);
public static HtmlString BundleRenderDeferred(this HtmlHelper htmlHelper)
{
var deferredBundles = htmlHelper.ViewContext.HttpContext.Items[BundleTable.DeferredKey] as List<string>;
+1 -1
View File
@@ -5,7 +5,7 @@ namespace Disco.Services.Web.Bundles
public class UrlBundle : IBundle
{
public bool RemapRequest { get { return false; } }
public string Url { get; private set; }
public string VersionUrl { get; private set; }
+1 -1
View File
@@ -28,7 +28,7 @@ namespace Disco.Services.Web
ViewData = new ViewDataDictionary<HandleErrorInfo>(model),
TempData = filterContext.Controller.TempData
};
filterContext.Result = result;
filterContext.ExceptionHandled = true;
contextResponse.Clear();