diff --git a/Moonlight/App/Helpers/Wings/WingsConsole.cs b/Moonlight/App/Helpers/Wings/WingsConsole.cs index c9840840..c95908f4 100644 --- a/Moonlight/App/Helpers/Wings/WingsConsole.cs +++ b/Moonlight/App/Helpers/Wings/WingsConsole.cs @@ -89,10 +89,6 @@ public class WingsConsole : IDisposable { await Work(); } - catch (JsonReaderException) - { - // ignore - } catch (Exception e) { Logger.Warn("Error connecting to wings console"); @@ -247,6 +243,7 @@ public class WingsConsole : IDisposable break; } } + catch(JsonReaderException){} catch (Exception e) { if (!Disconnecting) diff --git a/Moonlight/Moonlight.csproj b/Moonlight/Moonlight.csproj index 4f49f9e0..28fb2188 100644 --- a/Moonlight/Moonlight.csproj +++ b/Moonlight/Moonlight.csproj @@ -48,7 +48,7 @@ - + diff --git a/Moonlight/Pages/_Layout.cshtml b/Moonlight/Pages/_Layout.cshtml index 73ba593c..a4f60ffb 100644 --- a/Moonlight/Pages/_Layout.cshtml +++ b/Moonlight/Pages/_Layout.cshtml @@ -105,9 +105,7 @@ - - - + diff --git a/Moonlight/Shared/Components/Xterm/Terminal.razor b/Moonlight/Shared/Components/Xterm/Terminal.razor index 6d8e2a6f..16ee2bbc 100644 --- a/Moonlight/Shared/Components/Xterm/Terminal.razor +++ b/Moonlight/Shared/Components/Xterm/Terminal.razor @@ -5,7 +5,7 @@ @@ -48,6 +48,18 @@ { await Xterm.InvokeAddonFunctionVoidAsync("xterm-addon-fit", "fit"); RunOnFirstRender.Invoke(); + + await Task.Run(async () => + { + try + { + await Task.Delay(1000); + await Xterm.InvokeAddonFunctionVoidAsync("xterm-addon-fit", "fit"); + await Task.Delay(1000); + await Xterm.InvokeAddonFunctionVoidAsync("xterm-addon-fit", "fit"); + } + catch (Exception){} + }); } catch (Exception) { diff --git a/Moonlight/Shared/Layouts/MainLayout.razor b/Moonlight/Shared/Layouts/MainLayout.razor index 3f45acb0..f9dd8de0 100644 --- a/Moonlight/Shared/Layouts/MainLayout.razor +++ b/Moonlight/Shared/Layouts/MainLayout.razor @@ -22,138 +22,134 @@ @inject IpBanService IpBanService @inject DynamicBackgroundService DynamicBackgroundService - - @{ - var uri = new Uri(NavigationManager.Uri); - var pathParts = uri.LocalPath.Split("/").Reverse(); +@{ + var uri = new Uri(NavigationManager.Uri); + var pathParts = uri.LocalPath.Split("/").Reverse(); - var title = ""; + var title = ""; - foreach (var pathPart in pathParts) + foreach (var pathPart in pathParts) + { + if (!string.IsNullOrEmpty(pathPart)) { - if (!string.IsNullOrEmpty(pathPart)) - { - if (pathPart == pathParts.Last()) - title += $"{pathPart.FirstCharToUpper()} "; - else - title += $"{pathPart.FirstCharToUpper()} - "; - } + if (pathPart == pathParts.Last()) + title += $"{pathPart.FirstCharToUpper()} "; + else + title += $"{pathPart.FirstCharToUpper()} - "; } } +} - - @(string.IsNullOrEmpty(title) ? "Dashboard - " : title)Moonlight + + @(string.IsNullOrEmpty(title) ? "Dashboard - " : title)Moonlight -
-
- +
+
+ - @{ - //TODO: Add a way to disable the snow - } + @{ + //TODO: Add a way to disable the snow + } - -
- -
-
-
-
-
- - @if (!IsIpBanned) + +
+ +
+
+
+
+
+ @if (!IsIpBanned) + { + if (UserProcessed) + { + if (uri.LocalPath != "/login" && + uri.LocalPath != "/passwordreset" && + uri.LocalPath != "/register") { - if (UserProcessed) + if (User == null) { - if (uri.LocalPath != "/login" && - uri.LocalPath != "/passwordreset" && - uri.LocalPath != "/register") - { - if (User == null) - { - - } - else - { - if (User.Status == UserStatus.Banned) - { - - } - else if (User.Status == UserStatus.Disabled) - { - - } - else if (User.Status == UserStatus.PasswordPending) - { - - } - else if (User.Status == UserStatus.DataPending) - { - - } - else - { - @Body - - - } - } - } - else - { - if (uri.LocalPath == "/login") - { - - } - else if (uri.LocalPath == "/register") - { - - } - else if (uri.LocalPath == "/passwordreset") - { - - } - } + } else { - + if (User.Status == UserStatus.Banned) + { + + } + else if (User.Status == UserStatus.Disabled) + { + + } + else if (User.Status == UserStatus.PasswordPending) + { + + } + else if (User.Status == UserStatus.DataPending) + { + + } + else + { + @Body + + + } } } else { -
-
+
- - +
+ @code { @@ -190,16 +186,13 @@ { try { - DynamicBackgroundService.OnBackgroundImageChanged += async (_, _) => - { - await InvokeAsync(StateHasChanged); - }; - + DynamicBackgroundService.OnBackgroundImageChanged += async (_, _) => { await InvokeAsync(StateHasChanged); }; + IsIpBanned = await IpBanService.IsBanned(); - - if(IsIpBanned) + + if (IsIpBanned) await InvokeAsync(StateHasChanged); - + await Event.On("ipBan.update", this, async _ => { IsIpBanned = await IpBanService.IsBanned(); diff --git a/Moonlight/wwwroot/assets/js/moonlight.js b/Moonlight/wwwroot/assets/js/moonlight.js index 7e865926..ca1bfa2b 100644 --- a/Moonlight/wwwroot/assets/js/moonlight.js +++ b/Moonlight/wwwroot/assets/js/moonlight.js @@ -302,8 +302,8 @@ console.log("Registering xterm addons"); window.XtermBlazor.registerAddon("xterm-addon-fit", new window.FitAddon.FitAddon()); - window.XtermBlazor.registerAddon("xterm-addon-search", new window.SearchAddon.SearchAddon()); - window.XtermBlazor.registerAddon("xterm-addon-web-links", new window.WebLinksAddon.WebLinksAddon()); + //window.XtermBlazor.registerAddon("xterm-addon-search", new window.SearchAddon.SearchAddon()); + //window.XtermBlazor.registerAddon("xterm-addon-web-links", new window.WebLinksAddon.WebLinksAddon()); }, loadMonaco: function () {