Skip to content

Commit 2608e38

Browse files
authored
Merge branch 'master' into migrate
2 parents 1a4f8a8 + 70be9fe commit 2608e38

File tree

20 files changed

+6219
-5182
lines changed

20 files changed

+6219
-5182
lines changed

.github/workflows/nodejs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Node CI
22

33
on:
4-
push
4+
[push, pull_request]
55

66
jobs:
77
build:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ The web-gui should now be available at the url http://localhost:5572
7373
**Bash users:**
7474

7575
Download the sh file given here:
76-
[webui.sh](https://raw.githubusercontent.com/negative0/rclone-webui-react/master/package.json)
76+
[webui.sh](https://raw.githubusercontent.com/rclone/rclone-webui-react/master/webui.sh)
7777

7878
Copy the file to root folder of rclone.
7979

@@ -118,7 +118,7 @@ Coming soon
118118

119119
### Get the Project
120120
```
121-
git clone https://github.com/negative0/rclone-webui-react
121+
git clone https://github.com/rclone/rclone-webui-react
122122
```
123123
OR download a zip from the option above.
124124

package-lock.json

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

package.json

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,53 +12,53 @@
1212
"url": "[email protected]:negative0/rclone-webui-react.git"
1313
},
1414
"dependencies": {
15-
"@coreui/coreui": "^2.1.12",
15+
"@coreui/coreui": "^2.1.16",
1616
"@coreui/coreui-plugin-chartjs-custom-tooltips": "^1.3.1",
1717
"@coreui/icons": "0.3.0",
18-
"@coreui/react": "~2.5.1",
19-
"axios": "^0.19.0",
20-
"bootstrap": "^4.3.1",
21-
"chart.js": "^2.8.0",
18+
"@coreui/react": "^2.5.4",
19+
"axios": "^0.19.2",
20+
"bootstrap": "^4.4.1",
21+
"chart.js": "^2.9.3",
2222
"classnames": "^2.2.6",
23-
"core-js": "^3.1.4",
24-
"flag-icon-css": "^3.3.0",
23+
"core-js": "^3.6.4",
24+
"flag-icon-css": "^3.4.6",
2525
"font-awesome": "^4.7.0",
2626
"jquery": "^3.4.1",
2727
"lodash": "^4.17.14",
2828
"node-sass": "^4.13.1",
2929
"package.json": "^2.0.1",
3030
"prop-types": "^15.7.2",
31-
"react": "^16.8.6",
32-
"react-app-polyfill": "^1.0.1",
31+
"react": "^16.12.0",
32+
"react-app-polyfill": "^1.0.6",
3333
"react-autosuggest": "^9.4.3",
34-
"react-awesome-player": "^1.0.9",
35-
"react-chartjs-2": "^2.7.6",
34+
"react-awesome-player": "^1.0.11",
35+
"react-chartjs-2": "^2.9.0",
3636
"react-dnd": "^7.7.0",
3737
"react-dnd-html5-backend": "^7.7.0",
38-
"react-dom": "^16.8.6",
38+
"react-dom": "^16.12.0",
3939
"react-in-viewport": "0.0.38",
40-
"react-redux": "^7.1.0",
41-
"react-router-config": "^5.0.1",
40+
"react-redux": "^7.1.3",
41+
"react-router-config": "^5.1.1",
4242
"react-router-dom": "~5.0.1",
43-
"react-test-renderer": "^16.8.6",
44-
"react-toastify": "^5.2.1",
45-
"reactstrap": "^8.0.0",
46-
"redux": "^4.0.4",
43+
"react-test-renderer": "^16.12.0",
44+
"react-toastify": "^5.5.0",
45+
"reactstrap": "^8.4.1",
46+
"redux": "^4.0.5",
4747
"redux-thunk": "^2.3.0",
4848
"simple-line-icons": "^2.4.1",
49-
"typescript": "^3.5.3"
49+
"typescript": "^3.7.5"
5050
},
5151
"devDependencies": {
5252
"check-prop-types": "^1.1.2",
53-
"coveralls": "^3.0.4",
54-
"enzyme": "^3.10.0",
55-
"enzyme-adapter-react-16": "^1.14.0",
56-
"enzyme-to-json": "^3.3.5",
57-
"fetch-mock": "^7.3.6",
58-
"react-dnd-test-utils": "^7.4.4",
53+
"coveralls": "^3.0.9",
54+
"enzyme": "^3.11.0",
55+
"enzyme-adapter-react-16": "^1.15.2",
56+
"enzyme-to-json": "^3.4.4",
57+
"fetch-mock": "^7.7.3",
5958
"react-dnd-test-backend": "^7.7.0",
60-
"react-scripts": "^3.0.1",
61-
"redux-mock-store": "^1.5.3"
59+
"react-dnd-test-utils": "^7.4.4",
60+
"react-scripts": "^3.3.1",
61+
"redux-mock-store": "^1.5.4"
6262
},
6363
"scripts": {
6464
"start": "react-scripts start",

src/actions/types.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export const FETCH_STATUS = 'FETCH_STATUS';
22
export const GET_PROVIDERS = 'GET_PROVIDERS';
3+
export const GET_VERSION = 'GET_VERSION';
34
export const GET_CONFIG_FOR_REMOTE = 'GET_CONFIG_FOR_REMOTE';
45
export const GET_REMOTE_LIST = 'GET_REMOTE_LIST';
56
export const GET_CONFIG_DUMP = 'GET_CONFIG_DUMP';

src/actions/versionActions.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import axiosInstance from '../utils/API/API';
2+
import urls from '../utils/API/endpoint';
3+
import { GET_VERSION, REQUEST_SUCCESS, REQUEST_ERROR } from './types';
4+
5+
export const getVersion = () => {
6+
return dispatch => {
7+
axiosInstance.post(urls.getRcloneVersion).then(
8+
res =>
9+
dispatch({
10+
type: GET_VERSION,
11+
status: REQUEST_SUCCESS,
12+
payload: res.data
13+
}),
14+
error =>
15+
dispatch({
16+
type: GET_VERSION,
17+
status: REQUEST_ERROR,
18+
payload: error
19+
})
20+
);
21+
};
22+
};

src/containers/DefaultLayout/DefaultLayout.js

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, {Component, Suspense} from 'react';
22
import {Redirect, Route, Switch} from 'react-router-dom';
33
import {Container} from 'reactstrap';
4+
import {getVersion} from "../../actions/versionActions";
45

56
import {
67
AppAside,
@@ -26,14 +27,34 @@ const DefaultAside = React.lazy(() => import('./DefaultAside'));
2627
const DefaultFooter = React.lazy(() => import('./DefaultFooter'));
2728
const DefaultHeader = React.lazy(() => import('./DefaultHeader'));
2829

30+
const VERSION_NAV_ITEM_ATTRS = {
31+
attributes: { target: '_blank' },
32+
class: 'mt-auto',
33+
icon: 'cui-cog',
34+
url: 'https://rclone.org/changelog',
35+
variant: 'success'
36+
}
2937
class DefaultLayout extends Component {
3038

3139
loading = () => <div className="animated fadeIn pt-1 text-center">Loading...</div>;
3240

41+
get navConfig() {
42+
return {
43+
items: [
44+
...navigation.items,
45+
{
46+
name: this.props.version.version,
47+
...VERSION_NAV_ITEM_ATTRS
48+
}
49+
]
50+
}
51+
}
3352

3453
componentWillMount() {
3554
if (!localStorage.getItem(AUTH_KEY)) {
3655
this.props.history.push('/login');
56+
} else {
57+
this.props.getVersion();
3758
}
3859
}
3960

@@ -54,7 +75,7 @@ class DefaultLayout extends Component {
5475
<AppSidebarHeader/>
5576
<AppSidebarForm/>
5677
<Suspense fallback={this.loading()}>
57-
<AppSidebarNav navConfig={navigation} {...this.props} />
78+
<AppSidebarNav navConfig={this.navConfig} />
5879
</Suspense>
5980
<AppSidebarFooter/>
6081
<AppSidebarMinimizer/>
@@ -102,6 +123,7 @@ class DefaultLayout extends Component {
102123

103124
const mapStateToProps = (state) => ({
104125
isConnected: state.status.isConnected,
126+
version: state.version,
105127
});
106128

107-
export default connect(mapStateToProps, {})(DefaultLayout);
129+
export default connect(mapStateToProps, { getVersion })(DefaultLayout);

src/containers/DefaultLayout/__snapshots__/DefaultLayout.test.js.snap

Lines changed: 19 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -42,26 +42,16 @@ exports[`Remote Explorer renders should match snapshot 1`] = `
4242
<AppSidebarForm
4343
tag="div"
4444
/>
45-
<Suspense>
45+
<Suspense
46+
fallback={
47+
<div
48+
className="animated fadeIn pt-1 text-center"
49+
>
50+
Loading...
51+
</div>
52+
}
53+
>
4654
<AppSidebarNav
47-
history={
48-
Object {
49-
"push": [MockFunction] {
50-
"calls": Array [
51-
Array [
52-
"/login",
53-
],
54-
],
55-
"results": Array [
56-
Object {
57-
"type": "return",
58-
"value": undefined,
59-
},
60-
],
61-
},
62-
}
63-
}
64-
isConnected={true}
6555
isOpen={false}
6656
navConfig={
6757
Object {
@@ -91,18 +81,19 @@ exports[`Remote Explorer renders should match snapshot 1`] = `
9181
"name": "Log Out",
9282
"url": "/login",
9383
},
84+
Object {
85+
"attributes": Object {
86+
"target": "_blank",
87+
},
88+
"class": "mt-auto",
89+
"icon": "cui-cog",
90+
"name": "",
91+
"url": "https://rclone.org/changelog",
92+
"variant": "success",
93+
},
9494
],
9595
}
9696
}
97-
store={
98-
Object {
99-
"dispatch": [Function],
100-
"getState": [Function],
101-
"replaceReducer": [Function],
102-
"subscribe": [Function],
103-
Symbol(observable): [Function],
104-
}
105-
}
10697
tag="nav"
10798
/>
10899
</Suspense>

src/reducers/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {SIGNOUT_REQUEST} from "../actions/types";
88
import providerStatusReducer from "./providerStatusReducer";
99
import userActionsReducer from "./userActionsReducer";
1010
import imagesReducer from "./imagesReducer";
11+
import versionReducer from "./versionReducer";
1112

1213
/**
1314
* Configures the root reducer to be executed before any other reducers configured in the system.
@@ -36,7 +37,8 @@ const appReducer = combineReducers({
3637
explorer: explorerState,
3738
providerStatus: providerStatusReducer,
3839
user: userActionsReducer,
39-
imageLoader: imagesReducer
40+
imageLoader: imagesReducer,
41+
version: versionReducer
4042
// remoteOps: remoteOpsReducer
4143
});
4244

src/reducers/versionReducer.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { GET_VERSION, REQUEST_ERROR, REQUEST_SUCCESS } from '../actions/types';
2+
3+
export const initialState = {
4+
arch: '',
5+
decomposed: [],
6+
goVersion: '',
7+
isGit: false,
8+
os: '',
9+
version: '',
10+
hasError: false
11+
};
12+
13+
export default (state = initialState, action) => {
14+
if (action.type === GET_VERSION) {
15+
if (action.status === REQUEST_SUCCESS) {
16+
return {
17+
...state,
18+
...action.payload,
19+
hasError: false
20+
};
21+
}
22+
if (action.status === REQUEST_ERROR) {
23+
return {
24+
...state,
25+
error: action.payload,
26+
hasError: true
27+
};
28+
}
29+
}
30+
31+
return state;
32+
};

0 commit comments

Comments
 (0)