list_admin.py 726 B

123456789101112131415161718192021222324252627
  1. from .tool.func import *
  2. async def list_admin():
  3. with get_db_connect() as conn:
  4. curs = conn.cursor()
  5. div = '<ul>'
  6. curs.execute(db_change(
  7. "select id, data from user_set where name = 'acl' and not data = 'user'"
  8. ))
  9. for data in curs.fetchall():
  10. name = '' + \
  11. await ip_pas(data[0]) + ' ' + \
  12. '<a href="/auth/list/add/' + url_pas(data[1]) + '">(' + data[1] + ')</a>' + \
  13. ''
  14. div += '<li>' + name + '</li>'
  15. div += '</ul>'
  16. return await render_template(
  17. await get_lang('admin_list'),
  18. div,
  19. 0,
  20. [['other', await get_lang('return')]]
  21. )