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