Няма описание

overview_routes.py 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. # IRIS Source Code
  2. # Copyright (C) 2024 - DFIR-IRIS
  3. # contact@dfir-iris.org
  4. #
  5. # This program is free software; you can redistribute it and/or
  6. # modify it under the terms of the GNU Lesser General Public
  7. # License as published by the Free Software Foundation; either
  8. # version 3 of the License, or (at your option) any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. # Lesser General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU Lesser General Public License
  16. # along with this program; if not, write to the Free Software Foundation,
  17. # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  18. from flask import Blueprint
  19. from flask import request
  20. from flask_login import current_user
  21. from app.datamgmt.overview.overview_db import get_overview_db
  22. from app.blueprints.access_controls import ac_api_requires
  23. from app.blueprints.responses import response_success
  24. overview_rest_blueprint = Blueprint('overview_rest', __name__)
  25. @overview_rest_blueprint.route('/overview/filter', methods=['GET'])
  26. @ac_api_requires()
  27. def get_overview_filter():
  28. """Return an overview of the cases"""
  29. show_full = request.args.get('show_closed', 'false') == 'true'
  30. overview = get_overview_db(current_user.id, show_full)
  31. return response_success('', data=overview)