From ccea5f26592cb288a7046d3241dc0fb24eb3b650 Mon Sep 17 00:00:00 2001 From: NexusGKSoftwares Date: Sun, 1 Dec 2024 17:30:58 +0300 Subject: [PATCH] "Added SystemHealth model to admin panel with list display, filtering, and search fields" --- admin_panel/admin.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/admin_panel/admin.py b/admin_panel/admin.py index 8c38f3f..42f4421 100644 --- a/admin_panel/admin.py +++ b/admin_panel/admin.py @@ -1,3 +1,8 @@ from django.contrib import admin +from .models import SystemHealth -# Register your models here. +@admin.register(SystemHealth) +class SystemHealthAdmin(admin.ModelAdmin): + list_display = ('timestamp', 'cpu_usage', 'memory_usage', 'disk_space') + list_filter = ('timestamp',) + search_fields = ('timestamp',)