Kaynağa Gözat

Merge pull request #2359 from openNAMU/dev

게시판 이름 변경 및 버그 수정
잉여개발기 1 yıl önce
ebeveyn
işleme
fe66fe6f49

+ 2 - 2
route/go_api_bbs_w_set.py

@@ -1,9 +1,9 @@
 from .tool.func import *
 
-async def api_bbs_w_set(name = 'Test', set_id = '1'):
+async def api_bbs_w_set(name = 'Test', bbs_num = 1):
     other_set = {}
     other_set["set_name"] = name
-    other_set["set_id"] = set_id
+    other_set["set_id"] = str(bbs_num)
     other_set["ip"] = ip_check()
 
     func_name = sys._getframe().f_code.co_name

+ 1 - 1
route/tool/func.py

@@ -1256,7 +1256,7 @@ def skin_check(conn, set_n = 0):
         return skin
     
 def cache_v():
-    return '.cache_v274'
+    return '.cache_v275'
 
 def wiki_css(data):
     with class_temp_db() as m_conn:

BIN
route_go/bin/main.amd64.bin


BIN
route_go/bin/main.amd64.exe


BIN
route_go/bin/main.arm64.bin


BIN
route_go/bin/main.arm64.exe


+ 1 - 1
route_go/route/api_bbs_w_set.go

@@ -43,7 +43,7 @@ func Api_bbs_w_set(call_arg []string) string {
 			}
 		}
 
-		stmt, err := db.Prepare(tool.DB_change("select set_data, set_code from other where set_name = ? and set_id = ?"))
+		stmt, err := db.Prepare(tool.DB_change("select set_data, set_code from bbs_set where set_name = ? and set_id = ?"))
 		if err != nil {
 			log.Fatal(err)
 		}

+ 1 - 1
route_go/route/api_bbs_w_set_put.go

@@ -42,7 +42,7 @@ func Api_bbs_w_set_put(call_arg []string) string {
 			}
 			defer stmt.Close()
 
-			_, err = stmt.Exec(other_set["set_name"], other_set["data"], other_set["set_id"])
+			_, err = stmt.Exec(other_set["set_name"], other_set["set_id"], other_set["data"])
 			if err != nil {
 				log.Fatal(err)
 			}

+ 1 - 1
version.json

@@ -1,6 +1,6 @@
 {
     "beta" : {
-        "r_ver" : "v3.5.0-v179",
+        "r_ver" : "v3.5.0-v180",
         "c_ver" : "20240732",
         "s_ver" : "20240426"
     }

+ 21 - 5
views/main_css/js/route/bbs_w_set.js

@@ -6,14 +6,20 @@ function opennamu_bbs_w_set_post() {
         "bbs_acl",
         "bbs_edit_acl",
         "bbs_comment_acl",
-        "bbs_markup"
+        "bbs_markup",
+        "bbs_name"
     ];
 
+    const url = window.location.pathname;
+    const url_split = url.split('/');
+
+    let set_id = url_split[3];
+
     for(let for_a = 0; for_a < acl_set_list.length; for_a++) {
         let post_data = new FormData();
         post_data.append('data', document.getElementById('opennamu_' + acl_set_list[for_a]).value);
         
-        fetch('/api/v2/setting/' + acl_set_list[for_a], {
+        fetch('/api/v2/bbs/set/' + set_id + '/' + acl_set_list[for_a], {
             method : 'PUT',
             body : post_data,
         }).then(function(res) {
@@ -107,23 +113,33 @@ function opennamu_bbs_w_set() {
             document.getElementById('opennamu_bbs_w_set').innerHTML = renderSimpleSet('' +
                 make_html +
                 '<hr class="main_hr">' + 
+                '<input id="opennamu_bbs_name">' +
+                '<hr class="main_hr">' + 
                 '<button onclick="opennamu_bbs_w_set_post();">' + lang['save'] + '</button>' +
             '');
 
             let total_set_list = [];
-            total_set_list.concat(acl_set_list);
-            total_set_list.concat(markup_set_list);
+            total_set_list = total_set_list.concat(acl_set_list);
+            total_set_list = total_set_list.concat(markup_set_list);
 
             for(let for_a = 0; for_a < total_set_list.length; for_a++) {
                 fetch('/api/v2/bbs/set/' + set_id + '/' + total_set_list[for_a]).then(function(res) {
                     return res.json();
                 }).then(function(data) {
-                    data = data["data"][0];
+                    data = data["data"][0][0];
 
                     let select_element = document.getElementById('opennamu_' + total_set_list[for_a]);
                     select_element.querySelector('option[value="' + data + '"]').selected = true;
                 });
             }
+
+            fetch('/api/v2/bbs/set/' + set_id + '/bbs_name').then(function(res) {
+                return res.json();
+            }).then(function(data) {
+                data = data["data"][0][0];
+
+                document.getElementById('opennamu_bbs_name').value = data;
+            });
         });
     });
 }