diff --git a/server/web/src/theme.css b/server/web/src/theme.css index 665571e..31ebaa5 100644 --- a/server/web/src/theme.css +++ b/server/web/src/theme.css @@ -13,6 +13,8 @@ --np-bg-soft: #0f1626; --np-panel-bg: rgba(15, 22, 38, 0.82); --np-panel-bg-strong: rgba(17, 24, 40, 0.94); + --np-sticky-bg: #0d1422; + --np-sticky-bg-hover: #121c2e; --np-bg-hover: rgba(76, 141, 255, 0.09); --np-border: #26314a; --np-border-soft: rgba(148, 163, 184, 0.13); @@ -55,6 +57,8 @@ --np-bg-soft: #ffffff; --np-panel-bg: rgba(255, 255, 255, 0.92); --np-panel-bg-strong: #ffffff; + --np-sticky-bg: #ffffff; + --np-sticky-bg-hover: #f3f7ff; --np-bg-hover: rgba(37, 99, 235, 0.06); --np-border: #d7e0ee; --np-border-soft: rgba(37, 99, 235, 0.1); diff --git a/server/web/src/views/Nodes.vue b/server/web/src/views/Nodes.vue index 2407b1f..7af088b 100644 --- a/server/web/src/views/Nodes.vue +++ b/server/web/src/views/Nodes.vue @@ -165,6 +165,13 @@ const clickable = (row, field, cls) => ({ onClick: () => openEdit(row, field), }); +// Keep the real width of every visible column instead of a fixed 1500px. A fixed +// scroll-x smaller than the sum squeezes columns and lets the sticky ops column +// sit on top of neighbouring text. +const tableScrollX = computed(() => + ALL_COLUMNS.filter((c) => visibleKeys.value.includes(c.key)).reduce((sum, c) => sum + c.width, 0) +); + const tableColumns = computed(() => ALL_COLUMNS.filter((c) => visibleKeys.value.includes(c.key)).map((c) => { const def = { @@ -439,13 +446,13 @@ const cbRowClass = (row) => {
节点列表 - 点击「区域 / 分组 / 标签 / 备注」单元格可直接编辑 + 点击「区域 / 分组 / 标签 / 备注」单元格可直接编辑 · 表格可左右滑动
{ letter-spacing: 0.04em; } .nodes-table :deep(.n-data-table-td) { font-size: 12.5px; } +/* The ops column is sticky. Naive paints every td with the theme's tdColor; + ours is transparent for the glass panel, so the cells scrolling underneath + showed through the button cell. Give the sticky column its own opaque + surface (and a divider) so the buttons always win the overlap. */ +.nodes-table :deep(.n-data-table-td--fixed-right) { + background: var(--np-sticky-bg) !important; + border-left: 1px solid var(--np-border-soft); + white-space: nowrap; +} +.nodes-table :deep(.n-data-table-th--fixed-right) { + background: var(--np-sticky-bg) !important; + border-left: 1px solid var(--np-border-soft); + z-index: 3; +} +.nodes-table :deep(.n-data-table-tr:hover .n-data-table-td--fixed-right) { + background: var(--np-sticky-bg-hover) !important; +} .np-edit-head { display: flex;