mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-10 09:02:42 +08:00
fix: 解决防火墙范围端口添加时备注不生效的问题 (#2507)
This commit is contained in:
parent
7f12beab8f
commit
f9e22166c1
1 changed files with 7 additions and 2 deletions
|
@ -225,7 +225,10 @@ func (u *FirewallService) OperatePortRule(req dto.PortRuleOperate, reload bool)
|
|||
if err := u.operatePort(client, req); err != nil {
|
||||
global.LOG.Errorf("%s port %s/%s failed (strategy: %s, address: %s), err: %v", req.Operation, req.Port, req.Protocol, req.Strategy, req.Address, err)
|
||||
}
|
||||
_ = u.addPortRecord(req)
|
||||
req.Port = strings.ReplaceAll(req.Port, ":", "-")
|
||||
if err := u.addPortRecord(req); err != nil {
|
||||
global.LOG.Errorf("add record %s/%s failed (strategy: %s, address: %s), err: %v", req.Port, req.Protocol, req.Strategy, req.Address, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
@ -244,7 +247,9 @@ func (u *FirewallService) OperatePortRule(req dto.PortRuleOperate, reload bool)
|
|||
if len(req.Protocol) == 0 {
|
||||
req.Protocol = "tcp/udp"
|
||||
}
|
||||
_ = u.addPortRecord(req)
|
||||
if err := u.addPortRecord(req); err != nil {
|
||||
global.LOG.Errorf("add record %s/%s failed (strategy: %s, address: %s), err: %v", req.Port, req.Protocol, req.Strategy, req.Address, err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue