PortableDevTools.razor (1001B)
1 2 @if (Enabled) 3 { 4 <a href="/DevOptions">Portable devtools (enabled)</a> 5 <div id="PortableDevTools" style="position: fixed; bottom: 0; right: 0; min-width: 200px; min-height: 100px; background: #0002;" draggable> 6 <p>Cache size: @RuntimeCache.GenericResponseCache.Sum(x=>x.Value.Cache.Count)</p> 7 </div> 8 } 9 else { 10 <a href="/DevOptions">Portable devtools (disabled)</a> 11 } 12 13 @code { 14 private bool Enabled { get; set; } = LocalStorageWrapper.Settings.DeveloperSettings.EnablePortableDevtools; 15 16 protected override async Task OnInitializedAsync() 17 { 18 // if(!RuntimeCache.WasLoaded) 19 // await LocalStorageWrapper.LoadFromLocalStorage(LocalStorage); 20 // StateHasChanged(); 21 Task.Run(async () => 22 { 23 while (true) 24 { 25 await Task.Delay(100); 26 Enabled = LocalStorageWrapper.Settings.DeveloperSettings.EnablePortableDevtools; 27 StateHasChanged(); 28 } 29 }); 30 } 31 }