mirror of
https://github.com/chylex/Minecraft-Phantom-Panel.git
synced 2025-04-07 20:15:46 +02:00
Remove unnecessary trailing spaces
This commit is contained in:
parent
339b958e45
commit
627e7436fd
Agent
Phantom.Agent.Minecraft
Command
Instance
Java
Launcher
Properties
Server
Phantom.Agent.Rpc
Phantom.Agent.Services
Phantom.Agent
Common
Phantom.Common.Data.Tests
Phantom.Common.Data
Instance
Java
Minecraft
Replies
Phantom.Common.Logging
Phantom.Common.Messages
Controller
Phantom.Controller.Database
DatabaseProvider.cs
Entities
AuditLogEntity.csEventLogEntity.csInstanceEntity.csPermissionEntity.csRoleEntity.csRolePermissionEntity.csUserEntity.csUserRoleEntity.cs
Enums
Factories
Phantom.Controller.Rpc
Phantom.Controller.Services
Utils
Phantom.Utils.Events
Phantom.Utils.Rpc/Message
Phantom.Utils
Collections
Cryptography
IO
Processes
Runtime
Tasks
Threading
Web
Phantom.Web.Components
Phantom.Web.Identity
Authentication
Authorization
Interfaces
Phantom.Web/Base
@ -1,4 +1,4 @@
|
||||
namespace Phantom.Agent.Minecraft.Command;
|
||||
namespace Phantom.Agent.Minecraft.Command;
|
||||
|
||||
public static class MinecraftCommand {
|
||||
public const string SaveOn = "save-on";
|
||||
|
@ -1,7 +1,7 @@
|
||||
using Phantom.Utils.Collections;
|
||||
using Phantom.Utils.Processes;
|
||||
|
||||
namespace Phantom.Agent.Minecraft.Instance;
|
||||
namespace Phantom.Agent.Minecraft.Instance;
|
||||
|
||||
public sealed class InstanceProcess : IDisposable {
|
||||
public InstanceProperties InstanceProperties { get; }
|
||||
|
@ -1,6 +1,6 @@
|
||||
using Phantom.Common.Data.Java;
|
||||
|
||||
namespace Phantom.Agent.Minecraft.Java;
|
||||
namespace Phantom.Agent.Minecraft.Java;
|
||||
|
||||
public sealed class JavaRuntimeExecutable {
|
||||
internal string ExecutablePath { get; }
|
||||
|
@ -1,6 +1,6 @@
|
||||
using Phantom.Agent.Minecraft.Java;
|
||||
using Phantom.Agent.Minecraft.Server;
|
||||
|
||||
namespace Phantom.Agent.Minecraft.Launcher;
|
||||
namespace Phantom.Agent.Minecraft.Launcher;
|
||||
|
||||
public sealed record LaunchServices(MinecraftServerExecutables ServerExecutables, JavaRuntimeRepository JavaRuntimeRepository);
|
||||
|
@ -3,7 +3,7 @@ using Phantom.Agent.Minecraft.Instance;
|
||||
using Phantom.Utils.IO;
|
||||
using Serilog;
|
||||
|
||||
namespace Phantom.Agent.Minecraft.Launcher.Types;
|
||||
namespace Phantom.Agent.Minecraft.Launcher.Types;
|
||||
|
||||
public sealed class FabricLauncher : BaseLauncher {
|
||||
public FabricLauncher(InstanceProperties instanceProperties) : base(instanceProperties) {}
|
||||
|
@ -1,7 +1,7 @@
|
||||
using Phantom.Agent.Minecraft.Server;
|
||||
using Serilog;
|
||||
|
||||
namespace Phantom.Agent.Minecraft.Launcher.Types;
|
||||
namespace Phantom.Agent.Minecraft.Launcher.Types;
|
||||
|
||||
public sealed class InvalidLauncher : IServerLauncher {
|
||||
public static InvalidLauncher Instance { get; } = new ();
|
||||
|
@ -1,6 +1,6 @@
|
||||
using Phantom.Agent.Minecraft.Instance;
|
||||
|
||||
namespace Phantom.Agent.Minecraft.Launcher.Types;
|
||||
namespace Phantom.Agent.Minecraft.Launcher.Types;
|
||||
|
||||
public sealed class VanillaLauncher : BaseLauncher {
|
||||
public VanillaLauncher(InstanceProperties instanceProperties) : base(instanceProperties) {}
|
||||
|
@ -1,6 +1,6 @@
|
||||
using Phantom.Agent.Minecraft.Java;
|
||||
|
||||
namespace Phantom.Agent.Minecraft.Properties;
|
||||
namespace Phantom.Agent.Minecraft.Properties;
|
||||
|
||||
abstract class MinecraftServerProperty<T> {
|
||||
private readonly string key;
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace Phantom.Agent.Minecraft.Server;
|
||||
namespace Phantom.Agent.Minecraft.Server;
|
||||
|
||||
public sealed class DownloadProgressEventArgs : EventArgs {
|
||||
public ulong DownloadedBytes { get; }
|
||||
|
@ -1,3 +1,3 @@
|
||||
namespace Phantom.Agent.Minecraft.Server;
|
||||
namespace Phantom.Agent.Minecraft.Server;
|
||||
|
||||
sealed record MinecraftServerExecutableDownloadListener(EventHandler<DownloadProgressEventArgs> DownloadProgressEventHandler, CancellationToken CancellationToken);
|
||||
|
@ -6,7 +6,7 @@ using System.Text;
|
||||
using Phantom.Common.Logging;
|
||||
using Serilog;
|
||||
|
||||
namespace Phantom.Agent.Minecraft.Server;
|
||||
namespace Phantom.Agent.Minecraft.Server;
|
||||
|
||||
public sealed class ServerStatusProtocol {
|
||||
private readonly ILogger logger;
|
||||
|
@ -4,7 +4,7 @@ using Phantom.Common.Messages;
|
||||
using Phantom.Common.Messages.BiDirectional;
|
||||
using Phantom.Utils.Rpc.Message;
|
||||
|
||||
namespace Phantom.Agent.Rpc;
|
||||
namespace Phantom.Agent.Rpc;
|
||||
|
||||
public sealed class RpcServerConnection {
|
||||
private readonly ClientSocket socket;
|
||||
|
@ -1,3 +1,3 @@
|
||||
namespace Phantom.Agent.Services;
|
||||
namespace Phantom.Agent.Services;
|
||||
|
||||
public readonly record struct AgentServiceConfiguration(int MaxConcurrentCompressionTasks);
|
||||
|
@ -7,7 +7,7 @@ using Phantom.Common.Logging;
|
||||
using Phantom.Utils.IO;
|
||||
using Serilog;
|
||||
|
||||
namespace Phantom.Agent.Services.Backups;
|
||||
namespace Phantom.Agent.Services.Backups;
|
||||
|
||||
sealed class BackupArchiver {
|
||||
private readonly string destinationBasePath;
|
||||
|
@ -2,7 +2,7 @@
|
||||
using Phantom.Utils.Processes;
|
||||
using Serilog;
|
||||
|
||||
namespace Phantom.Agent.Services.Backups;
|
||||
namespace Phantom.Agent.Services.Backups;
|
||||
|
||||
static class BackupCompressor {
|
||||
private static ILogger Logger { get; } = PhantomLogger.Create(nameof(BackupCompressor));
|
||||
|
@ -23,7 +23,7 @@ sealed class BackupScheduler : CancellableBackgroundTask {
|
||||
private readonly ServerStatusProtocol serverStatusProtocol;
|
||||
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) {
|
||||
this.backupManager = backupManager;
|
||||
|
@ -3,7 +3,7 @@ using Phantom.Agent.Services.Instances.States;
|
||||
using Phantom.Common.Data.Instance;
|
||||
using Serilog;
|
||||
|
||||
namespace Phantom.Agent.Services.Instances;
|
||||
namespace Phantom.Agent.Services.Instances;
|
||||
|
||||
interface IInstanceContext {
|
||||
string ShortName { get; }
|
||||
|
@ -27,7 +27,7 @@ sealed class Instance : IAsyncDisposable {
|
||||
private IInstanceState currentState;
|
||||
public bool IsRunning => currentState is not InstanceNotRunningState;
|
||||
|
||||
public event EventHandler? IsRunningChanged;
|
||||
public event EventHandler? IsRunningChanged;
|
||||
|
||||
private readonly InstanceProcedureManager procedureManager;
|
||||
|
||||
|
@ -2,6 +2,6 @@
|
||||
using Phantom.Agent.Services.Backups;
|
||||
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);
|
||||
|
@ -1,6 +1,6 @@
|
||||
using Phantom.Agent.Services.Instances.States;
|
||||
|
||||
namespace Phantom.Agent.Services.Instances.Procedures;
|
||||
namespace Phantom.Agent.Services.Instances.Procedures;
|
||||
|
||||
interface IInstanceProcedure {
|
||||
Task<IInstanceState?> Run(IInstanceContext context, CancellationToken cancellationToken);
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace Phantom.Agent.Services.Instances.States;
|
||||
namespace Phantom.Agent.Services.Instances.States;
|
||||
|
||||
interface IInstanceState {
|
||||
void Initialize();
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace Phantom.Agent.Services.Instances.States;
|
||||
namespace Phantom.Agent.Services.Instances.States;
|
||||
|
||||
sealed class InstanceNotRunningState : IInstanceState {
|
||||
public void Initialize() {}
|
||||
|
@ -3,7 +3,7 @@ using Phantom.Common.Logging;
|
||||
using Phantom.Utils.IO;
|
||||
using Serilog;
|
||||
|
||||
namespace Phantom.Agent;
|
||||
namespace Phantom.Agent;
|
||||
|
||||
static class GuidFile {
|
||||
private static ILogger Logger { get; } = PhantomLogger.Create(nameof(GuidFile));
|
||||
|
@ -1,6 +1,6 @@
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Phantom.Common.Data.Tests;
|
||||
namespace Phantom.Common.Data.Tests;
|
||||
|
||||
[TestFixture]
|
||||
public sealed class AllowedPortsTests {
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace Phantom.Common.Data.Instance;
|
||||
namespace Phantom.Common.Data.Instance;
|
||||
|
||||
public interface IInstanceEventVisitor {
|
||||
void OnLaunchSucceeded(InstanceLaunchSuccededEvent e);
|
||||
|
@ -1,7 +1,7 @@
|
||||
using MemoryPack;
|
||||
using Phantom.Common.Data.Minecraft;
|
||||
|
||||
namespace Phantom.Common.Data.Instance;
|
||||
namespace Phantom.Common.Data.Instance;
|
||||
|
||||
[MemoryPackable(GenerateType.VersionTolerant)]
|
||||
public sealed partial record InstanceLaunchProperties(
|
||||
|
@ -1,6 +1,6 @@
|
||||
using MemoryPack;
|
||||
|
||||
namespace Phantom.Common.Data.Java;
|
||||
namespace Phantom.Common.Data.Java;
|
||||
|
||||
[MemoryPackable(GenerateType.VersionTolerant)]
|
||||
public sealed partial record TaggedJavaRuntime(
|
||||
|
@ -2,7 +2,7 @@
|
||||
using Phantom.Utils.Cryptography;
|
||||
using Phantom.Utils.IO;
|
||||
|
||||
namespace Phantom.Common.Data.Minecraft;
|
||||
namespace Phantom.Common.Data.Minecraft;
|
||||
|
||||
[MemoryPackable(GenerateType.VersionTolerant)]
|
||||
public sealed partial class FileDownloadInfo {
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace Phantom.Common.Data.Minecraft;
|
||||
namespace Phantom.Common.Data.Minecraft;
|
||||
|
||||
public enum MinecraftServerKind : ushort {
|
||||
Vanilla = 1,
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace Phantom.Common.Data.Minecraft;
|
||||
namespace Phantom.Common.Data.Minecraft;
|
||||
|
||||
public sealed record MinecraftVersion(
|
||||
string Id,
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace Phantom.Common.Data.Replies;
|
||||
namespace Phantom.Common.Data.Replies;
|
||||
|
||||
public enum ConfigureInstanceResult : byte {
|
||||
Success
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace Phantom.Common.Data.Replies;
|
||||
namespace Phantom.Common.Data.Replies;
|
||||
|
||||
public enum RegisterAgentFailure : byte {
|
||||
ConnectionAlreadyHasAnAgent,
|
||||
|
@ -1,7 +1,7 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Serilog.Events;
|
||||
|
||||
namespace Phantom.Common.Logging;
|
||||
namespace Phantom.Common.Logging;
|
||||
|
||||
static class DefaultLogLevel {
|
||||
private const string ENVIRONMENT_VARIABLE = "LOG_LEVEL";
|
||||
|
@ -1,6 +1,6 @@
|
||||
using Serilog;
|
||||
|
||||
namespace Phantom.Common.Logging;
|
||||
namespace Phantom.Common.Logging;
|
||||
|
||||
public static class LoggerExtensions {
|
||||
private static readonly string HeadingPadding = new (' ', 23);
|
||||
|
@ -2,7 +2,7 @@
|
||||
using Phantom.Common.Messages.ToServer;
|
||||
using Phantom.Utils.Rpc.Message;
|
||||
|
||||
namespace Phantom.Common.Messages;
|
||||
namespace Phantom.Common.Messages;
|
||||
|
||||
public interface IMessageToServerListener {
|
||||
bool IsDisposed { get; }
|
||||
|
@ -5,7 +5,7 @@ using Phantom.Common.Messages.ToAgent;
|
||||
using Phantom.Common.Messages.ToServer;
|
||||
using Phantom.Utils.Rpc.Message;
|
||||
|
||||
namespace Phantom.Common.Messages;
|
||||
namespace Phantom.Common.Messages;
|
||||
|
||||
public static class MessageRegistries {
|
||||
public static MessageRegistry<IMessageToAgentListener> ToAgent { get; } = new (PhantomLogger.Create("MessageRegistry:ToAgent"));
|
||||
|
@ -1,7 +1,7 @@
|
||||
using MemoryPack;
|
||||
using Phantom.Common.Data.Replies;
|
||||
|
||||
namespace Phantom.Common.Messages.ToAgent;
|
||||
namespace Phantom.Common.Messages.ToAgent;
|
||||
|
||||
[MemoryPackable(GenerateType.VersionTolerant)]
|
||||
public sealed partial record LaunchInstanceMessage(
|
||||
|
@ -1,7 +1,7 @@
|
||||
using MemoryPack;
|
||||
using Phantom.Common.Data.Replies;
|
||||
|
||||
namespace Phantom.Common.Messages.ToAgent;
|
||||
namespace Phantom.Common.Messages.ToAgent;
|
||||
|
||||
[MemoryPackable(GenerateType.VersionTolerant)]
|
||||
public sealed partial record SendCommandToInstanceMessage(
|
||||
|
@ -2,7 +2,7 @@
|
||||
using Phantom.Common.Data.Minecraft;
|
||||
using Phantom.Common.Data.Replies;
|
||||
|
||||
namespace Phantom.Common.Messages.ToAgent;
|
||||
namespace Phantom.Common.Messages.ToAgent;
|
||||
|
||||
[MemoryPackable(GenerateType.VersionTolerant)]
|
||||
public sealed partial record StopInstanceMessage(
|
||||
|
@ -3,7 +3,7 @@ using MemoryPack;
|
||||
using Phantom.Common.Data.Java;
|
||||
using Phantom.Utils.Rpc.Message;
|
||||
|
||||
namespace Phantom.Common.Messages.ToServer;
|
||||
namespace Phantom.Common.Messages.ToServer;
|
||||
|
||||
[MemoryPackable(GenerateType.VersionTolerant)]
|
||||
public sealed partial record AdvertiseJavaRuntimesMessage(
|
||||
|
@ -1,7 +1,7 @@
|
||||
using MemoryPack;
|
||||
using Phantom.Utils.Rpc.Message;
|
||||
|
||||
namespace Phantom.Common.Messages.ToServer;
|
||||
namespace Phantom.Common.Messages.ToServer;
|
||||
|
||||
[MemoryPackable(GenerateType.VersionTolerant)]
|
||||
public sealed partial record AgentIsAliveMessage : IMessageToServer {
|
||||
|
@ -2,7 +2,7 @@
|
||||
using Phantom.Common.Data;
|
||||
using Phantom.Utils.Rpc.Message;
|
||||
|
||||
namespace Phantom.Common.Messages.ToServer;
|
||||
namespace Phantom.Common.Messages.ToServer;
|
||||
|
||||
[MemoryPackable(GenerateType.VersionTolerant)]
|
||||
public sealed partial record ReportAgentStatusMessage(
|
||||
|
@ -2,7 +2,7 @@
|
||||
using Phantom.Common.Data.Instance;
|
||||
using Phantom.Utils.Rpc.Message;
|
||||
|
||||
namespace Phantom.Common.Messages.ToServer;
|
||||
namespace Phantom.Common.Messages.ToServer;
|
||||
|
||||
[MemoryPackable(GenerateType.VersionTolerant)]
|
||||
public sealed partial record ReportInstanceEventMessage(
|
||||
|
@ -1,6 +1,6 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace Phantom.Controller.Database;
|
||||
namespace Phantom.Controller.Database;
|
||||
|
||||
public sealed class DatabaseProvider {
|
||||
private readonly IServiceScopeFactory serviceScopeFactory;
|
||||
|
@ -4,7 +4,7 @@ using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text.Json;
|
||||
using Phantom.Controller.Database.Enums;
|
||||
|
||||
namespace Phantom.Controller.Database.Entities;
|
||||
namespace Phantom.Controller.Database.Entities;
|
||||
|
||||
[Table("AuditLog", Schema = "system")]
|
||||
[SuppressMessage("ReSharper", "AutoPropertyCanBeMadeGetOnly.Global")]
|
||||
|
@ -4,7 +4,7 @@ using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text.Json;
|
||||
using Phantom.Controller.Database.Enums;
|
||||
|
||||
namespace Phantom.Controller.Database.Entities;
|
||||
namespace Phantom.Controller.Database.Entities;
|
||||
|
||||
[Table("EventLog", Schema = "system")]
|
||||
[SuppressMessage("ReSharper", "AutoPropertyCanBeMadeGetOnly.Global")]
|
||||
|
@ -4,7 +4,7 @@ using System.Diagnostics.CodeAnalysis;
|
||||
using Phantom.Common.Data;
|
||||
using Phantom.Common.Data.Minecraft;
|
||||
|
||||
namespace Phantom.Controller.Database.Entities;
|
||||
namespace Phantom.Controller.Database.Entities;
|
||||
|
||||
[Table("Instances", Schema = "agents")]
|
||||
[SuppressMessage("ReSharper", "AutoPropertyCanBeMadeGetOnly.Global")]
|
||||
|
@ -1,7 +1,7 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Phantom.Controller.Database.Entities;
|
||||
namespace Phantom.Controller.Database.Entities;
|
||||
|
||||
[Table("Permissions", Schema = "identity")]
|
||||
public sealed class PermissionEntity {
|
||||
|
@ -1,7 +1,7 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Phantom.Controller.Database.Entities;
|
||||
namespace Phantom.Controller.Database.Entities;
|
||||
|
||||
[Table("Roles", Schema = "identity")]
|
||||
public sealed class RoleEntity {
|
||||
|
@ -1,6 +1,6 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Phantom.Controller.Database.Entities;
|
||||
namespace Phantom.Controller.Database.Entities;
|
||||
|
||||
[Table("RolePermissions", Schema = "identity")]
|
||||
public sealed class RolePermissionEntity {
|
||||
|
@ -1,7 +1,7 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Phantom.Controller.Database.Entities;
|
||||
namespace Phantom.Controller.Database.Entities;
|
||||
|
||||
[Table("Users", Schema = "identity")]
|
||||
public sealed class UserEntity {
|
||||
|
@ -1,6 +1,6 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Phantom.Controller.Database.Entities;
|
||||
namespace Phantom.Controller.Database.Entities;
|
||||
|
||||
[Table("UserRoles", Schema = "identity")]
|
||||
public sealed class UserRoleEntity {
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace Phantom.Controller.Database.Enums;
|
||||
namespace Phantom.Controller.Database.Enums;
|
||||
|
||||
public enum AuditLogSubjectType {
|
||||
User,
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace Phantom.Controller.Database.Enums;
|
||||
namespace Phantom.Controller.Database.Enums;
|
||||
|
||||
public enum EventLogSubjectType {
|
||||
Instance
|
||||
|
@ -1,7 +1,7 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Phantom.Controller.Database.Entities;
|
||||
|
||||
namespace Phantom.Controller.Database.Factories;
|
||||
namespace Phantom.Controller.Database.Factories;
|
||||
|
||||
public sealed class AgentEntityUpsert : AbstractUpsertHelper<AgentEntity> {
|
||||
internal AgentEntityUpsert(ApplicationDbContext ctx) : base(ctx) {}
|
||||
|
@ -1,7 +1,7 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Phantom.Controller.Database.Entities;
|
||||
|
||||
namespace Phantom.Controller.Database.Factories;
|
||||
namespace Phantom.Controller.Database.Factories;
|
||||
|
||||
public sealed class InstanceEntityUpsert : AbstractUpsertHelper<InstanceEntity> {
|
||||
internal InstanceEntityUpsert(ApplicationDbContext ctx) : base(ctx) {}
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace Phantom.Controller.Rpc;
|
||||
namespace Phantom.Controller.Rpc;
|
||||
|
||||
sealed class RpcClientConnectionClosedEventArgs : EventArgs {
|
||||
public uint RoutingId { get; }
|
||||
|
@ -2,7 +2,7 @@
|
||||
using Phantom.Common.Data.Java;
|
||||
using Phantom.Utils.Collections;
|
||||
|
||||
namespace Phantom.Controller.Services.Agents;
|
||||
namespace Phantom.Controller.Services.Agents;
|
||||
|
||||
public sealed class AgentJavaRuntimesManager {
|
||||
private readonly RwLockedDictionary<Guid, ImmutableArray<TaggedJavaRuntime>> runtimes = new (LockRecursionPolicy.NoRecursion);
|
||||
|
@ -1,6 +1,6 @@
|
||||
using System.Text.Json;
|
||||
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);
|
||||
|
@ -4,7 +4,7 @@ using Phantom.Controller.Database.Entities;
|
||||
using Phantom.Controller.Database.Enums;
|
||||
using Phantom.Utils.Tasks;
|
||||
|
||||
namespace Phantom.Controller.Services.Events;
|
||||
namespace Phantom.Controller.Services.Events;
|
||||
|
||||
public sealed partial class EventLog {
|
||||
private readonly CancellationToken cancellationToken;
|
||||
|
@ -1,6 +1,6 @@
|
||||
using System.Text.Json;
|
||||
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);
|
||||
|
@ -1,6 +1,6 @@
|
||||
using Phantom.Common.Data.Instance;
|
||||
|
||||
namespace Phantom.Controller.Services.Instances;
|
||||
namespace Phantom.Controller.Services.Instances;
|
||||
|
||||
public sealed record Instance(
|
||||
InstanceConfiguration Configuration,
|
||||
|
@ -5,7 +5,7 @@ using Phantom.Utils.Collections;
|
||||
using Phantom.Utils.Events;
|
||||
using ILogger = Serilog.ILogger;
|
||||
|
||||
namespace Phantom.Controller.Services.Instances;
|
||||
namespace Phantom.Controller.Services.Instances;
|
||||
|
||||
public sealed class InstanceLogManager {
|
||||
private const int RetainedLines = 1000;
|
||||
|
@ -3,7 +3,7 @@ using Phantom.Controller.Services.Agents;
|
||||
using Phantom.Controller.Services.Events;
|
||||
using Phantom.Controller.Services.Instances;
|
||||
|
||||
namespace Phantom.Controller.Services.Rpc;
|
||||
namespace Phantom.Controller.Services.Rpc;
|
||||
|
||||
public sealed class MessageToServerListenerFactory {
|
||||
private readonly ServiceConfiguration configuration;
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace Phantom.Controller.Services.Users;
|
||||
namespace Phantom.Controller.Services.Users;
|
||||
|
||||
public enum AddRoleError : byte {
|
||||
NameIsEmpty,
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace Phantom.Controller.Services.Users;
|
||||
namespace Phantom.Controller.Services.Users;
|
||||
|
||||
public enum DeleteUserResult : byte {
|
||||
Deleted,
|
||||
|
@ -1,6 +1,6 @@
|
||||
using Serilog;
|
||||
|
||||
namespace Phantom.Utils.Events;
|
||||
namespace Phantom.Utils.Events;
|
||||
|
||||
public abstract class ObservableState<T> {
|
||||
public EventSubscribers<T> Subs { get; }
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace Phantom.Utils.Rpc.Message;
|
||||
namespace Phantom.Utils.Rpc.Message;
|
||||
|
||||
public interface IMessage<TListener, TReply> {
|
||||
Task<TReply> Accept(TListener listener);
|
||||
|
@ -1,7 +1,7 @@
|
||||
using Phantom.Utils.Tasks;
|
||||
using Serilog;
|
||||
|
||||
namespace Phantom.Utils.Rpc.Message;
|
||||
namespace Phantom.Utils.Rpc.Message;
|
||||
|
||||
public abstract class MessageHandler<TListener> {
|
||||
protected TListener Listener { get; }
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace Phantom.Utils.Rpc.Message;
|
||||
namespace Phantom.Utils.Rpc.Message;
|
||||
|
||||
public readonly struct NoReply {
|
||||
public static NoReply Instance { get; } = new ();
|
||||
|
@ -1,7 +1,7 @@
|
||||
using System.Collections.Immutable;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Phantom.Utils.Collections;
|
||||
namespace Phantom.Utils.Collections;
|
||||
|
||||
public static class EnumerableExtensions {
|
||||
[SuppressMessage("ReSharper", "LoopCanBeConvertedToQuery")]
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace Phantom.Utils.Collections;
|
||||
namespace Phantom.Utils.Collections;
|
||||
|
||||
public sealed class RingBuffer<T> {
|
||||
private readonly T[] buffer;
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace Phantom.Utils.Cryptography;
|
||||
namespace Phantom.Utils.Cryptography;
|
||||
|
||||
public static class StableHashCode {
|
||||
public static int ForString(string str) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace Phantom.Utils.IO;
|
||||
namespace Phantom.Utils.IO;
|
||||
|
||||
public static class Chmod {
|
||||
public const UnixFileMode URWX = UnixFileMode.UserRead | UnixFileMode.UserWrite | UnixFileMode.UserExecute;
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace Phantom.Utils.IO;
|
||||
namespace Phantom.Utils.IO;
|
||||
|
||||
public static class Directories {
|
||||
public static void Create(string path, UnixFileMode mode) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace Phantom.Utils.IO;
|
||||
namespace Phantom.Utils.IO;
|
||||
|
||||
public static class Paths {
|
||||
public static string ExpandTilde(string path) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
using System.Buffers;
|
||||
|
||||
namespace Phantom.Utils.IO;
|
||||
namespace Phantom.Utils.IO;
|
||||
|
||||
public sealed class StreamCopier : IDisposable {
|
||||
private const int DefaultBufferSize = 81920;
|
||||
|
@ -1,7 +1,7 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Phantom.Utils.Processes;
|
||||
namespace Phantom.Utils.Processes;
|
||||
|
||||
public sealed class ProcessConfigurator {
|
||||
private readonly ProcessStartInfo startInfo = new () {
|
||||
|
@ -1,6 +1,6 @@
|
||||
using System.Reflection;
|
||||
|
||||
namespace Phantom.Utils.Runtime;
|
||||
namespace Phantom.Utils.Runtime;
|
||||
|
||||
public static class AssemblyAttributes {
|
||||
public static string GetFullVersion(Assembly assembly) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace Phantom.Utils.Runtime;
|
||||
namespace Phantom.Utils.Runtime;
|
||||
|
||||
/// <summary>
|
||||
/// Custom exception used to signal a procedure should stop. This exception should not be logged or propagated.
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace Phantom.Utils.Tasks;
|
||||
namespace Phantom.Utils.Tasks;
|
||||
|
||||
public static class AsyncTasks {
|
||||
public static TaskCompletionSource CreateCompletionSource() {
|
||||
|
@ -1,6 +1,6 @@
|
||||
using Serilog;
|
||||
|
||||
namespace Phantom.Utils.Tasks;
|
||||
namespace Phantom.Utils.Tasks;
|
||||
|
||||
public abstract class CancellableBackgroundTask {
|
||||
private readonly CancellationTokenSource cancellationTokenSource = new ();
|
||||
|
@ -2,7 +2,7 @@
|
||||
using Phantom.Utils.Collections;
|
||||
using Serilog;
|
||||
|
||||
namespace Phantom.Utils.Tasks;
|
||||
namespace Phantom.Utils.Tasks;
|
||||
|
||||
public sealed class TaskManager {
|
||||
private readonly ILogger logger;
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace Phantom.Utils.Threading;
|
||||
namespace Phantom.Utils.Threading;
|
||||
|
||||
public sealed class ThreadSafeLinkedList<T> : IDisposable {
|
||||
private readonly LinkedList<T> list = new ();
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace Phantom.Utils.Threading;
|
||||
namespace Phantom.Utils.Threading;
|
||||
|
||||
public sealed class ThreadSafeStructRef<T> : IDisposable where T : struct {
|
||||
private T? value;
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace Phantom.Web.Components.Forms.Base;
|
||||
namespace Phantom.Web.Components.Forms.Base;
|
||||
|
||||
public interface ICustomFormField {
|
||||
bool TwoWayValueBinding { get; set; }
|
||||
|
@ -1,7 +1,7 @@
|
||||
using Microsoft.AspNetCore.Components.Forms;
|
||||
using Phantom.Web.Components.Utils;
|
||||
|
||||
namespace Phantom.Web.Components.Forms;
|
||||
namespace Phantom.Web.Components.Forms;
|
||||
|
||||
public abstract class FormModel {
|
||||
public EditContext EditContext { get; }
|
||||
|
@ -1,6 +1,6 @@
|
||||
using Microsoft.AspNetCore.Components.Forms;
|
||||
|
||||
namespace Phantom.Web.Components.Utils;
|
||||
namespace Phantom.Web.Components.Utils;
|
||||
|
||||
public static class EditContextExtensions {
|
||||
public static void RevalidateWhenFieldChanges(this EditContext editContext, string tracked, string revalidated) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Phantom.Web.Components.Utils;
|
||||
namespace Phantom.Web.Components.Utils;
|
||||
|
||||
public abstract class FormValidationAttribute<TModel, TValue> : ValidationAttribute {
|
||||
public sealed override bool IsValid(object? value) {
|
||||
|
@ -4,7 +4,7 @@ using Phantom.Common.Logging;
|
||||
using Phantom.Utils.Tasks;
|
||||
using ILogger = Serilog.ILogger;
|
||||
|
||||
namespace Phantom.Web.Identity.Authentication;
|
||||
namespace Phantom.Web.Identity.Authentication;
|
||||
|
||||
public sealed class PhantomLoginStore {
|
||||
private static readonly ILogger Logger = PhantomLogger.Create<PhantomLoginStore>();
|
||||
|
@ -1,7 +1,7 @@
|
||||
using System.Collections.Immutable;
|
||||
using Phantom.Web.Identity.Data;
|
||||
|
||||
namespace Phantom.Web.Identity.Authorization;
|
||||
namespace Phantom.Web.Identity.Authorization;
|
||||
|
||||
public sealed class IdentityPermissions {
|
||||
internal static IdentityPermissions None { get; } = new ();
|
||||
|
@ -1,6 +1,6 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Phantom.Web.Identity.Data;
|
||||
|
||||
namespace Phantom.Web.Identity.Authorization;
|
||||
namespace Phantom.Web.Identity.Authorization;
|
||||
|
||||
sealed record PermissionBasedPolicyRequirement(Permission Permission) : IAuthorizationRequirement;
|
||||
|
@ -1,6 +1,6 @@
|
||||
using Phantom.Controller.Database.Entities;
|
||||
|
||||
namespace Phantom.Web.Identity.Interfaces;
|
||||
namespace Phantom.Web.Identity.Interfaces;
|
||||
|
||||
public interface ILoginEvents {
|
||||
void UserLoggedIn(UserEntity user);
|
||||
|
@ -3,7 +3,7 @@ using System.Web;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Phantom.Web.Identity.Interfaces;
|
||||
|
||||
namespace Phantom.Web.Base;
|
||||
namespace Phantom.Web.Base;
|
||||
|
||||
sealed class Navigation : INavigation {
|
||||
public static Func<IServiceProvider, Navigation> Create(string basePath) {
|
||||
|
@ -5,7 +5,7 @@ using Phantom.Web.Identity.Authorization;
|
||||
using Phantom.Web.Identity.Data;
|
||||
using ILogger = Serilog.ILogger;
|
||||
|
||||
namespace Phantom.Web.Base;
|
||||
namespace Phantom.Web.Base;
|
||||
|
||||
public abstract class PhantomComponent : ComponentBase {
|
||||
private static readonly ILogger Logger = PhantomLogger.Create<PhantomComponent>();
|
||||
|
Loading…
Reference in New Issue
Block a user