SettingsRootView.swift 2.6 KB

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