openfree commited on
Commit
3764c21
ยท
verified ยท
1 Parent(s): de354d7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +92 -14
app.py CHANGED
@@ -765,23 +765,101 @@ The response should be in HTML format with appropriate styling."""
765
  "system": SystemPrompt,
766
  })
767
 
768
- #NEW - ๊ฒ€์ƒ‰ ๋ชจ๋“œ ์ƒํƒœ ์ถ”๊ฐ€
769
  search_mode = gr.State(False)
770
-
771
- # code_output ์ •์˜ ์ถ”๊ฐ€
772
  code_output = gr.State("")
773
 
774
- with ms.Application() as app:
775
- with antd.ConfigProvider():
776
- #NEW - ๋ชจ๋“œ ์„ ํƒ ๋ผ๋””์˜ค ๋ฒ„ํŠผ ์ถ”๊ฐ€
777
- with gr.Row():
778
- mode = gr.Radio(
779
- choices=["Generate", "Generate + Web Search"],
780
- label="Mode",
781
- value="Generate",
782
- info="Select 'Generate + Web Search' to include web search results",
783
- elem_classes="mode-selector"
784
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
785
 
786
  with antd.Drawer(open=False, title="AI is Creating...", placement="left", width="750px") as code_drawer:
787
  gr.HTML("""
 
765
  "system": SystemPrompt,
766
  })
767
 
 
768
  search_mode = gr.State(False)
 
 
769
  code_output = gr.State("")
770
 
771
+ # ์ „์ฒด ๋ ˆ์ด์•„์›ƒ์„ ์œ„ํ•œ Row ์ถ”๊ฐ€
772
+ with gr.Row():
773
+ # ์ขŒ์ธก ํŒจ๋„
774
+ with gr.Column(scale=1):
775
+ with ms.Application() as app:
776
+ with antd.ConfigProvider():
777
+ with gr.Row():
778
+ mode = gr.Radio(
779
+ choices=["Generate", "Generate + Web Search"],
780
+ label="Mode",
781
+ value="Generate",
782
+ info="Select 'Generate + Web Search' to include web search results",
783
+ elem_classes="mode-selector"
784
+ )
785
+
786
+ # ์ž…๋ ฅ ์˜์—ญ
787
+ input = antd.InputTextarea(
788
+ size="large",
789
+ allow_clear=True,
790
+ placeholder=get_random_placeholder(),
791
+ elem_classes="custom-textarea"
792
+ )
793
+
794
+ # ๋ฒ„ํŠผ ๊ทธ๋ฃน
795
+ with antd.Flex(gap="small", justify="flex-start"):
796
+ btn = antd.Button(
797
+ "Generate",
798
+ type="primary",
799
+ size="large",
800
+ elem_classes="generate-btn"
801
+ )
802
+ boost_btn = antd.Button(
803
+ "Enhance",
804
+ type="default",
805
+ size="large",
806
+ elem_classes="enhance-btn"
807
+ )
808
+ deploy_btn = antd.Button(
809
+ "Share",
810
+ type="default",
811
+ size="large",
812
+ elem_classes="share-btn"
813
+ )
814
+
815
+ deploy_result = gr.HTML(
816
+ label="Share Result",
817
+ elem_classes="deploy-result"
818
+ )
819
+
820
+ # ์šฐ์ธก ํŒจ๋„
821
+ with gr.Column(scale=2):
822
+ with ms.Div(elem_classes="right_panel"):
823
+ gr.HTML("""
824
+ <div class="window-frame">
825
+ <div class="window-header">
826
+ <div class="window-controls">
827
+ <div class="control close"></div>
828
+ <div class="control minimize"></div>
829
+ <div class="control maximize"></div>
830
+ </div>
831
+ <div class="window-title">Preview</div>
832
+ </div>
833
+ </div>
834
+ """)
835
+
836
+ with antd.Tabs(active_key="empty", render_tab_bar="() => null") as state_tab:
837
+ with antd.Tabs.Item(key="empty"):
838
+ empty = antd.Empty(
839
+ description="Enter your question to begin",
840
+ elem_classes="right_content empty-content"
841
+ )
842
+
843
+ with antd.Tabs.Item(key="loading"):
844
+ loading = antd.Spin(
845
+ True,
846
+ tip="Creating visual presentation...",
847
+ size="large",
848
+ elem_classes="right_content"
849
+ )
850
+
851
+ with antd.Tabs.Item(key="render"):
852
+ sandbox = gr.HTML(elem_classes="html_content")
853
+
854
+ with antd.Tabs.Item(key="error"):
855
+ error = antd.Empty(
856
+ description="An error occurred. Please try again.",
857
+ elem_classes="right_content error-content"
858
+ )
859
+
860
+
861
+
862
+
863
 
864
  with antd.Drawer(open=False, title="AI is Creating...", placement="left", width="750px") as code_drawer:
865
  gr.HTML("""