LoopNightscoutRemoteView.swift 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // LoopFollow
  2. // LoopNightscoutRemoteView.swift
  3. // Created by Jonas Björkert on 2025-01-27.
  4. import SwiftUI
  5. struct LoopNightscoutRemoteView: View {
  6. @Environment(\.presentationMode) var presentationMode
  7. @ObservedObject var nsAdmin = Storage.shared.nsWriteAuth
  8. var body: some View {
  9. NavigationView {
  10. if !nsAdmin.value {
  11. ErrorMessageView(
  12. message: "Please update your token to include the 'admin' role in order to do remote commands with Loop."
  13. )
  14. } else {
  15. VStack {
  16. let columns = [
  17. GridItem(.flexible(), spacing: 16),
  18. GridItem(.flexible(), spacing: 16),
  19. ]
  20. LazyVGrid(columns: columns, spacing: 16) {
  21. CommandButtonView(command: "Overrides", iconName: "slider.horizontal.3", destination: LoopOverrideView())
  22. }
  23. .padding(.horizontal)
  24. Spacer()
  25. }
  26. .navigationBarTitle("Loop Remote Control", displayMode: .inline)
  27. }
  28. }
  29. }
  30. }