sync2
Laurent 8 months ago
parent 36504eec51
commit 3a17267c83
  1. 25
      PadelClub/Views/Navigation/Toolbox/APICallsListView.swift

@ -32,11 +32,11 @@ struct APICallsListView: View {
} }
func load() { func load() {
self.descriptors = Store.main.collectionNames().map {
CollectionDescriptor(name: $0.0, type: $0.1)
}.sorted(by: \.name, order: .ascending)
Task { 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 { for descriptor in self.descriptors {
if let type = descriptor.type as? any SyncedStorable.Type { if let type = descriptor.type as? any SyncedStorable.Type {
await self.loadCount(type, descriptor) await self.loadCount(type, descriptor)
@ -85,14 +85,19 @@ struct APICallsView: View {
var body: some View { var body: some View {
List { List {
ForEach(self.apiCalls, id: \.id) { apiCall in Section(header:
NavigationLink { Text("\(apiCalls.count) API calls")
APICallView(apiCall: apiCall, type: self.type) .font(.headline)
} label: { .foregroundColor(.primary)
LabeledContent(apiCall.method.rawValue, value: apiCall.attemptsCount.string) ) {
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) }.navigationTitle(self.name)
.onAppear { .onAppear {
self._load() self._load()

Loading…
Cancel
Save