From 0fcd5df18effb42fa821af8a4f6cdaf50cac0b5d Mon Sep 17 00:00:00 2001 From: Cyberboss Date: Tue, 3 Apr 2018 13:39:32 -0400 Subject: [PATCH] Compiler model --- src/Tgstation.Server.Api/Models/Compiler.cs | 45 +++++++++++++++++++ .../Models/CompilerStatus.cs | 27 +++++++++++ .../Models/DreamDaemon.cs | 8 +++- 3 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 src/Tgstation.Server.Api/Models/Compiler.cs create mode 100644 src/Tgstation.Server.Api/Models/CompilerStatus.cs diff --git a/src/Tgstation.Server.Api/Models/Compiler.cs b/src/Tgstation.Server.Api/Models/Compiler.cs new file mode 100644 index 0000000000..39eaea40b9 --- /dev/null +++ b/src/Tgstation.Server.Api/Models/Compiler.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Tgstation.Server.Api.Models +{ + /// + /// Represents the state of the DreamMaker compiler + /// + public sealed class Compiler + { + /// + /// When the compilation started + /// + public DateTimeOffset StartedAt { get; set; } + /// + /// When the compilation finished + /// + public DateTimeOffset FinishedAt { get; set; } + /// + /// The of the compiler + /// + public CompilerStatus Status { get; set; } + /// + /// If the compiler targeted the primary directory + /// + public bool? TargetedPrimaryDirectory { get; set; } + /// + /// Textual output of DM + /// + public string Output { get; set; } + /// + /// Exit code of DM + /// + public int? ExitCode { get; set; } + /// + /// Git revision the compiler ran on + /// + public string Revision { get; set; } + /// + /// Git revision of the origin branch the compiler ran on + /// + public string OriginRevision { get; set; } + } +} diff --git a/src/Tgstation.Server.Api/Models/CompilerStatus.cs b/src/Tgstation.Server.Api/Models/CompilerStatus.cs new file mode 100644 index 0000000000..b2c93b82f4 --- /dev/null +++ b/src/Tgstation.Server.Api/Models/CompilerStatus.cs @@ -0,0 +1,27 @@ +namespace Tgstation.Server.Api.Models +{ + /// + /// Status of the for an + /// +#pragma warning disable CA1717 // Only FlagsAttribute enums should have plural names + public enum CompilerStatus +#pragma warning restore CA1717 // Only FlagsAttribute enums should have plural names + { + /// + /// The is idle + /// + Idle, + /// + /// The directiory is being targeted + /// + Targeting, + /// + /// The is being copied + /// + Copying, + /// + /// DreamMaker is running + /// + Compiling + } +} \ No newline at end of file diff --git a/src/Tgstation.Server.Api/Models/DreamDaemon.cs b/src/Tgstation.Server.Api/Models/DreamDaemon.cs index 974bf1d83e..564eac09b0 100644 --- a/src/Tgstation.Server.Api/Models/DreamDaemon.cs +++ b/src/Tgstation.Server.Api/Models/DreamDaemon.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; namespace Tgstation.Server.Api.Models { @@ -66,5 +67,10 @@ namespace Tgstation.Server.Api.Models /// The port the running instance is set to. Not modifiable /// public bool CurrentPort { get; set; } + + /// + /// When the live revision was compiled. Not modifiable + /// + public DateTimeOffset CompiledOn { get; set; } } }