Update app.py
Browse files
app.py
CHANGED
@@ -768,7 +768,7 @@ with gr.Blocks(css_paths="app.css",theme=theme) as demo:
|
|
768 |
execute_btn = antd.Button("Code 실행", type="default", size="large")
|
769 |
clear_btn = antd.Button("Clear", type="default", size="large")
|
770 |
|
771 |
-
# 우측 패널
|
772 |
with antd.Col(span=24, md=16):
|
773 |
with ms.Div(elem_classes="right_panel"):
|
774 |
with antd.Flex(gap="small", elem_classes="setting-buttons"):
|
@@ -779,7 +779,9 @@ with gr.Blocks(css_paths="app.css",theme=theme) as demo:
|
|
779 |
new_btn = antd.Button("✨ NEW 템플릿", type="default")
|
780 |
|
781 |
gr.HTML('<div class="render_header"><span class="header_btn"></span><span class="header_btn"></span><span class="header_btn"></span></div>')
|
782 |
-
|
|
|
|
|
783 |
with antd.Tabs(active_key="empty", render_tab_bar="() => null") as state_tab:
|
784 |
with antd.Tabs.Item(key="empty"):
|
785 |
empty = antd.Empty(description="empty input", elem_classes="right_content")
|
@@ -807,7 +809,7 @@ with gr.Blocks(css_paths="app.css",theme=theme) as demo:
|
|
807 |
print(f"Error executing code: {str(e)}")
|
808 |
return None, gr.update(active_key="empty")
|
809 |
|
810 |
-
|
811 |
execute_btn.click(
|
812 |
fn=execute_code,
|
813 |
inputs=[input],
|
@@ -819,7 +821,7 @@ with gr.Blocks(css_paths="app.css",theme=theme) as demo:
|
|
819 |
inputs=[],
|
820 |
outputs=[code_drawer]
|
821 |
)
|
822 |
-
|
823 |
code_drawer.close(
|
824 |
lambda: gr.update(open=False),
|
825 |
inputs=[],
|
@@ -831,14 +833,14 @@ with gr.Blocks(css_paths="app.css",theme=theme) as demo:
|
|
831 |
inputs=[history],
|
832 |
outputs=[history_drawer, history_output]
|
833 |
)
|
834 |
-
|
835 |
history_drawer.close(
|
836 |
lambda: gr.update(open=False),
|
837 |
inputs=[],
|
838 |
outputs=[history_drawer]
|
839 |
)
|
840 |
|
841 |
-
|
842 |
best_btn.click(
|
843 |
fn=lambda: (gr.update(open=True), load_best_templates()),
|
844 |
outputs=[session_drawer, session_history],
|
@@ -857,14 +859,6 @@ with gr.Blocks(css_paths="app.css",theme=theme) as demo:
|
|
857 |
queue=False
|
858 |
)
|
859 |
|
860 |
-
# 기존 세션 버튼 이벤트
|
861 |
-
sessionBtn.click(
|
862 |
-
fn=lambda: (gr.update(open=True), load_session_history()),
|
863 |
-
inputs=[],
|
864 |
-
outputs=[session_drawer, session_history],
|
865 |
-
queue=False
|
866 |
-
)
|
867 |
-
|
868 |
session_drawer.close(
|
869 |
lambda: (gr.update(open=False), gr.HTML("")),
|
870 |
outputs=[session_drawer, session_history]
|
@@ -887,6 +881,8 @@ with gr.Blocks(css_paths="app.css",theme=theme) as demo:
|
|
887 |
outputs=[history]
|
888 |
)
|
889 |
|
|
|
|
|
890 |
if __name__ == "__main__":
|
891 |
try:
|
892 |
demo_instance = Demo()
|
|
|
768 |
execute_btn = antd.Button("Code 실행", type="default", size="large")
|
769 |
clear_btn = antd.Button("Clear", type="default", size="large")
|
770 |
|
771 |
+
# 우측 패널 부분
|
772 |
with antd.Col(span=24, md=16):
|
773 |
with ms.Div(elem_classes="right_panel"):
|
774 |
with antd.Flex(gap="small", elem_classes="setting-buttons"):
|
|
|
779 |
new_btn = antd.Button("✨ NEW 템플릿", type="default")
|
780 |
|
781 |
gr.HTML('<div class="render_header"><span class="header_btn"></span><span class="header_btn"></span><span class="header_btn"></span></div>')
|
782 |
+
|
783 |
+
|
784 |
+
|
785 |
with antd.Tabs(active_key="empty", render_tab_bar="() => null") as state_tab:
|
786 |
with antd.Tabs.Item(key="empty"):
|
787 |
empty = antd.Empty(description="empty input", elem_classes="right_content")
|
|
|
809 |
print(f"Error executing code: {str(e)}")
|
810 |
return None, gr.update(active_key="empty")
|
811 |
|
812 |
+
# 이벤트 핸들러들
|
813 |
execute_btn.click(
|
814 |
fn=execute_code,
|
815 |
inputs=[input],
|
|
|
821 |
inputs=[],
|
822 |
outputs=[code_drawer]
|
823 |
)
|
824 |
+
|
825 |
code_drawer.close(
|
826 |
lambda: gr.update(open=False),
|
827 |
inputs=[],
|
|
|
833 |
inputs=[history],
|
834 |
outputs=[history_drawer, history_output]
|
835 |
)
|
836 |
+
|
837 |
history_drawer.close(
|
838 |
lambda: gr.update(open=False),
|
839 |
inputs=[],
|
840 |
outputs=[history_drawer]
|
841 |
)
|
842 |
|
843 |
+
# 템플릿 버튼 이벤트 핸들러
|
844 |
best_btn.click(
|
845 |
fn=lambda: (gr.update(open=True), load_best_templates()),
|
846 |
outputs=[session_drawer, session_history],
|
|
|
859 |
queue=False
|
860 |
)
|
861 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
862 |
session_drawer.close(
|
863 |
lambda: (gr.update(open=False), gr.HTML("")),
|
864 |
outputs=[session_drawer, session_history]
|
|
|
881 |
outputs=[history]
|
882 |
)
|
883 |
|
884 |
+
|
885 |
+
|
886 |
if __name__ == "__main__":
|
887 |
try:
|
888 |
demo_instance = Demo()
|