fix: include ref's desc

This commit is contained in:
Zhongwen Deng 2022-05-12 16:15:04 +08:00
parent 41e5bda914
commit 09e5f35f5c
2 changed files with 21 additions and 6 deletions

View File

@ -944,8 +944,8 @@ until the RPC connection is considered lost."""
zh: """需要持久化到文件的日志处理进程列表。默认只有 default 一个处理进程。""" zh: """需要持久化到文件的日志处理进程列表。默认只有 default 一个处理进程。"""
} }
label { label {
en: "File Handlers" en: "File Handler"
zh: "File Handlers" zh: "File Handler"
} }
} }
@ -1389,8 +1389,8 @@ Each sink is represented by a _log handler_, which can be configured independent
zh: """日志处理进程将日志事件打印到 EMQX 控制台。""" zh: """日志处理进程将日志事件打印到 EMQX 控制台。"""
} }
label { label {
en: "Console Log Handler" en: "Console Handler"
zh: "控制台日志处理进程" zh: "Console Handler"
} }
} }

View File

@ -429,8 +429,23 @@ trans_label(Spec, Hocon, Default) ->
desc_struct(Hocon) -> desc_struct(Hocon) ->
case hocon_schema:field_schema(Hocon, desc) of case hocon_schema:field_schema(Hocon, desc) of
undefined -> hocon_schema:field_schema(Hocon, description); undefined ->
Struct -> Struct case hocon_schema:field_schema(Hocon, description) of
undefined ->
case Hocon of
?R_REF(Mod, Name) ->
case erlang:function_exported(Mod, desc, 1) of
true -> Mod:desc(Name);
false -> undefined
end;
_ ->
undefined
end;
Struct1 ->
Struct1
end;
Struct ->
Struct
end. end.
request_body(#{content := _} = Content, _Module, _Options) -> request_body(#{content := _} = Content, _Module, _Options) ->