Download templates/index.html from vortexa64/vpc: direct link, hf CLI and curl.
- Browser
- Download file 1.56 kB
-
https://huggingface.co/spaces/vortexa64/vpc/resolve/main/templates/index.html
- Command line
-
hf download hf://spaces/vortexa64/vpc/templates/index.html
-
curl -L -o index.html https://huggingface.co/spaces/vortexa64/vpc/resolve/main/templates/index.html
1.56 kB
| <html> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>VPC - Virtual Private Console π©π</title> | |
| <script src="https://cdn.jsdelivr.net/npm/xterm/lib/xterm.js"></script> | |
| <script src="https://cdn.socket.io/4.3.2/socket.io.min.js"></script> | |
| <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/xterm/css/xterm.css" /> | |
| <style> | |
| body { background: #111; color: white; margin: 0; display: flex; flex-direction: column; height: 100vh; } | |
| #terminal { flex-grow: 1; padding: 10px; } | |
| #upload-btn { padding: 10px; background: hotpink; border: none; color: white; cursor: pointer; } | |
| </style> | |
| </head> | |
| <body> | |
| <div id="terminal"></div> | |
| <input type="file" id="fileInput" style="display:none"> | |
| <button id="upload-btn">π Upload File</button> | |
| <script> | |
| const term = new Terminal(); | |
| const socket = io(); | |
| term.open(document.getElementById('terminal')); | |
| term.onData(data => socket.emit('input', data)); | |
| socket.on('output', data => term.write(data)); | |
| const uploadBtn = document.getElementById("upload-btn"); | |
| const fileInput = document.getElementById("fileInput"); | |
| uploadBtn.onclick = () => fileInput.click(); | |
| fileInput.onchange = () => { | |
| const file = fileInput.files[0]; | |
| const formData = new FormData(); | |
| formData.append("file", file); | |
| fetch("/upload", { | |
| method: "POST", | |
| body: formData | |
| }) | |
| .then(res => res.json()) | |
| .then(data => { | |
| term.writeln(`\r\n[Uploaded: ${data.path}]\r\n`); | |
| }); | |
| }; | |
| </script> | |
| </body> | |
| </html> | |