fix: 捕获解析YAML时发生的错误
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
<div class="control-zone">
|
||||
<Space Size="@("0")">
|
||||
<SpaceItem>
|
||||
<Button Type="@ButtonType.Text">
|
||||
<Button Type="@ButtonType.Text" OnClick="@QuitButtontClicked">
|
||||
退出
|
||||
</Button>
|
||||
</SpaceItem>
|
||||
@@ -28,7 +28,9 @@
|
||||
|
||||
<div class="logging-zone">
|
||||
<AntList TItem="@string" DataSource="@_logs" Split="@false" @ref="@_logList">
|
||||
<p style="margin-bottom: 0">@context</p>
|
||||
<ListItem class="logging-item">
|
||||
<p>@context</p>
|
||||
</ListItem>
|
||||
</AntList>
|
||||
</div>
|
||||
</div>
|
||||
@@ -60,7 +62,7 @@
|
||||
Log("未设置文法");
|
||||
grammarText = string.Empty;
|
||||
}
|
||||
|
||||
|
||||
return new StandaloneEditorConstructionOptions
|
||||
{
|
||||
Language = "yaml",
|
||||
@@ -84,10 +86,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
private void QuitButtontClicked()
|
||||
{
|
||||
Navigation.NavigateTo("/", replace: true);
|
||||
}
|
||||
|
||||
private void Log(string message)
|
||||
{
|
||||
_logs.Add($"{DateTime.Now:HH:mm:ss} {message}");
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@@ -10,4 +10,9 @@
|
||||
.logging-zone {
|
||||
height: 15%;
|
||||
overflow-y: auto;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.logging-item {
|
||||
padding: 0 0 0;
|
||||
}
|
@@ -11,6 +11,7 @@
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": false,
|
||||
"applicationUrl": "http://localhost:5163",
|
||||
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
|
Reference in New Issue
Block a user