Files
nixos-router/pkgs/router-webui/templates/changes.html
T
nilsandClaude Sonnet 5.5 eb11fc30b3 Name the element a change is in and let the diff show the lines around it
Each group of changes gets a bar with its place in the settings (like
router.firewall.rules[3], and the rule's zones) and buttons to show more
lines above and below, or all that are hidden.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-18 19:56:54 +01:00

19 lines
1.6 KiB
HTML

{{define "content"}}
{{with .Data}}
{{if .Rows}}
<p>The saved settings differ from the confirmed (running) ones: red lines go away, green lines are new.
Nothing is applied until you press Apply.</p>
{{with .TokenEdit}}<p class="error">{{.}}</p>{{end}}
<div class="diff" role="table" aria-label="Changes">
{{range .Rows}}{{if eq .Class "gap"}}<div class="drow gap" role="row" data-n="{{.N}}"><span class="more">{{if .Down}}<button type="button" class="link" data-more="down" title="Show 10 more lines below the change above">↓</button>{{end}}{{if .Up}}<button type="button" class="link" data-more="up" title="Show 10 more lines above the next change">↑</button>{{end}}{{if .N}}<button type="button" class="link" data-more="all" title="Show every line that is hidden here">Show {{.N}} lines</button>{{end}}</span>{{if .Path}}<span class="path">{{.Path}}{{with .Label}} <span class="muted">{{.}}</span>{{end}}</span>{{end}}</div>{{else}}<div class="drow {{.Class}}{{if .Hidden}} hid{{end}}" role="row"><span class="ln" role="cell">{{if .Old}}{{.Old}}{{end}}</span><span class="ln" role="cell">{{if .New}}{{.New}}{{end}}</span><span class="mk" role="cell">{{.Mark}}</span><code role="cell">{{.Text}}</code></div>{{end}}{{end}}
</div>
<div class="actions">
<form method="post" action="/apply"><input type="hidden" name="csrf" value="{{$.CSRF}}"><button>Apply</button></form>
<form method="post" action="/discard"><input type="hidden" name="csrf" value="{{$.CSRF}}"><button class="secondary">Discard changes</button></form>
</div>
{{else}}
<p>No changes: the saved settings are the confirmed ones.</p>
{{end}}
{{end}}
{{end}}