Spaces:
Paused
Paused
| <html> | |
| <head> | |
| <title>Cyber Terminal Pro</title> | |
| <style> | |
| body { | |
| background: #0d1117; | |
| color: #00ffcc; | |
| font-family: monospace; | |
| text-align: center; | |
| } | |
| h1 { | |
| color: #58a6ff; | |
| } | |
| .container { | |
| width: 600px; | |
| margin: auto; | |
| } | |
| .card { | |
| background: #161b22; | |
| padding: 20px; | |
| margin: 20px 0; | |
| border-radius: 15px; | |
| box-shadow: 0 0 15px #00ffcc33; | |
| } | |
| input, button { | |
| padding: 10px; | |
| border-radius: 8px; | |
| border: none; | |
| margin: 5px; | |
| } | |
| input[type="text"] { | |
| width: 70%; | |
| } | |
| button { | |
| background: #238636; | |
| color: white; | |
| cursor: pointer; | |
| } | |
| button:hover { | |
| background: #2ea043; | |
| } | |
| #output { | |
| background: black; | |
| padding: 15px; | |
| height: 300px; | |
| overflow-y: auto; | |
| border-radius: 10px; | |
| text-align: left; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <h1>β‘ Ubuntu Web Control Panel</h1> | |
| <div class="container"> | |
| <div class="card"> | |
| <h3>π» Run Command</h3> | |
| <input type="text" id="cmd" placeholder="Enter command"> | |
| <button onclick="runCmd()">Run</button> | |
| </div> | |
| <div class="card"> | |
| <h3>π Upload File (/app)</h3> | |
| <input type="file" id="fileInput"> | |
| <button onclick="uploadFile()">Upload</button> | |
| </div> | |
| <div class="card"> | |
| <h3>β¬οΈ Download File (/app)</h3> | |
| <input type="text" id="downloadFile" placeholder="Enter filename"> | |
| <button onclick="downloadFile()">Download</button> | |
| </div> | |
| <div class="card"> | |
| <h3>π Output</h3> | |
| <pre id="output">Ready...</pre> | |
| </div> | |
| </div> | |
| <script> | |
| async function runCmd() { | |
| const cmd = document.getElementById("cmd").value; | |
| const output = document.getElementById("output"); | |
| if (!cmd) { | |
| output.textContent = "β Enter command"; | |
| return; | |
| } | |
| output.textContent = "β³ Running..."; | |
| const res = await fetch("/run", { | |
| method: "POST", | |
| headers: {"Content-Type": "application/json"}, | |
| body: JSON.stringify({ cmd }) | |
| }); | |
| const data = await res.json(); | |
| output.textContent = data.error | |
| ? "β " + data.error | |
| : "β " + (data.output || "No output"); | |
| } | |
| async function uploadFile() { | |
| const fileInput = document.getElementById("fileInput"); | |
| const output = document.getElementById("output"); | |
| if (!fileInput.files.length) { | |
| output.textContent = "β Select file"; | |
| return; | |
| } | |
| const formData = new FormData(); | |
| formData.append("file", fileInput.files[0]); | |
| output.textContent = "β³ Uploading..."; | |
| const res = await fetch("/upload", { | |
| method: "POST", | |
| body: formData | |
| }); | |
| const data = await res.json(); | |
| output.textContent = data.error | |
| ? "β " + data.error | |
| : "β " + data.output; | |
| } | |
| function downloadFile() { | |
| const filename = document.getElementById("downloadFile").value; | |
| if (!filename) { | |
| alert("Enter file name"); | |
| return; | |
| } | |
| window.open(`/download?file=${encodeURIComponent(filename)}`, "_blank"); | |
| } | |
| </script> | |
| </body> | |
| </html> |