SettingsRootView.swift 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. }
  30. Group {
  31. Text("Glucose").chevronCell().modal(for: .configEditor(file: OpenAPS.Monitor.glucose), from: self)
  32. Text("Suggested").chevronCell()
  33. .modal(for: .configEditor(file: OpenAPS.Enact.suggested), from: self)
  34. }
  35. }
  36. }
  37. .navigationTitle("Settings")
  38. .navigationBarTitleDisplayMode(.automatic)
  39. }
  40. }
  41. }