Initial scaffold — NASBackup iOS app
Full project scaffold: XcodeGen project.yml, Core models/protocols/errors,
SMBService (kishikawakatsumi/SMBClient), SFTPService (Citadel 0.9.2),
PhotoLibraryService, LANMonitor, BackupEngine, BackgroundTaskManager,
all feature UIs (Login, Connect, Browse, Backup, History, Settings),
Shared components and theme. Builds clean with zero errors.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 17:05:04 +03:00
|
|
|
import SwiftUI
|
|
|
|
|
|
|
|
|
|
struct SettingsView: View {
|
|
|
|
|
@EnvironmentObject var store: ConnectionStore
|
Add cellular data toggle, Tailscale remote access, fix ToggleRow padding
- ToggleRow: fix cramped layout — proper horizontal + vertical card padding
- ConnectionStore: add allowCellularBackup, useTailscaleWhenRemote, tailscaleHost
- LANMonitor: add isOnCellular (NWPath cellular interface), isTailscaleActive
(detects utun interface with 100.x.x.x CGNAT address), openTailscaleApp()
- BackupEngine: gate backup on cellular setting; resolveHost() switches to
tailscaleHost when not on trusted LAN and Tailscale tunnel is active
- SettingsView: CONNECTIVITY section (cellular toggle + live status),
REMOTE ACCESS section (Tailscale toggle, host field, status dot, Open button)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 11:40:07 +03:00
|
|
|
@EnvironmentObject var lanMonitor: LANMonitor
|
Initial scaffold — NASBackup iOS app
Full project scaffold: XcodeGen project.yml, Core models/protocols/errors,
SMBService (kishikawakatsumi/SMBClient), SFTPService (Citadel 0.9.2),
PhotoLibraryService, LANMonitor, BackupEngine, BackgroundTaskManager,
all feature UIs (Login, Connect, Browse, Backup, History, Settings),
Shared components and theme. Builds clean with zero errors.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 17:05:04 +03:00
|
|
|
|
|
|
|
|
var body: some View {
|
|
|
|
|
ZStack {
|
|
|
|
|
Color.white.ignoresSafeArea()
|
|
|
|
|
|
|
|
|
|
ScrollView {
|
2026-05-16 00:43:31 +03:00
|
|
|
VStack(spacing: AppTheme.sectionGap) {
|
Initial scaffold — NASBackup iOS app
Full project scaffold: XcodeGen project.yml, Core models/protocols/errors,
SMBService (kishikawakatsumi/SMBClient), SFTPService (Citadel 0.9.2),
PhotoLibraryService, LANMonitor, BackupEngine, BackgroundTaskManager,
all feature UIs (Login, Connect, Browse, Backup, History, Settings),
Shared components and theme. Builds clean with zero errors.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 17:05:04 +03:00
|
|
|
LANTriggerSection()
|
|
|
|
|
mediaSection
|
|
|
|
|
quietHoursSection
|
Add cellular data toggle, Tailscale remote access, fix ToggleRow padding
- ToggleRow: fix cramped layout — proper horizontal + vertical card padding
- ConnectionStore: add allowCellularBackup, useTailscaleWhenRemote, tailscaleHost
- LANMonitor: add isOnCellular (NWPath cellular interface), isTailscaleActive
(detects utun interface with 100.x.x.x CGNAT address), openTailscaleApp()
- BackupEngine: gate backup on cellular setting; resolveHost() switches to
tailscaleHost when not on trusted LAN and Tailscale tunnel is active
- SettingsView: CONNECTIVITY section (cellular toggle + live status),
REMOTE ACCESS section (Tailscale toggle, host field, status dot, Open button)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 11:40:07 +03:00
|
|
|
connectivitySection
|
|
|
|
|
remoteAccessSection
|
Initial scaffold — NASBackup iOS app
Full project scaffold: XcodeGen project.yml, Core models/protocols/errors,
SMBService (kishikawakatsumi/SMBClient), SFTPService (Citadel 0.9.2),
PhotoLibraryService, LANMonitor, BackupEngine, BackgroundTaskManager,
all feature UIs (Login, Connect, Browse, Backup, History, Settings),
Shared components and theme. Builds clean with zero errors.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 17:05:04 +03:00
|
|
|
notificationSection
|
|
|
|
|
}
|
2026-05-16 00:43:31 +03:00
|
|
|
.padding(.horizontal, AppTheme.hPad)
|
Initial scaffold — NASBackup iOS app
Full project scaffold: XcodeGen project.yml, Core models/protocols/errors,
SMBService (kishikawakatsumi/SMBClient), SFTPService (Citadel 0.9.2),
PhotoLibraryService, LANMonitor, BackupEngine, BackgroundTaskManager,
all feature UIs (Login, Connect, Browse, Backup, History, Settings),
Shared components and theme. Builds clean with zero errors.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 17:05:04 +03:00
|
|
|
.padding(.top, 20)
|
2026-05-16 00:43:31 +03:00
|
|
|
.padding(.bottom, 48)
|
Initial scaffold — NASBackup iOS app
Full project scaffold: XcodeGen project.yml, Core models/protocols/errors,
SMBService (kishikawakatsumi/SMBClient), SFTPService (Citadel 0.9.2),
PhotoLibraryService, LANMonitor, BackupEngine, BackgroundTaskManager,
all feature UIs (Login, Connect, Browse, Backup, History, Settings),
Shared components and theme. Builds clean with zero errors.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 17:05:04 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.navigationTitle("Settings")
|
|
|
|
|
.navigationBarTitleDisplayMode(.inline)
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-16 00:43:31 +03:00
|
|
|
// MARK: — Media
|
Initial scaffold — NASBackup iOS app
Full project scaffold: XcodeGen project.yml, Core models/protocols/errors,
SMBService (kishikawakatsumi/SMBClient), SFTPService (Citadel 0.9.2),
PhotoLibraryService, LANMonitor, BackupEngine, BackgroundTaskManager,
all feature UIs (Login, Connect, Browse, Backup, History, Settings),
Shared components and theme. Builds clean with zero errors.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 17:05:04 +03:00
|
|
|
|
|
|
|
|
private var mediaSection: some View {
|
|
|
|
|
VStack(alignment: .leading, spacing: 8) {
|
2026-05-16 00:43:31 +03:00
|
|
|
sectionLabel("WHAT TO BACK UP")
|
Initial scaffold — NASBackup iOS app
Full project scaffold: XcodeGen project.yml, Core models/protocols/errors,
SMBService (kishikawakatsumi/SMBClient), SFTPService (Citadel 0.9.2),
PhotoLibraryService, LANMonitor, BackupEngine, BackgroundTaskManager,
all feature UIs (Login, Connect, Browse, Backup, History, Settings),
Shared components and theme. Builds clean with zero errors.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 17:05:04 +03:00
|
|
|
|
|
|
|
|
VStack(spacing: 0) {
|
|
|
|
|
ToggleRow(icon: "photo", title: "Photos",
|
|
|
|
|
isOn: $store.backupFilter.includePhotos)
|
2026-05-16 00:43:31 +03:00
|
|
|
hairline
|
Initial scaffold — NASBackup iOS app
Full project scaffold: XcodeGen project.yml, Core models/protocols/errors,
SMBService (kishikawakatsumi/SMBClient), SFTPService (Citadel 0.9.2),
PhotoLibraryService, LANMonitor, BackupEngine, BackgroundTaskManager,
all feature UIs (Login, Connect, Browse, Backup, History, Settings),
Shared components and theme. Builds clean with zero errors.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 17:05:04 +03:00
|
|
|
ToggleRow(icon: "video", title: "Videos",
|
|
|
|
|
isOn: $store.backupFilter.includeVideos)
|
2026-05-16 00:43:31 +03:00
|
|
|
hairline
|
Initial scaffold — NASBackup iOS app
Full project scaffold: XcodeGen project.yml, Core models/protocols/errors,
SMBService (kishikawakatsumi/SMBClient), SFTPService (Citadel 0.9.2),
PhotoLibraryService, LANMonitor, BackupEngine, BackgroundTaskManager,
all feature UIs (Login, Connect, Browse, Backup, History, Settings),
Shared components and theme. Builds clean with zero errors.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 17:05:04 +03:00
|
|
|
ToggleRow(icon: "camera.viewfinder", title: "Screenshots",
|
|
|
|
|
isOn: $store.backupFilter.includeScreenshots)
|
2026-05-16 00:43:31 +03:00
|
|
|
hairline
|
Initial scaffold — NASBackup iOS app
Full project scaffold: XcodeGen project.yml, Core models/protocols/errors,
SMBService (kishikawakatsumi/SMBClient), SFTPService (Citadel 0.9.2),
PhotoLibraryService, LANMonitor, BackupEngine, BackgroundTaskManager,
all feature UIs (Login, Connect, Browse, Backup, History, Settings),
Shared components and theme. Builds clean with zero errors.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 17:05:04 +03:00
|
|
|
ToggleRow(icon: "rays", title: "RAW",
|
|
|
|
|
isOn: $store.backupFilter.includeRAW)
|
2026-05-16 00:43:31 +03:00
|
|
|
hairline
|
Initial scaffold — NASBackup iOS app
Full project scaffold: XcodeGen project.yml, Core models/protocols/errors,
SMBService (kishikawakatsumi/SMBClient), SFTPService (Citadel 0.9.2),
PhotoLibraryService, LANMonitor, BackupEngine, BackgroundTaskManager,
all feature UIs (Login, Connect, Browse, Backup, History, Settings),
Shared components and theme. Builds clean with zero errors.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 17:05:04 +03:00
|
|
|
ToggleRow(icon: "doc.badge.clock", title: "New files only",
|
|
|
|
|
subtitle: "Skip files already on NAS",
|
|
|
|
|
isOn: $store.backupFilter.newFilesOnly)
|
|
|
|
|
}
|
|
|
|
|
.background(Color.white)
|
2026-05-16 00:43:31 +03:00
|
|
|
.clipShape(RoundedRectangle(cornerRadius: AppTheme.radius, style: .continuous))
|
|
|
|
|
.shadow(color: AppTheme.cardShadow, radius: 12, x: 0, y: 2)
|
Initial scaffold — NASBackup iOS app
Full project scaffold: XcodeGen project.yml, Core models/protocols/errors,
SMBService (kishikawakatsumi/SMBClient), SFTPService (Citadel 0.9.2),
PhotoLibraryService, LANMonitor, BackupEngine, BackgroundTaskManager,
all feature UIs (Login, Connect, Browse, Backup, History, Settings),
Shared components and theme. Builds clean with zero errors.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 17:05:04 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-16 00:43:31 +03:00
|
|
|
// MARK: — Quiet hours
|
Initial scaffold — NASBackup iOS app
Full project scaffold: XcodeGen project.yml, Core models/protocols/errors,
SMBService (kishikawakatsumi/SMBClient), SFTPService (Citadel 0.9.2),
PhotoLibraryService, LANMonitor, BackupEngine, BackgroundTaskManager,
all feature UIs (Login, Connect, Browse, Backup, History, Settings),
Shared components and theme. Builds clean with zero errors.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 17:05:04 +03:00
|
|
|
|
|
|
|
|
private var quietHoursSection: some View {
|
|
|
|
|
VStack(alignment: .leading, spacing: 8) {
|
2026-05-16 00:43:31 +03:00
|
|
|
sectionLabel("QUIET HOURS")
|
Initial scaffold — NASBackup iOS app
Full project scaffold: XcodeGen project.yml, Core models/protocols/errors,
SMBService (kishikawakatsumi/SMBClient), SFTPService (Citadel 0.9.2),
PhotoLibraryService, LANMonitor, BackupEngine, BackgroundTaskManager,
all feature UIs (Login, Connect, Browse, Backup, History, Settings),
Shared components and theme. Builds clean with zero errors.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 17:05:04 +03:00
|
|
|
|
|
|
|
|
VStack(spacing: 0) {
|
2026-05-16 00:43:31 +03:00
|
|
|
ToggleRow(icon: "moon", title: "Quiet hours",
|
Initial scaffold — NASBackup iOS app
Full project scaffold: XcodeGen project.yml, Core models/protocols/errors,
SMBService (kishikawakatsumi/SMBClient), SFTPService (Citadel 0.9.2),
PhotoLibraryService, LANMonitor, BackupEngine, BackgroundTaskManager,
all feature UIs (Login, Connect, Browse, Backup, History, Settings),
Shared components and theme. Builds clean with zero errors.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 17:05:04 +03:00
|
|
|
subtitle: "No auto-backup during this window",
|
|
|
|
|
isOn: $store.quietHoursEnabled)
|
|
|
|
|
|
|
|
|
|
if store.quietHoursEnabled {
|
2026-05-16 00:43:31 +03:00
|
|
|
hairline
|
Initial scaffold — NASBackup iOS app
Full project scaffold: XcodeGen project.yml, Core models/protocols/errors,
SMBService (kishikawakatsumi/SMBClient), SFTPService (Citadel 0.9.2),
PhotoLibraryService, LANMonitor, BackupEngine, BackgroundTaskManager,
all feature UIs (Login, Connect, Browse, Backup, History, Settings),
Shared components and theme. Builds clean with zero errors.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 17:05:04 +03:00
|
|
|
timePickerRow(label: "Start", hour: $store.quietHoursStart)
|
2026-05-16 00:43:31 +03:00
|
|
|
hairline
|
Initial scaffold — NASBackup iOS app
Full project scaffold: XcodeGen project.yml, Core models/protocols/errors,
SMBService (kishikawakatsumi/SMBClient), SFTPService (Citadel 0.9.2),
PhotoLibraryService, LANMonitor, BackupEngine, BackgroundTaskManager,
all feature UIs (Login, Connect, Browse, Backup, History, Settings),
Shared components and theme. Builds clean with zero errors.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 17:05:04 +03:00
|
|
|
timePickerRow(label: "End", hour: $store.quietHoursEnd)
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-16 00:43:31 +03:00
|
|
|
hairline
|
|
|
|
|
ToggleRow(icon: "bolt", title: "Only while charging",
|
Initial scaffold — NASBackup iOS app
Full project scaffold: XcodeGen project.yml, Core models/protocols/errors,
SMBService (kishikawakatsumi/SMBClient), SFTPService (Citadel 0.9.2),
PhotoLibraryService, LANMonitor, BackupEngine, BackgroundTaskManager,
all feature UIs (Login, Connect, Browse, Backup, History, Settings),
Shared components and theme. Builds clean with zero errors.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 17:05:04 +03:00
|
|
|
subtitle: "Preserve battery on large libraries",
|
|
|
|
|
isOn: $store.chargingOnlyMode)
|
|
|
|
|
}
|
|
|
|
|
.background(Color.white)
|
2026-05-16 00:43:31 +03:00
|
|
|
.clipShape(RoundedRectangle(cornerRadius: AppTheme.radius, style: .continuous))
|
|
|
|
|
.shadow(color: AppTheme.cardShadow, radius: 12, x: 0, y: 2)
|
|
|
|
|
.animation(.spring(response: 0.3, dampingFraction: 0.8), value: store.quietHoursEnabled)
|
Initial scaffold — NASBackup iOS app
Full project scaffold: XcodeGen project.yml, Core models/protocols/errors,
SMBService (kishikawakatsumi/SMBClient), SFTPService (Citadel 0.9.2),
PhotoLibraryService, LANMonitor, BackupEngine, BackgroundTaskManager,
all feature UIs (Login, Connect, Browse, Backup, History, Settings),
Shared components and theme. Builds clean with zero errors.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 17:05:04 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private func timePickerRow(label: String, hour: Binding<Int>) -> some View {
|
|
|
|
|
HStack {
|
|
|
|
|
Text(label)
|
2026-05-16 00:43:31 +03:00
|
|
|
.font(AppTheme.body())
|
|
|
|
|
.foregroundStyle(AppTheme.ink)
|
Initial scaffold — NASBackup iOS app
Full project scaffold: XcodeGen project.yml, Core models/protocols/errors,
SMBService (kishikawakatsumi/SMBClient), SFTPService (Citadel 0.9.2),
PhotoLibraryService, LANMonitor, BackupEngine, BackgroundTaskManager,
all feature UIs (Login, Connect, Browse, Backup, History, Settings),
Shared components and theme. Builds clean with zero errors.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 17:05:04 +03:00
|
|
|
Spacer()
|
|
|
|
|
Picker(label, selection: hour) {
|
|
|
|
|
ForEach(0..<24, id: \.self) { h in
|
|
|
|
|
Text(String(format: "%02d:00", h)).tag(h)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.pickerStyle(.menu)
|
2026-05-16 00:43:31 +03:00
|
|
|
.tint(AppTheme.inkSecondary)
|
Initial scaffold — NASBackup iOS app
Full project scaffold: XcodeGen project.yml, Core models/protocols/errors,
SMBService (kishikawakatsumi/SMBClient), SFTPService (Citadel 0.9.2),
PhotoLibraryService, LANMonitor, BackupEngine, BackgroundTaskManager,
all feature UIs (Login, Connect, Browse, Backup, History, Settings),
Shared components and theme. Builds clean with zero errors.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 17:05:04 +03:00
|
|
|
}
|
2026-05-16 00:43:31 +03:00
|
|
|
.padding(.horizontal, AppTheme.cardPad)
|
|
|
|
|
.padding(.vertical, 12)
|
Initial scaffold — NASBackup iOS app
Full project scaffold: XcodeGen project.yml, Core models/protocols/errors,
SMBService (kishikawakatsumi/SMBClient), SFTPService (Citadel 0.9.2),
PhotoLibraryService, LANMonitor, BackupEngine, BackgroundTaskManager,
all feature UIs (Login, Connect, Browse, Backup, History, Settings),
Shared components and theme. Builds clean with zero errors.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 17:05:04 +03:00
|
|
|
}
|
|
|
|
|
|
Add cellular data toggle, Tailscale remote access, fix ToggleRow padding
- ToggleRow: fix cramped layout — proper horizontal + vertical card padding
- ConnectionStore: add allowCellularBackup, useTailscaleWhenRemote, tailscaleHost
- LANMonitor: add isOnCellular (NWPath cellular interface), isTailscaleActive
(detects utun interface with 100.x.x.x CGNAT address), openTailscaleApp()
- BackupEngine: gate backup on cellular setting; resolveHost() switches to
tailscaleHost when not on trusted LAN and Tailscale tunnel is active
- SettingsView: CONNECTIVITY section (cellular toggle + live status),
REMOTE ACCESS section (Tailscale toggle, host field, status dot, Open button)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 11:40:07 +03:00
|
|
|
// MARK: — Connectivity
|
|
|
|
|
|
|
|
|
|
private var connectivitySection: some View {
|
|
|
|
|
VStack(alignment: .leading, spacing: 8) {
|
|
|
|
|
sectionLabel("CONNECTIVITY")
|
|
|
|
|
|
|
|
|
|
VStack(spacing: 0) {
|
|
|
|
|
ToggleRow(
|
|
|
|
|
icon: "antenna.radiowaves.left.and.right",
|
|
|
|
|
title: "Allow over cellular",
|
|
|
|
|
subtitle: "Uses mobile data when Wi-Fi is unavailable",
|
|
|
|
|
isOn: $store.allowCellularBackup
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// Live status chip
|
|
|
|
|
if lanMonitor.isOnCellular {
|
|
|
|
|
hairline
|
|
|
|
|
HStack(spacing: 8) {
|
|
|
|
|
Circle()
|
|
|
|
|
.fill(store.allowCellularBackup ? AppTheme.positive : AppTheme.destructive)
|
|
|
|
|
.frame(width: 6, height: 6)
|
|
|
|
|
Text(store.allowCellularBackup
|
|
|
|
|
? "On cellular — backup allowed"
|
|
|
|
|
: "On cellular — backup blocked")
|
|
|
|
|
.font(AppTheme.micro(11))
|
|
|
|
|
.foregroundStyle(store.allowCellularBackup
|
|
|
|
|
? AppTheme.positive : AppTheme.destructive)
|
|
|
|
|
}
|
|
|
|
|
.padding(.horizontal, AppTheme.cardPad)
|
|
|
|
|
.padding(.vertical, 10)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.background(Color.white)
|
|
|
|
|
.clipShape(RoundedRectangle(cornerRadius: AppTheme.radius, style: .continuous))
|
|
|
|
|
.shadow(color: AppTheme.cardShadow, radius: 12, x: 0, y: 2)
|
|
|
|
|
.animation(.spring(response: 0.3, dampingFraction: 0.8), value: lanMonitor.isOnCellular)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// MARK: — Remote Access (Tailscale)
|
|
|
|
|
|
|
|
|
|
private var remoteAccessSection: some View {
|
|
|
|
|
VStack(alignment: .leading, spacing: 8) {
|
|
|
|
|
sectionLabel("REMOTE ACCESS")
|
|
|
|
|
|
|
|
|
|
VStack(spacing: 0) {
|
|
|
|
|
ToggleRow(
|
|
|
|
|
icon: "network.badge.shield.half.filled",
|
|
|
|
|
title: "Use Tailscale when remote",
|
|
|
|
|
subtitle: "Connects via VPN when not on home network",
|
|
|
|
|
isOn: $store.useTailscaleWhenRemote
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
if store.useTailscaleWhenRemote {
|
|
|
|
|
hairline
|
|
|
|
|
|
|
|
|
|
// Tailscale host input
|
|
|
|
|
HStack(spacing: 12) {
|
|
|
|
|
Image(systemName: "server.rack")
|
|
|
|
|
.font(.system(size: 14, weight: .regular))
|
|
|
|
|
.foregroundStyle(AppTheme.inkSecondary)
|
|
|
|
|
.frame(width: 20)
|
|
|
|
|
VStack(alignment: .leading, spacing: 3) {
|
|
|
|
|
Text("Tailscale NAS host")
|
|
|
|
|
.font(AppTheme.micro())
|
|
|
|
|
.foregroundStyle(AppTheme.inkTertiary)
|
|
|
|
|
TextField("100.x.x.x or nas.tail-xxxxx.ts.net",
|
|
|
|
|
text: $store.tailscaleHost)
|
|
|
|
|
.font(AppTheme.body())
|
|
|
|
|
.foregroundStyle(AppTheme.ink)
|
|
|
|
|
.keyboardType(.URL)
|
|
|
|
|
.autocorrectionDisabled()
|
|
|
|
|
.textInputAutocapitalization(.never)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.padding(.horizontal, AppTheme.cardPad)
|
|
|
|
|
.padding(.vertical, 12)
|
|
|
|
|
|
|
|
|
|
hairline
|
|
|
|
|
|
|
|
|
|
// Tailscale status + open button
|
|
|
|
|
HStack(spacing: 10) {
|
|
|
|
|
Circle()
|
|
|
|
|
.fill(lanMonitor.isTailscaleActive ? AppTheme.positive : AppTheme.inkQuaternary)
|
|
|
|
|
.frame(width: 7, height: 7)
|
|
|
|
|
Text(lanMonitor.isTailscaleActive ? "Tailscale connected" : "Tailscale not active")
|
|
|
|
|
.font(AppTheme.caption())
|
|
|
|
|
.foregroundStyle(lanMonitor.isTailscaleActive
|
|
|
|
|
? AppTheme.positive : AppTheme.inkTertiary)
|
|
|
|
|
Spacer()
|
|
|
|
|
if !lanMonitor.isTailscaleActive {
|
|
|
|
|
Button {
|
|
|
|
|
lanMonitor.openTailscaleApp()
|
|
|
|
|
} label: {
|
|
|
|
|
Text("Open Tailscale")
|
|
|
|
|
.font(AppTheme.micro())
|
|
|
|
|
.foregroundStyle(AppTheme.ink)
|
|
|
|
|
.padding(.horizontal, 10)
|
|
|
|
|
.padding(.vertical, 5)
|
|
|
|
|
.background(AppTheme.surfaceSunken)
|
|
|
|
|
.clipShape(RoundedRectangle(cornerRadius: 6, style: .continuous))
|
|
|
|
|
}
|
|
|
|
|
.buttonStyle(ScaleButtonStyle())
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.padding(.horizontal, AppTheme.cardPad)
|
|
|
|
|
.padding(.vertical, 12)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.background(Color.white)
|
|
|
|
|
.clipShape(RoundedRectangle(cornerRadius: AppTheme.radius, style: .continuous))
|
|
|
|
|
.shadow(color: AppTheme.cardShadow, radius: 12, x: 0, y: 2)
|
|
|
|
|
.animation(.spring(response: 0.3, dampingFraction: 0.8), value: store.useTailscaleWhenRemote)
|
|
|
|
|
.animation(.spring(response: 0.25, dampingFraction: 0.8), value: lanMonitor.isTailscaleActive)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-16 00:43:31 +03:00
|
|
|
// MARK: — Notifications
|
Initial scaffold — NASBackup iOS app
Full project scaffold: XcodeGen project.yml, Core models/protocols/errors,
SMBService (kishikawakatsumi/SMBClient), SFTPService (Citadel 0.9.2),
PhotoLibraryService, LANMonitor, BackupEngine, BackgroundTaskManager,
all feature UIs (Login, Connect, Browse, Backup, History, Settings),
Shared components and theme. Builds clean with zero errors.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 17:05:04 +03:00
|
|
|
|
|
|
|
|
private var notificationSection: some View {
|
|
|
|
|
VStack(alignment: .leading, spacing: 8) {
|
2026-05-16 00:43:31 +03:00
|
|
|
sectionLabel("NOTIFICATIONS")
|
Initial scaffold — NASBackup iOS app
Full project scaffold: XcodeGen project.yml, Core models/protocols/errors,
SMBService (kishikawakatsumi/SMBClient), SFTPService (Citadel 0.9.2),
PhotoLibraryService, LANMonitor, BackupEngine, BackgroundTaskManager,
all feature UIs (Login, Connect, Browse, Backup, History, Settings),
Shared components and theme. Builds clean with zero errors.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 17:05:04 +03:00
|
|
|
|
|
|
|
|
VStack(spacing: 0) {
|
2026-05-16 00:43:31 +03:00
|
|
|
notifRow(icon: "bell", title: "On start", value: "Off")
|
|
|
|
|
hairline
|
|
|
|
|
notifRow(icon: "checkmark.circle", title: "On complete", value: "On")
|
|
|
|
|
hairline
|
|
|
|
|
notifRow(icon: "exclamationmark.triangle", title: "On errors", value: "On")
|
Initial scaffold — NASBackup iOS app
Full project scaffold: XcodeGen project.yml, Core models/protocols/errors,
SMBService (kishikawakatsumi/SMBClient), SFTPService (Citadel 0.9.2),
PhotoLibraryService, LANMonitor, BackupEngine, BackgroundTaskManager,
all feature UIs (Login, Connect, Browse, Backup, History, Settings),
Shared components and theme. Builds clean with zero errors.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 17:05:04 +03:00
|
|
|
}
|
|
|
|
|
.background(Color.white)
|
2026-05-16 00:43:31 +03:00
|
|
|
.clipShape(RoundedRectangle(cornerRadius: AppTheme.radius, style: .continuous))
|
|
|
|
|
.shadow(color: AppTheme.cardShadow, radius: 12, x: 0, y: 2)
|
Initial scaffold — NASBackup iOS app
Full project scaffold: XcodeGen project.yml, Core models/protocols/errors,
SMBService (kishikawakatsumi/SMBClient), SFTPService (Citadel 0.9.2),
PhotoLibraryService, LANMonitor, BackupEngine, BackgroundTaskManager,
all feature UIs (Login, Connect, Browse, Backup, History, Settings),
Shared components and theme. Builds clean with zero errors.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 17:05:04 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-16 00:43:31 +03:00
|
|
|
private func notifRow(icon: String, title: String, value: String) -> some View {
|
|
|
|
|
HStack(spacing: 12) {
|
Initial scaffold — NASBackup iOS app
Full project scaffold: XcodeGen project.yml, Core models/protocols/errors,
SMBService (kishikawakatsumi/SMBClient), SFTPService (Citadel 0.9.2),
PhotoLibraryService, LANMonitor, BackupEngine, BackgroundTaskManager,
all feature UIs (Login, Connect, Browse, Backup, History, Settings),
Shared components and theme. Builds clean with zero errors.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 17:05:04 +03:00
|
|
|
Image(systemName: icon)
|
2026-05-16 00:43:31 +03:00
|
|
|
.font(.system(size: 14, weight: .regular))
|
|
|
|
|
.foregroundStyle(AppTheme.inkSecondary)
|
|
|
|
|
.frame(width: 20)
|
Initial scaffold — NASBackup iOS app
Full project scaffold: XcodeGen project.yml, Core models/protocols/errors,
SMBService (kishikawakatsumi/SMBClient), SFTPService (Citadel 0.9.2),
PhotoLibraryService, LANMonitor, BackupEngine, BackgroundTaskManager,
all feature UIs (Login, Connect, Browse, Backup, History, Settings),
Shared components and theme. Builds clean with zero errors.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 17:05:04 +03:00
|
|
|
Text(title)
|
2026-05-16 00:43:31 +03:00
|
|
|
.font(AppTheme.body())
|
|
|
|
|
.foregroundStyle(AppTheme.ink)
|
Initial scaffold — NASBackup iOS app
Full project scaffold: XcodeGen project.yml, Core models/protocols/errors,
SMBService (kishikawakatsumi/SMBClient), SFTPService (Citadel 0.9.2),
PhotoLibraryService, LANMonitor, BackupEngine, BackgroundTaskManager,
all feature UIs (Login, Connect, Browse, Backup, History, Settings),
Shared components and theme. Builds clean with zero errors.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 17:05:04 +03:00
|
|
|
Spacer()
|
|
|
|
|
Text(value)
|
2026-05-16 00:43:31 +03:00
|
|
|
.font(AppTheme.caption())
|
|
|
|
|
.foregroundStyle(AppTheme.inkTertiary)
|
Initial scaffold — NASBackup iOS app
Full project scaffold: XcodeGen project.yml, Core models/protocols/errors,
SMBService (kishikawakatsumi/SMBClient), SFTPService (Citadel 0.9.2),
PhotoLibraryService, LANMonitor, BackupEngine, BackgroundTaskManager,
all feature UIs (Login, Connect, Browse, Backup, History, Settings),
Shared components and theme. Builds clean with zero errors.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 17:05:04 +03:00
|
|
|
}
|
2026-05-16 00:43:31 +03:00
|
|
|
.padding(.horizontal, AppTheme.cardPad)
|
|
|
|
|
.padding(.vertical, 14)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private var hairline: some View {
|
|
|
|
|
Rectangle()
|
|
|
|
|
.fill(AppTheme.separator)
|
|
|
|
|
.frame(height: 0.5)
|
|
|
|
|
.padding(.leading, AppTheme.cardPad)
|
Initial scaffold — NASBackup iOS app
Full project scaffold: XcodeGen project.yml, Core models/protocols/errors,
SMBService (kishikawakatsumi/SMBClient), SFTPService (Citadel 0.9.2),
PhotoLibraryService, LANMonitor, BackupEngine, BackgroundTaskManager,
all feature UIs (Login, Connect, Browse, Backup, History, Settings),
Shared components and theme. Builds clean with zero errors.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 17:05:04 +03:00
|
|
|
}
|
|
|
|
|
}
|