expose more fields in search amidaware/tacticalrmm-web@93dbc74e33 closes #652
This commit is contained in:
		@@ -90,6 +90,11 @@ class AgentTableSerializer(serializers.ModelSerializer):
 | 
				
			|||||||
    last_seen = serializers.ReadOnlyField()
 | 
					    last_seen = serializers.ReadOnlyField()
 | 
				
			||||||
    pending_actions_count = serializers.ReadOnlyField()
 | 
					    pending_actions_count = serializers.ReadOnlyField()
 | 
				
			||||||
    has_patches_pending = serializers.ReadOnlyField()
 | 
					    has_patches_pending = serializers.ReadOnlyField()
 | 
				
			||||||
 | 
					    cpu_model = serializers.ReadOnlyField()
 | 
				
			||||||
 | 
					    graphics = serializers.ReadOnlyField()
 | 
				
			||||||
 | 
					    local_ips = serializers.ReadOnlyField()
 | 
				
			||||||
 | 
					    make_model = serializers.ReadOnlyField()
 | 
				
			||||||
 | 
					    physical_disks = serializers.ReadOnlyField()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def get_alert_template(self, obj):
 | 
					    def get_alert_template(self, obj):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -141,6 +146,14 @@ class AgentTableSerializer(serializers.ModelSerializer):
 | 
				
			|||||||
            "plat",
 | 
					            "plat",
 | 
				
			||||||
            "goarch",
 | 
					            "goarch",
 | 
				
			||||||
            "has_patches_pending",
 | 
					            "has_patches_pending",
 | 
				
			||||||
 | 
					            "version",
 | 
				
			||||||
 | 
					            "operating_system",
 | 
				
			||||||
 | 
					            "public_ip",
 | 
				
			||||||
 | 
					            "cpu_model",
 | 
				
			||||||
 | 
					            "graphics",
 | 
				
			||||||
 | 
					            "local_ips",
 | 
				
			||||||
 | 
					            "make_model",
 | 
				
			||||||
 | 
					            "physical_disks",
 | 
				
			||||||
        ]
 | 
					        ]
 | 
				
			||||||
        depth = 2
 | 
					        depth = 2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -30,6 +30,7 @@ from scripts.models import Script
 | 
				
			|||||||
from scripts.tasks import handle_bulk_command_task, handle_bulk_script_task
 | 
					from scripts.tasks import handle_bulk_command_task, handle_bulk_script_task
 | 
				
			||||||
from tacticalrmm.constants import (
 | 
					from tacticalrmm.constants import (
 | 
				
			||||||
    AGENT_DEFER,
 | 
					    AGENT_DEFER,
 | 
				
			||||||
 | 
					    AGENT_TABLE_DEFER,
 | 
				
			||||||
    AGENT_STATUS_OFFLINE,
 | 
					    AGENT_STATUS_OFFLINE,
 | 
				
			||||||
    AGENT_STATUS_ONLINE,
 | 
					    AGENT_STATUS_ONLINE,
 | 
				
			||||||
    AgentHistoryType,
 | 
					    AgentHistoryType,
 | 
				
			||||||
@@ -115,7 +116,7 @@ class GetAgents(APIView):
 | 
				
			|||||||
                Agent.objects.filter_by_role(request.user)  # type: ignore
 | 
					                Agent.objects.filter_by_role(request.user)  # type: ignore
 | 
				
			||||||
                .filter(monitoring_type_filter)
 | 
					                .filter(monitoring_type_filter)
 | 
				
			||||||
                .filter(client_site_filter)
 | 
					                .filter(client_site_filter)
 | 
				
			||||||
                .defer(*AGENT_DEFER)
 | 
					                .defer(*AGENT_TABLE_DEFER)
 | 
				
			||||||
                .select_related(
 | 
					                .select_related(
 | 
				
			||||||
                    "site__server_policy",
 | 
					                    "site__server_policy",
 | 
				
			||||||
                    "site__workstation_policy",
 | 
					                    "site__workstation_policy",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -240,6 +240,14 @@ AGENT_DEFER = (
 | 
				
			|||||||
    "modified_time",
 | 
					    "modified_time",
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					AGENT_TABLE_DEFER = (
 | 
				
			||||||
 | 
					    "services",
 | 
				
			||||||
 | 
					    "created_by",
 | 
				
			||||||
 | 
					    "created_time",
 | 
				
			||||||
 | 
					    "modified_by",
 | 
				
			||||||
 | 
					    "modified_time",
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ONLINE_AGENTS = (
 | 
					ONLINE_AGENTS = (
 | 
				
			||||||
    "pk",
 | 
					    "pk",
 | 
				
			||||||
    "agent_id",
 | 
					    "agent_id",
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user