ruslanmv commited on
Commit
80daf2a
·
verified ·
1 Parent(s): dc8ae45

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -12
app.py CHANGED
@@ -199,18 +199,15 @@ with gr.Blocks(
199
 
200
  with gr.Tab("Command Viewer"):
201
  with gr.Row():
202
- with gr.Column(scale=10):
203
- command_cmd = gr.Textbox(label="Command", placeholder="Enter a command")
204
- with gr.Column(scale=1, min_width=BUTTON_MIN_WIDTH):
205
- btn_cmd = gr.Button("Run Command")
206
- output_cmd = gr.Label("", label="Command Output") # Use gr.Label for simple text output
207
- def on_button_click():
208
- output_cmd.value = run_command(command_cmd.value) # Update value directly
209
- def on_enter_key(key):
210
- if key == "enter":
211
- on_button_click()
212
- command_cmd.keypress(on_enter_key) # Add event listener for Enter keypress
213
- btn_cmd.click(on_button_click)
214
 
215
 
216
  if __name__ == "__main__":
 
199
 
200
  with gr.Tab("Command Viewer"):
201
  with gr.Row():
202
+ input_cmd = gr.Textbox(label="Command", placeholder="Enter a command")
203
+ output_cmd = gr.Label("", label="Command Output")
204
+ btn_cmd = gr.Button("Run Command")
205
+
206
+ btn_cmd.click(fn=run_command,
207
+ inputs=[input_cmd.value],
208
+ outputs=[output_cmd.text])
209
+
210
+
 
 
 
211
 
212
 
213
  if __name__ == "__main__":