@page "/" @inject DedupClient Client; @inject Blazored.LocalStorage.ILocalStorageService localStorage; @inject IJSRuntime jsRt;
@Error
@if(Ready) { @if(LoggedIn) {

Backups: @Stats.Backups

Blocks: @Stats.Blocks

Size: @Stats.Label


To Install

$ sudo apt install httpdirfs

To Mount

$ mkdir "~/BackupsMount"
$ httpdirfs -u "\$access_key" -p "@_AccessKey" "@Client.DataPath" "~/BackupsMount"

To Unmount

$ umount "~/BackupsMount"

To Unmount (if busy and you are impatient)

$ umount -l "~/BackupsMount"
} else { @if(Registered) {

Login

} else {

Register

} } } @code { public async Task SplashErrorAsync(string error) { Error = error; await jsRt.InvokeVoidAsync("ui","#sb_error"); } public Stats Stats {get;set;}=new Stats(); public bool Ready {get;set;}=false; public bool Registered {get;set;}=false; public bool LoggedIn {get;set;}=false; public string Username {get;set;}=""; public string Password {get;set;}=""; public string ConfirmPassword {get;set;}=""; public string Error {get;set;}=""; public string DeviceName {get;set;}="Browser"; public string _AccessKey {get;set;}=""; protected override async Task OnInitializedAsync() { LoggedIn = await localStorage.ContainKeyAsync("token"); if(LoggedIn) { var token=await localStorage.GetItemAsStringAsync("token"); try{ _AccessKey = token ?? ""; Stats = await Client.GetStatsAsync(_AccessKey); }catch(System.Net.Http.HttpRequestException ex) { _=ex; LoggedIn=false; } } Registered = await Client.IsRegisteredAsync(); Ready = true; } public async Task LoginAsync() { var res=await Client.LoginAsync(Username,Password,DeviceName); if(res.Success) { await localStorage.SetItemAsStringAsync("token",res.Key); Registered=true; LoggedIn=true; _AccessKey = res.Key; Stats = await Client.GetStatsAsync(res.Key); } else { await SplashErrorAsync("Incorrect username or password"); } } public async Task RegisterAsync() { if(Password != ConfirmPassword) { await SplashErrorAsync("Passwords do not match"); return; } var res=await Client.LoginAsync(Username,Password,DeviceName); if(res.Success) { await localStorage.SetItemAsStringAsync("token",res.Key); Stats = await Client.GetStatsAsync(res.Key); Registered=true; LoggedIn=true; } else { await SplashErrorAsync("Incorrect username or password"); } } }