From 3a17267c83130503dd8d5f97ab60a8bbbaab19f1 Mon Sep 17 00:00:00 2001 From: Laurent Date: Mon, 17 Mar 2025 11:08:26 +0100 Subject: [PATCH] add infos --- .../Navigation/Toolbox/APICallsListView.swift | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/PadelClub/Views/Navigation/Toolbox/APICallsListView.swift b/PadelClub/Views/Navigation/Toolbox/APICallsListView.swift index 4c904d6..6706d47 100644 --- a/PadelClub/Views/Navigation/Toolbox/APICallsListView.swift +++ b/PadelClub/Views/Navigation/Toolbox/APICallsListView.swift @@ -32,11 +32,11 @@ struct APICallsListView: View { } func load() { - self.descriptors = Store.main.collectionNames().map { - CollectionDescriptor(name: $0.0, type: $0.1) - }.sorted(by: \.name, order: .ascending) Task { - + self.descriptors = await StoreCenter.main.apiCollectionDescriptors().map { + CollectionDescriptor(name: $0.0, type: $0.1) + }.sorted(by: \.name, order: .ascending) + for descriptor in self.descriptors { if let type = descriptor.type as? any SyncedStorable.Type { await self.loadCount(type, descriptor) @@ -85,14 +85,19 @@ struct APICallsView: View { var body: some View { List { - ForEach(self.apiCalls, id: \.id) { apiCall in - NavigationLink { - APICallView(apiCall: apiCall, type: self.type) - } label: { - LabeledContent(apiCall.method.rawValue, value: apiCall.attemptsCount.string) + Section(header: + Text("\(apiCalls.count) API calls") + .font(.headline) + .foregroundColor(.primary) + ) { + ForEach(self.apiCalls, id: \.id) { apiCall in + NavigationLink { + APICallView(apiCall: apiCall, type: self.type) + } label: { + LabeledContent(apiCall.method.rawValue, value: apiCall.attemptsCount.string) + } } } -// Text(self.text).lineLimit(nil) }.navigationTitle(self.name) .onAppear { self._load()