Change to string for auto support
This commit is contained in:
@@ -252,8 +252,6 @@ func main() {
|
|||||||
switch name {
|
switch name {
|
||||||
case "X", "Y":
|
case "X", "Y":
|
||||||
f.FieldType = "float64"
|
f.FieldType = "float64"
|
||||||
case "Channel", "BackupChannel", "TxPower":
|
|
||||||
f.FieldType = "int"
|
|
||||||
case "StpPriority", "Ht":
|
case "StpPriority", "Ht":
|
||||||
f.FieldType = "string"
|
f.FieldType = "string"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -275,19 +275,19 @@ func (dst *DevicePortOverrides) UnmarshalJSON(b []byte) error {
|
|||||||
type DeviceRadioTable struct {
|
type DeviceRadioTable struct {
|
||||||
AntennaGain int `json:"antenna_gain,omitempty"` // ^-?([0-9]|[1-9][0-9])
|
AntennaGain int `json:"antenna_gain,omitempty"` // ^-?([0-9]|[1-9][0-9])
|
||||||
AntennaID int `json:"antenna_id,omitempty"` // -1|[0-9]
|
AntennaID int `json:"antenna_id,omitempty"` // -1|[0-9]
|
||||||
BackupChannel int `json:"backup_channel,omitempty"` // [0-9]|[1][0-4]|16|34|36|38|40|42|44|46|48|52|56|60|64|100|104|108|112|116|120|124|128|132|136|140|144|149|153|157|161|165|183|184|185|187|188|189|192|196|auto
|
BackupChannel string `json:"backup_channel,omitempty"` // [0-9]|[1][0-4]|16|34|36|38|40|42|44|46|48|52|56|60|64|100|104|108|112|116|120|124|128|132|136|140|144|149|153|157|161|165|183|184|185|187|188|189|192|196|auto
|
||||||
Channel int `json:"channel,omitempty"` // [0-9]|[1][0-4]|4.5|16|34|36|38|40|42|44|46|48|52|56|60|64|100|104|108|112|116|120|124|128|132|136|140|144|149|153|157|161|165|183|184|185|187|188|189|192|196|auto
|
Channel string `json:"channel,omitempty"` // [0-9]|[1][0-4]|4.5|16|34|36|38|40|42|44|46|48|52|56|60|64|100|104|108|112|116|120|124|128|132|136|140|144|149|153|157|161|165|183|184|185|187|188|189|192|196|auto
|
||||||
HardNoiseFloorEnabled bool `json:"hard_noise_floor_enabled,omitempty"`
|
HardNoiseFloorEnabled bool `json:"hard_noise_floor_enabled,omitempty"`
|
||||||
Ht string `json:"ht,omitempty"` // 20|40|80|160|1080|2160
|
Ht string `json:"ht,omitempty"` // 20|40|80|160|1080|2160
|
||||||
LoadbalanceEnabled bool `json:"loadbalance_enabled,omitempty"`
|
LoadbalanceEnabled bool `json:"loadbalance_enabled,omitempty"`
|
||||||
Maxsta int `json:"maxsta,omitempty"` // [1-9]|[1-9][0-9]|1[0-9]{2}|200|^$
|
Maxsta int `json:"maxsta,omitempty"` // [1-9]|[1-9][0-9]|1[0-9]{2}|200|^$
|
||||||
MinRssi int `json:"min_rssi,omitempty"` // ^-([1-9]|[1-8][0-9]|9[0-4])$
|
MinRssi int `json:"min_rssi,omitempty"` // ^-(6[7-9]|[7-8][0-9]|90)$
|
||||||
MinRssiEnabled bool `json:"min_rssi_enabled,omitempty"`
|
MinRssiEnabled bool `json:"min_rssi_enabled,omitempty"`
|
||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
Radio string `json:"radio,omitempty"` // ng|na|ad
|
Radio string `json:"radio,omitempty"` // ng|na|ad
|
||||||
SensLevel int `json:"sens_level,omitempty"` // ^-([5-8][0-9]|90)$
|
SensLevel int `json:"sens_level,omitempty"` // ^-([5-8][0-9]|90)$
|
||||||
SensLevelEnabled bool `json:"sens_level_enabled,omitempty"`
|
SensLevelEnabled bool `json:"sens_level_enabled,omitempty"`
|
||||||
TxPower int `json:"tx_power,omitempty"` // [\d]+|auto
|
TxPower string `json:"tx_power,omitempty"` // [\d]+|auto
|
||||||
TxPowerMode string `json:"tx_power_mode,omitempty"` // auto|medium|high|low|custom
|
TxPowerMode string `json:"tx_power_mode,omitempty"` // auto|medium|high|low|custom
|
||||||
VwireEnabled bool `json:"vwire_enabled,omitempty"`
|
VwireEnabled bool `json:"vwire_enabled,omitempty"`
|
||||||
}
|
}
|
||||||
@@ -295,14 +295,11 @@ type DeviceRadioTable struct {
|
|||||||
func (dst *DeviceRadioTable) UnmarshalJSON(b []byte) error {
|
func (dst *DeviceRadioTable) UnmarshalJSON(b []byte) error {
|
||||||
type Alias DeviceRadioTable
|
type Alias DeviceRadioTable
|
||||||
aux := &struct {
|
aux := &struct {
|
||||||
AntennaGain emptyStringInt `json:"antenna_gain"`
|
AntennaGain emptyStringInt `json:"antenna_gain"`
|
||||||
AntennaID emptyStringInt `json:"antenna_id"`
|
AntennaID emptyStringInt `json:"antenna_id"`
|
||||||
BackupChannel emptyStringInt `json:"backup_channel"`
|
Maxsta emptyStringInt `json:"maxsta"`
|
||||||
Channel emptyStringInt `json:"channel"`
|
MinRssi emptyStringInt `json:"min_rssi"`
|
||||||
Maxsta emptyStringInt `json:"maxsta"`
|
SensLevel emptyStringInt `json:"sens_level"`
|
||||||
MinRssi emptyStringInt `json:"min_rssi"`
|
|
||||||
SensLevel emptyStringInt `json:"sens_level"`
|
|
||||||
TxPower emptyStringInt `json:"tx_power"`
|
|
||||||
|
|
||||||
*Alias
|
*Alias
|
||||||
}{
|
}{
|
||||||
@@ -315,12 +312,9 @@ func (dst *DeviceRadioTable) UnmarshalJSON(b []byte) error {
|
|||||||
}
|
}
|
||||||
dst.AntennaGain = int(aux.AntennaGain)
|
dst.AntennaGain = int(aux.AntennaGain)
|
||||||
dst.AntennaID = int(aux.AntennaID)
|
dst.AntennaID = int(aux.AntennaID)
|
||||||
dst.BackupChannel = int(aux.BackupChannel)
|
|
||||||
dst.Channel = int(aux.Channel)
|
|
||||||
dst.Maxsta = int(aux.Maxsta)
|
dst.Maxsta = int(aux.Maxsta)
|
||||||
dst.MinRssi = int(aux.MinRssi)
|
dst.MinRssi = int(aux.MinRssi)
|
||||||
dst.SensLevel = int(aux.SensLevel)
|
dst.SensLevel = int(aux.SensLevel)
|
||||||
dst.TxPower = int(aux.TxPower)
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ type SettingSuperMgmt struct {
|
|||||||
LiveUpdates string `json:"live_updates,omitempty"` // disabled|live|auto
|
LiveUpdates string `json:"live_updates,omitempty"` // disabled|live|auto
|
||||||
MinimumUsableHdSpace int `json:"minimum_usable_hd_space,omitempty"`
|
MinimumUsableHdSpace int `json:"minimum_usable_hd_space,omitempty"`
|
||||||
MinimumUsableSdSpace int `json:"minimum_usable_sd_space,omitempty"`
|
MinimumUsableSdSpace int `json:"minimum_usable_sd_space,omitempty"`
|
||||||
|
MultipleSitesEnabled bool `json:"multiple_sites_enabled"`
|
||||||
OverrideInformHost bool `json:"override_inform_host"`
|
OverrideInformHost bool `json:"override_inform_host"`
|
||||||
StoreEnabled string `json:"store_enabled,omitempty"` // disabled|super-only|everyone
|
StoreEnabled string `json:"store_enabled,omitempty"` // disabled|super-only|everyone
|
||||||
TimeSeriesPerClientStatsEnabled bool `json:"time_series_per_client_stats_enabled"`
|
TimeSeriesPerClientStatsEnabled bool `json:"time_series_per_client_stats_enabled"`
|
||||||
|
|||||||
Reference in New Issue
Block a user