feat: add dedicated Profile management page

This commit is contained in:
proxyctl coordinator
2026-07-17 22:37:25 +08:00
parent 7c0b4481d7
commit d34ce0cd6b
11 changed files with 583 additions and 160 deletions
+3 -11
View File
@@ -51,27 +51,19 @@ func TestMainAndProfilePagesMapKeysAndObscurePasswords(t *testing.T) {
model = updateKey(model, "p")
view := model.View()
if !strings.Contains(view, "Proxy Profiles") || !strings.Contains(view, "alice:") {
if !strings.Contains(view, "Proxy Profile management") || !strings.Contains(view, "alice:") {
t.Fatalf("Profile page did not render selected Profile:\n%s", view)
}
if strings.Contains(view, "very-secret") {
t.Fatalf("Profile page exposed proxy password:\n%s", view)
}
updated, command := model.Update(keyMessage("a"))
model = updated.(Model)
if command == nil || len(module.intents) != 1 || module.intents[0].Kind != app.ActivateProfile || module.intents[0].Name != "office" {
t.Fatalf("activate key dispatched %#v", module.intents)
}
updated, _ = model.Update(command())
model = updated.(Model)
model = updateKey(model, "p")
model = updateKey(model, "d")
if !strings.Contains(model.View(), "Delete Profile") {
if !strings.Contains(model.View(), "Delete Proxy Profile") {
t.Fatalf("delete key did not request confirmation:\n%s", model.View())
}
model = updateKey(model, "y")
if len(module.intents) != 2 || module.intents[1].Kind != app.DeleteProfile || !module.intents[1].Confirm {
if len(module.intents) != 1 || module.intents[0].Kind != app.DeleteProfile || !module.intents[0].Confirm {
t.Fatalf("confirmed delete dispatched %#v", module.intents)
}
}