+
+
{{ itemDisplayName(item) }}
@if (item.seasonNumber > 0) {
}
-
+
{{ item.instanceType }}
@@ -208,7 +214,53 @@
({{ item.searchCount }}x this cycle)
}
{{ item.lastSearchedAt | date:'yyyy-MM-dd HH:mm' }}
+
+
+ @if (expandedItemId() === item.id) {
+
+
Search History
+ @if (detailLoading()) {
+
Loading...
+ } @else if (detailEntries().length === 0) {
+
No search events found
+ } @else {
+
+ @for (event of detailEntries(); track event.id) {
+
+
+
+ {{ event.searchType }}
+
+ @if (event.searchStatus) {
+
+ {{ event.searchStatus }}
+
+ }
+ @if (event.isDryRun) {
+
Dry Run
+ }
+ @if (event.cycleRunId) {
+
{{ event.cycleRunId.substring(0, 8) }}
+ }
+
{{ event.timestamp | date:'yyyy-MM-dd HH:mm' }}
+
+ @if (event.grabbedItems && event.grabbedItems.length > 0) {
+
+
+
+ Grabbed: {{ formatGrabbedItems(event.grabbedItems) }}
+
+
+ }
+ }
+
+ }
+
+ }
} @empty {
(null);
+ readonly detailEntries = signal([]);
+ readonly detailLoading = signal(false);
+
constructor() {
effect(() => {
this.hub.searchStatsVersion(); // subscribe to changes
@@ -144,6 +149,30 @@ export class SearchStatsComponent implements OnInit {
this.loadActiveTab();
}
+ toggleItemExpand(item: SearchHistoryEntry): void {
+ const id = item.id;
+ if (this.expandedItemId() === id) {
+ this.expandedItemId.set(null);
+ this.detailEntries.set([]);
+ return;
+ }
+
+ this.expandedItemId.set(id);
+ this.detailLoading.set(true);
+ this.detailEntries.set([]);
+
+ this.api.getItemDetail(item.arrInstanceId, item.externalItemId, item.seasonNumber).subscribe({
+ next: (res) => {
+ this.detailEntries.set(res.entries);
+ this.detailLoading.set(false);
+ },
+ error: () => {
+ this.detailLoading.set(false);
+ this.toast.error('Failed to load item detail');
+ },
+ });
+ }
+
searchTypeSeverity(type: SeekerSearchType): 'info' | 'warning' {
return type === SeekerSearchType.Replacement ? 'warning' : 'info';
}
@@ -232,6 +261,8 @@ export class SearchStatsComponent implements OnInit {
private loadItems(): void {
this.loading.set(true);
+ this.expandedItemId.set(null);
+ this.detailEntries.set([]);
const instanceId = this.selectedInstanceId() || undefined;
this.api.getHistory(this.itemsPage(), this.pageSize(), instanceId, this.itemsSortBy()).subscribe({
next: (result) => {