NightscoutUploadView.swift 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. import SwiftUI
  2. struct NightscoutUploadView: View {
  3. @ObservedObject var state: NightscoutConfig.StateModel
  4. var body: some View {
  5. Form {
  6. Section(
  7. header: Text("Allow Uploading to Nightscout"),
  8. footer: VStack(alignment: .leading, spacing: 2) {
  9. Text(
  10. "The Upload Treatments toggle enables uploading of carbs, temp targets, device status, preferences and settings."
  11. )
  12. Text("\nThe Upload Glucose toggle enables uploading of CGM readings.")
  13. if !state.changeUploadGlucose {
  14. Text("\nTo flip the Upload Glucose toggle, go to ⚙️ > CGM > CGM Configuration")
  15. }
  16. }
  17. )
  18. {
  19. Toggle("Upload Treatments and Settings", isOn: $state.isUploadEnabled)
  20. Toggle("Upload Glucose", isOn: $state.uploadGlucose).disabled(!state.changeUploadGlucose)
  21. }
  22. }
  23. .navigationTitle("Upload")
  24. }
  25. }