Skip to content

Commit c8437aa

Browse files
author
XZB-1248
committed
optimize: toolbar of web UI
1 parent f69822b commit c8437aa

File tree

3 files changed

+21
-27
lines changed

3 files changed

+21
-27
lines changed

web/src/components/desktop.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function ScreenModal(props) {
4040

4141
function initCanvas() {
4242
if (!canvas) return;
43-
ctx = canvas.getContext('2d');
43+
ctx = canvas.getContext('2d', {alpha: false});
4444
}
4545
function construct() {
4646
if (ctx !== null) {

web/src/components/explorer.js

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import dayjs from "dayjs";
1919
import i18n from "../locale/locale";
2020
import {VList} from "virtuallist-antd";
2121
import {
22-
CloseOutlined,
22+
CloseOutlined, FullscreenOutlined,
2323
HomeOutlined,
2424
LoadingOutlined,
2525
QuestionCircleOutlined,
@@ -87,27 +87,10 @@ function FileBrowser(props) {
8787
const options = {
8888
show: true,
8989
search: true,
90+
reload: false,
9091
density: false,
9192
setting: false,
9293
};
93-
const toolbar = {
94-
settings: [
95-
{
96-
icon: <UploadOutlined/>,
97-
tooltip: i18n.t('upload'),
98-
key: 'upload',
99-
onClick: uploadFile
100-
},
101-
{
102-
icon: <ReloadOutlined/>,
103-
tooltip: i18n.t('reload'),
104-
key: 'reload',
105-
onClick: () => {
106-
tableRef.current.reload();
107-
}
108-
}
109-
]
110-
};
11194
const tableRef = useRef();
11295
const virtualTable = useMemo(() => {
11396
return VList({
@@ -127,7 +110,6 @@ function FileBrowser(props) {
127110
>
128111
<a>{i18n.t('delete')}</a>
129112
</Popconfirm>
130-
131113
</Space>);
132114
useEffect(() => {
133115
if (props.device) {
@@ -433,7 +415,6 @@ function FileBrowser(props) {
433415
destroyOnClose={true}
434416
modalTitle={i18n.t('fileExplorer')}
435417
footer={null}
436-
height={500}
437418
width={830}
438419
bodyStyle={{
439420
padding: 0
@@ -442,10 +423,13 @@ function FileBrowser(props) {
442423
>
443424
<ProTable
444425
rowKey='name'
426+
tableStyle={{
427+
minHeight: '320px',
428+
maxHeight: '320px'
429+
}}
445430
onRow={file => ({
446431
onDoubleClick: onRowClick.bind(null, file)
447432
})}
448-
toolbar={toolbar}
449433
scroll={{scrollToFirstRowOnChange: true, y: 300}}
450434
search={false}
451435
size='small'
@@ -473,6 +457,20 @@ function FileBrowser(props) {
473457
actionRef={tableRef}
474458
components={virtualTable}
475459
/>
460+
<Button
461+
style={{right:'59px'}}
462+
className='header-button'
463+
icon={<ReloadOutlined />}
464+
onClick={() => {
465+
tableRef.current.reload();
466+
}}
467+
/>
468+
<Button
469+
style={{right:'115px'}}
470+
className='header-button'
471+
icon={<UploadOutlined />}
472+
onClick={uploadFile}
473+
/>
476474
<input
477475
id='uploader'
478476
type='file'

web/src/components/procmgr.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ function ProcessMgr(props) {
9797
destroyOnClose={true}
9898
modalTitle={i18n.t('processManager')}
9999
footer={null}
100-
height={500}
101100
width={400}
102101
bodyStyle={{
103102
padding: 0
@@ -111,9 +110,6 @@ function ProcessMgr(props) {
111110
minHeight: '355px',
112111
maxHeight: '355px'
113112
}}
114-
toolbar={{
115-
actions: []
116-
}}
117113
scroll={{scrollToFirstRowOnChange: true, y: 300}}
118114
search={false}
119115
size='small'

0 commit comments

Comments
 (0)