Add disk usage statistics
- add model CustomerPackageDiskUsage for hosting package disk usage statistics - add REST API endpoint for submittings statistics for disk, mysql and pgsql usage - add disk usage information to hosting package detail view - add separate hosting package disk usage statistic view
This commit is contained in:
parent
affb49a971
commit
cb62bd63e2
10 changed files with 379 additions and 16 deletions
|
@ -12,6 +12,7 @@ from .models import (
|
|||
CustomerHostingPackage,
|
||||
CustomerHostingPackageDomain,
|
||||
CustomerMailboxOption,
|
||||
CustomerPackageDiskUsage,
|
||||
CustomerUserDatabaseOption,
|
||||
DiskSpaceOption,
|
||||
HostingPackageTemplate,
|
||||
|
@ -95,6 +96,18 @@ class CustomerHostingPackageDomainInline(admin.TabularInline):
|
|||
extra = 0
|
||||
|
||||
|
||||
class CustomerPackageDiskUsageInline(admin.TabularInline):
|
||||
model = CustomerPackageDiskUsage
|
||||
ordering = ["-used_kb", "source", "item"]
|
||||
fields = ["source", "item", "used_kb"]
|
||||
readonly_fields = ["source", "item", "used_kb"]
|
||||
extra = 0
|
||||
can_delete = False
|
||||
|
||||
def has_add_permission(self, request, obj):
|
||||
return False
|
||||
|
||||
|
||||
class CustomerHostingPackageAdmin(admin.ModelAdmin):
|
||||
"""
|
||||
This class implements the admin interface for
|
||||
|
@ -110,6 +123,7 @@ class CustomerHostingPackageAdmin(admin.ModelAdmin):
|
|||
CustomerMailboxOptionInline,
|
||||
CustomerUserDatabaseOptionInline,
|
||||
CustomerHostingPackageDomainInline,
|
||||
CustomerPackageDiskUsageInline,
|
||||
]
|
||||
list_display = ["name", "customer", "osuser"]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue