@@ -87,6 +87,9 @@ func createNs(w http.ResponseWriter, r *http.Request) {
87
87
if req .Tags == nil {
88
88
req .Tags = make (datatypes.JSONMap )
89
89
}
90
+ if req .Nodes == nil {
91
+ req .Nodes = make (datatypes.JSONMap )
92
+ }
90
93
if gNs , ok := logic .GlobalNsList [req .Name ]; ok {
91
94
req .Servers = gNs .IPs
92
95
}
@@ -107,6 +110,7 @@ func createNs(w http.ResponseWriter, r *http.Request) {
107
110
MatchDomains : req .MatchDomains ,
108
111
Servers : req .Servers ,
109
112
Tags : req .Tags ,
113
+ Nodes : req .Nodes ,
110
114
Status : true ,
111
115
CreatedBy : r .Header .Get ("user" ),
112
116
CreatedAt : time .Now ().UTC (),
@@ -198,6 +202,9 @@ func updateNs(w http.ResponseWriter, r *http.Request) {
198
202
if updateNs .Tags == nil {
199
203
updateNs .Tags = make (datatypes.JSONMap )
200
204
}
205
+ if updateNs .Nodes == nil {
206
+ updateNs .Nodes = make (datatypes.JSONMap )
207
+ }
201
208
202
209
ns := schema.Nameserver {ID : updateNs .ID }
203
210
err = ns .Get (db .WithContext (r .Context ()))
@@ -239,6 +246,7 @@ func updateNs(w http.ResponseWriter, r *http.Request) {
239
246
ns .MatchAll = updateNs .MatchAll
240
247
ns .Description = updateNs .Description
241
248
ns .Name = updateNs .Name
249
+ ns .Nodes = updateNs .Nodes
242
250
ns .Status = updateNs .Status
243
251
ns .UpdatedAt = time .Now ().UTC ()
244
252
0 commit comments