2022-10-02 20:18:05 +09:00
{% extends "base.html" %}
{% block content %}
< div >
{{ macros.m_button_group([['globalSettingSaveBtn', '설정 저장']])}}
{{ macros.m_row_start('5') }}
{{ macros.m_row_end() }}
2022-10-07 15:11:05 +09:00
2022-10-02 20:18:05 +09:00
< nav >
{{ macros.m_tab_head_start() }}
{{ macros.m_tab_head2('basic', 'Basic', true) }}
{{ macros.m_tab_head2('advanced', 'Advanced', false) }}
{{ macros.m_tab_head_end() }}
< / nav >
< form id = 'setting' name = 'setting' >
< div class = "tab-content" id = "nav-tabContent" >
{{ macros.m_tab_content_start('basic', true) }}
{{ macros.setting_checkbox('notify_telegram_use', '텔레그램 사용', value=arg['notify_telegram_use']) }}
< div id = "notify_telegram_use_div" class = "collapse" >
{{ macros.setting_input_text('notify_telegram_token', 'Bot Token', value=arg['notify_telegram_token']) }}
{{ macros.setting_input_text('notify_telegram_chat_id', 'My Chat ID', value=arg['notify_telegram_chat_id'], col='3') }}
{{ macros.setting_checkbox('notify_telegram_disable_notification', '알람 Disable', value=arg['notify_telegram_disable_notification'], desc='On : 알람 소리 없이 메시지를 수신합니다.') }}
2022-10-07 01:48:42 +09:00
{{ macros.setting_input_text_and_buttons('tmp_text_telegram', 'Test', [['tmp_telegram_test_btn', '전송']], value='테스트 메시지입니다.', col='9', desc=['사용자가 먼저 봇과 대화를 시작하여 대화창이 생성된 상태여야 합니다.', '(대화창이 있을 경우에만 알림 수신)']) }}
2022-10-02 20:18:05 +09:00
< / div >
2022-10-07 01:48:42 +09:00
2022-10-02 20:18:05 +09:00
{{ macros.m_hr() }}
2022-10-07 01:48:42 +09:00
2022-10-02 20:18:05 +09:00
{{ macros.setting_checkbox('notify_discord_use', '디스코드 사용', value=arg['notify_discord_use']) }}
< div id = "notify_discord_use_div" class = "collapse" >
{{ macros.setting_input_text('notify_discord_webhook', '웹훅', value=arg['notify_discord_webhook']) }}
{{ macros.setting_input_text_and_buttons('tmp_text_discord', 'Test', [['tmp_discord_test_btn', '전송']], value='테스트 메시지입니다.', col='9') }}
< / div >
{{ macros.m_tab_content_end() }}
{{ macros.m_tab_content_start('advanced', false) }}
2022-10-07 01:48:42 +09:00
{{ macros.setting_checkbox('notify_advaned_use', '사용', value=arg['notify_advaned_use'], desc=['사용시 기본설정은 무시됩니다.']) }}
2022-10-02 20:18:05 +09:00
< div id = "notify_advaned_use_div" class = "collapse" >
2022-10-07 01:48:42 +09:00
{{ macros.info_text_and_buttons('notify_yaml_filepath', '파일 위치', [['globalEditBtn', '편집기에서 열기', [('file',arg['notify_yaml_filepath'])]]], value=arg['notify_yaml_filepath']) }}
{{ macros.setting_input_textarea('notify.yaml', '정책', value=arg['notify.yaml'], row='20') }}
2022-10-02 20:18:05 +09:00
{{ macros.setting_input_text('tmp_message_id', 'Test Message ID', value='DEFAULT') }}
2022-10-07 01:48:42 +09:00
{{ macros.setting_input_text_and_buttons('tmp_text_advanced', 'Test', [['tmp_advanced_test_btn', '전송']], value='테스트 메시지입니다.', col='9', desc=['저장 후 적용됩니다.']) }}
2022-10-02 20:18:05 +09:00
< / div >
{{ macros.m_tab_content_end() }}
< / div > <!-- tab - content -->
< / form >
< / div > <!-- 전체 -->
< script type = "text/javascript" >
$ ( document ) . ready ( function ( ) {
use _collapse ( "notify_telegram_use" ) ;
use _collapse ( "notify_discord_use" ) ;
use _collapse ( "notify_advaned_use" ) ;
} ) ;
$ ( '#notify_telegram_use' ) . change ( function ( ) {
use _collapse ( 'notify_telegram_use' ) ;
} ) ;
$ ( '#notify_discord_use' ) . change ( function ( ) {
use _collapse ( 'notify_discord_use' ) ;
} ) ;
$ ( '#notify_advaned_use' ) . change ( function ( ) {
use _collapse ( 'notify_advaned_use' ) ;
} ) ;
$ ( "body" ) . on ( 'click' , '#tmp_telegram_test_btn' , function ( e ) {
e . preventDefault ( ) ;
2022-10-07 01:48:42 +09:00
param = $ ( '#notify_telegram_token' ) . val ( ) + '||' + $ ( '#notify_telegram_chat_id' ) . val ( ) + '||' + $ ( '#notify_telegram_disable_notification' ) . is ( ":checked" ) + '||' + $ ( '#tmp_text_telegram' ) . val ( ) ;
globalSendCommand ( 'notify_test' , 'telegram' , param ) ;
2022-10-02 20:18:05 +09:00
} ) ;
$ ( "body" ) . on ( 'click' , '#tmp_discord_test_btn' , function ( e ) {
e . preventDefault ( ) ;
2022-10-07 01:48:42 +09:00
globalSendCommand ( 'notify_test' , 'discord' , $ ( '#notify_discord_webhook' ) . val ( ) , $ ( '#tmp_text_discord' ) . val ( ) ) ;
2022-10-02 20:18:05 +09:00
} ) ;
$ ( "body" ) . on ( 'click' , '#tmp_advanced_test_btn' , function ( e ) {
e . preventDefault ( ) ;
2022-10-07 01:48:42 +09:00
globalSendCommand ( 'notify_test' , 'advanced' , $ ( '#tmp_message_id' ) . val ( ) , $ ( '#tmp_text_advanced' ) . val ( ) ) ;
2022-10-02 20:18:05 +09:00
} ) ;
< / script >
{% endblock %}