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
@@ -0,0 +1,27 @@
|
||||
package db
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestSubnetMatcher(t *testing.T) {
|
||||
nested := []Subnet{{CIDR: "10.0.0.0/8", Label: "wide"}, {CIDR: "10.1.0.0/16", Label: "narrow"}, {CIDR: "2001:db8::/32"}}
|
||||
for _, c := range []struct {
|
||||
name string
|
||||
list []Subnet
|
||||
ip string
|
||||
cidr string
|
||||
label string
|
||||
}{
|
||||
{"most specific", nested, "10.1.2.3", "10.1.0.0/16", "narrow"},
|
||||
{"outer only", nested, "10.2.0.1", "10.0.0.0/8", "wide"},
|
||||
{"outside", nested, "192.0.2.1", SubnetOutside, ""},
|
||||
{"garbage", nested, "garbage", SubnetOutside, ""},
|
||||
{"ipv6 in list", nested, "2001:db8::1", "2001:db8::/32", ""},
|
||||
{"empty list v4", nil, "203.0.113.77", "203.0.113.0/24", ""},
|
||||
{"empty list v6", nil, "2001:db8:1:2:3::1", "2001:db8:1:2::/64", ""},
|
||||
} {
|
||||
cidr, label := NewSubnetMatcher(c.list).Lookup(c.ip)
|
||||
if cidr != c.cidr || label != c.label {
|
||||
t.Errorf("%s: got %q/%q, want %q/%q", c.name, cidr, label, c.cidr, c.label)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user