Skip to content

Commit

Permalink
optimize: toolbar of web UI
Browse files Browse the repository at this point in the history
  • Loading branch information
XZB-1248 committed Sep 20, 2022
1 parent f69822b commit c8437aa
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 27 deletions.
2 changes: 1 addition & 1 deletion web/src/components/desktop.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function ScreenModal(props) {

function initCanvas() {
if (!canvas) return;
ctx = canvas.getContext('2d');
ctx = canvas.getContext('2d', {alpha: false});
}
function construct() {
if (ctx !== null) {
Expand Down
42 changes: 20 additions & 22 deletions web/src/components/explorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import dayjs from "dayjs";
import i18n from "../locale/locale";
import {VList} from "virtuallist-antd";
import {
CloseOutlined,
CloseOutlined, FullscreenOutlined,
HomeOutlined,
LoadingOutlined,
QuestionCircleOutlined,
Expand Down Expand Up @@ -87,27 +87,10 @@ function FileBrowser(props) {
const options = {
show: true,
search: true,
reload: false,
density: 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 virtualTable = useMemo(() => {
return VList({
Expand All @@ -127,7 +110,6 @@ function FileBrowser(props) {
>
<a>{i18n.t('delete')}</a>
</Popconfirm>

</Space>);
useEffect(() => {
if (props.device) {
Expand Down Expand Up @@ -433,7 +415,6 @@ function FileBrowser(props) {
destroyOnClose={true}
modalTitle={i18n.t('fileExplorer')}
footer={null}
height={500}
width={830}
bodyStyle={{
padding: 0
Expand All @@ -442,10 +423,13 @@ function FileBrowser(props) {
>
<ProTable
rowKey='name'
tableStyle={{
minHeight: '320px',
maxHeight: '320px'
}}
onRow={file => ({
onDoubleClick: onRowClick.bind(null, file)
})}
toolbar={toolbar}
scroll={{scrollToFirstRowOnChange: true, y: 300}}
search={false}
size='small'
Expand Down Expand Up @@ -473,6 +457,20 @@ function FileBrowser(props) {
actionRef={tableRef}
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
id='uploader'
type='file'
Expand Down
4 changes: 0 additions & 4 deletions web/src/components/procmgr.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ function ProcessMgr(props) {
destroyOnClose={true}
modalTitle={i18n.t('processManager')}
footer={null}
height={500}
width={400}
bodyStyle={{
padding: 0
Expand All @@ -111,9 +110,6 @@ function ProcessMgr(props) {
minHeight: '355px',
maxHeight: '355px'
}}
toolbar={{
actions: []
}}
scroll={{scrollToFirstRowOnChange: true, y: 300}}
search={false}
size='small'
Expand Down

0 comments on commit c8437aa

Please sign in to comment.