From f69446b6482a75f648bca0d99d02468d46261034 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sun, 13 Dec 2020 11:45:24 +0000 Subject: [PATCH] agent 1.1.11 wh1te909/rmmagent@f693d15322a8176ed00c0b2867ff34635af6f28b --- api/tacticalrmm/apiv3/views.py | 50 +++++++++++++------------ api/tacticalrmm/tacticalrmm/settings.py | 4 +- 2 files changed, 28 insertions(+), 26 deletions(-) diff --git a/api/tacticalrmm/apiv3/views.py b/api/tacticalrmm/apiv3/views.py index 5c27ba83..4f5a018d 100644 --- a/api/tacticalrmm/apiv3/views.py +++ b/api/tacticalrmm/apiv3/views.py @@ -94,33 +94,35 @@ class CheckIn(APIView): serializer = WinAgentSerializer(instance=agent, data=request.data, partial=True) serializer.is_valid(raise_exception=True) - disks = request.data["disks"] - new = [] - # python agent - if isinstance(disks, dict): - for k, v in disks.items(): - new.append(v) - else: - # golang agent - for disk in disks: - tmp = {} - for k, v in disk.items(): - tmp["device"] = disk["device"] - tmp["fstype"] = disk["fstype"] - tmp["total"] = bytes2human(disk["total"]) - tmp["used"] = bytes2human(disk["used"]) - tmp["free"] = bytes2human(disk["free"]) - tmp["percent"] = int(disk["percent"]) - new.append(tmp) + if "disks" in request.data.keys(): + disks = request.data["disks"] + new = [] + # python agent + if isinstance(disks, dict): + for k, v in disks.items(): + new.append(v) + else: + # golang agent + for disk in disks: + tmp = {} + for k, v in disk.items(): + tmp["device"] = disk["device"] + tmp["fstype"] = disk["fstype"] + tmp["total"] = bytes2human(disk["total"]) + tmp["used"] = bytes2human(disk["used"]) + tmp["free"] = bytes2human(disk["free"]) + tmp["percent"] = int(disk["percent"]) + new.append(tmp) - if request.data["logged_in_username"] == "None": serializer.save(disks=new) - else: - serializer.save( - disks=new, - last_logged_in_user=request.data["logged_in_username"], - ) + return Response("ok") + if "logged_in_username" in request.data.keys(): + if request.data["logged_in_username"] != "None": + serializer.save(last_logged_in_user=request.data["logged_in_username"]) + return Response("ok") + + serializer.save() return Response("ok") def post(self, request): diff --git a/api/tacticalrmm/tacticalrmm/settings.py b/api/tacticalrmm/tacticalrmm/settings.py index 0e59a1b3..d6adb75f 100644 --- a/api/tacticalrmm/tacticalrmm/settings.py +++ b/api/tacticalrmm/tacticalrmm/settings.py @@ -15,7 +15,7 @@ EXE_DIR = os.path.join(BASE_DIR, "tacticalrmm/private/exe") AUTH_USER_MODEL = "accounts.User" # latest release -TRMM_VERSION = "0.2.15" +TRMM_VERSION = "0.2.16" # bump this version everytime vue code is changed # to alert user they need to manually refresh their browser @@ -25,7 +25,7 @@ APP_VER = "0.0.99" LATEST_SALT_VER = "1.1.0" # https://github.com/wh1te909/rmmagent -LATEST_AGENT_VER = "1.1.10" +LATEST_AGENT_VER = "1.1.11" MESH_VER = "0.7.14"