n_list_recent_block.py 1.2 KB

123456789101112131415161718192021222324252627
  1. from .tool.func import *
  2. async def list_recent_block(user_name = 'Test', tool = 'all', num = 1, why = ''):
  3. with get_db_connect() as conn:
  4. sub = 0
  5. if tool == 'ongoing':
  6. sub = '(' + get_lang(conn, 'in_progress') + ')'
  7. elif tool == 'regex':
  8. sub = '(' + get_lang(conn, 'regex') + ')'
  9. elif tool == 'user':
  10. sub = '(' + get_lang(conn, 'blocked') + ')'
  11. elif tool == 'cidr':
  12. sub = '(' + get_lang(conn, 'cidr') + ')'
  13. elif tool == 'private':
  14. sub = '(' + get_lang(conn, 'private') + ')'
  15. elif tool == 'admin':
  16. sub = '(' + get_lang(conn, 'admin') + ')'
  17. return easy_minify(conn, flask.render_template(skin_check(conn),
  18. imp = [get_lang(conn, 'recent_ban'), await wiki_set(), await wiki_custom(conn), wiki_css([sub, 0])],
  19. data = '' + \
  20. '<div id="opennamu_list_recent_block"></div>' + \
  21. '<script defer src="/views/main_css/js/route/list_recent_block.js' + cache_v() + '"></script>' + \
  22. '<script>window.addEventListener("DOMContentLoaded", function() { opennamu_list_recent_block(); });</script>' + \
  23. '',
  24. menu = [['other', get_lang(conn, 'return')]]
  25. ))