fontend update without css

This commit is contained in:
qing committed 2026-07-27 12:24:06 +08:00
1 parent ce9337fe0d
commit 614368eb93
3 files changed
+25

No files matched your search

+1
View File
@@ -9,6 +9,7 @@
</head> </head>
<body> <body>
<div class="box"> <div class="box">
<div id="minimap" class="minimap"></div>
<div class="recommend-list" id="recommend-list"></div> <div class="recommend-list" id="recommend-list"></div>
<div class="card node-form"> <div class="card node-form">
<h3>节点操作</h3> <h3>节点操作</h3>
+23
View File
@@ -90,6 +90,7 @@ async function addNode(token, pid, title, content) {
input_note_title.value = ""; input_note_title.value = "";
input_note_content.value = ""; input_note_content.value = "";
getNode(token, stack[stack.length - 1]).then(load_notes); getNode(token, stack[stack.length - 1]).then(load_notes);
getNode(token, stack[stack.length - 1]).then(loadMap)
//if (result.success) { //if (result.success) {
alert(`添加节点成功`, result); alert(`添加节点成功`, result);
@@ -142,6 +143,7 @@ async function deleteNode(token, id) {
stack.pop(); stack.pop();
getNode(token, stack[stack.length - 1]).then(load_notes); getNode(token, stack[stack.length - 1]).then(load_notes);
getNode(token, stack[stack.length - 1]).then(loadMap)
console.log(`删除节点成功`); console.log(`删除节点成功`);
return result return result
@@ -171,6 +173,7 @@ var input_note_submit = document.getElementById('input-note-submit');
var input_note_clear = document.getElementById('input-note-clear'); var input_note_clear = document.getElementById('input-note-clear');
var recommend_list = document.getElementById('recommend-list'); var recommend_list = document.getElementById('recommend-list');
var delete_note = document.getElementById('delete-note'); var delete_note = document.getElementById('delete-note');
var minimap = document.getElementById("minimap");
input_note_submit.addEventListener('click', function(event) { input_note_submit.addEventListener('click', function(event) {
var title = input_note_title.value var title = input_note_title.value
@@ -228,6 +231,7 @@ function load_notes(main_node) {
stack.pop(); stack.pop();
var id = (stack.length > 1) ? stack[stack.length - 1] : 0; var id = (stack.length > 1) ? stack[stack.length - 1] : 0;
getNode(token, id).then(load_notes) getNode(token, id).then(load_notes)
getNode(token, id).then(loadMap)
}); });
var bak1 = document.createElement('h1'); var bak1 = document.createElement('h1');
bak1.textContent = "返回上一层"; bak1.textContent = "返回上一层";
@@ -242,10 +246,12 @@ function load_notes(main_node) {
var id = Number(item.id) var id = Number(item.id)
stack.push(id) stack.push(id)
getNode(token, id).then(load_notes) getNode(token, id).then(load_notes)
getNode(token, id).then(loadMap)
}); });
let ttl = document.createElement('center'); let ttl = document.createElement('center');
let ttl1 =document.createElement('h3'); let ttl1 =document.createElement('h3');
ttl1.textContent = item.title; ttl1.textContent = item.title;
card.id = item.title;
ttl.appendChild(ttl1); ttl.appendChild(ttl1);
card.appendChild(ttl); card.appendChild(ttl);
let vit_div = document.createElement('p'); let vit_div = document.createElement('p');
@@ -265,5 +271,22 @@ function load_notes(main_node) {
} }
}; };
function loadMap(children_json) {
minimap.replaceChildren();
for (let i in children_json) {
let item = children_json[i];
let tag = document.createElement("div");
let title = item.title;
tag.className = "tag";
tag.textContent = title;
tag.addEventListener("click", () => {
window.location.href = `#${title}`;
console.log(`跳转到${title}`);
})
minimap.appendChild(tag);
}
}
var token = sessionStorage.getItem('q4_token') var token = sessionStorage.getItem('q4_token')
getNode(token, 0).then(load_notes); getNode(token, 0).then(load_notes);
getNode(token, 0).then(loadMap)
+1
View File
@@ -1,3 +1,4 @@
../pymsg
nuitka nuitka
Flask>=2.3.0,<3.0.0 Flask>=2.3.0,<3.0.0
Flask-CORS>=4.0.0,<5.0.0 Flask-CORS>=4.0.0,<5.0.0