diff --git a/backend/i18n/frontend_en.json b/backend/i18n/frontend_en.json index e4c1487ea..cc3761743 100644 --- a/backend/i18n/frontend_en.json +++ b/backend/i18n/frontend_en.json @@ -481,6 +481,7 @@ "dashboard.trafficSummaryCard": "API Traffic Summary", "dashboard.welcomeText": "Welcome to **{app}** dashboard.", "dashboard.welcomeTitle": "Hi {user}", + "eventConsumers.count": "Count", "eventConsumers.loadFailed": "Failed to load event consumers. Please reload.", "eventConsumers.pageTitle": "Event Consumers", "eventConsumers.position": "Position", diff --git a/backend/i18n/frontend_it.json b/backend/i18n/frontend_it.json index 78a52c4f3..606dd164a 100644 --- a/backend/i18n/frontend_it.json +++ b/backend/i18n/frontend_it.json @@ -481,6 +481,7 @@ "dashboard.trafficSummaryCard": "Riepilogo del traffico delle API", "dashboard.welcomeText": "Benvenuto su **{app}** dashboard.", "dashboard.welcomeTitle": "Ciao {user}", + "eventConsumers.count": "Count", "eventConsumers.loadFailed": "Non รจ stato possibile caricare event consumers. Per favore ricarica.", "eventConsumers.pageTitle": "Eventi degli utenti", "eventConsumers.position": "Posizione", diff --git a/backend/i18n/frontend_nl.json b/backend/i18n/frontend_nl.json index 2557e7323..34a0ddfa3 100644 --- a/backend/i18n/frontend_nl.json +++ b/backend/i18n/frontend_nl.json @@ -481,6 +481,7 @@ "dashboard.trafficSummaryCard": "API Verkeer Samenvatting", "dashboard.welcomeText": "Welkom bij **{app}** dashboard.", "dashboard.welcomeTitle": "Hallo {user}", + "eventConsumers.count": "Count", "eventConsumers.loadFailed": "Kan gebeurtenisgebruikers niet laden. Laad opnieuw.", "eventConsumers.pageTitle": "Evenementconsumenten", "eventConsumers.position": "Positie", diff --git a/backend/i18n/source/frontend_en.json b/backend/i18n/source/frontend_en.json index e4c1487ea..cc3761743 100644 --- a/backend/i18n/source/frontend_en.json +++ b/backend/i18n/source/frontend_en.json @@ -481,6 +481,7 @@ "dashboard.trafficSummaryCard": "API Traffic Summary", "dashboard.welcomeText": "Welcome to **{app}** dashboard.", "dashboard.welcomeTitle": "Hi {user}", + "eventConsumers.count": "Count", "eventConsumers.loadFailed": "Failed to load event consumers. Please reload.", "eventConsumers.pageTitle": "Event Consumers", "eventConsumers.position": "Position", diff --git a/backend/src/Squidex.Infrastructure/EventSourcing/EventConsumerInfo.cs b/backend/src/Squidex.Infrastructure/EventSourcing/EventConsumerInfo.cs index d17f8e069..44562ada5 100644 --- a/backend/src/Squidex.Infrastructure/EventSourcing/EventConsumerInfo.cs +++ b/backend/src/Squidex.Infrastructure/EventSourcing/EventConsumerInfo.cs @@ -11,6 +11,8 @@ namespace Squidex.Infrastructure.EventSourcing { public bool IsStopped { get; set; } + public int Count { get; set; } + public string Name { get; set; } public string Error { get; set; } diff --git a/backend/src/Squidex.Infrastructure/EventSourcing/Grains/EventConsumerState.cs b/backend/src/Squidex.Infrastructure/EventSourcing/Grains/EventConsumerState.cs index 5fabc4c86..f772a0a3b 100644 --- a/backend/src/Squidex.Infrastructure/EventSourcing/Grains/EventConsumerState.cs +++ b/backend/src/Squidex.Infrastructure/EventSourcing/Grains/EventConsumerState.cs @@ -14,6 +14,8 @@ namespace Squidex.Infrastructure.EventSourcing.Grains { public bool IsStopped { get; set; } + public int Count { get; set; } + public string? Error { get; set; } public string? Position { get; set; } @@ -32,9 +34,11 @@ namespace Squidex.Infrastructure.EventSourcing.Grains { } - public EventConsumerState(string? position) + public EventConsumerState(string? position, int count) { Position = position; + + Count = count; } public EventConsumerState Reset() @@ -44,17 +48,17 @@ namespace Squidex.Infrastructure.EventSourcing.Grains public EventConsumerState Handled(string position) { - return new EventConsumerState(position); + return new EventConsumerState(position, Count + 1); } public EventConsumerState Stopped(Exception? ex = null) { - return new EventConsumerState(Position) { IsStopped = true, Error = ex?.ToString() }; + return new EventConsumerState(Position, Count) { IsStopped = true, Error = ex?.ToString() }; } public EventConsumerState Started() { - return new EventConsumerState(Position) { IsStopped = false }; + return new EventConsumerState(Position, Count) { IsStopped = false }; } public EventConsumerInfo ToInfo(string name) diff --git a/backend/src/Squidex/Areas/Api/Controllers/EventConsumers/Models/EventConsumerDto.cs b/backend/src/Squidex/Areas/Api/Controllers/EventConsumers/Models/EventConsumerDto.cs index e1ac74e3f..137fbeae7 100644 --- a/backend/src/Squidex/Areas/Api/Controllers/EventConsumers/Models/EventConsumerDto.cs +++ b/backend/src/Squidex/Areas/Api/Controllers/EventConsumers/Models/EventConsumerDto.cs @@ -17,6 +17,8 @@ namespace Squidex.Areas.Api.Controllers.EventConsumers.Models public bool IsResetting { get; set; } + public int Count { get; set; } + public string Name { get; set; } public string? Error { get; set; } diff --git a/backend/src/Squidex/Config/Domain/StoreServices.cs b/backend/src/Squidex/Config/Domain/StoreServices.cs index 0b4e7b9dd..ff70fdbab 100644 --- a/backend/src/Squidex/Config/Domain/StoreServices.cs +++ b/backend/src/Squidex/Config/Domain/StoreServices.cs @@ -119,9 +119,6 @@ namespace Squidex.Config.Domain .As().As>(); services.AddSingletonAs() - .AsSelf(); - - services.AddSingletonAs(c => new CachingTextIndexerState(c.GetRequiredService())) .As(); var registration = services.FirstOrDefault(x => x.ServiceType == typeof(IPersistedGrantStore)); diff --git a/frontend/app/features/administration/pages/event-consumers/event-consumer.component.html b/frontend/app/features/administration/pages/event-consumers/event-consumer.component.html index 2e41dfcb4..726225fc7 100644 --- a/frontend/app/features/administration/pages/event-consumers/event-consumer.component.html +++ b/frontend/app/features/administration/pages/event-consumers/event-consumer.component.html @@ -6,6 +6,9 @@ {{eventConsumer.name}} + + {{eventConsumer.count}} + {{eventConsumer.position}} diff --git a/frontend/app/features/administration/pages/event-consumers/event-consumers-page.component.html b/frontend/app/features/administration/pages/event-consumers/event-consumers-page.component.html index a7468a5fe..e1fc0bb36 100644 --- a/frontend/app/features/administration/pages/event-consumers/event-consumers-page.component.html +++ b/frontend/app/features/administration/pages/event-consumers/event-consumers-page.component.html @@ -22,6 +22,9 @@ {{ 'common.name' | sqxTranslate }} + + {{ 'eventConsumers.count' | sqxTranslate }} + {{ 'eventConsumers.position' | sqxTranslate }} diff --git a/frontend/app/features/administration/services/event-consumers.service.spec.ts b/frontend/app/features/administration/services/event-consumers.service.spec.ts index 54dcc6260..3d7e2ec78 100644 --- a/frontend/app/features/administration/services/event-consumers.service.spec.ts +++ b/frontend/app/features/administration/services/event-consumers.service.spec.ts @@ -134,6 +134,7 @@ describe('EventConsumersService', () => { return { name: `event-consumer${id}`, position: `position${id}`, + count: id, isStopped: true, isResetting: true, error: `failure${id}`, @@ -151,6 +152,7 @@ export function createEventConsumer(id: number, suffix = '') { return new EventConsumerDto(links, `event-consumer${id}`, + id, true, true, `failure${id}${suffix}`, diff --git a/frontend/app/features/administration/services/event-consumers.service.ts b/frontend/app/features/administration/services/event-consumers.service.ts index 3fe40dae1..dd3996378 100644 --- a/frontend/app/features/administration/services/event-consumers.service.ts +++ b/frontend/app/features/administration/services/event-consumers.service.ts @@ -30,6 +30,7 @@ export class EventConsumerDto { constructor(links: ResourceLinks, public readonly name: string, + public readonly count: number, public readonly isStopped?: boolean, public readonly isResetting?: boolean, public readonly error?: string, @@ -104,6 +105,7 @@ function parseEventConsumer(response: any): EventConsumerDto { return new EventConsumerDto( response._links, response.name, + response.count, response.isStopped, response.isResetting, response.error, diff --git a/frontend/app/theme/_panels.scss b/frontend/app/theme/_panels.scss index 4687ac763..78b7ed93f 100644 --- a/frontend/app/theme/_panels.scss +++ b/frontend/app/theme/_panels.scss @@ -334,11 +334,14 @@ &-item { & { @include border-radius; + color: inherit; display: block; font-size: .9rem; font-weight: normal; margin-bottom: .25rem; padding: .25rem 1rem; + text-align: left; + text-decoration: none; } &-remove { @@ -352,6 +355,9 @@ &.active, &:hover { background: $color-theme-secondary; + color: inherit; + text-align: left; + text-decoration: none; } &.inactive { @@ -359,6 +365,7 @@ } &:hover { + .sidebar-item-remove { visibility: visible; }