UI improvements
All checks were successful
Build Docker and Deploy / Build Docker Container (push) Successful in 51s
Build Docker and Deploy / Run Unit-Tests (push) Successful in 7m29s
Build Docker and Deploy / Deploy to Server (push) Successful in 7s

This commit is contained in:
2026-01-19 19:19:43 +01:00
parent 1dafab8f5c
commit 9352ff5c2c
3 changed files with 13 additions and 19 deletions

View File

@@ -1,6 +1,7 @@
import { Injectable, inject } from '@angular/core';
import { Observable, of, catchError, map, shareReplay } from 'rxjs';
import { ApiService } from './api.service';
import { ClientPreview, UserPreview } from '../models';
export interface ResolvedClient {
clientId: string;
@@ -17,18 +18,14 @@ export interface ResolvedClient {
export class ClientCacheService {
private apiService = inject(ApiService);
private cache = new Map<string, Observable<ResolvedClient | null>>();
private cache = new Map<string, Observable<{client: ClientPreview, user: UserPreview} | null>>();
resolveClient(clientId: string): Observable<ResolvedClient | null> {
resolveClient(clientId: string): Observable<{client: ClientPreview, user: UserPreview} | 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,
client: response.client,
user: response.user
})),
catchError(() => of(null)),
shareReplay(1)

View File

@@ -104,19 +104,15 @@
@for (delivery of deliveriesTable.data; track delivery.delivery_id) {
<tr>
<td>
<div class="cell-name">{{ getResolvedClient(delivery.receiver_client_id)?.clientName || '-' }}</div>
<div class="cell-name">{{ getResolvedClient(delivery.receiver_client_id)?.client?.name ?? '-' }}</div>
<div class="cell-id mono">{{ delivery.receiver_client_id }}</div>
</td>
<td>
<div class="cell-name">{{ getResolvedClient(delivery.receiver_client_id)?.userName || '-' }}</div>
<div class="cell-name">{{ getResolvedClient(delivery.receiver_client_id)?.user?.username ?? '-' }}</div>
<div class="cell-id mono">{{ delivery.receiver_user_id }}</div>
</td>
<td>
@if (getResolvedClient(delivery.receiver_client_id); as client) {
{{ client.agentModel }} {{ client.agentVersion }}
} @else {
-
}
{{ getResolvedClient(delivery.receiver_client_id)?.client?.agent_model ?? '-' }}
</td>
<td>
<nz-tag [nzColor]="getStatusColor(delivery.status)">
@@ -133,7 +129,8 @@
nzType="copy"
class="action-icon"
nz-tooltip
nzTooltipTitle="Copy FCM ID"
nzTooltipTitle="Copy Message FCM-ID"
style="cursor: pointer"
[appCopyToClipboard]="delivery.fcm_message_id"
></span>
} @else {

View File

@@ -16,7 +16,7 @@ import { SettingsService } from '../../../core/services/settings.service';
import { KeyCacheService, ResolvedKey } from '../../../core/services/key-cache.service';
import { UserCacheService, ResolvedUser } from '../../../core/services/user-cache.service';
import { ClientCacheService, ResolvedClient } from '../../../core/services/client-cache.service';
import { Message, Delivery } from '../../../core/models';
import { Message, Delivery, ClientPreview, UserPreview } from '../../../core/models';
import { CopyToClipboardDirective } from '../../../shared/directives/copy-to-clipboard.directive';
import { RelativeTimePipe } from '../../../shared/pipes/relative-time.pipe';
import { MetadataGridComponent, MetadataValueComponent } from '../../../shared/components/metadata-grid';
@@ -59,7 +59,7 @@ export class MessageDetailComponent implements OnInit {
resolvedKey = signal<ResolvedKey | null>(null);
resolvedChannelOwner = signal<ResolvedUser | null>(null);
deliveries = signal<Delivery[]>([]);
resolvedClients = signal<Map<string, ResolvedClient>>(new Map());
resolvedClients = signal<Map<string, {client: ClientPreview, user: UserPreview}>>(new Map());
loading = signal(true);
deleting = signal(false);
loadingDeliveries = signal(false);
@@ -139,7 +139,7 @@ export class MessageDetailComponent implements OnInit {
}
}
getResolvedClient(clientId: string): ResolvedClient | undefined {
getResolvedClient(clientId: string): {client: ClientPreview, user: UserPreview} | undefined {
return this.resolvedClients().get(clientId);
}