| | | 1 | | using Elsa.Dashboard.Abstractions.Models; |
| | | 2 | | |
| | | 3 | | namespace Elsa.Dashboard.Abstractions.Contracts; |
| | | 4 | | |
| | | 5 | | public interface IDashboardContributor |
| | | 6 | | { |
| | | 7 | | string Id { get; } |
| | | 8 | | |
| | | 9 | | int Order { get; } |
| | | 10 | | |
| | | 11 | | ValueTask<DashboardOverviewContribution?> GetOverviewAsync(DashboardContext context) |
| | | 12 | | { |
| | | 13 | | return ValueTask.FromResult<DashboardOverviewContribution?>(null); |
| | | 14 | | } |
| | | 15 | | |
| | | 16 | | ValueTask<IReadOnlyCollection<DashboardFinding>> GetFindingsAsync(DashboardContext context) |
| | | 17 | | { |
| | | 18 | | return ValueTask.FromResult<IReadOnlyCollection<DashboardFinding>>([]); |
| | | 19 | | } |
| | | 20 | | |
| | | 21 | | ValueTask<DashboardTrendResponse?> GetWorkflowTrendsAsync(DashboardTrendContext context) |
| | | 22 | | { |
| | | 23 | | return ValueTask.FromResult<DashboardTrendResponse?>(null); |
| | | 24 | | } |
| | | 25 | | |
| | | 26 | | ValueTask<DashboardRecentActivityResponse?> GetRecentActivityAsync(DashboardListContext context) |
| | | 27 | | { |
| | | 28 | | return ValueTask.FromResult<DashboardRecentActivityResponse?>(null); |
| | | 29 | | } |
| | | 30 | | |
| | | 31 | | ValueTask<DashboardWorkflowHotspotsResponse?> GetWorkflowHotspotsAsync(DashboardHotspotsContext context) |
| | | 32 | | { |
| | | 33 | | return ValueTask.FromResult<DashboardWorkflowHotspotsResponse?>(null); |
| | | 34 | | } |
| | | 35 | | } |
| | | 36 | | |
| | | 37 | | public record DashboardContext( |
| | | 38 | | DashboardRange Range, |
| | | 39 | | bool IncludeSystem, |
| | | 40 | | CancellationToken CancellationToken, |
| | | 41 | | string? TenantId = null, |
| | | 42 | | string? EnvironmentName = null); |
| | | 43 | | |
| | | 44 | | public record DashboardTrendContext( |
| | | 45 | | DashboardRange Range, |
| | | 46 | | string Granularity, |
| | | 47 | | bool IncludeSystem, |
| | | 48 | | CancellationToken CancellationToken, |
| | | 49 | | string? TenantId = null, |
| | | 50 | | string? EnvironmentName = null); |
| | | 51 | | |
| | | 52 | | public record DashboardListContext( |
| | | 53 | | DashboardRange Range, |
| | | 54 | | int Take, |
| | | 55 | | bool IncludeSystem, |
| | | 56 | | CancellationToken CancellationToken, |
| | | 57 | | string? TenantId = null, |
| | | 58 | | string? EnvironmentName = null); |
| | | 59 | | |
| | 0 | 60 | | public record DashboardHotspotsContext( |
| | 0 | 61 | | DashboardRange Range, |
| | 0 | 62 | | string Metric, |
| | 0 | 63 | | int Take, |
| | 0 | 64 | | bool IncludeSystem, |
| | 0 | 65 | | CancellationToken CancellationToken, |
| | 0 | 66 | | string? TenantId = null, |
| | 0 | 67 | | string? EnvironmentName = null); |
| | | 68 | | |
| | | 69 | | public record DashboardOverviewContribution |
| | | 70 | | { |
| | | 71 | | public DashboardRuntimeStatus? Runtime { get; init; } |
| | | 72 | | public DashboardWorkflowInstanceMetrics? WorkflowInstances { get; init; } |
| | | 73 | | public DashboardDiagnosticsSummary? Diagnostics { get; init; } |
| | | 74 | | public IReadOnlyCollection<DashboardMetricCard> Metrics { get; init; } = []; |
| | | 75 | | public IReadOnlyCollection<DashboardPanelSummary> Panels { get; init; } = []; |
| | | 76 | | } |