@page "/openbirch" @inject OpenBirchConsole console @inject IJSRuntime js
@for (int i = 0; i < console.history.Count; i++) { int temp = i; ConsoleLine line = console.history[temp]; @((line.source == ConsoleSource.User) ? ">" : "") @line.text @if (line.source == ConsoleSource.OpenBirch) {
} }
@code { public string inputField = ""; async void OnKeyDown(KeyboardEventArgs args) { if (args.Key == "Enter") { await Task.Delay(100); sendCommand(inputField); StateHasChanged(); } } private async void sendCommand(string command) { inputField = ""; await console.pushCommand(command); await InvokeAsync(StateHasChanged); } protected override async Task OnInitializedAsync() { } }