Unverified Commit 3b338b4c authored by ZackYoung's avatar ZackYoung Committed by GitHub

[fix][web] fix dark theme (#2151)

* fix dark theme * remove scroll
parent 6da90afd
...@@ -60,8 +60,8 @@ const Settings: ProLayoutProps & { ...@@ -60,8 +60,8 @@ const Settings: ProLayoutProps & {
colorBgMenuItemSelected: '#3399FF', colorBgMenuItemSelected: '#3399FF',
}, },
pageContainer: { pageContainer: {
paddingBlockPageContainerContent: 0, paddingBlockPageContainerContent: 5,
paddingInlinePageContainerContent: 0, paddingInlinePageContainerContent: 10,
} }
}, },
}; };
......
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import React from "react";
import {Button} from "antd";
import {MinusOutlined, UserSwitchOutlined} from "@ant-design/icons";
import {l} from "@/utils/intl";
type CircleButtonProps = {
// key: string;
icon: React.ReactNode;
onClick?: () => void;
title?: string;
};
export const CircleBtn: React.FC<CircleButtonProps> = (props) => {
const {onClick,title,icon} = props;
return (
<Button title={title}
// key={key}
icon={icon} block type={"text"}
shape={"circle"}
onClick={onClick}/>
);
};
// style={{color:token.colorText}}
import { l } from '@/utils/intl';
import { GithubOutlined } from '@ant-design/icons';
import { DefaultFooter } from '@ant-design/pro-components';
import React from 'react';
import {children} from "@umijs/utils/compiled/cheerio/lib/api/traversing";
import {theme} from "antd";
export type TitleProps = {
children?: React.ReactNode;
}
const { useToken } = theme;
const Title: React.FC<TitleProps> = (props) => {
const {token} = useToken();
return (
<span className={"title"} style={{color:token.colorText}}>
{props.children}
</span>
);
};
export default Title;
import React from "react"; import React from "react";
import {theme} from "antd";
export type ContentScrollProps = { export type ContentScrollProps = {
height:number|string height:number|string
children?: React.ReactNode; children?: React.ReactNode;
} }
const { useToken } = theme;
const ContentScroll: React.FC<ContentScrollProps> = (props) => { const ContentScroll: React.FC<ContentScrollProps> = (props) => {
const {height,children}=props const {height,children}=props
const {token} = useToken();
return ( return (
<div className="content-scroll" style={{height:height,display:height<1?"none":"block"}}> <div className="content-scroll" style={{height:height,display:height<1?"none":"block",backgroundColor:token.colorBgBase}}>
{children} {children}
</div> </div>
) )
......
import React from "react"; import React, {Fragment, useState} from "react";
import {MinusOutlined, MinusSquareOutlined, PlusSquareOutlined} from "@ant-design/icons"; import {MinusOutlined, MinusSquareOutlined, PlusSquareOutlined} from "@ant-design/icons";
import {Enable, Resizable, ResizeCallback, Size} from "re-resizable"; import {Enable, Resizable, ResizeCallback, Size} from "re-resizable";
import {PageContainer} from "@ant-design/pro-components"; import {PageContainer} from "@ant-design/pro-components";
import {l} from "@/utils/intl"; import {l} from "@/utils/intl";
import {Button, TabPaneProps} from "antd"; import {Button, Space, TabPaneProps, theme} from "antd";
import {MaxIcon, MinIcon} from "@/components/Icons/StudioIcon"; import {MaxIcon, MinIcon} from "@/components/Icons/StudioIcon";
import {CircleBtn} from "@/components/CallBackButton/CircleBtn";
import useThemeValue from "@/hooks/useThemeValue";
import {THEME} from "@/types/Public/data";
export type MovableSidebarProps = { export type MovableSidebarProps = {
title?: React.ReactNode; title?: React.ReactNode;
...@@ -19,52 +22,72 @@ export type MovableSidebarProps = { ...@@ -19,52 +22,72 @@ export type MovableSidebarProps = {
children?: React.ReactNode; children?: React.ReactNode;
handlerMinimize?: () => void; handlerMinimize?: () => void;
handlerMaxsize?: () => void; handlerMaxsize?: () => void;
btnGroup?: React.ReactNode[];
onResize?: ResizeCallback; onResize?: ResizeCallback;
style?: React.CSSProperties; style?: React.CSSProperties;
tagList?: TabPaneProps[]; tagList?: TabPaneProps[];
}; };
const { useToken } = theme;
const MovableSidebar: React.FC<MovableSidebarProps> = (props) => { const MovableSidebar: React.FC<MovableSidebarProps> = (props) => {
const {token} = useToken();
const themeValue = useThemeValue();
const {style, visible,onResize,defaultSize, const {
minWidth,maxWidth,minHeight,maxHeight,enable style, visible, onResize, defaultSize,
,children, title,contentHeight,handlerMinimize, handlerMaxsize,tagList minWidth, maxWidth, minHeight, maxHeight, enable
} = props; , children, title, contentHeight, handlerMinimize, handlerMaxsize, tagList
} = props;
const [showBtn,setShowBtn] = useState(false)
return (
<div onMouseEnter={() => setShowBtn(true)} onMouseLeave={() => setShowBtn(false)}>
<Resizable
className={'container'}
style={{...style, display: visible ? 'block' : 'none', borderRadius: 5}}
onResize={onResize}
defaultSize={defaultSize}
minWidth={minWidth}
maxWidth={maxWidth}
minHeight={minHeight}
maxHeight={maxHeight}
enable={enable}
>
{/*<PageContainer*/}
{/* title={title}*/}
{/* tabProps={{*/}
{/* type: "editable-card",*/}
{/* hideAdd: true,*/}
{/* size: "small",*/}
{/* animated: true,*/}
{/* tabBarStyle: {margin: 0, padding: 0},*/}
{/* }}*/}
{/* tabList={tagList}*/}
{/* extra={[*/}
{/* <Button title={l('global.mini')} key={"minimize"} icon={<MinusOutlined/>} block type={"text"} shape={"circle"}*/}
{/* onClick={props.handlerMinimize}/>*/}
{/* // <MinusSquareOutlined size={15} title={l('global.mini')} key={"minimize"} onClick={handlerMinimize}/>,*/}
{/* // <MinusOutlined size={35} title={l('global.mini')} key={"minimize"} onClick={handlerMinimize}/>,*/}
{/* // <PlusSquareOutlined size={15} title={l('global.max')} key={"maximize"} onClick={handlerMaxsize}/>*/}
{/* ]}*/}
{/* fixedHeader*/}
{/*>*/}
{/* <div style={{height: contentHeight,marginBlock:-5,marginInline:-10}}>{children}</div>*/}
{/*</PageContainer>*/}
<Fragment>
<div style={{backgroundColor:token.colorBgBase,borderBlockColor:themeValue.borderColor}} className={"container-header"}>
<div>{title}</div>
{/*<div style={{display:showBtn?"block":"none",animation: (showBtn?"show-anim":"hide-anim")+" 2s"}}>*/}
<div className={showBtn?"show":"hide"}>
<Space size={5}>
{props.btnGroup}
<CircleBtn onClick={props.handlerMinimize} icon={<MinusOutlined/>}/>
</Space>
</div>
</div>
<div style={{height: contentHeight,backgroundColor:token.colorBgBase}}>{children}</div>
</Fragment>
return ( </Resizable>
<Resizable </div>
className={'container'} );
style={{...style, display: visible ? 'block' : 'none',borderRadius: 5}}
onResize={onResize}
defaultSize={defaultSize}
minWidth={minWidth}
maxWidth={maxWidth}
minHeight={minHeight}
maxHeight={maxHeight}
enable={enable}
>
<PageContainer
title={title}
tabProps={{
type: "editable-card",
hideAdd: true,
size: "small",
animated: true,
tabBarStyle: {margin: 0, padding: 0},
}}
tabList={tagList}
extra={[
<Button title={l('global.mini')} key={"minimize"} icon={<MinusOutlined/>} block type={"text"} shape={"circle"}
onClick={props.handlerMinimize}/>
// <MinusSquareOutlined size={15} title={l('global.mini')} key={"minimize"} onClick={handlerMinimize}/>,
// <MinusOutlined size={35} title={l('global.mini')} key={"minimize"} onClick={handlerMinimize}/>,
// <PlusSquareOutlined size={15} title={l('global.max')} key={"maximize"} onClick={handlerMaxsize}/>
]}
fixedHeader
>
<div style={{height: contentHeight}}>{children}</div>
</PageContainer>
</Resizable>
);
}; };
export default MovableSidebar; export default MovableSidebar;
...@@ -16,6 +16,10 @@ ...@@ -16,6 +16,10 @@
*/ */
import styled from "styled-components"; import styled from "styled-components";
import { theme } from 'antd';
const { getDesignToken } = theme;
const token = getDesignToken();
export const DataAction = styled.div` export const DataAction = styled.div`
display: flex !important; display: flex !important;
...@@ -63,6 +67,3 @@ export const FlexCenterDiv = styled.div` ...@@ -63,6 +67,3 @@ export const FlexCenterDiv = styled.div`
justify-content: left; justify-content: left;
align-items: center; align-items: center;
`; `;
export const Title = styled.div`
font-size: 16px;
`;
...@@ -103,7 +103,7 @@ body, ...@@ -103,7 +103,7 @@ body,
} }
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
background-color: #ccc; background-color: #8db7fd;
border-radius: 10px; border-radius: 10px;
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2); box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
} }
...@@ -215,6 +215,7 @@ ol { ...@@ -215,6 +215,7 @@ ol {
height: 100%; height: 100%;
overflow-x: auto; overflow-x: auto;
overflow-y: auto; overflow-y: auto;
.ant-tree-list-holder-inner { .ant-tree-list-holder-inner {
min-width: max-content; min-width: max-content;
z-index: auto; z-index: auto;
...@@ -328,7 +329,7 @@ ol { ...@@ -328,7 +329,7 @@ ol {
align-content: center; align-content: center;
} }
h5{ h5 {
margin-left: 0.5rem; margin-left: 0.5rem;
margin-bottom: 0; margin-bottom: 0;
} }
...@@ -336,41 +337,50 @@ h5{ ...@@ -336,41 +337,50 @@ h5{
// theme // theme
// light // light
.side{ .show{
background-color: #fafaf9 opacity: 1;
animation: show-anim 0.5s;
} }
.hide{
.container{ opacity: 0;
background-color: #ffffff; animation: hide-anim 0.5s;
}
@keyframes show-anim {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
@keyframes hide-anim {
0% {
opacity: 1;
}
100% {
opacity: 0;
}
} }
.ant-page-header{ .title{
border-block: 1px solid #E0E2E5; font-size: 15px;
font-weight: 500;
font-family: "SimHei",serif;
}
.container-header {
display: flex;
justify-content: space-between;
align-items: center;
line-height: 32px;
padding-inline: 10px;
padding-block: 5px;
border-block: 1px solid
} }
// 滚动条 // 滚动条
.content-scroll { .content-scroll {
background-color: #ffffff;
overflow-y: auto; overflow-y: auto;
direction: ltr; direction: ltr;
scrollbar-color: #d4aa70 #e4e4e4; scrollbar-color: #d4aa70 #e4e4e4;
scrollbar-width: thin; scrollbar-width: thin;
} }
.content-scroll::-webkit-scrollbar {
width: 5px;
}
.content-scroll::-webkit-scrollbar-track {
background-color: #ffffff;
border-radius: 100px;
}
.content-scroll::-webkit-scrollbar-thumb {
border-radius: 100px;
border: 6px solid rgba(0, 0, 0, 0.18);
border-left: 0;
border-right: 0;
background-color: #1890ff;
}
import {THEME} from "@/types/Public/data";
import {useEffect, useState} from "react";
import {theme} from "antd";
export type ThemeValue = {
borderColor: string
}
const { useToken } = theme;
const getThemeValue = (isDark: boolean): ThemeValue => {
if (isDark) {
return {borderColor: "#343434"}
} else {
return {borderColor: "rgba(5, 5, 5, 0.06)"}
// return {borderColor: "#E0E2E5"}
}
}
export default function useThemeValue() {
const {token} = useToken();
// const {initialState} = useModel("@@initialState");
const [theme,setTheme] = useState(localStorage.getItem(THEME.NAV_THEME))
const isDark = theme === THEME.dark;
useEffect(() => {
setTheme(localStorage.getItem(THEME.NAV_THEME))
},[localStorage.getItem(THEME.NAV_THEME)]);
return getThemeValue(isDark);
};
import {Tabs} from "antd"; import {Space, Tabs} from "antd";
import MovableSidebar, {MovableSidebarProps} from "@/components/Sidebar/MovableSidebar"; import MovableSidebar, {MovableSidebarProps} from "@/components/Sidebar/MovableSidebar";
import React from "react"; import React from "react";
import {connect} from "@@/exports"; import {connect} from "@@/exports";
import {StateType, VIEW} from "@/pages/DataStudio/model"; import {StateType, VIEW} from "@/pages/DataStudio/model";
import {LeftSide} from "@/pages/DataStudio/route"; import {LeftSide} from "@/pages/DataStudio/route";
import {l} from "@/utils/intl"; import {l} from "@/utils/intl";
import Title from "@/components/Front/Title";
import useThemeValue from "@/hooks/useThemeValue";
export type LeftContainerProps = { export type LeftContainerProps = {
size:number size:number
} }
const LeftContainer:React.FC<LeftContainerProps> = (props:any) => { const LeftContainer:React.FC<LeftContainerProps> = (props:any) => {
const {dispatch,size} = props; const {dispatch,size} = props;
const themeValue = useThemeValue();
const {toolContentHeight ,leftContainer , rightContainer} = props const {toolContentHeight ,leftContainer , rightContainer} = props
...@@ -50,7 +52,7 @@ const LeftContainer:React.FC<LeftContainerProps> = (props:any) => { ...@@ -50,7 +52,7 @@ const LeftContainer:React.FC<LeftContainerProps> = (props:any) => {
const restMovableSidebarProps : MovableSidebarProps = { const restMovableSidebarProps : MovableSidebarProps = {
contentHeight: toolContentHeight, contentHeight: toolContentHeight,
onResize: (event: any, direction: any, elementRef: { offsetWidth: any; }) => handleReSizeChange(elementRef.offsetWidth), onResize: (event: any, direction: any, elementRef: { offsetWidth: any; }) => handleReSizeChange(elementRef.offsetWidth),
title: <h5>{l(leftContainer.selectKey)}</h5>, title: <Title>{l(leftContainer.selectKey)}</Title>,
handlerMinimize: ()=> handleMinimize(), handlerMinimize: ()=> handleMinimize(),
handlerMaxsize: () => handleMaxsize(size.width - 2 * VIEW.leftToolWidth - rightContainer.width - 700), handlerMaxsize: () => handleMaxsize(size.width - 2 * VIEW.leftToolWidth - rightContainer.width - 700),
visible: leftContainer.selectKey !== "", visible: leftContainer.selectKey !== "",
...@@ -58,7 +60,7 @@ const LeftContainer:React.FC<LeftContainerProps> = (props:any) => { ...@@ -58,7 +60,7 @@ const LeftContainer:React.FC<LeftContainerProps> = (props:any) => {
minWidth: 260, minWidth: 260,
maxWidth: size.width - 2 * VIEW.leftToolWidth - rightContainer.width - 700, // maxWidth: size.width - 2 * VIEW.leftToolWidth - rightContainer.width - 700, //
enable: {right: true}, enable: {right: true},
style:{borderInlineEnd: "1px solid #E0E2E5"} style:{borderInlineEnd: "1px solid "+themeValue.borderColor}
} }
......
...@@ -26,12 +26,14 @@ import {MenuInfo} from "rc-menu/es/interface"; ...@@ -26,12 +26,14 @@ import {MenuInfo} from "rc-menu/es/interface";
import {STUDIO_TAG_RIGHT_CONTEXT_MENU} from "@/pages/DataStudio/constants"; import {STUDIO_TAG_RIGHT_CONTEXT_MENU} from "@/pages/DataStudio/constants";
import QuickGuide from "@/pages/DataStudio/MiddleContainer/QuickGuide"; import QuickGuide from "@/pages/DataStudio/MiddleContainer/QuickGuide";
import ContentScroll from "@/components/Scroll/ContentScroll"; import ContentScroll from "@/components/Scroll/ContentScroll";
import useThemeValue from "@/hooks/useThemeValue";
type TargetKey = React.MouseEvent | React.KeyboardEvent | string; type TargetKey = React.MouseEvent | React.KeyboardEvent | string;
const MiddleContainer = (props: any) => { const MiddleContainer = (props: any) => {
const {tabs: {panes, activeKey}, dispatch} = props; const {tabs: {panes, activeKey}, dispatch} = props;
const themeValue = useThemeValue();
const [contextMenuPosition, setContextMenuPosition] = useState({}); const [contextMenuPosition, setContextMenuPosition] = useState({});
const [contextMenuVisible, setContextMenuVisible] = useState(false); const [contextMenuVisible, setContextMenuVisible] = useState(false);
...@@ -127,15 +129,15 @@ const MiddleContainer = (props: any) => { ...@@ -127,15 +129,15 @@ const MiddleContainer = (props: any) => {
* @returns {JSX.Element} * @returns {JSX.Element}
*/ */
const renderRightClickMenu = () => { const renderRightClickMenu = () => {
const menuList = <Menu onClick={handleMenuClick} items={STUDIO_TAG_RIGHT_CONTEXT_MENU}/> // const menuList = <Menu onClick={handleMenuClick} items={STUDIO_TAG_RIGHT_CONTEXT_MENU}/>
return <> return <>
<Dropdown <Dropdown
arrow arrow
trigger={['contextMenu']} trigger={['contextMenu']}
overlayStyle={{...contextMenuPosition}} overlayStyle={{...contextMenuPosition}}
overlay={menuList} menu={{items: STUDIO_TAG_RIGHT_CONTEXT_MENU,onClick:handleMenuClick}}
open={contextMenuVisible} open={contextMenuVisible}
onVisibleChange={setContextMenuVisible} onOpenChange={setContextMenuVisible}
> >
{/*占位*/} {/*占位*/}
<div style={{...contextMenuPosition}}/> <div style={{...contextMenuPosition}}/>
...@@ -204,7 +206,7 @@ const MiddleContainer = (props: any) => { ...@@ -204,7 +206,7 @@ const MiddleContainer = (props: any) => {
} }
}}> }}>
<Tabs <Tabs
// tabBarStyle={{border: '1px solid black',borderRadius: 0}} tabBarStyle={{borderBlock: '1px solid '+themeValue.borderColor}}
hideAdd hideAdd
onTabClick={(active, e) => updateActiveKey(active, e)} onTabClick={(active, e) => updateActiveKey(active, e)}
activeKey={activeKey} activeKey={activeKey}
......
...@@ -26,12 +26,14 @@ import React from "react"; ...@@ -26,12 +26,14 @@ import React from "react";
import {connect} from "@@/exports"; import {connect} from "@@/exports";
import {mapDispatchToProps} from "@/pages/DataStudio/function"; import {mapDispatchToProps} from "@/pages/DataStudio/function";
import {LeftSide, RightSide} from "@/pages/DataStudio/route"; import {LeftSide, RightSide} from "@/pages/DataStudio/route";
import useThemeValue from "@/hooks/useThemeValue";
export type RightContainerProps = { export type RightContainerProps = {
size:number size:number
bottomHeight:number bottomHeight:number
} }
const RightContainer:React.FC<RightContainerProps> = (prop:any) => { const RightContainer:React.FC<RightContainerProps> = (prop:any) => {
const themeValue = useThemeValue();
const {size,leftContainer,rightContainer,bottomHeight,updateRightWidth,updateSelectRightKey}=prop const {size,leftContainer,rightContainer,bottomHeight,updateRightWidth,updateSelectRightKey}=prop
const maxWidth= size.width - 2 * VIEW.leftToolWidth - leftContainer.width - 600 const maxWidth= size.width - 2 * VIEW.leftToolWidth - leftContainer.width - 600
return ( return (
...@@ -48,7 +50,7 @@ const RightContainer:React.FC<RightContainerProps> = (prop:any) => { ...@@ -48,7 +50,7 @@ const RightContainer:React.FC<RightContainerProps> = (prop:any) => {
minWidth={300} minWidth={300}
maxWidth={maxWidth} maxWidth={maxWidth}
enable={{left: true}} enable={{left: true}}
style={{borderInlineStart: "1px solid #E0E2E5"}} style={{borderInlineStart: "1px solid "+themeValue.borderColor}}
> >
<Tabs activeKey={rightContainer.selectKey} items={RightSide} tabBarStyle={{display: "none"}}/> <Tabs activeKey={rightContainer.selectKey} items={RightSide} tabBarStyle={{display: "none"}}/>
......
...@@ -15,36 +15,34 @@ ...@@ -15,36 +15,34 @@
* limitations under the License. * limitations under the License.
*/ */
import {Button, Layout, Menu, Space} from 'antd'; import {Layout, Menu, theme} from 'antd';
import {connect, getDvaApp} from "umi"; import {connect, getDvaApp} from "umi";
import {
CloseSquareOutlined,
CopyOutlined,
QuestionOutlined,
} from "@ant-design/icons";
import React, {Fragment, useCallback, useEffect, useState} from "react"; import React, {Fragment, useCallback, useEffect, useState} from "react";
import {StateType, TabsItemType, TabsPageType, VIEW} from "@/pages/DataStudio/model"; import {StateType, TabsItemType, TabsPageType, VIEW} from "@/pages/DataStudio/model";
import MovableSidebar from "@/components/Sidebar/MovableSidebar";
import {PersistGate} from 'redux-persist/integration/react'; import {PersistGate} from 'redux-persist/integration/react';
import {getDataBase} from "@/pages/DataStudio/LeftContainer/MetaData/service"; import {getDataBase} from "@/pages/DataStudio/LeftContainer/MetaData/service";
import MiddleContainer from "@/pages/DataStudio/MiddleContainer"; import MiddleContainer from "@/pages/DataStudio/MiddleContainer";
import LeftContainer from "@/pages/DataStudio/LeftContainer"; import LeftContainer from "@/pages/DataStudio/LeftContainer";
import {LeftBottomMoreTabs, LeftBottomSide, LeftSide, RightSide} from "@/pages/DataStudio/route"; import {LeftBottomMoreTabs, LeftBottomSide, LeftSide, RightSide} from "@/pages/DataStudio/route";
import {l} from '@/utils/intl';
import {mapDispatchToProps} from "@/pages/DataStudio/function"; import {mapDispatchToProps} from "@/pages/DataStudio/function";
import BottomContainer from "@/pages/DataStudio/BottomContainer"; import BottomContainer from "@/pages/DataStudio/BottomContainer";
import HeaderContainer from "@/pages/DataStudio/HeaderContainer"; import HeaderContainer from "@/pages/DataStudio/HeaderContainer";
import RightContainer from "@/pages/DataStudio/RightContainer"; import RightContainer from "@/pages/DataStudio/RightContainer";
import {getConsoleData} from "@/pages/DataStudio/BottomContainer/Console/service"; import {getConsoleData} from "@/pages/DataStudio/BottomContainer/Console/service";
import useThemeValue from "@/hooks/useThemeValue";
const {Sider, Content} = Layout; const {Sider, Content} = Layout;
const { useToken } = theme;
const DataStudio = (props: any) => { const DataStudio = (props: any) => {
const { const {
bottomContainer, leftContainer, rightContainer, saveDataBase, updateToolContentHeight,updateBottomConsole bottomContainer, leftContainer, rightContainer, saveDataBase, updateToolContentHeight,updateBottomConsole
, updateCenterContentHeight, updateSelectLeftKey, updateLeftWidth, updateSelectRightKey , updateCenterContentHeight, updateSelectLeftKey, updateLeftWidth, updateSelectRightKey
, updateRightWidth, updateSelectBottomKey, updateBottomHeight, activeBreadcrumbTitle, updateSelectBottomSubKey, tabs , updateRightWidth, updateSelectBottomKey, updateBottomHeight, activeBreadcrumbTitle, updateSelectBottomSubKey, tabs
} = props } = props
const {token} = useToken();
const themeValue = useThemeValue();
const getActiveTabType: () => (TabsPageType) = () => { const getActiveTabType: () => (TabsPageType) = () => {
if (parseInt(tabs.activeKey) < 0) { if (parseInt(tabs.activeKey) < 0) {
return TabsPageType.None return TabsPageType.None
...@@ -115,20 +113,19 @@ const DataStudio = (props: any) => { ...@@ -115,20 +113,19 @@ const DataStudio = (props: any) => {
return ( return (
<PersistGate loading={null} persistor={persistor}> <PersistGate loading={null} persistor={persistor}>
<Fragment> <Fragment>
<Layout style={{minHeight: "60vh"}}> <div style={{marginInline: -10, marginBlock: -5}}>
{/* 渲染 header */} {/* 渲染 header */}
{renderHeaderContainer()} {renderHeaderContainer()}
<Layout hasSider style={{minHeight: size.contentHeight}}> <Layout hasSider style={{minHeight: size.contentHeight,paddingInline:0}}>
{/*渲染左侧侧边栏*/} {/*渲染左侧侧边栏*/}
<Sider collapsed collapsedWidth={40}> <Sider collapsed collapsedWidth={40}>
<Menu <Menu
className={'side'}
mode="inline" mode="inline"
selectedKeys={[leftContainer.selectKey]} selectedKeys={[leftContainer.selectKey]}
items={LeftSide.map(x => { items={LeftSide.map(x => {
return {key: x.key, label: x.label, icon: x.icon} return {key: x.key, label: x.label, icon: x.icon}
})} })}
style={{height: '50%'}} style={{height: '50%',borderBlockStart:"1px solid "+themeValue.borderColor,borderInlineEnd:"1px solid "+themeValue.borderColor}}
onClick={(item) => { onClick={(item) => {
updateSelectLeftKey(item.key === leftContainer.selectKey ? '' : item.key) updateSelectLeftKey(item.key === leftContainer.selectKey ? '' : item.key)
}} }}
...@@ -137,7 +134,6 @@ const DataStudio = (props: any) => { ...@@ -137,7 +134,6 @@ const DataStudio = (props: any) => {
{/*底部菜单*/} {/*底部菜单*/}
<Menu <Menu
className={'side'}
mode="inline" mode="inline"
selectedKeys={[bottomContainer.selectKey]} selectedKeys={[bottomContainer.selectKey]}
items={LeftBottomSide.map(x => { items={LeftBottomSide.map(x => {
...@@ -146,7 +142,8 @@ const DataStudio = (props: any) => { ...@@ -146,7 +142,8 @@ const DataStudio = (props: any) => {
style={{ style={{
display: 'flex', display: 'flex',
height: '50%', height: '50%',
flexDirection: "column-reverse" flexDirection: "column-reverse",
borderInlineEnd:"1px solid "+themeValue.borderColor
}} }}
onClick={(item) => { onClick={(item) => {
updateSelectBottomKey(item.key === bottomContainer.selectKey ? '' : item.key) updateSelectBottomKey(item.key === bottomContainer.selectKey ? '' : item.key)
...@@ -188,10 +185,9 @@ const DataStudio = (props: any) => { ...@@ -188,10 +185,9 @@ const DataStudio = (props: any) => {
{/* 渲染右侧侧边栏 */} {/* 渲染右侧侧边栏 */}
<Sider collapsed collapsedWidth={40}> <Sider collapsed collapsedWidth={40}>
<Menu <Menu
className={'side'}
selectedKeys={[rightContainer.selectKey]} selectedKeys={[rightContainer.selectKey]}
mode="inline" mode="inline"
style={{height: '100%', borderInlineStart: "1px solid rgba(5, 5, 5, 0.06)"}} style={{height: '100%', borderInlineStart: "1px solid "+themeValue.borderColor,borderBlockStart:"1px solid "+themeValue.borderColor}}
items={RightSide.filter(x => { items={RightSide.filter(x => {
if (!x.isShow) { if (!x.isShow) {
return true return true
...@@ -206,7 +202,7 @@ const DataStudio = (props: any) => { ...@@ -206,7 +202,7 @@ const DataStudio = (props: any) => {
/> />
</Sider> </Sider>
</Layout> </Layout>
</Layout> </div>
</Fragment> </Fragment>
</PersistGate> </PersistGate>
); );
......
...@@ -19,7 +19,7 @@ export const VIEW = { ...@@ -19,7 +19,7 @@ export const VIEW = {
bottomHeight: 100, bottomHeight: 100,
rightMargin: 32, rightMargin: 32,
leftMargin: 36, leftMargin: 36,
midMargin: 50, midMargin: 44,
otherHeight: 10, otherHeight: 10,
paddingInline: 50, paddingInline: 50,
}; };
......
...@@ -28,6 +28,7 @@ type LogsTreeProps = { ...@@ -28,6 +28,7 @@ type LogsTreeProps = {
const {DirectoryTree} = Tree; const {DirectoryTree} = Tree;
const LogsTree: React.FC<LogsTreeProps> = (props) => { const LogsTree: React.FC<LogsTreeProps> = (props) => {
const {treeData, onNodeClick} = props; const {treeData, onNodeClick} = props;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment