Bladeren bron

chore: mv i18n.conf to emqx_dashboard/priv/

Zhongwen Deng 3 jaren geleden
bovenliggende
commit
9768e302c2

+ 1 - 0
.gitignore

@@ -44,6 +44,7 @@ _packages
 elvis
 emqx_dialyzer_*_plt
 */emqx_dashboard/priv/www
+*/emqx_dashboard/priv/i18n.conf
 dist.zip
 scripts/git-token
 apps/*/etc/*.all

File diff suppressed because it is too large
+ 0 - 1
apps/emqx/test/emqx_static_checks_data/5.0.0.bpapi


+ 1 - 1
apps/emqx_conf/src/emqx_conf.erl

@@ -138,7 +138,7 @@ reset(Node, KeyPath, Opts) ->
 %% @doc Called from build script.
 -spec dump_schema(file:name_all()) -> ok.
 dump_schema(Dir) ->
-    I18nFile = emqx:etc_file("i18n.conf"),
+    I18nFile = emqx_dashboard:i18n_file(),
     dump_schema(Dir, emqx_conf_schema, I18nFile).
 
 dump_schema(Dir, SchemaModule, I18nFile) ->

+ 2 - 1
apps/emqx_dashboard/src/emqx_dashboard.erl

@@ -30,6 +30,7 @@
     init_i18n/2,
     init_i18n/0,
     get_i18n/0,
+    i18n_file/0,
     clear_i18n/0
 ]).
 
@@ -271,7 +272,7 @@ return_unauthorized(Code, Message) ->
 
 i18n_file() ->
     case application:get_env(emqx_dashboard, i18n_file) of
-        undefined -> emqx:etc_file("i18n.conf");
+        undefined -> filename:join([code:priv_dir(emqx_dashboard), "i18n.conf"]);
         {ok, File} -> File
     end.
 

+ 1 - 1
apps/emqx_management/src/emqx_mgmt_api_nodes.erl

@@ -289,7 +289,7 @@ format(_Node, Info = #{memory_total := Total, memory_used := Used}) ->
     LogPath =
         case log_path() of
             undefined ->
-                <<"The log path is not yet set">>;
+                <<"log.file_handler.default.enable is false,only log to console">>;
             Path ->
                 filename:join(SysPath, Path)
         end,

+ 3 - 1
mix.exs

@@ -291,6 +291,8 @@ defmodule EMQXUmbrella.MixProject do
   end
 
   defp copy_files(release, release_type, package_type, edition_type) do
+    IO.inspect :zhongwen
+    IO.inspect release.applications.emqx_dashboard
     overwrite? = Keyword.get(release.options, :overwrite, false)
 
     bin = Path.join(release.path, "bin")
@@ -325,7 +327,7 @@ defmodule EMQXUmbrella.MixProject do
     # required by emqx_dashboard
     Mix.Generator.copy_file(
       "apps/emqx_dashboard/etc/i18n.conf.all",
-      Path.join(etc, "i18n.conf"),
+      Path.join(release.path, "lib/emqx_dashboard-#{release.applications.emqx_dashboard[:vsn]}/priv/i18n.conf"),
       force: overwrite?
     )
 

+ 4 - 2
rebar.config.erl

@@ -425,13 +425,15 @@ emqx_etc_overlay_common() ->
 emqx_etc_overlay_per_edition(ce) ->
     [
         {"{{base_dir}}/lib/emqx_conf/etc/emqx.conf.all", "etc/emqx.conf"},
-        {"{{base_dir}}/lib/emqx_dashboard/etc/i18n.conf.all", "etc/i18n.conf"}
+        {"{{base_dir}}/lib/emqx_dashboard/etc/i18n.conf.all",
+            "{{base_dir}}/lib/emqx_dashboard/priv/i18n.conf"}
     ];
 emqx_etc_overlay_per_edition(ee) ->
     [
         {"{{base_dir}}/lib/emqx_conf/etc/emqx_enterprise.conf.all", "etc/emqx_enterprise.conf"},
         {"{{base_dir}}/lib/emqx_conf/etc/emqx.conf.all", "etc/emqx.conf"},
-        {"{{base_dir}}/lib/emqx_dashboard/etc/i18n.conf.all", "etc/i18n.conf"}
+        {"{{base_dir}}/lib/emqx_dashboard/etc/i18n.conf.all",
+            "{{base_dir}}/lib/emqx_dashboard/priv/i18n.conf"}
     ].
 
 get_vsn(Profile) ->