From 115f010780fd7ce090e2f5effb80bd664037c9d5 Mon Sep 17 00:00:00 2001 From: GyroGearl00se Date: Wed, 19 Jun 2024 17:58:04 +0200 Subject: [PATCH] added OnInitialized again --- Components/Pages/QueueBrowser.razor | 34 +++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/Components/Pages/QueueBrowser.razor b/Components/Pages/QueueBrowser.razor index 7baf029..db864d7 100644 --- a/Components/Pages/QueueBrowser.razor +++ b/Components/Pages/QueueBrowser.razor @@ -5,6 +5,7 @@ @inject QueueBrowserService QueueBrowserService @inject ILogger Logger @inject Blazored.Toast.Services.IToastService toastService +@inject NavigationManager Navigation Queue Browser @@ -201,4 +202,37 @@ deletingMessageId = ""; } } + + protected override void OnInitialized() + { + var uri = Navigation.ToAbsoluteUri(Navigation.Uri); + var queryParams = Microsoft.AspNetCore.WebUtilities.QueryHelpers.ParseQuery(uri.Query); + + if (queryParams.TryGetValue("host", out var hostValue)) + { + host = hostValue; + } + + if (queryParams.TryGetValue("vpn", out var vpnValue)) + { + vpnName = vpnValue; + } + + if (queryParams.TryGetValue("queue", out var queueValue)) + { + queueName = queueValue; + } + + if (queryParams.TryGetValue("username", out var usernameValue)) + { + username = usernameValue; + } + + if (queryParams.TryGetValue("hostname", out var hostnameValue)) + { + host = hostnameValue; + } + + password = string.Empty; + } }