Compare views rebuilt: from the zone's view, in sections, one line per record

The Compare views tab and jarl zone diff compare a zone with the same zone in other views from the view you're on: a summary per view, what is answered differently (Use this everywhere), the names only some views have (Add to VIEW), and how many are the same. One name can be compared (jarl zone diff ZONE NAME [TYPE], a Compare button per record). The CLI prints one line per record, cut to the terminal (--wide shows it whole); the web UI cuts long values with the whole one on hover. GET /zones/{zone}/compare returns these sections, with ?with, ?name and ?type.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
adamandClaude Opus 5.5 committed 2026-10-13 10:55:57 +01:00
1 parent ec16de875d
commit b1719ce362
12 files changed
+656 -146

No files matched your search

+48 -14
View File
@@ -209,20 +209,6 @@ each view (Jarl lists them). Share the right version afterwards. Unlinking
keeps every record, all local; a link left with one zone is dissolved, as
when the other zone is deleted.
**Comparing the views.** The zone's **Compare views** tab, or `jarl zone
diff adbraun.lol`, lines the views up and shows each name and type that
differs: a view's own records, or a name one view lacks. **Use this
version** (`jarl record update ID --shared`) makes one view's version
every view's. It works for zones that aren't linked too, to see what
linking them would keep local.
```
$ jarl zone diff adbraun.lol
NAME TYPE INTERNAL EXTERNAL
nas A 10.0.10.20 [local, id 812] 203.0.113.20 [local, id 790]
5 names and types differ, 21 are the same; linked
```
`--local` also works on a zone that isn't linked (its records are local
anyway), so scripts don't need to know; `--shared` there is refused.
@@ -246,6 +232,54 @@ as it is: linked zones can differ per view, keep their own options, and
don't depend on the view order (`in-view` can only use a view defined
before it).
## Comparing views
A zone's **Compare views** tab, or `jarl zone diff`, compares it with the
same zone in another view (or all of them), from the view you're on:
```
$ jarl zone diff adbraun.lol --view internal
adbraun.lol in internal, compared with external
linked: a difference is a view's own records, there on purpose
external: 1 answered differently, 24 only in internal, 2 only in external, 31 the same
ANSWERED DIFFERENTLY (1)
nas A
internal 10.0.10.20 [local, id 812]
external 203.0.113.20 [local, id 790]
ONLY IN INTERNAL (24)
printer A 10.0.10.30
router A 10.0.10.1
...
ONLY IN EXTERNAL (2)
_acme-challenge TXT "…"
...
31 names and types are the same (--all lists them)
```
* **Answered differently**: names and types more than one view has, with
different records. In linked zones that is a view's own (local)
records, there on purpose; between zones that aren't linked, it is a
difference that crept in. **Use this everywhere** gives every view one
view's records (in linked zones by sharing them: `jarl record update ID
--shared`).
* **Only in …**: names and types some views lack. **Add to external**
gives that view the same records, its own.
* **The same**: how many; `--all` (or "List them") shows them.
One line per record: the CLI cuts long values to fit the terminal
(`--wide` shows them whole); the web UI shows the whole value on hover.
The apex NS records are left out, since views often list their name
servers differently on purpose.
**One name.** `jarl zone diff adbraun.lol nas` (and a type: `... @ TXT`)
shows just that name in every view, the same records included. In the
web UI, a record's **Compare** button does the same. `--with external`
(repeat it) picks the views to compare with.
## Living with views
* Commands that name a zone that exists in several views need `--view`