90 lines
3.7 KiB
Swift
90 lines
3.7 KiB
Swift
// SPDX-FileCopyrightText: 2026 Kaede Akino
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
import SwiftUI
|
|
import TermindApplication
|
|
import TermindPresentation
|
|
|
|
struct MobileSettingsView: View {
|
|
let app: MobileAppModel
|
|
@AppStorage(SettingsKey.debugSectionEnabled) private var debugSectionEnabled = false
|
|
|
|
var body: some View {
|
|
Form {
|
|
Section {
|
|
Button(AppStrings.Pro.termindPro.swiftUIKey, systemImage: "sparkles.rectangle.stack") {
|
|
app.pro.presentPaywall()
|
|
}
|
|
}
|
|
Section {
|
|
NavigationLink {
|
|
MobileAppSettingsView(
|
|
workspaceSettings: app.workspaceSettings,
|
|
appReview: app.appReview,
|
|
diagnosis: app.diagnosis)
|
|
} label: {
|
|
Label(AppStrings.Settings.app.swiftUIKey, systemImage: "app.badge")
|
|
}
|
|
NavigationLink {
|
|
Form {
|
|
NotificationSettingsFields(
|
|
model: app.notificationSettings, service: app.notifications,
|
|
openSettings: TerminalNotificationPlatform.openSettings)
|
|
}
|
|
.navigationTitle(AppStrings.Notifications.title)
|
|
} label: {
|
|
Label(AppStrings.Notifications.title, systemImage: "bell.badge")
|
|
}
|
|
NavigationLink {
|
|
MobileTerminalSettingsView(
|
|
model: app.terminalSettings, experience: app.terminalExperienceSettings)
|
|
} label: {
|
|
Label(AppStrings.Settings.terminal.swiftUIKey, systemImage: "terminal")
|
|
}
|
|
NavigationLink {
|
|
MobileConnectionSettingsView(
|
|
ssh: app.sshSettings, sftp: app.sftpSettings,
|
|
sftpAccess: .init(isAllowed: app.pro.canUse(.sftpMultiConnection)) {
|
|
app.pro.require(.sftpMultiConnection)
|
|
})
|
|
} label: {
|
|
Label(AppStrings.Settings.connections.swiftUIKey, systemImage: "network")
|
|
}
|
|
NavigationLink {
|
|
MobileAISettingsView(app: app)
|
|
} label: {
|
|
Label(AppStrings.Settings.ai.swiftUIKey, systemImage: "sparkles")
|
|
}
|
|
NavigationLink {
|
|
MobileSyncSettingsView(app: app)
|
|
} label: {
|
|
Label(AppStrings.Settings.sync.swiftUIKey, systemImage: "icloud")
|
|
}
|
|
}
|
|
if debugSectionEnabled {
|
|
Section {
|
|
NavigationLink {
|
|
Form {
|
|
AppReviewDeveloperSection(controller: app.appReview)
|
|
}
|
|
.navigationTitle(AppStrings.Settings.developer.swiftUIKey)
|
|
} label: {
|
|
Label(AppStrings.Settings.developer.swiftUIKey, systemImage: "hammer")
|
|
}
|
|
NavigationLink {
|
|
MobileLoggingView(logging: app.logging)
|
|
} label: {
|
|
Label(AppStrings.Settings.logging.swiftUIKey, systemImage: "doc.text")
|
|
}
|
|
LabeledContent {
|
|
Text(verbatim: String(DeviceCensorship.canDisplayTaiwanFlag))
|
|
} label: {
|
|
Label(AppStrings.Settings.taiwanFlagAvailable.swiftUIKey, systemImage: "touchid")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
.navigationTitle(AppStrings.Navigation.settings.swiftUIKey)
|
|
}
|
|
}
|