mirror of
https://github.com/Youzini-afk/ST-Bionic-Memory-Ecology.git
synced 2026-05-15 14:20:35 +08:00
Make persistence diagnostics detail two-column
This commit is contained in:
16
style.css
16
style.css
@@ -1689,6 +1689,16 @@
|
|||||||
.bme-persist-kv__row span { color: var(--bme-on-surface-dim); }
|
.bme-persist-kv__row span { color: var(--bme-on-surface-dim); }
|
||||||
.bme-persist-kv__row strong { color: var(--bme-on-surface); font-weight: 600; }
|
.bme-persist-kv__row strong { color: var(--bme-on-surface); font-weight: 600; }
|
||||||
|
|
||||||
|
.bme-persist-kv-columns {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bme-persist-kv-column {
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.bme-persist-guide {
|
.bme-persist-guide {
|
||||||
margin-top: 4px;
|
margin-top: 4px;
|
||||||
padding: 14px 16px;
|
padding: 14px 16px;
|
||||||
@@ -1728,6 +1738,12 @@
|
|||||||
color: var(--bme-on-surface-dim);
|
color: var(--bme-on-surface-dim);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 900px) {
|
||||||
|
.bme-persist-kv-columns {
|
||||||
|
grid-template-columns: minmax(0, 1fr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.bme-persist-actions {
|
.bme-persist-actions {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
|
|||||||
25
ui/panel.js
25
ui/panel.js
@@ -2530,14 +2530,25 @@ function _refreshTaskPersistence() {
|
|||||||
`主存储 · ${primaryTierLabel}`,
|
`主存储 · ${primaryTierLabel}`,
|
||||||
`确认 · ${acceptedSummaryLabel}`,
|
`确认 · ${acceptedSummaryLabel}`,
|
||||||
];
|
];
|
||||||
|
const collectVisibleRows = (rows = []) =>
|
||||||
|
rows.filter(([, value]) => value !== null && value !== undefined && value !== "");
|
||||||
|
const renderRow = ([key, value]) =>
|
||||||
|
`<div class="bme-persist-kv__row"><span>${_escHtml(String(key))}</span><strong>${_escHtml(String(value))}</strong></div>`;
|
||||||
const renderRows = (rows = []) =>
|
const renderRows = (rows = []) =>
|
||||||
rows
|
collectVisibleRows(rows)
|
||||||
.filter(([, value]) => value !== null && value !== undefined && value !== "")
|
.map(renderRow)
|
||||||
.map(
|
|
||||||
([key, value]) =>
|
|
||||||
`<div class="bme-persist-kv__row"><span>${_escHtml(String(key))}</span><strong>${_escHtml(String(value))}</strong></div>`,
|
|
||||||
)
|
|
||||||
.join("");
|
.join("");
|
||||||
|
const renderRowsTwoColumn = (rows = []) => {
|
||||||
|
const visibleRows = collectVisibleRows(rows);
|
||||||
|
if (!visibleRows.length) return "";
|
||||||
|
const splitIndex = Math.ceil(visibleRows.length / 2);
|
||||||
|
return `
|
||||||
|
<div class="bme-persist-kv-columns">
|
||||||
|
<div class="bme-persist-kv-column">${visibleRows.slice(0, splitIndex).map(renderRow).join("")}</div>
|
||||||
|
<div class="bme-persist-kv-column">${visibleRows.slice(splitIndex).map(renderRow).join("")}</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
};
|
||||||
|
|
||||||
const primaryRows = [
|
const primaryRows = [
|
||||||
["当前状态", acceptedSummaryLabel],
|
["当前状态", acceptedSummaryLabel],
|
||||||
@@ -2616,7 +2627,7 @@ function _refreshTaskPersistence() {
|
|||||||
<i class="fa-solid fa-stethoscope" style="margin-right:6px;color:var(--bme-primary)"></i>查看诊断细节
|
<i class="fa-solid fa-stethoscope" style="margin-right:6px;color:var(--bme-primary)"></i>查看诊断细节
|
||||||
</summary>
|
</summary>
|
||||||
<div style="margin-top:12px">
|
<div style="margin-top:12px">
|
||||||
${renderRows(diagnosticRows)}
|
${renderRowsTwoColumn(diagnosticRows)}
|
||||||
</div>
|
</div>
|
||||||
</details>
|
</details>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user