cleanup
This commit is contained in:
@@ -2,7 +2,6 @@
|
|||||||
@using XtermBlazor
|
@using XtermBlazor
|
||||||
|
|
||||||
@inject BuildService BuildService
|
@inject BuildService BuildService
|
||||||
@inject IJSRuntime JsRuntime
|
|
||||||
|
|
||||||
@implements IDisposable
|
@implements IDisposable
|
||||||
|
|
||||||
@@ -11,12 +10,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
private List<string> _outputLines = [];
|
|
||||||
private ElementReference _logContainer;
|
|
||||||
|
|
||||||
private Xterm _terminalRef;
|
private Xterm _terminalRef;
|
||||||
|
|
||||||
private TerminalOptions _options = new TerminalOptions
|
private readonly TerminalOptions _options = new TerminalOptions
|
||||||
{
|
{
|
||||||
CursorBlink = true,
|
CursorBlink = true,
|
||||||
CursorStyle = CursorStyle.Bar,
|
CursorStyle = CursorStyle.Bar,
|
||||||
@@ -53,18 +49,9 @@
|
|||||||
|
|
||||||
private async Task ClearPreviousOutput()
|
private async Task ClearPreviousOutput()
|
||||||
{
|
{
|
||||||
_outputLines.Clear();
|
|
||||||
await _terminalRef.Clear();
|
await _terminalRef.Clear();
|
||||||
await InvokeAsync(StateHasChanged);
|
await InvokeAsync(StateHasChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task ScrollToBottomAsync()
|
public void Dispose() => BuildService.BuildStarted -= ClearPreviousOutput;
|
||||||
{
|
|
||||||
await JsRuntime.InvokeVoidAsync("scrollToBottom", _logContainer);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Dispose()
|
|
||||||
{
|
|
||||||
BuildService.BuildStarted -= ClearPreviousOutput;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user