Merge pull request #10136 from kjellwinblad/kjell/fix/default_value_ui

fix: schema default value so that it shows up correctly in UI
This commit is contained in:
Kjell Winblad 2023-03-16 12:20:08 +01:00 committed by GitHub
commit 884dddec79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 7 deletions

View File

@ -106,7 +106,14 @@ fields(topology) ->
{socket_timeout_ms, duration("socket_timeout")}, {socket_timeout_ms, duration("socket_timeout")},
{server_selection_timeout_ms, duration("server_selection_timeout")}, {server_selection_timeout_ms, duration("server_selection_timeout")},
{wait_queue_timeout_ms, duration("wait_queue_timeout")}, {wait_queue_timeout_ms, duration("wait_queue_timeout")},
{heartbeat_frequency_ms, fun heartbeat_frequency_ms/1}, {heartbeat_frequency_ms,
hoconsc:mk(
emqx_schema:duration_ms(),
#{
default => <<"200s">>,
desc => ?DESC("heartbeat_period")
}
)},
{min_heartbeat_frequency_ms, duration("min_heartbeat_period")} {min_heartbeat_frequency_ms, duration("min_heartbeat_period")}
]. ].
@ -407,12 +414,6 @@ duration(Desc) ->
desc => ?DESC(Desc) desc => ?DESC(Desc)
}. }.
heartbeat_frequency_ms(type) -> emqx_schema:duration_ms();
heartbeat_frequency_ms(desc) -> ?DESC("heartbeat_period");
heartbeat_frequency_ms(default) -> 200000;
heartbeat_frequency_ms(validator) -> [?MIN(1)];
heartbeat_frequency_ms(_) -> undefined.
max_overflow(type) -> non_neg_integer(); max_overflow(type) -> non_neg_integer();
max_overflow(desc) -> ?DESC("max_overflow"); max_overflow(desc) -> ?DESC("max_overflow");
max_overflow(default) -> 0; max_overflow(default) -> 0;