From c56c537f7f31df57b36ee6e625cd3174ddb4c211 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Tue, 2 Mar 2021 23:42:00 +0000 Subject: [PATCH] HOTFIX 0.4.20 temporarily disable some sorting --- api/tacticalrmm/agents/views.py | 15 +++++++++++++- api/tacticalrmm/tacticalrmm/settings.py | 4 ++-- web/src/components/AgentTable.vue | 7 ++++--- web/src/views/Dashboard.vue | 27 +++++++++++++------------ 4 files changed, 34 insertions(+), 19 deletions(-) diff --git a/api/tacticalrmm/agents/views.py b/api/tacticalrmm/agents/views.py index 8c7487a9..54900dc0 100644 --- a/api/tacticalrmm/agents/views.py +++ b/api/tacticalrmm/agents/views.py @@ -234,6 +234,19 @@ class AgentsTableList(APIView): site = Q() mon_type = Q() + if pagination["sortBy"] == "agentstatus": + sort = "last_seen" + elif pagination["sortBy"] == "client_name": + sort = "site__client__name" + elif pagination["sortBy"] == "site_name": + sort = "site__name" + elif pagination["sortBy"] == "user": + sort = "logged_in_username" + else: + sort = pagination["sortBy"] + + order_by = f"-{sort}" if pagination["descending"] else sort + if monType == "server": mon_type = Q(monitoring_type="server") elif monType == "workstation": @@ -270,7 +283,7 @@ class AgentsTableList(APIView): "time_zone", "maintenance_mode", ) - .order_by(pagination["sortBy"]) + .order_by(order_by) ) paginator = Paginator(queryset, pagination["rowsPerPage"]) diff --git a/api/tacticalrmm/tacticalrmm/settings.py b/api/tacticalrmm/tacticalrmm/settings.py index 9762090a..6e05df3f 100644 --- a/api/tacticalrmm/tacticalrmm/settings.py +++ b/api/tacticalrmm/tacticalrmm/settings.py @@ -15,11 +15,11 @@ EXE_DIR = os.path.join(BASE_DIR, "tacticalrmm/private/exe") AUTH_USER_MODEL = "accounts.User" # latest release -TRMM_VERSION = "0.4.19" +TRMM_VERSION = "0.4.20" # bump this version everytime vue code is changed # to alert user they need to manually refresh their browser -APP_VER = "0.0.117" +APP_VER = "0.0.118" # https://github.com/wh1te909/rmmagent LATEST_AGENT_VER = "1.4.8" diff --git a/web/src/components/AgentTable.vue b/web/src/components/AgentTable.vue index 9a6a89d4..4218003d 100644 --- a/web/src/components/AgentTable.vue +++ b/web/src/components/AgentTable.vue @@ -69,7 +69,7 @@ -