SettingsRootView.swift 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import SwiftUI
  2. extension Settings {
  3. struct RootView: BaseView {
  4. @EnvironmentObject var viewModel: ViewModel<Provider>
  5. var body: some View {
  6. Form {
  7. Section(header: Text("Devices")) {
  8. Text("Pump").chevronCell().modal(for: .pumpConfig, from: self)
  9. }
  10. Section(header: Text("Services")) {
  11. Text("Nightscout").chevronCell().modal(for: .nighscoutConfig, from: self)
  12. }
  13. Section(header: Text("Configuration")) {
  14. Text("Pump settings").chevronCell().modal(for: .pumpSettingsEditor, from: self)
  15. }
  16. Section(header: Text("Config files")) {
  17. Group {
  18. Text("Preferences").chevronCell()
  19. .modal(for: .configEditor(file: OpenAPS.Settings.preferences), from: self)
  20. Text("Pump Settings").chevronCell().modal(for: .configEditor(file: OpenAPS.Settings.settings), from: self)
  21. Text("Autosense").chevronCell().modal(for: .configEditor(file: OpenAPS.Settings.autosense), from: self)
  22. Text("Pump History").chevronCell()
  23. .modal(for: .configEditor(file: OpenAPS.Monitor.pumpHistory), from: self)
  24. Text("Basal profile").chevronCell()
  25. .modal(for: .configEditor(file: OpenAPS.Settings.basalProfile), from: self)
  26. Text("BG targets").chevronCell().modal(for: .configEditor(file: OpenAPS.Settings.bgTargets), from: self)
  27. Text("Carb ratios").chevronCell().modal(for: .configEditor(file: OpenAPS.Settings.carbRatios), from: self)
  28. Text("Insulin sensitivities").chevronCell()
  29. .modal(for: .configEditor(file: OpenAPS.Settings.carbRatios), from: self)
  30. Text("Temp targets").chevronCell()
  31. .modal(for: .configEditor(file: OpenAPS.Settings.tempTargets), from: self)
  32. }
  33. Group {
  34. Text("Glucose").chevronCell().modal(for: .configEditor(file: OpenAPS.Monitor.glucose), from: self)
  35. Text("Suggested").chevronCell()
  36. .modal(for: .configEditor(file: OpenAPS.Enact.suggested), from: self)
  37. }
  38. }
  39. }
  40. .navigationTitle("Settings")
  41. .navigationBarTitleDisplayMode(.automatic)
  42. }
  43. }
  44. }