NightscoutUploadView.swift 904 B

123456789101112131415161718192021222324252627
  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. }
  14. )
  15. {
  16. Toggle("Upload Treatments and Settings", isOn: $state.isUploadEnabled)
  17. Toggle("Upload Glucose", isOn: $state.uploadGlucose).disabled(!state.changeUploadGlucose)
  18. }
  19. }
  20. .navigationTitle("Upload")
  21. }
  22. }