From 51910ea2c18d77deb6ef5411862cb8cd9b5bf0fe Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Wed, 30 Aug 2023 18:18:08 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=8E=86=E5=8F=B2?= =?UTF-8?q?=E4=BC=9A=E8=AF=9D=E4=B8=BA=E8=B4=9F=E6=95=B0=E7=9A=84=E6=83=85?= =?UTF-8?q?=E5=86=B5=20(#11472)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: feng <1304903146@qq.com> --- apps/jumpserver/api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/jumpserver/api.py b/apps/jumpserver/api.py index 18ef672b7..0592373a5 100644 --- a/apps/jumpserver/api.py +++ b/apps/jumpserver/api.py @@ -360,8 +360,9 @@ class IndexApi(DateTimeMixin, DatesLoginMetricMixin, APIView): }) if _all or query_params.get('total_count') or query_params.get('total_count_history_sessions'): + count = self.sessions_amount - caches.total_count_online_sessions data.update({ - 'total_count_history_sessions': self.sessions_amount - caches.total_count_online_sessions, + 'total_count_history_sessions': count if count > 0 else 0, }) if _all or query_params.get('total_count') or query_params.get('total_count_ftp_logs'):