fix(ft): make ee schema aware of ee fields
This commit is contained in:
parent
18aa39f892
commit
2f1970adbc
|
@ -35,7 +35,7 @@
|
|||
|
||||
-reflect_type([json_value/0]).
|
||||
|
||||
-import(hoconsc, [ref/1, ref/2, mk/2]).
|
||||
-import(hoconsc, [ref/2, mk/2]).
|
||||
|
||||
namespace() -> file_transfer.
|
||||
|
||||
|
@ -217,3 +217,6 @@ converter(checksum) ->
|
|||
_ = byte_size(Hex) =:= 64 orelse throw({expected_length, 64}),
|
||||
{sha256, binary:decode_hex(Hex)}
|
||||
end.
|
||||
|
||||
ref(Ref) ->
|
||||
ref(?MODULE, Ref).
|
||||
|
|
|
@ -26,10 +26,24 @@ roots() ->
|
|||
).
|
||||
|
||||
fields(Name) ->
|
||||
emqx_conf_schema:fields(Name).
|
||||
ee_fields(?EE_SCHEMA_MODULES, Name).
|
||||
|
||||
translations() ->
|
||||
emqx_conf_schema:translations().
|
||||
|
||||
translation(Name) ->
|
||||
emqx_conf_schema:translation(Name).
|
||||
|
||||
%%------------------------------------------------------------------------------
|
||||
%% helpers
|
||||
%%------------------------------------------------------------------------------
|
||||
|
||||
ee_fields([EEMod | EEMods], Name) ->
|
||||
case lists:member(Name, apply(EEMod, roots, [])) of
|
||||
true ->
|
||||
apply(EEMod, fields, [Name]);
|
||||
false ->
|
||||
ee_fields(EEMods, Name)
|
||||
end;
|
||||
ee_fields([], Name) ->
|
||||
emqx_conf_schema:fields(Name).
|
||||
|
|
Loading…
Reference in New Issue