about summary refs log tree commit diff
path: root/MatrixRoomUtils.Web/Shared/MainLayout.razor
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2023-05-04 20:34:16 +0200
committerTheArcaneBrony <myrainbowdash949@gmail.com>2023-05-04 20:34:16 +0200
commit383f7b633471dedf515907cb8a8752bc5885ae64 (patch)
tree793225216c9c38be1533e1960166b7b3dd472890 /MatrixRoomUtils.Web/Shared/MainLayout.razor
parentDark theme, fancier room list (diff)
downloadMatrixUtils-383f7b633471dedf515907cb8a8752bc5885ae64.tar.xz
Add room manager, profile caching
Diffstat (limited to 'MatrixRoomUtils.Web/Shared/MainLayout.razor')
-rw-r--r--MatrixRoomUtils.Web/Shared/MainLayout.razor16
1 files changed, 15 insertions, 1 deletions
diff --git a/MatrixRoomUtils.Web/Shared/MainLayout.razor b/MatrixRoomUtils.Web/Shared/MainLayout.razor
index 4aa01c6..87442d8 100644
--- a/MatrixRoomUtils.Web/Shared/MainLayout.razor
+++ b/MatrixRoomUtils.Web/Shared/MainLayout.razor
@@ -1,4 +1,6 @@
-@inherits LayoutComponentBase
+@using MatrixRoomUtils.Core.Extensions
+@using System.Net
+@inherits LayoutComponentBase
 
 <div class="page">
     <div class="sidebar">
@@ -9,6 +11,10 @@
         <div class="top-row px-4">
             <a href="https://git.rory.gay/MatrixRoomUtils.git/" target="_blank">Git</a>
             <a href="https://matrix.to/#/%23mru%3Arory.gay?via=rory.gay&via=matrix.org&via=feline.support" target="_blank">Matrix</a>
+            @if (showDownload)
+            {
+                <a href="/MRU.tar.xz" target="_blank">Download</a>
+            }
         </div>
 
         <article class="content px-4">
@@ -18,6 +24,14 @@
 </div>
 
 @code {
+    private bool showDownload { get; set; } = false;
 
+    protected override async Task OnInitializedAsync()
+    {
+        using var hc = new HttpClient();
+        var hr = await hc.SendAsync(new(HttpMethod.Head, NavigationManager.ToAbsoluteUri("/MRU.tar.xz").AbsoluteUri));
+        showDownload = hr.StatusCode == HttpStatusCode.OK;
+        await base.OnInitializedAsync();
 
+    }
 }
\ No newline at end of file