From 69893450883836920d455142fddcc5b2c2f43558 Mon Sep 17 00:00:00 2001 From: jialin Date: Mon, 1 Jul 2024 17:14:39 +0800 Subject: [PATCH] style: pagecontainer padding --- src/assets/styles/menu.less | 2 +- src/global.less | 12 ++++++++- src/layouts/index.tsx | 1 - src/layouts/rightRender.tsx | 25 ++++++++++++++++--- .../components/resource-utilization.tsx | 1 + src/pages/dashboard/index.tsx | 19 ++++++++------ .../playground/components/ground-left.tsx | 5 ++-- src/pages/playground/index.tsx | 8 +++--- src/pages/playground/style/chat-footer.less | 2 +- src/pages/playground/style/ground-left.less | 5 +--- src/pages/profile/index.tsx | 5 +++- 11 files changed, 58 insertions(+), 27 deletions(-) diff --git a/src/assets/styles/menu.less b/src/assets/styles/menu.less index c86484d9..cc7ed8e6 100644 --- a/src/assets/styles/menu.less +++ b/src/assets/styles/menu.less @@ -6,7 +6,7 @@ .ant-layout-sider-children { background-color: var(--color-fill-1); border-inline: none; - border-radius: var(--menu-border-radius-base); + border-radius: 0; padding-inline: 16px; padding-block-end: 12px; } diff --git a/src/global.less b/src/global.less index f34f423c..8278a090 100644 --- a/src/global.less +++ b/src/global.less @@ -9,6 +9,8 @@ html { --color-fill-3: #f3f6fa; --color-logs-bg: #1e1e1e; --color-logs-text: #d4d4d4; + --layout-content-blockpadding: 32px; + --layout-content-inlinepadding: 32px; --menu-border-radius-base: 8px; --border-radius-base: 8px; --border-radius-middle: 20px; @@ -40,7 +42,7 @@ html { --ant-input-active-shadow: 0 0 0 2px rgba(5, 255, 105, 6%); --ant-input-active-border-color: #2fbf85; --ant-input-hover-border-color: #54cc98; - --box-shadow-base: 0 4px 12px rgb(227, 232, 240); + --box-shadow-base: 0 4px 12px rgba(227, 232, 240, 70%); .css-var-rf { --ant-font-size: var(--font-size-base); @@ -272,6 +274,14 @@ body { .ant-pro-layout { height: 100vh; + // .ant-pro-layout-content { + // padding-block: var(--layout-content-blockpadding); + // padding-inline: var(--layout-content-inlinepadding); + // } + .ant-pro-page-container-children-container { + padding-block: var(--layout-content-blockpadding); + padding-inline: var(--layout-content-inlinepadding); + } .ant-pro-sider-logo { padding-left: 22px; diff --git a/src/layouts/index.tsx b/src/layouts/index.tsx index a19ebd32..f096a5ef 100644 --- a/src/layouts/index.tsx +++ b/src/layouts/index.tsx @@ -186,7 +186,6 @@ export default (props: any) => { } if (menuItemProps.path && location.pathname !== menuItemProps.path) { return ( - // handle wildcard route path, for example /slave/* from qiankun { + return ( + + +
    + } + title={intl?.formatMessage?.({ id: 'common.button.settings' })} + > + } + title={intl?.formatMessage?.({ id: 'common.button.logout' })} + > +
+
+
+ ); + }; const langMenu = { className: 'umi-plugin-layout-menu', selectedKeys: [], @@ -123,7 +143,7 @@ export function getRightRenderContent(opts: { let dropdownProps; if (version.startsWith('5.') || version.startsWith('4.24.')) { - dropdownProps = { menu: langMenu }; + dropdownProps = { menu: langMenu, mode: 'vertical' }; } else if (version.startsWith('3.')) { dropdownProps = { overlay: ( @@ -138,7 +158,7 @@ export function getRightRenderContent(opts: { }; } else { // 需要 antd 4.20.0 以上版本 - dropdownProps = { overlay: }; + dropdownProps = { overlay: }; } return ( @@ -153,7 +173,6 @@ export function getRightRenderContent(opts: { > {avatar} - ) : ( avatar diff --git a/src/pages/dashboard/components/resource-utilization.tsx b/src/pages/dashboard/components/resource-utilization.tsx index 5295e5f1..fcd06b82 100644 --- a/src/pages/dashboard/components/resource-utilization.tsx +++ b/src/pages/dashboard/components/resource-utilization.tsx @@ -95,6 +95,7 @@ const UtilizationOvertime: React.FC = () => { diff --git a/src/pages/dashboard/index.tsx b/src/pages/dashboard/index.tsx index 8edbaf48..3b78cf18 100644 --- a/src/pages/dashboard/index.tsx +++ b/src/pages/dashboard/index.tsx @@ -1,3 +1,4 @@ +import { PageContainer } from '@ant-design/pro-components'; import { Spin } from 'antd'; import { useEffect, useState } from 'react'; import { queryDashboardData } from './apis'; @@ -27,14 +28,16 @@ const Dashboard: React.FC = () => { getDashboardData(); }, []); return ( - - - - - - - - + + + + + + + + + + ); }; diff --git a/src/pages/playground/components/ground-left.tsx b/src/pages/playground/components/ground-left.tsx index 20a169d3..65da9a28 100644 --- a/src/pages/playground/components/ground-left.tsx +++ b/src/pages/playground/components/ground-left.tsx @@ -2,7 +2,6 @@ import TransitionWrapper from '@/components/transition'; import HotKeys from '@/config/hotkeys'; import { fetchChunkedData, readStreamData } from '@/utils/fetch-chunk-data'; import { EyeInvisibleOutlined } from '@ant-design/icons'; -import { PageContainer } from '@ant-design/pro-components'; import { useIntl } from '@umijs/max'; import { Button, Input, Spin } from 'antd'; import _ from 'lodash'; @@ -185,7 +184,7 @@ const MessageList: React.FC = (props) => { return (
- +
= (props) => { )}
- +
{ }; return ( -
- +
+
@@ -45,7 +45,7 @@ const Playground: React.FC = () => { />
- +
); }; diff --git a/src/pages/playground/style/chat-footer.less b/src/pages/playground/style/chat-footer.less index daa2fbef..2005cca8 100644 --- a/src/pages/playground/style/chat-footer.less +++ b/src/pages/playground/style/chat-footer.less @@ -1,7 +1,7 @@ .chat-footer { display: flex; align-items: center; - padding-inline: 26px; + padding-inline: 0 32px; height: 100px; // box-shadow: 0px -1px 2px 0px var(--ant-color-border); } diff --git a/src/pages/playground/style/ground-left.less b/src/pages/playground/style/ground-left.less index 2bcc87f4..ab6359b3 100644 --- a/src/pages/playground/style/ground-left.less +++ b/src/pages/playground/style/ground-left.less @@ -2,14 +2,11 @@ position: relative; height: calc(100vh - 84px); padding-bottom: 120px; + padding-right: 32px; .message-list-wrap { max-height: calc(100vh - 152px); overflow-y: auto; - - .ant-pro-page-container-children-container { - padding-inline: 16px 26px; - } } .ground-left-footer { diff --git a/src/pages/profile/index.tsx b/src/pages/profile/index.tsx index 0a2fcc40..cf980e0d 100644 --- a/src/pages/profile/index.tsx +++ b/src/pages/profile/index.tsx @@ -44,7 +44,10 @@ const Profile: React.FC = () => { extra={[]} >