Update app.py
Browse files
app.py
CHANGED
|
@@ -747,13 +747,13 @@ with gr.Blocks(title="AI PROMPT ENHANCER", css=CUSTOM_CSS) as demo:
|
|
| 747 |
enhanced_image_output = gr.Image(label="", height=400)
|
| 748 |
|
| 749 |
# Tab 3: 내 계정
|
| 750 |
-
with gr.Tab("👤 내 계정"):
|
| 751 |
account_info = gr.Markdown("로그인이 필요합니다.")
|
| 752 |
history_display = gr.Dataframe(headers=["프롬프트", "생성일시", "상태"], interactive=False)
|
| 753 |
refresh_history_btn = gr.Button("🔄 새로고침")
|
| 754 |
|
| 755 |
# Tab 4: 관리자
|
| 756 |
-
with gr.Tab("🛠️ 관리자"):
|
| 757 |
admin_auth_status = gr.Markdown("관리자 권한이 필요합니다.")
|
| 758 |
with gr.Row(visible=False) as admin_panel:
|
| 759 |
with gr.Column():
|
|
@@ -838,6 +838,10 @@ with gr.Blocks(title="AI PROMPT ENHANCER", css=CUSTOM_CSS) as demo:
|
|
| 838 |
refresh_users_btn.click(load_admin_panel, [session_token], [admin_auth_status, admin_panel, admin_actions, stats_display, users_table])
|
| 839 |
toggle_active_btn.click(toggle_user_active, [session_token, user_id_input], [admin_action_status])
|
| 840 |
update_limit_btn.click(change_user_limit, [session_token, user_id_input, new_limit], [admin_action_status])
|
|
|
|
|
|
|
|
|
|
|
|
|
| 841 |
|
| 842 |
if __name__ == "__main__":
|
| 843 |
demo.launch()
|
|
|
|
| 747 |
enhanced_image_output = gr.Image(label="", height=400)
|
| 748 |
|
| 749 |
# Tab 3: 내 계정
|
| 750 |
+
with gr.Tab("👤 내 계정") as account_tab:
|
| 751 |
account_info = gr.Markdown("로그인이 필요합니다.")
|
| 752 |
history_display = gr.Dataframe(headers=["프롬프트", "생성일시", "상태"], interactive=False)
|
| 753 |
refresh_history_btn = gr.Button("🔄 새로고침")
|
| 754 |
|
| 755 |
# Tab 4: 관리자
|
| 756 |
+
with gr.Tab("🛠️ 관리자") as admin_tab:
|
| 757 |
admin_auth_status = gr.Markdown("관리자 권한이 필요합니다.")
|
| 758 |
with gr.Row(visible=False) as admin_panel:
|
| 759 |
with gr.Column():
|
|
|
|
| 838 |
refresh_users_btn.click(load_admin_panel, [session_token], [admin_auth_status, admin_panel, admin_actions, stats_display, users_table])
|
| 839 |
toggle_active_btn.click(toggle_user_active, [session_token, user_id_input], [admin_action_status])
|
| 840 |
update_limit_btn.click(change_user_limit, [session_token, user_id_input, new_limit], [admin_action_status])
|
| 841 |
+
|
| 842 |
+
# 탭 선택 시 자동 로드
|
| 843 |
+
admin_tab.select(load_admin_panel, [session_token], [admin_auth_status, admin_panel, admin_actions, stats_display, users_table])
|
| 844 |
+
account_tab.select(load_account_info, [session_token], [account_info, history_display])
|
| 845 |
|
| 846 |
if __name__ == "__main__":
|
| 847 |
demo.launch()
|