Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions module/webui/app_home.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,24 @@ def ui_check_announcement(self, force=False) -> None:
def run(self, initial_page="home") -> None:
# setup gui
set_env(title="AzurPilot", output_animation=False)
if get_localstorage("clarity_notice_shown") != "1":
set_localstorage("clarity_notice_shown", "1")
toast(
"本 WebUI 使用 Microsoft Clarity 收集页面访问、点击交互和性能数据,用于分析并改进使用体验。",
color="info",
duration=12,
)
# 加载 Microsoft Clarity 行为分析脚本,同一会话仅注入一次。
run_js(
"if (!document.getElementById('microsoft-clarity-script')) {"
"(function(c,l,a,r,i,t,y){"
"c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};"
"t=l.createElement(r);t.id='microsoft-clarity-script';t.async=1;"
"t.src='https://www.clarity.ms/tag/'+i;"
"y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);"
"})(window,document,'clarity','script','xszl2nrp3q');"
"}"
)
run_js(
"document.head.append(Object.assign(document.createElement('link'), { rel: 'manifest', href: '/static/assets/spa/manifest.json' }))"
)
Expand Down
Loading