prettier
This commit is contained in:
@@ -5,11 +5,11 @@ import DropDown from '../../components/UI/DropDown/DropDown';
|
||||
import IPCContainer from '../IPCContainer/IPCContainer';
|
||||
import PropTypes from 'prop-types';
|
||||
import Text from '../../components/UI/Text/Text';
|
||||
import { addEditHostAction } from '../../redux/actions/host_actions';
|
||||
import { connect } from 'react-redux';
|
||||
import { createDismissDisplay } from '../../utils.jsx';
|
||||
import { notifyApplicationBusy } from '../../redux/actions/common_actions';
|
||||
import { notifyError, notifyInfo } from '../../redux/actions/error_actions';
|
||||
import {addEditHostAction} from '../../redux/actions/host_actions';
|
||||
import {connect} from 'react-redux';
|
||||
import {createDismissDisplay} from '../../utils.jsx';
|
||||
import {notifyApplicationBusy} from '../../redux/actions/common_actions';
|
||||
import {notifyError, notifyInfo} from '../../redux/actions/error_actions';
|
||||
|
||||
const Constants = require('../../constants');
|
||||
|
||||
@@ -31,7 +31,7 @@ class AddEditHost extends IPCContainer {
|
||||
this.setRequestHandler(Constants.IPC_Skynet_Test_Logon_Reply, this.onSkynetTestLogonReply);
|
||||
|
||||
if (this.props.HostData) {
|
||||
this.setState({ ...this.state, ...this.props.HostData });
|
||||
this.setState({...this.state, ...this.props.HostData});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ class AddEditHost extends IPCContainer {
|
||||
const allowTestLogon = this.state.AuthURL && this.state.AuthUser;
|
||||
|
||||
return (
|
||||
<Box dxDark dxStyle={{ width: '430px', height: 'auto', padding: '5px' }}>
|
||||
<Box dxDark dxStyle={{width: '430px', height: 'auto', padding: '5px'}}>
|
||||
{createDismissDisplay(this.props.Close)}
|
||||
<div
|
||||
style={{
|
||||
@@ -115,86 +115,86 @@ class AddEditHost extends IPCContainer {
|
||||
}}>
|
||||
Portal Settings
|
||||
</h1>
|
||||
<div style={{ display: 'flex', flexDirection: 'row' }}>
|
||||
<Text text={'Host / IP'} textAlign={'left'} type={'Heading2'} />
|
||||
<div style={{display: 'flex', flexDirection: 'row'}}>
|
||||
<Text text={'Host / IP'} textAlign={'left'} type={'Heading2'}/>
|
||||
</div>
|
||||
<div style={{ display: 'flex', flexDirection: 'row' }}>
|
||||
<div style={{display: 'flex', flexDirection: 'row'}}>
|
||||
<input
|
||||
onChange={(e) => this.setState({ HostNameOrIp: e.target.value.trim() })}
|
||||
onChange={(e) => this.setState({HostNameOrIp: e.target.value.trim()})}
|
||||
className={'ConfigurationItemInput'}
|
||||
style={{ width: '100%' }}
|
||||
style={{width: '100%'}}
|
||||
type={'text'}
|
||||
value={this.state.HostNameOrIp}
|
||||
/>
|
||||
</div>
|
||||
<div style={{ height: 'var(--default_spacing)' }} />
|
||||
<div style={{ display: 'flex', flexDirection: 'row' }}>
|
||||
<Text text={'Protocol'} textAlign={'left'} type={'Heading2'} />
|
||||
<div style={{ paddingLeft: 'var(--default_spacing)' }} />
|
||||
<Text text={'Port'} textAlign={'left'} type={'Heading2'} />
|
||||
<div style={{ paddingLeft: 'var(--default_spacing)' }} />
|
||||
<Text text={'Timeout (ms)'} textAlign={'left'} type={'Heading2'} />
|
||||
<div style={{height: 'var(--default_spacing)'}}/>
|
||||
<div style={{display: 'flex', flexDirection: 'row'}}>
|
||||
<Text text={'Protocol'} textAlign={'left'} type={'Heading2'}/>
|
||||
<div style={{paddingLeft: 'var(--default_spacing)'}}/>
|
||||
<Text text={'Port'} textAlign={'left'} type={'Heading2'}/>
|
||||
<div style={{paddingLeft: 'var(--default_spacing)'}}/>
|
||||
<Text text={'Timeout (ms)'} textAlign={'left'} type={'Heading2'}/>
|
||||
</div>
|
||||
<div style={{ display: 'flex', flexDirection: 'row' }}>
|
||||
<div style={{display: 'flex', flexDirection: 'row'}}>
|
||||
<DropDown
|
||||
changed={(e) => this.setState({ Protocol: e.target.value })}
|
||||
changed={(e) => this.setState({Protocol: e.target.value})}
|
||||
items={['https', 'http']}
|
||||
selected={this.state.Protocol}
|
||||
/>
|
||||
<div style={{ width: 'var(--default_spacing)' }} />
|
||||
<div style={{ width: 'var(--default_spacing)' }} />
|
||||
<div style={{width: 'var(--default_spacing)'}}/>
|
||||
<div style={{width: 'var(--default_spacing)'}}/>
|
||||
<input
|
||||
onChange={(e) => this.setState({ ApiPort: parseInt(e.target.value) })}
|
||||
onChange={(e) => this.setState({ApiPort: parseInt(e.target.value)})}
|
||||
className={'ConfigurationItemInput'}
|
||||
style={{ width: '100%' }}
|
||||
style={{width: '100%'}}
|
||||
type={'number'}
|
||||
min={1}
|
||||
max={65535}
|
||||
value={this.state.ApiPort}
|
||||
/>
|
||||
<div style={{ width: 'var(--default_spacing)' }} />
|
||||
<div style={{ width: 'var(--default_spacing)' }} />
|
||||
<div style={{width: 'var(--default_spacing)'}}/>
|
||||
<div style={{width: 'var(--default_spacing)'}}/>
|
||||
<input
|
||||
onChange={(e) => this.setState({ TimeoutMs: parseInt(e.target.value) })}
|
||||
onChange={(e) => this.setState({TimeoutMs: parseInt(e.target.value)})}
|
||||
className={'ConfigurationItemInput'}
|
||||
style={{ width: '100%' }}
|
||||
style={{width: '100%'}}
|
||||
type={'number'}
|
||||
min={1000}
|
||||
step={1000}
|
||||
value={this.state.TimeoutMs}
|
||||
/>
|
||||
</div>
|
||||
<div style={{ height: 'var(--default_spacing)' }} />
|
||||
<div style={{ display: 'flex', flexDirection: 'row' }}>
|
||||
<Text text={'Agent String (optional)'} textAlign={'left'} type={'Heading2'} />
|
||||
<div style={{ width: 'var(--default_spacing)' }} />
|
||||
<Text text={'API Key (optional)'} textAlign={'left'} type={'Heading2'} />
|
||||
<div style={{height: 'var(--default_spacing)'}}/>
|
||||
<div style={{display: 'flex', flexDirection: 'row'}}>
|
||||
<Text text={'Agent String (optional)'} textAlign={'left'} type={'Heading2'}/>
|
||||
<div style={{width: 'var(--default_spacing)'}}/>
|
||||
<Text text={'API Key (optional)'} textAlign={'left'} type={'Heading2'}/>
|
||||
</div>
|
||||
<div style={{ display: 'flex', flexDirection: 'row' }}>
|
||||
<div style={{display: 'flex', flexDirection: 'row'}}>
|
||||
<input
|
||||
onChange={(e) => this.setState({ AgentString: e.target.value })}
|
||||
onChange={(e) => this.setState({AgentString: e.target.value})}
|
||||
className={'ConfigurationItemInput'}
|
||||
style={{ flex: '1' }}
|
||||
style={{flex: '1'}}
|
||||
type={'text'}
|
||||
value={this.state.AgentString}
|
||||
/>
|
||||
<div style={{ width: 'var(--default_spacing)' }} />
|
||||
<div style={{width: 'var(--default_spacing)'}}/>
|
||||
<input
|
||||
onChange={(e) => this.setState({ ApiPassword: e.target.value })}
|
||||
onChange={(e) => this.setState({ApiPassword: e.target.value})}
|
||||
className={'ConfigurationItemInput'}
|
||||
style={{ flex: '1' }}
|
||||
style={{flex: '1'}}
|
||||
type={'text'}
|
||||
value={this.state.ApiPassword}
|
||||
/>
|
||||
</div>
|
||||
<div style={{ height: 'var(--default_spacing)' }} />
|
||||
<div style={{ display: 'flex', flexDirection: 'row' }}>
|
||||
<div style={{height: 'var(--default_spacing)'}}/>
|
||||
<div style={{display: 'flex', flexDirection: 'row'}}>
|
||||
<Text
|
||||
noOwner
|
||||
text={'Authentication URL (premium)'}
|
||||
textAlign={'left'}
|
||||
type={'Heading2'}
|
||||
style={{ marginRight: 'auto' }}
|
||||
style={{marginRight: 'auto'}}
|
||||
/>
|
||||
{allowTestLogon ? (
|
||||
<a
|
||||
@@ -207,51 +207,51 @@ class AddEditHost extends IPCContainer {
|
||||
</a>
|
||||
) : null}
|
||||
</div>
|
||||
<div style={{ display: 'flex', flexDirection: 'column' }}>
|
||||
<div style={{display: 'flex', flexDirection: 'column'}}>
|
||||
<input
|
||||
onChange={(e) => this.setState({ AuthURL: e.target.value })}
|
||||
onChange={(e) => this.setState({AuthURL: e.target.value})}
|
||||
className={'ConfigurationItemInput'}
|
||||
type={'text'}
|
||||
value={this.state.AuthURL}
|
||||
/>
|
||||
</div>
|
||||
<div style={{ height: 'var(--default_spacing)' }} />
|
||||
<div style={{ display: 'flex', flexDirection: 'row' }}>
|
||||
<Text text={'User Name (premium)'} textAlign={'left'} type={'Heading2'} />
|
||||
<div style={{ width: 'var(--default_spacing)' }} />
|
||||
<Text text={'Password (premium)'} textAlign={'left'} type={'Heading2'} />
|
||||
<div style={{height: 'var(--default_spacing)'}}/>
|
||||
<div style={{display: 'flex', flexDirection: 'row'}}>
|
||||
<Text text={'User Name (premium)'} textAlign={'left'} type={'Heading2'}/>
|
||||
<div style={{width: 'var(--default_spacing)'}}/>
|
||||
<Text text={'Password (premium)'} textAlign={'left'} type={'Heading2'}/>
|
||||
</div>
|
||||
<div style={{ display: 'flex', flexDirection: 'row' }}>
|
||||
<div style={{display: 'flex', flexDirection: 'row'}}>
|
||||
<input
|
||||
onChange={(e) => this.setState({ AuthUser: e.target.value })}
|
||||
onChange={(e) => this.setState({AuthUser: e.target.value})}
|
||||
className={'ConfigurationItemInput'}
|
||||
style={{ flex: '1' }}
|
||||
style={{flex: '1'}}
|
||||
type={'text'}
|
||||
value={this.state.AuthUser}
|
||||
/>
|
||||
<div style={{ width: 'var(--default_spacing)' }} />
|
||||
<div style={{width: 'var(--default_spacing)'}}/>
|
||||
<input
|
||||
onChange={(e) => this.setState({ AuthPassword: e.target.value })}
|
||||
onChange={(e) => this.setState({AuthPassword: e.target.value})}
|
||||
className={'ConfigurationItemInput'}
|
||||
style={{ flex: '1' }}
|
||||
style={{flex: '1'}}
|
||||
type={'text'}
|
||||
value={this.state.AuthPassword}
|
||||
/>
|
||||
</div>
|
||||
<div style={{ height: 'var(--default_spacing)' }} />
|
||||
<div style={{height: 'var(--default_spacing)'}}/>
|
||||
<p>
|
||||
<b>
|
||||
{'Portal URL: ' +
|
||||
this.state.Protocol +
|
||||
'://' +
|
||||
this.state.HostNameOrIp +
|
||||
((this.state.Protocol === 'http' && this.state.ApiPort != 80) ||
|
||||
(this.state.Protocol === 'https' && this.state.ApiPort != 443)
|
||||
? ':' + this.state.ApiPort.toString()
|
||||
: '')}
|
||||
this.state.Protocol +
|
||||
'://' +
|
||||
this.state.HostNameOrIp +
|
||||
((this.state.Protocol === 'http' && this.state.ApiPort != 80) ||
|
||||
(this.state.Protocol === 'https' && this.state.ApiPort != 443)
|
||||
? ':' + this.state.ApiPort.toString()
|
||||
: '')}
|
||||
</b>
|
||||
</p>
|
||||
<div style={{ height: 'var(--default_spacing)' }} />
|
||||
<div style={{height: 'var(--default_spacing)'}}/>
|
||||
</div>
|
||||
<Button clicked={this.handleSave}>Save</Button>
|
||||
</Box>
|
||||
@@ -270,7 +270,7 @@ const mapStateToProps = (state) => {
|
||||
const mapDispatchToProps = (dispatch) => {
|
||||
return {
|
||||
Close: () => dispatch(addEditHostAction.complete(false)),
|
||||
completeAddEditHost: (host_data) => dispatch(addEditHostAction.complete(true, { host_data })),
|
||||
completeAddEditHost: (host_data) => dispatch(addEditHostAction.complete(true, {host_data})),
|
||||
notifyApplicationBusy: (busy) => dispatch(notifyApplicationBusy(busy, true)),
|
||||
notifyError: (msg) => dispatch(notifyError(msg)),
|
||||
notifyInfo: (msg) => dispatch(notifyInfo(msg)),
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Component } from 'react';
|
||||
import {Component} from 'react';
|
||||
import './AddMount.css';
|
||||
import { connect } from 'react-redux';
|
||||
import {connect} from 'react-redux';
|
||||
import Button from '../../components/UI/Button/Button';
|
||||
import Box from '../../components/UI/Box/Box';
|
||||
import Text from '../../components/UI/Text/Text';
|
||||
import { notifyError } from '../../redux/actions/error_actions';
|
||||
import { addRemoteMount, addS3Mount } from '../../redux/actions/mount_actions';
|
||||
import { createModalConditionally } from '../../utils.jsx';
|
||||
import {notifyError} from '../../redux/actions/error_actions';
|
||||
import {addRemoteMount, addS3Mount} from '../../redux/actions/mount_actions';
|
||||
import {createModalConditionally} from '../../utils.jsx';
|
||||
import DropDown from '../../components/UI/DropDown/DropDown';
|
||||
import * as Constants from '../../constants';
|
||||
|
||||
@@ -129,40 +129,40 @@ class AddMount extends Component {
|
||||
}}>
|
||||
Add Remote Mount
|
||||
</h1>
|
||||
<Text text={'Hostname or IP'} textAlign={'left'} type={'Heading2'} />
|
||||
<Text text={'Hostname or IP'} textAlign={'left'} type={'Heading2'}/>
|
||||
<input
|
||||
onChange={(e) => this.setState({ HostNameOrIp: e.target.value.trim() })}
|
||||
onChange={(e) => this.setState({HostNameOrIp: e.target.value.trim()})}
|
||||
className={'ConfigurationItemInput'}
|
||||
type={'text'}
|
||||
value={this.state.HostNameOrIp}
|
||||
/>
|
||||
<div style={{ paddingTop: 'var(--default_spacing)' }} />
|
||||
<Text text={'Port'} textAlign={'left'} type={'Heading2'} />
|
||||
<div style={{paddingTop: 'var(--default_spacing)'}}/>
|
||||
<Text text={'Port'} textAlign={'left'} type={'Heading2'}/>
|
||||
<input
|
||||
max={65535}
|
||||
min={1025}
|
||||
onChange={(e) => this.setState({ Port: e.target.value })}
|
||||
onChange={(e) => this.setState({Port: e.target.value})}
|
||||
className={'ConfigurationItemInput'}
|
||||
type={'number'}
|
||||
value={this.state.Port}
|
||||
/>
|
||||
<div style={{ paddingTop: 'var(--default_spacing)' }} />
|
||||
<Text text={'Remote Token'} textAlign={'left'} type={'Heading2'} />
|
||||
<div style={{paddingTop: 'var(--default_spacing)'}}/>
|
||||
<Text text={'Remote Token'} textAlign={'left'} type={'Heading2'}/>
|
||||
<input
|
||||
onChange={(e) => this.setState({ Token: e.target.value })}
|
||||
onChange={(e) => this.setState({Token: e.target.value})}
|
||||
className={'ConfigurationItemInput'}
|
||||
type={'text'}
|
||||
value={this.state.Token}
|
||||
/>
|
||||
<div style={{ paddingTop: 'var(--default_spacing)' }} />
|
||||
<div style={{ display: 'flex', flexDirection: 'row' }}>
|
||||
<Button buttonStyles={{ width: '100%' }} clicked={() => this.addRemoteMount()}>
|
||||
<div style={{paddingTop: 'var(--default_spacing)'}}/>
|
||||
<div style={{display: 'flex', flexDirection: 'row'}}>
|
||||
<Button buttonStyles={{width: '100%'}} clicked={() => this.addRemoteMount()}>
|
||||
OK
|
||||
</Button>
|
||||
<div style={{ paddingLeft: 'var(--default_spacing)' }} />
|
||||
<div style={{paddingLeft: 'var(--default_spacing)'}}/>
|
||||
<Button
|
||||
buttonStyles={{ width: '100%' }}
|
||||
clicked={() => this.setState({ DisplayRemote: false })}>
|
||||
buttonStyles={{width: '100%'}}
|
||||
clicked={() => this.setState({DisplayRemote: false})}>
|
||||
Cancel
|
||||
</Button>
|
||||
</div>
|
||||
@@ -185,20 +185,20 @@ class AddMount extends Component {
|
||||
}}>
|
||||
Add S3 Mount
|
||||
</h1>
|
||||
<div style={{ display: 'flex', flexDirection: 'row' }}>
|
||||
<Text text={'Name'} textAlign={'left'} type={'Heading2'} />
|
||||
<div style={{ paddingLeft: 'var(--default_spacing)' }} />
|
||||
<Text text={'Provider'} textAlign={'left'} type={'Heading2'} />
|
||||
<div style={{display: 'flex', flexDirection: 'row'}}>
|
||||
<Text text={'Name'} textAlign={'left'} type={'Heading2'}/>
|
||||
<div style={{paddingLeft: 'var(--default_spacing)'}}/>
|
||||
<Text text={'Provider'} textAlign={'left'} type={'Heading2'}/>
|
||||
</div>
|
||||
<div style={{ display: 'flex', flexDirection: 'row' }}>
|
||||
<div style={{display: 'flex', flexDirection: 'row'}}>
|
||||
<input
|
||||
onChange={(e) => this.setState({ Name: e.target.value.trim() })}
|
||||
onChange={(e) => this.setState({Name: e.target.value.trim()})}
|
||||
className={'ConfigurationItemInput'}
|
||||
style={{ width: '100%' }}
|
||||
style={{width: '100%'}}
|
||||
type={'text'}
|
||||
value={this.state.Name}
|
||||
/>
|
||||
<div style={{ paddingLeft: 'var(--default_spacing)' }} />
|
||||
<div style={{paddingLeft: 'var(--default_spacing)'}}/>
|
||||
<DropDown
|
||||
changed={(e) =>
|
||||
this.setState({
|
||||
@@ -206,45 +206,45 @@ class AddMount extends Component {
|
||||
Region:
|
||||
Constants.S3_REGION_PROVIDER_REGION[
|
||||
Constants.S3_PROVIDER_LIST.indexOf(e.target.value)
|
||||
][0],
|
||||
][0],
|
||||
})
|
||||
}
|
||||
items={Constants.S3_PROVIDER_LIST}
|
||||
selected={this.state.Provider}
|
||||
/>
|
||||
</div>
|
||||
<div style={{ paddingTop: 'var(--default_spacing)' }} />
|
||||
<div style={{paddingTop: 'var(--default_spacing)'}}/>
|
||||
{this.state.Provider === Constants.S3_CUSTOM_PROVIDER ? (
|
||||
<div>
|
||||
<div style={{ display: 'flex', flexDirection: 'row' }}>
|
||||
<Text text={'Custom URL'} textAlign={'left'} type={'Heading2'} />
|
||||
<div style={{display: 'flex', flexDirection: 'row'}}>
|
||||
<Text text={'Custom URL'} textAlign={'left'} type={'Heading2'}/>
|
||||
</div>
|
||||
<div style={{ display: 'flex', flexDirection: 'row' }}>
|
||||
<div style={{display: 'flex', flexDirection: 'row'}}>
|
||||
<input
|
||||
onChange={(e) => this.setState({ CustomURL: e.target.value })}
|
||||
onChange={(e) => this.setState({CustomURL: e.target.value})}
|
||||
className={'ConfigurationItemInput'}
|
||||
style={{ width: '100%' }}
|
||||
style={{width: '100%'}}
|
||||
type={'text'}
|
||||
value={this.state.CustomURL}
|
||||
/>
|
||||
</div>
|
||||
<div style={{ paddingTop: 'var(--default_spacing)' }} />
|
||||
<div style={{paddingTop: 'var(--default_spacing)'}}/>
|
||||
</div>
|
||||
) : null}
|
||||
<div style={{ display: 'flex', flexDirection: 'row' }}>
|
||||
<Text text={'Bucket Name (optional)'} textAlign={'left'} type={'Heading2'} />
|
||||
<div style={{ paddingLeft: 'var(--default_spacing)' }} />
|
||||
<Text text={'Region'} textAlign={'left'} type={'Heading2'} />
|
||||
<div style={{display: 'flex', flexDirection: 'row'}}>
|
||||
<Text text={'Bucket Name (optional)'} textAlign={'left'} type={'Heading2'}/>
|
||||
<div style={{paddingLeft: 'var(--default_spacing)'}}/>
|
||||
<Text text={'Region'} textAlign={'left'} type={'Heading2'}/>
|
||||
</div>
|
||||
<div style={{ display: 'flex', flexDirection: 'row' }}>
|
||||
<div style={{display: 'flex', flexDirection: 'row'}}>
|
||||
<input
|
||||
onChange={(e) => this.setState({ BucketName: e.target.value })}
|
||||
onChange={(e) => this.setState({BucketName: e.target.value})}
|
||||
className={'ConfigurationItemInput'}
|
||||
style={{ width: '100%' }}
|
||||
style={{width: '100%'}}
|
||||
type={'text'}
|
||||
value={this.state.BucketName}
|
||||
/>
|
||||
<div style={{ paddingLeft: 'var(--default_spacing)' }} />
|
||||
<div style={{paddingLeft: 'var(--default_spacing)'}}/>
|
||||
<DropDown
|
||||
changed={(e) =>
|
||||
this.setState({
|
||||
@@ -254,61 +254,61 @@ class AddMount extends Component {
|
||||
items={
|
||||
Constants.S3_REGION_PROVIDER_REGION[
|
||||
Constants.S3_PROVIDER_LIST.indexOf(this.state.Provider)
|
||||
]
|
||||
]
|
||||
}
|
||||
selected={this.state.Region}
|
||||
/>
|
||||
</div>
|
||||
<div style={{ paddingTop: 'var(--default_spacing)' }} />
|
||||
<div style={{paddingTop: 'var(--default_spacing)'}}/>
|
||||
{this.state.Region === Constants.S3_CUSTOM_REGION ? (
|
||||
<div>
|
||||
<div style={{ display: 'flex', flexDirection: 'row' }}>
|
||||
<div style={{ paddingLeft: 'var(--default_spacing)', width: '100%' }} />
|
||||
<Text text={'Custom Region'} textAlign={'left'} type={'Heading2'} />
|
||||
<div style={{display: 'flex', flexDirection: 'row'}}>
|
||||
<div style={{paddingLeft: 'var(--default_spacing)', width: '100%'}}/>
|
||||
<Text text={'Custom Region'} textAlign={'left'} type={'Heading2'}/>
|
||||
</div>
|
||||
<div style={{ display: 'flex', flexDirection: 'row' }}>
|
||||
<div style={{ paddingLeft: 'var(--default_spacing)', width: '100%' }} />
|
||||
<div style={{display: 'flex', flexDirection: 'row'}}>
|
||||
<div style={{paddingLeft: 'var(--default_spacing)', width: '100%'}}/>
|
||||
<input
|
||||
onChange={(e) => this.setState({ CustomRegion: e.target.value })}
|
||||
onChange={(e) => this.setState({CustomRegion: e.target.value})}
|
||||
className={'ConfigurationItemInput'}
|
||||
style={{ width: '100%' }}
|
||||
style={{width: '100%'}}
|
||||
type={'text'}
|
||||
value={this.state.CustomRegion}
|
||||
/>
|
||||
</div>
|
||||
<div style={{ paddingTop: 'var(--default_spacing)' }} />
|
||||
<div style={{paddingTop: 'var(--default_spacing)'}}/>
|
||||
</div>
|
||||
) : null}
|
||||
<div style={{ display: 'flex', flexDirection: 'row' }}>
|
||||
<Text text={'Access Key'} textAlign={'left'} type={'Heading2'} />
|
||||
<div style={{ paddingLeft: 'var(--default_spacing)' }} />
|
||||
<Text text={'Secret Key'} textAlign={'left'} type={'Heading2'} />
|
||||
<div style={{display: 'flex', flexDirection: 'row'}}>
|
||||
<Text text={'Access Key'} textAlign={'left'} type={'Heading2'}/>
|
||||
<div style={{paddingLeft: 'var(--default_spacing)'}}/>
|
||||
<Text text={'Secret Key'} textAlign={'left'} type={'Heading2'}/>
|
||||
</div>
|
||||
<div style={{ display: 'flex', flexDirection: 'row' }}>
|
||||
<div style={{display: 'flex', flexDirection: 'row'}}>
|
||||
<input
|
||||
onChange={(e) => this.setState({ AccessKey: e.target.value })}
|
||||
onChange={(e) => this.setState({AccessKey: e.target.value})}
|
||||
className={'ConfigurationItemInput'}
|
||||
type={'text'}
|
||||
value={this.state.AccessKey}
|
||||
/>
|
||||
<div style={{ paddingLeft: 'var(--default_spacing)' }} />
|
||||
<div style={{paddingLeft: 'var(--default_spacing)'}}/>
|
||||
<input
|
||||
onChange={(e) => this.setState({ SecretKey: e.target.value })}
|
||||
onChange={(e) => this.setState({SecretKey: e.target.value})}
|
||||
className={'ConfigurationItemInput'}
|
||||
type={'text'}
|
||||
value={this.state.SecretKey}
|
||||
/>
|
||||
</div>
|
||||
<div style={{ paddingTop: 'calc(var(--default_spacing) * 2)' }} />
|
||||
<div style={{ display: 'flex', flexDirection: 'row' }}>
|
||||
<div style={{ width: '200%' }} />
|
||||
<Button buttonStyles={{ width: '100%' }} clicked={() => this.addS3Mount()}>
|
||||
<div style={{paddingTop: 'calc(var(--default_spacing) * 2)'}}/>
|
||||
<div style={{display: 'flex', flexDirection: 'row'}}>
|
||||
<div style={{width: '200%'}}/>
|
||||
<Button buttonStyles={{width: '100%'}} clicked={() => this.addS3Mount()}>
|
||||
OK
|
||||
</Button>
|
||||
<div style={{ paddingLeft: 'var(--default_spacing)' }} />
|
||||
<div style={{paddingLeft: 'var(--default_spacing)'}}/>
|
||||
<Button
|
||||
buttonStyles={{ width: '100%' }}
|
||||
clicked={() => this.setState({ DisplayS3: false })}>
|
||||
buttonStyles={{width: '100%'}}
|
||||
clicked={() => this.setState({DisplayS3: false})}>
|
||||
Cancel
|
||||
</Button>
|
||||
</div>
|
||||
@@ -326,7 +326,7 @@ class AddMount extends Component {
|
||||
</Button>
|
||||
) : null}
|
||||
{this.props.remoteSupported && this.props.s3Supported ? (
|
||||
<div style={{ paddingRight: 'var(--default_spacing)' }} />
|
||||
<div style={{paddingRight: 'var(--default_spacing)'}}/>
|
||||
) : null}
|
||||
{this.props.s3Supported ? (
|
||||
<Button className={'AddMountButton'} clicked={this.handleAddS3Mount}>
|
||||
|
||||
@@ -6,11 +6,11 @@ import ConfigurationItem from './ConfigurationItem/ConfigurationItem';
|
||||
import IPCContainer from '../IPCContainer/IPCContainer';
|
||||
import Modal from '../../components/UI/Modal/Modal';
|
||||
import PropTypes from 'prop-types';
|
||||
import { connect } from 'react-redux';
|
||||
import { createDismissDisplay } from '../../utils.jsx';
|
||||
import { displayConfiguration } from '../../redux/actions/mount_actions';
|
||||
import { displayPinnedManager } from '../../redux/actions/pinned_manager_actions';
|
||||
import { notifyError } from '../../redux/actions/error_actions';
|
||||
import {connect} from 'react-redux';
|
||||
import {createDismissDisplay} from '../../utils.jsx';
|
||||
import {displayConfiguration} from '../../redux/actions/mount_actions';
|
||||
import {displayPinnedManager} from '../../redux/actions/pinned_manager_actions';
|
||||
import {notifyError} from '../../redux/actions/error_actions';
|
||||
|
||||
const Constants = require('../../constants');
|
||||
|
||||
@@ -113,30 +113,30 @@ class Configuration extends IPCContainer {
|
||||
createItemList = (config, template) => {
|
||||
const objectList = [];
|
||||
const itemList = Object.keys(config)
|
||||
.map((key) => {
|
||||
return {
|
||||
advanced: template[key] ? template[key].advanced : false,
|
||||
hide_remote: template[key] ? template[key].hide_remote : false,
|
||||
label: key,
|
||||
remote: template[key] ? template[key].remote : false,
|
||||
type: template[key] ? template[key].type : null,
|
||||
value:
|
||||
template[key] &&
|
||||
(template[key].type === 'string_array' || template[key].type === 'object')
|
||||
? config[key]
|
||||
: template[key] && template[key].type === 'host_list'
|
||||
.map((key) => {
|
||||
return {
|
||||
advanced: template[key] ? template[key].advanced : false,
|
||||
hide_remote: template[key] ? template[key].hide_remote : false,
|
||||
label: key,
|
||||
remote: template[key] ? template[key].remote : false,
|
||||
type: template[key] ? template[key].type : null,
|
||||
value:
|
||||
template[key] &&
|
||||
(template[key].type === 'string_array' || template[key].type === 'object')
|
||||
? config[key]
|
||||
: template[key] && template[key].type === 'host_list'
|
||||
? config[key]
|
||||
: config[key].toString(),
|
||||
};
|
||||
})
|
||||
.filter((i) => {
|
||||
let ret = template[i.label];
|
||||
if (ret && template[i.label].type === 'object') {
|
||||
objectList.push(i);
|
||||
ret = false;
|
||||
}
|
||||
return ret;
|
||||
});
|
||||
};
|
||||
})
|
||||
.filter((i) => {
|
||||
let ret = template[i.label];
|
||||
if (ret && template[i.label].type === 'object') {
|
||||
objectList.push(i);
|
||||
ret = false;
|
||||
}
|
||||
return ret;
|
||||
});
|
||||
return {
|
||||
ObjectList: objectList,
|
||||
ItemList: itemList,
|
||||
@@ -149,8 +149,8 @@ class Configuration extends IPCContainer {
|
||||
target.type === 'textarea'
|
||||
? target.string_array
|
||||
: target.type === 'host_list'
|
||||
? target.value
|
||||
: target.value.toString();
|
||||
? target.value
|
||||
: target.value.toString();
|
||||
this.setState({
|
||||
ItemList: itemList,
|
||||
});
|
||||
@@ -166,8 +166,8 @@ class Configuration extends IPCContainer {
|
||||
target.type === 'textarea'
|
||||
? target.string_array
|
||||
: target.type === 'host_list'
|
||||
? target.value
|
||||
: target.value.toString();
|
||||
? target.value
|
||||
: target.value.toString();
|
||||
objectLookup[name] = itemList;
|
||||
this.setState({
|
||||
ObjectLookup: objectLookup,
|
||||
@@ -205,7 +205,8 @@ class Configuration extends IPCContainer {
|
||||
OriginalItemList: itemListCopy,
|
||||
OriginalObjectLookup: objectLookupCopy,
|
||||
},
|
||||
() => {}
|
||||
() => {
|
||||
}
|
||||
);
|
||||
} else {
|
||||
this.props.notifyError(arg.data.Error);
|
||||
@@ -253,8 +254,8 @@ class Configuration extends IPCContainer {
|
||||
item.type === 'string_array'
|
||||
? item.value.join(';')
|
||||
: item.type === 'host_list'
|
||||
? JSON.stringify(item.value)
|
||||
: item.value,
|
||||
? JSON.stringify(item.value)
|
||||
: item.value,
|
||||
};
|
||||
});
|
||||
|
||||
@@ -268,8 +269,8 @@ class Configuration extends IPCContainer {
|
||||
item.type === 'string_array'
|
||||
? item.value.join(';')
|
||||
: item.type === 'host_list'
|
||||
? JSON.stringify(item.value)
|
||||
: item.value,
|
||||
? JSON.stringify(item.value)
|
||||
: item.value,
|
||||
};
|
||||
})
|
||||
);
|
||||
@@ -300,13 +301,13 @@ class Configuration extends IPCContainer {
|
||||
return item.label === 'RemoteHostNameOrIp' || item.label === 'RemoteMaxConnections'
|
||||
? isRemoteMount
|
||||
: item.label === 'RemoteReceiveTimeoutSeconds' ||
|
||||
item.label === 'RemoteSendTimeoutSeconds' ||
|
||||
item.label === 'RemotePort' ||
|
||||
item.label === 'RemoteToken'
|
||||
? isRemoteMount || enableRemoteMount
|
||||
: item.label === 'EnableRemoteMount'
|
||||
? !isRemoteMount
|
||||
: enableRemoteMount;
|
||||
item.label === 'RemoteSendTimeoutSeconds' ||
|
||||
item.label === 'RemotePort' ||
|
||||
item.label === 'RemoteToken'
|
||||
? isRemoteMount || enableRemoteMount
|
||||
: item.label === 'EnableRemoteMount'
|
||||
? !isRemoteMount
|
||||
: enableRemoteMount;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
@@ -316,22 +317,22 @@ class Configuration extends IPCContainer {
|
||||
if (this.state.ChangedItems.length > 0 || this.state.ChangedObjectLookup) {
|
||||
confirmSave = (
|
||||
<Modal>
|
||||
<Box dxStyle={{ width: '40vw', padding: 'var(--default_spacing)' }}>
|
||||
<h1 style={{ width: '100%', textAlign: 'center' }}>Save Changes?</h1>
|
||||
<Box dxStyle={{width: '40vw', padding: 'var(--default_spacing)'}}>
|
||||
<h1 style={{width: '100%', textAlign: 'center'}}>Save Changes?</h1>
|
||||
<table width="100%">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="center" width="50%">
|
||||
<Button clicked={this.saveAndClose} disabled={this.state.Saving}>
|
||||
Yes
|
||||
</Button>
|
||||
</td>
|
||||
<td align="center" width="50%">
|
||||
<Button clicked={this.props.hideConfiguration} disabled={this.state.Saving}>
|
||||
No
|
||||
</Button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" width="50%">
|
||||
<Button clicked={this.saveAndClose} disabled={this.state.Saving}>
|
||||
Yes
|
||||
</Button>
|
||||
</td>
|
||||
<td align="center" width="50%">
|
||||
<Button clicked={this.props.hideConfiguration} disabled={this.state.Saving}>
|
||||
No
|
||||
</Button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</Box>
|
||||
@@ -353,30 +354,30 @@ class Configuration extends IPCContainer {
|
||||
<h2>{key}</h2>
|
||||
<div>
|
||||
{this.state.ObjectLookup[key]
|
||||
.map((k, i) => {
|
||||
const shouldFocus = getAutoFocus();
|
||||
setAutoFocus(false);
|
||||
return !k.advanced ||
|
||||
(this.state.ShowAdvanced && k.advanced && !k.remote) ||
|
||||
this.showRemoteConfigItem(k, this.state.ObjectLookup[key]) ? (
|
||||
<ConfigurationItem
|
||||
advanced={k.advanced}
|
||||
autoFocus={shouldFocus}
|
||||
changed={(e) => this.handleObjectItemChanged(e, key, i)}
|
||||
grouping={key}
|
||||
items={this.state.Template[key].template[k.label].items}
|
||||
key={i}
|
||||
label={k.label}
|
||||
readOnly={
|
||||
this.state.IsRemoteMount &&
|
||||
(k.label === 'RemoteHostNameOrIp' || k.label === 'RemotePort')
|
||||
}
|
||||
template={this.state.Template[key].template[k.label]}
|
||||
value={k.value}
|
||||
/>
|
||||
) : null;
|
||||
})
|
||||
.filter((i) => i !== null)}
|
||||
.map((k, i) => {
|
||||
const shouldFocus = getAutoFocus();
|
||||
setAutoFocus(false);
|
||||
return !k.advanced ||
|
||||
(this.state.ShowAdvanced && k.advanced && !k.remote) ||
|
||||
this.showRemoteConfigItem(k, this.state.ObjectLookup[key]) ? (
|
||||
<ConfigurationItem
|
||||
advanced={k.advanced}
|
||||
autoFocus={shouldFocus}
|
||||
changed={(e) => this.handleObjectItemChanged(e, key, i)}
|
||||
grouping={key}
|
||||
items={this.state.Template[key].template[k.label].items}
|
||||
key={i}
|
||||
label={k.label}
|
||||
readOnly={
|
||||
this.state.IsRemoteMount &&
|
||||
(k.label === 'RemoteHostNameOrIp' || k.label === 'RemotePort')
|
||||
}
|
||||
template={this.state.Template[key].template[k.label]}
|
||||
value={k.value}
|
||||
/>
|
||||
) : null;
|
||||
})
|
||||
.filter((i) => i !== null)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
@@ -386,7 +387,7 @@ class Configuration extends IPCContainer {
|
||||
const shouldFocus = autoFocus;
|
||||
autoFocus = false;
|
||||
return (!this.state.IsRemoteMount || !k.hide_remote) &&
|
||||
(!k.advanced || (this.state.ShowAdvanced && k.advanced)) ? (
|
||||
(!k.advanced || (this.state.ShowAdvanced && k.advanced)) ? (
|
||||
<ConfigurationItem
|
||||
advanced={k.advanced}
|
||||
autoFocus={shouldFocus}
|
||||
@@ -404,16 +405,16 @@ class Configuration extends IPCContainer {
|
||||
return (
|
||||
<div className={'Configuration'}>
|
||||
{confirmSave}
|
||||
<Box dxDark dxStyle={{ padding: '5px' }}>
|
||||
<Box dxDark dxStyle={{padding: '5px'}}>
|
||||
{createDismissDisplay(this.checkSaveRequired)}
|
||||
<h1 style={{ width: '100%', textAlign: 'center' }}>
|
||||
<h1 style={{width: '100%', textAlign: 'center'}}>
|
||||
{(this.props.DisplayRemoteConfiguration
|
||||
? this.props.DisplayConfiguration.substr(6)
|
||||
: this.props.DisplayS3Configuration
|
||||
? this.props.DisplayConfiguration.substr(2)
|
||||
: this.props.DisplayConfiguration) + ' Configuration '}
|
||||
? this.props.DisplayConfiguration.substr(2)
|
||||
: this.props.DisplayConfiguration) + ' Configuration '}
|
||||
</h1>
|
||||
<div style={{ overflowY: 'auto', height: '90%' }}>
|
||||
<div style={{overflowY: 'auto', height: '90%'}}>
|
||||
{this.props.MState.Mounted && configurationItems.length > 0 ? (
|
||||
<Button
|
||||
buttonStyles={{
|
||||
@@ -429,7 +430,7 @@ class Configuration extends IPCContainer {
|
||||
Pinned File Manager...
|
||||
</Button>
|
||||
) : null}
|
||||
<div style={{ marginBottom: '4px' }} />
|
||||
<div style={{marginBottom: '4px'}}/>
|
||||
{objectItems}
|
||||
{configurationItems.length > 0 ? <h2>Settings</h2> : null}
|
||||
{configurationItems}
|
||||
|
||||
@@ -6,10 +6,10 @@ import HostList from '../../HostList/HostList';
|
||||
import Password from '../../../containers/UI/Password/Password';
|
||||
import PropTypes from 'prop-types';
|
||||
import settings from '../../../assets/settings';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { connect } from 'react-redux';
|
||||
import { faInfoCircle } from '@fortawesome/free-solid-svg-icons';
|
||||
import { notifyError, notifyInfo } from '../../../redux/actions/error_actions';
|
||||
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
|
||||
import {connect} from 'react-redux';
|
||||
import {faInfoCircle} from '@fortawesome/free-solid-svg-icons';
|
||||
import {notifyError, notifyInfo} from '../../../redux/actions/error_actions';
|
||||
|
||||
const ConfigurationItem = (props) => {
|
||||
const handleChanged = (e) => {
|
||||
@@ -37,7 +37,7 @@ const ConfigurationItem = (props) => {
|
||||
displayInfo();
|
||||
return false;
|
||||
}}>
|
||||
<FontAwesomeIcon icon={faInfoCircle} />
|
||||
<FontAwesomeIcon icon={faInfoCircle}/>
|
||||
</a>
|
||||
);
|
||||
}
|
||||
@@ -236,18 +236,18 @@ const ConfigurationItem = (props) => {
|
||||
<div className={'ConfigurationItem'}>
|
||||
<table cellPadding="2" width="100%">
|
||||
<tbody>
|
||||
<tr>
|
||||
{infoDisplay ? (
|
||||
<td width="100%" valign={'top'}>
|
||||
{infoDisplay} {props.label}
|
||||
</td>
|
||||
) : (
|
||||
<td width="100%" valign={'top'}>
|
||||
{props.label}
|
||||
</td>
|
||||
)}
|
||||
<td>{data}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
{infoDisplay ? (
|
||||
<td width="100%" valign={'top'}>
|
||||
{infoDisplay} {props.label}
|
||||
</td>
|
||||
) : (
|
||||
<td width="100%" valign={'top'}>
|
||||
{props.label}
|
||||
</td>
|
||||
)}
|
||||
<td>{data}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { addEditHostAction } from '../../../redux/actions/host_actions';
|
||||
import { connect } from 'react-redux';
|
||||
import { faTrashAlt, faEdit } from '@fortawesome/free-solid-svg-icons';
|
||||
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
|
||||
import {addEditHostAction} from '../../../redux/actions/host_actions';
|
||||
import {connect} from 'react-redux';
|
||||
import {faTrashAlt, faEdit} from '@fortawesome/free-solid-svg-icons';
|
||||
|
||||
const mapDispatchToProps = (dispatch) => {
|
||||
return {
|
||||
editHost: (host_list, host_data, cb) =>
|
||||
dispatch(addEditHostAction.display(true, cb, { host_list, host_data })),
|
||||
dispatch(addEditHostAction.display(true, cb, {host_list, host_data})),
|
||||
};
|
||||
};
|
||||
|
||||
const Host = ({ allowDelete, editHost, host_list, host_data, onChange, onDelete }) => {
|
||||
const Host = ({allowDelete, editHost, host_list, host_data, onChange, onDelete}) => {
|
||||
const handleEditHost = () => {
|
||||
editHost(host_list, host_data, (changed, { host_data }) => {
|
||||
editHost(host_list, host_data, (changed, {host_data}) => {
|
||||
if (changed) {
|
||||
onChange(host_data);
|
||||
}
|
||||
@@ -33,14 +33,14 @@ const Host = ({ allowDelete, editHost, host_list, host_data, onChange, onDelete
|
||||
|
||||
const premium = host_data.AuthURL && host_data.AuthUser;
|
||||
return (
|
||||
<div style={{ display: 'flex', flexDirection: 'row' }}>
|
||||
<div style={{display: 'flex', flexDirection: 'row'}}>
|
||||
<div
|
||||
style={{
|
||||
flex: 0,
|
||||
paddingRight: 'calc(var(--default_spacing) * 1.25)',
|
||||
}}>
|
||||
<a href={'#'} onClick={handleEditHost}>
|
||||
<FontAwesomeIcon icon={faEdit} />
|
||||
<FontAwesomeIcon icon={faEdit}/>
|
||||
</a>
|
||||
</div>
|
||||
{allowDelete ? (
|
||||
@@ -50,7 +50,7 @@ const Host = ({ allowDelete, editHost, host_list, host_data, onChange, onDelete
|
||||
paddingRight: 'calc(var(--default_spacing) * 1.25)',
|
||||
}}>
|
||||
<a href={'#'} onClick={onDelete}>
|
||||
<FontAwesomeIcon icon={faTrashAlt} />
|
||||
<FontAwesomeIcon icon={faTrashAlt}/>
|
||||
</a>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
@@ -2,12 +2,12 @@ import React from 'react';
|
||||
import './HostList.css';
|
||||
import Host from './Host/Host';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Component } from 'react';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { confirmYesNoAction } from '../../redux/actions/common_actions';
|
||||
import { connect } from 'react-redux';
|
||||
import { addEditHostAction } from '../../redux/actions/host_actions';
|
||||
import { faPlusCircle } from '@fortawesome/free-solid-svg-icons';
|
||||
import {Component} from 'react';
|
||||
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
|
||||
import {confirmYesNoAction} from '../../redux/actions/common_actions';
|
||||
import {connect} from 'react-redux';
|
||||
import {addEditHostAction} from '../../redux/actions/host_actions';
|
||||
import {faPlusCircle} from '@fortawesome/free-solid-svg-icons';
|
||||
|
||||
class HostList extends Component {
|
||||
state = {
|
||||
@@ -18,13 +18,14 @@ class HostList extends Component {
|
||||
// type={props.template.subtype}
|
||||
|
||||
componentDidMount() {
|
||||
this.setState({ items: this.props.value });
|
||||
this.setState({items: this.props.value});
|
||||
}
|
||||
|
||||
componentWillUnmount() {}
|
||||
componentWillUnmount() {
|
||||
}
|
||||
|
||||
handleAddHost = () => {
|
||||
this.props.AddHost(this.state.items, (changed, { host_data }) => {
|
||||
this.props.AddHost(this.state.items, (changed, {host_data}) => {
|
||||
if (changed) {
|
||||
const items = [...this.state.items, host_data];
|
||||
this.updateItems(items);
|
||||
@@ -65,7 +66,7 @@ class HostList extends Component {
|
||||
render() {
|
||||
let idx = 0;
|
||||
return (
|
||||
<div style={{ display: 'flex', flexDirection: 'column' }}>
|
||||
<div style={{display: 'flex', flexDirection: 'column'}}>
|
||||
<div
|
||||
style={{
|
||||
maxHeight: '80px',
|
||||
@@ -94,7 +95,7 @@ class HostList extends Component {
|
||||
style={{
|
||||
marginTop: 'var(--default_spacing)',
|
||||
}}>
|
||||
<FontAwesomeIcon icon={faPlusCircle} />
|
||||
<FontAwesomeIcon icon={faPlusCircle}/>
|
||||
<b>{' Add Portal '}</b>
|
||||
</a>
|
||||
</div>
|
||||
@@ -104,8 +105,8 @@ class HostList extends Component {
|
||||
|
||||
const mapDispatchToProps = (dispatch) => {
|
||||
return {
|
||||
AddHost: (host_list, cb) => dispatch(addEditHostAction.display(true, cb, { host_list })),
|
||||
ConfirmRemoveHost: (title, cb) => dispatch(confirmYesNoAction.display(true, cb, { title })),
|
||||
AddHost: (host_list, cb) => dispatch(addEditHostAction.display(true, cb, {host_list})),
|
||||
ConfirmRemoveHost: (title, cb) => dispatch(confirmYesNoAction.display(true, cb, {title})),
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component } from 'react';
|
||||
import { getIPCRenderer } from '../../utils.jsx';
|
||||
import {Component} from 'react';
|
||||
import {getIPCRenderer} from '../../utils.jsx';
|
||||
|
||||
const ipcRenderer = getIPCRenderer();
|
||||
|
||||
|
||||
@@ -9,15 +9,15 @@ import PropTypes from 'prop-types';
|
||||
import RootElem from '../../../components/UI/RootElem/RootElem';
|
||||
import Text from '../../../components/UI/Text/Text';
|
||||
import configureImage from '../../../assets/images/configure.png';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { connect } from 'react-redux';
|
||||
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
|
||||
import {connect} from 'react-redux';
|
||||
import {
|
||||
displayConfiguration,
|
||||
removeMount,
|
||||
setProviderState,
|
||||
} from '../../../redux/actions/mount_actions';
|
||||
import { displaySkynetExport, displaySkynetImport } from '../../../redux/actions/skynet_actions';
|
||||
import { faTrashAlt } from '@fortawesome/free-solid-svg-icons';
|
||||
import {displaySkynetExport, displaySkynetImport} from '../../../redux/actions/skynet_actions';
|
||||
import {faTrashAlt} from '@fortawesome/free-solid-svg-icons';
|
||||
|
||||
const MountItem = (props) => {
|
||||
const handleAutoMountChanged = (e) => {
|
||||
@@ -37,7 +37,7 @@ const MountItem = (props) => {
|
||||
};
|
||||
|
||||
let secondRow = 6;
|
||||
const pointer = { cursor: props.MState.AllowMount ? 'pointer' : 'no-drop' };
|
||||
const pointer = {cursor: props.MState.AllowMount ? 'pointer' : 'no-drop'};
|
||||
const configButton = (
|
||||
<RootElem colSpan={4} rowSpan={6}>
|
||||
<img
|
||||
@@ -47,11 +47,11 @@ const MountItem = (props) => {
|
||||
props.MState.AllowMount
|
||||
? () => props.displayConfiguration(props.provider, props.remote, props.s3)
|
||||
: (e) => {
|
||||
e.preventDefault();
|
||||
}
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
src={configureImage}
|
||||
style={{ padding: 0, border: 0, margin: 0, ...pointer }}
|
||||
style={{padding: 0, border: 0, margin: 0, ...pointer}}
|
||||
width={'16px'}
|
||||
/>
|
||||
</RootElem>
|
||||
@@ -111,7 +111,7 @@ const MountItem = (props) => {
|
||||
'Mount'
|
||||
)
|
||||
) : (
|
||||
<Loader color={'var(--heading_text_color)'} height={19} type="Circles" width={19} />
|
||||
<Loader color={'var(--heading_text_color)'} height={19} type="Circles" width={19}/>
|
||||
);
|
||||
|
||||
const actionsDisplay = (
|
||||
@@ -168,7 +168,7 @@ const MountItem = (props) => {
|
||||
removeControl = (
|
||||
<RootElem col={(dimensions) => dimensions.columns - 6} row={secondRow + 3}>
|
||||
<a href={'#'} onClick={handleRemoveMount} style={removeStyle}>
|
||||
<FontAwesomeIcon icon={faTrashAlt} />
|
||||
<FontAwesomeIcon icon={faTrashAlt}/>
|
||||
</a>
|
||||
</RootElem>
|
||||
);
|
||||
@@ -187,10 +187,10 @@ const MountItem = (props) => {
|
||||
props.remote
|
||||
? props.provider.substr(6)
|
||||
: props.s3
|
||||
? props.provider.substr(2)
|
||||
: isSkynet
|
||||
? props.provider + ' [EXPERIMENTAL]'
|
||||
: props.provider
|
||||
? props.provider.substr(2)
|
||||
: isSkynet
|
||||
? props.provider + ' [EXPERIMENTAL]'
|
||||
: props.provider
|
||||
}
|
||||
textAlign={'Left'}
|
||||
type={'Heading2'}
|
||||
@@ -203,11 +203,11 @@ const MountItem = (props) => {
|
||||
props.MState.AllowMount
|
||||
? () => props.displaySkynetExport(true)
|
||||
: (e) => {
|
||||
e.preventDefault();
|
||||
}
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
rowSpan={5}
|
||||
style={{ ...pointer, fontWeight: 'normal' }}>
|
||||
style={{...pointer, fontWeight: 'normal'}}>
|
||||
<u>Export</u>
|
||||
</a>
|
||||
) : null}
|
||||
@@ -219,11 +219,11 @@ const MountItem = (props) => {
|
||||
props.MState.AllowMount
|
||||
? () => props.displaySkynetImport(true)
|
||||
: (e) => {
|
||||
e.preventDefault();
|
||||
}
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
rowSpan={5}
|
||||
style={{ ...pointer, fontWeight: 'normal' }}>
|
||||
style={{...pointer, fontWeight: 'normal'}}>
|
||||
<u>Import</u>
|
||||
</a>
|
||||
) : null}
|
||||
|
||||
@@ -6,8 +6,8 @@ import Button from '../../components/UI/Button/Button';
|
||||
import IPCContainer from '../IPCContainer/IPCContainer';
|
||||
import Modal from '../../components/UI/Modal/Modal';
|
||||
import MountItem from './MountItem/MountItem';
|
||||
import { connect } from 'react-redux';
|
||||
import { notifyError } from '../../redux/actions/error_actions';
|
||||
import {connect} from 'react-redux';
|
||||
import {notifyError} from '../../redux/actions/error_actions';
|
||||
import {
|
||||
resetMountsState,
|
||||
setAllowMount,
|
||||
@@ -164,13 +164,13 @@ class MountItems extends IPCContainer {
|
||||
if (mount) {
|
||||
let result =
|
||||
remote || s3 || provider === 'Skynet'
|
||||
? { Valid: true, Success: true }
|
||||
? {Valid: true, Success: true}
|
||||
: this.sendSyncRequest(Constants.IPC_Check_Daemon_Version, {
|
||||
Provider: provider,
|
||||
Remote: remote,
|
||||
S3: s3,
|
||||
Version: this.props.InstalledVersion,
|
||||
}).data;
|
||||
Provider: provider,
|
||||
Remote: remote,
|
||||
S3: s3,
|
||||
Version: this.props.InstalledVersion,
|
||||
}).data;
|
||||
const displayRetry = (msg) => {
|
||||
this.displayRetryMount(provider, remote, s3, location, msg);
|
||||
};
|
||||
@@ -367,14 +367,14 @@ class MountItems extends IPCContainer {
|
||||
);
|
||||
if (++retryCount < Object.keys(this.state.RetryItems).length) {
|
||||
retryList.push(
|
||||
<div style={{ paddingTop: 'var(--default_spacing)' }} key={'rl_' + retryList.length} />
|
||||
<div style={{paddingTop: 'var(--default_spacing)'}} key={'rl_' + retryList.length}/>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
retryDisplay = (
|
||||
<Modal>
|
||||
<Box dxDark dxStyle={{ padding: 'var(--default_spacing)', minWidth: '70vw' }}>
|
||||
<Box dxDark dxStyle={{padding: 'var(--default_spacing)', minWidth: '70vw'}}>
|
||||
<h1
|
||||
style={{
|
||||
textAlign: 'center',
|
||||
@@ -399,7 +399,7 @@ class MountItems extends IPCContainer {
|
||||
/>
|
||||
);
|
||||
} else {
|
||||
footerItems.push(<div key={'hi_' + footerItems.length} style={{ height: '27px' }} />);
|
||||
footerItems.push(<div key={'hi_' + footerItems.length} style={{height: '27px'}}/>);
|
||||
}
|
||||
|
||||
const mountItems = [];
|
||||
@@ -408,7 +408,7 @@ class MountItems extends IPCContainer {
|
||||
mountItems.push(
|
||||
<div
|
||||
key={'it_' + mountItems.length}
|
||||
style={{ paddingTop: 'calc(var(--default_spacing) * 2.5)' }}
|
||||
style={{paddingTop: 'calc(var(--default_spacing) * 2.5)'}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -438,7 +438,7 @@ class MountItems extends IPCContainer {
|
||||
}
|
||||
|
||||
return (
|
||||
<div style={{ margin: 0, padding: 0 }}>
|
||||
<div style={{margin: 0, padding: 0}}>
|
||||
{retryDisplay}
|
||||
<div
|
||||
className={
|
||||
@@ -446,7 +446,7 @@ class MountItems extends IPCContainer {
|
||||
}>
|
||||
{mountItems}
|
||||
</div>
|
||||
<div style={{ paddingTop: 'var(--default_spacing)' }} />
|
||||
<div style={{paddingTop: 'var(--default_spacing)'}}/>
|
||||
{footerItems}
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -4,12 +4,12 @@ import Box from '../../components/UI/Box/Box';
|
||||
import Button from '../../components/UI/Button/Button';
|
||||
import CheckBox from '../../components/UI/CheckBox/CheckBox';
|
||||
import IPCContainer from '../IPCContainer/IPCContainer';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { connect } from 'react-redux';
|
||||
import { displayPinnedManager } from '../../redux/actions/pinned_manager_actions';
|
||||
import { faFolder } from '@fortawesome/free-solid-svg-icons';
|
||||
import { notifyApplicationBusy } from '../../redux/actions/common_actions';
|
||||
import { notifyError, notifyInfo } from '../../redux/actions/error_actions';
|
||||
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
|
||||
import {connect} from 'react-redux';
|
||||
import {displayPinnedManager} from '../../redux/actions/pinned_manager_actions';
|
||||
import {faFolder} from '@fortawesome/free-solid-svg-icons';
|
||||
import {notifyApplicationBusy} from '../../redux/actions/common_actions';
|
||||
import {notifyError, notifyInfo} from '../../redux/actions/error_actions';
|
||||
|
||||
const Constants = require('../../constants');
|
||||
|
||||
@@ -39,7 +39,7 @@ class PinnedManager extends IPCContainer {
|
||||
});
|
||||
};
|
||||
|
||||
onGetDirectoryItemsReply = (_, { data }) => {
|
||||
onGetDirectoryItemsReply = (_, {data}) => {
|
||||
if (data.Success) {
|
||||
const items = data.Items.filter(
|
||||
(i) =>
|
||||
@@ -70,9 +70,9 @@ class PinnedManager extends IPCContainer {
|
||||
style.marginBottom = '4px';
|
||||
}
|
||||
return (
|
||||
<div key={'dir_' + idx} style={{ ...style }}>
|
||||
<div key={'dir_' + idx} style={{...style}}>
|
||||
<Button
|
||||
buttonStyles={{ textAlign: 'left' }}
|
||||
buttonStyles={{textAlign: 'left'}}
|
||||
clicked={() => {
|
||||
const previous = [...this.state.previous];
|
||||
if (path === '..') {
|
||||
@@ -95,7 +95,7 @@ class PinnedManager extends IPCContainer {
|
||||
icon={faFolder}
|
||||
fixedWidth
|
||||
color={'var(--heading_text_color)'}
|
||||
style={{ padding: 0, margin: 0 }}
|
||||
style={{padding: 0, margin: 0}}
|
||||
/>
|
||||
{name}
|
||||
</Button>
|
||||
@@ -104,12 +104,12 @@ class PinnedManager extends IPCContainer {
|
||||
};
|
||||
|
||||
createFile = (name, path, pinned, idx, total, item_idx) => {
|
||||
const style = { textAlign: 'left' };
|
||||
const style = {textAlign: 'left'};
|
||||
if (item_idx + 1 !== total) {
|
||||
style.marginBottom = '2px';
|
||||
}
|
||||
return (
|
||||
<div key={'file_' + idx} style={{ ...style }}>
|
||||
<div key={'file_' + idx} style={{...style}}>
|
||||
<CheckBox
|
||||
checked={pinned}
|
||||
changed={() => {
|
||||
@@ -153,11 +153,11 @@ class PinnedManager extends IPCContainer {
|
||||
<a
|
||||
href={'#'}
|
||||
onClick={() => this.props.displayPinnedManager(false)}
|
||||
style={{ cursor: 'pointer', flex: '0' }}>
|
||||
style={{cursor: 'pointer', flex: '0'}}>
|
||||
X
|
||||
</a>
|
||||
</div>
|
||||
<h1 style={{ width: '100%', textAlign: 'center' }}>{'Pinned File Manager'}</h1>
|
||||
<h1 style={{width: '100%', textAlign: 'center'}}>{'Pinned File Manager'}</h1>
|
||||
<div className={'PinnedManagerActiveDirectory'}>
|
||||
<b> {this.state.active_directory}</b>
|
||||
</div>
|
||||
@@ -168,13 +168,13 @@ class PinnedManager extends IPCContainer {
|
||||
return i.directory
|
||||
? this.createDirectory(i.name, i.path, idx++, this.state.items.length, k)
|
||||
: this.createFile(
|
||||
i.name,
|
||||
i.path,
|
||||
i.meta.pinned,
|
||||
idx++,
|
||||
this.state.items.length,
|
||||
k
|
||||
);
|
||||
i.name,
|
||||
i.path,
|
||||
i.meta.pinned,
|
||||
idx++,
|
||||
this.state.items.length,
|
||||
k
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import React from 'react';
|
||||
import './SkynetExport.css';
|
||||
import CheckboxTree from 'react-checkbox-tree';
|
||||
import { connect } from 'react-redux';
|
||||
import {connect} from 'react-redux';
|
||||
import IPCContainer from '../IPCContainer/IPCContainer';
|
||||
import { notifyApplicationBusy } from '../../redux/actions/common_actions';
|
||||
import { notifyError, notifyInfo } from '../../redux/actions/error_actions';
|
||||
import {notifyApplicationBusy} from '../../redux/actions/common_actions';
|
||||
import {notifyError, notifyInfo} from '../../redux/actions/error_actions';
|
||||
import Box from '../../components/UI/Box/Box';
|
||||
import { displaySkynetExport } from '../../redux/actions/skynet_actions';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import {displaySkynetExport} from '../../redux/actions/skynet_actions';
|
||||
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
|
||||
import {
|
||||
faCheckSquare,
|
||||
faChevronDown,
|
||||
@@ -158,7 +158,7 @@ export default connect(
|
||||
|
||||
render() {
|
||||
return this.props.AppBusy ? (
|
||||
<div />
|
||||
<div/>
|
||||
) : (
|
||||
<Box
|
||||
dxDark
|
||||
@@ -179,7 +179,7 @@ export default connect(
|
||||
<a
|
||||
href={'#'}
|
||||
onClick={() => this.props.displaySkynetExport(false)}
|
||||
style={{ cursor: 'pointer' }}>
|
||||
style={{cursor: 'pointer'}}>
|
||||
X
|
||||
</a>
|
||||
</div>
|
||||
@@ -214,45 +214,45 @@ export default connect(
|
||||
<FontAwesomeIcon
|
||||
icon={faCheckSquare}
|
||||
fixedWidth
|
||||
style={{ padding: 0, margin: 0 }}
|
||||
style={{padding: 0, margin: 0}}
|
||||
/>
|
||||
),
|
||||
uncheck: (
|
||||
<FontAwesomeIcon icon={faSquare} fixedWidth style={{ padding: 0, margin: 0 }} />
|
||||
<FontAwesomeIcon icon={faSquare} fixedWidth style={{padding: 0, margin: 0}}/>
|
||||
),
|
||||
halfCheck: (
|
||||
<FontAwesomeIcon
|
||||
icon={faHSquare}
|
||||
fixedWidth
|
||||
style={{ padding: 0, margin: 0 }}
|
||||
style={{padding: 0, margin: 0}}
|
||||
/>
|
||||
),
|
||||
expandClose: (
|
||||
<FontAwesomeIcon
|
||||
icon={faChevronRight}
|
||||
fixedWidth
|
||||
style={{ padding: 0, margin: 0 }}
|
||||
style={{padding: 0, margin: 0}}
|
||||
/>
|
||||
),
|
||||
expandOpen: (
|
||||
<FontAwesomeIcon
|
||||
icon={faChevronDown}
|
||||
fixedWidth
|
||||
style={{ padding: 0, margin: 0 }}
|
||||
style={{padding: 0, margin: 0}}
|
||||
/>
|
||||
),
|
||||
expandAll: (
|
||||
<FontAwesomeIcon
|
||||
icon={faPlusSquare}
|
||||
fixedWidth
|
||||
style={{ padding: 0, margin: 0 }}
|
||||
style={{padding: 0, margin: 0}}
|
||||
/>
|
||||
),
|
||||
collapseAll: (
|
||||
<FontAwesomeIcon
|
||||
icon={faMinusSquare}
|
||||
fixedWidth
|
||||
style={{ padding: 0, margin: 0 }}
|
||||
style={{padding: 0, margin: 0}}
|
||||
/>
|
||||
),
|
||||
parentClose: (
|
||||
@@ -260,7 +260,7 @@ export default connect(
|
||||
icon={faFolder}
|
||||
fixedWidth
|
||||
color={'var(--heading_text_color)'}
|
||||
style={{ padding: 0, margin: 0 }}
|
||||
style={{padding: 0, margin: 0}}
|
||||
/>
|
||||
),
|
||||
parentOpen: (
|
||||
@@ -268,7 +268,7 @@ export default connect(
|
||||
icon={faFolderOpen}
|
||||
fixedWidth
|
||||
color={'var(--heading_text_color)'}
|
||||
style={{ padding: 0, margin: 0 }}
|
||||
style={{padding: 0, margin: 0}}
|
||||
/>
|
||||
),
|
||||
leaf: (
|
||||
@@ -276,18 +276,18 @@ export default connect(
|
||||
icon={faFile}
|
||||
fixedWidth
|
||||
color={'var(--text_color)'}
|
||||
style={{ padding: 0, margin: 0 }}
|
||||
style={{padding: 0, margin: 0}}
|
||||
/>
|
||||
),
|
||||
}}
|
||||
nodes={this.state.nodes}
|
||||
onClick={(clicked) => this.setState({ clicked })}
|
||||
onCheck={(checked) => this.setState({ checked })}
|
||||
onExpand={(expanded) => this.setState({ expanded })}
|
||||
onClick={(clicked) => this.setState({clicked})}
|
||||
onCheck={(checked) => this.setState({checked})}
|
||||
onExpand={(expanded) => this.setState({expanded})}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
|
||||
<div style={{display: 'flex', justifyContent: 'flex-end'}}>
|
||||
{this.state.second_stage ? (
|
||||
<Button
|
||||
buttonStyles={{
|
||||
|
||||
@@ -2,7 +2,7 @@ import React from 'react';
|
||||
import './Import.css';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
const Import = ({ data }) => {
|
||||
const Import = ({data}) => {
|
||||
return (
|
||||
<div className={'ImportOwner'}>
|
||||
<input
|
||||
@@ -18,7 +18,7 @@ const Import = ({ data }) => {
|
||||
<input
|
||||
readOnly
|
||||
className={'ConfigurationItemInput'}
|
||||
style={{ maxWidth: 'calc(33.33% - calc(var(--default_spacing) / 2))' }}
|
||||
style={{maxWidth: 'calc(33.33% - calc(var(--default_spacing) / 2))'}}
|
||||
type={'text'}
|
||||
value={data.skylink}
|
||||
/>
|
||||
|
||||
@@ -4,7 +4,7 @@ import Import from './Import/Import';
|
||||
import PropTypes from 'prop-types';
|
||||
import Text from '../../../components/UI/Text/Text';
|
||||
|
||||
const ImportList = ({ imports_array }) => {
|
||||
const ImportList = ({imports_array}) => {
|
||||
let key = 0;
|
||||
return (
|
||||
<div>
|
||||
@@ -12,21 +12,21 @@ const ImportList = ({ imports_array }) => {
|
||||
<Text
|
||||
type={'Heading1'}
|
||||
text={'Directory'}
|
||||
style={{ minWidth: '33.33%', maxWidth: '33.33%' }}
|
||||
style={{minWidth: '33.33%', maxWidth: '33.33%'}}
|
||||
/>
|
||||
<Text
|
||||
type={'Heading1'}
|
||||
text={'Skylink'}
|
||||
style={{ minWidth: '33.33%', maxWidth: '33.33%' }}
|
||||
style={{minWidth: '33.33%', maxWidth: '33.33%'}}
|
||||
/>
|
||||
<Text type={'Heading1'} text={'Token'} style={{ minWidth: '33.33%', maxWidth: '33.33%' }} />
|
||||
<Text type={'Heading1'} text={'Token'} style={{minWidth: '33.33%', maxWidth: '33.33%'}}/>
|
||||
</div>
|
||||
<hr />
|
||||
<hr/>
|
||||
<div className={'ImportListOwner'}>
|
||||
{imports_array.map((data) => {
|
||||
return (
|
||||
<div key={'import_' + key++}>
|
||||
<Import data={data} />
|
||||
<Import data={data}/>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import React from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import {connect} from 'react-redux';
|
||||
import './SkynetImport.css';
|
||||
import Box from '../../components/UI/Box/Box';
|
||||
import Button from '../../components/UI/Button/Button';
|
||||
import { displaySkynetImport } from '../../redux/actions/skynet_actions';
|
||||
import {displaySkynetImport} from '../../redux/actions/skynet_actions';
|
||||
import ImportList from './ImportList/ImportList';
|
||||
import IPCContainer from '../IPCContainer/IPCContainer';
|
||||
import { notifyApplicationBusy } from '../../redux/actions/common_actions';
|
||||
import { notifyError, notifyInfo } from '../../redux/actions/error_actions';
|
||||
import { promptLocationAndReadFile } from '../../utils';
|
||||
import {notifyApplicationBusy} from '../../redux/actions/common_actions';
|
||||
import {notifyError, notifyInfo} from '../../redux/actions/error_actions';
|
||||
import {promptLocationAndReadFile} from '../../utils';
|
||||
|
||||
const Constants = require('../../constants');
|
||||
|
||||
@@ -79,7 +79,7 @@ export default connect(
|
||||
handleLoadFile = () => {
|
||||
const data = promptLocationAndReadFile(this.props.notifyError);
|
||||
if (data) {
|
||||
this.setState({ import_text: data });
|
||||
this.setState({import_text: data});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -176,7 +176,7 @@ export default connect(
|
||||
|
||||
render() {
|
||||
return this.props.AppBusy ? (
|
||||
<div />
|
||||
<div/>
|
||||
) : (
|
||||
<Box
|
||||
dxDark
|
||||
@@ -197,7 +197,7 @@ export default connect(
|
||||
<a
|
||||
href={'#'}
|
||||
onClick={() => this.props.displaySkynetImport(false)}
|
||||
style={{ cursor: 'pointer' }}>
|
||||
style={{cursor: 'pointer'}}>
|
||||
X
|
||||
</a>
|
||||
</div>
|
||||
@@ -205,7 +205,7 @@ export default connect(
|
||||
{this.state.second_stage ? 'Verify Imports' : 'Import List'}
|
||||
</h1>
|
||||
{this.state.second_stage ? (
|
||||
<ImportList imports_array={this.state.imports_array} />
|
||||
<ImportList imports_array={this.state.imports_array}/>
|
||||
) : (
|
||||
<textarea
|
||||
autoFocus={true}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import React, { Component } from 'react';
|
||||
import React, {Component} from 'react';
|
||||
import './Password.css';
|
||||
import PropTypes from 'prop-types';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { faEye, faEyeSlash } from '@fortawesome/free-solid-svg-icons';
|
||||
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
|
||||
import {faEye, faEyeSlash} from '@fortawesome/free-solid-svg-icons';
|
||||
|
||||
class Password extends Component {
|
||||
state = {
|
||||
@@ -115,7 +115,7 @@ class Password extends Component {
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className={'PasswordOwner'} style={{ ...this.props.style }}>
|
||||
<div className={'PasswordOwner'} style={{...this.props.style}}>
|
||||
{this.props.readOnly ? null : (
|
||||
<a href={'#'} className={'PasswordLink'} onClick={this.handleActionClick}>
|
||||
<u>{this.state.button_text}</u>
|
||||
@@ -132,7 +132,7 @@ class Password extends Component {
|
||||
value={this.state.button_text === 'confirm' ? this.state.password2 : this.state.password}
|
||||
/>
|
||||
<a href={'#'} className={'PasswordShowHide'} onClick={this.handleShowHideClick}>
|
||||
<FontAwesomeIcon icon={this.state.show_password ? faEye : faEyeSlash} fixedWidth />
|
||||
<FontAwesomeIcon icon={this.state.show_password ? faEye : faEyeSlash} fixedWidth/>
|
||||
</a>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user