mirror of
https://github.com/gravitl/netmaker.git
synced 2025-11-09 16:21:01 +08:00
add public port to api model
This commit is contained in:
parent
a4e5f84be8
commit
f19b33a84c
2 changed files with 4 additions and 3 deletions
|
|
@ -133,9 +133,8 @@ func UpdateHost(newHost, currentHost *models.Host) {
|
|||
if newHost.ProxyListenPort == 0 {
|
||||
newHost.ProxyListenPort = currentHost.ProxyListenPort
|
||||
}
|
||||
if newHost.PublicListenPort == 0 {
|
||||
newHost.PublicListenPort = currentHost.PublicListenPort
|
||||
}
|
||||
newHost.PublicListenPort = currentHost.PublicListenPort
|
||||
|
||||
}
|
||||
|
||||
// UpdateHostFromClient - used for updating host on server with update recieved from client
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ type ApiHost struct {
|
|||
ListenPort int `json:"listenport"`
|
||||
LocalListenPort int `json:"locallistenport"`
|
||||
ProxyListenPort int `json:"proxy_listen_port"`
|
||||
PublicListenPort int `json:"public_listen_port" yaml:"public_listen_port"`
|
||||
MTU int `json:"mtu" yaml:"mtu"`
|
||||
Interfaces []Iface `json:"interfaces" yaml:"interfaces"`
|
||||
DefaultInterface string `json:"defaultinterface" yaml:"defautlinterface"`
|
||||
|
|
@ -55,6 +56,7 @@ func (h *Host) ConvertNMHostToAPI() *ApiHost {
|
|||
a.OS = h.OS
|
||||
a.Nodes = h.Nodes
|
||||
a.ProxyEnabled = h.ProxyEnabled
|
||||
a.PublicListenPort = h.PublicListenPort
|
||||
a.ProxyListenPort = h.ProxyListenPort
|
||||
a.PublicKey = h.PublicKey.String()
|
||||
a.Verbosity = h.Verbosity
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue