kimddol commited on
Commit
2cc4827
·
verified ·
1 Parent(s): 841c0f3

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. frontend/app.py +5 -11
frontend/app.py CHANGED
@@ -12,9 +12,9 @@ with gr.Blocks(title='PersonaMate Pro (OAuth + Simplified UI)') as demo:
12
  with gr.Row():
13
  with gr.Column(scale=1):
14
  gr.Markdown('### 1) OAuth 로그인')
15
- btn_google=gr.Button('Google (YouTube) 로그인 열기')
16
- btn_instagram=gr.Button('Instagram 로그인 열기')
17
- btn_x=gr.Button('X (Twitter) 로그인 열기')
18
  with gr.Column(scale=2):
19
  gr.Markdown('### 2) 자동 수집')
20
  yt_chk=gr.Checkbox(label='YouTube 구독 목록 사용', value=True)
@@ -35,14 +35,8 @@ with gr.Blocks(title='PersonaMate Pro (OAuth + Simplified UI)') as demo:
35
  gr.Markdown('### 4) 추천 결과')
36
  result_table=gr.Dataframe(headers=["채널 이름","사이트 주소"], row_count=10, col_count=2)
37
 
38
- # 버튼 동작 연결
39
- import webbrowser
40
- def open_g(): webbrowser.open(f"{BACKEND}/oauth/google/start")
41
- def open_i(): webbrowser.open(f"{BACKEND}/oauth/instagram/start")
42
- def open_x(): webbrowser.open(f"{BACKEND}/oauth/x/start")
43
- btn_google.click(fn=open_g, inputs=[], outputs=[])
44
- btn_instagram.click(fn=open_i, inputs=[], outputs=[])
45
- btn_x.click(fn=open_x, inputs=[], outputs=[])
46
 
47
  def fetch_data_fn():
48
  try:
 
12
  with gr.Row():
13
  with gr.Column(scale=1):
14
  gr.Markdown('### 1) OAuth 로그인')
15
+ google_link=gr.Link("Google (YouTube) 로그인 열기", f"{BACKEND}/oauth/google/start")
16
+ instagram_link=gr.Link("Instagram 로그인 열기", f"{BACKEND}/oauth/instagram/start")
17
+ x_link=gr.Link("X (Twitter) 로그인 열기", f"{BACKEND}/oauth/x/start")
18
  with gr.Column(scale=2):
19
  gr.Markdown('### 2) 자동 수집')
20
  yt_chk=gr.Checkbox(label='YouTube 구독 목록 사용', value=True)
 
35
  gr.Markdown('### 4) 추천 결과')
36
  result_table=gr.Dataframe(headers=["채널 이름","사이트 주소"], row_count=10, col_count=2)
37
 
38
+ # 버튼 동작 연결 제거 (Hugging Face에서는 webbrowser.open 사용 불가)
39
+ # 대신 gr.Link 컴포넌트로 대체
 
 
 
 
 
 
40
 
41
  def fetch_data_fn():
42
  try: