From def247c306ef712d22de57e73dd41aafc87a821d Mon Sep 17 00:00:00 2001 From: qwe852 Date: Mon, 29 Jan 2018 13:43:51 +0800 Subject: [PATCH 1/2] 1. Modify clio.py and feeds.html to support search --- server/mhn/common/clio.py | 5 +++++ server/mhn/templates/ui/feeds.html | 25 +++++++++++++++++++------ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/server/mhn/common/clio.py b/server/mhn/common/clio.py index 385fc2aa..5b51d0ce 100644 --- a/server/mhn/common/clio.py +++ b/server/mhn/common/clio.py @@ -90,6 +90,11 @@ def _clean_query(cls, dirty): '$gte': datetime.datetime.utcnow() - datetime.timedelta(hours=int(dirty['hours_ago'])) } + if 'payload' in dirty and 'payload' in clean: + queryObj = 'payload.' + dirty.get('column') + clean[queryObj] = dirty.get('payload') + del clean['payload'] + return clean @classmethod diff --git a/server/mhn/templates/ui/feeds.html b/server/mhn/templates/ui/feeds.html index 6f58feb6..15819948 100644 --- a/server/mhn/templates/ui/feeds.html +++ b/server/mhn/templates/ui/feeds.html @@ -15,23 +15,36 @@

Search Filters

-
+
-
+
+ +
+
+
+ +
-
- {% for c in channel_list %} {% endfor %}
+
+ +
- +
@@ -54,7 +67,7 @@

Search Filters

{% for feed in feeds.items %} {% for field in columns %} - {{ feed[field] }} + {{ feed[field] }} {% endfor %} {% endfor %} From 8699b00c14d350b66f2b10eef08db3834951235d Mon Sep 17 00:00:00 2001 From: qwe852 Date: Mon, 29 Jan 2018 13:48:20 +0800 Subject: [PATCH 2/2] remove space from feeds.html --- server/mhn/templates/ui/feeds.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/mhn/templates/ui/feeds.html b/server/mhn/templates/ui/feeds.html index 15819948..f9d906bb 100644 --- a/server/mhn/templates/ui/feeds.html +++ b/server/mhn/templates/ui/feeds.html @@ -67,7 +67,7 @@

Search Filters

{% for feed in feeds.items %} {% for field in columns %} - {{ feed[field] }} + {{ feed[field] }} {% endfor %} {% endfor %}