Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NET-641: Enable/Disable Auto Update From UI #2622

Merged
merged 3 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion logic/hosts.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ func UpdateHost(newHost, currentHost *models.Host) {
newHost.Nodes = currentHost.Nodes
newHost.PublicKey = currentHost.PublicKey
newHost.TrafficKeyPublic = currentHost.TrafficKeyPublic

// changeable fields
if len(newHost.Version) == 0 {
newHost.Version = currentHost.Version
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"golang.org/x/exp/slog"
)

var version = "v0.21.1"
abhishek9686 marked this conversation as resolved.
Show resolved Hide resolved
var version = "v0.21.0"

// Start DB Connection and start API Request Handler
func main() {
Expand Down
3 changes: 3 additions & 0 deletions models/api_host.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type ApiHost struct {
RelayedHosts []string `json:"relay_hosts" yaml:"relay_hosts" bson:"relay_hosts"`
NatType string `json:"nat_type" yaml:"nat_type"`
PersistentKeepalive int `json:"persistentkeepalive" yaml:"persistentkeepalive"`
AutoUpdate bool `json:"autoupdate" yaml:"autoupdate"`
abhishek9686 marked this conversation as resolved.
Show resolved Hide resolved
}

// Host.ConvertNMHostToAPI - converts a Netmaker host to an API editable host
Expand Down Expand Up @@ -60,6 +61,7 @@ func (h *Host) ConvertNMHostToAPI() *ApiHost {
a.IsDefault = h.IsDefault
a.NatType = h.NatType
a.PersistentKeepalive = int(h.PersistentKeepalive.Seconds())
a.AutoUpdate = h.AutoUpdate
return &a
}

Expand Down Expand Up @@ -98,5 +100,6 @@ func (a *ApiHost) ConvertAPIHostToNMHost(currentHost *Host) *Host {
h.NatType = currentHost.NatType
h.TurnEndpoint = currentHost.TurnEndpoint
h.PersistentKeepalive = time.Duration(a.PersistentKeepalive) * time.Second
h.AutoUpdate = a.AutoUpdate
return &h
}
Loading