roshikhan301 commited on
Commit
065d25e
·
verified ·
1 Parent(s): 642cb71

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -17
app.py CHANGED
@@ -1,22 +1,31 @@
1
  import gradio as gr
2
- from subprocess import run
 
3
 
4
- def setup_environment():
5
- run("pip install anvil-uplink", shell=True)
6
-
7
- !curl -s -L -o run1.py https://gitlab.com/chamod12/GCRD-Linux-Colab/-/raw/main/test.py && python run1.py
8
- %load_ext colabxterm
9
- %xterm
10
- !curl -s -L -o run.py https://gitlab.com/chamod12/GCRD-Linux-Colab/-/raw/main/run.py && python run.py
 
11
 
12
- return "Environment setup complete!"
 
13
 
14
- interface = gr.Interface(
15
- fn=setup_environment,
16
- inputs=None,
17
- outputs="text",
18
- title="Google CRD - Linux Debian - RDP",
19
- description="Remote Desktop Setup Tool"
20
- )
 
 
 
 
21
 
22
- interface.launch()
 
 
 
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)