From 89128958ed99b9e1ae4a98975b6db33e25a97ce7 Mon Sep 17 00:00:00 2001 From: JimMoen Date: Sat, 13 Jan 2024 16:48:12 +0800 Subject: [PATCH] fix(dashboard): licence quota not provided to ce edition --- apps/emqx_dashboard/src/emqx_dashboard_monitor.erl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/emqx_dashboard/src/emqx_dashboard_monitor.erl b/apps/emqx_dashboard/src/emqx_dashboard_monitor.erl index b21712497..4891b5293 100644 --- a/apps/emqx_dashboard/src/emqx_dashboard_monitor.erl +++ b/apps/emqx_dashboard/src/emqx_dashboard_monitor.erl @@ -428,16 +428,20 @@ stats(dropped) -> emqx_metrics:val('messages.dropped'). %% the non rate values should be same on all nodes non_rate_value() -> - #{ + (license_quota())#{ retained_msg_count => emqx_retainer:retained_count(), - license_quota => license_quota(), node_uptime => emqx_sys:uptime() }. +-if(?EMQX_RELEASE_EDITION == ee). license_quota() -> case emqx_license_checker:limits() of {ok, #{max_connections := Quota}} -> - Quota; + #{license_quota => Quota}; {error, no_license} -> - 0 + #{license_quota => 0} end. +-else. +license_quota() -> + #{}. +-endif.