SettingsRootView.swift 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. Text("Basal settings").chevronCell().modal(for: .basalProfileEditor, from: self)
  16. }
  17. Section(header: Text("Config files")) {
  18. Group {
  19. Text("Preferences").chevronCell()
  20. .modal(for: .configEditor(file: OpenAPS.Settings.preferences), from: self)
  21. Text("Pump Settings").chevronCell().modal(for: .configEditor(file: OpenAPS.Settings.settings), from: self)
  22. Text("Autosense").chevronCell().modal(for: .configEditor(file: OpenAPS.Settings.autosense), from: self)
  23. Text("Pump History").chevronCell()
  24. .modal(for: .configEditor(file: OpenAPS.Monitor.pumpHistory), from: self)
  25. Text("Basal profile").chevronCell()
  26. .modal(for: .configEditor(file: OpenAPS.Settings.basalProfile), from: self)
  27. Text("BG targets").chevronCell().modal(for: .configEditor(file: OpenAPS.Settings.bgTargets), from: self)
  28. Text("Carb ratios").chevronCell().modal(for: .configEditor(file: OpenAPS.Settings.carbRatios), from: self)
  29. Text("Insulin sensitivities").chevronCell()
  30. .modal(for: .configEditor(file: OpenAPS.Settings.carbRatios), from: self)
  31. Text("Temp targets").chevronCell()
  32. .modal(for: .configEditor(file: OpenAPS.Settings.tempTargets), from: self)
  33. }
  34. Group {
  35. Text("Glucose").chevronCell().modal(for: .configEditor(file: OpenAPS.Monitor.glucose), from: self)
  36. Text("Suggested").chevronCell()
  37. .modal(for: .configEditor(file: OpenAPS.Enact.suggested), from: self)
  38. }
  39. }
  40. }
  41. .navigationTitle("Settings")
  42. .navigationBarTitleDisplayMode(.automatic)
  43. }
  44. }
  45. }