From 218ad6bbe0a91a97c32026f62651d173df89c0bb Mon Sep 17 00:00:00 2001 From: t0ng7u Date: Fri, 18 Jul 2025 01:06:18 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20refactor(ui):=20scope=20table=20?= =?UTF-8?q?scrolling=20to=20console=20cards=20&=20refine=20overall=20layou?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary Implement a dedicated, reusable scrolling mechanism for all console-table pages while keeping header and sidebar fixed, plus related layout improvements. Key Changes • Added `.table-scroll-card` utility class  – Provides flex column layout and internal vertical scrolling  – Desktop height: `calc(100vh - 110px)`; Mobile (<768 px) height: `calc(100vh - 77px)`  – Hides scrollbars cross-browser (`-ms-overflow-style`, `scrollbar-width`, `::-webkit-scrollbar`) • Replaced global `.semi-card` scrolling rules with `.table-scroll-card` to avoid affecting non-table cards • Updated table components (Channels, Tokens, Users, Logs, MjLogs, TaskLogs, Redemptions) to use the new class • PageLayout  – Footer is now suppressed for all `/console` routes  – Confirmed only central content area scrolls; header & sidebar remain fixed • Restored hidden scrollbar rules for `.semi-layout-content` and removed unnecessary global overrides • Minor CSS cleanup & comment improvements for readability Result Console table pages now fill the viewport with smooth, internal scrolling and no visible scrollbars, while other cards and pages remain unaffected. --- web/src/components/auth/LoginForm.js | 2 +- .../components/auth/PasswordResetConfirm.js | 2 +- web/src/components/auth/PasswordResetForm.js | 2 +- web/src/components/auth/RegisterForm.js | 2 +- web/src/components/layout/PageLayout.js | 2 +- .../components/settings/PersonalSetting.js | 2 +- web/src/components/table/ChannelsTable.js | 2 +- web/src/components/table/LogsTable.js | 2 +- web/src/components/table/MjLogsTable.js | 2 +- web/src/components/table/RedemptionsTable.js | 2 +- web/src/components/table/TaskLogsTable.js | 2 +- web/src/components/table/TokensTable.js | 2 +- web/src/components/table/UsersTable.js | 2 +- web/src/index.css | 35 +++++++++++++++---- web/src/pages/About/index.js | 2 +- web/src/pages/Channel/index.js | 2 +- web/src/pages/Chat/index.js | 2 +- web/src/pages/Chat2Link/index.js | 2 +- web/src/pages/Detail/index.js | 2 +- web/src/pages/Home/index.js | 2 +- web/src/pages/Log/index.js | 2 +- web/src/pages/Midjourney/index.js | 2 +- web/src/pages/NotFound/index.js | 2 +- web/src/pages/Playground/index.js | 2 +- web/src/pages/Pricing/index.js | 2 +- web/src/pages/Redemption/index.js | 2 +- web/src/pages/Setting/index.js | 2 +- web/src/pages/Setup/index.js | 2 +- web/src/pages/Task/index.js | 2 +- web/src/pages/Token/index.js | 2 +- web/src/pages/TopUp/index.js | 2 +- web/src/pages/User/index.js | 2 +- 32 files changed, 59 insertions(+), 38 deletions(-) diff --git a/web/src/components/auth/LoginForm.js b/web/src/components/auth/LoginForm.js index ae7fc0fc..16cece25 100644 --- a/web/src/components/auth/LoginForm.js +++ b/web/src/components/auth/LoginForm.js @@ -523,7 +523,7 @@ const LoginForm = () => { {/* 背景模糊晕染球 */}
-
+
{showEmailLogin || !(status.github_oauth || status.oidc_enabled || status.wechat_login || status.linuxdo_oauth || status.telegram_oauth) ? renderEmailLoginForm() : renderOAuthOptions()} diff --git a/web/src/components/auth/PasswordResetConfirm.js b/web/src/components/auth/PasswordResetConfirm.js index 5fbd1fc5..9b454f76 100644 --- a/web/src/components/auth/PasswordResetConfirm.js +++ b/web/src/components/auth/PasswordResetConfirm.js @@ -82,7 +82,7 @@ const PasswordResetConfirm = () => { {/* 背景模糊晕染球 */}
-
+
diff --git a/web/src/components/auth/PasswordResetForm.js b/web/src/components/auth/PasswordResetForm.js index 033989e0..fcbd9189 100644 --- a/web/src/components/auth/PasswordResetForm.js +++ b/web/src/components/auth/PasswordResetForm.js @@ -82,7 +82,7 @@ const PasswordResetForm = () => { {/* 背景模糊晕染球 */}
-
+
diff --git a/web/src/components/auth/RegisterForm.js b/web/src/components/auth/RegisterForm.js index 9d213a60..6d8a9466 100644 --- a/web/src/components/auth/RegisterForm.js +++ b/web/src/components/auth/RegisterForm.js @@ -540,7 +540,7 @@ const RegisterForm = () => { {/* 背景模糊晕染球 */}
-
+
{showEmailRegister || !(status.github_oauth || status.oidc_enabled || status.wechat_login || status.linuxdo_oauth || status.telegram_oauth) ? renderEmailRegisterForm() : renderOAuthOptions()} diff --git a/web/src/components/layout/PageLayout.js b/web/src/components/layout/PageLayout.js index 7ef42eb7..365df7da 100644 --- a/web/src/components/layout/PageLayout.js +++ b/web/src/components/layout/PageLayout.js @@ -23,7 +23,7 @@ const PageLayout = () => { const { i18n } = useTranslation(); const location = useLocation(); - const shouldHideFooter = location.pathname === '/console/playground' || location.pathname.startsWith('/console/chat'); + const shouldHideFooter = location.pathname.startsWith('/console'); const shouldInnerPadding = location.pathname.includes('/console') && !location.pathname.startsWith('/console/chat') && diff --git a/web/src/components/settings/PersonalSetting.js b/web/src/components/settings/PersonalSetting.js index 7e2b85fd..fda43d7d 100644 --- a/web/src/components/settings/PersonalSetting.js +++ b/web/src/components/settings/PersonalSetting.js @@ -379,7 +379,7 @@ const PersonalSetting = () => { }; return ( -
+
{/* 主卡片容器 */} diff --git a/web/src/components/table/ChannelsTable.js b/web/src/components/table/ChannelsTable.js index fba5db79..d49f23de 100644 --- a/web/src/components/table/ChannelsTable.js +++ b/web/src/components/table/ChannelsTable.js @@ -1902,7 +1902,7 @@ const ChannelsTable = () => { /> { <> {renderColumnSelector()} diff --git a/web/src/components/table/MjLogsTable.js b/web/src/components/table/MjLogsTable.js index 57e221d9..af7d1a1e 100644 --- a/web/src/components/table/MjLogsTable.js +++ b/web/src/components/table/MjLogsTable.js @@ -799,7 +799,7 @@ const LogsTable = () => { {renderColumnSelector()}
diff --git a/web/src/components/table/RedemptionsTable.js b/web/src/components/table/RedemptionsTable.js index b463294e..6e096b84 100644 --- a/web/src/components/table/RedemptionsTable.js +++ b/web/src/components/table/RedemptionsTable.js @@ -574,7 +574,7 @@ const RedemptionsTable = () => { > { {renderColumnSelector()}
diff --git a/web/src/components/table/TokensTable.js b/web/src/components/table/TokensTable.js index ac7fca92..09e180b1 100644 --- a/web/src/components/table/TokensTable.js +++ b/web/src/components/table/TokensTable.js @@ -872,7 +872,7 @@ const TokensTable = () => { > { > { ); return ( -
+
{aboutLoaded && about === '' ? (
{ return ( -
+
); diff --git a/web/src/pages/Chat/index.js b/web/src/pages/Chat/index.js index 4b354752..52e91526 100644 --- a/web/src/pages/Chat/index.js +++ b/web/src/pages/Chat/index.js @@ -42,7 +42,7 @@ const ChatPage = () => { allow='camera;microphone' /> ) : ( -
+
{ } return ( -
+

正在加载,请稍候...

); diff --git a/web/src/pages/Detail/index.js b/web/src/pages/Detail/index.js index b5553cbf..704093bb 100644 --- a/web/src/pages/Detail/index.js +++ b/web/src/pages/Detail/index.js @@ -1120,7 +1120,7 @@ const Detail = (props) => { }, []); return ( -
+

{ className="w-full h-screen border-none" /> ) : ( -
+
)}
)} diff --git a/web/src/pages/Log/index.js b/web/src/pages/Log/index.js index 74c570bb..fa919964 100644 --- a/web/src/pages/Log/index.js +++ b/web/src/pages/Log/index.js @@ -2,7 +2,7 @@ import React from 'react'; import LogsTable from '../../components/table/LogsTable'; const Token = () => ( -
+
); diff --git a/web/src/pages/Midjourney/index.js b/web/src/pages/Midjourney/index.js index 71d4c3a8..67d9f76c 100644 --- a/web/src/pages/Midjourney/index.js +++ b/web/src/pages/Midjourney/index.js @@ -2,7 +2,7 @@ import React from 'react'; import MjLogsTable from '../../components/table/MjLogsTable'; const Midjourney = () => ( -
+
); diff --git a/web/src/pages/NotFound/index.js b/web/src/pages/NotFound/index.js index c64b5a40..c6c9e96c 100644 --- a/web/src/pages/NotFound/index.js +++ b/web/src/pages/NotFound/index.js @@ -6,7 +6,7 @@ import { useTranslation } from 'react-i18next'; const NotFound = () => { const { t } = useTranslation(); return ( -
+
} darkModeImage={} diff --git a/web/src/pages/Playground/index.js b/web/src/pages/Playground/index.js index 9a41bc18..345959a1 100644 --- a/web/src/pages/Playground/index.js +++ b/web/src/pages/Playground/index.js @@ -352,7 +352,7 @@ const Playground = () => { }, [setMessage, saveMessagesImmediately]); return ( -
+
{(showSettings || !isMobile) && ( ( -
+
); diff --git a/web/src/pages/Redemption/index.js b/web/src/pages/Redemption/index.js index b55f8fdc..44bb1c87 100644 --- a/web/src/pages/Redemption/index.js +++ b/web/src/pages/Redemption/index.js @@ -3,7 +3,7 @@ import RedemptionsTable from '../../components/table/RedemptionsTable'; const Redemption = () => { return ( -
+
); diff --git a/web/src/pages/Setting/index.js b/web/src/pages/Setting/index.js index 43907826..a74e9b97 100644 --- a/web/src/pages/Setting/index.js +++ b/web/src/pages/Setting/index.js @@ -150,7 +150,7 @@ const Setting = () => { } }, [location.search]); return ( -
+
{ }; return ( -
+
diff --git a/web/src/pages/Task/index.js b/web/src/pages/Task/index.js index 4e3a9af4..261bd7da 100644 --- a/web/src/pages/Task/index.js +++ b/web/src/pages/Task/index.js @@ -2,7 +2,7 @@ import React from 'react'; import TaskLogsTable from '../../components/table/TaskLogsTable.js'; const Task = () => ( -
+
); diff --git a/web/src/pages/Token/index.js b/web/src/pages/Token/index.js index 33921eb6..5f825741 100644 --- a/web/src/pages/Token/index.js +++ b/web/src/pages/Token/index.js @@ -3,7 +3,7 @@ import TokensTable from '../../components/table/TokensTable'; const Token = () => { return ( -
+
); diff --git a/web/src/pages/TopUp/index.js b/web/src/pages/TopUp/index.js index dc986077..6fb57fe3 100644 --- a/web/src/pages/TopUp/index.js +++ b/web/src/pages/TopUp/index.js @@ -382,7 +382,7 @@ const TopUp = () => { }; return ( -
+
{/* 划转模态框 */} { return ( -
+
);