34 lines
2.7 KiB
Plaintext
34 lines
2.7 KiB
Plaintext
@model string
|
|
@{ ViewData["Title"] = "Problem Solver graph"; }
|
|
<h1>Problem Solver graph</h1>
|
|
<p>Immutable graph versions. Inspect nodes, choices, conditional connections, weights, diagnoses and feature mappings below. Validation reports reachability, dead ends, invalid references and unpermitted cycles. Publication preserves earlier snapshots.</p>
|
|
@if (ViewData["Report"] is IEnumerable<string> report) { <ul role="status">@foreach(var line in report) { <li>@line</li> }</ul> }
|
|
@if(ViewData["Graph"] is PlotLine.Models.WritingSolver.SolverGraph graph)
|
|
{
|
|
<h2>Graph at a glance</h2>
|
|
<p>Version @graph.Version · @graph.ChangeNote</p>
|
|
<div class="table-responsive"><table class="table"><thead><tr><th>Node</th><th>Question / active</th><th>Connections and conditions</th><th>Choice signals</th></tr></thead><tbody>
|
|
@foreach(var node in graph.Nodes.OrderBy(n=>n.Order))
|
|
{
|
|
<tr><td>@node.Id (@node.Type)</td><td>@node.Title<br />Active: @node.Active · Multiple: @node.Multiple · Neutral ending: @node.NeutralEndpoint</td>
|
|
<td>@foreach(var route in node.Routes) { <p>→ @route.Target<br />Choice: @(route.Choice ?? "any") · Signal: @(route.Signal ?? "any") ≥ @route.Minimum · Priority: @route.Priority · Cycle allowed: @route.AllowCycle</p> }</td>
|
|
<td>@foreach(var choice in node.Choices.OrderBy(c=>c.Order)) { <p><strong>@choice.Id</strong>: @choice.Text<br />Active: @choice.Active · Fallback: @choice.Fallback<br />@string.Join(", ",choice.Weights.Select(w=>$"{w.Key}: {w.Value}"))</p> }</td></tr>
|
|
}
|
|
</tbody></table></div>
|
|
<h2>Diagnoses and capabilities</h2>
|
|
<div class="table-responsive"><table class="table"><thead><tr><th>Diagnosis / active</th><th>Signals / threshold</th><th>Feature mappings</th></tr></thead><tbody>
|
|
@foreach(var solution in graph.Solutions)
|
|
{
|
|
<tr><td><a href="/problem-solver/@solution.Slug">@solution.PageTitle</a><br />@solution.Id · Active: @solution.Active · Index: @solution.Index</td><td>@string.Join(", ",solution.Signals.Select(w=>$"{w.Key}: {w.Value}"))<br />Threshold: @solution.Threshold</td>
|
|
<td>@foreach(var link in solution.Features) { <p>@link.Feature (@(link.Primary ? "primary" : "supporting"))<br />@link.Reason</p> }</td></tr>
|
|
}
|
|
</tbody></table></div>
|
|
}
|
|
<form method="post" action="/admin/writing-solver">
|
|
@Html.AntiForgeryToken()
|
|
<label for="graph-json">Graph JSON (schema v1)</label>
|
|
<textarea id="graph-json" name="json" rows="30" class="form-control" spellcheck="false" style="font-family:monospace">@Model</textarea>
|
|
<button name="operation" value="validate" class="btn btn-secondary mt-3">Validate without saving</button>
|
|
<button name="operation" value="publish" class="btn btn-primary mt-3">Validate & publish new version</button>
|
|
</form>
|