Преглед изворни кода

fix(plugin): schema content only provided in enterprise edition

JimMoen пре 1 година
родитељ
комит
140b7ce51e
1 измењених фајлова са 9 додато и 4 уклоњено
  1. 9 4
      apps/emqx_management/src/emqx_mgmt_api_plugins.erl

+ 9 - 4
apps/emqx_management/src/emqx_mgmt_api_plugins.erl

@@ -695,10 +695,15 @@ aggregate_status([{Node, Plugins} | List], Acc) ->
     aggregate_status(List, NewAcc).
     aggregate_status(List, NewAcc).
 
 
 format_plugin_avsc_and_i18n(NameVsn) ->
 format_plugin_avsc_and_i18n(NameVsn) ->
-    #{
-        avsc => try_read_file(fun() -> emqx_plugins:plugin_avsc(NameVsn) end),
-        i18n => try_read_file(fun() -> emqx_plugins:plugin_i18n(NameVsn) end)
-    }.
+    case emqx_release:edition() of
+        ee ->
+            #{
+                avsc => try_read_file(fun() -> emqx_plugins:plugin_avsc(NameVsn) end),
+                i18n => try_read_file(fun() -> emqx_plugins:plugin_i18n(NameVsn) end)
+            };
+        ce ->
+            #{avsc => null, i18n => null}
+    end.
 
 
 try_read_file(Fun) ->
 try_read_file(Fun) ->
     case Fun() of
     case Fun() of