Skip to content

Commit 80006cf

Browse files
committed
add home page ui
1 parent 69504f1 commit 80006cf

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/wechaty/plugin.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,10 +584,24 @@ def __init__(
584584
scheduler.add_jobstore(scheduler_options.job_store, scheduler_options.job_store_alias)
585585
self.scheduler: AsyncIOScheduler = scheduler
586586

587-
self.static_file_cacher = StaticFileCacher()
587+
self.static_file_cacher = StaticFileCacher([
588+
os.path.join(os.path.dirname(__file__), 'ui')
589+
])
588590

589591
async def register_ui_view(self, app: Quart) -> None:
590592
"""register the system ui view"""
593+
@app.route('/')
594+
async def wechaty_ui_home_page() -> Response:
595+
"""home page of wechaty ui"""
596+
response = await send_file(
597+
os.path.join(
598+
os.path.dirname(__file__),
599+
'ui',
600+
'index.html'
601+
)
602+
)
603+
return response
604+
591605
@app.route('/plugins/list')
592606
async def get_plugins_nav() -> Response:
593607

0 commit comments

Comments
 (0)