about summary refs log tree commit diff
path: root/MatrixRoomUtils.Web/Pages
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2023-05-14 15:07:47 +0200
committerTheArcaneBrony <myrainbowdash949@gmail.com>2023-05-14 15:07:47 +0200
commit60d713b82fcc6b17858dd4975601ee67177a9313 (patch)
tree548893df40087a6a1cc7f0bc9bbfd993f0428a56 /MatrixRoomUtils.Web/Pages
parentAdd state cache (diff)
downloadMatrixUtils-60d713b82fcc6b17858dd4975601ee67177a9313.tar.xz
Local changes
Diffstat (limited to 'MatrixRoomUtils.Web/Pages')
-rw-r--r--MatrixRoomUtils.Web/Pages/DevOptions.razor32
-rw-r--r--MatrixRoomUtils.Web/Pages/MediaLocator.razor36
2 files changed, 68 insertions, 0 deletions
diff --git a/MatrixRoomUtils.Web/Pages/DevOptions.razor b/MatrixRoomUtils.Web/Pages/DevOptions.razor
new file mode 100644
index 0000000..0cc38d8
--- /dev/null
+++ b/MatrixRoomUtils.Web/Pages/DevOptions.razor
@@ -0,0 +1,32 @@
+@page "/DevOptions"
+@using MatrixRoomUtils.Web.Shared.IndexComponents
+@using System.Net
+@using MatrixRoomUtils.Core.Extensions
+@inject NavigationManager NavigationManager
+@inject ILocalStorageService LocalStorage
+
+<PageTitle>Developer options</PageTitle>
+
+<h3>Rory&::MatrixUtils - Developer options</h3>
+<hr/>
+
+<InputCheckbox @bind-Value="@LocalStorageWrapper.Settings.DeveloperSettings.EnableLogViewers" @oninput="@LogStuff"></InputCheckbox><label> Enable log views</label>
+
+
+@code {
+    protected override async Task OnInitializedAsync()
+    {
+        await LocalStorageWrapper.LoadFromLocalStorage(LocalStorage);
+        await base.OnInitializedAsync();
+        await LocalStorageWrapper.SaveToLocalStorage(LocalStorage);
+    }
+
+    protected async Task LogStuff()
+    {
+        await Task.Delay(100);
+        Console.WriteLine($"Settings: {LocalStorageWrapper.Settings.ToJson()}");
+        
+        await LocalStorageWrapper.SaveToLocalStorage(LocalStorage);
+    }
+
+}
\ No newline at end of file
diff --git a/MatrixRoomUtils.Web/Pages/MediaLocator.razor b/MatrixRoomUtils.Web/Pages/MediaLocator.razor
new file mode 100644
index 0000000..cd244ef
--- /dev/null
+++ b/MatrixRoomUtils.Web/Pages/MediaLocator.razor
@@ -0,0 +1,36 @@
+@page "/MediaLocator"
+<h3>MediaLocator</h3>
+<hr/>
+
+<span>MXC URL: </span>
+<input type="text" @bind="mxcUrl" />
+<button @onclick="executeSearch">Search</button>
+
+
+@code {
+    string mxcUrl { get; set; }
+    List<string> successResults = new List<string>();
+    List<string> errorResults = new List<string>();
+    List<string> homeservers = new List<string>();
+
+    protected override async Task OnInitializedAsync()
+    {
+        base.OnInitializedAsync();
+        
+    }
+
+    async Task executeSearch()
+    {
+        var client = new HttpClient();
+        var response = await client.GetAsync($"https://matrix.org/_matrix/media/r0/identicon/{mxcUrl}");
+        if (response.IsSuccessStatusCode)
+        {
+            successResults.Add(mxcUrl);
+        }
+        else
+        {
+            errorResults.Add(mxcUrl);
+        }
+    }
+
+}
\ No newline at end of file