From 8cd005fd891a68a78a80fcd38e44b9f30dfa606b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B8=A1=E5=8F=A3=E6=B5=AA=E4=BA=BA?= Date: Sun, 18 Oct 2026 14:26:59 +0800 Subject: [PATCH] fix: show target frame in a dedicated automation column --- pigway_frame_flow/web/app.js | 2 +- pigway_frame_flow/web/style.css | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pigway_frame_flow/web/app.js b/pigway_frame_flow/web/app.js index a40dfaa..20df0cd 100644 --- a/pigway_frame_flow/web/app.js +++ b/pigway_frame_flow/web/app.js @@ -175,7 +175,7 @@ async function jobEditor(job){ views.automation=async epoch=>{ const jobs=await api('/api/v1/jobs'); if(epoch!==state.epoch)return; - $('#main').innerHTML=notice()+`

${state.lang==='zh'?'上海时间':'Shanghai time'} · ${t('automation')}

${buttons('new-job','newJob',true)}
${jobs.length?`
${['name','schedule','status','nextRun','lastRun','result','action'].map(key=>``).join('')}${jobs.map((job,index)=>``).join('')}
${t(key)}
${esc(job.name)}
${esc(deviceDisplayName(state.devices.find(d=>d.id===job.device_id)||{id:job.device_id,name:job.device_id}))}
${esc(scheduleSummary(job.schedule))}${t(job.enabled?'enabled':'disabled')}${fmt(job.next_run)}${fmt(job.last_run)}${esc(job.last_result)}
`:`
${t('noTasks')}
`}
`; + $('#main').innerHTML=notice()+`

${state.lang==='zh'?'上海时间':'Shanghai time'} · ${t('automation')}

${buttons('new-job','newJob',true)}
${jobs.length?`
${['name','targetFrame','schedule','status','nextRun','lastRun','result','action'].map(key=>``).join('')}${jobs.map((job,index)=>``).join('')}
${key==='targetFrame'?tr('目标相框','Target frame'):t(key)}
${esc(job.name)}${esc(deviceDisplayName(state.devices.find(d=>d.id===job.device_id)||{id:job.device_id,name:job.device_id}))}${esc(scheduleSummary(job.schedule))}${t(job.enabled?'enabled':'disabled')}${fmt(job.next_run)}${fmt(job.last_run)}${esc(job.last_result)}
`:`
${t('noTasks')}
`}
`; bind('new-job',()=>jobEditor()); document.querySelectorAll('[data-job-edit]').forEach(button=>button.onclick=()=>jobEditor(jobs[button.dataset.jobEdit])); document.querySelectorAll('[data-job-toggle]').forEach(button=>button.onclick=busy(async()=>{const job=jobs[button.dataset.jobToggle];await api('/api/v1/jobs/'+job.id,{method:'PUT',body:jobPayload(job,{enabled:!job.enabled})});await navigate();})); diff --git a/pigway_frame_flow/web/style.css b/pigway_frame_flow/web/style.css index af986f2..7b878b9 100644 --- a/pigway_frame_flow/web/style.css +++ b/pigway_frame_flow/web/style.css @@ -220,3 +220,7 @@ form#mqtt-config{grid-template-columns:minmax(160px,1fr) 110px minmax(180px,1.5f @media(max-width:720px){#client-form>.field{grid-column:auto}} .settings-columns>.card:nth-child(2) .detail-grid{grid-template-columns:minmax(0,1fr)} #storage-estimate:empty,#hook-secret:empty{display:none} + +.automation-table{min-width:1200px} +.automation-table td:is(:nth-child(2),:nth-child(5),:nth-child(6)){white-space:nowrap} +.automation-table .row-actions{flex-wrap:nowrap}