Skip to content

Commit

Permalink
默认暗色护眼主题
Browse files Browse the repository at this point in the history
  • Loading branch information
binary-sky committed Apr 3, 2023
1 parent bd6eb90 commit aaf4475
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,12 @@ def route(k, *args, **kwargs):
# gradio的inbrowser触发不太稳定,回滚代码到原始的浏览器打开函数
def auto_opentab_delay():
import threading, webbrowser, time
print(f"如果浏览器没有自动打开,请复制并转到以下URL: http://localhost:{PORT}")
print(f"如果浏览器没有自动打开,请复制并转到以下URL:")
print(f"\t(亮色主体): http://localhost:{PORT}")
print(f"\t(暗色主体): http://localhost:{PORT}/?__dark-theme=true")
def open():
time.sleep(2)
webbrowser.open_new_tab(f"http://localhost:{PORT}")
webbrowser.open_new_tab(f"http://localhost:{PORT}/?__dark-theme=true")
threading.Thread(target=open, name="open-browser", daemon=True).start()

auto_opentab_delay()
Expand Down

0 comments on commit aaf4475

Please sign in to comment.