Pass through more variables to the context modal and alter int handling
This commit is contained in:
parent
c9a17a6fa4
commit
1d2f37f588
|
@ -28,7 +28,9 @@
|
|||
"channel": "{{ channel }}",
|
||||
"time": "{{ time }}",
|
||||
"date": "{{ date }}",
|
||||
"index": "{{ index }}"}'
|
||||
"index": "{{ index }}",
|
||||
"type": "{{ type }}",
|
||||
"mtype": "{{ mtype }}"}'
|
||||
hx-target="#modal-context-table"
|
||||
hx-trigger="every 5s">
|
||||
</div>
|
||||
|
|
|
@ -223,7 +223,9 @@
|
|||
"channel": "{{ row.cells.channel|escapejs }}",
|
||||
"time": "{{ row.cells.time|escapejs }}",
|
||||
"date": "{{ row.cells.date|escapejs }}",
|
||||
"index": "{{ params.index }}"}'
|
||||
"index": "{{ params.index }}",
|
||||
"type": "{{ row.cells.type }}",
|
||||
"mtype": "{{ row.cells.mtype }}"}'
|
||||
hx-target="#modals-here"
|
||||
hx-trigger="click">
|
||||
{{ row.cells.msg }}
|
||||
|
|
|
@ -241,7 +241,6 @@ class DrilldownContextModal(APIView):
|
|||
|
||||
def post(self, request):
|
||||
if request.resolver_match.url_name == "modal_context_table":
|
||||
print("POST CONTEXT TABLE")
|
||||
self.template_name = "modals/context_table.html"
|
||||
|
||||
size = 20
|
||||
|
@ -255,8 +254,12 @@ class DrilldownContextModal(APIView):
|
|||
for key in mandatory:
|
||||
if key not in query_params:
|
||||
query_params[key] = None
|
||||
if query_params["index"] == "int":
|
||||
if "mtype" not in query_params:
|
||||
query_params["mtype"] = None
|
||||
query_params["sorting"] = "desc"
|
||||
|
||||
if query_params["index"] == "int" and query_params["mtype"] == "msg":
|
||||
query_params["index"] = "main"
|
||||
# Create the query with the context helper
|
||||
search_query = construct_query(
|
||||
query_params["index"],
|
||||
|
@ -287,8 +290,9 @@ class DrilldownContextModal(APIView):
|
|||
"date": query_params["date"],
|
||||
"index": query_params["index"],
|
||||
"num": query_params["num"],
|
||||
"type": query_params["type"],
|
||||
"mtype": query_params["mtype"],
|
||||
}
|
||||
print("CONTEXT", context)
|
||||
|
||||
return render(request, self.template_name, context)
|
||||
|
||||
|
|
Loading…
Reference in New Issue