fix OtherOptions not merge

This commit is contained in:
Yuzuki616
2025-01-18 02:13:32 +09:00
parent 68519193ec
commit acaeddf26a

View File

@@ -4,6 +4,7 @@ import (
"fmt" "fmt"
"github.com/InazumaV/Ratte-Interface/core" "github.com/InazumaV/Ratte-Interface/core"
"github.com/InazumaV/Ratte-Interface/panel" "github.com/InazumaV/Ratte-Interface/panel"
"github.com/InazumaV/Ratte/common/maps"
) )
func (h *Handler) PullNodeHandle(n *panel.NodeInfo) error { func (h *Handler) PullNodeHandle(n *panel.NodeInfo) error {
@@ -40,8 +41,10 @@ func (h *Handler) PullNodeHandle(n *panel.NodeInfo) error {
if err != nil { if err != nil {
h.l.WithError(err).Error("Exec before add node hook failed") h.l.WithError(err).Error("Exec before add node hook failed")
} }
ni := (*core.NodeInfo)(n)
ni.OtherOptions = maps.Merge[string, any](ni.OtherOptions, h.Options.Expand)
err = h.c.AddNode(&core.AddNodeParams{ err = h.c.AddNode(&core.AddNodeParams{
NodeInfo: (*core.NodeInfo)(n), NodeInfo: ni,
TlsOptions: core.TlsOptions{ TlsOptions: core.TlsOptions{
CertPath: h.Cert.CertPath, CertPath: h.Cert.CertPath,
KeyPath: h.Cert.KeyPath, KeyPath: h.Cert.KeyPath,