Skip to content

Commit 9043c6e

Browse files
committed
description
1 parent bbfcac8 commit 9043c6e

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

api/v1/device/device.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,8 +457,9 @@ func statusDevice(c *gin.Context) {
457457
}
458458

459459
msg.Config[i] = model.VPNConfig{}
460-
msg.Config[i].NetName = net.NetName
461-
msg.Config[i].NetId = net.NetId
460+
msg.Config[i].NetName = network.NetName
461+
msg.Config[i].NetId = network.Id
462+
msg.Config[i].Description = network.Description
462463

463464
hasIngress := false
464465
ingress := &model.VPN{}

core/service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,9 @@ func CreateService(service *model.Service) (*model.Service, error) {
199199
vpn.Current.PostDown = Sanitize(vpn.Current.PostDown)
200200

201201
vpn.Current.PersistentKeepalive = 23
202+
vpn.Current.FailSafe = true
202203

203204
if service.ServiceType != "Ingress" && service.ServiceType != "Egress" {
204-
vpn.Current.SyncEndpoint = true
205205
}
206206

207207
switch service.ServiceType {

core/vpn.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ func UpdateVPN(Id string, vpn *model.VPN, flag bool) (*model.VPN, error) {
261261
}
262262
}
263263

264-
if len(vpn.Current.Address) == 0 ||
264+
if len(vpn.Current.Address) == 0 &&
265265
(len(vpn.Default.Address) > 0 && len(current.Default.Address) > 0 &&
266266
(vpn.Default.Address[0] != current.Default.Address[0])) {
267267
reserverIps, err := GetAllReservedNetIps(vpn.NetId)

model/message.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
package model
22

33
type VPNConfig struct {
4-
NetName string `json:"netName" bson:"netName"`
5-
NetId string `json:"netid" bson:"netid"`
6-
VPNs []VPN `json:"vpns" bson:"vpns"`
4+
NetName string `json:"netName" bson:"netName"`
5+
NetId string `json:"netid" bson:"netid"`
6+
Description string `json:"description" bson:"description"`
7+
VPNs []VPN `json:"vpns" bson:"vpns"`
78
}
89

910
type Message struct {

0 commit comments

Comments
 (0)