Show more data in webapp deliveries-table
Build Docker and Deploy / Build Docker Container (push) Successful in 1m25s
Build Docker and Deploy / Run Unit-Tests (push) Failing after 10m51s
Build Docker and Deploy / Deploy to Server (push) Has been skipped

This commit is contained in:
2026-01-19 18:49:38 +01:00
parent 08fd34632a
commit b5e098a694
11 changed files with 225 additions and 8 deletions
@@ -26,6 +26,7 @@ import {
UpdateKeyRequest,
Client,
ClientListResponse,
ClientPreviewResponse,
SenderNameStatistics,
SenderNameListResponse,
DeliveryListResponse,
@@ -93,6 +94,10 @@ export class ApiService {
return this.http.delete<Client>(`${this.baseUrl}/users/${userId}/clients/${clientId}`);
}
getClientPreview(clientId: string): Observable<ClientPreviewResponse> {
return this.http.get<ClientPreviewResponse>(`${this.baseUrl}/preview/clients/${clientId}`);
}
// Channel endpoints
getChannels(userId: string, selector?: ChannelSelector): Observable<ChannelListResponse> {
let params = new HttpParams();
@@ -0,0 +1,44 @@
import { Injectable, inject } from '@angular/core';
import { Observable, of, catchError, map, shareReplay } from 'rxjs';
import { ApiService } from './api.service';
export interface ResolvedClient {
clientId: string;
clientName: string | null;
userId: string;
userName: string | null;
agentModel: string;
agentVersion: string;
}
@Injectable({
providedIn: 'root'
})
export class ClientCacheService {
private apiService = inject(ApiService);
private cache = new Map<string, Observable<ResolvedClient | null>>();
resolveClient(clientId: string): Observable<ResolvedClient | null> {
if (!this.cache.has(clientId)) {
const request$ = this.apiService.getClientPreview(clientId).pipe(
map(response => ({
clientId: response.client.client_id,
clientName: response.client.name,
userId: response.user.user_id,
userName: response.user.username,
agentModel: response.client.agent_model,
agentVersion: response.client.agent_version,
})),
catchError(() => of(null)),
shareReplay(1)
);
this.cache.set(clientId, request$);
}
return this.cache.get(clientId)!;
}
clearCache(): void {
this.cache.clear();
}
}