fix(style): body scroll
This commit is contained in:
@@ -22,6 +22,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.ver {
|
.ver {
|
||||||
|
margin-bottom: 20px;
|
||||||
line-height: 32px;
|
line-height: 32px;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
@@ -53,7 +54,6 @@
|
|||||||
|
|
||||||
.upgrade {
|
.upgrade {
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-top: 20px;
|
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding-block: 20px 4px;
|
padding-block: 20px 4px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@@ -171,6 +171,10 @@ body {
|
|||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
|
|
||||||
|
&::-webkit-scrollbar {
|
||||||
|
width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.ant-modal-confirm-title {
|
.ant-modal-confirm-title {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|||||||
+12
-5
@@ -24,6 +24,7 @@ import {
|
|||||||
} from '@umijs/max';
|
} from '@umijs/max';
|
||||||
import { Button, Modal } from 'antd';
|
import { Button, Modal } from 'antd';
|
||||||
import { useAtom } from 'jotai';
|
import { useAtom } from 'jotai';
|
||||||
|
import 'overlayscrollbars/overlayscrollbars.css';
|
||||||
import { useCallback, useEffect, useMemo, useState } from 'react';
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
||||||
import Exception from './Exception';
|
import Exception from './Exception';
|
||||||
import './Layout.css';
|
import './Layout.css';
|
||||||
@@ -89,7 +90,7 @@ const mapRoutes = (routes: IRoute[], role: string) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export default (props: any) => {
|
export default (props: any) => {
|
||||||
const { initialize } = useOverlayScroller();
|
const { initialize: initialize } = useOverlayScroller();
|
||||||
const { initialize: initializeMenu } = useOverlayScroller();
|
const { initialize: initializeMenu } = useOverlayScroller();
|
||||||
const [userInfo] = useAtom(userAtom);
|
const [userInfo] = useAtom(userAtom);
|
||||||
const [version] = useAtom(GPUStackVersionAtom);
|
const [version] = useAtom(GPUStackVersionAtom);
|
||||||
@@ -185,13 +186,19 @@ export default (props: any) => {
|
|||||||
}, [updateCheck, version, initialState]);
|
}, [updateCheck, version, initialState]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
initialize(document.body);
|
const body = document.querySelector('body');
|
||||||
|
if (body) {
|
||||||
|
initialize(body);
|
||||||
|
}
|
||||||
}, [initialize]);
|
}, [initialize]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
initializeMenu(
|
const menuWrap = document.querySelector(
|
||||||
document.querySelector('.ant-menu.ant-menu-root')?.parentElement
|
'.ant-menu.ant-menu-root'
|
||||||
);
|
)?.parentElement;
|
||||||
|
if (menuWrap) {
|
||||||
|
initializeMenu(menuWrap);
|
||||||
|
}
|
||||||
}, [initializeMenu]);
|
}, [initializeMenu]);
|
||||||
|
|
||||||
const renderMenuHeader = useCallback(
|
const renderMenuHeader = useCallback(
|
||||||
|
|||||||
@@ -11,6 +11,10 @@
|
|||||||
padding-top: 16px;
|
padding-top: 16px;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
|
||||||
|
&::-webkit-scrollbar {
|
||||||
|
width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.box {
|
.box {
|
||||||
width: 390px;
|
width: 390px;
|
||||||
padding-inline: var(--layout-content-inlinepadding);
|
padding-inline: var(--layout-content-inlinepadding);
|
||||||
|
|||||||
@@ -200,7 +200,14 @@ const GPUList: React.FC = () => {
|
|||||||
render={(text, record: GPUDeviceItem) => {
|
render={(text, record: GPUDeviceItem) => {
|
||||||
return (
|
return (
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
percent={_.round(record.memory?.utilization_rate, 0)}
|
percent={
|
||||||
|
record.memory?.used
|
||||||
|
? _.round(record.memory?.utilization_rate, 0)
|
||||||
|
: _.round(
|
||||||
|
record.memory?.allocated / record.memory?.total,
|
||||||
|
0
|
||||||
|
)
|
||||||
|
}
|
||||||
label={
|
label={
|
||||||
<span className="flex-column">
|
<span className="flex-column">
|
||||||
<span>
|
<span>
|
||||||
|
|||||||
@@ -454,7 +454,16 @@ const Resources: React.FC = () => {
|
|||||||
</span>
|
</span>
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
key={index}
|
key={index}
|
||||||
percent={_.round(item.memory?.utilization_rate, 0)}
|
percent={
|
||||||
|
item.memory?.used
|
||||||
|
? _.round(item.memory?.utilization_rate, 0)
|
||||||
|
: _.round(
|
||||||
|
(item.memory?.allocated /
|
||||||
|
item.memory?.total) *
|
||||||
|
100,
|
||||||
|
0
|
||||||
|
)
|
||||||
|
}
|
||||||
label={
|
label={
|
||||||
<span className="flex-column">
|
<span className="flex-column">
|
||||||
<span>
|
<span>
|
||||||
|
|||||||
Reference in New Issue
Block a user