Standarized the iptables parsed log
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -18,6 +18,7 @@ from .utils.statistics import count_clients, count_traffic, count_connection, co
|
||||
from .utils.reqs_handler import req_edit_state, req_edit_user, req_apply_sys, req_ip_recommendation, reg_bulk, req_del_user, req_get_client
|
||||
from django.middleware.csrf import get_token
|
||||
from django.views.decorators.csrf import csrf_exempt
|
||||
from .iptable_parser.wrapper import line_process
|
||||
|
||||
class wgLogin(APIView):
|
||||
authentication_classes = [SessionAuthentication, BasicAuthentication]
|
||||
@@ -571,3 +572,26 @@ def wg_GetClient(request):
|
||||
req_commit = req_get_client(id)
|
||||
|
||||
return HttpResponse(json.dumps(req_commit['Client']), content_type='application')
|
||||
|
||||
@csrf_exempt
|
||||
@api_view(["GET"])
|
||||
#@permission_classes([IsAuthenticated])
|
||||
def wg_GetGraphData(request):
|
||||
if request.method == "GET":
|
||||
print(request)
|
||||
print("-> Bulk Registration")
|
||||
|
||||
print(request.body)
|
||||
print("-"*20)
|
||||
|
||||
nodes, edges = line_process()
|
||||
|
||||
final_data = {"nodes": nodes, "edges": edges}
|
||||
|
||||
#id = request.body.decode('utf-8')
|
||||
#id = request.GET.get("id")
|
||||
#id = json.loads(id)
|
||||
|
||||
#req_commit = req_get_client(id)
|
||||
|
||||
return HttpResponse(json.dumps(final_data), content_type='json')
|
||||
|
||||
Reference in New Issue
Block a user