diff --git a/plugins/sentinel/dashboard.html b/plugins/sentinel/dashboard.html index 79bee1b..0281f76 100644 --- a/plugins/sentinel/dashboard.html +++ b/plugins/sentinel/dashboard.html @@ -56,12 +56,14 @@ .node-notes { font-size:.75rem; color:var(--text-dim); font-style:italic; margin-bottom:8px } /* 横版布局 — 左中右三列 */ #sentinel-grid.layout-row { display:flex;flex-direction:column;gap:12px } - #sentinel-grid.layout-row .node-card { display:grid;grid-template-columns:220px 1fr 180px;gap:16px;align-items:start } - #sentinel-grid.layout-row .row-extra { display:contents } + #sentinel-grid.layout-row .node-card { display:grid;grid-template-columns:220px 1fr 180px;gap:12px 16px;align-items:start } + #sentinel-grid.layout-row .col-left { min-width:0 } + #sentinel-grid.layout-row .col-mid { min-width:0 } + #sentinel-grid.layout-row .col-right { display:flex;flex-direction:column;gap:8px } #sentinel-grid.layout-row .col-chart { display:flex;flex-direction:column;gap:4px } #sentinel-grid.layout-row .col-chart canvas { border-radius:4px;background:var(--md-sys-color-surface-container-lowest) } #sentinel-grid.layout-row .col-info { text-align:right } - #sentinel-grid.layout-row .node-time { grid-column:1/-1 } + #sentinel-grid.layout-row .node-time { grid-column:1/-1;margin-top:8px } #sentinel-grid.layout-row .metric-bar { display:none } .metric-row { display:flex; gap:12px; margin-bottom:8px } .metric { flex:1 } @@ -177,26 +179,32 @@ card.setAttribute('data-id', id); var plat = n.platform || {}; var sysInfo = (plat.system||'') + (plat.release ? ' ' + plat.release : '') + (plat.machine ? ' | ' + plat.machine : ''); - // 两种模式用同一套 DOM, CSS 控制布局 - card.innerHTML = - '
'+(n.online?'🟢':'🔴')+' '+esc(n.name)+'
'+ - (sysInfo.trim() ? '
'+esc(sysInfo)+'
' : '')+ - '
'+esc(n.url||'')+'
'+ - (n.notes ? '
📝 '+esc(n.notes)+'
' : '')+ - '
'+ - '
'; if (isRow) { - // 横版: 额外加折线图 canvas + 右侧信息区 - var rowExtra = document.createElement('div'); - rowExtra.className = 'row-extra'; - rowExtra.innerHTML = - '
'+ - ''+ - ''+ - ''+ + card.innerHTML = + '
'+ + '
'+(n.online?'🟢':'🔴')+' '+esc(n.name)+'
'+ + (sysInfo.trim() ? '
'+esc(sysInfo)+'
' : '')+ + '
'+esc(n.url||'')+'
'+ + (n.notes ? '
📝 '+esc(n.notes)+'
' : '')+ '
'+ - '
'; - card.appendChild(rowExtra); + '
'+ + '
'+ + '
'+ + ''+ + ''+ + ''+ + '
'+ + '
'+ + '
'+ + '
'; + } else { + card.innerHTML = + '
'+(n.online?'🟢':'🔴')+' '+esc(n.name)+'
'+ + (sysInfo.trim() ? '
'+esc(sysInfo)+'
' : '')+ + '
'+esc(n.url||'')+'
'+ + (n.notes ? '
📝 '+esc(n.notes)+'
' : '')+ + '
'+ + '
'; } grid.appendChild(card); _cardCache[id] = card;