From ce39df8f835e4bedab79558cee1d886e06acdd22 Mon Sep 17 00:00:00 2001 From: Florian Perucki Date: Tue, 20 Oct 2015 17:39:51 +0200 Subject: [PATCH 1/2] Allow filtering on queue, task path and exception type using regex --- mrq/dashboard/app.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mrq/dashboard/app.py b/mrq/dashboard/app.py index 4eebfc0c..d3c69eee 100644 --- a/mrq/dashboard/app.py +++ b/mrq/dashboard/app.py @@ -6,6 +6,7 @@ import time import os import sys +import re from bson import ObjectId import json import argparse @@ -127,7 +128,7 @@ def build_api_datatables_query(req): for param in ["queue", "path", "exceptiontype"]: if req.args.get(param): - query[param] = req.args.get(param) + query[param] = re.compile("^"+req.args.get(param)+"$") if req.args.get("status"): statuses = req.args["status"].split("-") if len(statuses) == 1: From b9abd54c1d905af1aacb550cd2efed5841a4b76d Mon Sep 17 00:00:00 2001 From: Florian Perucki Date: Tue, 20 Oct 2015 17:54:58 +0200 Subject: [PATCH 2/2] Filter search using regex only when '*' is detected --- mrq/dashboard/app.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mrq/dashboard/app.py b/mrq/dashboard/app.py index d3c69eee..27276f36 100644 --- a/mrq/dashboard/app.py +++ b/mrq/dashboard/app.py @@ -128,7 +128,11 @@ def build_api_datatables_query(req): for param in ["queue", "path", "exceptiontype"]: if req.args.get(param): - query[param] = re.compile("^"+req.args.get(param)+"$") + if "*" in req.args.get(param): + query[param] = re.compile("^"+req.args.get(param)+"$") + else: + query[param] = req.args.get(param) + if req.args.get("status"): statuses = req.args["status"].split("-") if len(statuses) == 1: