area444 commited on
Commit
f1aec6f
·
verified ·
1 Parent(s): ac95d16

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -147,7 +147,7 @@ def save_csv(file_name):
147
 
148
  with gr.Blocks() as demo:
149
  # Create the first panel (visible from the start)
150
- with gr.Column(visible=True) as panel_1:
151
  user_text = gr.Textbox(label="User name:", placeholder="Type here...", max_lines=1)
152
  input_text = gr.Textbox(label="Password:", placeholder="Type here...", max_lines=1, type="password")
153
 
@@ -155,11 +155,14 @@ with gr.Blocks() as demo:
155
  btn_1 = gr.Button("Login")
156
 
157
 
158
- with gr.Column(visible=False) as panel_2:
159
  #m = gr.Markdown()
160
- #with gr.Row():
161
  # demo.load(update_message, None, gr.Markdown())
162
  # logout_button = gr.Button("Logout", link="/logout", scale=0)
 
 
 
163
  with gr.Row():
164
  start_input = gr.Textbox(label="Start Date:", placeholder="Enter date (e.g., 2023-09-01)", max_lines=1)
165
  prediction_input = gr.Text(label="Month Prediction:", placeholder="Enter date (e.g., 2024-10-31)", max_lines=1)
@@ -174,11 +177,8 @@ with gr.Blocks() as demo:
174
 
175
  btn_update.click(fn=update_table, inputs=[start_input, prediction_input, range_input], outputs=table_)
176
  #btn_saving.click(fn=save_csv, inputs=file_name_input, outputs=gr.Textbox(label="File Status:"))
177
-
178
- # Add a second button inside Panel 2 to hide the panel and show Panel 1 again
179
- btn_2 = gr.Button("Logout", visible=True)
180
- btn_2.click(hide_and_show_panel, outputs=[panel_2, panel_1]) # Hide Panel 2 and show Panel 1
181
 
 
182
  # Configure the buttons and the panel visibility
183
  btn_1.click(check_words, inputs=[user_text, input_text], outputs=[panel_2, panel_1, user_text, input_text]) # Hide Panel 1 and show Panel 2
184
 
 
147
 
148
  with gr.Blocks() as demo:
149
  # Create the first panel (visible from the start)
150
+ with gr.Column(visible=True, height=700) as panel_1:
151
  user_text = gr.Textbox(label="User name:", placeholder="Type here...", max_lines=1)
152
  input_text = gr.Textbox(label="Password:", placeholder="Type here...", max_lines=1, type="password")
153
 
 
155
  btn_1 = gr.Button("Login")
156
 
157
 
158
+ with gr.Column(visible=False, height=1300) as panel_2:
159
  #m = gr.Markdown()
160
+ with gr.Row():
161
  # demo.load(update_message, None, gr.Markdown())
162
  # logout_button = gr.Button("Logout", link="/logout", scale=0)
163
+ # Add a second button inside Panel 2 to hide the panel and show Panel 1 again
164
+ btn_2 = gr.Button("Logout", visible=True)
165
+ btn_2.click(hide_and_show_panel, outputs=[panel_2, panel_1]) # Hide Panel 2 and show Panel 1
166
  with gr.Row():
167
  start_input = gr.Textbox(label="Start Date:", placeholder="Enter date (e.g., 2023-09-01)", max_lines=1)
168
  prediction_input = gr.Text(label="Month Prediction:", placeholder="Enter date (e.g., 2024-10-31)", max_lines=1)
 
177
 
178
  btn_update.click(fn=update_table, inputs=[start_input, prediction_input, range_input], outputs=table_)
179
  #btn_saving.click(fn=save_csv, inputs=file_name_input, outputs=gr.Textbox(label="File Status:"))
 
 
 
 
180
 
181
+
182
  # Configure the buttons and the panel visibility
183
  btn_1.click(check_words, inputs=[user_text, input_text], outputs=[panel_2, panel_1, user_text, input_text]) # Hide Panel 1 and show Panel 2
184