Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,22 +1,31 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
|
|
|
|
| 3 |
|
| 4 |
-
def
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
|
|
|
| 11 |
|
| 12 |
-
|
|
|
|
| 13 |
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
-
|
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import subprocess
|
| 3 |
+
import os
|
| 4 |
|
| 5 |
+
def setup_rdp():
|
| 6 |
+
# Download required files
|
| 7 |
+
subprocess.run("curl -s -L -o run1.py https://gitlab.com/chamod12/GCRD-Linux-Colab/-/raw/main/test.py", shell=True)
|
| 8 |
+
subprocess.run("curl -s -L -o run.py https://gitlab.com/chamod12/GCRD-Linux-Colab/-/raw/main/run.py", shell=True)
|
| 9 |
+
|
| 10 |
+
# Execute the setup scripts
|
| 11 |
+
result1 = subprocess.run("python run1.py", shell=True, capture_output=True, text=True)
|
| 12 |
+
result2 = subprocess.run("python run.py", shell=True, capture_output=True, text=True)
|
| 13 |
|
| 14 |
+
output = result1.stdout + "\n" + result2.stdout
|
| 15 |
+
return output
|
| 16 |
|
| 17 |
+
def create_rdp_interface():
|
| 18 |
+
with gr.Blocks() as app:
|
| 19 |
+
gr.Markdown("# Windows RDP Setup Interface")
|
| 20 |
+
|
| 21 |
+
with gr.Row():
|
| 22 |
+
setup_button = gr.Button("Setup Windows RDP")
|
| 23 |
+
output = gr.Textbox(label="Setup Output", lines=10)
|
| 24 |
+
|
| 25 |
+
setup_button.click(fn=setup_rdp, outputs=output)
|
| 26 |
+
|
| 27 |
+
return app
|
| 28 |
|
| 29 |
+
# Create and launch the interface
|
| 30 |
+
app = create_rdp_interface()
|
| 31 |
+
app.launch(share=True)
|