fix(webui): prevent duplicate v prefix in version and link to GitHub repo

This commit is contained in:
Jason Xu committed 2026-10-17 19:45:45 +08:00
1 parent a9470df4fc
commit 83d623d541
3 files changed
+20 -2

No files matched your search

+9
View File
@@ -158,6 +158,15 @@ pre {
color: var(--text-3);
}
.sidebar-foot a {
text-decoration: none;
}
.sidebar-foot a:hover {
color: var(--text-1);
text-decoration: underline;
}
.content {
display: flex;
flex-direction: column;
+9 -1
View File
@@ -63,7 +63,15 @@
<button class="nav-item" data-page="account" data-i18n="nav.account">账号安全</button>
</div>
</nav>
<div class="sidebar-foot"><span id="version">版本 —</span></div>
<div class="sidebar-foot">
<a
id="version"
href="https://github.com/jasonxu114514/opencode2api"
target="_blank"
rel="noopener noreferrer"
>版本 —</a
>
</div>
</aside>
<div class="content">
+2 -1
View File
@@ -87,7 +87,8 @@ async function boot() {
setUnauthorizedHandler(showLogin);
store.on("monitor", (data) => {
$("#version").textContent = `v${data.version}`;
const version = String(data.version || "");
$("#version").textContent = version.startsWith("v") || version === "dev" ? version : `v${version}`;
});
for (const page of PAGES) page.init?.();