[Layout changes] [Skynet premium portal support]
This commit is contained in:
@@ -44,7 +44,7 @@ const UpgradeIPC = require('../src/renderer/ipc/UpgradeIPC');
|
|||||||
const platform = os.platform();
|
const platform = os.platform();
|
||||||
|
|
||||||
const dimensions = {
|
const dimensions = {
|
||||||
height: platform === 'win32' ? 326 : platform === 'darwin' ? 322 : 300,
|
height: platform === 'win32' ? 326 : platform === 'darwin' ? 322 : 400,
|
||||||
width: platform === 'win32' ? 468 : 628,
|
width: platform === 'win32' ? 468 : 628,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
16
src/App.css
16
src/App.css
@@ -8,19 +8,3 @@
|
|||||||
background-size: cover;
|
background-size: cover;
|
||||||
}
|
}
|
||||||
|
|
||||||
.AppContainer {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
|
|
||||||
.AppHeader {
|
|
||||||
height: 28px;
|
|
||||||
margin-bottom: var(--default_spacing);
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
|
|
||||||
.AppContent {
|
|
||||||
height: calc(100% - 36px);
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
|
|||||||
39
src/App.jsx
39
src/App.jsx
@@ -280,7 +280,7 @@ class App extends IPCContainer {
|
|||||||
let mainContent = [];
|
let mainContent = [];
|
||||||
if (this.props.DisplaySelectAppPlatform || !this.props.AppReady) {
|
if (this.props.DisplaySelectAppPlatform || !this.props.AppReady) {
|
||||||
mainContent = (
|
mainContent = (
|
||||||
<Box dxStyle={{ height: '100%' }}>
|
<Box col={0} colSpan={'remain'} row={0} rowSpan={'remain'}>
|
||||||
<Loading />
|
<Loading />
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
@@ -288,24 +288,25 @@ class App extends IPCContainer {
|
|||||||
let key = 0;
|
let key = 0;
|
||||||
mainContent.push(
|
mainContent.push(
|
||||||
<Box
|
<Box
|
||||||
|
col={0}
|
||||||
|
colSpan={'remain'}
|
||||||
|
row={10}
|
||||||
|
rowSpan={'17'}
|
||||||
key={'md_' + key++}
|
key={'md_' + key++}
|
||||||
dxStyle={{ padding: 'var(--default_spacing)', height: 'auto' }}>
|
dxStyle={{ padding: 'var(--default_spacing)' }}>
|
||||||
<ReleaseVersionDisplay
|
<ReleaseVersionDisplay
|
||||||
downloadDisabled={!downloadEnabled}
|
downloadDisabled={!downloadEnabled}
|
||||||
version={selectedVersion}
|
version={selectedVersion}
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
mainContent.push(
|
|
||||||
<div
|
|
||||||
key={'md_' + key++}
|
|
||||||
style={{ paddingTop: 'var(--default_spacing)' }}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
if (allowMount) {
|
if (allowMount) {
|
||||||
mainContent.push(
|
mainContent.push(
|
||||||
<Box
|
<Box
|
||||||
dxStyle={{ padding: 'var(--default_spacing)', height: 'auto' }}
|
row={29}
|
||||||
|
rowSpan={'remain'}
|
||||||
|
colSpan={'remain'}
|
||||||
|
dxStyle={{ padding: 'var(--default_spacing)' }}
|
||||||
key={'md_' + key++}>
|
key={'md_' + key++}>
|
||||||
<MountItems
|
<MountItems
|
||||||
s3Supported={s3Supported}
|
s3Supported={s3Supported}
|
||||||
@@ -319,7 +320,11 @@ class App extends IPCContainer {
|
|||||||
} else if (!downloadEnabled && selectedVersion !== 'unavailable') {
|
} else if (!downloadEnabled && selectedVersion !== 'unavailable') {
|
||||||
mainContent.push(
|
mainContent.push(
|
||||||
<Box
|
<Box
|
||||||
dxStyle={{ padding: 'var(--default_spacing)', height: '170px' }}
|
col={0}
|
||||||
|
colSpan={'remain'}
|
||||||
|
row={0}
|
||||||
|
rowSpan={'remain'}
|
||||||
|
dxStyle={{ padding: 'var(--default_spacing)' }}
|
||||||
key={'md_' + key++}>
|
key={'md_' + key++}>
|
||||||
<Loading />
|
<Loading />
|
||||||
</Box>
|
</Box>
|
||||||
@@ -329,15 +334,14 @@ class App extends IPCContainer {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={'App'}>
|
<div className={'App'}>
|
||||||
<div className={'AppContainer'}>
|
|
||||||
<div className={'AppHeader'}>
|
|
||||||
<Box>
|
|
||||||
<Grid>
|
<Grid>
|
||||||
|
<Box col={0} colSpan={'remain'} row={0} rowSpan={8}>
|
||||||
|
<Grid noScroll>
|
||||||
<Text
|
<Text
|
||||||
col={0}
|
col={0}
|
||||||
colSpan={'remain'}
|
colSpan={'remain'}
|
||||||
row={0}
|
row={0}
|
||||||
rowSpan={'remain'}
|
rowSpan={8}
|
||||||
text={'Repertory UI v' + this.props.Version}
|
text={'Repertory UI v' + this.props.Version}
|
||||||
textAlign={'center'}
|
textAlign={'center'}
|
||||||
type={'Heading1'}
|
type={'Heading1'}
|
||||||
@@ -355,15 +359,14 @@ class App extends IPCContainer {
|
|||||||
}
|
}
|
||||||
clicked={this.handleUpgradeIconClicked}
|
clicked={this.handleUpgradeIconClicked}
|
||||||
col={(dimensions) => dimensions.columns - 6}
|
col={(dimensions) => dimensions.columns - 6}
|
||||||
colSpan={5}
|
colSpan={1}
|
||||||
row={1}
|
row={1}
|
||||||
rowSpan={(remain) => remain - 1}
|
rowSpan={(remain) => remain - 1}
|
||||||
/>
|
/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Box>
|
</Box>
|
||||||
</div>
|
{mainContent}
|
||||||
<div className={'AppContent'}>{mainContent}</div>
|
</Grid>
|
||||||
</div>
|
|
||||||
{importDisplay}
|
{importDisplay}
|
||||||
{exportDisplay}
|
{exportDisplay}
|
||||||
{newReleasesDisplay}
|
{newReleasesDisplay}
|
||||||
|
|||||||
@@ -5,12 +5,13 @@ import DropDown from '../../components/UI/DropDown/DropDown';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import Text from '../../components/UI/Text/Text';
|
import Text from '../../components/UI/Text/Text';
|
||||||
import { Component } from 'react';
|
import { Component } from 'react';
|
||||||
import { connect } from 'react-redux';
|
|
||||||
import { createDismissDisplay } from '../../utils.jsx';
|
|
||||||
import {
|
import {
|
||||||
addEditHost,
|
addEditHost,
|
||||||
completeAddEditHost,
|
completeAddEditHost,
|
||||||
} from '../../redux/actions/host_actions';
|
} from '../../redux/actions/host_actions';
|
||||||
|
import { connect } from 'react-redux';
|
||||||
|
import { createDismissDisplay } from '../../utils.jsx';
|
||||||
|
import { notifyError } from '../../redux/actions/error_actions';
|
||||||
|
|
||||||
class AddEditHost extends Component {
|
class AddEditHost extends Component {
|
||||||
state = {
|
state = {
|
||||||
@@ -37,6 +38,18 @@ class AddEditHost extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleSave = () => {
|
handleSave = () => {
|
||||||
|
if (this.state.HostNameOrIp.trim().length == 0) {
|
||||||
|
this.props.notifyError('Host / IP cannot be empty');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this.state.HostNameOrIp.trim().indexOf('/') >= 0) {
|
||||||
|
this.props.notifyError(`Host / IP cannot be contain '/'`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this.state.HostNameOrIp.trim().indexOf(':') >= 0) {
|
||||||
|
this.props.notifyError(`Host / IP cannot be contain ':'`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.props.completeAddEditHost(this.state);
|
this.props.completeAddEditHost(this.state);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -224,6 +237,7 @@ const mapDispatchToProps = (dispatch) => {
|
|||||||
Close: () => dispatch(addEditHost(false)),
|
Close: () => dispatch(addEditHost(false)),
|
||||||
completeAddEditHost: (host_data) =>
|
completeAddEditHost: (host_data) =>
|
||||||
dispatch(completeAddEditHost(true, host_data)),
|
dispatch(completeAddEditHost(true, host_data)),
|
||||||
|
notifyError: (msg) => dispatch(notifyError(msg)),
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -231,6 +245,7 @@ AddEditHost.propTypes = {
|
|||||||
Close: PropTypes.func.isRequired,
|
Close: PropTypes.func.isRequired,
|
||||||
completeAddEditHost: PropTypes.func.isRequired,
|
completeAddEditHost: PropTypes.func.isRequired,
|
||||||
HostData: PropTypes.object,
|
HostData: PropTypes.object,
|
||||||
|
notifyError: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(AddEditHost);
|
export default connect(mapStateToProps, mapDispatchToProps)(AddEditHost);
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ const Host = ({ allowDelete, addEditHost, value, onChange, onDelete }) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const premium = value.AuthURL && value.AuthUser;
|
||||||
return (
|
return (
|
||||||
<div style={{ display: 'flex', flexDirection: 'row' }}>
|
<div style={{ display: 'flex', flexDirection: 'row' }}>
|
||||||
<div
|
<div
|
||||||
@@ -46,6 +47,18 @@ const Host = ({ allowDelete, addEditHost, value, onChange, onDelete }) => {
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
|
{premium ? (
|
||||||
|
<p>
|
||||||
|
<b>
|
||||||
|
{'(premium) ' +
|
||||||
|
value.HostNameOrIp +
|
||||||
|
((value.Protocol === 'http' && value.ApiPort === 80) ||
|
||||||
|
(value.Protocol === 'https' && value.ApiPort === 443)
|
||||||
|
? ''
|
||||||
|
: ':' + value.ApiPort)}
|
||||||
|
</b>
|
||||||
|
</p>
|
||||||
|
) : (
|
||||||
<p>
|
<p>
|
||||||
{value.HostNameOrIp +
|
{value.HostNameOrIp +
|
||||||
((value.Protocol === 'http' && value.ApiPort === 80) ||
|
((value.Protocol === 'http' && value.ApiPort === 80) ||
|
||||||
@@ -53,6 +66,7 @@ const Host = ({ allowDelete, addEditHost, value, onChange, onDelete }) => {
|
|||||||
? ''
|
? ''
|
||||||
: ':' + value.ApiPort)}
|
: ':' + value.ApiPort)}
|
||||||
</p>
|
</p>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
.MountItems {
|
.MountItems {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
height: 121px;
|
height: 212px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
.MountItemsRemote {
|
.MountItemsRemote {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
height: 121px;
|
height: 212px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
|
|||||||
@@ -314,7 +314,7 @@ class MountItems extends IPCContainer {
|
|||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
onDetectMountReply = (event, arg) => {
|
onDetectMountReply = (_, arg) => {
|
||||||
const provider = arg.data.Provider;
|
const provider = arg.data.Provider;
|
||||||
if (!this.state.RetryItems[provider]) {
|
if (!this.state.RetryItems[provider]) {
|
||||||
if (
|
if (
|
||||||
@@ -344,13 +344,13 @@ class MountItems extends IPCContainer {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
onMountDriveReply = (event, arg) => {
|
onMountDriveReply = (_, arg) => {
|
||||||
this.props.setMounted(arg.data.Provider, arg.data.Success);
|
this.props.setMounted(arg.data.Provider, arg.data.Success);
|
||||||
this.detectMount(arg.data.Provider);
|
this.detectMount(arg.data.Provider);
|
||||||
this.removeMountsBusy(arg.data.Provider);
|
this.removeMountsBusy(arg.data.Provider);
|
||||||
};
|
};
|
||||||
|
|
||||||
onUnmountDriveReply = (event, arg) => {
|
onUnmountDriveReply = (_, arg) => {
|
||||||
if (
|
if (
|
||||||
arg &&
|
arg &&
|
||||||
arg.data &&
|
arg.data &&
|
||||||
@@ -480,78 +480,49 @@ class MountItems extends IPCContainer {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
let items = [];
|
let mountItems = [];
|
||||||
for (const provider of this.getProviderList(true)) {
|
const addMountItem = (provider, remote, s3) => {
|
||||||
items.push(
|
if (mountItems.length > 0) {
|
||||||
<MountItem
|
mountItems.push(
|
||||||
allowRemove={false}
|
|
||||||
browseClicked={this.handleBrowseLocation}
|
|
||||||
changed={(e) =>
|
|
||||||
this.handleMountLocationChanged(provider, e.target.value)
|
|
||||||
}
|
|
||||||
clicked={this.handleMountUnMount}
|
|
||||||
key={'it_' + items.length}
|
|
||||||
provider={provider}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
items.push(
|
|
||||||
<div
|
<div
|
||||||
key={'it_' + items.length}
|
key={'it_' + mountItems.length}
|
||||||
style={{ paddingTop: 'var(--default_spacing)' }}
|
style={{ paddingTop: 'calc(var(--default_spacing) * 2.5)' }}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.props.remoteSupported) {
|
mountItems.push(
|
||||||
for (const provider of this.props.RemoteMounts) {
|
|
||||||
items.push(
|
|
||||||
<MountItem
|
<MountItem
|
||||||
allowRemove={true}
|
allowRemove={remote || s3}
|
||||||
browseClicked={this.handleBrowseLocation}
|
browseClicked={this.handleBrowseLocation}
|
||||||
changed={(e) =>
|
changed={(e) =>
|
||||||
this.handleMountLocationChanged(provider, e.target.value)
|
this.handleMountLocationChanged(provider, e.target.value)
|
||||||
}
|
}
|
||||||
clicked={this.handleMountUnMount}
|
clicked={this.handleMountUnMount}
|
||||||
key={'it_' + items.length}
|
key={'it_' + mountItems.length}
|
||||||
provider={provider}
|
provider={provider}
|
||||||
remote
|
remote={remote}
|
||||||
/>
|
s3={s3}
|
||||||
);
|
|
||||||
items.push(
|
|
||||||
<div
|
|
||||||
key={'it_' + items.length}
|
|
||||||
style={{ paddingTop: 'var(--default_spacing)' }}
|
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
for (const provider of this.getProviderList(true)) {
|
||||||
|
addMountItem(provider);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.props.remoteSupported) {
|
||||||
|
for (const provider of this.props.RemoteMounts) {
|
||||||
|
addMountItem(provider, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.props.s3Supported) {
|
if (this.props.s3Supported) {
|
||||||
for (const provider of this.props.S3Mounts) {
|
for (const provider of this.props.S3Mounts) {
|
||||||
items.push(
|
addMountItem(provider, false, true);
|
||||||
<MountItem
|
|
||||||
allowRemove={true}
|
|
||||||
browseClicked={this.handleBrowseLocation}
|
|
||||||
changed={(e) =>
|
|
||||||
this.handleMountLocationChanged(provider, e.target.value)
|
|
||||||
}
|
|
||||||
clicked={this.handleMountUnMount}
|
|
||||||
key={'it_' + items.length}
|
|
||||||
provider={provider}
|
|
||||||
s3
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
items.push(
|
|
||||||
<div
|
|
||||||
key={'it_' + items.length}
|
|
||||||
style={{ paddingTop: 'var(--default_spacing)' }}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
items.splice(items.length - 1, 1);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div style={{ margin: 0, padding: 0 }}>
|
<div style={{ margin: 0, padding: 0 }}>
|
||||||
{retryDisplay}
|
{retryDisplay}
|
||||||
@@ -561,7 +532,7 @@ class MountItems extends IPCContainer {
|
|||||||
? 'MountItemsRemote'
|
? 'MountItemsRemote'
|
||||||
: 'MountItems'
|
: 'MountItems'
|
||||||
}>
|
}>
|
||||||
{items}
|
{mountItems}
|
||||||
</div>
|
</div>
|
||||||
<div style={{ paddingTop: 'var(--default_spacing)' }} />
|
<div style={{ paddingTop: 'var(--default_spacing)' }} />
|
||||||
{footerItems}
|
{footerItems}
|
||||||
|
|||||||
Reference in New Issue
Block a user