Check, preview and apply look at the repository's release tags and the channel together; the new nixos-router is a highlighted row in the preview table. The update server section and the separate git update are gone; bundles stay. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
165 lines
8.6 KiB
HTML
165 lines
8.6 KiB
HTML
{{define "content"}}
|
|
<div class="cols">
|
|
{{$u := .Data.Update}}{{$g := .Data.Upgrade}}
|
|
|
|
{{if $u.Status.Running}}
|
|
<div class="upload-overlay" role="dialog" aria-modal="true">
|
|
<div class="upload-card wide">
|
|
<h2>Updating…</h2>
|
|
<progress max="100" value="{{$u.Progress}}"></progress>
|
|
<p>{{$u.Step}}</p>
|
|
{{if $u.Status.Log}}<pre class="log">{{$u.Status.Log}}</pre>{{end}}
|
|
<p class="muted">This takes a few minutes. The page reloads when it is done; the web UI restarts when the new
|
|
version is switched on, and you log in again.</p>
|
|
</div>
|
|
</div>
|
|
{{else if $g.Run.Running}}
|
|
<div class="upload-overlay" role="dialog" aria-modal="true">
|
|
<div class="upload-card wide">
|
|
<h2>{{$g.Title}}</h2>
|
|
<progress max="100"></progress>
|
|
{{if $g.Run.Log}}<pre class="log">{{$g.Run.Log}}</pre>{{end}}
|
|
<p class="muted">The page reloads when it is done. The web UI restarts when an upgrade is switched on, and you log in again.</p>
|
|
</div>
|
|
</div>
|
|
{{else if $u.Pending}}
|
|
<section class="pending"><h2>Waiting for confirmation</h2>
|
|
<p>A new system is active and not confirmed yet. Confirm it on the <a href="/">Overview</a>, or the router goes back to the
|
|
previous one.</p></section>
|
|
{{end}}
|
|
|
|
{{with $g.NewerRelease}}
|
|
<section class="notice">
|
|
<h2>NixOS {{.}} is out</h2>
|
|
<p>You follow {{$g.Channel}}. {{.}} is the newer stable release: switch the channel to it, then look for upgrades and
|
|
preview what would change. Nothing is installed until you upgrade, and NixOS cannot go back to the older release afterwards.</p>
|
|
<form method="post" action="/upgrade/channel" class="actions">
|
|
<input type="hidden" name="csrf" value="{{$.CSRF}}">
|
|
<input type="hidden" name="channel" value="{{.}}">
|
|
<button class="secondary">Follow {{.}}</button>
|
|
</form>
|
|
</section>
|
|
{{end}}
|
|
|
|
<section id="packages">
|
|
<h2>Installed</h2>
|
|
<dl>
|
|
<dt>nixos-router</dt><dd>{{or $g.Router.Version "unknown"}}{{if $g.Router.Rev}} <span class="muted">{{printf "%.7s" $g.Router.Rev}}</span>{{end}}</dd>
|
|
<dt>Settings schema</dt><dd>{{$g.Router.Schema}}</dd>
|
|
<dt>NixOS</dt><dd>{{or $g.Version "unknown"}}</dd>
|
|
</dl>
|
|
<p>An upgrade brings the newest nixos-router{{if $g.Repository}} (from <code>{{$g.Repository}}</code>){{end}} and the packages
|
|
(the kernel and all programs) of the channel you follow. Nothing is downloaded until you ask for it, and an upgrade is
|
|
activated like a settings change: unless you confirm it in time, the router goes back to the previous system.</p>
|
|
<form method="post" action="/upgrade/channel" class="actions">
|
|
<input type="hidden" name="csrf" value="{{.CSRF}}">
|
|
<label>Follow
|
|
<select name="channel">
|
|
{{range $g.Choices}}<option value="{{.Value}}"{{if eq .Value $g.Channel}} selected{{end}}>{{.Label}}</option>{{end}}
|
|
</select>
|
|
</label>
|
|
<button class="secondary">Save</button>
|
|
</form>
|
|
{{if $g.ReleasesSeen}}<p class="hint">Stable releases as the channel server listed them on {{$g.ReleasesSeen}}; Check for upgrades asks again.</p>{{end}}
|
|
<p class="hint">The channel only chooses which packages an upgrade offers; saving it changes nothing on the router. Going back to an older release
|
|
(unstable to 26.05) is refused unless you tick "downgrade anyway" when previewing; state written by the newer
|
|
release may not work with the older one.</p>
|
|
</section>
|
|
|
|
{{if or $g.Channel $g.Repository}}
|
|
<section>
|
|
<h2>Check</h2>
|
|
<form method="post" action="/upgrade/check" class="actions">
|
|
<input type="hidden" name="csrf" value="{{.CSRF}}">
|
|
<button class="secondary"{{if or $g.Run.Running $g.Updating}} disabled{{end}}>Check for upgrades</button>
|
|
</form>
|
|
{{with $g.Check}}
|
|
<dl>
|
|
{{with .Router}}<dt>nixos-router</dt><dd>{{.Installed}}{{if .Newer}} → <strong>{{.Newest.Version}}</strong>{{else}} <span class="muted">(the newest)</span>{{end}}</dd>{{end}}
|
|
{{if .Channel}}<dt>Packages</dt><dd>{{.Channel}}: {{printf "%.7s" .Newest.Rev}}{{if .PackagesUpToDate}} <span class="muted">(what runs)</span>{{else}} <strong>newer than the running {{printf "%.7s" .Running.Rev}}</strong>{{end}}</dd>{{end}}
|
|
<dt>Checked</dt><dd>{{.Time}}</dd>
|
|
</dl>
|
|
{{if .UpToDate}}<p>Up to date.</p>{{else}}<p>A newer version is available.</p>{{end}}
|
|
{{end}}
|
|
</section>
|
|
|
|
<section>
|
|
<h2>What would change</h2>
|
|
<form method="post" action="/upgrade/preview" class="actions">
|
|
<input type="hidden" name="csrf" value="{{.CSRF}}">
|
|
{{if and $g.Check $g.Check.UpToDate}}<label><input type="checkbox" name="force"> look anyway</label>{{end}}
|
|
<label><input type="checkbox" name="downgrade"> downgrade anyway</label>
|
|
<button class="secondary"{{if or $g.Run.Running $g.Updating}} disabled{{end}}>Preview</button>
|
|
</form>
|
|
<p class="hint">Works it out from the new versions' descriptions: no package is downloaded.</p>
|
|
{{with $g.Preview}}
|
|
<p>{{$g.Version}} → <strong>{{.Version}}</strong> <span class="muted">{{if .Rev}}{{printf "%.7s" .Rev}}, {{end}}previewed {{.Time}}</span></p>
|
|
{{if or .Router .Changes}}
|
|
<table>
|
|
<thead><tr><th>Package</th><th>Now</th><th></th><th>New</th></tr></thead>
|
|
<tbody>
|
|
{{with .Router}}<tr class="highlight" title="This upgrade also installs a new version of nixos-router itself, and migrates the settings to it if it needs that."><td>nixos-router</td><td>{{.From}}</td><td>→</td><td>{{.To}}</td></tr>{{end}}
|
|
{{range .Changes}}<tr><td>{{.Name}}</td><td>{{.From}}</td><td>→</td><td>{{.To}}</td></tr>{{end}}
|
|
</tbody>
|
|
</table>
|
|
{{else}}<p>No package changes.</p>{{end}}
|
|
{{if .Router}}<p class="hint">The highlighted row is the router software itself: this upgrade installs it too.</p>{{end}}
|
|
<p class="hint">The list shows the versions of programs the router runs; a program that is only rebuilt does not appear.</p>
|
|
<dl>
|
|
<dt>To download</dt><dd>{{or .Download "nothing, or the package cache cannot be reached"}}</dd>
|
|
<dt>Built here</dt><dd>{{.Builds}} derivation{{if ne .Builds 1}}s{{end}}{{if gt .Builds 50}} <span class="muted">(many: the package cache may not have them yet; this takes long)</span>{{end}}</dd>
|
|
{{if .RebootNeeded}}<dt>Kernel</dt><dd>A new kernel: it runs after the next reboot.</dd>{{end}}
|
|
</dl>
|
|
{{if .BuildNames}}
|
|
<details>
|
|
<summary>What is built here</summary>
|
|
<p class="hint">The system's own pieces (they carry the nixpkgs revision) and programs the package cache does not have yet.</p>
|
|
<ul>{{range .BuildNames}}<li>{{.}}</li>{{end}}</ul>
|
|
{{if .MoreBuilds}}<p class="muted">… and {{.MoreBuilds}} more</p>{{end}}
|
|
</details>
|
|
{{end}}
|
|
<div class="actions">
|
|
<form method="post" action="/upgrade/download">
|
|
<input type="hidden" name="csrf" value="{{$.CSRF}}">
|
|
<button class="secondary"{{if or $g.Run.Running $g.Updating $g.Pending}} disabled{{end}}>Download now</button>
|
|
</form>
|
|
<form method="post" action="/upgrade/apply">
|
|
<input type="hidden" name="csrf" value="{{$.CSRF}}">
|
|
<button{{if or $g.Run.Running $g.Updating $g.Pending}} disabled{{end}}>Upgrade{{with .Router}} nixos-router to {{.To}} and{{end}} to {{.Version}}</button>
|
|
</form>
|
|
</div>
|
|
<p class="hint">Downloading first lets you start the upgrade later without needing the internet. Upgrading
|
|
downloads what is missing, builds the system and switches to it; confirm it on the Overview.</p>
|
|
{{end}}
|
|
</section>
|
|
{{else}}
|
|
<section><p>Choose a channel to look for upgrades.</p></section>
|
|
{{end}}
|
|
|
|
<section>
|
|
<h2>Install a bundle</h2>
|
|
<p>For a router without a route to the repository, or when it is down: a <code>.bundle</code> file made with
|
|
<code>nix run .#release</code>. It is installed only if it is signed with this router's update key. The settings are kept
|
|
(and migrated if the new version needs it); the new version must be confirmed afterwards, or the router goes back.</p>
|
|
<form method="post" action="/update/upload?csrf={{.CSRF}}" enctype="multipart/form-data" data-upload>
|
|
<p><label><input type="checkbox" name="force"> also install a version that is not newer</label></p>
|
|
<p><input type="file" name="bundle" required> <button>Upload and install</button></p>
|
|
</form>
|
|
</section>
|
|
|
|
{{if and $u.Status.Log (not $u.Status.Running)}}
|
|
<section>
|
|
<h2>Last bundle update{{if $u.Status.Result}} — {{if eq $u.Status.Result "success"}}succeeded{{else}}failed ({{$u.Status.Result}}){{end}}{{end}}</h2>
|
|
<pre class="log">{{$u.Status.Log}}</pre>
|
|
</section>
|
|
{{end}}
|
|
|
|
{{if and $g.Run.Log (not $g.Run.Running)}}
|
|
<section>
|
|
<h2>Last upgrade run{{if $g.Run.Result}} — {{if eq $g.Run.Result "success"}}succeeded{{else}}failed ({{$g.Run.Result}}){{end}}{{end}}</h2>
|
|
<pre class="log">{{$g.Run.Log}}</pre>
|
|
</section>
|
|
{{end}}
|
|
</div>
|
|
{{end}}
|