Fixed xterm console issues
This commit is contained in:
@@ -89,10 +89,6 @@ public class WingsConsole : IDisposable
|
|||||||
{
|
{
|
||||||
await Work();
|
await Work();
|
||||||
}
|
}
|
||||||
catch (JsonReaderException)
|
|
||||||
{
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Logger.Warn("Error connecting to wings console");
|
Logger.Warn("Error connecting to wings console");
|
||||||
@@ -247,6 +243,7 @@ public class WingsConsole : IDisposable
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch(JsonReaderException){}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
if (!Disconnecting)
|
if (!Disconnecting)
|
||||||
|
|||||||
@@ -48,7 +48,7 @@
|
|||||||
<PackageReference Include="RestSharp" Version="109.0.0-preview.1" />
|
<PackageReference Include="RestSharp" Version="109.0.0-preview.1" />
|
||||||
<PackageReference Include="SSH.NET" Version="2020.0.2" />
|
<PackageReference Include="SSH.NET" Version="2020.0.2" />
|
||||||
<PackageReference Include="UAParser" Version="3.1.47" />
|
<PackageReference Include="UAParser" Version="3.1.47" />
|
||||||
<PackageReference Include="XtermBlazor" Version="1.6.1" />
|
<PackageReference Include="XtermBlazor" Version="1.8.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -105,9 +105,7 @@
|
|||||||
|
|
||||||
<script src="https://www.google.com/recaptcha/api.js"></script>
|
<script src="https://www.google.com/recaptcha/api.js"></script>
|
||||||
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/xterm-addon-fit@0.5.0/lib/xterm-addon-fit.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/xterm-addon-fit@0.7.0/lib/xterm-addon-fit.min.js"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/xterm-addon-search@0.8.2/lib/xterm-addon-search.min.js"></script>
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/xterm-addon-web-links@0.5.0/lib/xterm-addon-web-links.min.js"></script>
|
|
||||||
|
|
||||||
<script src="/_content/BlazorMonaco/lib/monaco-editor/min/vs/loader.js"></script>
|
<script src="/_content/BlazorMonaco/lib/monaco-editor/min/vs/loader.js"></script>
|
||||||
<script>require.config({ paths: { 'vs': '/_content/BlazorMonaco/lib/monaco-editor/min/vs' } });</script>
|
<script>require.config({ paths: { 'vs': '/_content/BlazorMonaco/lib/monaco-editor/min/vs' } });</script>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<Xterm
|
<Xterm
|
||||||
@ref="Xterm"
|
@ref="Xterm"
|
||||||
Options="TerminalOptions"
|
Options="TerminalOptions"
|
||||||
AddonIds="@(new[] { "xterm-addon-fit", "xterm-addon-search", "xterm-addon-web-links" })"
|
AddonIds="@(new[] { "xterm-addon-fit" })"
|
||||||
OnFirstRender="OnFirstRender">
|
OnFirstRender="OnFirstRender">
|
||||||
</Xterm>
|
</Xterm>
|
||||||
|
|
||||||
@@ -48,6 +48,18 @@
|
|||||||
{
|
{
|
||||||
await Xterm.InvokeAddonFunctionVoidAsync("xterm-addon-fit", "fit");
|
await Xterm.InvokeAddonFunctionVoidAsync("xterm-addon-fit", "fit");
|
||||||
RunOnFirstRender.Invoke();
|
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)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -22,8 +22,7 @@
|
|||||||
@inject IpBanService IpBanService
|
@inject IpBanService IpBanService
|
||||||
@inject DynamicBackgroundService DynamicBackgroundService
|
@inject DynamicBackgroundService DynamicBackgroundService
|
||||||
|
|
||||||
<GlobalErrorBoundary>
|
@{
|
||||||
@{
|
|
||||||
var uri = new Uri(NavigationManager.Uri);
|
var uri = new Uri(NavigationManager.Uri);
|
||||||
var pathParts = uri.LocalPath.Split("/").Reverse();
|
var pathParts = uri.LocalPath.Split("/").Reverse();
|
||||||
|
|
||||||
@@ -39,9 +38,9 @@
|
|||||||
title += $"{pathPart.FirstCharToUpper()} - ";
|
title += $"{pathPart.FirstCharToUpper()} - ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
<CascadingValue Value="User">
|
<CascadingValue Value="User">
|
||||||
<PageTitle>@(string.IsNullOrEmpty(title) ? "Dashboard - " : title)Moonlight</PageTitle>
|
<PageTitle>@(string.IsNullOrEmpty(title) ? "Dashboard - " : title)Moonlight</PageTitle>
|
||||||
|
|
||||||
<div class="d-flex flex-column flex-root app-root" id="kt_app_root">
|
<div class="d-flex flex-column flex-root app-root" id="kt_app_root">
|
||||||
@@ -60,7 +59,6 @@
|
|||||||
<div id="kt_app_content" class="app-content flex-column-fluid" style="background-position: center; background-size: cover; background-repeat: no-repeat; background-attachment: fixed; background-image: url('@(DynamicBackgroundService.BackgroundImageUrl)')">
|
<div id="kt_app_content" class="app-content flex-column-fluid" style="background-position: center; background-size: cover; background-repeat: no-repeat; background-attachment: fixed; background-image: url('@(DynamicBackgroundService.BackgroundImageUrl)')">
|
||||||
<div id="kt_app_content_container" class="app-container container-fluid">
|
<div id="kt_app_content_container" class="app-container container-fluid">
|
||||||
<div class="mt-10">
|
<div class="mt-10">
|
||||||
<SoftErrorBoundary>
|
|
||||||
@if (!IsIpBanned)
|
@if (!IsIpBanned)
|
||||||
{
|
{
|
||||||
if (UserProcessed)
|
if (UserProcessed)
|
||||||
@@ -142,7 +140,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
</SoftErrorBoundary>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -152,8 +149,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</CascadingValue>
|
</CascadingValue>
|
||||||
</GlobalErrorBoundary>
|
|
||||||
|
|
||||||
@code
|
@code
|
||||||
{
|
{
|
||||||
@@ -190,14 +186,11 @@
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
DynamicBackgroundService.OnBackgroundImageChanged += async (_, _) =>
|
DynamicBackgroundService.OnBackgroundImageChanged += async (_, _) => { await InvokeAsync(StateHasChanged); };
|
||||||
{
|
|
||||||
await InvokeAsync(StateHasChanged);
|
|
||||||
};
|
|
||||||
|
|
||||||
IsIpBanned = await IpBanService.IsBanned();
|
IsIpBanned = await IpBanService.IsBanned();
|
||||||
|
|
||||||
if(IsIpBanned)
|
if (IsIpBanned)
|
||||||
await InvokeAsync(StateHasChanged);
|
await InvokeAsync(StateHasChanged);
|
||||||
|
|
||||||
await Event.On<Object>("ipBan.update", this, async _ =>
|
await Event.On<Object>("ipBan.update", this, async _ =>
|
||||||
|
|||||||
@@ -302,8 +302,8 @@
|
|||||||
console.log("Registering xterm addons");
|
console.log("Registering xterm addons");
|
||||||
|
|
||||||
window.XtermBlazor.registerAddon("xterm-addon-fit", new window.FitAddon.FitAddon());
|
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-search", new window.SearchAddon.SearchAddon());
|
||||||
window.XtermBlazor.registerAddon("xterm-addon-web-links", new window.WebLinksAddon.WebLinksAddon());
|
//window.XtermBlazor.registerAddon("xterm-addon-web-links", new window.WebLinksAddon.WebLinksAddon());
|
||||||
},
|
},
|
||||||
loadMonaco: function ()
|
loadMonaco: function ()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user