Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -46,7 +46,6 @@ def get_command():
|
|
| 46 |
cmd_data = json.load(f)
|
| 47 |
return cmd_data.get("command", "")
|
| 48 |
|
| 49 |
-
# Gradio UI
|
| 50 |
with gr.Blocks() as ui:
|
| 51 |
with gr.Row():
|
| 52 |
name_input = gr.Textbox(label="PC Name")
|
|
@@ -60,5 +59,10 @@ with gr.Blocks() as ui:
|
|
| 60 |
send_btn = gr.Button("Send Command")
|
| 61 |
send_output = gr.Textbox(label="Response")
|
| 62 |
send_btn.click(send_command, inputs=[name_input, pass_input, cmd_input], outputs=send_output)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
|
| 64 |
ui.launch(share=True)
|
|
|
|
| 46 |
cmd_data = json.load(f)
|
| 47 |
return cmd_data.get("command", "")
|
| 48 |
|
|
|
|
| 49 |
with gr.Blocks() as ui:
|
| 50 |
with gr.Row():
|
| 51 |
name_input = gr.Textbox(label="PC Name")
|
|
|
|
| 59 |
send_btn = gr.Button("Send Command")
|
| 60 |
send_output = gr.Textbox(label="Response")
|
| 61 |
send_btn.click(send_command, inputs=[name_input, pass_input, cmd_input], outputs=send_output)
|
| 62 |
+
|
| 63 |
+
# Hidden components to expose the get_command API endpoint.
|
| 64 |
+
hidden_get_cmd_btn = gr.Button("Hidden Get Command", visible=False)
|
| 65 |
+
hidden_cmd_output = gr.Textbox(visible=False)
|
| 66 |
+
hidden_get_cmd_btn.click(get_command, inputs=[], outputs=hidden_cmd_output, api_name="/get_command")
|
| 67 |
|
| 68 |
ui.launch(share=True)
|