mirror of
https://github.com/gravitl/netmaker.git
synced 2025-11-08 07:41:41 +08:00
add isdefault to models
This commit is contained in:
parent
c257827807
commit
6669f38961
2 changed files with 4 additions and 0 deletions
|
|
@ -25,6 +25,7 @@ type ApiHost struct {
|
|||
InternetGateway string `json:"internetgateway"`
|
||||
Nodes []string `json:"nodes"`
|
||||
ProxyEnabled bool `json:"proxy_enabled" yaml:"proxy_enabled"`
|
||||
IsDefault bool `json:"isdefault" yaml:"isdefault"`
|
||||
}
|
||||
|
||||
// Host.ConvertNMHostToAPI - converts a Netmaker host to an API editable host
|
||||
|
|
@ -60,6 +61,7 @@ func (h *Host) ConvertNMHostToAPI() *ApiHost {
|
|||
a.PublicKey = h.PublicKey.String()
|
||||
a.Verbosity = h.Verbosity
|
||||
a.Version = h.Version
|
||||
a.IsDefault = h.IsDefault
|
||||
|
||||
return &a
|
||||
}
|
||||
|
|
@ -109,6 +111,7 @@ func (a *ApiHost) ConvertAPIHostToNMHost(currentHost *Host) *Host {
|
|||
h.LocalRange = currentHost.LocalRange
|
||||
}
|
||||
h.ProxyEnabled = a.ProxyEnabled
|
||||
h.IsDefault = a.IsDefault
|
||||
|
||||
return &h
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ type Host struct {
|
|||
IsDocker bool `json:"isdocker" yaml:"isdocker"`
|
||||
IsK8S bool `json:"isk8s" yaml:"isk8s"`
|
||||
IsStatic bool `json:"isstatic" yaml:"isstatic"`
|
||||
IsDefault bool `json:"isdefault" yaml:"isdefault"`
|
||||
}
|
||||
|
||||
// FormatBool converts a boolean to a [yes|no] string
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue