Registry: trend chart, always-pass indicator, subnet columns in the address list dialog
- Registry: "Динамика по запускам" chart (Chart.js 4.5.1, vendored) over finalized runs per target or site, % or count, subnet and calendar period filters; GET /admin/registry/trend - Registry: clickable "Всегда проходили" indicator with the address list and CSV; GET /admin/registry/always-pass and /always-pass/list - Address list dialog: "Подсеть" and "Метка подсети" columns from the administrator's subnet list (shared db.SubnetMatcher), per-subnet summary chips with a client-side filter; "прочие" renamed to "вне списка подсетей" - Rebuild control-api and admin-dashboard binaries; plans and summaries in docs/changes, README, API and USAGE updated Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c13139cd41
commit
1536723196
50 files changed
+3560
-154
No files matched your search
@@ -156,13 +156,13 @@ func TestCompareLists(t *testing.T) {
|
||||
|
||||
// New and left: the state in the run the address is in; numeric order.
|
||||
l := mustList(t, c, GroupNew, CompareFilter{})
|
||||
if want := []string{"Адрес", "Подсеть", "Вердикт", "Egress", "Ingress", "Индикаторы"}; !reflect.DeepEqual(l.Columns, want) {
|
||||
if want := []string{"Адрес", "Подсеть", "Метка подсети", "Вердикт", "Egress", "Ingress", "Индикаторы"}; !reflect.DeepEqual(l.Columns, want) {
|
||||
t.Errorf("new columns: %v", l.Columns)
|
||||
}
|
||||
if got := ips(l); !reflect.DeepEqual(got, []string{"10.0.0.11", "10.0.0.12", "10.0.0.13"}) {
|
||||
t.Errorf("new: %v", got)
|
||||
}
|
||||
if want := []string{"10.0.0.11", "10.0.0.0/24", "partial", "0 из 2", "2 из 2", "partial, Egress https: есть провалы, Egress https: все провалены"}; !reflect.DeepEqual(l.Rows[0], want) {
|
||||
if want := []string{"10.0.0.11", "10.0.0.0/24", "", "partial", "0 из 2", "2 из 2", "partial, Egress https: есть провалы, Egress https: все провалены"}; !reflect.DeepEqual(l.Rows[0], want) {
|
||||
t.Errorf("new row: %v", l.Rows[0])
|
||||
}
|
||||
if got := ips(mustList(t, c, GroupNew, CompareFilter{Indicator: ListVerdictPass})); !reflect.DeepEqual(got, []string{"10.0.0.12", "10.0.0.13"}) {
|
||||
@@ -175,7 +175,7 @@ func TestCompareLists(t *testing.T) {
|
||||
if got := ips(l); !reflect.DeepEqual(got, []string{"10.0.0.10", "10.0.0.14"}) {
|
||||
t.Errorf("left: %v", got)
|
||||
}
|
||||
if want := "fail"; l.Rows[0][2] != want || l.Rows[0][5] != "fail, Egress https: есть провалы, Egress https: все провалены, Ingress ssh: есть провалы, Ingress ssh: все провалены" {
|
||||
if want := "fail"; l.Rows[0][3] != want || l.Rows[0][6] != "fail, Egress https: есть провалы, Egress https: все провалены, Ingress ssh: есть провалы, Ingress ssh: все провалены" {
|
||||
t.Errorf("left row: %v", l.Rows[0])
|
||||
}
|
||||
if got := ips(mustList(t, c, GroupLeft, CompareFilter{Indicator: ListVerdictPass})); !reflect.DeepEqual(got, []string{"10.0.0.14"}) {
|
||||
@@ -187,14 +187,14 @@ func TestCompareLists(t *testing.T) {
|
||||
if got := ips(l); !reflect.DeepEqual(got, []string{"10.0.0.2", "10.0.0.3"}) {
|
||||
t.Fatalf("changed: %v", got)
|
||||
}
|
||||
if l.Columns[2] != "Вердикт (A → B)" || l.Columns[5] != "Что изменилось" {
|
||||
if l.Columns[3] != "Вердикт (A → B)" || l.Columns[6] != "Что изменилось" {
|
||||
t.Errorf("changed columns: %v", l.Columns)
|
||||
}
|
||||
if want := []string{"10.0.0.2", "10.0.0.0/24", "partial → pass", "0 из 2 → 2 из 2", "2 из 2 → 2 из 2",
|
||||
if want := []string{"10.0.0.2", "10.0.0.0/24", "", "partial → pass", "0 из 2 → 2 из 2", "2 из 2 → 2 из 2",
|
||||
"вердикт partial → pass; вышел из: Egress https: есть провалы, Egress https: все провалены; https: провалены цели −a.test −b.test; валидатор v2 → v5"}; !reflect.DeepEqual(l.Rows[0], want) {
|
||||
t.Errorf("changed row 1: %v", l.Rows[0])
|
||||
}
|
||||
if want := []string{"10.0.0.3", "10.0.0.0/24", "pass → partial", "2 из 2 → 2 из 2", "2 из 2 → 1 из 2",
|
||||
if want := []string{"10.0.0.3", "10.0.0.0/24", "", "pass → partial", "2 из 2 → 2 из 2", "2 из 2 → 1 из 2",
|
||||
"вердикт pass → partial; вошёл в: Ingress ssh: есть провалы; ssh: площадки +rxmsk"}; !reflect.DeepEqual(l.Rows[1], want) {
|
||||
t.Errorf("changed row 2: %v", l.Rows[1])
|
||||
}
|
||||
@@ -211,7 +211,7 @@ func TestCompareLists(t *testing.T) {
|
||||
if got := ips(l); !reflect.DeepEqual(got, []string{"10.0.0.1", "10.0.0.20"}) {
|
||||
t.Fatalf("same: %v", got)
|
||||
}
|
||||
if want := []string{"10.0.0.20", "10.0.0.0/24", "partial → partial", "1 из 2 → 1 из 2", "2 из 2 → 2 из 2", "без изменений"}; !reflect.DeepEqual(l.Rows[1], want) {
|
||||
if want := []string{"10.0.0.20", "10.0.0.0/24", "", "partial → partial", "1 из 2 → 1 из 2", "2 из 2 → 2 из 2", "без изменений"}; !reflect.DeepEqual(l.Rows[1], want) {
|
||||
t.Errorf("same row: %v", l.Rows[1])
|
||||
}
|
||||
if got := ips(mustList(t, c, GroupSame, CompareFilter{Indicator: ListEgressHTTPSAny})); !reflect.DeepEqual(got, []string{"10.0.0.20"}) {
|
||||
@@ -220,7 +220,7 @@ func TestCompareLists(t *testing.T) {
|
||||
|
||||
// Common is changed + same, in address order.
|
||||
l = mustList(t, c, GroupCommon, CompareFilter{})
|
||||
if got := ips(l); !reflect.DeepEqual(got, []string{"10.0.0.1", "10.0.0.2", "10.0.0.3", "10.0.0.20"}) || l.Rows[3][5] != "без изменений" {
|
||||
if got := ips(l); !reflect.DeepEqual(got, []string{"10.0.0.1", "10.0.0.2", "10.0.0.3", "10.0.0.20"}) || l.Rows[3][6] != "без изменений" {
|
||||
t.Errorf("common: %v", l.Rows)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user