2
0

main_sys_shutdown.py 850 B

1234567891011121314151617181920212223
  1. from .tool.func import *
  2. async def main_sys_shutdown():
  3. with get_db_connect() as conn:
  4. if await acl_check('', 'owner_auth', '', '') == 1:
  5. return await re_error(conn, 3)
  6. if flask.request.method == 'POST':
  7. await acl_check(tool = 'owner_auth', memo = 'shutdown')
  8. print('Shutdown')
  9. sys.exit()
  10. else:
  11. return easy_minify(flask.render_template(await skin_check(),
  12. imp = [await get_lang('wiki_shutdown'), await wiki_set(), await wiki_custom(), wiki_css([0, 0])],
  13. data = '''
  14. <form method="post">
  15. <button type="submit">''' + await get_lang('shutdown') + '''</button>
  16. </form>
  17. ''',
  18. menu = [['manager', await get_lang('return')]]
  19. ))