mirror of
https://github.com/house-of-vanity/OutFleet.git
synced 2025-08-21 14:37:16 +00:00
Added keys count on outline page.
This commit is contained in:
@@ -33,7 +33,6 @@ class ServerAdmin(PolymorphicParentModelAdmin):
|
||||
status = obj.get_server_status()
|
||||
if 'error' in status:
|
||||
return mark_safe(f"<span style='color: red;'>Error: {status['error']}</span>")
|
||||
# Преобразуем JSON в красивый формат
|
||||
import json
|
||||
pretty_status = ", ".join(f"{key}: {value}" for key, value in status.items())
|
||||
return mark_safe(f"<pre>{pretty_status}</pre>")
|
||||
|
@@ -73,7 +73,9 @@ class OutlineServer(Server):
|
||||
if raw:
|
||||
status = info
|
||||
else:
|
||||
keys = self.client.get_keys()
|
||||
status.update(info)
|
||||
status.update({"keys": len(keys)})
|
||||
except Exception as e:
|
||||
status.update({f"error": e})
|
||||
return status
|
||||
|
@@ -1,6 +1,14 @@
|
||||
from django.shortcuts import get_object_or_404
|
||||
from django.http import JsonResponse
|
||||
from django.http import HttpResponse
|
||||
|
||||
def print_headers(request):
|
||||
headers = {key: value for key, value in request.META.items() if key.startswith('HTTP_')}
|
||||
|
||||
for key, value in headers.items():
|
||||
print(f'{key}: {value}')
|
||||
|
||||
return HttpResponse(f"Headers: {headers}")
|
||||
|
||||
def shadowsocks(request, link):
|
||||
from .models import ACL
|
||||
|
Reference in New Issue
Block a user