From 5f2add48a961258104f6e9cca5a6b7b4b5074286 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Wed, 10 Aug 2022 07:10:32 +0000 Subject: [PATCH] more fuckery --- src/components/modals/agents/EditAgent.vue | 50 +++++++++++++++++++--- 1 file changed, 45 insertions(+), 5 deletions(-) diff --git a/src/components/modals/agents/EditAgent.vue b/src/components/modals/agents/EditAgent.vue index 56d4c04..f1472d1 100644 --- a/src/components/modals/agents/EditAgent.vue +++ b/src/components/modals/agents/EditAgent.vue @@ -466,10 +466,50 @@ export default { }, editAgent() { // TODO we need to fix the serializer to not send this stuff - delete this.agent.all_timezones; - delete this.agent.timezone; - delete this.agent.wmi_detail; - delete this.agent.services; + const toRemove = [ + "created_by", + "created_time", + "modified_by", + "modified_time", + "all_timezones", + "timezone", + "wmi_detail", + "services", + "status", + "cpu_model", + "local_ips", + "make_model", + "physical_disks", + "graphics", + "checks", + "patches_last_installed", + "last_seen", + "applied_policies", + "effective_patch_policy", + "version", + "operating_system", + "plat", + "goarch", + "hostname", + "public_ip", + "total_ram", + "disks", + "boot_time", + "logged_in_username", + "last_logged_in_user", + "needs_reboot", + "choco_installed", + "policy", + "mesh_node_id", + "block_policy_inheritance", + "maintenance_mode", + "alert_template", + "client", + "site_name", + ]; + for (const elem of toRemove) { + delete this.agent[elem]; + } // only send the timezone data if it has changed // this way django will keep the db column as null and inherit from the global setting @@ -506,7 +546,7 @@ export default { else if (day === 0) result += "Sun, "; } - return result.trimRight(","); + return result.trimEnd(","); }, }, mounted() {