| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- from .tool.func import *
- from .edit import edit_editor
- async def recent_history_add(name = 'Test', do_type = ''):
- with get_db_connect() as conn:
- curs = conn.cursor()
- ip = ip_check()
- if await acl_check('', 'owner_auth', '', '') == 1:
- return await re_error(conn, 0)
- if flask.request.method == 'POST':
- await acl_check(tool = 'owner_auth', memo = 'history_add (' + name + ')')
- today = get_time()
- content = flask.request.form.get('content', '')
- leng = '+' + str(len(content))
- history_plus(conn,
- name,
- content,
- today,
- 'Add:' + flask.request.form.get('get_ip', ''),
- flask.request.form.get('send', ''),
- leng,
- mode = 'add'
- )
- return redirect(conn, '/history/' + url_pas(name))
- else:
- return await render_template(
- await get_lang('history_add'),
- '''
- <form method="post">
- <input class="__ON_INPUT__" placeholder="''' + await get_lang('why') + '''" name="send">
- <hr class="main_hr">
-
- <input class="__ON_INPUT__" placeholder="''' + await get_lang('name') + '''" name="get_ip">
- <hr class="main_hr">
- ''' + await edit_editor(conn, ip) + '''
- </form>
- ''',
- '(' + name + ')',
- [['history/' + url_pas(name), await get_lang('return')]]
- )
|