1
0
mirror of https://github.com/chylex/Minecraft-Phantom-Panel.git synced 2025-05-30 13:34:05 +02:00

Remove unnecessary trailing spaces

This commit is contained in:
chylex 2023-10-22 23:05:24 +02:00
parent 339b958e45
commit 627e7436fd
Signed by: chylex
GPG Key ID: 4DE42C8F19A80548
95 changed files with 95 additions and 95 deletions
Agent
Common
Controller
Utils
Web

View File

@ -1,4 +1,4 @@
namespace Phantom.Agent.Minecraft.Command; namespace Phantom.Agent.Minecraft.Command;
public static class MinecraftCommand { public static class MinecraftCommand {
public const string SaveOn = "save-on"; public const string SaveOn = "save-on";

View File

@ -1,7 +1,7 @@
using Phantom.Utils.Collections; using Phantom.Utils.Collections;
using Phantom.Utils.Processes; using Phantom.Utils.Processes;
namespace Phantom.Agent.Minecraft.Instance; namespace Phantom.Agent.Minecraft.Instance;
public sealed class InstanceProcess : IDisposable { public sealed class InstanceProcess : IDisposable {
public InstanceProperties InstanceProperties { get; } public InstanceProperties InstanceProperties { get; }

View File

@ -1,6 +1,6 @@
using Phantom.Common.Data.Java; using Phantom.Common.Data.Java;
namespace Phantom.Agent.Minecraft.Java; namespace Phantom.Agent.Minecraft.Java;
public sealed class JavaRuntimeExecutable { public sealed class JavaRuntimeExecutable {
internal string ExecutablePath { get; } internal string ExecutablePath { get; }

View File

@ -1,6 +1,6 @@
using Phantom.Agent.Minecraft.Java; using Phantom.Agent.Minecraft.Java;
using Phantom.Agent.Minecraft.Server; using Phantom.Agent.Minecraft.Server;
namespace Phantom.Agent.Minecraft.Launcher; namespace Phantom.Agent.Minecraft.Launcher;
public sealed record LaunchServices(MinecraftServerExecutables ServerExecutables, JavaRuntimeRepository JavaRuntimeRepository); public sealed record LaunchServices(MinecraftServerExecutables ServerExecutables, JavaRuntimeRepository JavaRuntimeRepository);

View File

@ -3,7 +3,7 @@ using Phantom.Agent.Minecraft.Instance;
using Phantom.Utils.IO; using Phantom.Utils.IO;
using Serilog; using Serilog;
namespace Phantom.Agent.Minecraft.Launcher.Types; namespace Phantom.Agent.Minecraft.Launcher.Types;
public sealed class FabricLauncher : BaseLauncher { public sealed class FabricLauncher : BaseLauncher {
public FabricLauncher(InstanceProperties instanceProperties) : base(instanceProperties) {} public FabricLauncher(InstanceProperties instanceProperties) : base(instanceProperties) {}

View File

@ -1,7 +1,7 @@
using Phantom.Agent.Minecraft.Server; using Phantom.Agent.Minecraft.Server;
using Serilog; using Serilog;
namespace Phantom.Agent.Minecraft.Launcher.Types; namespace Phantom.Agent.Minecraft.Launcher.Types;
public sealed class InvalidLauncher : IServerLauncher { public sealed class InvalidLauncher : IServerLauncher {
public static InvalidLauncher Instance { get; } = new (); public static InvalidLauncher Instance { get; } = new ();

View File

@ -1,6 +1,6 @@
using Phantom.Agent.Minecraft.Instance; using Phantom.Agent.Minecraft.Instance;
namespace Phantom.Agent.Minecraft.Launcher.Types; namespace Phantom.Agent.Minecraft.Launcher.Types;
public sealed class VanillaLauncher : BaseLauncher { public sealed class VanillaLauncher : BaseLauncher {
public VanillaLauncher(InstanceProperties instanceProperties) : base(instanceProperties) {} public VanillaLauncher(InstanceProperties instanceProperties) : base(instanceProperties) {}

View File

@ -1,6 +1,6 @@
using Phantom.Agent.Minecraft.Java; using Phantom.Agent.Minecraft.Java;
namespace Phantom.Agent.Minecraft.Properties; namespace Phantom.Agent.Minecraft.Properties;
abstract class MinecraftServerProperty<T> { abstract class MinecraftServerProperty<T> {
private readonly string key; private readonly string key;

View File

@ -1,4 +1,4 @@
namespace Phantom.Agent.Minecraft.Server; namespace Phantom.Agent.Minecraft.Server;
public sealed class DownloadProgressEventArgs : EventArgs { public sealed class DownloadProgressEventArgs : EventArgs {
public ulong DownloadedBytes { get; } public ulong DownloadedBytes { get; }

View File

@ -1,3 +1,3 @@
namespace Phantom.Agent.Minecraft.Server; namespace Phantom.Agent.Minecraft.Server;
sealed record MinecraftServerExecutableDownloadListener(EventHandler<DownloadProgressEventArgs> DownloadProgressEventHandler, CancellationToken CancellationToken); sealed record MinecraftServerExecutableDownloadListener(EventHandler<DownloadProgressEventArgs> DownloadProgressEventHandler, CancellationToken CancellationToken);

View File

@ -6,7 +6,7 @@ using System.Text;
using Phantom.Common.Logging; using Phantom.Common.Logging;
using Serilog; using Serilog;
namespace Phantom.Agent.Minecraft.Server; namespace Phantom.Agent.Minecraft.Server;
public sealed class ServerStatusProtocol { public sealed class ServerStatusProtocol {
private readonly ILogger logger; private readonly ILogger logger;

View File

@ -4,7 +4,7 @@ using Phantom.Common.Messages;
using Phantom.Common.Messages.BiDirectional; using Phantom.Common.Messages.BiDirectional;
using Phantom.Utils.Rpc.Message; using Phantom.Utils.Rpc.Message;
namespace Phantom.Agent.Rpc; namespace Phantom.Agent.Rpc;
public sealed class RpcServerConnection { public sealed class RpcServerConnection {
private readonly ClientSocket socket; private readonly ClientSocket socket;

View File

@ -1,3 +1,3 @@
namespace Phantom.Agent.Services; namespace Phantom.Agent.Services;
public readonly record struct AgentServiceConfiguration(int MaxConcurrentCompressionTasks); public readonly record struct AgentServiceConfiguration(int MaxConcurrentCompressionTasks);

View File

@ -7,7 +7,7 @@ using Phantom.Common.Logging;
using Phantom.Utils.IO; using Phantom.Utils.IO;
using Serilog; using Serilog;
namespace Phantom.Agent.Services.Backups; namespace Phantom.Agent.Services.Backups;
sealed class BackupArchiver { sealed class BackupArchiver {
private readonly string destinationBasePath; private readonly string destinationBasePath;

View File

@ -2,7 +2,7 @@
using Phantom.Utils.Processes; using Phantom.Utils.Processes;
using Serilog; using Serilog;
namespace Phantom.Agent.Services.Backups; namespace Phantom.Agent.Services.Backups;
static class BackupCompressor { static class BackupCompressor {
private static ILogger Logger { get; } = PhantomLogger.Create(nameof(BackupCompressor)); private static ILogger Logger { get; } = PhantomLogger.Create(nameof(BackupCompressor));

View File

@ -23,7 +23,7 @@ sealed class BackupScheduler : CancellableBackgroundTask {
private readonly ServerStatusProtocol serverStatusProtocol; private readonly ServerStatusProtocol serverStatusProtocol;
private readonly ManualResetEventSlim serverOutputWhileWaitingForOnlinePlayers = new (); private readonly ManualResetEventSlim serverOutputWhileWaitingForOnlinePlayers = new ();
public event EventHandler<BackupCreationResult>? BackupCompleted; public event EventHandler<BackupCreationResult>? BackupCompleted;
public BackupScheduler(TaskManager taskManager, BackupManager backupManager, InstanceProcess process, IInstanceContext context, int serverPort) : base(PhantomLogger.Create<BackupScheduler>(context.ShortName), taskManager, "Backup scheduler for " + context.ShortName) { public BackupScheduler(TaskManager taskManager, BackupManager backupManager, InstanceProcess process, IInstanceContext context, int serverPort) : base(PhantomLogger.Create<BackupScheduler>(context.ShortName), taskManager, "Backup scheduler for " + context.ShortName) {
this.backupManager = backupManager; this.backupManager = backupManager;

View File

@ -3,7 +3,7 @@ using Phantom.Agent.Services.Instances.States;
using Phantom.Common.Data.Instance; using Phantom.Common.Data.Instance;
using Serilog; using Serilog;
namespace Phantom.Agent.Services.Instances; namespace Phantom.Agent.Services.Instances;
interface IInstanceContext { interface IInstanceContext {
string ShortName { get; } string ShortName { get; }

View File

@ -27,7 +27,7 @@ sealed class Instance : IAsyncDisposable {
private IInstanceState currentState; private IInstanceState currentState;
public bool IsRunning => currentState is not InstanceNotRunningState; public bool IsRunning => currentState is not InstanceNotRunningState;
public event EventHandler? IsRunningChanged; public event EventHandler? IsRunningChanged;
private readonly InstanceProcedureManager procedureManager; private readonly InstanceProcedureManager procedureManager;

View File

@ -2,6 +2,6 @@
using Phantom.Agent.Services.Backups; using Phantom.Agent.Services.Backups;
using Phantom.Utils.Tasks; using Phantom.Utils.Tasks;
namespace Phantom.Agent.Services.Instances; namespace Phantom.Agent.Services.Instances;
sealed record InstanceServices(TaskManager TaskManager, PortManager PortManager, BackupManager BackupManager, LaunchServices LaunchServices); sealed record InstanceServices(TaskManager TaskManager, PortManager PortManager, BackupManager BackupManager, LaunchServices LaunchServices);

View File

@ -1,6 +1,6 @@
using Phantom.Agent.Services.Instances.States; using Phantom.Agent.Services.Instances.States;
namespace Phantom.Agent.Services.Instances.Procedures; namespace Phantom.Agent.Services.Instances.Procedures;
interface IInstanceProcedure { interface IInstanceProcedure {
Task<IInstanceState?> Run(IInstanceContext context, CancellationToken cancellationToken); Task<IInstanceState?> Run(IInstanceContext context, CancellationToken cancellationToken);

View File

@ -1,4 +1,4 @@
namespace Phantom.Agent.Services.Instances.States; namespace Phantom.Agent.Services.Instances.States;
interface IInstanceState { interface IInstanceState {
void Initialize(); void Initialize();

View File

@ -1,4 +1,4 @@
namespace Phantom.Agent.Services.Instances.States; namespace Phantom.Agent.Services.Instances.States;
sealed class InstanceNotRunningState : IInstanceState { sealed class InstanceNotRunningState : IInstanceState {
public void Initialize() {} public void Initialize() {}

View File

@ -3,7 +3,7 @@ using Phantom.Common.Logging;
using Phantom.Utils.IO; using Phantom.Utils.IO;
using Serilog; using Serilog;
namespace Phantom.Agent; namespace Phantom.Agent;
static class GuidFile { static class GuidFile {
private static ILogger Logger { get; } = PhantomLogger.Create(nameof(GuidFile)); private static ILogger Logger { get; } = PhantomLogger.Create(nameof(GuidFile));

View File

@ -1,6 +1,6 @@
using NUnit.Framework; using NUnit.Framework;
namespace Phantom.Common.Data.Tests; namespace Phantom.Common.Data.Tests;
[TestFixture] [TestFixture]
public sealed class AllowedPortsTests { public sealed class AllowedPortsTests {

View File

@ -1,4 +1,4 @@
namespace Phantom.Common.Data.Instance; namespace Phantom.Common.Data.Instance;
public interface IInstanceEventVisitor { public interface IInstanceEventVisitor {
void OnLaunchSucceeded(InstanceLaunchSuccededEvent e); void OnLaunchSucceeded(InstanceLaunchSuccededEvent e);

View File

@ -1,7 +1,7 @@
using MemoryPack; using MemoryPack;
using Phantom.Common.Data.Minecraft; using Phantom.Common.Data.Minecraft;
namespace Phantom.Common.Data.Instance; namespace Phantom.Common.Data.Instance;
[MemoryPackable(GenerateType.VersionTolerant)] [MemoryPackable(GenerateType.VersionTolerant)]
public sealed partial record InstanceLaunchProperties( public sealed partial record InstanceLaunchProperties(

View File

@ -1,6 +1,6 @@
using MemoryPack; using MemoryPack;
namespace Phantom.Common.Data.Java; namespace Phantom.Common.Data.Java;
[MemoryPackable(GenerateType.VersionTolerant)] [MemoryPackable(GenerateType.VersionTolerant)]
public sealed partial record TaggedJavaRuntime( public sealed partial record TaggedJavaRuntime(

View File

@ -2,7 +2,7 @@
using Phantom.Utils.Cryptography; using Phantom.Utils.Cryptography;
using Phantom.Utils.IO; using Phantom.Utils.IO;
namespace Phantom.Common.Data.Minecraft; namespace Phantom.Common.Data.Minecraft;
[MemoryPackable(GenerateType.VersionTolerant)] [MemoryPackable(GenerateType.VersionTolerant)]
public sealed partial class FileDownloadInfo { public sealed partial class FileDownloadInfo {

View File

@ -1,4 +1,4 @@
namespace Phantom.Common.Data.Minecraft; namespace Phantom.Common.Data.Minecraft;
public enum MinecraftServerKind : ushort { public enum MinecraftServerKind : ushort {
Vanilla = 1, Vanilla = 1,

View File

@ -1,4 +1,4 @@
namespace Phantom.Common.Data.Minecraft; namespace Phantom.Common.Data.Minecraft;
public sealed record MinecraftVersion( public sealed record MinecraftVersion(
string Id, string Id,

View File

@ -1,4 +1,4 @@
namespace Phantom.Common.Data.Replies; namespace Phantom.Common.Data.Replies;
public enum ConfigureInstanceResult : byte { public enum ConfigureInstanceResult : byte {
Success Success

View File

@ -1,4 +1,4 @@
namespace Phantom.Common.Data.Replies; namespace Phantom.Common.Data.Replies;
public enum RegisterAgentFailure : byte { public enum RegisterAgentFailure : byte {
ConnectionAlreadyHasAnAgent, ConnectionAlreadyHasAnAgent,

View File

@ -1,7 +1,7 @@
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using Serilog.Events; using Serilog.Events;
namespace Phantom.Common.Logging; namespace Phantom.Common.Logging;
static class DefaultLogLevel { static class DefaultLogLevel {
private const string ENVIRONMENT_VARIABLE = "LOG_LEVEL"; private const string ENVIRONMENT_VARIABLE = "LOG_LEVEL";

View File

@ -1,6 +1,6 @@
using Serilog; using Serilog;
namespace Phantom.Common.Logging; namespace Phantom.Common.Logging;
public static class LoggerExtensions { public static class LoggerExtensions {
private static readonly string HeadingPadding = new (' ', 23); private static readonly string HeadingPadding = new (' ', 23);

View File

@ -2,7 +2,7 @@
using Phantom.Common.Messages.ToServer; using Phantom.Common.Messages.ToServer;
using Phantom.Utils.Rpc.Message; using Phantom.Utils.Rpc.Message;
namespace Phantom.Common.Messages; namespace Phantom.Common.Messages;
public interface IMessageToServerListener { public interface IMessageToServerListener {
bool IsDisposed { get; } bool IsDisposed { get; }

View File

@ -5,7 +5,7 @@ using Phantom.Common.Messages.ToAgent;
using Phantom.Common.Messages.ToServer; using Phantom.Common.Messages.ToServer;
using Phantom.Utils.Rpc.Message; using Phantom.Utils.Rpc.Message;
namespace Phantom.Common.Messages; namespace Phantom.Common.Messages;
public static class MessageRegistries { public static class MessageRegistries {
public static MessageRegistry<IMessageToAgentListener> ToAgent { get; } = new (PhantomLogger.Create("MessageRegistry:ToAgent")); public static MessageRegistry<IMessageToAgentListener> ToAgent { get; } = new (PhantomLogger.Create("MessageRegistry:ToAgent"));

View File

@ -1,7 +1,7 @@
using MemoryPack; using MemoryPack;
using Phantom.Common.Data.Replies; using Phantom.Common.Data.Replies;
namespace Phantom.Common.Messages.ToAgent; namespace Phantom.Common.Messages.ToAgent;
[MemoryPackable(GenerateType.VersionTolerant)] [MemoryPackable(GenerateType.VersionTolerant)]
public sealed partial record LaunchInstanceMessage( public sealed partial record LaunchInstanceMessage(

View File

@ -1,7 +1,7 @@
using MemoryPack; using MemoryPack;
using Phantom.Common.Data.Replies; using Phantom.Common.Data.Replies;
namespace Phantom.Common.Messages.ToAgent; namespace Phantom.Common.Messages.ToAgent;
[MemoryPackable(GenerateType.VersionTolerant)] [MemoryPackable(GenerateType.VersionTolerant)]
public sealed partial record SendCommandToInstanceMessage( public sealed partial record SendCommandToInstanceMessage(

View File

@ -2,7 +2,7 @@
using Phantom.Common.Data.Minecraft; using Phantom.Common.Data.Minecraft;
using Phantom.Common.Data.Replies; using Phantom.Common.Data.Replies;
namespace Phantom.Common.Messages.ToAgent; namespace Phantom.Common.Messages.ToAgent;
[MemoryPackable(GenerateType.VersionTolerant)] [MemoryPackable(GenerateType.VersionTolerant)]
public sealed partial record StopInstanceMessage( public sealed partial record StopInstanceMessage(

View File

@ -3,7 +3,7 @@ using MemoryPack;
using Phantom.Common.Data.Java; using Phantom.Common.Data.Java;
using Phantom.Utils.Rpc.Message; using Phantom.Utils.Rpc.Message;
namespace Phantom.Common.Messages.ToServer; namespace Phantom.Common.Messages.ToServer;
[MemoryPackable(GenerateType.VersionTolerant)] [MemoryPackable(GenerateType.VersionTolerant)]
public sealed partial record AdvertiseJavaRuntimesMessage( public sealed partial record AdvertiseJavaRuntimesMessage(

View File

@ -1,7 +1,7 @@
using MemoryPack; using MemoryPack;
using Phantom.Utils.Rpc.Message; using Phantom.Utils.Rpc.Message;
namespace Phantom.Common.Messages.ToServer; namespace Phantom.Common.Messages.ToServer;
[MemoryPackable(GenerateType.VersionTolerant)] [MemoryPackable(GenerateType.VersionTolerant)]
public sealed partial record AgentIsAliveMessage : IMessageToServer { public sealed partial record AgentIsAliveMessage : IMessageToServer {

View File

@ -2,7 +2,7 @@
using Phantom.Common.Data; using Phantom.Common.Data;
using Phantom.Utils.Rpc.Message; using Phantom.Utils.Rpc.Message;
namespace Phantom.Common.Messages.ToServer; namespace Phantom.Common.Messages.ToServer;
[MemoryPackable(GenerateType.VersionTolerant)] [MemoryPackable(GenerateType.VersionTolerant)]
public sealed partial record ReportAgentStatusMessage( public sealed partial record ReportAgentStatusMessage(

View File

@ -2,7 +2,7 @@
using Phantom.Common.Data.Instance; using Phantom.Common.Data.Instance;
using Phantom.Utils.Rpc.Message; using Phantom.Utils.Rpc.Message;
namespace Phantom.Common.Messages.ToServer; namespace Phantom.Common.Messages.ToServer;
[MemoryPackable(GenerateType.VersionTolerant)] [MemoryPackable(GenerateType.VersionTolerant)]
public sealed partial record ReportInstanceEventMessage( public sealed partial record ReportInstanceEventMessage(

View File

@ -1,6 +1,6 @@
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
namespace Phantom.Controller.Database; namespace Phantom.Controller.Database;
public sealed class DatabaseProvider { public sealed class DatabaseProvider {
private readonly IServiceScopeFactory serviceScopeFactory; private readonly IServiceScopeFactory serviceScopeFactory;

View File

@ -4,7 +4,7 @@ using System.Diagnostics.CodeAnalysis;
using System.Text.Json; using System.Text.Json;
using Phantom.Controller.Database.Enums; using Phantom.Controller.Database.Enums;
namespace Phantom.Controller.Database.Entities; namespace Phantom.Controller.Database.Entities;
[Table("AuditLog", Schema = "system")] [Table("AuditLog", Schema = "system")]
[SuppressMessage("ReSharper", "AutoPropertyCanBeMadeGetOnly.Global")] [SuppressMessage("ReSharper", "AutoPropertyCanBeMadeGetOnly.Global")]

View File

@ -4,7 +4,7 @@ using System.Diagnostics.CodeAnalysis;
using System.Text.Json; using System.Text.Json;
using Phantom.Controller.Database.Enums; using Phantom.Controller.Database.Enums;
namespace Phantom.Controller.Database.Entities; namespace Phantom.Controller.Database.Entities;
[Table("EventLog", Schema = "system")] [Table("EventLog", Schema = "system")]
[SuppressMessage("ReSharper", "AutoPropertyCanBeMadeGetOnly.Global")] [SuppressMessage("ReSharper", "AutoPropertyCanBeMadeGetOnly.Global")]

View File

@ -4,7 +4,7 @@ using System.Diagnostics.CodeAnalysis;
using Phantom.Common.Data; using Phantom.Common.Data;
using Phantom.Common.Data.Minecraft; using Phantom.Common.Data.Minecraft;
namespace Phantom.Controller.Database.Entities; namespace Phantom.Controller.Database.Entities;
[Table("Instances", Schema = "agents")] [Table("Instances", Schema = "agents")]
[SuppressMessage("ReSharper", "AutoPropertyCanBeMadeGetOnly.Global")] [SuppressMessage("ReSharper", "AutoPropertyCanBeMadeGetOnly.Global")]

View File

@ -1,7 +1,7 @@
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
namespace Phantom.Controller.Database.Entities; namespace Phantom.Controller.Database.Entities;
[Table("Permissions", Schema = "identity")] [Table("Permissions", Schema = "identity")]
public sealed class PermissionEntity { public sealed class PermissionEntity {

View File

@ -1,7 +1,7 @@
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
namespace Phantom.Controller.Database.Entities; namespace Phantom.Controller.Database.Entities;
[Table("Roles", Schema = "identity")] [Table("Roles", Schema = "identity")]
public sealed class RoleEntity { public sealed class RoleEntity {

View File

@ -1,6 +1,6 @@
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
namespace Phantom.Controller.Database.Entities; namespace Phantom.Controller.Database.Entities;
[Table("RolePermissions", Schema = "identity")] [Table("RolePermissions", Schema = "identity")]
public sealed class RolePermissionEntity { public sealed class RolePermissionEntity {

View File

@ -1,7 +1,7 @@
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
namespace Phantom.Controller.Database.Entities; namespace Phantom.Controller.Database.Entities;
[Table("Users", Schema = "identity")] [Table("Users", Schema = "identity")]
public sealed class UserEntity { public sealed class UserEntity {

View File

@ -1,6 +1,6 @@
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
namespace Phantom.Controller.Database.Entities; namespace Phantom.Controller.Database.Entities;
[Table("UserRoles", Schema = "identity")] [Table("UserRoles", Schema = "identity")]
public sealed class UserRoleEntity { public sealed class UserRoleEntity {

View File

@ -1,4 +1,4 @@
namespace Phantom.Controller.Database.Enums; namespace Phantom.Controller.Database.Enums;
public enum AuditLogSubjectType { public enum AuditLogSubjectType {
User, User,

View File

@ -1,4 +1,4 @@
namespace Phantom.Controller.Database.Enums; namespace Phantom.Controller.Database.Enums;
public enum EventLogSubjectType { public enum EventLogSubjectType {
Instance Instance

View File

@ -1,7 +1,7 @@
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Phantom.Controller.Database.Entities; using Phantom.Controller.Database.Entities;
namespace Phantom.Controller.Database.Factories; namespace Phantom.Controller.Database.Factories;
public sealed class AgentEntityUpsert : AbstractUpsertHelper<AgentEntity> { public sealed class AgentEntityUpsert : AbstractUpsertHelper<AgentEntity> {
internal AgentEntityUpsert(ApplicationDbContext ctx) : base(ctx) {} internal AgentEntityUpsert(ApplicationDbContext ctx) : base(ctx) {}

View File

@ -1,7 +1,7 @@
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Phantom.Controller.Database.Entities; using Phantom.Controller.Database.Entities;
namespace Phantom.Controller.Database.Factories; namespace Phantom.Controller.Database.Factories;
public sealed class InstanceEntityUpsert : AbstractUpsertHelper<InstanceEntity> { public sealed class InstanceEntityUpsert : AbstractUpsertHelper<InstanceEntity> {
internal InstanceEntityUpsert(ApplicationDbContext ctx) : base(ctx) {} internal InstanceEntityUpsert(ApplicationDbContext ctx) : base(ctx) {}

View File

@ -1,4 +1,4 @@
namespace Phantom.Controller.Rpc; namespace Phantom.Controller.Rpc;
sealed class RpcClientConnectionClosedEventArgs : EventArgs { sealed class RpcClientConnectionClosedEventArgs : EventArgs {
public uint RoutingId { get; } public uint RoutingId { get; }

View File

@ -2,7 +2,7 @@
using Phantom.Common.Data.Java; using Phantom.Common.Data.Java;
using Phantom.Utils.Collections; using Phantom.Utils.Collections;
namespace Phantom.Controller.Services.Agents; namespace Phantom.Controller.Services.Agents;
public sealed class AgentJavaRuntimesManager { public sealed class AgentJavaRuntimesManager {
private readonly RwLockedDictionary<Guid, ImmutableArray<TaggedJavaRuntime>> runtimes = new (LockRecursionPolicy.NoRecursion); private readonly RwLockedDictionary<Guid, ImmutableArray<TaggedJavaRuntime>> runtimes = new (LockRecursionPolicy.NoRecursion);

View File

@ -1,6 +1,6 @@
using System.Text.Json; using System.Text.Json;
using Phantom.Controller.Database.Enums; using Phantom.Controller.Database.Enums;
namespace Phantom.Controller.Services.Audit; namespace Phantom.Controller.Services.Audit;
public sealed record AuditLogItem(DateTime UtcTime, Guid? UserGuid, string? UserName, AuditLogEventType EventType, AuditLogSubjectType SubjectType, string? SubjectId, JsonDocument? Data); public sealed record AuditLogItem(DateTime UtcTime, Guid? UserGuid, string? UserName, AuditLogEventType EventType, AuditLogSubjectType SubjectType, string? SubjectId, JsonDocument? Data);

View File

@ -4,7 +4,7 @@ using Phantom.Controller.Database.Entities;
using Phantom.Controller.Database.Enums; using Phantom.Controller.Database.Enums;
using Phantom.Utils.Tasks; using Phantom.Utils.Tasks;
namespace Phantom.Controller.Services.Events; namespace Phantom.Controller.Services.Events;
public sealed partial class EventLog { public sealed partial class EventLog {
private readonly CancellationToken cancellationToken; private readonly CancellationToken cancellationToken;

View File

@ -1,6 +1,6 @@
using System.Text.Json; using System.Text.Json;
using Phantom.Controller.Database.Enums; using Phantom.Controller.Database.Enums;
namespace Phantom.Controller.Services.Events; namespace Phantom.Controller.Services.Events;
public sealed record EventLogItem(DateTime UtcTime, Guid? AgentGuid, EventLogEventType EventType, EventLogSubjectType SubjectType, string SubjectId, JsonDocument? Data); public sealed record EventLogItem(DateTime UtcTime, Guid? AgentGuid, EventLogEventType EventType, EventLogSubjectType SubjectType, string SubjectId, JsonDocument? Data);

View File

@ -1,6 +1,6 @@
using Phantom.Common.Data.Instance; using Phantom.Common.Data.Instance;
namespace Phantom.Controller.Services.Instances; namespace Phantom.Controller.Services.Instances;
public sealed record Instance( public sealed record Instance(
InstanceConfiguration Configuration, InstanceConfiguration Configuration,

View File

@ -5,7 +5,7 @@ using Phantom.Utils.Collections;
using Phantom.Utils.Events; using Phantom.Utils.Events;
using ILogger = Serilog.ILogger; using ILogger = Serilog.ILogger;
namespace Phantom.Controller.Services.Instances; namespace Phantom.Controller.Services.Instances;
public sealed class InstanceLogManager { public sealed class InstanceLogManager {
private const int RetainedLines = 1000; private const int RetainedLines = 1000;

View File

@ -3,7 +3,7 @@ using Phantom.Controller.Services.Agents;
using Phantom.Controller.Services.Events; using Phantom.Controller.Services.Events;
using Phantom.Controller.Services.Instances; using Phantom.Controller.Services.Instances;
namespace Phantom.Controller.Services.Rpc; namespace Phantom.Controller.Services.Rpc;
public sealed class MessageToServerListenerFactory { public sealed class MessageToServerListenerFactory {
private readonly ServiceConfiguration configuration; private readonly ServiceConfiguration configuration;

View File

@ -1,4 +1,4 @@
namespace Phantom.Controller.Services.Users; namespace Phantom.Controller.Services.Users;
public enum AddRoleError : byte { public enum AddRoleError : byte {
NameIsEmpty, NameIsEmpty,

View File

@ -1,4 +1,4 @@
namespace Phantom.Controller.Services.Users; namespace Phantom.Controller.Services.Users;
public enum DeleteUserResult : byte { public enum DeleteUserResult : byte {
Deleted, Deleted,

View File

@ -1,6 +1,6 @@
using Serilog; using Serilog;
namespace Phantom.Utils.Events; namespace Phantom.Utils.Events;
public abstract class ObservableState<T> { public abstract class ObservableState<T> {
public EventSubscribers<T> Subs { get; } public EventSubscribers<T> Subs { get; }

View File

@ -1,4 +1,4 @@
namespace Phantom.Utils.Rpc.Message; namespace Phantom.Utils.Rpc.Message;
public interface IMessage<TListener, TReply> { public interface IMessage<TListener, TReply> {
Task<TReply> Accept(TListener listener); Task<TReply> Accept(TListener listener);

View File

@ -1,7 +1,7 @@
using Phantom.Utils.Tasks; using Phantom.Utils.Tasks;
using Serilog; using Serilog;
namespace Phantom.Utils.Rpc.Message; namespace Phantom.Utils.Rpc.Message;
public abstract class MessageHandler<TListener> { public abstract class MessageHandler<TListener> {
protected TListener Listener { get; } protected TListener Listener { get; }

View File

@ -1,4 +1,4 @@
namespace Phantom.Utils.Rpc.Message; namespace Phantom.Utils.Rpc.Message;
public readonly struct NoReply { public readonly struct NoReply {
public static NoReply Instance { get; } = new (); public static NoReply Instance { get; } = new ();

View File

@ -1,7 +1,7 @@
using System.Collections.Immutable; using System.Collections.Immutable;
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
namespace Phantom.Utils.Collections; namespace Phantom.Utils.Collections;
public static class EnumerableExtensions { public static class EnumerableExtensions {
[SuppressMessage("ReSharper", "LoopCanBeConvertedToQuery")] [SuppressMessage("ReSharper", "LoopCanBeConvertedToQuery")]

View File

@ -1,4 +1,4 @@
namespace Phantom.Utils.Collections; namespace Phantom.Utils.Collections;
public sealed class RingBuffer<T> { public sealed class RingBuffer<T> {
private readonly T[] buffer; private readonly T[] buffer;

View File

@ -1,4 +1,4 @@
namespace Phantom.Utils.Cryptography; namespace Phantom.Utils.Cryptography;
public static class StableHashCode { public static class StableHashCode {
public static int ForString(string str) { public static int ForString(string str) {

View File

@ -1,4 +1,4 @@
namespace Phantom.Utils.IO; namespace Phantom.Utils.IO;
public static class Chmod { public static class Chmod {
public const UnixFileMode URWX = UnixFileMode.UserRead | UnixFileMode.UserWrite | UnixFileMode.UserExecute; public const UnixFileMode URWX = UnixFileMode.UserRead | UnixFileMode.UserWrite | UnixFileMode.UserExecute;

View File

@ -1,4 +1,4 @@
namespace Phantom.Utils.IO; namespace Phantom.Utils.IO;
public static class Directories { public static class Directories {
public static void Create(string path, UnixFileMode mode) { public static void Create(string path, UnixFileMode mode) {

View File

@ -1,4 +1,4 @@
namespace Phantom.Utils.IO; namespace Phantom.Utils.IO;
public static class Paths { public static class Paths {
public static string ExpandTilde(string path) { public static string ExpandTilde(string path) {

View File

@ -1,6 +1,6 @@
using System.Buffers; using System.Buffers;
namespace Phantom.Utils.IO; namespace Phantom.Utils.IO;
public sealed class StreamCopier : IDisposable { public sealed class StreamCopier : IDisposable {
private const int DefaultBufferSize = 81920; private const int DefaultBufferSize = 81920;

View File

@ -1,7 +1,7 @@
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Diagnostics; using System.Diagnostics;
namespace Phantom.Utils.Processes; namespace Phantom.Utils.Processes;
public sealed class ProcessConfigurator { public sealed class ProcessConfigurator {
private readonly ProcessStartInfo startInfo = new () { private readonly ProcessStartInfo startInfo = new () {

View File

@ -1,6 +1,6 @@
using System.Reflection; using System.Reflection;
namespace Phantom.Utils.Runtime; namespace Phantom.Utils.Runtime;
public static class AssemblyAttributes { public static class AssemblyAttributes {
public static string GetFullVersion(Assembly assembly) { public static string GetFullVersion(Assembly assembly) {

View File

@ -1,4 +1,4 @@
namespace Phantom.Utils.Runtime; namespace Phantom.Utils.Runtime;
/// <summary> /// <summary>
/// Custom exception used to signal a procedure should stop. This exception should not be logged or propagated. /// Custom exception used to signal a procedure should stop. This exception should not be logged or propagated.

View File

@ -1,4 +1,4 @@
namespace Phantom.Utils.Tasks; namespace Phantom.Utils.Tasks;
public static class AsyncTasks { public static class AsyncTasks {
public static TaskCompletionSource CreateCompletionSource() { public static TaskCompletionSource CreateCompletionSource() {

View File

@ -1,6 +1,6 @@
using Serilog; using Serilog;
namespace Phantom.Utils.Tasks; namespace Phantom.Utils.Tasks;
public abstract class CancellableBackgroundTask { public abstract class CancellableBackgroundTask {
private readonly CancellationTokenSource cancellationTokenSource = new (); private readonly CancellationTokenSource cancellationTokenSource = new ();

View File

@ -2,7 +2,7 @@
using Phantom.Utils.Collections; using Phantom.Utils.Collections;
using Serilog; using Serilog;
namespace Phantom.Utils.Tasks; namespace Phantom.Utils.Tasks;
public sealed class TaskManager { public sealed class TaskManager {
private readonly ILogger logger; private readonly ILogger logger;

View File

@ -1,4 +1,4 @@
namespace Phantom.Utils.Threading; namespace Phantom.Utils.Threading;
public sealed class ThreadSafeLinkedList<T> : IDisposable { public sealed class ThreadSafeLinkedList<T> : IDisposable {
private readonly LinkedList<T> list = new (); private readonly LinkedList<T> list = new ();

View File

@ -1,4 +1,4 @@
namespace Phantom.Utils.Threading; namespace Phantom.Utils.Threading;
public sealed class ThreadSafeStructRef<T> : IDisposable where T : struct { public sealed class ThreadSafeStructRef<T> : IDisposable where T : struct {
private T? value; private T? value;

View File

@ -1,4 +1,4 @@
namespace Phantom.Web.Components.Forms.Base; namespace Phantom.Web.Components.Forms.Base;
public interface ICustomFormField { public interface ICustomFormField {
bool TwoWayValueBinding { get; set; } bool TwoWayValueBinding { get; set; }

View File

@ -1,7 +1,7 @@
using Microsoft.AspNetCore.Components.Forms; using Microsoft.AspNetCore.Components.Forms;
using Phantom.Web.Components.Utils; using Phantom.Web.Components.Utils;
namespace Phantom.Web.Components.Forms; namespace Phantom.Web.Components.Forms;
public abstract class FormModel { public abstract class FormModel {
public EditContext EditContext { get; } public EditContext EditContext { get; }

View File

@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Components.Forms; using Microsoft.AspNetCore.Components.Forms;
namespace Phantom.Web.Components.Utils; namespace Phantom.Web.Components.Utils;
public static class EditContextExtensions { public static class EditContextExtensions {
public static void RevalidateWhenFieldChanges(this EditContext editContext, string tracked, string revalidated) { public static void RevalidateWhenFieldChanges(this EditContext editContext, string tracked, string revalidated) {

View File

@ -1,6 +1,6 @@
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
namespace Phantom.Web.Components.Utils; namespace Phantom.Web.Components.Utils;
public abstract class FormValidationAttribute<TModel, TValue> : ValidationAttribute { public abstract class FormValidationAttribute<TModel, TValue> : ValidationAttribute {
public sealed override bool IsValid(object? value) { public sealed override bool IsValid(object? value) {

View File

@ -4,7 +4,7 @@ using Phantom.Common.Logging;
using Phantom.Utils.Tasks; using Phantom.Utils.Tasks;
using ILogger = Serilog.ILogger; using ILogger = Serilog.ILogger;
namespace Phantom.Web.Identity.Authentication; namespace Phantom.Web.Identity.Authentication;
public sealed class PhantomLoginStore { public sealed class PhantomLoginStore {
private static readonly ILogger Logger = PhantomLogger.Create<PhantomLoginStore>(); private static readonly ILogger Logger = PhantomLogger.Create<PhantomLoginStore>();

View File

@ -1,7 +1,7 @@
using System.Collections.Immutable; using System.Collections.Immutable;
using Phantom.Web.Identity.Data; using Phantom.Web.Identity.Data;
namespace Phantom.Web.Identity.Authorization; namespace Phantom.Web.Identity.Authorization;
public sealed class IdentityPermissions { public sealed class IdentityPermissions {
internal static IdentityPermissions None { get; } = new (); internal static IdentityPermissions None { get; } = new ();

View File

@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Phantom.Web.Identity.Data; using Phantom.Web.Identity.Data;
namespace Phantom.Web.Identity.Authorization; namespace Phantom.Web.Identity.Authorization;
sealed record PermissionBasedPolicyRequirement(Permission Permission) : IAuthorizationRequirement; sealed record PermissionBasedPolicyRequirement(Permission Permission) : IAuthorizationRequirement;

View File

@ -1,6 +1,6 @@
using Phantom.Controller.Database.Entities; using Phantom.Controller.Database.Entities;
namespace Phantom.Web.Identity.Interfaces; namespace Phantom.Web.Identity.Interfaces;
public interface ILoginEvents { public interface ILoginEvents {
void UserLoggedIn(UserEntity user); void UserLoggedIn(UserEntity user);

View File

@ -3,7 +3,7 @@ using System.Web;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
using Phantom.Web.Identity.Interfaces; using Phantom.Web.Identity.Interfaces;
namespace Phantom.Web.Base; namespace Phantom.Web.Base;
sealed class Navigation : INavigation { sealed class Navigation : INavigation {
public static Func<IServiceProvider, Navigation> Create(string basePath) { public static Func<IServiceProvider, Navigation> Create(string basePath) {

View File

@ -5,7 +5,7 @@ using Phantom.Web.Identity.Authorization;
using Phantom.Web.Identity.Data; using Phantom.Web.Identity.Data;
using ILogger = Serilog.ILogger; using ILogger = Serilog.ILogger;
namespace Phantom.Web.Base; namespace Phantom.Web.Base;
public abstract class PhantomComponent : ComponentBase { public abstract class PhantomComponent : ComponentBase {
private static readonly ILogger Logger = PhantomLogger.Create<PhantomComponent>(); private static readonly ILogger Logger = PhantomLogger.Create<PhantomComponent>();