openfree commited on
Commit
1101d45
·
verified ·
1 Parent(s): be99ee2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -92
app.py CHANGED
@@ -1812,98 +1812,7 @@ def create_main_interface():
1812
  with gr.Tab("갤러리 >", elem_id="gallery-tab"):
1813
  gr.HTML(value=get_user_spaces())
1814
 
1815
- # MOUSE 탭
1816
- with gr.Tab("MOUSE > ", elem_id="mouse-tab", elem_classes="mouse-tab"):
1817
-
1818
- history = gr.State([])
1819
- setting = gr.State({
1820
- "system": SystemPrompt,
1821
- })
1822
-
1823
- with ms.Application() as app:
1824
- with antd.ConfigProvider():
1825
- # Drawer 컴포넌트들
1826
- with antd.Drawer(open=False, title="code", placement="left", width="750px") as code_drawer:
1827
- code_output = legacy.Markdown()
1828
-
1829
- with antd.Drawer(open=False, title="history", placement="left", width="900px") as history_drawer:
1830
- history_output = legacy.Chatbot(show_label=False, flushing=False, height=960, elem_classes="history_chatbot")
1831
-
1832
- with antd.Drawer(
1833
- open=False,
1834
- title="Templates",
1835
- placement="right",
1836
- width="900px",
1837
- elem_classes="session-drawer"
1838
- ) as session_drawer:
1839
- with antd.Flex(vertical=True, gap="middle"):
1840
- gr.Markdown("### Available Templates")
1841
- session_history = gr.HTML(
1842
- elem_classes="session-history"
1843
- )
1844
- close_btn = antd.Button(
1845
- "Close",
1846
- type="default",
1847
- elem_classes="close-btn"
1848
- )
1849
-
1850
- # 메인 컨텐츠를 위한 Row
1851
- with antd.Row(gutter=[32, 12]) as layout:
1852
- # 좌측 패널
1853
- with antd.Col(span=24, md=8):
1854
- with antd.Flex(vertical=True, gap="middle", wrap=True):
1855
- # 헤더 부분
1856
- header = gr.HTML(f"""
1857
- <div class="left_header">
1858
- <img src="data:image/gif;base64,{get_image_base64('mouse.gif')}" width="360px" />
1859
- <h1 style="font-size: 18px;">고양이도 발로 코딩하는 'MOUSE-I'</h2>
1860
- <h1 style="font-size: 10px;">템플릿의 프롬프트를 복사하여 붙여넣고 Send 클릭시 자동으로 코드가 생성됩니다. 생성 결과를 확인 배포하기 클릭시 글로벌 크라우드 Vercel을 통해 웹서비스가 배포됩니다. 생성된 코드만 프롬프트에 붙여넣고 'Code 실행' 버튼 클릭시 화면에 즉시 서비스가 실행. 문의: [email protected]</h1>
1861
- <h1 style="font-size: 12px; margin-top: 10px;">
1862
- <a href="https://openfree-mouse.hf.space" target="_blank" style="color: #0084ff; text-decoration: none; transition: color 0.3s;">
1863
- 🎨 [HOME] MOUSE로 생성한 웹앱 공개 갤러리 바로가기 클릭
1864
- </a>
1865
- </h1>
1866
- </div>
1867
- """)
1868
- # 입력 영역
1869
- input = antd.InputTextarea(
1870
- size="large",
1871
- allow_clear=True,
1872
- placeholder=random.choice(DEMO_LIST)['description']
1873
- )
1874
-
1875
-
1876
- # 버튼 그룹
1877
- with antd.Flex(gap="small", justify="space-between"):
1878
- btn = antd.Button("Send", type="primary", size="large")
1879
- boost_btn = antd.Button("Boost", type="default", size="large")
1880
- execute_btn = antd.Button("Code실행", type="default", size="large")
1881
- deploy_btn = antd.Button("배포", type="default", size="large")
1882
- clear_btn = antd.Button("클리어", type="default", size="large")
1883
-
1884
- deploy_result = gr.HTML(label="배포 결과")
1885
-
1886
- # 우측 패널
1887
- with antd.Col(span=24, md=16):
1888
- with ms.Div(elem_classes="right_panel"):
1889
- # 상단 버튼들
1890
- with antd.Flex(gap="small", elem_classes="setting-buttons"):
1891
- codeBtn = antd.Button("🧑‍💻 코드 보기", type="default")
1892
- historyBtn = antd.Button("📜 히스토리", type="default")
1893
- best_btn = antd.Button("🏆 베스트 템플릿", type="default")
1894
- trending_btn = antd.Button("🔥 트렌딩 템플릿", type="default")
1895
- new_btn = antd.Button("✨ NEW 템플릿", type="default")
1896
-
1897
- gr.HTML('<div class="render_header"><span class="header_btn"></span><span class="header_btn"></span><span class="header_btn"></span></div>')
1898
-
1899
- # 탭 컨텐츠
1900
- with antd.Tabs(active_key="empty", render_tab_bar="() => null") as state_tab:
1901
- with antd.Tabs.Item(key="empty"):
1902
- empty = antd.Empty(description="empty input", elem_classes="right_content")
1903
- with antd.Tabs.Item(key="loading"):
1904
- loading = antd.Spin(True, tip="coding...", size="large", elem_classes="right_content")
1905
- with antd.Tabs.Item(key="render"):
1906
- sandbox = gr.HTML(elem_classes="html_content")
1907
 
1908
  # 이벤트 핸들러 연결
1909
  execute_btn.click(
 
1812
  with gr.Tab("갤러리 >", elem_id="gallery-tab"):
1813
  gr.HTML(value=get_user_spaces())
1814
 
1815
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1816
 
1817
  # 이벤트 핸들러 연결
1818
  execute_btn.click(