From 4bc2eec34013251762f5593029343d9569f648cf Mon Sep 17 00:00:00 2001 From: fn-deepseek-harness Date: Sat, 17 Oct 2026 22:40:30 +0800 Subject: [PATCH] =?UTF-8?q?style:=20v1.6.1=20=E2=80=94=20=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E9=A1=B5=E6=98=8E=E7=BB=86=E8=A1=A8=E6=8E=92=E7=89=88?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 原来每列都挤、仓库名和分支名被折成两三行、核对时间占两行、提交信息撑高行高、 两个操作按钮上下堆叠。重做表格: - 固定列宽(table-layout:fixed + colgroup),按内容实测分配,1280px 起不再折行 仓库名 17%(DCU_DesktopController 全名显示不截断)、提交列 19% - 仓库名下方小字显示占用大小,省掉一列 - 状态/GitHub 核对改为彩色圆角小标签(✓ 已同步 / ≠ 不同 等),一眼可辨 - 最新提交:短 hash 灰底小标签 + 单行省略的消息,作者/时间降到下方小字 - 最近推送:时间在上、日期在下两行,不再挤成一坨 - 分支/标签合并为「1 / 0」紧凑格式,表头说明 - 操作列两个按钮横排,同步为主色按钮 - 标题栏右侧放「核对 GitHub 实况」,说明文字单独一行,不再和按钮抢位置 - 窄屏卡片模式同步适配新结构(仓库名整行、内容右对齐) - 修 ckChip 映射 bug:same 状态误用了 check 类名,导致「一致」标签没样式 --- GiteaHubSync/app/backend/panel.py | 129 ++++++++++++++++++++++++------ GiteaHubSync/manifest | 2 +- 2 files changed, 107 insertions(+), 24 deletions(-) diff --git a/GiteaHubSync/app/backend/panel.py b/GiteaHubSync/app/backend/panel.py index 68b60db..38bb24d 100644 --- a/GiteaHubSync/app/backend/panel.py +++ b/GiteaHubSync/app/backend/panel.py @@ -1042,6 +1042,38 @@ td.ok{color:#0a7d34;font-weight:600;white-space:nowrap} td.warn{color:#b45309;font-weight:600;white-space:nowrap} .mono{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px} .commit{color:#646a73;font-size:12px;margin-top:2px;line-height:1.5} +/* ---------- 状态页明细表(紧凑排版) ---------- */ +.tblhead{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:12px 0 10px} +.tbltip{font-size:12px;color:#8a919e;line-height:1.6;flex:1;min-width:220px} +table.detail{table-layout:fixed;font-size:13px} +table.detail th,table.detail td{padding:11px 9px;vertical-align:middle} +table.detail th{font-size:11.5px;color:#8a919e;font-weight:600;border-bottom:1.5px solid #e8ebef;white-space:nowrap;padding-bottom:9px} +table.detail tbody tr{border-bottom:1px solid #f1f3f6} +table.detail tbody tr:hover{background:#fafbfc} +table.detail tbody tr:last-child{border-bottom:none} +.repo-name{font-weight:600;font-size:13.5px;color:#1f2329;white-space:nowrap;overflow:hidden;text-overflow:ellipsis} +.repo-sub{font-size:11px;color:#a0a6b0;margin-top:3px;white-space:nowrap} +.stg{display:inline-flex;align-items:center;gap:4px;font-size:12px;font-weight:600;padding:3px 9px;border-radius:999px;white-space:nowrap} +.stg.ok{background:#e3f5e9;color:#0a7d34} +.stg.warn{background:#fffaeb;color:#b45309} +.ck{display:inline-flex;align-items:center;gap:4px;font-size:12px;font-weight:600;padding:3px 9px;border-radius:999px;white-space:nowrap;cursor:default} +.ck.same{background:#e3f5e9;color:#0a7d34} +.ck.diff{background:#fffaeb;color:#b45309} +.ck.unknown{background:#f1f3f5;color:#959ca8} +.br-name{font-size:12.5px;color:#374151;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-family:ui-monospace,SFMono-Regular,Menlo,monospace} +.br-count{font-size:12.5px;color:#4e5969;white-space:nowrap;font-family:ui-monospace,SFMono-Regular,Menlo,monospace} +.br-count b{font-weight:600;color:#1f2329} +.time-cell{font-size:12.5px;color:#4e5969;white-space:nowrap;line-height:1.35} +.time-cell .d{display:block;font-size:11px;color:#a0a6b0;margin-top:2px} +.cmt{display:flex;align-items:center;gap:7px;min-width:0} +.cmt .h{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px;background:#f1f3f5;color:#4e5969;border-radius:5px;padding:2px 6px;flex:none;letter-spacing:.2px} +.cmt .m{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;color:#1f2329;font-size:12.5px} +.cmt-sub{font-size:11px;color:#a0a6b0;margin-top:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis} +.size-cell{font-size:12.5px;color:#4e5969;white-space:nowrap;text-align:right} +.rowact{display:flex;gap:6px;justify-content:flex-end;flex-wrap:nowrap} +.rowact button{padding:5px 11px;font-size:12px;border-radius:8px;white-space:nowrap} +.rowact .b-pri{background:#0a7d34;color:#fff} +.rowact .b-pri:hover{background:#086b2c} h2{font-size:15px;margin-bottom:12px;color:#1f2329} pre{background:#0d1117;color:#c9d1d9;border-radius:10px;padding:14px;font-size:12px;line-height:1.6;max-height:300px;overflow:auto;white-space:pre-wrap;word-break:break-all} .tip{font-size:12px;color:#646a73;margin-top:10px;line-height:1.6} @@ -1167,6 +1199,22 @@ td.ops button,td.ops .pill{margin:2px 4px 2px 0} table.resp tbody td .val{flex:1;text-align:right;min-width:0;word-break:break-word} table.resp tbody td:has(button){justify-content:flex-end} table.resp tbody td:has(button)::before{margin-right:auto} + /* 明细表在窄屏也保持卡片化,但内容右对齐更整齐 */ + table.detail{font-size:13px} + table.detail tbody td{padding:6px 0;align-items:center} + table.detail tbody td[data-label="项目"]{padding-top:2px;padding-bottom:8px;border-bottom:1px dashed #eef0f3;margin-bottom:4px;justify-content:flex-start} + table.detail tbody td[data-label="项目"]::before{display:none} + table.detail .repo-name{font-size:14px;white-space:normal;word-break:break-all} + table.detail .repo-sub{display:inline-block;margin-top:2px} + table.detail tbody td[data-label="最新提交"]{align-items:flex-start} + table.detail tbody td[data-label="最新提交"]>div{max-width:78%} + table.detail .cmt{justify-content:flex-end;flex-wrap:wrap} + table.detail .cmt .m{white-space:normal;word-break:break-word;text-align:right} + table.detail .cmt-sub{white-space:normal} + table.detail .size-cell{text-align:right} + table.detail .rowact{flex:1;justify-content:flex-end;flex-wrap:wrap} + table.detail .rowact button{flex:none} + .tbltip{display:none} pre{font-size:11px;padding:10px} } """ @@ -1283,16 +1331,22 @@ PAGE_STATUS = """
-

项目明细

- -
-
-
+

项目明细

+
+
+
- - +
项目状态默认分支分支/标签最近推送同步GitHub 核对最新提交大小
+ + + + + + + +
项目状态默认分支分支/标签最近推送GitHub 核对最新提交操作
@@ -1318,27 +1372,56 @@ async function refresh(){ ?(rt.pending.length+' 个待重试 · '+rt.next_in+'s后(最多'+rt.max+'次)') :'无待重试'; document.getElementById('sSize').textContent=s.total_size_mb+' MB'; - document.getElementById('sTarget').textContent='同步目标: '+(s.account?s.account.gh_user+'('+s.account.method+')':'未配置')+' · '+(s.max_workers||1)+' 个并行 · Gitea '+(s.gitea_online?'在线 ✓':'离线 ✗'); + document.getElementById('sTarget').textContent=(s.account?s.account.gh_user+'('+s.account.method+')':'未配置')+' · '+(s.max_workers||1)+' 个并行 · Gitea '+(s.gitea_online?'在线 ✓':'离线 ✗'); const vg=!!s.verify_github; - document.getElementById('cmpTip').innerHTML='推送前会先读 GitHub 上的分支和提交号:一致就跳过,不同才推送。' - +'当前模式:'+(vg?'每轮都核对(严格)':'仅本地有新提交时核对(省流量)')+',可在设置里切换。'; + document.getElementById('cmpTip').innerHTML='推送前先读 GitHub 上的分支和提交号,一致就跳过,不同才推送。当前模式:'+(vg?'每轮都核对(严格)':'仅本地有新提交时核对(省流量)')+',可在 设置 里切换。'; + const stChip=(t,c)=>`${t}`; + const ckChip=(v)=>{ + const m={same:['same','✓ 一致'],diff:['diff','≠ 不同'],unknown:['unknown','? 未知']}; + const it=m[v]||m.unknown; + return `${it[1]}`; + }; document.getElementById('tb').innerHTML=s.repos.map(r=>{ const att=(rt.attempts||{})[r.name]; - const stTxt=r.status==='已同步'?'✓ 已同步':(att!=null?('⏳ 重试中 '+att+'/'+(rt.max||5)):'⏳ 未同步'); - const stCls=r.status==='已同步'?'ok':'warn'; - const st=`${stTxt}`; + const stTxt=r.status==='已同步'?'✓ 已同步':(att!=null?('⏳ 重试 '+att+'/'+(rt.max||5)):'⏳ 未同步'); + const st=stChip(stTxt, r.status==='已同步'?'ok':'warn'); const cp=r.compare; - let cpHtml='未核对'; - if(cp){ - const map={same:['✓ 一致','ok'],diff:['≠ 不同','warn'],unknown:['? 未知','warn']}; - const mm=map[cp.verdict]||['? 未知','warn']; - cpHtml=`${mm[0]}` - +`
${esc(cp.at)}
`; + const cpHtml=cp?ckChip(cp.verdict):'— 未核对'; + const cpTip=cp?(` title="核对时间 ${esc(cp.at)} · ${esc(cp.detail)}"`):''; + // 最近推送:日期与时间分行,避免挤成一坨 + let pushHtml='—'; + if(r.last_push&&r.last_push.includes(' ')){ + const [d,t]=r.last_push.split(' '); + pushHtml=`
${esc(t)}${esc(d)}
`; + }else if(r.last_push){pushHtml=`
${esc(r.last_push)}
`} + // 最新提交:hash 用小标签,消息单行省略,作者/时间放下方 + let cmtHtml='—'; + if(r.last_commit){ + const c=r.last_commit; + cmtHtml=`
+ ${esc(c.hash)}${esc(c.msg||'')} +
+
${esc(c.author||'')}${c.time?' · '+esc(c.time):''}
`; } - const c=r.last_commit?`
${esc(r.last_commit.hash)} ${esc(r.last_commit.msg)} · ${esc(r.last_commit.author)} · ${esc(r.last_commit.time)}
`:'
—
'; - return `${esc(r.name)}${st}${esc(r.head||'—')}${r.branches} / ${r.tags}${r.last_push||'—'}${cpHtml}${c}${r.size_mb} MB `; - }).join('')||'还没有同步项目,去项目管理添加'; - }catch(e){document.getElementById('tb').innerHTML='刷新失败: '+e+''} + const headHtml=`
${esc(r.head||'—')}
`; + return ` + +
${esc(r.name)}
+
${r.size_mb} MB
+ + ${st} + ${headHtml} +
${r.branches} / ${r.tags}
+ ${pushHtml} + ${cpHtml} + ${cmtHtml} +
+ + +
+ `; + }).join('')||'还没有同步项目,去项目管理添加'; + }catch(e){document.getElementById('tb').innerHTML='刷新失败: '+e+''} } async function checkOne(n){ const r=await (await fetch('api/repos/check',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({name:n})})).json(); diff --git a/GiteaHubSync/manifest b/GiteaHubSync/manifest index 1a77f90..35ad3bf 100644 --- a/GiteaHubSync/manifest +++ b/GiteaHubSync/manifest @@ -1,5 +1,5 @@ appname = GiteaHubSync -version = 1.6.0 +version = 1.6.1 display_name = Gitea→GitHub 同步助手 desc = 每次推送到飞牛 Gitea 的代码,10 秒内自动镜像到 GitHub 的 7 个私有仓库。内置控制面板:自动同步开关、立即同步、仓库状态、同步日志,一键打开 Gitea。数据全部保存在 NAS 本地。 platform = all