mirror of https://github.com/jumpserver/jumpserver
fix: 控制台-仪表盘会话用户,资产排名不对
parent
913c0d140d
commit
23874460da
|
@ -187,14 +187,14 @@ class DatesLoginMetricMixin:
|
|||
|
||||
def get_dates_login_times_assets(self):
|
||||
assets = self.sessions_queryset.values("asset") \
|
||||
.annotate(total=Count("asset", distinct=True)) \
|
||||
.annotate(total=Count("asset")) \
|
||||
.annotate(last=Cast(Max("date_start"), output_field=CharField())) \
|
||||
.order_by("-total")
|
||||
return list(assets[:10])
|
||||
|
||||
def get_dates_login_times_users(self):
|
||||
users = self.sessions_queryset.values("user_id") \
|
||||
.annotate(total=Count("user_id", distinct=True)) \
|
||||
.annotate(total=Count("user_id")) \
|
||||
.annotate(user=Max('user')) \
|
||||
.annotate(last=Cast(Max("date_start"), output_field=CharField())) \
|
||||
.order_by("-total")
|
||||
|
|
Loading…
Reference in New Issue