@page "/Alarm"

Alarm

Raise Get Delete Get all monitored

@if (Exception != null) {
Error:
            @Exception
        
} @if (Result != null) {
Result:
            @Result.ToJson(indent: true)
        
} @code { private Exception? Exception { get; set; } private object? Result { get; set; } private string UserId { get; set; } = "@me"; protected override async Task OnInitializedAsync() { if (App.Client is null) { NavigationManager.NavigateTo("/Auth"); return; } } private async Task RaiseAlarm() { Result = null; await App.Client!.SetAlarm(new() { Reason = "fall" }); StateHasChanged(); } private async Task GetAlarm() { Result = null; Result = await App.Client!.GetAlarm(UserId); StateHasChanged(); } private async Task ClearAlarm() { Result = null; await App.Client!.DeleteAlarm(UserId); StateHasChanged(); } private async Task GetAllAlarms() { Result = await App.Client!.GetAllAlarms(); StateHasChanged(); } }