fix(ui): сохранять устройство оптимизатора в адресе

This commit is contained in:
Denozordec committed 2026-09-30 23:34:05 +07:00
1 parent 2cdfa2cb13
commit c82434c435
5 files changed
+70 -19

No files matched your search

+1 -1
View File
@@ -19,7 +19,7 @@ test("optimizer refuses unknown types, duplicate inventory/WAN and invalid metri
import {buildLiveOptimizerData,DEFAULT_ROUTE_AI_OPTIMIZER_SETTINGS} from "./route-optimizer-data"
test("optimizer does not recommend an absent chain at a zero threshold",()=>{
const rows=[{...server,wanUplinks:[{id:"wan",name:"WAN",isp:"ISP",iface:"ether1",ip:"198.51.100.1",maxDl:100,maxUl:100}]}]
const rows=[{...server,type:"home-router" as const,site:"TEST",model:"CHR",wanUplinks:[{id:"wan",name:"WAN",isp:"ISP",iface:"ether1",ip:"198.51.100.1",maxDl:100,maxUl:100}]}]
const rules=optimizerRulesSchema.parse({rulesets:[{serverId:"1",rules:[{id:"r",community:"65001:1",communityName:"Service",gateway:"192.0.2.2",gatewayTunnelId:"",description:""}]}]}).rulesets
const result=buildLiveOptimizerData(rows,rules,{...DEFAULT_ROUTE_AI_OPTIMIZER_SETTINGS,switchThreshold:0})
const recommendation=result.homes[0].commRecs[0]