Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -99,10 +99,10 @@ def run_command(command):
|
|
99 |
return result
|
100 |
except subprocess.CalledProcessError as e:
|
101 |
return f"Error: {e}"
|
102 |
-
|
103 |
|
104 |
|
105 |
|
|
|
106 |
with gr.Blocks(
|
107 |
title = "3GPP Database",
|
108 |
theme = "Base",
|
@@ -199,15 +199,21 @@ with gr.Blocks(
|
|
199 |
outputs=[output_box])
|
200 |
|
201 |
|
|
|
202 |
|
|
|
|
|
|
|
|
|
|
|
|
|
203 |
with gr.Tab("Command Viewer"):
|
204 |
with gr.Row():
|
205 |
input_cmd = gr.Textbox(label="Command", placeholder="Enter a command")
|
206 |
output_cmd = gr.Label("", label="Command Output")
|
207 |
btn_cmd = gr.Button("Run Command", run_function_on_click=True)
|
208 |
-
|
209 |
-
btn_cmd.click(
|
210 |
-
|
211 |
|
212 |
|
213 |
|
|
|
99 |
return result
|
100 |
except subprocess.CalledProcessError as e:
|
101 |
return f"Error: {e}"
|
|
|
102 |
|
103 |
|
104 |
|
105 |
+
|
106 |
with gr.Blocks(
|
107 |
title = "3GPP Database",
|
108 |
theme = "Base",
|
|
|
199 |
outputs=[output_box])
|
200 |
|
201 |
|
202 |
+
|
203 |
|
204 |
+
def on_click_run_command():
|
205 |
+
input_text = input_cmd.get_value()
|
206 |
+
result = run_command(input_text)
|
207 |
+
output_cmd.set_value(result)
|
208 |
+
|
209 |
+
|
210 |
with gr.Tab("Command Viewer"):
|
211 |
with gr.Row():
|
212 |
input_cmd = gr.Textbox(label="Command", placeholder="Enter a command")
|
213 |
output_cmd = gr.Label("", label="Command Output")
|
214 |
btn_cmd = gr.Button("Run Command", run_function_on_click=True)
|
215 |
+
|
216 |
+
btn_cmd.click(fn=on_click_run_command, inputs=[input_cmd], outputs=[output_cmd])
|
|
|
217 |
|
218 |
|
219 |
|