feat(ui): Git 面板列表头显示 remote

列表只有仓库路径和分支,看不出这个仓库推到哪、也没法一眼确认有没有配远端。

ensureRepo 多读一条 git remote -v(取第一条 fetch,origin 惯例在最前),
URL 里的 user:pass 先脱敏再给前端;列表头渲染成「路径 · 分支 · origin」,
悬停看完整地址,没配 remote 时灰色标「无 remote」。
This commit is contained in:
2026-11-13 18:00:56 +08:00
parent 71f3cdb694
commit a0195c710b
3 changed files with 16 additions and 2 deletions
+4 -1
View File
@@ -54,7 +54,10 @@
const parts = [];
parts.push('<div class="vcs-list">');
if (st.repo) {
parts.push('<div class="vcs-repo">' + esc(st.repo.root) + (st.repo.branch ? ' · ' + esc(st.repo.branch) : '') + '</div>');
const rm = st.repo.remote;
parts.push('<div class="vcs-repo">' + esc(st.repo.root) + (st.repo.branch ? ' · ' + esc(st.repo.branch) : '') +
' · <span class="vcs-remote' + (rm ? '' : ' none') + '" title="' + esc(rm ? rm.url : '未配置 remote') + '">' +
esc(rm ? rm.name : '无 remote') + '</span></div>');
}
if (st.worktree && st.worktree.files) {
parts.push('<div class="vcs-item wt" data-act="worktree">' +