25/09/24 10:00~11:30 停机维护

This commit is contained in:
Cai
2025-09-24 18:12:45 +08:00
parent 07cf2363ab
commit 3ad36c29ed
13 changed files with 2997 additions and 224 deletions

View File

@@ -262,6 +262,12 @@ function loadFileContent(item) {
}
function createAndWriteNewFile(path, content){
fetch(`/vsc-like/create-file`, { method: 'POST', body: JSON.stringify({ path: path, parent: '.' }) , headers: { 'Content-Type': 'application/json' } })
.then(() => {
postSaveFile('./'+path, content)
});
}
// 新建文件
@@ -303,6 +309,12 @@ function createNewFolder(event) {
}
}
function postSaveFile(path, content){
fetch(`/vsc-like/save-file`, { method: 'POST', body: JSON.stringify({ path: path, content: content }) , headers: { 'Content-Type': 'application/json' } })
.then(() => loadFileTree());
}
// 保存文件
function saveFile(event) {
event.stopPropagation();
@@ -311,8 +323,7 @@ function saveFile(event) {
if (selectedItem.path==undefined){
selectedItem.path='.';
}
fetch(`/vsc-like/save-file`, { method: 'POST', body: JSON.stringify({ path: selectedItem.path+'/'+selectedItem.name, content: content }) , headers: { 'Content-Type': 'application/json' } })
.then(() => loadFileTree());
postSaveFile(selectedItem.path+'/'+selectedItem.name, content)
}