diff options
| author | Christian Cleberg <[email protected]> | 2026-04-21 21:53:16 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-04-21 21:53:16 -0500 |
| commit | 1f58092dcb67cded75a850db364f3b46d86181f3 (patch) | |
| tree | 662731251ed1022b4a1585ec74379f233ca6705a /DomainDig/BatchSweepSummaryView.swift | |
| parent | 2e90ee4ceca73d5126118920b486149cb227c4e9 (diff) | |
| download | domain-dig-1f58092dcb67cded75a850db364f3b46d86181f3.tar.gz domain-dig-1f58092dcb67cded75a850db364f3b46d86181f3.tar.bz2 domain-dig-1f58092dcb67cded75a850db364f3b46d86181f3.zip | |
feat(v2.2.0): add foreground monitoring, notifications, and smarter diffs
- implement “Check All” sweep for tracked domains
- add local notifications for changes and certificate expiration
- introduce change severity filtering (low/medium/high)
- enhance change summaries and diff readability
- add certificate expiration tracking and alerts
- improve watchlist indicators for changes
- add sweep summary screen
- optimize performance for larger watchlists
Diffstat (limited to 'DomainDig/BatchSweepSummaryView.swift')
| -rw-r--r-- | DomainDig/BatchSweepSummaryView.swift | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/DomainDig/BatchSweepSummaryView.swift b/DomainDig/BatchSweepSummaryView.swift new file mode 100644 index 0000000..fda2bc5 --- /dev/null +++ b/DomainDig/BatchSweepSummaryView.swift @@ -0,0 +1,68 @@ +import SwiftUI + +struct BatchSweepSummaryView: View { + @Bindable var viewModel: DomainViewModel + let summary: BatchSweepSummary + + @State private var showUnchangedDomains = false + + private var visibleResults: [BatchLookupResult] { + if showUnchangedDomains { + return summary.results + } + + return summary.results.filter { + ($0.changeSeverity ?? .low) >= .medium || $0.certificateWarningLevel != .none || $0.status == .failed + } + } + + var body: some View { + NavigationStack { + List { + Section("Overview") { + statRow(label: "Checked", value: "\(summary.totalDomains)") + statRow(label: "Changed", value: "\(summary.changedDomains)") + statRow(label: "Warnings", value: "\(summary.warningDomains)") + statRow(label: "Unchanged", value: "\(summary.unchangedDomains)") + } + + Section { + Toggle("Show unchanged domains", isOn: $showUnchangedDomains) + } + + Section(visibleResults.isEmpty ? "Changed Domains" : "Results") { + if visibleResults.isEmpty { + Text("No domains with changes or warnings") + .font(.system(.caption, design: .monospaced)) + .foregroundStyle(.secondary) + } else { + ForEach(visibleResults) { result in + if let entry = viewModel.historyEntry(for: result) { + NavigationLink { + HistoryDetailView(viewModel: viewModel, entry: entry) + } label: { + BatchResultRowView(result: result) + } + } else { + BatchResultRowView(result: result) + } + } + } + } + } + .navigationTitle(summary.source == .watchlistRefresh ? "Sweep Summary" : "Batch Summary") + } + } + + private func statRow(label: String, value: String) -> some View { + HStack { + Text(label) + .font(.system(.caption, design: .monospaced)) + .foregroundStyle(.secondary) + Spacer() + Text(value) + .font(.system(.callout, design: .monospaced)) + .foregroundStyle(.primary) + } + } +} |
