1tbfree commited on
Commit
bf504ce
·
verified ·
1 Parent(s): 3ce5e9c

Create public/index.html

Browse files
Files changed (1) hide show
  1. public/index.html +53 -0
public/index.html ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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>Command Runner</title>
7
+ <style>
8
+ body {
9
+ font-family: Arial, sans-serif;
10
+ margin: 20px;
11
+ }
12
+ input[type="text"] {
13
+ width: 300px;
14
+ padding: 10px;
15
+ margin-right: 10px;
16
+ }
17
+ button {
18
+ padding: 10px 15px;
19
+ }
20
+ pre {
21
+ background-color: #f4f4f4;
22
+ padding: 10px;
23
+ border: 1px solid #ccc;
24
+ white-space: pre-wrap;
25
+ word-wrap: break-word;
26
+ }
27
+ </style>
28
+ </head>
29
+ <body>
30
+ <h1>Run a Command</h1>
31
+ <form id="command-form">
32
+ <input type="text" id="command" name="command" placeholder="Enter command here" required>
33
+ <button type="submit">Run</button>
34
+ </form>
35
+ <h2>Output:</h2>
36
+ <pre id="output"></pre>
37
+
38
+ <script>
39
+ document.getElementById('command-form').addEventListener('submit', function(event) {
40
+ event.preventDefault();
41
+ const command = document.getElementById('command').value;
42
+ fetch(`/run?command=${encodeURIComponent(command)}`)
43
+ .then(response => response.text())
44
+ .then(data => {
45
+ document.getElementById('output').textContent = data;
46
+ })
47
+ .catch(error => {
48
+ document.getElementById('output').textContent = `Error: ${error}`;
49
+ });
50
+ });
51
+ </script>
52
+ </body>
53
+ </html>