diff --git a/.gitignore b/.gitignore index f718587b..d5ffa9a9 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,7 @@ db.sqlite3 api/tacticalrmm/static celerybeat-schedule meshagent.exe +meshagent-x86.exe app.ini .env.dev .env diff --git a/api/tacticalrmm/core/views.py b/api/tacticalrmm/core/views.py index f0bc4f90..65eae75f 100644 --- a/api/tacticalrmm/core/views.py +++ b/api/tacticalrmm/core/views.py @@ -19,11 +19,14 @@ class UploadMeshAgent(APIView): parser_class = (FileUploadParser,) def put(self, request, format=None): - if "meshagent" not in request.data: + if "meshagent" not in request.data and "arch" not in request.data: raise ParseError("Empty content") + arch = request.data["arch"] f = request.data["meshagent"] - mesh_exe = os.path.join(settings.EXE_DIR, "meshagent.exe") + mesh_exe = os.path.join( + settings.EXE_DIR, "meshagent.exe" if arch == "64" else "meshagent-x86.exe" + ) with open(mesh_exe, "wb+") as j: for chunk in f.chunks(): j.write(chunk) diff --git a/web/src/components/modals/core/UploadMesh.vue b/web/src/components/modals/core/UploadMesh.vue index d893f1db..a88850ab 100644 --- a/web/src/components/modals/core/UploadMesh.vue +++ b/web/src/components/modals/core/UploadMesh.vue @@ -4,6 +4,12 @@
Upload New Mesh Agent
+ +
+ + +
+