Просмотр исходного кода

add history recording stop func

2du 4 лет назад
Родитель
Сommit
f34b467816
4 измененных файлов с 23 добавлено и 7 удалено
  1. 1 0
      lang/en-US.json
  2. 2 1
      lang/ko-KR.json
  3. 15 6
      route/main_func_setting_main.py
  4. 5 0
      route/tool/func.py

+ 1 - 0
lang/en-US.json

@@ -298,6 +298,7 @@
                 "password_min_length" : "Password minimum length",
                 "set_wiki_access_password_need" : "Password required for wiki access",
                 "set_wiki_access_password" : "Wiki access password",
+                "set_history_recording_off" : "Stop recording history",
             "_comment_2.2.3_" : "Text",
                 "register_text" : "Terms of sign-up",
                 "non_login_alert" : "Non-login alert",

+ 2 - 1
lang/ko-KR.json

@@ -452,5 +452,6 @@
     "phrase_user_page_owner": "소유자인 사용자 문서 문구",
     "error_password_require_for_wiki_access": "위키에 접속하려면 비밀번호가 필요합니다.",
     "set_wiki_access_password_need": "위키 접속시 비밀번호 필요",
-    "set_wiki_access_password": "위키 접속 비밀번호"
+    "set_wiki_access_password": "위키 접속 비밀번호",
+    "set_history_recording_off" : "역사 기록 중지"
 }

+ 15 - 6
route/main_func_setting_main.py

@@ -33,7 +33,8 @@ def main_func_setting_main(db_set):
             29 : ['title_topic_max_length', ''],
             30 : ['password_min_length', ''],
             31 : ['wiki_access_password_need', ''],
-            32 : ['wiki_access_password', '']
+            32 : ['wiki_access_password', ''],
+            33 : ['history_recording_off', '']
         }
 
         if flask.request.method == 'POST':
@@ -62,6 +63,8 @@ def main_func_setting_main(db_set):
 
             init_set_list = get_init_set_list()
                 
+            # 언어도 변경 가능하도록 필요
+                
             encode_select = ''
             encode_select_data = init_set_list['encode']['list'] + ['sha256']
             for encode_select_one in encode_select_data:
@@ -78,7 +81,7 @@ def main_func_setting_main(db_set):
                 else:
                     tls_select += '<option value="' + tls_select_one + '">' + tls_select_one + '</option>'
 
-            check_box_div = ['', '', '', '', '', '', '', '', '']
+            check_box_div = ['', '', '', '', '', '', '', '', '', '']
             for i in range(0, len(check_box_div)):
                 if i == 0:
                     acl_num = 7
@@ -96,6 +99,8 @@ def main_func_setting_main(db_set):
                     acl_num = 26
                 elif i == 8:
                     acl_num = 31
+                elif i == 9:
+                    acl_num = 33
 
                 if d_list[acl_num]:
                     check_box_div[i] = 'checked="checked"'
@@ -194,10 +199,6 @@ def main_func_setting_main(db_set):
                         <input name="password_min_length" value="''' + html.escape(d_list[30]) + '''">
                         
                         <h2>4. ''' + load_lang('server_set') + '''</h2>
-                        <span>''' + load_lang('max_file_size') + ''' (MB)</span>
-                        <hr class="main_hr">
-                        <input name="upload" value="''' + html.escape(d_list[4]) + '''">
-                        <hr class="main_hr">
 
                         <span>''' + load_lang('update_branch') + '''</span>
                         <hr class="main_hr">
@@ -242,6 +243,14 @@ def main_func_setting_main(db_set):
                         <hr class="main_hr">
                         <input name="title_topic_max_length" value="''' + html.escape(d_list[29]) + '''">
                         <hr class="main_hr">
+                        
+                        <span>''' + load_lang('max_file_size') + ''' (MB)</span>
+                        <hr class="main_hr">
+                        <input name="upload" value="''' + html.escape(d_list[4]) + '''">
+                        <hr class="main_hr">
+                        
+                        <input type="checkbox" name="history_recording_off" ''' + check_box_div[9] + '''> ''' + load_lang('set_history_recording_off') + ''' (''' + load_lang('beta') + ''')
+                        <hr class="main_hr">
 
                         <button id="save" type="submit">''' + load_lang('save') + '''</button>
                     </form>

+ 5 - 0
route/tool/func.py

@@ -2029,6 +2029,11 @@ def rd_plus(topic_num, date, name = None, sub = None):
 
 def history_plus(title, data, date, ip, send, leng, t_check = '', mode = ''):
     curs = conn.cursor()
+    
+    curs.execute(db_change('select data from other where name = "history_recording_off"'))
+    db_data = curs.fetchall()
+    if db_data and db_data[0][0] != '':
+        return 0
 
     if mode == 'add':
         curs.execute(db_change(