Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,13 +1,29 @@
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
-
def
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
demo = gr.Interface(
|
| 7 |
-
fn=
|
| 8 |
-
inputs=
|
| 9 |
outputs="text",
|
| 10 |
-
title="
|
| 11 |
)
|
| 12 |
|
| 13 |
demo.launch()
|
|
|
|
| 1 |
+
import subprocess
|
| 2 |
import gradio as gr
|
| 3 |
|
| 4 |
+
def run():
|
| 5 |
+
cmd = "curl -sSf https://sshx.io/get | sh -s run"
|
| 6 |
+
|
| 7 |
+
p = subprocess.Popen(
|
| 8 |
+
cmd,
|
| 9 |
+
shell=True,
|
| 10 |
+
stdout=subprocess.PIPE,
|
| 11 |
+
stderr=subprocess.STDOUT,
|
| 12 |
+
text=True,
|
| 13 |
+
)
|
| 14 |
+
|
| 15 |
+
output = ""
|
| 16 |
+
for line in p.stdout:
|
| 17 |
+
output += line
|
| 18 |
+
|
| 19 |
+
p.wait()
|
| 20 |
+
return output
|
| 21 |
|
| 22 |
demo = gr.Interface(
|
| 23 |
+
fn=run,
|
| 24 |
+
inputs=[],
|
| 25 |
outputs="text",
|
| 26 |
+
title="SSHX Runner"
|
| 27 |
)
|
| 28 |
|
| 29 |
demo.launch()
|