Skip to content

Commit df7d04c

Browse files
committed
chg: [search engine images description] show image
1 parent 3d35cf2 commit df7d04c

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

bin/lib/objects/Domains.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,8 @@ def get_meta(self, options=set(), flask_context=False):
237237
meta['languages'] = self.get_languages()
238238
if 'screenshot' in options:
239239
meta['screenshot'] = self.get_screenshot()
240+
if 'img' in options:
241+
meta['img'] = self.get_screenshot()
240242
if 'tags_safe' in options:
241243
meta['is_tags_safe'] = self.is_tags_safe(meta['tags'])
242244
if 'link' in options:

bin/lib/search_engine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ def api_search_images(data):
338338
else:
339339
continue # TODO ERROR
340340
# domain
341-
meta = obj.get_meta(options={'link'})
341+
meta = obj.get_meta(options={'link', 'tags_safe'})
342342
meta['result'] = res['_formatted']['content']
343343
objs.append(meta)
344344
return (objs, pagination), 200

var/www/templates/search/search_description_images.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@
1919
<script src="{{ url_for('static', filename='js/dataTables.bootstrap.min.js')}}"></script>
2020
<script src="{{ url_for('static', filename='js/helper.js')}}"></script>
2121

22+
<style>
23+
.object_image {
24+
max-width: 50%;
25+
filter: blur(5px);
26+
}
27+
</style>
28+
2229
</head>
2330
<body>
2431

@@ -33,6 +40,10 @@
3340

3441
{% include 'search/block_description_images_search.html' %}
3542

43+
<span class="mt-3">
44+
{% include 'objects/image/block_blur_img_slider.html' %}
45+
</span>
46+
3647
{% if result %}
3748
{% set endpoint_url = url_for('search_b.search_crawled') + "?search=" + to_search + "&index=" + search_index %}
3849
{% include 'search/pagination.html' %}
@@ -56,6 +67,19 @@ <h5>
5667

5768
<pre class="border">{{ obj['result'] }}</pre>
5869

70+
{% if obj['tags_safe'] %}
71+
{% if obj['type'] == 'image' %}
72+
<img class="object_image mb-1" src="{{ url_for('objects_image.image', filename=obj['img']) }}" loading="lazy">
73+
{% if obj['type'] == 'screenshot' or obj['type'] == 'domain'%}
74+
<img class="object_image mb-1" src="{{ url_for('objects_item.screenshot', filename=obj['img']) }}" loading="lazy">
75+
{% endif %}
76+
{% else %}
77+
<span class="my-2 fa-stack fa-8x">
78+
<i class="fas fa-stack-1x fa-image"></i>
79+
<i class="fas fa-stack-2x fa-ban" style="color:Red"></i>
80+
</span>
81+
{% endif %}
82+
5983
</div>
6084
</div>
6185

0 commit comments

Comments
 (0)