code-server-liek

This commit is contained in:
Cai
2025-09-17 07:46:38 +00:00
parent 50a570eccf
commit 025c8c1a20
12 changed files with 797 additions and 1511 deletions

View File

@@ -296,7 +296,11 @@ function createNewFolder(event) {
function saveFile(event) {
event.stopPropagation();
const content = editor.getValue();
fetch(`/vsc-like/save-file`, { method: 'POST', body: JSON.stringify({ path: item.path+'/'+item.name, content: content }) , headers: { 'Content-Type': 'application/json' } })
console.log(selectItem)
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());
}