feat: single setup, mass-pass progress, per-server homes, Desktop shares its library (owner review 5, v1.1.0) (#68)
CI / Build and test (push) Successful in 11m36s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 12s
Release / Build, test and publish (push) Successful in 14m56s
CI / PostgreSQL 16 integration (push) Successful in 10m11s
CI / PostgreSQL 17 integration (push) Successful in 10m15s
CI / Docker image (push) Successful in 45s
Release / Server image (push) Successful in 4m55s

Co-authored-by: Alberto Balbo <alberto.balbo.96@gmail.com>
This commit was merged in pull request #68.
This commit is contained in:
Alby96 authored and Alby96 committed 2026-11-15 18:11:43 +01:00
1 parent 988068ee8e
commit 20d64af4a4
793 files changed
+23882 -2096

No files matched your search

+44
View File
@@ -0,0 +1,44 @@
using Chronos.Protocol;
using Chronos.Protocol.Client;
namespace Chronos.App.Server;
/// <summary>
/// What the Server section's job list needs from the signed-in server (owner review 5, #65): its jobs by state, one job,
/// pause, resume and cancel, and its events (<see cref="JobProgressEvent"/>, <see cref="JobStateEvent"/>). Owns its connection.
/// </summary>
public interface IServerJobsApi : IDisposable
{
/// <summary>A page of the server's jobs in <paramref name="state"/> (a wire name: running, paused…), newest first.</summary>
Task<Page<JobDto>> ListJobsAsync(string state, string? cursor, CancellationToken cancellationToken);
Task<JobDto> GetJobAsync(Guid id, CancellationToken cancellationToken);
Task<JobDto> PauseJobAsync(Guid id, CancellationToken cancellationToken);
Task<JobDto> ResumeJobAsync(Guid id, CancellationToken cancellationToken);
Task<JobDto> CancelJobAsync(Guid id, CancellationToken cancellationToken);
/// <summary>Server events until cancelled or the socket closes.</summary>
IAsyncEnumerable<ServerEvent> EventsAsync(CancellationToken cancellationToken);
}
/// <summary><see cref="IServerJobsApi"/> over a signed-in <see cref="ChronosClient"/>, which it owns.</summary>
public sealed class ChronosServerJobsApi(ChronosClient client) : IServerJobsApi
{
public Task<Page<JobDto>> ListJobsAsync(string state, string? cursor, CancellationToken cancellationToken) =>
client.ListJobsAsync(state, null, cursor, cancellationToken);
public Task<JobDto> GetJobAsync(Guid id, CancellationToken cancellationToken) => client.GetJobAsync(id, cancellationToken);
public Task<JobDto> PauseJobAsync(Guid id, CancellationToken cancellationToken) => client.PauseJobAsync(id, cancellationToken);
public Task<JobDto> ResumeJobAsync(Guid id, CancellationToken cancellationToken) => client.ResumeJobAsync(id, cancellationToken);
public Task<JobDto> CancelJobAsync(Guid id, CancellationToken cancellationToken) => client.CancelJobAsync(id, cancellationToken);
public IAsyncEnumerable<ServerEvent> EventsAsync(CancellationToken cancellationToken) => client.EventsAsync(cancellationToken);
public void Dispose() => client.Dispose();
}