|
|
|
@ -253,7 +253,7 @@ class DrilldownContextModal(APIView):
|
|
|
|
|
size = 20
|
|
|
|
|
nicks = None
|
|
|
|
|
# Create the query params from the POST arguments
|
|
|
|
|
mandatory = ["net", "channel", "num", "src", "index", "nick"]
|
|
|
|
|
mandatory = ["net", "channel", "num", "src", "index", "nick", "type"]
|
|
|
|
|
invalid = [None, False, "—", "None"]
|
|
|
|
|
query_params = {k: v for k, v in request.data.items() if v}
|
|
|
|
|
for key in query_params:
|
|
|
|
@ -275,6 +275,13 @@ class DrilldownContextModal(APIView):
|
|
|
|
|
and not query_params["type"] == "query"
|
|
|
|
|
):
|
|
|
|
|
query_params["index"] = "main"
|
|
|
|
|
|
|
|
|
|
type = None
|
|
|
|
|
if "type" in query_params:
|
|
|
|
|
type = query_params["type"]
|
|
|
|
|
if type == "znc":
|
|
|
|
|
query_params["channel"] = "*status"
|
|
|
|
|
|
|
|
|
|
# Create the query with the context helper
|
|
|
|
|
search_query = construct_query(
|
|
|
|
|
query_params["index"],
|
|
|
|
@ -283,10 +290,16 @@ class DrilldownContextModal(APIView):
|
|
|
|
|
query_params["src"],
|
|
|
|
|
query_params["num"],
|
|
|
|
|
size,
|
|
|
|
|
type=type,
|
|
|
|
|
nicks=nicks,
|
|
|
|
|
)
|
|
|
|
|
annotate = False
|
|
|
|
|
if query_params["src"] == "irc":
|
|
|
|
|
if query_params["type"] in ["query", "notice", "msg", "highlight"]:
|
|
|
|
|
annotate = True
|
|
|
|
|
|
|
|
|
|
results = query_results(
|
|
|
|
|
request, query_params, annotate=True, custom_query=search_query
|
|
|
|
|
request, query_params, annotate=annotate, custom_query=search_query
|
|
|
|
|
)
|
|
|
|
|
if "message" in results:
|
|
|
|
|
return render(request, self.template_name, results)
|
|
|
|
|