diff --git a/stash-web/src/App.css b/stash-web/src/App.css index d1224f9..fa54630 100644 --- a/stash-web/src/App.css +++ b/stash-web/src/App.css @@ -42,9 +42,9 @@ /* ---------- 页头 ---------- */ .site-header-inner { - display: flex; + display: grid; + grid-template-columns: minmax(0, 1fr) minmax(0, 720px) minmax(0, 1fr); align-items: center; - justify-content: space-between; gap: var(--su-space-4); width: 100%; max-width: var(--su-layout-width); @@ -133,14 +133,22 @@ white-space: nowrap; } -/* 滚动信息只占中间约 2/3,并靠右贴近操作图标 */ +/* 滚动信息居中,左右列等宽 */ +.header-ticker-slot { + justify-self: center; + width: 100%; + min-width: 0; +} + .header-ticker { - max-width: 720px; - margin-left: auto; + width: 100%; + max-width: none; + margin: 0; } .header-actions { - /* 靠右交给 .header-ticker 的 margin-left: auto;没有滚动信息时由 space-between 兜住 */ + justify-self: end; + /* 靠右对齐到页头右边缘 */ flex: none; } diff --git a/stash-web/src/components/header/SiteHeader.tsx b/stash-web/src/components/header/SiteHeader.tsx index 8cf850c..205bba6 100644 --- a/stash-web/src/components/header/SiteHeader.tsx +++ b/stash-web/src/components/header/SiteHeader.tsx @@ -76,20 +76,22 @@ export function SiteHeader({ logo={site.brand.logo} /> - {headerEnabled && ( - - {headerItems.map((item, index) => ( - - {item.tag !== undefined && item.tag !== null && item.tag !== '' && ( - - {item.tag} - - )} - {fillHeaderText(item.text, context)} - - ))} - - )} +
+ {headerEnabled && ( + + {headerItems.map((item, index) => ( + + {item.tag !== undefined && item.tag !== null && item.tag !== '' && ( + + {item.tag} + + )} + {fillHeaderText(item.text, context)} + + ))} + + )} +
{site.actions.theme && ( diff --git a/stash-web/src/components/sidebar/ServicePanel.tsx b/stash-web/src/components/sidebar/ServicePanel.tsx index a28fbd5..4e8bf0d 100644 --- a/stash-web/src/components/sidebar/ServicePanel.tsx +++ b/stash-web/src/components/sidebar/ServicePanel.tsx @@ -64,19 +64,23 @@ export function ServicePanel({ 重新扫描 - } onClick={(event) => { - // 无修饰键时接管点击,走站内路由,只换右侧内容;按住修饰键仍可新标签打开 - if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return - event.preventDefault() + // 无修饰键时走站内路由;按住修饰键仍可新标签打开接口页 + if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) { + window.open('/interface', '_blank', 'noopener') + return + } onOpenApi() }} + title="查看接口一览" > - 查看接口 - +
)