Spaces:
Paused
Paused
BinaryONe
commited on
Commit
·
a4da194
1
Parent(s):
f0f2770
Changes
Browse files- WebSSH/AppHandler.py +1 -0
- WebSSH/templates/index.html +7 -3
WebSSH/AppHandler.py
CHANGED
|
@@ -23,6 +23,7 @@ class AppHandler(tornado.web.RequestHandler):
|
|
| 23 |
if command:
|
| 24 |
try:
|
| 25 |
result = subprocess.run(command, shell=True, capture_output=True, text=True)
|
|
|
|
| 26 |
return(result.stdout)
|
| 27 |
except Exception as e:
|
| 28 |
return(str(e))
|
|
|
|
| 23 |
if command:
|
| 24 |
try:
|
| 25 |
result = subprocess.run(command, shell=True, capture_output=True, text=True)
|
| 26 |
+
print(f"Result: {result.stdout}")
|
| 27 |
return(result.stdout)
|
| 28 |
except Exception as e:
|
| 29 |
return(str(e))
|
WebSSH/templates/index.html
CHANGED
|
@@ -70,9 +70,13 @@
|
|
| 70 |
},
|
| 71 |
body: JSON.stringify({ command: command })
|
| 72 |
})
|
| 73 |
-
.then(
|
| 74 |
-
console.log(
|
| 75 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
}
|
| 77 |
function get_privatekey() {
|
| 78 |
event.preventDefault();
|
|
|
|
| 70 |
},
|
| 71 |
body: JSON.stringify({ command: command })
|
| 72 |
})
|
| 73 |
+
.then(response => {
|
| 74 |
+
console.log(response)
|
| 75 |
+
if (!response.ok) {
|
| 76 |
+
throw new Error('Network response was not ok');
|
| 77 |
+
}
|
| 78 |
+
return response.text();
|
| 79 |
+
})
|
| 80 |
}
|
| 81 |
function get_privatekey() {
|
| 82 |
event.preventDefault();
|