Skip to content

Commit 1266423

Browse files
authored
Merge pull request #85 from rclone/ui-redesign
Ui redesign
2 parents 7d72ca4 + 1efb2f2 commit 1266423

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+2548
-2138
lines changed

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/actions/explorerActions.js

Lines changed: 70 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
import axiosInstance from "../utils/API/API";
22
import {
3-
CHANGE_DISTRACTION_FREE_MODE,
4-
CHANGE_LAYOUT_COLS,
5-
GET_CONFIG_FOR_REMOTE,
6-
GET_FILES_LIST,
7-
GET_REMOTE_LIST,
8-
REQUEST_ERROR,
9-
REQUEST_SUCCESS
3+
ADD_LAYOUT_CONTAINER,
4+
CHANGE_ACTIVE_REMOTE_CONTAINER,
5+
CHANGE_DISTRACTION_FREE_MODE,
6+
CHANGE_LAYOUT_COLS,
7+
GET_CONFIG_FOR_REMOTE,
8+
GET_FILES_LIST,
9+
GET_REMOTE_LIST,
10+
REMOVE_LAYOUT_CONTAINER,
11+
REQUEST_ERROR,
12+
REQUEST_SUCCESS
1013
} from "./types";
11-
import {addColonAtLast, isLocalRemoteName} from "../utils/Tools";
12-
import {createPath} from "./explorerStateActions";
14+
import {addColonAtLast, isLocalRemoteName, makeUniqueID} from "../utils/Tools";
15+
import {createPath, removePath} from "./explorerStateActions";
1316
import urls from "../utils/API/endpoint";
1417

