diff options
| author | Melodi <62381002+Melodi17@users.noreply.github.com> | 2026-09-06 09:02:31 +1000 |
|---|---|---|
| committer | Melodi <62381002+Melodi17@users.noreply.github.com> | 2026-09-06 09:02:31 +1000 |
| commit | a9bc03fb01b5d1ac41bf5592f384d22df5425aa4 (patch) | |
| tree | 16ae13e19d2a3cd7488202c30790d09557559d70 /src/marlin.web/Controllers/JobsController.cs | |
| parent | c00992ffad24212c4398736efd6d707d4cb0cc0d (diff) | |
feat: vcs and secret management support
Diffstat (limited to 'src/marlin.web/Controllers/JobsController.cs')
| -rw-r--r-- | src/marlin.web/Controllers/JobsController.cs | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/src/marlin.web/Controllers/JobsController.cs b/src/marlin.web/Controllers/JobsController.cs index 1cfdadb..c86cb2d 100644 --- a/src/marlin.web/Controllers/JobsController.cs +++ b/src/marlin.web/Controllers/JobsController.cs @@ -30,10 +30,23 @@ public class JobsController(ApplicationDbContext dbContext) : Controller return this.View(results); } + public record JobSpawnDetails( + ICollection<VersionControlSource> Sources, + Guid? Vcs = null, + string? Ref = null, + string? Commit = null, + string? Recipe = null); + [HttpGet("spawn")] - public async Task<IActionResult> Spawn() + public async Task<IActionResult> Spawn(CancellationToken ct) { - return this.View(); + var sources = await dbContext.Sources + .Include(x => x.Branches) + .ThenInclude(x => x.Commit) + .ToListAsync(ct); + + var details = new JobSpawnDetails(sources); + return this.View(details); } public record JobSpawnRequest(Guid Vcs, string Ref, string Commit, string Recipe); @@ -62,4 +75,18 @@ public class JobsController(ApplicationDbContext dbContext) : Controller // cancel job // details job (recipe, status, agent, target, plan, log, artifacts) + [HttpGet("details/{id}")] + public async Task<IActionResult> Details(Guid id) + { + var job = await dbContext.Jobs + .Include(x => x.Agent) + .Include(x => x.Source) + .Include(x => x.StatusUpdates) + .FirstOrDefaultAsync(x => x.Id == id); + + if (job == null) + return this.NotFound(); + + return this.View(job); + } }
\ No newline at end of file |
