@namespace ZB.MOM.WW.OtOpcUa.AdminUI.Components.Shared
@using ZB.MOM.WW.OtOpcUa.AdminUI.ScriptAnalysis
@* The script editor's Problems list. Fed by MonacoEditor.MarkersChanged; clicking a row calls OnSelect, which the
host wires to MonacoEditor.RevealLineAsync so the caret jumps to the problem. Ordering and wording live in
ScriptProblems (unit-tested). *@
@{
var report = Report ?? ScriptProblemReport.Empty;
var ordered = ScriptProblems.Order(report.Markers);
}
Problems
@ScriptProblems.Summary(report with { Markers = ordered })
@if (ordered.Count > 0)
{
@foreach (var m in ordered.Take(MaxRows))
{
- OnSelect.InvokeAsync(m)"
@onkeydown="e => OnKeyAsync(e, m)">
@ScriptProblems.SeverityLabel(m.Severity)
@m.StartLineNumber:@m.StartColumn
@m.Message
@m.Code
}
@if (report.Total > Math.Min(ordered.Count, MaxRows))
{
@* The editor reports at most ScriptEditorLimits.MaxReportedMarkers problems (one circuit message); the
rest are still squiggled in the editor. *@
+@(report.Total - Math.Min(ordered.Count, MaxRows)) more — fix the problems above, or scroll the editor to see them all.
}
}
@code {
private const int MaxRows = ScriptEditorLimits.MaxReportedMarkers;
///