chg: [crawler cookies] use cookiejar

This commit is contained in:
Terrtia 2020-03-26 09:53:07 +01:00
parent d87ecff4a0
commit 1ce7b7c2a0
No known key found for this signature in database
GPG key ID: 1E1B1F50D84613D0
2 changed files with 43 additions and 0 deletions

View file

@ -170,6 +170,28 @@ def domains_explorer_web():
dict_data = Domain.get_domains_up_by_filers('regular', page=page, date_from=date_from, date_to=date_to)
return render_template("domain_explorer.html", dict_data=dict_data, bootstrap_label=bootstrap_label, domain_type='regular')
## Cookiejar ##
@crawler_splash.route('/crawler/cookiejar/add', methods=['GET'])
#@login_required
#@login_analyst
def crawler_cookiejar_add():
return render_template("add_cookiejar.html")
@crawler_splash.route('/crawler/cookiejar/all', methods=['GET'])
#@login_required
#@login_read_only
def crawler_cookies_all():
user_id = current_user.get_id()
user_cookiejar = crawlers.get_all_user_cookies_metadata(user_id)
global_cookiejar = crawlers.get_all_global_cookies_metadata()
return render_template("all_cookies.html", user_cookies=user_cookies, global_cookies=global_cookies)
## - - ##
@crawler_splash.route('/crawler/cookies/add', methods=['GET'])
#@login_required
#@login_analyst

View file

@ -84,4 +84,25 @@
</li>
</ul>
</nav>
<h5 class="d-flex text-muted w-100" id="nav_title_cookies">
<span>Cookiejar </span>
<a class="ml-auto" href="{{url_for('crawler_splash.crawler_cookies_add')}}">
<i class="fas fa-plus-circle ml-auto"></i>
</a>
</h5>
<ul class="nav flex-md-column flex-row navbar-nav justify-content-between w-100">
<li class="nav-item">
<a class="nav-link" href="{{url_for('crawler_splash.crawler_cookiejar_add')}}" id="nav_cookiejar_add">
<i class="fas fa-cookie"></i>
<span>Add Cookiejar</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{url_for('crawler_splash.crawler_cookies_all')}}" id="nav_cookiejar_all">
<i class="fas fa-cookie-bite"></i>
<span>All Cookiejar</span>
</a>
</li>
</ul>
</div>