From d680ba77f97e3a79bc5903cb204cd37ec122206c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B8=A1=E5=8F=A3=E6=B5=AA=E4=BA=BA?= Date: Fri, 23 Oct 2026 21:04:01 +0800 Subject: [PATCH] fix: group source library tabs and images in a dedicated panel --- SHA256SUMS | 4 ++-- pigway_frame_flow/web/libraries.js | 9 ++++++--- pigway_frame_flow/web/style.css | 8 ++++++++ 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/SHA256SUMS b/SHA256SUMS index 87d2af5..45920d8 100644 --- a/SHA256SUMS +++ b/SHA256SUMS @@ -139,10 +139,10 @@ d7d55b06ead173b4c23a277fa39800cadfc18f1163c500e8617cfc1f4ee0dea9 pigway_frame_f 1f77efa9acfb40872593e3b7c475d972b960cb9f21e9afb936add03c3f2dd542 pigway_frame_flow/web/features.js a07ea444ab4ac75ea11e1188a431b48195353b1e08f7e80f3b931e8097ea6221 pigway_frame_flow/web/i18n.js 6385ec8b0383fa9bdbb23c4c685c8ef1afd7926fd74c8032811e647808548255 pigway_frame_flow/web/index.html -a68b22ea3baf2a1b9d44f58d59e4bcc27017af49b852b5f76815634539c9c698 pigway_frame_flow/web/libraries.js +3102475828fe978b7b7e9fda9cd9adfce4fc788b8a569ac8f2806ebde8333f9a pigway_frame_flow/web/libraries.js 0fa494a3fbd456c754bbea3f7f050be139e32e3b42b09a1ed953094087437210 pigway_frame_flow/web/logo-symbol.svg 9dcf0419d0292efce8ead7309dc70b4afd27dd24fe82cf9e673682342650f4da pigway_frame_flow/web/source-browser.js -e857baff294a00e9799d2b6b5473644f836f507f4aab8044a6a99fb9f48234b1 pigway_frame_flow/web/style.css +321f47b115653673a8403107b4ac3f3b8421feb02e4ed14e6019e686b9b5b0de pigway_frame_flow/web/style.css cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 pigway_frame_flow/web/swagger-LICENSE 050bc415ee7048dcd881682678f720264e7da5e373f7461d7c58c755305255f7 pigway_frame_flow/web/swagger-ui-bundle.js 1ac324f7dcd27e4b9386b4bd6421271ec147e922a22c05ba24b11515e9aa6321 pigway_frame_flow/web/swagger-ui.css diff --git a/pigway_frame_flow/web/libraries.js b/pigway_frame_flow/web/libraries.js index eb975fb..1bcb2e1 100644 --- a/pigway_frame_flow/web/libraries.js +++ b/pigway_frame_flow/web/libraries.js @@ -41,12 +41,15 @@ async function sourceLibraryPage(epoch,sources,terminals){ if(epoch!==state.epoch)return; if(libraryUI.plan&&!plans.some(p=>p.id===libraryUI.plan))libraryUI.plan=null; const plan=plans.find(p=>p.id===libraryUI.plan),uses=terminals.filter(t=>t.binding?.source_id===sourceId&&(!plan||t.binding.plan_id===plan.id)); - panel.innerHTML=`

${tr('源画面先保存到本地;同一张照片按不同方案生成版本,多个终端可共用一份版本。Photos 画面可能是源预览。','Source pixels are stored locally first. Plans create versions of the same photo; terminals may share one version. Photos may supply source previews.')}

${plan&&!plan.archived?``:''}

${tr('使用终端:','Used by: ')}${uses.map(terminalLabel).map(esc).join('、')||tr('尚未绑定','No terminals bound')}

`; $('#library-source').onchange=()=>{libraryUI.source=$('#library-source').value;libraryUI.plan=null;libraryUI.offset=0;return navigate();}; - document.querySelectorAll('[data-library-plan]').forEach(b=>b.onclick=()=>{libraryUI.plan=b.dataset.libraryPlan||null;return navigate();}); + document.querySelectorAll('[data-library-plan]').forEach(b=>{ + b.onclick=()=>{libraryUI.plan=b.dataset.libraryPlan||null;return navigate();}; + b.onkeydown=async e=>{const tabs=[...document.querySelectorAll('[data-library-plan]')],index=tabs.indexOf(b);let next;if(e.key==='ArrowRight')next=(index+1)%tabs.length;else if(e.key==='ArrowLeft')next=(index+tabs.length-1)%tabs.length;else if(e.key==='Home')next=0;else if(e.key==='End')next=tabs.length-1;else return;e.preventDefault();libraryUI.plan=tabs[next].dataset.libraryPlan||null;await navigate();document.querySelector('[data-library-plan][aria-selected="true"]')?.focus();}; + }); bind('library-import',()=>libraryImportDialog(sourceId));bind('library-source-settings',()=>navigate('photo-sources'));bind('library-legacy',()=>libraryLegacy('local')); bind('library-new-plan',()=>generationPlanEditor(sourceId,null,page.items));bind('library-edit-plan',()=>generationPlanEditor(sourceId,plan,page.items)); bind('library-delete-plan',()=>confirmDialog(tr('删除此方案?已有生成版本保留参数快照;正在被终端使用的方案不能删除。','Delete this plan? Existing versions keep their snapshots. Bound plans cannot be deleted.'),async()=>{await api('/api/v1/generation-plans/'+plan.id,{method:'DELETE'});await navigate();})); diff --git a/pigway_frame_flow/web/style.css b/pigway_frame_flow/web/style.css index 5c23d84..65ad104 100644 --- a/pigway_frame_flow/web/style.css +++ b/pigway_frame_flow/web/style.css @@ -283,3 +283,11 @@ form#history-filters{display:grid;grid-template-columns:repeat(3,minmax(0,1fr)); .browse-folder{overflow-wrap:anywhere} @media(max-width:1050px){.source-browser-filters{grid-template-columns:repeat(2,minmax(0,1fr))}} @media(max-width:480px){.source-browser-filters{grid-template-columns:minmax(0,1fr)}} + +.library-source-controls>.hint:last-child{margin-bottom:0} +.library-output-panel{margin-top:20px} +.library-output-panel>.library-plan-toolbar{border-bottom:1px solid var(--border);padding-bottom:12px;margin-bottom:14px} +.library-output-panel .library-plan-tabs{background:transparent;padding:0;border-radius:0;gap:6px} +.library-output-panel .library-plan-tabs button{border-radius:8px 8px 0 0;border-bottom:2px solid transparent} +.library-output-panel .library-plan-tabs button.active{border-bottom-color:var(--accent)} +.library-output-panel .library-pagination{margin-bottom:0}