n_list_recent_block.py 1.1 KB

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