about summary refs log tree commit diff
path: root/MatrixUtils.Web/Pages/HSAdmin/HSAdmin.razor
diff options
context:
space:
mode:
Diffstat (limited to 'MatrixUtils.Web/Pages/HSAdmin/HSAdmin.razor')
-rw-r--r--MatrixUtils.Web/Pages/HSAdmin/HSAdmin.razor34
1 files changed, 34 insertions, 0 deletions
diff --git a/MatrixUtils.Web/Pages/HSAdmin/HSAdmin.razor b/MatrixUtils.Web/Pages/HSAdmin/HSAdmin.razor
new file mode 100644
index 0000000..6499f57
--- /dev/null
+++ b/MatrixUtils.Web/Pages/HSAdmin/HSAdmin.razor
@@ -0,0 +1,34 @@
+@page "/HSAdmin"
+@using LibMatrix.Homeservers
+@using ArcaneLibs.Extensions
+<h3>Homeserver Admininistration</h3>
+<hr/>
+
+@if (Homeserver is null) {
+    <p>Homeserver is null...</p>
+}
+else {
+    @if (Homeserver is AuthenticatedHomeserverSynapse) {
+        <h4>Synapse tools</h4>
+        <hr/>
+        <a href="/HSAdmin/RoomQuery">Query rooms</a>
+    }
+    else {
+        <p>Homeserver type @Homeserver.GetType().Name does not have any administration tools in RMU.</p>
+        <p>Server info:</p>
+        <pre>@ServerVersionResponse?.ToJson(ignoreNull: true)</pre>
+    }
+}
+
+@code {
+    public AuthenticatedHomeserverGeneric? Homeserver { get; set; }
+    public ServerVersionResponse? ServerVersionResponse { get; set; }
+
+    protected override async Task OnInitializedAsync() {
+        Homeserver = await RMUStorage.GetCurrentSessionOrNavigate();
+        if (Homeserver is null) return;
+        ServerVersionResponse = await (Homeserver.FederationClient?.GetServerVersionAsync() ?? Task.FromResult<ServerVersionResponse?>(null));
+        await base.OnInitializedAsync();
+    }
+
+}
\ No newline at end of file