修复依赖管理和脚本管理样式

This commit is contained in:
whyour 2024-08-31 23:46:29 +08:00
parent a41dd74048
commit c229eca315
3 changed files with 18 additions and 8 deletions

View File

@ -15,7 +15,7 @@ ARG QL_URL=https://github.com/${QL_MAINTAINER}/qinglong.git
ARG QL_BRANCH=develop ARG QL_BRANCH=develop
ENV PNPM_HOME=/root/.local/share/pnpm \ ENV PNPM_HOME=/root/.local/share/pnpm \
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/.local/share/pnpm:/root/.local/share/pnpm/global/5/node_modules:$PNPM_HOME \ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/.local/share/pnpm:/root/.local/share/pnpm/global/5/node_modules \
NODE_PATH=/usr/local/bin:/usr/local/pnpm-global/5/node_modules:/usr/local/lib/node_modules:/root/.local/share/pnpm/global/5/node_modules \ NODE_PATH=/usr/local/bin:/usr/local/pnpm-global/5/node_modules:/usr/local/lib/node_modules:/root/.local/share/pnpm/global/5/node_modules \
LANG=C.UTF-8 \ LANG=C.UTF-8 \
SHELL=/bin/bash \ SHELL=/bin/bash \

View File

@ -39,6 +39,7 @@ import dayjs from 'dayjs';
import WebSocketManager from '@/utils/websocket'; import WebSocketManager from '@/utils/websocket';
import { DependenceStatus, Status } from './type'; import { DependenceStatus, Status } from './type';
import IconFont from '@/components/iconfont'; import IconFont from '@/components/iconfont';
import useResizeObserver from '@react-hook/resize-observer';
const { Text } = Typography; const { Text } = Typography;
const { Search } = Input; const { Search } = Input;
@ -240,7 +241,19 @@ const Dependence = () => {
const [isLogModalVisible, setIsLogModalVisible] = useState(false); const [isLogModalVisible, setIsLogModalVisible] = useState(false);
const [type, setType] = useState('nodejs'); const [type, setType] = useState('nodejs');
const tableRef = useRef<HTMLDivElement>(null); const tableRef = useRef<HTMLDivElement>(null);
const tableScrollHeight = useTableScrollHeight(tableRef, 59); const [height, setHeight] = useState<number>(0);
useResizeObserver(tableRef, (entry) => {
const _height =
entry.target?.parentElement?.parentElement?.parentElement?.offsetHeight;
let threshold = 113;
if (selectedRowIds.length) {
threshold += 53;
}
if (_height && height !== _height - threshold) {
setHeight(_height - threshold);
}
});
const getDependencies = (status?: number[]) => { const getDependencies = (status?: number[]) => {
setLoading(true); setLoading(true);
@ -568,7 +581,7 @@ const Dependence = () => {
dataSource={value} dataSource={value}
rowKey="id" rowKey="id"
size="middle" size="middle"
scroll={{ x: 768, y: tableScrollHeight }} scroll={{ x: 768, y: height }}
loading={loading} loading={loading}
onChange={(pagination, filters) => { onChange={(pagination, filters) => {
getDependencies(filters?.status as number[]); getDependencies(filters?.status as number[]);
@ -602,27 +615,24 @@ const Dependence = () => {
defaultActiveKey="nodejs" defaultActiveKey="nodejs"
size="small" size="small"
tabPosition="top" tabPosition="top"
style={{ height: '100%' }}
destroyInactiveTabPane destroyInactiveTabPane
onChange={onTabChange} onChange={onTabChange}
items={[ items={[
{ {
key: 'nodejs', key: 'nodejs',
label: 'NodeJs', label: 'NodeJs',
children,
}, },
{ {
key: 'python3', key: 'python3',
label: 'Python3', label: 'Python3',
children,
}, },
{ {
key: 'linux', key: 'linux',
label: 'Linux', label: 'Linux',
children,
}, },
]} ]}
/> />
{children}
<DependenceModal <DependenceModal
visible={isModalVisible} visible={isModalVisible}
handleCancel={handleCancel} handleCancel={handleCancel}

View File

@ -377,7 +377,7 @@ const Script = () => {
useEffect(() => { useEffect(() => {
if (treeDom.current) { if (treeDom.current) {
setHeight(treeDom.current.clientHeight); setHeight(treeDom.current.clientHeight - 6);
} }
}, [treeDom.current, data]); }, [treeDom.current, data]);