Skip to content

Commit ac9ee56

Browse files
committed
Fix: file ops layout.
1 parent 485eeec commit ac9ee56

File tree

14 files changed

+277
-521
lines changed

14 files changed

+277
-521
lines changed

.idea/shelf/Uncommitted_changes_before_Update_at_17_06_20,_7_26_PM_[Default_Changelist]/shelved.patch

Lines changed: 0 additions & 222 deletions
This file was deleted.

.idea/shelf/Uncommitted_changes_before_rebase_[Default_Changelist]/shelved.patch

Lines changed: 0 additions & 100 deletions
This file was deleted.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
## About
1414

15-
This project is developed as a part of Google Summer of Code 2019 and 2020 under [ccextractor.org](https://ccextractor.org) and [rclone.org](https://rclone.org) by [negative0](https://github.com/negative0).
15+
This project under development as a part of Google Summer of Code 2019 and 2020 under [ccextractor.org](https://ccextractor.org) and [rclone.org](https://rclone.org) by [negative0](https://github.com/negative0).
1616

17-
This is a reactjs based web UI for the rclone cli project @ [Rclone Website](https://rclone.org/)
17+
This is a reactJS based web UI for the rclone cli project @ [Rclone Website](https://rclone.org/)
1818

1919
### Work Products (GSoC 2019):
2020

@@ -50,7 +50,7 @@ You may have to clear the browser local storage if needed, after switching to th
5050
## Alternatively, you can use the hosted version:
5151
With every release, we publish it to github-pages. You can directly use it without installing rclone locally.
5252

53-
Head over to https://rclone.github.io/rclone-webui-react/. And enter the IP address, username and password of rclone rc server.
53+
Head over to https://rclone.github.io/rclone-webui-react/. To login, enter the IP address, username and password of rclone rc server.
5454

5555
While running the rclone rc server, use the following command,
5656
```

src/scss/_custom.scss

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ body{
4949
font-weight: bold;
5050
color: rgba(114,114,114,1);
5151
}
52-
.layout-change-button{
52+
53+
.layout-change-button {
5354
background: none;
5455
padding: 0;
5556

@@ -58,16 +59,35 @@ body{
5859
.btn-explorer-action {
5960
background: none;
6061
border: none;
62+
63+
}
64+
65+
.file-ops-container {
66+
flex-direction: row;
67+
justify-content: space-between;
6168
}
6269

6370
.btn-explorer-action :hover {
6471
border: 1px;
6572
background: none;
6673
}
6774

68-
.table-fix-head { overflow-y: auto; height: 100px; }
69-
.table-fix-head thead th { position: sticky; top: 0; z-index: 2; border-top: none; border-bottom: 1px solid #c8ced3;}
70-
.table-fix-head th { background: #ffffff; }
75+
.table-fix-head {
76+
overflow-y: auto;
77+
height: 100px;
78+
}
79+
80+
.table-fix-head thead th {
81+
position: sticky;
82+
top: 0;
83+
z-index: 2;
84+
border-top: none;
85+
border-bottom: 1px solid #c8ced3;
86+
}
87+
88+
.table-fix-head th {
89+
background: #ffffff;
90+
}
7191

7292
.animate-fade-in {
7393
-webkit-animation: fadein 0.5s; /* Safari, Chrome and Opera > 12.1 */

src/views/Base/FileOperations/FileOperations.js

Lines changed: 101 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React from 'react';
22
import {
33
Button,
44
ButtonDropdown,
5-
ButtonGroup,
65
Col,
76
DropdownItem,
87
DropdownMenu,
@@ -192,22 +191,26 @@ class FileOperations extends React.Component {
192191
const {changePath, containerID, currentPath} = this.props;
193192
const {tempUrl} = this.state;
194193
let urlSplits = tempUrl.split(":/")
195-
console.log("Url splits", urlSplits);
196-
197194
if (urlSplits && urlSplits[0] && (currentPath.remoteName !== urlSplits[0] || currentPath.remotePath !== urlSplits[1]))
198195
changePath(containerID, urlSplits[0], urlSplits[1])
199196
}
200197

198+
getLg = (n) => {
199+
const {numCols} = this.props;
200+
return Math.abs(n * numCols);
201+
}
202+
201203
render() {
202204
const {containerID, getFilesForContainerID, gridMode, navigateFwd, navigateBack, searchQuery, currentPath, doughnutData} = this.props;
203205
const {newFolderModalIsVisible, dropdownOpen, isAboutModalOpen, searchOpen, tempUrl, isUrlBarFocused} = this.state;
204206

205-
const {remoteName, remotePath} = currentPath;
207+
const {remoteName} = currentPath;
206208

207209
return (
208-
<nav aria-label="breadcrumb" className="row mt-3 mb-1">
209-
<Col sm={4} md={3} lg={2} className="pl-0">
210-
<Button color="light" className={"mr-1 btn-explorer-action"}
210+
<div className="pl-0 mt-3 mb-1 d-flex justify-content-between align-items-center"
211+
style={{marginLeft: "-15px", marginRight: "-15px"}}>
212+
<div className="d-flex flex-nowrap">
213+
<Button color="light" className="mr-1 btn-explorer-action"
211214
onClick={() => navigateBack(containerID)}><i
212215
className={"fa fa-lg fa-arrow-left"}/></Button>
213216
<Button color="light" className={"mr-1 btn-explorer-action"}
@@ -219,108 +222,105 @@ class FileOperations extends React.Component {
219222
<UncontrolledTooltip placement="right" target="RefreshButton">
220223
Refresh Files
221224
</UncontrolledTooltip>
222-
</Col>
223-
<Col sm={8} md={6} lg={7}>
224-
<Form inline onSubmit={this.onSubmitUrlChange}>
225+
</div>
226+
<div className="flex-grow-1 pl-1 pr-1 pr-lg-3 pl-lg-3">
227+
<Form inline onSubmit={this.onSubmitUrlChange} className="h-100">
225228
<Input style={{width: "100%"}} value={tempUrl} onChange={this.onChangeTrial}
226229
onFocus={this.onFocusHandle} onBlur={this.onBlurHandle}/>
227230
<Button className={isUrlBarFocused ? "" : "d-none"} color="link" type={"submit"}
228231
style={{marginLeft: "-45px"}}><i className="fa fa-arrow-right"/></Button>
229232
</Form>
233+
</div>
234+
<div className="d-flex flex-wrap">
235+
{/*<Button className="p-0 float-right" color="link"><i className="fa fa-info-circle"/></Button>*/}
236+
237+
<Button className="mr-1 btn-explorer-action p-1" id="CreateFolderButton"
238+
onClick={this.openNewFolderModal}><img src={newFolderImg} alt="New Folder"
239+
className="fa fa-lg"/> </Button>
240+
<UncontrolledTooltip placement="bottom" target="CreateFolderButton">
241+
Create a new Folder
242+
</UncontrolledTooltip>
230243

231-
</Col>
232-
<Col md={3} lg={3}>
233-
<div className="float-right form-inline">
234-
{/*<Button className="p-0 float-right" color="link"><i className="fa fa-info-circle"/></Button>*/}
235-
<ButtonGroup>
236-
<Form inline>
237-
<FormGroup>
238-
{searchOpen && <Input type="text" placeholder="Search" value={searchQuery}
239-
className="animate-fade-in"
240-
onChange={this.changeSearch}/>
241-
}
242-
<Button className="mr-1 btn-explorer-action" onClick={this.handleSearchOpen}>
243-
<i className={"fa fa-lg " + (searchOpen ? "fa-close" : "fa-search")}/>
244-
</Button>
245-
</FormGroup>
246-
</Form>
247-
<Button className="mr-1 btn-explorer-action p-1" id="CreateFolderButton"
248-
onClick={this.openNewFolderModal}><img src={newFolderImg} alt="New Folder"
249-
className="fa fa-lg"/> </Button>
250-
<UncontrolledTooltip placement="bottom" target="CreateFolderButton">
251-
Create a new Folder
252-
</UncontrolledTooltip>
253-
254-
<ButtonDropdown isOpen={dropdownOpen} toggle={this.toggleDropDown} direction={'down'}
255-
id="FilterButton">
256-
<DropdownToggle className="btn-explorer-action">
257-
<i className={"fa fa-lg fa-filter"}/>
258-
</DropdownToggle>
259-
<DropdownMenu>
260-
<DropdownItem key={"None"} value={""}
261-
onClick={this.handleChangeFilter}>None</DropdownItem>
262-
{
263-
this.filterOptions.map((item, _) => {
264-
return (<DropdownItem key={item} value={item}
265-
onClick={this.handleChangeFilter}>{item}</DropdownItem>)
266-
})
267-
}
268-
</DropdownMenu>
269-
</ButtonDropdown>
270-
271-
<Button className="btn-explorer-action" id="ListViewButton"
272-
onClick={this.handleChangeGridMode}>
273-
<i className={"fa fa-lg " + (gridMode === "card" ? "fa-list" : "fa-th-large")}/>
274-
</Button>
275-
<UncontrolledTooltip placement="right" target="ListViewButton">
276-
{(gridMode === "card" ? "List View" : "Card View")}
277-
</UncontrolledTooltip>
244+
<ButtonDropdown isOpen={dropdownOpen} toggle={this.toggleDropDown} direction={'down'}
245+
id="FilterButton">
246+
<DropdownToggle className="btn-explorer-action">
247+
<i className={"fa fa-lg fa-filter"}/>
248+
</DropdownToggle>
249+
<DropdownMenu>
250+
<DropdownItem key={"None"} value={""}
251+
onClick={this.handleChangeFilter}>None</DropdownItem>
252+
{
253+
this.filterOptions.map((item, _) => {
254+
return (<DropdownItem key={item} value={item}
255+
onClick={this.handleChangeFilter}>{item}</DropdownItem>)
256+
})
257+
}
258+
</DropdownMenu>
259+
</ButtonDropdown>
260+
261+
<Button className="btn-explorer-action" id="ListViewButton"
262+
onClick={this.handleChangeGridMode}>
263+
<i className={"fa fa-lg " + (gridMode === "card" ? "fa-list" : "fa-th-large")}/>
264+
</Button>
265+
<UncontrolledTooltip placement="right" target="ListViewButton">
266+
{(gridMode === "card" ? "List View" : "Card View")}
267+
</UncontrolledTooltip>
268+
269+
<Button className="btn-explorer-action" id="InfoButton"
270+
onClick={this.toggleAboutModal}>
271+
<i className="fa fa-lg fa-info"/>
272+
</Button>
273+
<UncontrolledTooltip placement="right" target="InfoButton">
274+
Show Remote Info
275+
</UncontrolledTooltip>
278276

279-
<Button className="btn-explorer-action" id="InfoButton"
280-
onClick={this.toggleAboutModal}>
281-
<i className="fa fa-lg fa-info"/>
277+
<Form inline>
278+
<FormGroup>
279+
{searchOpen && <Input type="text" placeholder="Search" value={searchQuery}
280+
className="animate-fade-in"
281+
onChange={this.changeSearch}/>
282+
}
283+
<Button color="" className="mr-1 btn-explorer-action"
284+
onClick={this.handleSearchOpen}>
285+
<i className={"fa fa-lg " + (searchOpen ? "fa-close" : "fa-search")}/>
282286
</Button>
283-
<UncontrolledTooltip placement="right" target="InfoButton">
284-
Show Remote Info
285-
</UncontrolledTooltip>
286-
287-
</ButtonGroup>
288-
289-
290-
<NewFolder containerID={containerID} isVisible={newFolderModalIsVisible}
291-
closeModal={this.closeNewFolderModal}/>
292-
293-
<Modal isOpen={isAboutModalOpen} toggle={this.toggleAboutModal}>
294-
<ModalHeader>
295-
Status for {remoteName}
296-
</ModalHeader>
297-
<ModalBody>
298-
<Row>
299-
<Col sm={12}>
300-
<div className="chart-wrapper">
301-
<p>Space Usage (in GB)</p>
302-
{doughnutData && !isEmpty(doughnutData) ? <Doughnut data={doughnutData}/> :
303-
<React.Fragment><Spinner color="primary"/>Loading</React.Fragment>}
304-
</div>
305-
</Col>
306-
</Row>
307-
<Row>
308-
<Col sm={12}>
309-
<Button color="danger" onClick={this.handleCleanTrash}>Clean Trash <i
310-
className="fa fa-lg fa-trash"/></Button>
311-
</Col>
312-
</Row>
313-
314-
</ModalBody>
315-
<ModalFooter>
316-
317-
</ModalFooter>
318-
319-
</Modal>
320-
321-
</div>
322-
</Col>
323-
</nav>
287+
</FormGroup>
288+
</Form>
289+
290+
291+
<NewFolder containerID={containerID} isVisible={newFolderModalIsVisible}
292+
closeModal={this.closeNewFolderModal}/>
293+
294+
<Modal isOpen={isAboutModalOpen} toggle={this.toggleAboutModal}>
295+
<ModalHeader>
296+
Status for {remoteName}
297+
</ModalHeader>
298+
<ModalBody>
299+
<Row>
300+
<Col sm={12}>
301+
<div className="chart-wrapper">
302+
<p>Space Usage (in GB)</p>
303+
{doughnutData && !isEmpty(doughnutData) ? <Doughnut data={doughnutData}/> :
304+
<React.Fragment><Spinner color="primary"/>Loading</React.Fragment>}
305+
</div>
306+
</Col>
307+
</Row>
308+
<Row>
309+
<Col sm={12}>
310+
<Button color="danger" onClick={this.handleCleanTrash}>Clean Trash <i
311+
className="fa fa-lg fa-trash"/></Button>
312+
</Col>
313+
</Row>
314+
315+
</ModalBody>
316+
<ModalFooter>
317+
318+
</ModalFooter>
319+
320+
</Modal>
321+
322+
</div>
323+
</div>
324324

325325
);
326326
}

0 commit comments

Comments
 (0)