Spaces:
Sleeping
Sleeping
Update index.html
Browse files- index.html +123 -156
index.html
CHANGED
|
@@ -3,244 +3,211 @@
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
| 6 |
-
<title>Elite
|
| 7 |
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
<script src="https://unpkg.com/lucide@latest"></script>
|
| 9 |
<style>
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
.
|
| 14 |
-
.
|
| 15 |
-
input, button { outline: none !important; }
|
| 16 |
</style>
|
| 17 |
</head>
|
| 18 |
-
<body class="h-screen flex flex-col
|
| 19 |
-
|
| 20 |
-
<!-- Sidebar Overlay -->
|
| 21 |
-
<div id="overlay" onclick="toggleSidebar()" class="fixed inset-0 bg-black/60 hidden z-[90]"></div>
|
| 22 |
|
| 23 |
<!-- Header -->
|
| 24 |
-
<header class="h-14
|
| 25 |
-
<button onclick="toggleSidebar()" class="p-2
|
| 26 |
-
|
| 27 |
-
</button>
|
| 28 |
-
<span class="text-xs font-bold tracking-[0.2em] text-indigo-400">ULTRA V4</span>
|
| 29 |
-
<button onclick="logout()" class="p-2"><i data-lucide="log-out" class="w-5 h-5 text-slate-500"></i></button>
|
| 30 |
</header>
|
| 31 |
|
| 32 |
<div class="flex flex-1 relative overflow-hidden">
|
| 33 |
<!-- Sidebar -->
|
| 34 |
-
<aside id="sidebar" class="
|
| 35 |
-
<div class="p-
|
| 36 |
-
<button onclick="
|
| 37 |
-
<i data-lucide="terminal"
|
| 38 |
</button>
|
| 39 |
-
<button onclick="
|
| 40 |
-
<i data-lucide="folder"
|
| 41 |
</button>
|
| 42 |
-
<button onclick="
|
| 43 |
-
<i data-lucide="monitor"
|
| 44 |
</button>
|
| 45 |
</div>
|
| 46 |
</aside>
|
| 47 |
|
| 48 |
-
<!--
|
|
|
|
|
|
|
| 49 |
<main class="flex-1 p-3 overflow-y-auto">
|
| 50 |
-
|
| 51 |
<!-- Terminal -->
|
| 52 |
-
<div id="
|
| 53 |
-
<div id="output" class="flex-1 glass rounded-2xl p-4 overflow-y-auto
|
| 54 |
-
<div class="flex gap-2
|
| 55 |
-
<input type="text" id="
|
| 56 |
-
<button onclick="
|
| 57 |
</div>
|
| 58 |
</div>
|
| 59 |
|
| 60 |
<!-- File Manager -->
|
| 61 |
-
<div id="
|
| 62 |
-
<div class="flex items-center gap-2
|
| 63 |
-
<button
|
| 64 |
-
<
|
| 65 |
-
<
|
| 66 |
-
<input type="file" id="fileUp" class="hidden" onchange="handleUpload()">
|
| 67 |
</div>
|
| 68 |
-
<div id="
|
| 69 |
</div>
|
| 70 |
|
| 71 |
<!-- Proxy -->
|
| 72 |
-
<div id="
|
| 73 |
<div class="flex gap-2">
|
| 74 |
-
<input type="text" id="
|
| 75 |
<button onclick="loadProxy()" class="bg-indigo-600 px-4 rounded-lg text-xs">LOAD</button>
|
| 76 |
</div>
|
| 77 |
-
<iframe id="
|
| 78 |
</div>
|
| 79 |
-
|
| 80 |
</main>
|
| 81 |
</div>
|
| 82 |
|
| 83 |
-
<!-- Editor
|
| 84 |
-
<div id="
|
| 85 |
-
<div class="flex justify-between
|
| 86 |
-
<span id="
|
| 87 |
-
<div class="flex gap-
|
| 88 |
-
<button onclick="closeEditor()" class="
|
| 89 |
-
<button onclick="
|
| 90 |
</div>
|
| 91 |
</div>
|
| 92 |
-
<textarea id="
|
| 93 |
</div>
|
| 94 |
|
| 95 |
-
<!-- Login
|
| 96 |
-
<div id="
|
| 97 |
-
<div class="w-full max-w-xs space-y-6
|
| 98 |
-
<
|
| 99 |
-
|
| 100 |
-
</
|
| 101 |
-
<h1 class="text-xl font-bold">Secure Access</h1>
|
| 102 |
-
<input type="password" id="pass" class="w-full bg-slate-900 border border-slate-800 p-4 rounded-2xl text-center outline-none focus:border-indigo-500" placeholder="Enter Password">
|
| 103 |
-
<button onclick="login()" class="w-full bg-indigo-600 py-4 rounded-2xl font-bold shadow-xl shadow-indigo-600/20">Authorize</button>
|
| 104 |
</div>
|
| 105 |
</div>
|
| 106 |
|
| 107 |
<script>
|
| 108 |
lucide.createIcons();
|
| 109 |
-
let ws,
|
| 110 |
|
| 111 |
-
// --- Auth & Auto-connect ---
|
| 112 |
window.onload = () => {
|
| 113 |
-
const
|
| 114 |
-
if
|
| 115 |
-
else document.getElementById('
|
| 116 |
};
|
| 117 |
|
| 118 |
-
function
|
| 119 |
-
|
| 120 |
-
connectWS(p);
|
| 121 |
-
}
|
| 122 |
-
|
| 123 |
-
function logout() {
|
| 124 |
-
localStorage.removeItem('ultra_pass');
|
| 125 |
-
location.reload();
|
| 126 |
-
}
|
| 127 |
|
| 128 |
-
function
|
| 129 |
-
const
|
| 130 |
-
ws = new WebSocket(`${
|
| 131 |
ws.onopen = () => ws.send(p);
|
| 132 |
ws.onmessage = (e) => {
|
| 133 |
-
if
|
| 134 |
-
localStorage.setItem('
|
| 135 |
-
document.getElementById('
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
alert("Invalid Password");
|
| 139 |
logout();
|
| 140 |
-
} else
|
| 141 |
};
|
| 142 |
-
ws.onclose = () => setTimeout(() => connectWS(p), 2000);
|
| 143 |
}
|
| 144 |
|
| 145 |
-
// --- Sidebar ---
|
| 146 |
function toggleSidebar() {
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
s.classList.toggle('-translate-x-full');
|
| 150 |
-
o.classList.toggle('hidden');
|
| 151 |
}
|
| 152 |
|
| 153 |
-
function
|
| 154 |
-
document.querySelectorAll('.
|
| 155 |
-
document.
|
| 156 |
-
|
| 157 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 158 |
}
|
| 159 |
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
document.getElementById('currentPath').innerText = path;
|
| 164 |
-
document.getElementById('backBtn').style.display = path === '.' ? 'none' : 'block';
|
| 165 |
-
|
| 166 |
const res = await fetch(`/api/files?path=${path}`);
|
| 167 |
const files = await res.json();
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
<div class="flex items-center justify-between p-4 glass rounded-xl active:scale-95 transition-transform" onclick="${f.is_dir ? `loadFiles('${f.path}')` : `editFile('${f.path}')`}">
|
| 171 |
<div class="flex items-center gap-3">
|
| 172 |
-
<i data-lucide="${f.is_dir ? 'folder' : 'file-text'}" class="
|
| 173 |
-
<span class="text-sm
|
| 174 |
</div>
|
| 175 |
-
<button onclick="event.stopPropagation();
|
| 176 |
</div>
|
| 177 |
`).join('');
|
| 178 |
lucide.createIcons();
|
| 179 |
}
|
| 180 |
|
| 181 |
-
function
|
| 182 |
-
const
|
| 183 |
-
|
| 184 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 185 |
}
|
| 186 |
|
| 187 |
-
async function editFile(
|
| 188 |
-
const res = await fetch(`/api/read?path=${
|
| 189 |
const data = await res.json();
|
| 190 |
-
document.getElementById('
|
| 191 |
-
document.getElementById('
|
| 192 |
-
document.getElementById('
|
| 193 |
}
|
| 194 |
|
| 195 |
-
async function
|
| 196 |
-
const path = document.getElementById('
|
| 197 |
-
const content = document.getElementById('
|
| 198 |
await fetch('/api/save', {
|
| 199 |
method: 'POST',
|
| 200 |
headers: {'Content-Type': 'application/json'},
|
| 201 |
body: JSON.stringify({path, content})
|
| 202 |
});
|
| 203 |
-
|
| 204 |
-
}
|
| 205 |
-
|
| 206 |
-
function closeEditor() { document.getElementById('editorModal').classList.add('hidden'); }
|
| 207 |
-
|
| 208 |
-
async function handleUpload() {
|
| 209 |
-
const file = document.getElementById('fileUp').files[0];
|
| 210 |
-
const fd = new FormData();
|
| 211 |
-
fd.append('file', file);
|
| 212 |
-
await fetch(`/api/upload?path=${currentPath}`, {method: 'POST', body: fd});
|
| 213 |
-
loadFiles(currentPath);
|
| 214 |
-
}
|
| 215 |
-
|
| 216 |
-
async function deleteF(path) {
|
| 217 |
-
if(confirm('Delete?')) {
|
| 218 |
-
await fetch(`/api/delete?path=${path}`, {method: 'DELETE'});
|
| 219 |
-
loadFiles(currentPath);
|
| 220 |
-
}
|
| 221 |
}
|
| 222 |
|
| 223 |
-
|
| 224 |
-
function
|
| 225 |
-
const
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
i.value = '';
|
| 229 |
-
}
|
| 230 |
}
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
const o = document.getElementById('output');
|
| 234 |
-
const d = document.createElement('div');
|
| 235 |
-
d.className = "mb-2 text-slate-300 break-all";
|
| 236 |
-
d.innerText = t;
|
| 237 |
-
o.appendChild(d);
|
| 238 |
-
o.scrollTop = o.scrollHeight;
|
| 239 |
-
}
|
| 240 |
-
|
| 241 |
-
function loadProxy() {
|
| 242 |
-
document.getElementById('pFrame').src = `/proxy?url=${encodeURIComponent(document.getElementById('pUrl').value)}`;
|
| 243 |
}
|
|
|
|
| 244 |
</script>
|
| 245 |
</body>
|
| 246 |
</html>
|
|
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
| 6 |
+
<title>Elite WebTermX</title>
|
| 7 |
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
<script src="https://unpkg.com/lucide@latest"></script>
|
| 9 |
<style>
|
| 10 |
+
body { background: #020617; color: #f8fafc; font-family: 'Inter', sans-serif; overflow: hidden; }
|
| 11 |
+
.glass { background: rgba(15, 23, 42, 0.9); backdrop-filter: blur(15px); border: 1px solid rgba(255,255,255,0.05); }
|
| 12 |
+
#sidebar { transition: transform 0.3s ease; width: 80%; max-width: 280px; z-index: 1000; }
|
| 13 |
+
.active-nav { background: #4f46e5; color: white; }
|
| 14 |
+
.terminal-text { font-family: 'JetBrains Mono', monospace; font-size: 11px; }
|
|
|
|
| 15 |
</style>
|
| 16 |
</head>
|
| 17 |
+
<body class="h-screen flex flex-col">
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
<!-- Header -->
|
| 20 |
+
<header class="h-14 flex items-center justify-between px-4 glass border-b border-white/5 sticky top-0 z-[100]">
|
| 21 |
+
<button onclick="toggleSidebar()" class="p-2"><i data-lucide="menu"></i></button>
|
| 22 |
+
<span class="font-bold tracking-widest text-indigo-500">ULTRA V5</span>
|
| 23 |
+
<button onclick="logout()"><i data-lucide="log-out" class="w-5 h-5 text-slate-400"></i></button>
|
|
|
|
|
|
|
| 24 |
</header>
|
| 25 |
|
| 26 |
<div class="flex flex-1 relative overflow-hidden">
|
| 27 |
<!-- Sidebar -->
|
| 28 |
+
<aside id="sidebar" class="fixed inset-y-0 left-0 glass -translate-x-full pt-16">
|
| 29 |
+
<div class="p-4 space-y-2">
|
| 30 |
+
<button onclick="openTab('terminal')" id="btn-terminal" class="w-full flex items-center gap-4 p-4 rounded-xl active-nav">
|
| 31 |
+
<i data-lucide="terminal"></i> Terminal
|
| 32 |
</button>
|
| 33 |
+
<button onclick="openTab('files')" id="btn-files" class="w-full flex items-center gap-4 p-4 rounded-xl">
|
| 34 |
+
<i data-lucide="folder"></i> File Manager
|
| 35 |
</button>
|
| 36 |
+
<button onclick="openTab('proxy')" id="btn-proxy" class="w-full flex items-center gap-4 p-4 rounded-xl">
|
| 37 |
+
<i data-lucide="monitor"></i> Web Preview
|
| 38 |
</button>
|
| 39 |
</div>
|
| 40 |
</aside>
|
| 41 |
|
| 42 |
+
<!-- Overlay -->
|
| 43 |
+
<div id="overlay" onclick="toggleSidebar()" class="fixed inset-0 bg-black/60 hidden z-[900]"></div>
|
| 44 |
+
|
| 45 |
<main class="flex-1 p-3 overflow-y-auto">
|
|
|
|
| 46 |
<!-- Terminal -->
|
| 47 |
+
<div id="tab-terminal" class="tab-content h-full flex flex-col gap-2">
|
| 48 |
+
<div id="output" class="flex-1 glass rounded-2xl p-4 overflow-y-auto terminal-text leading-relaxed"></div>
|
| 49 |
+
<div class="flex gap-2">
|
| 50 |
+
<input type="text" id="cmdInput" class="flex-1 bg-slate-900 border border-slate-800 rounded-xl px-4 py-3 text-sm focus:border-indigo-500" placeholder="Enter command...">
|
| 51 |
+
<button onclick="sendCmd()" class="bg-indigo-600 px-5 rounded-xl"><i data-lucide="play" class="w-4 h-4"></i></button>
|
| 52 |
</div>
|
| 53 |
</div>
|
| 54 |
|
| 55 |
<!-- File Manager -->
|
| 56 |
+
<div id="tab-files" class="tab-content hidden space-y-3">
|
| 57 |
+
<div class="flex items-center gap-2">
|
| 58 |
+
<button onclick="goBack()" class="p-2 glass rounded-lg"><i data-lucide="chevron-left"></i></button>
|
| 59 |
+
<button onclick="createItem()" class="p-2 bg-emerald-600 rounded-lg"><i data-lucide="plus"></i></button>
|
| 60 |
+
<div class="flex-1 text-[10px] mono truncate opacity-50 px-2" id="pathBar">.</div>
|
|
|
|
| 61 |
</div>
|
| 62 |
+
<div id="fileList" class="space-y-2"></div>
|
| 63 |
</div>
|
| 64 |
|
| 65 |
<!-- Proxy -->
|
| 66 |
+
<div id="tab-proxy" class="tab-content hidden h-full flex flex-col gap-2">
|
| 67 |
<div class="flex gap-2">
|
| 68 |
+
<input type="text" id="proxyUrl" value="http://localhost:8080" class="flex-1 bg-slate-900 p-2 rounded-lg text-xs">
|
| 69 |
<button onclick="loadProxy()" class="bg-indigo-600 px-4 rounded-lg text-xs">LOAD</button>
|
| 70 |
</div>
|
| 71 |
+
<iframe id="proxyFrame" class="flex-1 bg-white rounded-xl border-none"></iframe>
|
| 72 |
</div>
|
|
|
|
| 73 |
</main>
|
| 74 |
</div>
|
| 75 |
|
| 76 |
+
<!-- Editor -->
|
| 77 |
+
<div id="editor" class="fixed inset-0 bg-slate-950 z-[1100] hidden flex flex-col p-4">
|
| 78 |
+
<div class="flex justify-between mb-4">
|
| 79 |
+
<span id="edName" class="text-xs opacity-50"></span>
|
| 80 |
+
<div class="flex gap-3">
|
| 81 |
+
<button onclick="closeEditor()" class="text-xs">Cancel</button>
|
| 82 |
+
<button onclick="saveContent()" class="bg-indigo-600 px-4 py-1 rounded text-xs">Save</button>
|
| 83 |
</div>
|
| 84 |
</div>
|
| 85 |
+
<textarea id="edArea" class="flex-1 bg-slate-900 p-4 rounded-xl terminal-text outline-none border border-white/5"></textarea>
|
| 86 |
</div>
|
| 87 |
|
| 88 |
+
<!-- Login -->
|
| 89 |
+
<div id="login" class="fixed inset-0 z-[2000] bg-slate-950 flex items-center justify-center p-6 hidden">
|
| 90 |
+
<div class="w-full max-w-xs text-center space-y-6">
|
| 91 |
+
<h1 class="text-2xl font-bold">Access Denied</h1>
|
| 92 |
+
<input type="password" id="pKey" class="w-full bg-slate-900 border border-slate-800 p-4 rounded-2xl text-center" placeholder="Password">
|
| 93 |
+
<button onclick="doLogin()" class="w-full bg-indigo-600 py-4 rounded-2xl font-bold">Login</button>
|
|
|
|
|
|
|
|
|
|
| 94 |
</div>
|
| 95 |
</div>
|
| 96 |
|
| 97 |
<script>
|
| 98 |
lucide.createIcons();
|
| 99 |
+
let ws, curPath = ".";
|
| 100 |
|
|
|
|
| 101 |
window.onload = () => {
|
| 102 |
+
const k = localStorage.getItem('ultra_v5_key');
|
| 103 |
+
if(k) connect(k);
|
| 104 |
+
else document.getElementById('login').classList.remove('hidden');
|
| 105 |
};
|
| 106 |
|
| 107 |
+
function doLogin() { connect(document.getElementById('pKey').value); }
|
| 108 |
+
function logout() { localStorage.clear(); location.reload(); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
|
| 110 |
+
function connect(p) {
|
| 111 |
+
const prot = location.protocol === 'https:' ? 'wss:' : 'ws:';
|
| 112 |
+
ws = new WebSocket(`${prot}//${location.host}/ws`);
|
| 113 |
ws.onopen = () => ws.send(p);
|
| 114 |
ws.onmessage = (e) => {
|
| 115 |
+
if(e.data === "AUTH_SUCCESS") {
|
| 116 |
+
localStorage.setItem('ultra_v5_key', p);
|
| 117 |
+
document.getElementById('login').classList.add('hidden');
|
| 118 |
+
} else if(e.data === "AUTH_FAILED") {
|
| 119 |
+
alert("Wrong!");
|
|
|
|
| 120 |
logout();
|
| 121 |
+
} else append(e.data);
|
| 122 |
};
|
|
|
|
| 123 |
}
|
| 124 |
|
|
|
|
| 125 |
function toggleSidebar() {
|
| 126 |
+
document.getElementById('sidebar').classList.toggle('-translate-x-full');
|
| 127 |
+
document.getElementById('overlay').classList.toggle('hidden');
|
|
|
|
|
|
|
| 128 |
}
|
| 129 |
|
| 130 |
+
function openTab(t) {
|
| 131 |
+
document.querySelectorAll('.tab-content').forEach(c => c.classList.add('hidden'));
|
| 132 |
+
document.querySelectorAll('nav button').forEach(b => b.classList.remove('active-nav'));
|
| 133 |
+
document.getElementById('tab-'+t).classList.remove('hidden');
|
| 134 |
+
document.getElementById('btn-'+t).classList.add('active-nav');
|
| 135 |
+
if(t === 'files') fetchFiles(curPath);
|
| 136 |
+
if(window.innerWidth < 1024) toggleSidebar();
|
| 137 |
+
}
|
| 138 |
+
|
| 139 |
+
function sendCmd() {
|
| 140 |
+
const input = document.getElementById('cmdInput');
|
| 141 |
+
if(input.value) { ws.send(input.value); input.value = ''; }
|
| 142 |
+
}
|
| 143 |
+
|
| 144 |
+
function append(t) {
|
| 145 |
+
const o = document.getElementById('output');
|
| 146 |
+
const d = document.createElement('div');
|
| 147 |
+
d.className = "mb-1 text-slate-400 border-l-2 border-indigo-500 pl-2";
|
| 148 |
+
d.innerText = t;
|
| 149 |
+
o.appendChild(d);
|
| 150 |
+
o.scrollTop = o.scrollHeight;
|
| 151 |
}
|
| 152 |
|
| 153 |
+
async function fetchFiles(path) {
|
| 154 |
+
curPath = path;
|
| 155 |
+
document.getElementById('pathBar').innerText = path;
|
|
|
|
|
|
|
|
|
|
| 156 |
const res = await fetch(`/api/files?path=${path}`);
|
| 157 |
const files = await res.json();
|
| 158 |
+
document.getElementById('fileList').innerHTML = files.map(f => `
|
| 159 |
+
<div class="flex items-center justify-between p-4 glass rounded-xl active:scale-95 transition-all" onclick="${f.is_dir ? `fetchFiles('${f.path}')` : `editFile('${f.path}')`}">
|
|
|
|
| 160 |
<div class="flex items-center gap-3">
|
| 161 |
+
<i data-lucide="${f.is_dir ? 'folder' : 'file-text'}" class="${f.is_dir ? 'text-indigo-400' : 'text-slate-500'}"></i>
|
| 162 |
+
<span class="text-sm">${f.name}</span>
|
| 163 |
</div>
|
| 164 |
+
<button onclick="event.stopPropagation(); del('${f.path}')" class="text-rose-500"><i data-lucide="trash-2" class="w-4 h-4"></i></button>
|
| 165 |
</div>
|
| 166 |
`).join('');
|
| 167 |
lucide.createIcons();
|
| 168 |
}
|
| 169 |
|
| 170 |
+
async function createItem() {
|
| 171 |
+
const name = prompt("Name:");
|
| 172 |
+
if(!name) return;
|
| 173 |
+
const isDir = confirm("Is it a folder?");
|
| 174 |
+
await fetch('/api/create', {
|
| 175 |
+
method: 'POST',
|
| 176 |
+
headers: {'Content-Type': 'application/json'},
|
| 177 |
+
body: JSON.stringify({name, is_dir: isDir, path: curPath})
|
| 178 |
+
});
|
| 179 |
+
fetchFiles(curPath);
|
| 180 |
}
|
| 181 |
|
| 182 |
+
async function editFile(p) {
|
| 183 |
+
const res = await fetch(`/api/read?path=${p}`);
|
| 184 |
const data = await res.json();
|
| 185 |
+
document.getElementById('edName').innerText = p;
|
| 186 |
+
document.getElementById('edArea').value = data.content;
|
| 187 |
+
document.getElementById('editor').classList.remove('hidden');
|
| 188 |
}
|
| 189 |
|
| 190 |
+
async function saveContent() {
|
| 191 |
+
const path = document.getElementById('edName').innerText;
|
| 192 |
+
const content = document.getElementById('edArea').value;
|
| 193 |
await fetch('/api/save', {
|
| 194 |
method: 'POST',
|
| 195 |
headers: {'Content-Type': 'application/json'},
|
| 196 |
body: JSON.stringify({path, content})
|
| 197 |
});
|
| 198 |
+
document.getElementById('editor').classList.add('hidden');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 199 |
}
|
| 200 |
|
| 201 |
+
function closeEditor() { document.getElementById('editor').classList.add('hidden'); }
|
| 202 |
+
function goBack() {
|
| 203 |
+
const parts = curPath.split('/');
|
| 204 |
+
parts.pop();
|
| 205 |
+
fetchFiles(parts.length ? parts.join('/') : '.');
|
|
|
|
|
|
|
| 206 |
}
|
| 207 |
+
function loadProxy() {
|
| 208 |
+
document.getElementById('proxyFrame').src = `/proxy?url=${encodeURIComponent(document.getElementById('proxyUrl').value)}`;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 209 |
}
|
| 210 |
+
async function del(p) { if(confirm('Delete?')) { await fetch(`/api/delete?path=${p}`, {method: 'DELETE'}); fetchFiles(curPath); } }
|
| 211 |
</script>
|
| 212 |
</body>
|
| 213 |
</html>
|