日志和脚本增加文件大小展示,修改脚本管理列表排序

This commit is contained in:
whyour
2023-12-21 09:57:06 +08:00
parent 52a89a21f6
commit f8aba4b1fb
6 changed files with 78 additions and 54 deletions
+14 -4
View File
@@ -1,4 +1,4 @@
import intl from 'react-intl-universal'
import intl from 'react-intl-universal';
import { useState, useEffect, useCallback, Key, useRef } from 'react';
import {
TreeSelect,
@@ -31,7 +31,7 @@ const { Text } = Typography;
const Log = () => {
const { headerStyle, isPhone, theme } = useOutletContext<SharedContext>();
const [value, setValue] = useState(intl.get('请选择日志文件'));
const [select, setSelect] = useState<string>('');
const [select, setSelect] = useState<string>(intl.get('请选择日志文件'));
const [data, setData] = useState<any[]>([]);
const [loading, setLoading] = useState(false);
const [height, setHeight] = useState<number>();
@@ -117,7 +117,8 @@ const Log = () => {
<Text style={{ wordBreak: 'break-all' }} type="warning">
{select}
</Text>
{intl.get('文件')}{currentNode.type === 'directory' ? intl.get('夹下所以日志') : ''}
{intl.get('文件')}
{currentNode.type === 'directory' ? intl.get('夹下所以日志') : ''}
{intl.get(',删除后不可恢复')}
</>
),
@@ -181,7 +182,16 @@ const Log = () => {
return (
<PageContainer
className="ql-container-wrapper log-wrapper"
title={select}
title={
<>
{select}
{currentNode?.type === 'file' && (
<span style={{ marginLeft: 6, fontSize: 12, color: '#999' }}>
{(currentNode.size / 1024).toFixed(3)}KB
</span>
)}
</>
}
loading={loading}
extra={
isPhone
+12 -3
View File
@@ -50,7 +50,7 @@ const { Text } = Typography;
const Script = () => {
const { headerStyle, isPhone, theme } = useOutletContext<SharedContext>();
const [value, setValue] = useState(intl.get('请选择脚本文件'));
const [select, setSelect] = useState<string>('');
const [select, setSelect] = useState<string>(intl.get('请选择脚本文件'));
const [data, setData] = useState<any[]>([]);
const [loading, setLoading] = useState(false);
const [mode, setMode] = useState('');
@@ -363,7 +363,7 @@ const Script = () => {
};
const initState = () => {
setSelect('');
setSelect(intl.get('请选择脚本文件'));
setCurrentNode(null);
setValue(intl.get('请选择脚本文件'));
};
@@ -462,7 +462,16 @@ const Script = () => {
return (
<PageContainer
className="ql-container-wrapper log-wrapper"
title={select}
title={
<>
{select}
{currentNode?.type === 'file' && (
<span style={{ marginLeft: 6, fontSize: 12, color: '#999' }}>
{(currentNode.size / 1024).toFixed(3)}KB
</span>
)}
</>
}
loading={loading}
extra={
isPhone