platform: modularize api/gui, add docs-tests-web foundation, and refresh root config

This commit is contained in:
beckline
2026-03-26 22:40:54 +03:00
parent 0e2d7f61ea
commit 6a56d734c2
562 changed files with 70151 additions and 16423 deletions

View File

@@ -0,0 +1,35 @@
package app
func transportAppendDNSRule(rawDNS map[string]any, rule map[string]any) {
if rawDNS == nil || len(rule) == 0 {
return
}
rawRules, _ := rawDNS["rules"].([]any)
for _, it := range rawRules {
existing, ok := it.(map[string]any)
if !ok || existing == nil {
continue
}
if mapsEqual(existing, rule) {
return
}
}
rawRules = append(rawRules, rule)
rawDNS["rules"] = rawRules
}
func mapsEqual(a, b map[string]any) bool {
if len(a) != len(b) {
return false
}
for k, av := range a {
bv, ok := b[k]
if !ok {
return false
}
if asString(av) != asString(bv) {
return false
}
}
return true
}