Spaces:
Running
Running
update
Browse files
app.py
CHANGED
|
@@ -1320,10 +1320,10 @@ with gr.Blocks(
|
|
| 1320 |
return "<div style='padding:1em;color:#888;text-align:center;'>Preview is only available for HTML. Please download your code using the download button above.</div>"
|
| 1321 |
|
| 1322 |
def show_deploy_components(*args):
|
| 1323 |
-
return [gr.Textbox(visible=True), gr.Dropdown(visible=True), gr.Button(visible=True)]
|
| 1324 |
|
| 1325 |
def hide_deploy_components(*args):
|
| 1326 |
-
return [gr.Textbox(visible=False), gr.Dropdown(visible=False), gr.Button(visible=False)]
|
| 1327 |
|
| 1328 |
btn.click(
|
| 1329 |
generation_code,
|
|
@@ -1332,13 +1332,13 @@ with gr.Blocks(
|
|
| 1332 |
).then(
|
| 1333 |
show_deploy_components,
|
| 1334 |
None,
|
| 1335 |
-
[space_name_input, sdk_dropdown, deploy_btn]
|
| 1336 |
)
|
| 1337 |
# Update preview when code or language changes
|
| 1338 |
code_output.change(preview_logic, inputs=[code_output, language_dropdown], outputs=sandbox)
|
| 1339 |
language_dropdown.change(preview_logic, inputs=[code_output, language_dropdown], outputs=sandbox)
|
| 1340 |
clear_btn.click(clear_history, outputs=[history, history_output, file_input, website_url_input])
|
| 1341 |
-
clear_btn.click(hide_deploy_components, None, [space_name_input, sdk_dropdown, deploy_btn])
|
| 1342 |
|
| 1343 |
# Deploy to Spaces logic
|
| 1344 |
|
|
|
|
| 1320 |
return "<div style='padding:1em;color:#888;text-align:center;'>Preview is only available for HTML. Please download your code using the download button above.</div>"
|
| 1321 |
|
| 1322 |
def show_deploy_components(*args):
|
| 1323 |
+
return [gr.Textbox(visible=True), gr.Dropdown(visible=True), gr.Button(visible=True), gr.Markdown(visible=True)]
|
| 1324 |
|
| 1325 |
def hide_deploy_components(*args):
|
| 1326 |
+
return [gr.Textbox(visible=False), gr.Dropdown(visible=False), gr.Button(visible=False), gr.Markdown(visible=False)]
|
| 1327 |
|
| 1328 |
btn.click(
|
| 1329 |
generation_code,
|
|
|
|
| 1332 |
).then(
|
| 1333 |
show_deploy_components,
|
| 1334 |
None,
|
| 1335 |
+
[space_name_input, sdk_dropdown, deploy_btn, deploy_status]
|
| 1336 |
)
|
| 1337 |
# Update preview when code or language changes
|
| 1338 |
code_output.change(preview_logic, inputs=[code_output, language_dropdown], outputs=sandbox)
|
| 1339 |
language_dropdown.change(preview_logic, inputs=[code_output, language_dropdown], outputs=sandbox)
|
| 1340 |
clear_btn.click(clear_history, outputs=[history, history_output, file_input, website_url_input])
|
| 1341 |
+
clear_btn.click(hide_deploy_components, None, [space_name_input, sdk_dropdown, deploy_btn, deploy_status])
|
| 1342 |
|
| 1343 |
# Deploy to Spaces logic
|
| 1344 |
|