mirror of
https://github.com/house-of-vanity/OutFleet.git
synced 2025-08-21 14:37:16 +00:00
Added TG bot
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import logging
|
||||
from django.db import models
|
||||
from django.contrib import admin
|
||||
from polymorphic.admin import PolymorphicChildModelAdmin
|
||||
from .generic import Server
|
||||
from vpn.models_xray import Inbound, UserSubscription
|
||||
|
||||
@@ -778,7 +779,9 @@ class ServerInboundInline(admin.TabularInline):
|
||||
return super().formfield_for_foreignkey(db_field, request, **kwargs)
|
||||
|
||||
|
||||
class XrayServerV2Admin(admin.ModelAdmin):
|
||||
class XrayServerV2Admin(PolymorphicChildModelAdmin):
|
||||
base_model = XrayServerV2
|
||||
show_in_index = False
|
||||
list_display = ['name', 'client_hostname', 'api_address', 'api_enabled', 'stats_enabled', 'registration_date']
|
||||
list_filter = ['api_enabled', 'stats_enabled', 'registration_date']
|
||||
search_fields = ['name', 'client_hostname', 'comment']
|
||||
@@ -944,4 +947,8 @@ class XrayServerV2Admin(admin.ModelAdmin):
|
||||
except Exception as e:
|
||||
return f"Error fetching statistics: {str(e)}"
|
||||
|
||||
traffic_statistics.short_description = 'Traffic Statistics'
|
||||
traffic_statistics.short_description = 'Traffic Statistics'
|
||||
|
||||
|
||||
# Register the admin class
|
||||
admin.site.register(XrayServerV2, XrayServerV2Admin)
|
Reference in New Issue
Block a user