mirror of
https://github.com/XZB-1248/Spark
synced 2025-09-27 04:26:20 +08:00
optimize: toolbar of web UI
This commit is contained in:
@@ -40,7 +40,7 @@ function ScreenModal(props) {
|
|||||||
|
|
||||||
function initCanvas() {
|
function initCanvas() {
|
||||||
if (!canvas) return;
|
if (!canvas) return;
|
||||||
ctx = canvas.getContext('2d');
|
ctx = canvas.getContext('2d', {alpha: false});
|
||||||
}
|
}
|
||||||
function construct() {
|
function construct() {
|
||||||
if (ctx !== null) {
|
if (ctx !== null) {
|
||||||
|
@@ -19,7 +19,7 @@ import dayjs from "dayjs";
|
|||||||
import i18n from "../locale/locale";
|
import i18n from "../locale/locale";
|
||||||
import {VList} from "virtuallist-antd";
|
import {VList} from "virtuallist-antd";
|
||||||
import {
|
import {
|
||||||
CloseOutlined,
|
CloseOutlined, FullscreenOutlined,
|
||||||
HomeOutlined,
|
HomeOutlined,
|
||||||
LoadingOutlined,
|
LoadingOutlined,
|
||||||
QuestionCircleOutlined,
|
QuestionCircleOutlined,
|
||||||
@@ -87,27 +87,10 @@ function FileBrowser(props) {
|
|||||||
const options = {
|
const options = {
|
||||||
show: true,
|
show: true,
|
||||||
search: true,
|
search: true,
|
||||||
|
reload: false,
|
||||||
density: false,
|
density: false,
|
||||||
setting: false,
|
setting: false,
|
||||||
};
|
};
|
||||||
const toolbar = {
|
|
||||||
settings: [
|
|
||||||
{
|
|
||||||
icon: <UploadOutlined/>,
|
|
||||||
tooltip: i18n.t('upload'),
|
|
||||||
key: 'upload',
|
|
||||||
onClick: uploadFile
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: <ReloadOutlined/>,
|
|
||||||
tooltip: i18n.t('reload'),
|
|
||||||
key: 'reload',
|
|
||||||
onClick: () => {
|
|
||||||
tableRef.current.reload();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};
|
|
||||||
const tableRef = useRef();
|
const tableRef = useRef();
|
||||||
const virtualTable = useMemo(() => {
|
const virtualTable = useMemo(() => {
|
||||||
return VList({
|
return VList({
|
||||||
@@ -127,7 +110,6 @@ function FileBrowser(props) {
|
|||||||
>
|
>
|
||||||
<a>{i18n.t('delete')}</a>
|
<a>{i18n.t('delete')}</a>
|
||||||
</Popconfirm>
|
</Popconfirm>
|
||||||
|
|
||||||
</Space>);
|
</Space>);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (props.device) {
|
if (props.device) {
|
||||||
@@ -433,7 +415,6 @@ function FileBrowser(props) {
|
|||||||
destroyOnClose={true}
|
destroyOnClose={true}
|
||||||
modalTitle={i18n.t('fileExplorer')}
|
modalTitle={i18n.t('fileExplorer')}
|
||||||
footer={null}
|
footer={null}
|
||||||
height={500}
|
|
||||||
width={830}
|
width={830}
|
||||||
bodyStyle={{
|
bodyStyle={{
|
||||||
padding: 0
|
padding: 0
|
||||||
@@ -442,10 +423,13 @@ function FileBrowser(props) {
|
|||||||
>
|
>
|
||||||
<ProTable
|
<ProTable
|
||||||
rowKey='name'
|
rowKey='name'
|
||||||
|
tableStyle={{
|
||||||
|
minHeight: '320px',
|
||||||
|
maxHeight: '320px'
|
||||||
|
}}
|
||||||
onRow={file => ({
|
onRow={file => ({
|
||||||
onDoubleClick: onRowClick.bind(null, file)
|
onDoubleClick: onRowClick.bind(null, file)
|
||||||
})}
|
})}
|
||||||
toolbar={toolbar}
|
|
||||||
scroll={{scrollToFirstRowOnChange: true, y: 300}}
|
scroll={{scrollToFirstRowOnChange: true, y: 300}}
|
||||||
search={false}
|
search={false}
|
||||||
size='small'
|
size='small'
|
||||||
@@ -473,6 +457,20 @@ function FileBrowser(props) {
|
|||||||
actionRef={tableRef}
|
actionRef={tableRef}
|
||||||
components={virtualTable}
|
components={virtualTable}
|
||||||
/>
|
/>
|
||||||
|
<Button
|
||||||
|
style={{right:'59px'}}
|
||||||
|
className='header-button'
|
||||||
|
icon={<ReloadOutlined />}
|
||||||
|
onClick={() => {
|
||||||
|
tableRef.current.reload();
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<Button
|
||||||
|
style={{right:'115px'}}
|
||||||
|
className='header-button'
|
||||||
|
icon={<UploadOutlined />}
|
||||||
|
onClick={uploadFile}
|
||||||
|
/>
|
||||||
<input
|
<input
|
||||||
id='uploader'
|
id='uploader'
|
||||||
type='file'
|
type='file'
|
||||||
|
@@ -97,7 +97,6 @@ function ProcessMgr(props) {
|
|||||||
destroyOnClose={true}
|
destroyOnClose={true}
|
||||||
modalTitle={i18n.t('processManager')}
|
modalTitle={i18n.t('processManager')}
|
||||||
footer={null}
|
footer={null}
|
||||||
height={500}
|
|
||||||
width={400}
|
width={400}
|
||||||
bodyStyle={{
|
bodyStyle={{
|
||||||
padding: 0
|
padding: 0
|
||||||
@@ -111,9 +110,6 @@ function ProcessMgr(props) {
|
|||||||
minHeight: '355px',
|
minHeight: '355px',
|
||||||
maxHeight: '355px'
|
maxHeight: '355px'
|
||||||
}}
|
}}
|
||||||
toolbar={{
|
|
||||||
actions: []
|
|
||||||
}}
|
|
||||||
scroll={{scrollToFirstRowOnChange: true, y: 300}}
|
scroll={{scrollToFirstRowOnChange: true, y: 300}}
|
||||||
search={false}
|
search={false}
|
||||||
size='small'
|
size='small'
|
||||||
|
Reference in New Issue
Block a user