diff --git a/panel/web/src/pages/Admin.tsx b/panel/web/src/pages/Admin.tsx index 74b1996..bb0e654 100644 --- a/panel/web/src/pages/Admin.tsx +++ b/panel/web/src/pages/Admin.tsx @@ -1331,22 +1331,29 @@ function InstanceAdminCard({ return (
- {inst.name} + + {inst.name} + {badge.text} - {outdated && !acting && ( - - 可升级 - - )} - {inst.imageVersion && ( - - 镜像 {/^\d+\.\d+\.\d+$/.test(inst.imageVersion) ? `v${inst.imageVersion}` : inst.imageVersion.slice(0, 8)} - - )}
+ {/* 次要元数据独占一行(可换行),不再和名字挤在标题行导致名字被截断、徽标竖排换行 */} + {((outdated && !acting) || inst.imageVersion) && ( +
+ {outdated && !acting && ( + + 可升级 + + )} + {inst.imageVersion && ( + + 镜像 {/^\d+\.\d+\.\d+$/.test(inst.imageVersion) ? `v${inst.imageVersion}` : inst.imageVersion.slice(0, 8)} + + )} +
+ )}
{sub} {!acting && ` · 可访问 ${userCount} 人`} diff --git a/panel/web/src/styles.css b/panel/web/src/styles.css index 5edb1ca..427c94c 100644 --- a/panel/web/src/styles.css +++ b/panel/web/src/styles.css @@ -476,6 +476,7 @@ button { margin-left: 8px; vertical-align: middle; font-weight: 600; + white-space: nowrap; /* 徽标整体不换行,杜绝「可升\n级」竖排 */ } .tag-off { background: rgba(var(--danger-rgb) / 0.14); @@ -952,7 +953,7 @@ button { /* ---------- 实例网格 ---------- */ .inst-grid { display: grid; - grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); + grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 14px; margin-bottom: 22px; /* 各卡片按自身内容高度,避免某张展开「管理」菜单时同行其它卡片被拉等高(显得也展开了) */ @@ -989,6 +990,8 @@ button { gap: 8px; } .inst-name { + flex: 1; /* 吃满剩余宽度,名字有充分空间,只在真的过长时才省略 */ + min-width: 0; /* 允许在 flex 容器内收缩以触发省略号 */ font-size: 16px; font-weight: 700; color: var(--text); @@ -996,6 +999,23 @@ button { text-overflow: ellipsis; white-space: nowrap; } +/* 标题行的状态徽标:不参与收缩、整体不换行(此前会被挤成「在\n线」竖排) */ +.inst-head > .tag { + flex: none; + margin-left: 0; + white-space: nowrap; +} +/* 次要元数据行:可升级 / 镜像版本,独立成行、可自然换行 */ +.inst-meta { + display: flex; + flex-wrap: wrap; + gap: 6px; + margin-top: 8px; +} +.inst-meta .tag { + margin-left: 0; + white-space: nowrap; +} .inst-sub { margin-top: 6px; font-size: 13px;