Add a standby control plane with server add, and draw the screens as windows

server add gives another machine this llmgw, a certificate, the
configuration and store address, lets it into the store through Patroni, and
starts it; --vip keeps a floating address on the leader with keepalived,
following a new /leader endpoint. Nodes learn every control plane from the
leader and notice a dead one by HTTP/2 ping instead of after the kernel's
fifteen minutes. The setup, console, node and init screens are drawn full
screen in one frame: title bar, sidebar, bordered panel, key bar, dialogs.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ilker ManapandClaude Opus 5.5 committed 2026-10-03 22:29:12 +02:00
1 parent f5c79052b1
commit aa3efcebbe
31 files changed
+1856 -394

No files matched your search

+21 -2
View File
@@ -43,8 +43,12 @@ func TestTheSetupAsksForWhatHighAvailabilityNeedsAndRefusesWhatWillNotDo(t *test
if s := m.(setupModel); s.page != pAdmin || !strings.Contains(s.formErr, "email") {
t.Fatalf("went on without an administrator: %+v", s.formErr)
}
// The refusal puts the cursor back on the email.
m = press(m, "a@example.com", "tab", "tab", "enter")
// The refusal is a dialog; a key closes it, and the cursor is back on
// the email.
if !strings.Contains(m.View(), "Not yet") {
t.Error("the refusal was not shown as a dialog")
}
m = press(m, "x", "a@example.com", "tab", "tab", "enter")
s := m.(setupModel)
if s.page != pMachines {
t.Fatalf("page %d: %s", s.page, s.formErr)
@@ -117,3 +121,18 @@ func TestTheConsoleOffersToReplicateOnlyAStoreThatIsNot(t *testing.T) {
}
_ = adminapi.Summary{}
}
func TestTheSetupIsDrawnAsWindows(t *testing.T) {
m := newSetupModel("ctl", []string{"10.0.0.5"})
m.width, m.height = 100, 30
v := m.View()
lines := strings.Split(v, "\n")
if len(lines) != 30 {
t.Errorf("%d lines for a 30-line terminal", len(lines))
}
for _, want := range []string{"llmgw setup", "Steps", "Start", "╭", "One machine", "Ctrl+C"} {
if !strings.Contains(v, want) {
t.Errorf("the screen lacks %q:\n%s", want, v)
}
}
}