BG5 commited on
Commit
643de08
·
verified ·
1 Parent(s): bd4a0de

Create templates/index.html

Browse files
Files changed (1) hide show
  1. templates/index.html +30 -0
templates/index.html ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Interactive WebShell</title>
7
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.0.1/socket.io.js"></script>
8
+ </head>
9
+ <body>
10
+ <h1>Interactive Web</h1>
11
+ <input type="text" id="command" placeholder="Enter command" style="width: 80%;">
12
+ <button onclick="executeCommand()">Execute</button>
13
+ <h2>Output:</h2>
14
+ <pre id="output"></pre>
15
+
16
+ <script>
17
+ var socket = io();
18
+
19
+ function executeCommand() {
20
+ var command = document.getElementById('command').value;
21
+ socket.emit('execute_command', command);
22
+ }
23
+
24
+ socket.on('command_output', function(data) {
25
+ var output = document.getElementById('output');
26
+ output.innerHTML += data.output + '\n';
27
+ });
28
+ </script>
29
+ </body>
30
+ </html>