@page "/backups"
@inject DedupClient Client;
@inject Blazored.LocalStorage.ILocalStorageService localStorage;
@if(Ready)
{
var i = 0;
@foreach(var item in Items)
{
@if(i > 0)
{
}
@item.DeviceName
@item.Tag
i++;
}
}
@code {
public bool Ready {get;set;}=false;
public List Items {get;set;}=new List();
protected override async Task OnInitializedAsync()
{
var loggedIn = await localStorage.ContainKeyAsync("token");
if(loggedIn)
{
var token=await localStorage.GetItemAsStringAsync("token");
await foreach(var item in Client.GetBackupsAsync(token ?? ""))
{
Items.Add(item);
}
Ready=true;
}
}
}