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,138 +22,134 @@
|
|||||||
@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();
|
|
||||||
|
|
||||||
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()} ";
|
||||||
if (pathPart == pathParts.Last())
|
else
|
||||||
title += $"{pathPart.FirstCharToUpper()} ";
|
title += $"{pathPart.FirstCharToUpper()} - ";
|
||||||
else
|
|
||||||
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">
|
||||||
<div class="app-page flex-column flex-column-fluid" id="kt_app_page">
|
<div class="app-page flex-column flex-column-fluid" id="kt_app_page">
|
||||||
<canvas id="snow" class="snow-canvas"></canvas>
|
<canvas id="snow" class="snow-canvas"></canvas>
|
||||||
|
|
||||||
@{
|
@{
|
||||||
//TODO: Add a way to disable the snow
|
//TODO: Add a way to disable the snow
|
||||||
}
|
}
|
||||||
|
|
||||||
<PageHeader></PageHeader>
|
<PageHeader></PageHeader>
|
||||||
<div class="app-wrapper flex-column flex-row-fluid" id="kt_app_wrapper">
|
<div class="app-wrapper flex-column flex-row-fluid" id="kt_app_wrapper">
|
||||||
<Sidebar></Sidebar>
|
<Sidebar></Sidebar>
|
||||||
<div class="app-main flex-column flex-row-fluid" id="kt_app_main">
|
<div class="app-main flex-column flex-row-fluid" id="kt_app_main">
|
||||||
<div class="d-flex flex-column flex-column-fluid">
|
<div class="d-flex flex-column flex-column-fluid">
|
||||||
<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 (uri.LocalPath != "/login" &&
|
||||||
|
uri.LocalPath != "/passwordreset" &&
|
||||||
|
uri.LocalPath != "/register")
|
||||||
{
|
{
|
||||||
if (UserProcessed)
|
if (User == null)
|
||||||
{
|
{
|
||||||
if (uri.LocalPath != "/login" &&
|
<Login></Login>
|
||||||
uri.LocalPath != "/passwordreset" &&
|
|
||||||
uri.LocalPath != "/register")
|
|
||||||
{
|
|
||||||
if (User == null)
|
|
||||||
{
|
|
||||||
<Login></Login>
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (User.Status == UserStatus.Banned)
|
|
||||||
{
|
|
||||||
<BannedAlert></BannedAlert>
|
|
||||||
}
|
|
||||||
else if (User.Status == UserStatus.Disabled)
|
|
||||||
{
|
|
||||||
<DisabledAlert></DisabledAlert>
|
|
||||||
}
|
|
||||||
else if (User.Status == UserStatus.PasswordPending)
|
|
||||||
{
|
|
||||||
<PasswordChangeView></PasswordChangeView>
|
|
||||||
}
|
|
||||||
else if (User.Status == UserStatus.DataPending)
|
|
||||||
{
|
|
||||||
<UserDataSetView></UserDataSetView>
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
@Body
|
|
||||||
|
|
||||||
<RatingPopup/>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (uri.LocalPath == "/login")
|
|
||||||
{
|
|
||||||
<Login></Login>
|
|
||||||
}
|
|
||||||
else if (uri.LocalPath == "/register")
|
|
||||||
{
|
|
||||||
<Register></Register>
|
|
||||||
}
|
|
||||||
else if (uri.LocalPath == "/passwordreset")
|
|
||||||
{
|
|
||||||
<PasswordReset></PasswordReset>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<div class="modal d-block">
|
if (User.Status == UserStatus.Banned)
|
||||||
<div class="modal-dialog modal-dialog-centered mw-900px">
|
{
|
||||||
<div class="modal-content">
|
<BannedAlert></BannedAlert>
|
||||||
<div class="pt-2 modal-body py-lg-10 px-lg-10">
|
}
|
||||||
<h2>@(SmartTranslateService.Translate("Authenticating"))...</h2>
|
else if (User.Status == UserStatus.Disabled)
|
||||||
<p class="mt-3 fw-normal fs-6">@(SmartTranslateService.Translate("Verifying token, loading user data"))</p>
|
{
|
||||||
</div>
|
<DisabledAlert></DisabledAlert>
|
||||||
</div>
|
}
|
||||||
</div>
|
else if (User.Status == UserStatus.PasswordPending)
|
||||||
</div>
|
{
|
||||||
|
<PasswordChangeView></PasswordChangeView>
|
||||||
|
}
|
||||||
|
else if (User.Status == UserStatus.DataPending)
|
||||||
|
{
|
||||||
|
<UserDataSetView></UserDataSetView>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
@Body
|
||||||
|
|
||||||
|
<RatingPopup/>
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<div class="modal d-block">
|
if (uri.LocalPath == "/login")
|
||||||
<div class="modal-dialog modal-dialog-centered mw-900px">
|
{
|
||||||
<div class="modal-content">
|
<Login></Login>
|
||||||
<div class="pt-2 modal-body py-lg-10 px-lg-10">
|
}
|
||||||
<h2>@(SmartTranslateService.Translate("Your ip has been banned"))</h2>
|
else if (uri.LocalPath == "/register")
|
||||||
<p class="mt-3 fw-normal fs-6">@(SmartTranslateService.Translate("Your ip address has been banned by an admin"))</p>
|
{
|
||||||
</div>
|
<Register></Register>
|
||||||
|
}
|
||||||
|
else if (uri.LocalPath == "/passwordreset")
|
||||||
|
{
|
||||||
|
<PasswordReset></PasswordReset>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<div class="modal d-block">
|
||||||
|
<div class="modal-dialog modal-dialog-centered mw-900px">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="pt-2 modal-body py-lg-10 px-lg-10">
|
||||||
|
<h2>@(SmartTranslateService.Translate("Authenticating"))...</h2>
|
||||||
|
<p class="mt-3 fw-normal fs-6">@(SmartTranslateService.Translate("Verifying token, loading user data"))</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
</div>
|
||||||
</SoftErrorBoundary>
|
}
|
||||||
</div>
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<div class="modal d-block">
|
||||||
|
<div class="modal-dialog modal-dialog-centered mw-900px">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="pt-2 modal-body py-lg-10 px-lg-10">
|
||||||
|
<h2>@(SmartTranslateService.Translate("Your ip has been banned"))</h2>
|
||||||
|
<p class="mt-3 fw-normal fs-6">@(SmartTranslateService.Translate("Your ip address has been banned by an admin"))</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Footer></Footer>
|
|
||||||
</div>
|
</div>
|
||||||
|
<Footer></Footer>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</CascadingValue>
|
</div>
|
||||||
</GlobalErrorBoundary>
|
</CascadingValue>
|
||||||
|
|
||||||
@code
|
@code
|
||||||
{
|
{
|
||||||
@@ -190,16 +186,13 @@
|
|||||||
{
|
{
|
||||||
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 _ =>
|
||||||
{
|
{
|
||||||
IsIpBanned = await IpBanService.IsBanned();
|
IsIpBanned = await IpBanService.IsBanned();
|
||||||
|
|||||||
@@ -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