1518
/**
@@ -110,21 +113,74 @@ export const getFiles = (remoteName, remotePath) => dispatch => {
110113

111114
/**
112115
* Changes the number of columns in current layout view.
116+
* @param mode {string} Either "vertical or horizontal, defines the split type"
113117
* @param numCols {number} Number of columns to create
114118
* @returns {Function}
115119
*/
116-
export const changeNumCols = (numCols) => (dispatch) => {
120+
export const changeNumCols = (numCols, mode) => (dispatch) => {
117121
if (!numCols || numCols < 0) throw new Error(`Invalid number of cols:${numCols}`);
118122

119123

120-
for (let i = 0; i < numCols; i++) {
121-
dispatch(createPath(i.toString()))
122-
}
124+
// for (let i = 0; i < numCols; i++) {
125+
// dispatch(createPath(i.toString()))
126+
// }
123127

124128
dispatch({
125129
type: CHANGE_LAYOUT_COLS,
126130
payload: {
127-
numCols
131+
numCols, mode
132+
}
133+
})
134+
};
135+
136+
/**
137+
* Adds a new remote container.
138+
* @param paneID {int} pane ID
139+
* @returns {Function}
140+
*/
141+
export const addRemoteContainer = (paneID) => (dispatch) => {
142+
const uniqueID = makeUniqueID(3);
143+
dispatch(createPath(uniqueID));
144+
dispatch(changeActiveRemoteContainer(uniqueID, paneID));
145+
dispatch({
146+
type: ADD_LAYOUT_CONTAINER,
147+
payload: {
148+
containerID: uniqueID,
149+
paneID
150+
}
151+
})
152+
};
153+
154+
155+
/**
156+
* Remove a new remote container.
157+
* @param containerID {string} Container ID to remove
158+
* @param paneID {int} pane ID
159+
* @returns {Function}
160+
*/
161+
export const removeRemoteContainer = (containerID, paneID) => (dispatch) => {
162+
dispatch(removePath(containerID));
163+
// console.log("Removing : " + containerID);
164+
dispatch({
165+
type: REMOVE_LAYOUT_CONTAINER,
166+
payload: {
167+
containerID, paneID
168+
}
169+
})
170+
};
171+
172+
/**
173+
* Change active remote container.
174+
* @param containerID {string} Container ID to remove
175+
* @param paneID {int} pane ID
176+
* @returns {Function}
177+
*/
178+
export const changeActiveRemoteContainer = (containerID, paneID) => (dispatch) => {
179+
dispatch({
180+
type: CHANGE_ACTIVE_REMOTE_CONTAINER,
181+
payload: {
182+
containerID,
183+
paneID
128184
}
129185
})
130186
};

src/actions/explorerStateActions.js

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ import {
55
CHANGE_REMOTE_NAME,
66
CHANGE_REMOTE_PATH,
77
CHANGE_SEARCH_QUERY,
8+
CHANGE_SORT_FILTER,
89
CHANGE_VISIBILITY_FILTER,
910
CREATE_PATH,
1011
NAVIGATE_BACK,
1112
NAVIGATE_FWD,
12-
NAVIGATE_UP
13+
NAVIGATE_UP,
14+
REMOVE_PATH
1315
} from "./types";
1416
import {getFiles} from "./explorerActions";
1517

@@ -98,6 +100,20 @@ export const createPath = (containerID) => dispatch => {
98100
};
99101

100102

103+
/**
104+
* Creates an empty path for initialization of a container.
105+
* @param containerID {string}
106+
* @returns {Function}
107+
*/
108+
export const removePath = (containerID) => dispatch => {
109+
110+
dispatch({
111+
type: REMOVE_PATH,
112+
id: containerID
113+
})
114+
};
115+
116+
101117
/**
102118
* Computes and requests the path for going one level up in the working directory.
103119
* Eg: /tmp/abc -> navigateUp -> /tmp
@@ -197,3 +213,14 @@ export const setLoadImages = (containerID, shouldLoad) => dispatch => {
197213
})
198214
};
199215

216+
export const changeSortFilter = (containerID, sortFilter, sortFilterAscending) => dispatch => {
217+
dispatch({
218+
type: CHANGE_SORT_FILTER,
219+
id: containerID,
220+
payload: {
221+
sortFilter,
222+
sortFilterAscending
223+
}
224+
})
225+
}
226+

src/actions/types.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export const GET_CONFIG_DUMP = 'GET_CONFIG_DUMP';
77
export const GET_FILES_LIST = 'GET_FILES_LIST';
88
export const CHANGE_PATH = 'CHANGE_PATH';
99
export const CREATE_PATH = 'CREATE_PATH';
10+
export const REMOVE_PATH = 'REMOVE_PATH';
1011
export const CHANGE_REMOTE_NAME = 'CHANGE_REMOTE_NAME';
1112
export const CHANGE_REMOTE_PATH = 'CHANGE_REMOTE_PATH';
1213
export const NAVIGATE_UP = 'NAVIGATE_UP';
@@ -30,7 +31,11 @@ export const CHANGE_AXIOS_INTERCEPTOR = 'CHANGE_AXIOS_INTERCEPTOR';
3031
export const CHANGE_LOAD_IMAGES = 'CHANGE_LOAD_IMAGES';
3132
export const LOAD_IMAGE = 'LOAD_IMAGE';
3233
export const CHANGE_LAYOUT_COLS = 'CHANGE_LAYOUT_COLS';
34+
export const ADD_LAYOUT_CONTAINER = 'ADD_LAYOUT_CONTAINER';
35+
export const REMOVE_LAYOUT_CONTAINER = 'REMOVE_LAYOUT_CONTAINER';
36+
export const CHANGE_ACTIVE_REMOTE_CONTAINER = 'CHANGE_ACTIVE_REMOTE_CONTAINER';
3337
export const CHANGE_DISTRACTION_FREE_MODE = "CHANGE_DISTRACTION_FREE_MODE";
38+
export const CHANGE_SORT_FILTER = "CHANGE_SORT_FILTER";
3439

3540

3641
export const REQUEST_ERROR = 'ERROR';
1.06 MB
Loading
9.14 KB
Loading

src/assets/img/double-pane1.png

922 Bytes
Loading

src/assets/img/new-folder.png

337 Bytes
Loading

src/assets/img/single-pane.png

2.09 KB
Loading

src/assets/img/triple-pane.png

934 Bytes
Loading

0 commit comments

Comments
 (0)