From fc9500f99b66d6f3134a651dbdf659bea1e35fbb Mon Sep 17 00:00:00 2001 From: backuppc Date: Wed, 21 Jan 2026 14:43:10 +0900 Subject: [PATCH] =?UTF-8?q?=EB=A1=9C=EC=BB=AC=EC=8B=A4=ED=96=89=EB=AA=A8?= =?UTF-8?q?=EB=93=9C=EC=B6=94=EA=B0=80=20=EB=B0=8F=20=EB=A1=9C=EC=BB=AC?= =?UTF-8?q?=EC=8B=A4=ED=96=89=EC=8B=9C=EC=97=90=EB=8A=94=20=EB=B0=B1?= =?UTF-8?q?=EC=97=94=EB=93=9C=20=EB=B2=84=ED=8A=BC=20=EC=88=A8=EA=B9=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + App.tsx | 67 +- backend_proxy.cjs | 124 +++- package-lock.json | 1777 +++++++++++++++++++++++++++++++++++++++++---- package.json | 16 +- pkg-backend.json | 12 + 6 files changed, 1773 insertions(+), 224 deletions(-) create mode 100644 pkg-backend.json diff --git a/.gitignore b/.gitignore index c10d7ea..54ad191 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ dist-ssr *.sln *.sw? public/webftp-backend.exe +public/webftp.exe diff --git a/App.tsx b/App.tsx index e6b9ca9..a71ef65 100644 --- a/App.tsx +++ b/App.tsx @@ -165,55 +165,6 @@ const App: React.FC = () => { ws!.send(JSON.stringify({ command: 'LOCAL_LIST', path: storedLocalPath })); }; - ws.onmessage = (event) => { - try { - const data = JSON.parse(event.data); - - switch (data.type) { - // ... (no change to inside of switch) ... - case 'status': - if (data.status === 'connected') { - setConnection(prev => ({ ...prev, connected: true, connecting: false })); - addLog('success', data.message || 'FTP 연결 성공'); - - // Use Ref for latest state (especially initialPath from Site Manager) - const currentConn = connectionRef.current; - - // 1. Initial Directory from Site Config - if (currentConn.initialPath) { - ws?.send(JSON.stringify({ command: 'LIST', path: currentConn.initialPath })); - } - // 2. Last Visited Path (Persistence) - else { - const lastRemote = localStorage.getItem(`last_remote_path_${currentConn.host}`); - const initialPath = lastRemote || '/'; - ws?.send(JSON.stringify({ command: 'LIST', path: initialPath })); - } - } else if (data.status === 'disconnected') { - setConnection(prev => ({ ...prev, connected: false, connecting: false })); - setRemote(prev => ({ ...prev, files: [], path: '/' })); - addLog('system', 'FTP 연결 종료'); - } else if (data.status === 'error') { - setConnection(prev => ({ ...prev, connecting: false })); - addLog('error', data.message); - } - break; - - case 'list': - // ... (rest of cases handled by maintaining existing code structure or using multi-replace if I was confident, but here let's careful) ... - // Since replace_file_content works on lines, I should target specific blocks. - // BE CAREFUL: attempting to replace too large block blindly. - // I should stick to smaller replaces. - } - - // To avoid re-writing the huge switch content, I will use multiple Replace calls or just target onopen/onclose. - } catch (e) { - // ... - } - }; // This close brace is problematic if I don't include the switch logic. - // Better: just replace onopen and onclose separately. - - ws.onmessage = (event) => { try { const data = JSON.parse(event.data); @@ -1024,14 +975,16 @@ const App: React.FC = () => { {connection.connecting ?
: (connection.connected ? <> 연결 해제 : '빠른 연결')} - - 백엔드 - + {!(window as any).__IS_STANDALONE__ && ( + + 백엔드 + + )}