add 32bit mesh agent upload
This commit is contained in:
parent
6c692a2c09
commit
67b3841327
|
@ -25,6 +25,7 @@ db.sqlite3
|
|||
api/tacticalrmm/static
|
||||
celerybeat-schedule
|
||||
meshagent.exe
|
||||
meshagent-x86.exe
|
||||
app.ini
|
||||
.env.dev
|
||||
.env
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -4,6 +4,12 @@
|
|||
<div class="text-h6">Upload New Mesh Agent</div>
|
||||
</q-card-section>
|
||||
<q-form @submit.prevent="upload">
|
||||
<q-card-section>
|
||||
<div class="q-gutter-sm">
|
||||
<q-radio v-model="arch" val="64" label="64 bit" />
|
||||
<q-radio v-model="arch" val="32" label="32 bit" />
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-card-section>
|
||||
<div class="row">
|
||||
<q-file
|
||||
|
@ -38,12 +44,14 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
meshagent: null,
|
||||
arch: "64",
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
upload() {
|
||||
this.$q.loading.show({ message: "Uploading..." });
|
||||
let formData = new FormData();
|
||||
formData.append("arch", this.arch);
|
||||
formData.append("meshagent", this.meshagent);
|
||||
axios
|
||||
.put("/core/uploadmesh/", formData)
|
||||
|
|
Loading…
Reference in New Issue