This commit is contained in:
2021-08-04 17:17:16 -05:00
parent ce6d96e59b
commit e23c0086c2
75 changed files with 1255 additions and 1246 deletions

View File

@@ -3,7 +3,7 @@ import './App.css';
import AddEditHost from './containers/AddEditHost/AddEditHost'; import AddEditHost from './containers/AddEditHost/AddEditHost';
import Box from './components/UI/Box/Box'; import Box from './components/UI/Box/Box';
import Configuration from './containers/Configuration/Configuration'; import Configuration from './containers/Configuration/Configuration';
import { connect } from 'react-redux'; import {connect} from 'react-redux';
import DependencyList from './components/DependencyList/DependencyList'; import DependencyList from './components/DependencyList/DependencyList';
import DownloadProgress from './components/DownloadProgress/DownloadProgress'; import DownloadProgress from './components/DownloadProgress/DownloadProgress';
import ErrorDetails from './components/ErrorDetails/ErrorDetails'; import ErrorDetails from './components/ErrorDetails/ErrorDetails';
@@ -13,20 +13,20 @@ import IPCContainer from './containers/IPCContainer/IPCContainer';
import Loading from './components/UI/Loading/Loading'; import Loading from './components/UI/Loading/Loading';
import MountItems from './containers/MountItems/MountItems'; import MountItems from './containers/MountItems/MountItems';
import NewReleases from './components/NewReleases/NewReleases.jsx'; import NewReleases from './components/NewReleases/NewReleases.jsx';
import { notifyError } from './redux/actions/error_actions'; import {notifyError} from './redux/actions/error_actions';
import Reboot from './components/Reboot/Reboot'; import Reboot from './components/Reboot/Reboot';
import { import {
setDismissNewReleasesAvailable, setDismissNewReleasesAvailable,
setNewReleasesAvailable, setNewReleasesAvailable,
} from './redux/actions/release_version_actions'; } from './redux/actions/release_version_actions';
import ReleaseVersionDisplay from './components/ReleaseVersionDisplay/ReleaseVersionDisplay'; import ReleaseVersionDisplay from './components/ReleaseVersionDisplay/ReleaseVersionDisplay';
import { saveState } from './redux/actions/common_actions'; import {saveState} from './redux/actions/common_actions';
import Text from './components/UI/Text/Text'; import Text from './components/UI/Text/Text';
import UpgradeIcon from './components/UpgradeIcon/UpgradeIcon'; import UpgradeIcon from './components/UpgradeIcon/UpgradeIcon';
import UpgradeUI from './components/UpgradeUI/UpgradeUI'; import UpgradeUI from './components/UpgradeUI/UpgradeUI';
import { loadReleases, setDismissUIUpgrade } from './redux/actions/release_version_actions'; import {loadReleases, setDismissUIUpgrade} from './redux/actions/release_version_actions';
import YesNo from './components/YesNo/YesNo'; import YesNo from './components/YesNo/YesNo';
import { createModalConditionally } from './utils.jsx'; import {createModalConditionally} from './utils.jsx';
import SkynetImport from './containers/SkynetImport/SkynetImport'; import SkynetImport from './containers/SkynetImport/SkynetImport';
import ApplicationBusy from './components/ApplicationBusy/ApplicationBusy'; import ApplicationBusy from './components/ApplicationBusy/ApplicationBusy';
import SkynetExport from './containers/SkynetExport/SkynetExport'; import SkynetExport from './containers/SkynetExport/SkynetExport';
@@ -196,40 +196,40 @@ class App extends IPCContainer {
remoteSupported={remoteSupported} remoteSupported={remoteSupported}
/> />
); );
const addEditHostDisplay = createModalConditionally(showAddEditHost, <AddEditHost />); const addEditHostDisplay = createModalConditionally(showAddEditHost, <AddEditHost/>);
const pinnedManagerDisplay = createModalConditionally( const pinnedManagerDisplay = createModalConditionally(
showPinnedManager, showPinnedManager,
<PinnedManager version={selectedVersion} /> <PinnedManager version={selectedVersion}/>
); );
const confirmDisplay = createModalConditionally(this.props.DisplayConfirmYesNo, <YesNo />); const confirmDisplay = createModalConditionally(this.props.DisplayConfirmYesNo, <YesNo/>);
const dependencyDisplay = createModalConditionally( const dependencyDisplay = createModalConditionally(
showDependencies, showDependencies,
<DependencyList />, <DependencyList/>,
false, false,
this.props.InstallActive this.props.InstallActive
); );
const downloadDisplay = createModalConditionally( const downloadDisplay = createModalConditionally(
this.props.DownloadActive, this.props.DownloadActive,
<DownloadProgress />, <DownloadProgress/>,
false, false,
true true
); );
const errorDisplay = createModalConditionally(this.props.DisplayError, <ErrorDetails />, true); const errorDisplay = createModalConditionally(this.props.DisplayError, <ErrorDetails/>, true);
const infoDisplay = createModalConditionally(this.props.DisplayInfo, <InfoDetails />, true); const infoDisplay = createModalConditionally(this.props.DisplayInfo, <InfoDetails/>, true);
const newReleasesDisplay = createModalConditionally(showNewReleases, <NewReleases />); const newReleasesDisplay = createModalConditionally(showNewReleases, <NewReleases/>);
const rebootDisplay = createModalConditionally(this.props.RebootRequired, <Reboot />); const rebootDisplay = createModalConditionally(this.props.RebootRequired, <Reboot/>);
const upgradeDisplay = createModalConditionally(showUpgrade, <UpgradeUI />); const upgradeDisplay = createModalConditionally(showUpgrade, <UpgradeUI/>);
const importDisplay = createModalConditionally( const importDisplay = createModalConditionally(
showSkynetImport, showSkynetImport,
<SkynetImport version={selectedVersion} /> <SkynetImport version={selectedVersion}/>
); );
const exportDisplay = createModalConditionally( const exportDisplay = createModalConditionally(
showSkynetExport, showSkynetExport,
<SkynetExport version={selectedVersion} /> <SkynetExport version={selectedVersion}/>
); );
const appBusyDisplay = createModalConditionally( const appBusyDisplay = createModalConditionally(
this.props.AppBusy, this.props.AppBusy,
<ApplicationBusy />, <ApplicationBusy/>,
false, false,
true, true,
this.props.AppBusyTransparent this.props.AppBusyTransparent
@@ -239,7 +239,7 @@ class App extends IPCContainer {
if (!this.props.AppReady) { if (!this.props.AppReady) {
mainContent = ( mainContent = (
<Box col={0} colSpan={'remain'} row={10} rowSpan={'remain'}> <Box col={0} colSpan={'remain'} row={10} rowSpan={'remain'}>
<Loading /> <Loading/>
</Box> </Box>
); );
} else { } else {
@@ -251,8 +251,8 @@ class App extends IPCContainer {
row={10} row={10}
rowSpan={17} rowSpan={17}
key={'md_' + key++} key={'md_' + key++}
dxStyle={{ padding: 'var(--default_spacing)' }}> dxStyle={{padding: 'var(--default_spacing)'}}>
<ReleaseVersionDisplay downloadDisabled={!downloadEnabled} version={selectedVersion} /> <ReleaseVersionDisplay downloadDisabled={!downloadEnabled} version={selectedVersion}/>
</Box> </Box>
); );
if (allowMount) { if (allowMount) {
@@ -261,7 +261,7 @@ class App extends IPCContainer {
row={29} row={29}
rowSpan={'remain'} rowSpan={'remain'}
colSpan={'remain'} colSpan={'remain'}
dxStyle={{ padding: 'var(--default_spacing)' }} dxStyle={{padding: 'var(--default_spacing)'}}
key={'md_' + key++}> key={'md_' + key++}>
<MountItems <MountItems
s3Supported={s3Supported} s3Supported={s3Supported}
@@ -279,9 +279,9 @@ class App extends IPCContainer {
colSpan={'remain'} colSpan={'remain'}
row={29} row={29}
rowSpan={'remain'} rowSpan={'remain'}
dxStyle={{ padding: 'var(--default_spacing)' }} dxStyle={{padding: 'var(--default_spacing)'}}
key={'md_' + key++}> key={'md_' + key++}>
<Loading /> <Loading/>
</Box> </Box>
); );
} }

View File

@@ -4,16 +4,16 @@ import Loader from 'react-loader-spinner';
import Text from '../UI/Text/Text'; import Text from '../UI/Text/Text';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
const ApplicationBusy = ({ title }) => { const ApplicationBusy = ({title}) => {
return ( return (
<Box dxDark dxStyle={{ padding: 'var(--default_spacing)' }}> <Box dxDark dxStyle={{padding: 'var(--default_spacing)'}}>
<Text text={title || 'Please Wait...'} textAlign={'center'} type={'Heading1'} /> <Text text={title || 'Please Wait...'} textAlign={'center'} type={'Heading1'}/>
<div <div
style={{ style={{
paddingLeft: 'calc(50% - 16px)', paddingLeft: 'calc(50% - 16px)',
paddingTop: 'var(--default_spacing)', paddingTop: 'var(--default_spacing)',
}}> }}>
<Loader color={'var(--heading_text_color)'} height={32} width={32} type="TailSpin" /> <Loader color={'var(--heading_text_color)'} height={32} width={32} type="TailSpin"/>
</div> </div>
</Box> </Box>
); );

View File

@@ -2,7 +2,7 @@ import React from 'react';
import './Dependency.css'; import './Dependency.css';
import * as Constants from '../../../constants'; import * as Constants from '../../../constants';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { connect } from 'react-redux'; import {connect} from 'react-redux';
const Dependency = (props) => { const Dependency = (props) => {
return ( return (

View File

@@ -4,11 +4,11 @@ import * as Constants from '../../constants';
import Box from '../UI/Box/Box'; import Box from '../UI/Box/Box';
import Dependency from './Dependency/Dependency'; import Dependency from './Dependency/Dependency';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { connect } from 'react-redux'; import {connect} from 'react-redux';
import { createDismissDisplay } from '../../utils.jsx'; import {createDismissDisplay} from '../../utils.jsx';
import { downloadItem } from '../../redux/actions/download_actions'; import {downloadItem} from '../../redux/actions/download_actions';
import { extractFileNameFromURL } from '../../utils.jsx'; import {extractFileNameFromURL} from '../../utils.jsx';
import { setDismissDependencies } from '../../redux/actions/install_actions'; import {setDismissDependencies} from '../../redux/actions/install_actions';
const DependencyList = (props) => { const DependencyList = (props) => {
const items = props.MissingDependencies.map((k, i) => { const items = props.MissingDependencies.map((k, i) => {
@@ -29,7 +29,7 @@ const DependencyList = (props) => {
}); });
return ( return (
<Box dxStyle={{ width: '300px', height: 'auto', padding: '5px' }}> <Box dxStyle={{width: '300px', height: 'auto', padding: '5px'}}>
{createDismissDisplay( {createDismissDisplay(
() => props.setDismissDependencies(true), () => props.setDismissDependencies(true),
!props.AllowDismissDependencies !props.AllowDismissDependencies

View File

@@ -2,21 +2,21 @@ import Box from '../UI/Box/Box';
import './DownloadProgress.css'; import './DownloadProgress.css';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import { connect } from 'react-redux'; import {connect} from 'react-redux';
const DownloadProgress = (props) => { const DownloadProgress = (props) => {
const width = props.Platform === 'linux' ? '480px' : '380px'; const width = props.Platform === 'linux' ? '480px' : '380px';
return ( return (
<Box dxStyle={{ width: width, height: 'auto', padding: '5px' }}> <Box dxStyle={{width: width, height: 'auto', padding: '5px'}}>
<div style={{ width: '100%', height: 'auto' }}> <div style={{width: '100%', height: 'auto'}}>
<h1 style={{ width: '100%', textAlign: 'center' }}> <h1 style={{width: '100%', textAlign: 'center'}}>
{'Downloading ' + props.DownloadName} {'Downloading ' + props.DownloadName}
</h1> </h1>
</div> </div>
<progress <progress
max={100.0} max={100.0}
id={'download_progress'} id={'download_progress'}
style={{ width: '100%' }} style={{width: '100%'}}
value={props.DownloadProgress} value={props.DownloadProgress}
/> />
</Box> </Box>

View File

@@ -3,12 +3,12 @@ import './ErrorDetails.css';
import Box from '../UI/Box/Box'; import Box from '../UI/Box/Box';
import Button from '../UI/Button/Button'; import Button from '../UI/Button/Button';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { connect } from 'react-redux'; import {connect} from 'react-redux';
import { dismissError } from '../../redux/actions/error_actions'; import {dismissError} from '../../redux/actions/error_actions';
const ErrorDetails = (props) => { const ErrorDetails = (props) => {
return ( return (
<Box dxDark dxStyle={{ padding: 'var(--default_spacing)' }}> <Box dxDark dxStyle={{padding: 'var(--default_spacing)'}}>
<h1 className={'ErrorDetailsHeading'}>Application Error</h1> <h1 className={'ErrorDetailsHeading'}>Application Error</h1>
<div className={'ErrorDetailsContent'}> <div className={'ErrorDetailsContent'}>
<p>{props.ErrorMessage}</p> <p>{props.ErrorMessage}</p>

View File

@@ -3,9 +3,9 @@ import './InfoDetails.css';
import Box from '../UI/Box/Box'; import Box from '../UI/Box/Box';
import Button from '../UI/Button/Button'; import Button from '../UI/Button/Button';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { connect } from 'react-redux'; import {connect} from 'react-redux';
import { dismissInfo, notifyError } from '../../redux/actions/error_actions'; import {dismissInfo, notifyError} from '../../redux/actions/error_actions';
import { promptLocationAndSaveFile } from '../../utils'; import {promptLocationAndSaveFile} from '../../utils';
const InfoDetails = (props) => { const InfoDetails = (props) => {
let msg = props.InfoMessage.message; let msg = props.InfoMessage.message;
@@ -36,27 +36,28 @@ const InfoDetails = (props) => {
}; };
return ( return (
<Box dxDark dxStyle={{ padding: 'var(--default_spacing)' }}> <Box dxDark dxStyle={{padding: 'var(--default_spacing)'}}>
<h1 className={'InfoDetailsHeading'}>{props.InfoMessage.title}</h1> <h1 className={'InfoDetailsHeading'}>{props.InfoMessage.title}</h1>
<div className={classes.join(' ')}> <div className={classes.join(' ')}>
{copyable ? ( {copyable ? (
<textarea <textarea
autoFocus autoFocus
rows={9} rows={9}
onChange={() => {}} onChange={() => {
}}
value={msg} value={msg}
className={'SkynetImportTextArea'} className={'SkynetImportTextArea'}
onClick={(e) => scrollToTop(e.target)} onClick={(e) => scrollToTop(e.target)}
/> />
) : ( ) : (
<p style={{ textAlign: 'left' }}>{msg}</p> <p style={{textAlign: 'left'}}>{msg}</p>
)} )}
</div> </div>
{props.InfoMessage.saveToFile ? ( {props.InfoMessage.saveToFile ? (
<div className={'InfoButtonOwner'}> <div className={'InfoButtonOwner'}>
<Button clicked={props.dismissInfo}>Dismiss</Button> <Button clicked={props.dismissInfo}>Dismiss</Button>
<Button <Button
buttonStyles={{ marginLeft: 'var(--default_spacing)' }} buttonStyles={{marginLeft: 'var(--default_spacing)'}}
clicked={() => { clicked={() => {
if ( if (
promptLocationAndSaveFile( promptLocationAndSaveFile(

View File

@@ -2,11 +2,11 @@ import React from 'react';
import * as Constants from '../../../constants'; import * as Constants from '../../../constants';
import Button from '../../UI/Button/Button'; import Button from '../../UI/Button/Button';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { connect } from 'react-redux'; import {connect} from 'react-redux';
import { formatLinesForDisplay, getChangesForRepertoryVersion } from '../../../utils.jsx'; import {formatLinesForDisplay, getChangesForRepertoryVersion} from '../../../utils.jsx';
import { notifyError, notifyInfo } from '../../../redux/actions/error_actions'; import {notifyError, notifyInfo} from '../../../redux/actions/error_actions';
import { setActiveRelease } from '../../../redux/actions/release_version_actions'; import {setActiveRelease} from '../../../redux/actions/release_version_actions';
import { unmountAll } from '../../../redux/actions/mount_actions'; import {unmountAll} from '../../../redux/actions/mount_actions';
const NewRelease = ({ const NewRelease = ({
ActiveRelease, ActiveRelease,
@@ -18,7 +18,7 @@ const NewRelease = ({
notifyInfo, notifyInfo,
setActiveRelease, setActiveRelease,
unmountAll, unmountAll,
}) => { }) => {
const title = '[' + Constants.RELEASE_TYPES[release.Release] + '] ' + release.Display; const title = '[' + Constants.RELEASE_TYPES[release.Release] + '] ' + release.Display;
const displayChanges = async () => { const displayChanges = async () => {
try { try {
@@ -42,25 +42,25 @@ const NewRelease = ({
<h2>{title}</h2> <h2>{title}</h2>
<table cellSpacing={0} cellPadding={0} width="97%"> <table cellSpacing={0} cellPadding={0} width="97%">
<tbody> <tbody>
<tr style={{ height: '4px' }} /> <tr style={{height: '4px'}}/>
<tr> <tr>
<td width="50%"> <td width="50%">
<Button buttonStyles={{ width: '100%' }} clicked={displayChanges}> <Button buttonStyles={{width: '100%'}} clicked={displayChanges}>
Changes Changes
</Button> </Button>
</td> </td>
<td> <td>
<div style={{ width: 'var(--default_spacing)' }} /> <div style={{width: 'var(--default_spacing)'}}/>
</td> </td>
<td width="50%"> <td width="50%">
{!isActiveRelease ? ( {!isActiveRelease ? (
<Button buttonStyles={{ width: '100%' }} clicked={setReleaseAndVersion}> <Button buttonStyles={{width: '100%'}} clicked={setReleaseAndVersion}>
Activate Activate
</Button> </Button>
) : null} ) : null}
</td> </td>
</tr> </tr>
{lastItem ? null : <tr style={{ height: 'var(--default_spacing)' }} />} {lastItem ? null : <tr style={{height: 'var(--default_spacing)'}}/>}
</tbody> </tbody>
</table> </table>
</div> </div>

View File

@@ -4,8 +4,8 @@ import Box from '../UI/Box/Box';
import Button from '../UI/Button/Button'; import Button from '../UI/Button/Button';
import NewRelease from './NewRelease/NewRelease.jsx'; import NewRelease from './NewRelease/NewRelease.jsx';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { connect } from 'react-redux'; import {connect} from 'react-redux';
import { setDismissNewReleasesAvailable } from '../../redux/actions/release_version_actions'; import {setDismissNewReleasesAvailable} from '../../redux/actions/release_version_actions';
const NewReleases = (props) => { const NewReleases = (props) => {
const newReleases = props.NewReleasesAvailable.map((i, idx) => { const newReleases = props.NewReleasesAvailable.map((i, idx) => {
@@ -20,7 +20,7 @@ const NewReleases = (props) => {
}); });
return ( return (
<Box dxDark dxStyle={{ padding: 'var(--default_spacing)' }}> <Box dxDark dxStyle={{padding: 'var(--default_spacing)'}}>
<h1 className={'NewReleasesHeading'}>New Repertory Versions Available</h1> <h1 className={'NewReleasesHeading'}>New Repertory Versions Available</h1>
<div className={'NewReleasesContent'}>{newReleases}</div> <div className={'NewReleasesContent'}>{newReleases}</div>
<Button clicked={props.dismissNewReleasesAvailable}>Dismiss</Button> <Button clicked={props.dismissNewReleasesAvailable}>Dismiss</Button>

View File

@@ -3,12 +3,12 @@ import './Reboot.css';
import Box from '../UI/Box/Box'; import Box from '../UI/Box/Box';
import Button from '../UI/Button/Button'; import Button from '../UI/Button/Button';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { connect } from 'react-redux'; import {connect} from 'react-redux';
import { rebootSystem } from '../../redux/actions/common_actions'; import {rebootSystem} from '../../redux/actions/common_actions';
const Reboot = (props) => { const Reboot = (props) => {
return ( return (
<Box dxDark dxStyle={{ padding: 'var(--default_spacing)' }}> <Box dxDark dxStyle={{padding: 'var(--default_spacing)'}}>
<h1 className={'RebootHeading'}>Reboot System</h1> <h1 className={'RebootHeading'}>Reboot System</h1>
<div className={'RebootContent'}> <div className={'RebootContent'}>
<p>Repertory requires a system reboot to continue.</p> <p>Repertory requires a system reboot to continue.</p>

View File

@@ -7,9 +7,9 @@ import Grid from '../UI/Grid/Grid';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import Text from '../UI/Text/Text'; import Text from '../UI/Text/Text';
import UpgradeIcon from '../UpgradeIcon/UpgradeIcon'; import UpgradeIcon from '../UpgradeIcon/UpgradeIcon';
import { connect } from 'react-redux'; import {connect} from 'react-redux';
import { downloadItem } from '../../redux/actions/download_actions'; import {downloadItem} from '../../redux/actions/download_actions';
import { setActiveRelease } from '../../redux/actions/release_version_actions'; import {setActiveRelease} from '../../redux/actions/release_version_actions';
const ReleaseVersionDisplay = (props) => { const ReleaseVersionDisplay = (props) => {
const getSelectedVersion = () => { const getSelectedVersion = () => {

View File

@@ -18,7 +18,7 @@ const Box = (props) => {
} }
return ( return (
<div onClick={props.clicked} className={styleList.join(' ')} style={{ ...props.dxStyle }}> <div onClick={props.clicked} className={styleList.join(' ')} style={{...props.dxStyle}}>
{props.children} {props.children}
</div> </div>
); );

View File

@@ -14,7 +14,7 @@ const CheckBox = (props) => {
onChange={props.changed} onChange={props.changed}
type="checkbox" type="checkbox"
/> />
<span className="CheckBoxCheckMark" /> <span className="CheckBoxCheckMark"/>
</label> </label>
</div> </div>
); );

View File

@@ -1,4 +1,4 @@
import React, { Component } from 'react'; import React, {Component} from 'react';
import './Grid.css'; import './Grid.css';
import GridComponent from './GridComponent/GridComponent'; import GridComponent from './GridComponent/GridComponent';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';

View File

@@ -6,7 +6,7 @@ const Loading = () => {
return ( return (
<div className={'Loading'}> <div className={'Loading'}>
<div className={'LoadingContent'}> <div className={'LoadingContent'}>
<Loader color={'var(--heading_text_color)'} height={28} width={28} type="ThreeDots" /> <Loader color={'var(--heading_text_color)'} height={28} width={28} type="ThreeDots"/>
</div> </div>
</div> </div>
); );

View File

@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
const RootElem = (props) => { const RootElem = (props) => {
return ( return (
<div style={{ margin: 0, padding: 0 }} {...props}> <div style={{margin: 0, padding: 0}} {...props}>
{props.children} {props.children}
</div> </div>
); );

View File

@@ -9,7 +9,7 @@ const Text = (props) => {
styleList.push('Text' + props.type); styleList.push('Text' + props.type);
} }
let style = { ...props.style }; let style = {...props.style};
if (props.textAlign) { if (props.textAlign) {
style['textAlign'] = props.textAlign.toLowerCase(); style['textAlign'] = props.textAlign.toLowerCase();
} }

View File

@@ -2,8 +2,8 @@ import './UpgradeIcon.css';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import ReactTooltip from 'react-tooltip'; import ReactTooltip from 'react-tooltip';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons'; import {faExclamationTriangle} from '@fortawesome/free-solid-svg-icons';
const UpgradeIcon = (props) => { const UpgradeIcon = (props) => {
const styles = ['UpgradeIcon']; const styles = ['UpgradeIcon'];
@@ -22,7 +22,7 @@ const UpgradeIcon = (props) => {
<div className={'UpgradeIconOwner'}> <div className={'UpgradeIconOwner'}>
<p data-tip="" data-for={placement}> <p data-tip="" data-for={placement}>
<a href={'#'} className={styles.join(' ')} onClick={props.clicked}> <a href={'#'} className={styles.join(' ')} onClick={props.clicked}>
<FontAwesomeIcon icon={faExclamationTriangle} /> <FontAwesomeIcon icon={faExclamationTriangle}/>
</a> </a>
</p> </p>
<ReactTooltip id={placement} place={placement}> <ReactTooltip id={placement} place={placement}>

View File

@@ -1,12 +1,12 @@
import { connect } from 'react-redux'; import {connect} from 'react-redux';
import './UpgradeUI.css'; import './UpgradeUI.css';
import * as Constants from '../../constants'; import * as Constants from '../../constants';
import Box from '../UI/Box/Box'; import Box from '../UI/Box/Box';
import Button from '../UI/Button/Button'; import Button from '../UI/Button/Button';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import { downloadItem } from '../../redux/actions/download_actions'; import {downloadItem} from '../../redux/actions/download_actions';
import { setDismissUIUpgrade } from '../../redux/actions/release_version_actions'; import {setDismissUIUpgrade} from '../../redux/actions/release_version_actions';
const UpgradeUI = (props) => { const UpgradeUI = (props) => {
const handleDownload = () => { const handleDownload = () => {
@@ -20,21 +20,21 @@ const UpgradeUI = (props) => {
}; };
return ( return (
<Box dxStyle={{ width: '180px', height: 'auto', padding: '5px' }}> <Box dxStyle={{width: '180px', height: 'auto', padding: '5px'}}>
<div style={{ width: '100%', height: 'auto' }}> <div style={{width: '100%', height: 'auto'}}>
<h1 style={{ width: '100%', textAlign: 'center' }}>UI Upgrade Available</h1> <h1 style={{width: '100%', textAlign: 'center'}}>UI Upgrade Available</h1>
</div> </div>
<table cellSpacing={5} width="100%"> <table cellSpacing={5} width="100%">
<tbody> <tbody>
<tr> <tr>
<td width="50%"> <td width="50%">
<Button buttonStyles={{ width: '100%' }} clicked={handleDownload}> <Button buttonStyles={{width: '100%'}} clicked={handleDownload}>
Install Install
</Button> </Button>
</td> </td>
<td width="50%"> <td width="50%">
<Button <Button
buttonStyles={{ width: '100%' }} buttonStyles={{width: '100%'}}
clicked={() => props.setDismissUIUpgrade(true)}> clicked={() => props.setDismissUIUpgrade(true)}>
Cancel Cancel
</Button> </Button>

View File

@@ -3,8 +3,8 @@ import './YesNo.css';
import Box from '../UI/Box/Box'; import Box from '../UI/Box/Box';
import Button from '../UI/Button/Button'; import Button from '../UI/Button/Button';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { confirmYesNoAction } from '../../redux/actions/common_actions'; import {confirmYesNoAction} from '../../redux/actions/common_actions';
import { connect } from 'react-redux'; import {connect} from 'react-redux';
const YesNo = (props) => { const YesNo = (props) => {
return ( return (
@@ -14,19 +14,19 @@ const YesNo = (props) => {
height: 'auto', height: 'auto',
padding: 'var(--default_spacing)', padding: 'var(--default_spacing)',
}}> }}>
<div style={{ width: '100%', height: 'auto' }}> <div style={{width: '100%', height: 'auto'}}>
<h1 style={{ width: '100%', textAlign: 'center' }}>{props.Title}</h1> <h1 style={{width: '100%', textAlign: 'center'}}>{props.Title}</h1>
</div> </div>
<table cellSpacing={5} width="100%"> <table cellSpacing={5} width="100%">
<tbody> <tbody>
<tr> <tr>
<td width="50%"> <td width="50%">
<Button buttonStyles={{ width: '100%' }} clicked={() => props.confirm(true)}> <Button buttonStyles={{width: '100%'}} clicked={() => props.confirm(true)}>
Yes Yes
</Button> </Button>
</td> </td>
<td width="50%"> <td width="50%">
<Button buttonStyles={{ width: '100%' }} clicked={() => props.confirm(false)}> <Button buttonStyles={{width: '100%'}} clicked={() => props.confirm(false)}>
No No
</Button> </Button>
</td> </td>

View File

@@ -1,4 +1,4 @@
Object.defineProperty(exports, '__esModule', { value: true }); Object.defineProperty(exports, '__esModule', {value: true});
exports.DEV_PUBLIC_KEY = exports.DEV_PUBLIC_KEY =
'-----BEGIN PUBLIC KEY-----\n' + '-----BEGIN PUBLIC KEY-----\n' +
'MIIEIjANBgkqhkiG9w0BAQEFAAOCBA8AMIIECgKCBAEKfZmq5mMAtD4kSt2Gc/5J\n' + 'MIIEIjANBgkqhkiG9w0BAQEFAAOCBA8AMIIECgKCBAEKfZmq5mMAtD4kSt2Gc/5J\n' +

View File

@@ -5,11 +5,11 @@ import DropDown from '../../components/UI/DropDown/DropDown';
import IPCContainer from '../IPCContainer/IPCContainer'; import IPCContainer from '../IPCContainer/IPCContainer';
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 { addEditHostAction } from '../../redux/actions/host_actions'; import {addEditHostAction} from '../../redux/actions/host_actions';
import { connect } from 'react-redux'; import {connect} from 'react-redux';
import { createDismissDisplay } from '../../utils.jsx'; import {createDismissDisplay} from '../../utils.jsx';
import { notifyApplicationBusy } from '../../redux/actions/common_actions'; import {notifyApplicationBusy} from '../../redux/actions/common_actions';
import { notifyError, notifyInfo } from '../../redux/actions/error_actions'; import {notifyError, notifyInfo} from '../../redux/actions/error_actions';
const Constants = require('../../constants'); const Constants = require('../../constants');
@@ -31,7 +31,7 @@ class AddEditHost extends IPCContainer {
this.setRequestHandler(Constants.IPC_Skynet_Test_Logon_Reply, this.onSkynetTestLogonReply); this.setRequestHandler(Constants.IPC_Skynet_Test_Logon_Reply, this.onSkynetTestLogonReply);
if (this.props.HostData) { 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; const allowTestLogon = this.state.AuthURL && this.state.AuthUser;
return ( return (
<Box dxDark dxStyle={{ width: '430px', height: 'auto', padding: '5px' }}> <Box dxDark dxStyle={{width: '430px', height: 'auto', padding: '5px'}}>
{createDismissDisplay(this.props.Close)} {createDismissDisplay(this.props.Close)}
<div <div
style={{ style={{
@@ -115,86 +115,86 @@ class AddEditHost extends IPCContainer {
}}> }}>
Portal Settings Portal Settings
</h1> </h1>
<div style={{ display: 'flex', flexDirection: 'row' }}> <div style={{display: 'flex', flexDirection: 'row'}}>
<Text text={'Host / IP'} textAlign={'left'} type={'Heading2'} /> <Text text={'Host / IP'} textAlign={'left'} type={'Heading2'}/>
</div> </div>
<div style={{ display: 'flex', flexDirection: 'row' }}> <div style={{display: 'flex', flexDirection: 'row'}}>
<input <input
onChange={(e) => this.setState({ HostNameOrIp: e.target.value.trim() })} onChange={(e) => this.setState({HostNameOrIp: e.target.value.trim()})}
className={'ConfigurationItemInput'} className={'ConfigurationItemInput'}
style={{ width: '100%' }} style={{width: '100%'}}
type={'text'} type={'text'}
value={this.state.HostNameOrIp} value={this.state.HostNameOrIp}
/> />
</div> </div>
<div style={{ height: 'var(--default_spacing)' }} /> <div style={{height: 'var(--default_spacing)'}}/>
<div style={{ display: 'flex', flexDirection: 'row' }}> <div style={{display: 'flex', flexDirection: 'row'}}>
<Text text={'Protocol'} textAlign={'left'} type={'Heading2'} /> <Text text={'Protocol'} textAlign={'left'} type={'Heading2'}/>
<div style={{ paddingLeft: 'var(--default_spacing)' }} /> <div style={{paddingLeft: 'var(--default_spacing)'}}/>
<Text text={'Port'} textAlign={'left'} type={'Heading2'} /> <Text text={'Port'} textAlign={'left'} type={'Heading2'}/>
<div style={{ paddingLeft: 'var(--default_spacing)' }} /> <div style={{paddingLeft: 'var(--default_spacing)'}}/>
<Text text={'Timeout (ms)'} textAlign={'left'} type={'Heading2'} /> <Text text={'Timeout (ms)'} textAlign={'left'} type={'Heading2'}/>
</div> </div>
<div style={{ display: 'flex', flexDirection: 'row' }}> <div style={{display: 'flex', flexDirection: 'row'}}>
<DropDown <DropDown
changed={(e) => this.setState({ Protocol: e.target.value })} changed={(e) => this.setState({Protocol: e.target.value})}
items={['https', 'http']} items={['https', 'http']}
selected={this.state.Protocol} 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 <input
onChange={(e) => this.setState({ ApiPort: parseInt(e.target.value) })} onChange={(e) => this.setState({ApiPort: parseInt(e.target.value)})}
className={'ConfigurationItemInput'} className={'ConfigurationItemInput'}
style={{ width: '100%' }} style={{width: '100%'}}
type={'number'} type={'number'}
min={1} min={1}
max={65535} max={65535}
value={this.state.ApiPort} 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 <input
onChange={(e) => this.setState({ TimeoutMs: parseInt(e.target.value) })} onChange={(e) => this.setState({TimeoutMs: parseInt(e.target.value)})}
className={'ConfigurationItemInput'} className={'ConfigurationItemInput'}
style={{ width: '100%' }} style={{width: '100%'}}
type={'number'} type={'number'}
min={1000} min={1000}
step={1000} step={1000}
value={this.state.TimeoutMs} value={this.state.TimeoutMs}
/> />
</div> </div>
<div style={{ height: 'var(--default_spacing)' }} /> <div style={{height: 'var(--default_spacing)'}}/>
<div style={{ display: 'flex', flexDirection: 'row' }}> <div style={{display: 'flex', flexDirection: 'row'}}>
<Text text={'Agent String (optional)'} textAlign={'left'} type={'Heading2'} /> <Text text={'Agent String (optional)'} textAlign={'left'} type={'Heading2'}/>
<div style={{ width: 'var(--default_spacing)' }} /> <div style={{width: 'var(--default_spacing)'}}/>
<Text text={'API Key (optional)'} textAlign={'left'} type={'Heading2'} /> <Text text={'API Key (optional)'} textAlign={'left'} type={'Heading2'}/>
</div> </div>
<div style={{ display: 'flex', flexDirection: 'row' }}> <div style={{display: 'flex', flexDirection: 'row'}}>
<input <input
onChange={(e) => this.setState({ AgentString: e.target.value })} onChange={(e) => this.setState({AgentString: e.target.value})}
className={'ConfigurationItemInput'} className={'ConfigurationItemInput'}
style={{ flex: '1' }} style={{flex: '1'}}
type={'text'} type={'text'}
value={this.state.AgentString} value={this.state.AgentString}
/> />
<div style={{ width: 'var(--default_spacing)' }} /> <div style={{width: 'var(--default_spacing)'}}/>
<input <input
onChange={(e) => this.setState({ ApiPassword: e.target.value })} onChange={(e) => this.setState({ApiPassword: e.target.value})}
className={'ConfigurationItemInput'} className={'ConfigurationItemInput'}
style={{ flex: '1' }} style={{flex: '1'}}
type={'text'} type={'text'}
value={this.state.ApiPassword} value={this.state.ApiPassword}
/> />
</div> </div>
<div style={{ height: 'var(--default_spacing)' }} /> <div style={{height: 'var(--default_spacing)'}}/>
<div style={{ display: 'flex', flexDirection: 'row' }}> <div style={{display: 'flex', flexDirection: 'row'}}>
<Text <Text
noOwner noOwner
text={'Authentication URL (premium)'} text={'Authentication URL (premium)'}
textAlign={'left'} textAlign={'left'}
type={'Heading2'} type={'Heading2'}
style={{ marginRight: 'auto' }} style={{marginRight: 'auto'}}
/> />
{allowTestLogon ? ( {allowTestLogon ? (
<a <a
@@ -207,38 +207,38 @@ class AddEditHost extends IPCContainer {
</a> </a>
) : null} ) : null}
</div> </div>
<div style={{ display: 'flex', flexDirection: 'column' }}> <div style={{display: 'flex', flexDirection: 'column'}}>
<input <input
onChange={(e) => this.setState({ AuthURL: e.target.value })} onChange={(e) => this.setState({AuthURL: e.target.value})}
className={'ConfigurationItemInput'} className={'ConfigurationItemInput'}
type={'text'} type={'text'}
value={this.state.AuthURL} value={this.state.AuthURL}
/> />
</div> </div>
<div style={{ height: 'var(--default_spacing)' }} /> <div style={{height: 'var(--default_spacing)'}}/>
<div style={{ display: 'flex', flexDirection: 'row' }}> <div style={{display: 'flex', flexDirection: 'row'}}>
<Text text={'User Name (premium)'} textAlign={'left'} type={'Heading2'} /> <Text text={'User Name (premium)'} textAlign={'left'} type={'Heading2'}/>
<div style={{ width: 'var(--default_spacing)' }} /> <div style={{width: 'var(--default_spacing)'}}/>
<Text text={'Password (premium)'} textAlign={'left'} type={'Heading2'} /> <Text text={'Password (premium)'} textAlign={'left'} type={'Heading2'}/>
</div> </div>
<div style={{ display: 'flex', flexDirection: 'row' }}> <div style={{display: 'flex', flexDirection: 'row'}}>
<input <input
onChange={(e) => this.setState({ AuthUser: e.target.value })} onChange={(e) => this.setState({AuthUser: e.target.value})}
className={'ConfigurationItemInput'} className={'ConfigurationItemInput'}
style={{ flex: '1' }} style={{flex: '1'}}
type={'text'} type={'text'}
value={this.state.AuthUser} value={this.state.AuthUser}
/> />
<div style={{ width: 'var(--default_spacing)' }} /> <div style={{width: 'var(--default_spacing)'}}/>
<input <input
onChange={(e) => this.setState({ AuthPassword: e.target.value })} onChange={(e) => this.setState({AuthPassword: e.target.value})}
className={'ConfigurationItemInput'} className={'ConfigurationItemInput'}
style={{ flex: '1' }} style={{flex: '1'}}
type={'text'} type={'text'}
value={this.state.AuthPassword} value={this.state.AuthPassword}
/> />
</div> </div>
<div style={{ height: 'var(--default_spacing)' }} /> <div style={{height: 'var(--default_spacing)'}}/>
<p> <p>
<b> <b>
{'Portal URL: ' + {'Portal URL: ' +
@@ -251,7 +251,7 @@ class AddEditHost extends IPCContainer {
: '')} : '')}
</b> </b>
</p> </p>
<div style={{ height: 'var(--default_spacing)' }} /> <div style={{height: 'var(--default_spacing)'}}/>
</div> </div>
<Button clicked={this.handleSave}>Save</Button> <Button clicked={this.handleSave}>Save</Button>
</Box> </Box>
@@ -270,7 +270,7 @@ const mapStateToProps = (state) => {
const mapDispatchToProps = (dispatch) => { const mapDispatchToProps = (dispatch) => {
return { return {
Close: () => dispatch(addEditHostAction.complete(false)), 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)), notifyApplicationBusy: (busy) => dispatch(notifyApplicationBusy(busy, true)),
notifyError: (msg) => dispatch(notifyError(msg)), notifyError: (msg) => dispatch(notifyError(msg)),
notifyInfo: (msg) => dispatch(notifyInfo(msg)), notifyInfo: (msg) => dispatch(notifyInfo(msg)),

View File

@@ -1,14 +1,14 @@
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { Component } from 'react'; import {Component} from 'react';
import './AddMount.css'; import './AddMount.css';
import { connect } from 'react-redux'; import {connect} from 'react-redux';
import Button from '../../components/UI/Button/Button'; import Button from '../../components/UI/Button/Button';
import Box from '../../components/UI/Box/Box'; import Box from '../../components/UI/Box/Box';
import Text from '../../components/UI/Text/Text'; import Text from '../../components/UI/Text/Text';
import { notifyError } from '../../redux/actions/error_actions'; import {notifyError} from '../../redux/actions/error_actions';
import { addRemoteMount, addS3Mount } from '../../redux/actions/mount_actions'; import {addRemoteMount, addS3Mount} from '../../redux/actions/mount_actions';
import { createModalConditionally } from '../../utils.jsx'; import {createModalConditionally} from '../../utils.jsx';
import DropDown from '../../components/UI/DropDown/DropDown'; import DropDown from '../../components/UI/DropDown/DropDown';
import * as Constants from '../../constants'; import * as Constants from '../../constants';
@@ -129,40 +129,40 @@ class AddMount extends Component {
}}> }}>
Add Remote Mount Add Remote Mount
</h1> </h1>
<Text text={'Hostname or IP'} textAlign={'left'} type={'Heading2'} /> <Text text={'Hostname or IP'} textAlign={'left'} type={'Heading2'}/>
<input <input
onChange={(e) => this.setState({ HostNameOrIp: e.target.value.trim() })} onChange={(e) => this.setState({HostNameOrIp: e.target.value.trim()})}
className={'ConfigurationItemInput'} className={'ConfigurationItemInput'}
type={'text'} type={'text'}
value={this.state.HostNameOrIp} value={this.state.HostNameOrIp}
/> />
<div style={{ paddingTop: 'var(--default_spacing)' }} /> <div style={{paddingTop: 'var(--default_spacing)'}}/>
<Text text={'Port'} textAlign={'left'} type={'Heading2'} /> <Text text={'Port'} textAlign={'left'} type={'Heading2'}/>
<input <input
max={65535} max={65535}
min={1025} min={1025}
onChange={(e) => this.setState({ Port: e.target.value })} onChange={(e) => this.setState({Port: e.target.value})}
className={'ConfigurationItemInput'} className={'ConfigurationItemInput'}
type={'number'} type={'number'}
value={this.state.Port} value={this.state.Port}
/> />
<div style={{ paddingTop: 'var(--default_spacing)' }} /> <div style={{paddingTop: 'var(--default_spacing)'}}/>
<Text text={'Remote Token'} textAlign={'left'} type={'Heading2'} /> <Text text={'Remote Token'} textAlign={'left'} type={'Heading2'}/>
<input <input
onChange={(e) => this.setState({ Token: e.target.value })} onChange={(e) => this.setState({Token: e.target.value})}
className={'ConfigurationItemInput'} className={'ConfigurationItemInput'}
type={'text'} type={'text'}
value={this.state.Token} value={this.state.Token}
/> />
<div style={{ paddingTop: 'var(--default_spacing)' }} /> <div style={{paddingTop: 'var(--default_spacing)'}}/>
<div style={{ display: 'flex', flexDirection: 'row' }}> <div style={{display: 'flex', flexDirection: 'row'}}>
<Button buttonStyles={{ width: '100%' }} clicked={() => this.addRemoteMount()}> <Button buttonStyles={{width: '100%'}} clicked={() => this.addRemoteMount()}>
OK OK
</Button> </Button>
<div style={{ paddingLeft: 'var(--default_spacing)' }} /> <div style={{paddingLeft: 'var(--default_spacing)'}}/>
<Button <Button
buttonStyles={{ width: '100%' }} buttonStyles={{width: '100%'}}
clicked={() => this.setState({ DisplayRemote: false })}> clicked={() => this.setState({DisplayRemote: false})}>
Cancel Cancel
</Button> </Button>
</div> </div>
@@ -185,20 +185,20 @@ class AddMount extends Component {
}}> }}>
Add S3 Mount Add S3 Mount
</h1> </h1>
<div style={{ display: 'flex', flexDirection: 'row' }}> <div style={{display: 'flex', flexDirection: 'row'}}>
<Text text={'Name'} textAlign={'left'} type={'Heading2'} /> <Text text={'Name'} textAlign={'left'} type={'Heading2'}/>
<div style={{ paddingLeft: 'var(--default_spacing)' }} /> <div style={{paddingLeft: 'var(--default_spacing)'}}/>
<Text text={'Provider'} textAlign={'left'} type={'Heading2'} /> <Text text={'Provider'} textAlign={'left'} type={'Heading2'}/>
</div> </div>
<div style={{ display: 'flex', flexDirection: 'row' }}> <div style={{display: 'flex', flexDirection: 'row'}}>
<input <input
onChange={(e) => this.setState({ Name: e.target.value.trim() })} onChange={(e) => this.setState({Name: e.target.value.trim()})}
className={'ConfigurationItemInput'} className={'ConfigurationItemInput'}
style={{ width: '100%' }} style={{width: '100%'}}
type={'text'} type={'text'}
value={this.state.Name} value={this.state.Name}
/> />
<div style={{ paddingLeft: 'var(--default_spacing)' }} /> <div style={{paddingLeft: 'var(--default_spacing)'}}/>
<DropDown <DropDown
changed={(e) => changed={(e) =>
this.setState({ this.setState({
@@ -213,38 +213,38 @@ class AddMount extends Component {
selected={this.state.Provider} selected={this.state.Provider}
/> />
</div> </div>
<div style={{ paddingTop: 'var(--default_spacing)' }} /> <div style={{paddingTop: 'var(--default_spacing)'}}/>
{this.state.Provider === Constants.S3_CUSTOM_PROVIDER ? ( {this.state.Provider === Constants.S3_CUSTOM_PROVIDER ? (
<div> <div>
<div style={{ display: 'flex', flexDirection: 'row' }}> <div style={{display: 'flex', flexDirection: 'row'}}>
<Text text={'Custom URL'} textAlign={'left'} type={'Heading2'} /> <Text text={'Custom URL'} textAlign={'left'} type={'Heading2'}/>
</div> </div>
<div style={{ display: 'flex', flexDirection: 'row' }}> <div style={{display: 'flex', flexDirection: 'row'}}>
<input <input
onChange={(e) => this.setState({ CustomURL: e.target.value })} onChange={(e) => this.setState({CustomURL: e.target.value})}
className={'ConfigurationItemInput'} className={'ConfigurationItemInput'}
style={{ width: '100%' }} style={{width: '100%'}}
type={'text'} type={'text'}
value={this.state.CustomURL} value={this.state.CustomURL}
/> />
</div> </div>
<div style={{ paddingTop: 'var(--default_spacing)' }} /> <div style={{paddingTop: 'var(--default_spacing)'}}/>
</div> </div>
) : null} ) : null}
<div style={{ display: 'flex', flexDirection: 'row' }}> <div style={{display: 'flex', flexDirection: 'row'}}>
<Text text={'Bucket Name (optional)'} textAlign={'left'} type={'Heading2'} /> <Text text={'Bucket Name (optional)'} textAlign={'left'} type={'Heading2'}/>
<div style={{ paddingLeft: 'var(--default_spacing)' }} /> <div style={{paddingLeft: 'var(--default_spacing)'}}/>
<Text text={'Region'} textAlign={'left'} type={'Heading2'} /> <Text text={'Region'} textAlign={'left'} type={'Heading2'}/>
</div> </div>
<div style={{ display: 'flex', flexDirection: 'row' }}> <div style={{display: 'flex', flexDirection: 'row'}}>
<input <input
onChange={(e) => this.setState({ BucketName: e.target.value })} onChange={(e) => this.setState({BucketName: e.target.value})}
className={'ConfigurationItemInput'} className={'ConfigurationItemInput'}
style={{ width: '100%' }} style={{width: '100%'}}
type={'text'} type={'text'}
value={this.state.BucketName} value={this.state.BucketName}
/> />
<div style={{ paddingLeft: 'var(--default_spacing)' }} /> <div style={{paddingLeft: 'var(--default_spacing)'}}/>
<DropDown <DropDown
changed={(e) => changed={(e) =>
this.setState({ this.setState({
@@ -259,56 +259,56 @@ class AddMount extends Component {
selected={this.state.Region} selected={this.state.Region}
/> />
</div> </div>
<div style={{ paddingTop: 'var(--default_spacing)' }} /> <div style={{paddingTop: 'var(--default_spacing)'}}/>
{this.state.Region === Constants.S3_CUSTOM_REGION ? ( {this.state.Region === Constants.S3_CUSTOM_REGION ? (
<div> <div>
<div style={{ display: 'flex', flexDirection: 'row' }}> <div style={{display: 'flex', flexDirection: 'row'}}>
<div style={{ paddingLeft: 'var(--default_spacing)', width: '100%' }} /> <div style={{paddingLeft: 'var(--default_spacing)', width: '100%'}}/>
<Text text={'Custom Region'} textAlign={'left'} type={'Heading2'} /> <Text text={'Custom Region'} textAlign={'left'} type={'Heading2'}/>
</div> </div>
<div style={{ display: 'flex', flexDirection: 'row' }}> <div style={{display: 'flex', flexDirection: 'row'}}>
<div style={{ paddingLeft: 'var(--default_spacing)', width: '100%' }} /> <div style={{paddingLeft: 'var(--default_spacing)', width: '100%'}}/>
<input <input
onChange={(e) => this.setState({ CustomRegion: e.target.value })} onChange={(e) => this.setState({CustomRegion: e.target.value})}
className={'ConfigurationItemInput'} className={'ConfigurationItemInput'}
style={{ width: '100%' }} style={{width: '100%'}}
type={'text'} type={'text'}
value={this.state.CustomRegion} value={this.state.CustomRegion}
/> />
</div> </div>
<div style={{ paddingTop: 'var(--default_spacing)' }} /> <div style={{paddingTop: 'var(--default_spacing)'}}/>
</div> </div>
) : null} ) : null}
<div style={{ display: 'flex', flexDirection: 'row' }}> <div style={{display: 'flex', flexDirection: 'row'}}>
<Text text={'Access Key'} textAlign={'left'} type={'Heading2'} /> <Text text={'Access Key'} textAlign={'left'} type={'Heading2'}/>
<div style={{ paddingLeft: 'var(--default_spacing)' }} /> <div style={{paddingLeft: 'var(--default_spacing)'}}/>
<Text text={'Secret Key'} textAlign={'left'} type={'Heading2'} /> <Text text={'Secret Key'} textAlign={'left'} type={'Heading2'}/>
</div> </div>
<div style={{ display: 'flex', flexDirection: 'row' }}> <div style={{display: 'flex', flexDirection: 'row'}}>
<input <input
onChange={(e) => this.setState({ AccessKey: e.target.value })} onChange={(e) => this.setState({AccessKey: e.target.value})}
className={'ConfigurationItemInput'} className={'ConfigurationItemInput'}
type={'text'} type={'text'}
value={this.state.AccessKey} value={this.state.AccessKey}
/> />
<div style={{ paddingLeft: 'var(--default_spacing)' }} /> <div style={{paddingLeft: 'var(--default_spacing)'}}/>
<input <input
onChange={(e) => this.setState({ SecretKey: e.target.value })} onChange={(e) => this.setState({SecretKey: e.target.value})}
className={'ConfigurationItemInput'} className={'ConfigurationItemInput'}
type={'text'} type={'text'}
value={this.state.SecretKey} value={this.state.SecretKey}
/> />
</div> </div>
<div style={{ paddingTop: 'calc(var(--default_spacing) * 2)' }} /> <div style={{paddingTop: 'calc(var(--default_spacing) * 2)'}}/>
<div style={{ display: 'flex', flexDirection: 'row' }}> <div style={{display: 'flex', flexDirection: 'row'}}>
<div style={{ width: '200%' }} /> <div style={{width: '200%'}}/>
<Button buttonStyles={{ width: '100%' }} clicked={() => this.addS3Mount()}> <Button buttonStyles={{width: '100%'}} clicked={() => this.addS3Mount()}>
OK OK
</Button> </Button>
<div style={{ paddingLeft: 'var(--default_spacing)' }} /> <div style={{paddingLeft: 'var(--default_spacing)'}}/>
<Button <Button
buttonStyles={{ width: '100%' }} buttonStyles={{width: '100%'}}
clicked={() => this.setState({ DisplayS3: false })}> clicked={() => this.setState({DisplayS3: false})}>
Cancel Cancel
</Button> </Button>
</div> </div>
@@ -326,7 +326,7 @@ class AddMount extends Component {
</Button> </Button>
) : null} ) : null}
{this.props.remoteSupported && this.props.s3Supported ? ( {this.props.remoteSupported && this.props.s3Supported ? (
<div style={{ paddingRight: 'var(--default_spacing)' }} /> <div style={{paddingRight: 'var(--default_spacing)'}}/>
) : null} ) : null}
{this.props.s3Supported ? ( {this.props.s3Supported ? (
<Button className={'AddMountButton'} clicked={this.handleAddS3Mount}> <Button className={'AddMountButton'} clicked={this.handleAddS3Mount}>

View File

@@ -6,11 +6,11 @@ import ConfigurationItem from './ConfigurationItem/ConfigurationItem';
import IPCContainer from '../IPCContainer/IPCContainer'; import IPCContainer from '../IPCContainer/IPCContainer';
import Modal from '../../components/UI/Modal/Modal'; import Modal from '../../components/UI/Modal/Modal';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { connect } from 'react-redux'; import {connect} from 'react-redux';
import { createDismissDisplay } from '../../utils.jsx'; import {createDismissDisplay} from '../../utils.jsx';
import { displayConfiguration } from '../../redux/actions/mount_actions'; import {displayConfiguration} from '../../redux/actions/mount_actions';
import { displayPinnedManager } from '../../redux/actions/pinned_manager_actions'; import {displayPinnedManager} from '../../redux/actions/pinned_manager_actions';
import { notifyError } from '../../redux/actions/error_actions'; import {notifyError} from '../../redux/actions/error_actions';
const Constants = require('../../constants'); const Constants = require('../../constants');
@@ -205,7 +205,8 @@ class Configuration extends IPCContainer {
OriginalItemList: itemListCopy, OriginalItemList: itemListCopy,
OriginalObjectLookup: objectLookupCopy, OriginalObjectLookup: objectLookupCopy,
}, },
() => {} () => {
}
); );
} else { } else {
this.props.notifyError(arg.data.Error); this.props.notifyError(arg.data.Error);
@@ -316,8 +317,8 @@ class Configuration extends IPCContainer {
if (this.state.ChangedItems.length > 0 || this.state.ChangedObjectLookup) { if (this.state.ChangedItems.length > 0 || this.state.ChangedObjectLookup) {
confirmSave = ( confirmSave = (
<Modal> <Modal>
<Box dxStyle={{ width: '40vw', padding: 'var(--default_spacing)' }}> <Box dxStyle={{width: '40vw', padding: 'var(--default_spacing)'}}>
<h1 style={{ width: '100%', textAlign: 'center' }}>Save Changes?</h1> <h1 style={{width: '100%', textAlign: 'center'}}>Save Changes?</h1>
<table width="100%"> <table width="100%">
<tbody> <tbody>
<tr> <tr>
@@ -404,16 +405,16 @@ class Configuration extends IPCContainer {
return ( return (
<div className={'Configuration'}> <div className={'Configuration'}>
{confirmSave} {confirmSave}
<Box dxDark dxStyle={{ padding: '5px' }}> <Box dxDark dxStyle={{padding: '5px'}}>
{createDismissDisplay(this.checkSaveRequired)} {createDismissDisplay(this.checkSaveRequired)}
<h1 style={{ width: '100%', textAlign: 'center' }}> <h1 style={{width: '100%', textAlign: 'center'}}>
{(this.props.DisplayRemoteConfiguration {(this.props.DisplayRemoteConfiguration
? this.props.DisplayConfiguration.substr(6) ? this.props.DisplayConfiguration.substr(6)
: this.props.DisplayS3Configuration : this.props.DisplayS3Configuration
? this.props.DisplayConfiguration.substr(2) ? this.props.DisplayConfiguration.substr(2)
: this.props.DisplayConfiguration) + ' Configuration '} : this.props.DisplayConfiguration) + ' Configuration '}
</h1> </h1>
<div style={{ overflowY: 'auto', height: '90%' }}> <div style={{overflowY: 'auto', height: '90%'}}>
{this.props.MState.Mounted && configurationItems.length > 0 ? ( {this.props.MState.Mounted && configurationItems.length > 0 ? (
<Button <Button
buttonStyles={{ buttonStyles={{
@@ -429,7 +430,7 @@ class Configuration extends IPCContainer {
&nbsp;Pinned File Manager...&nbsp; &nbsp;Pinned File Manager...&nbsp;
</Button> </Button>
) : null} ) : null}
<div style={{ marginBottom: '4px' }} /> <div style={{marginBottom: '4px'}}/>
{objectItems} {objectItems}
{configurationItems.length > 0 ? <h2>Settings</h2> : null} {configurationItems.length > 0 ? <h2>Settings</h2> : null}
{configurationItems} {configurationItems}

View File

@@ -6,10 +6,10 @@ import HostList from '../../HostList/HostList';
import Password from '../../../containers/UI/Password/Password'; import Password from '../../../containers/UI/Password/Password';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import settings from '../../../assets/settings'; import settings from '../../../assets/settings';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
import { connect } from 'react-redux'; import {connect} from 'react-redux';
import { faInfoCircle } from '@fortawesome/free-solid-svg-icons'; import {faInfoCircle} from '@fortawesome/free-solid-svg-icons';
import { notifyError, notifyInfo } from '../../../redux/actions/error_actions'; import {notifyError, notifyInfo} from '../../../redux/actions/error_actions';
const ConfigurationItem = (props) => { const ConfigurationItem = (props) => {
const handleChanged = (e) => { const handleChanged = (e) => {
@@ -37,7 +37,7 @@ const ConfigurationItem = (props) => {
displayInfo(); displayInfo();
return false; return false;
}}> }}>
<FontAwesomeIcon icon={faInfoCircle} /> <FontAwesomeIcon icon={faInfoCircle}/>
</a> </a>
); );
} }

View File

@@ -1,20 +1,20 @@
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
import { addEditHostAction } from '../../../redux/actions/host_actions'; import {addEditHostAction} from '../../../redux/actions/host_actions';
import { connect } from 'react-redux'; import {connect} from 'react-redux';
import { faTrashAlt, faEdit } from '@fortawesome/free-solid-svg-icons'; import {faTrashAlt, faEdit} from '@fortawesome/free-solid-svg-icons';
const mapDispatchToProps = (dispatch) => { const mapDispatchToProps = (dispatch) => {
return { return {
editHost: (host_list, host_data, cb) => 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 = () => { const handleEditHost = () => {
editHost(host_list, host_data, (changed, { host_data }) => { editHost(host_list, host_data, (changed, {host_data}) => {
if (changed) { if (changed) {
onChange(host_data); 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; const premium = host_data.AuthURL && host_data.AuthUser;
return ( return (
<div style={{ display: 'flex', flexDirection: 'row' }}> <div style={{display: 'flex', flexDirection: 'row'}}>
<div <div
style={{ style={{
flex: 0, flex: 0,
paddingRight: 'calc(var(--default_spacing) * 1.25)', paddingRight: 'calc(var(--default_spacing) * 1.25)',
}}> }}>
<a href={'#'} onClick={handleEditHost}> <a href={'#'} onClick={handleEditHost}>
<FontAwesomeIcon icon={faEdit} /> <FontAwesomeIcon icon={faEdit}/>
</a> </a>
</div> </div>
{allowDelete ? ( {allowDelete ? (
@@ -50,7 +50,7 @@ const Host = ({ allowDelete, editHost, host_list, host_data, onChange, onDelete
paddingRight: 'calc(var(--default_spacing) * 1.25)', paddingRight: 'calc(var(--default_spacing) * 1.25)',
}}> }}>
<a href={'#'} onClick={onDelete}> <a href={'#'} onClick={onDelete}>
<FontAwesomeIcon icon={faTrashAlt} /> <FontAwesomeIcon icon={faTrashAlt}/>
</a> </a>
</div> </div>
) : null} ) : null}

View File

@@ -2,12 +2,12 @@ import React from 'react';
import './HostList.css'; import './HostList.css';
import Host from './Host/Host'; import Host from './Host/Host';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { Component } from 'react'; import {Component} from 'react';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
import { confirmYesNoAction } from '../../redux/actions/common_actions'; import {confirmYesNoAction} from '../../redux/actions/common_actions';
import { connect } from 'react-redux'; import {connect} from 'react-redux';
import { addEditHostAction } from '../../redux/actions/host_actions'; import {addEditHostAction} from '../../redux/actions/host_actions';
import { faPlusCircle } from '@fortawesome/free-solid-svg-icons'; import {faPlusCircle} from '@fortawesome/free-solid-svg-icons';
class HostList extends Component { class HostList extends Component {
state = { state = {
@@ -18,13 +18,14 @@ class HostList extends Component {
// type={props.template.subtype} // type={props.template.subtype}
componentDidMount() { componentDidMount() {
this.setState({ items: this.props.value }); this.setState({items: this.props.value});
} }
componentWillUnmount() {} componentWillUnmount() {
}
handleAddHost = () => { handleAddHost = () => {
this.props.AddHost(this.state.items, (changed, { host_data }) => { this.props.AddHost(this.state.items, (changed, {host_data}) => {
if (changed) { if (changed) {
const items = [...this.state.items, host_data]; const items = [...this.state.items, host_data];
this.updateItems(items); this.updateItems(items);
@@ -65,7 +66,7 @@ class HostList extends Component {
render() { render() {
let idx = 0; let idx = 0;
return ( return (
<div style={{ display: 'flex', flexDirection: 'column' }}> <div style={{display: 'flex', flexDirection: 'column'}}>
<div <div
style={{ style={{
maxHeight: '80px', maxHeight: '80px',
@@ -94,7 +95,7 @@ class HostList extends Component {
style={{ style={{
marginTop: 'var(--default_spacing)', marginTop: 'var(--default_spacing)',
}}> }}>
<FontAwesomeIcon icon={faPlusCircle} /> <FontAwesomeIcon icon={faPlusCircle}/>
<b>{' Add Portal '}</b> <b>{' Add Portal '}</b>
</a> </a>
</div> </div>
@@ -104,8 +105,8 @@ class HostList extends Component {
const mapDispatchToProps = (dispatch) => { const mapDispatchToProps = (dispatch) => {
return { return {
AddHost: (host_list, cb) => dispatch(addEditHostAction.display(true, cb, { host_list })), AddHost: (host_list, cb) => dispatch(addEditHostAction.display(true, cb, {host_list})),
ConfirmRemoveHost: (title, cb) => dispatch(confirmYesNoAction.display(true, cb, { title })), ConfirmRemoveHost: (title, cb) => dispatch(confirmYesNoAction.display(true, cb, {title})),
}; };
}; };

View File

@@ -1,5 +1,5 @@
import { Component } from 'react'; import {Component} from 'react';
import { getIPCRenderer } from '../../utils.jsx'; import {getIPCRenderer} from '../../utils.jsx';
const ipcRenderer = getIPCRenderer(); const ipcRenderer = getIPCRenderer();

View File

@@ -9,15 +9,15 @@ import PropTypes from 'prop-types';
import RootElem from '../../../components/UI/RootElem/RootElem'; import RootElem from '../../../components/UI/RootElem/RootElem';
import Text from '../../../components/UI/Text/Text'; import Text from '../../../components/UI/Text/Text';
import configureImage from '../../../assets/images/configure.png'; import configureImage from '../../../assets/images/configure.png';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
import { connect } from 'react-redux'; import {connect} from 'react-redux';
import { import {
displayConfiguration, displayConfiguration,
removeMount, removeMount,
setProviderState, setProviderState,
} from '../../../redux/actions/mount_actions'; } from '../../../redux/actions/mount_actions';
import { displaySkynetExport, displaySkynetImport } from '../../../redux/actions/skynet_actions'; import {displaySkynetExport, displaySkynetImport} from '../../../redux/actions/skynet_actions';
import { faTrashAlt } from '@fortawesome/free-solid-svg-icons'; import {faTrashAlt} from '@fortawesome/free-solid-svg-icons';
const MountItem = (props) => { const MountItem = (props) => {
const handleAutoMountChanged = (e) => { const handleAutoMountChanged = (e) => {
@@ -37,7 +37,7 @@ const MountItem = (props) => {
}; };
let secondRow = 6; let secondRow = 6;
const pointer = { cursor: props.MState.AllowMount ? 'pointer' : 'no-drop' }; const pointer = {cursor: props.MState.AllowMount ? 'pointer' : 'no-drop'};
const configButton = ( const configButton = (
<RootElem colSpan={4} rowSpan={6}> <RootElem colSpan={4} rowSpan={6}>
<img <img
@@ -51,7 +51,7 @@ const MountItem = (props) => {
} }
} }
src={configureImage} src={configureImage}
style={{ padding: 0, border: 0, margin: 0, ...pointer }} style={{padding: 0, border: 0, margin: 0, ...pointer}}
width={'16px'} width={'16px'}
/> />
</RootElem> </RootElem>
@@ -111,7 +111,7 @@ const MountItem = (props) => {
'Mount' '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 = ( const actionsDisplay = (
@@ -168,7 +168,7 @@ const MountItem = (props) => {
removeControl = ( removeControl = (
<RootElem col={(dimensions) => dimensions.columns - 6} row={secondRow + 3}> <RootElem col={(dimensions) => dimensions.columns - 6} row={secondRow + 3}>
<a href={'#'} onClick={handleRemoveMount} style={removeStyle}> <a href={'#'} onClick={handleRemoveMount} style={removeStyle}>
<FontAwesomeIcon icon={faTrashAlt} /> <FontAwesomeIcon icon={faTrashAlt}/>
</a> </a>
</RootElem> </RootElem>
); );
@@ -207,7 +207,7 @@ const MountItem = (props) => {
} }
} }
rowSpan={5} rowSpan={5}
style={{ ...pointer, fontWeight: 'normal' }}> style={{...pointer, fontWeight: 'normal'}}>
<u>Export</u> <u>Export</u>
</a> </a>
) : null} ) : null}
@@ -223,7 +223,7 @@ const MountItem = (props) => {
} }
} }
rowSpan={5} rowSpan={5}
style={{ ...pointer, fontWeight: 'normal' }}> style={{...pointer, fontWeight: 'normal'}}>
<u>Import</u> <u>Import</u>
</a> </a>
) : null} ) : null}

View File

@@ -6,8 +6,8 @@ import Button from '../../components/UI/Button/Button';
import IPCContainer from '../IPCContainer/IPCContainer'; import IPCContainer from '../IPCContainer/IPCContainer';
import Modal from '../../components/UI/Modal/Modal'; import Modal from '../../components/UI/Modal/Modal';
import MountItem from './MountItem/MountItem'; import MountItem from './MountItem/MountItem';
import { connect } from 'react-redux'; import {connect} from 'react-redux';
import { notifyError } from '../../redux/actions/error_actions'; import {notifyError} from '../../redux/actions/error_actions';
import { import {
resetMountsState, resetMountsState,
setAllowMount, setAllowMount,
@@ -164,7 +164,7 @@ class MountItems extends IPCContainer {
if (mount) { if (mount) {
let result = let result =
remote || s3 || provider === 'Skynet' remote || s3 || provider === 'Skynet'
? { Valid: true, Success: true } ? {Valid: true, Success: true}
: this.sendSyncRequest(Constants.IPC_Check_Daemon_Version, { : this.sendSyncRequest(Constants.IPC_Check_Daemon_Version, {
Provider: provider, Provider: provider,
Remote: remote, Remote: remote,
@@ -367,14 +367,14 @@ class MountItems extends IPCContainer {
); );
if (++retryCount < Object.keys(this.state.RetryItems).length) { if (++retryCount < Object.keys(this.state.RetryItems).length) {
retryList.push( retryList.push(
<div style={{ paddingTop: 'var(--default_spacing)' }} key={'rl_' + retryList.length} /> <div style={{paddingTop: 'var(--default_spacing)'}} key={'rl_' + retryList.length}/>
); );
} }
}); });
retryDisplay = ( retryDisplay = (
<Modal> <Modal>
<Box dxDark dxStyle={{ padding: 'var(--default_spacing)', minWidth: '70vw' }}> <Box dxDark dxStyle={{padding: 'var(--default_spacing)', minWidth: '70vw'}}>
<h1 <h1
style={{ style={{
textAlign: 'center', textAlign: 'center',
@@ -399,7 +399,7 @@ class MountItems extends IPCContainer {
/> />
); );
} else { } else {
footerItems.push(<div key={'hi_' + footerItems.length} style={{ height: '27px' }} />); footerItems.push(<div key={'hi_' + footerItems.length} style={{height: '27px'}}/>);
} }
const mountItems = []; const mountItems = [];
@@ -408,7 +408,7 @@ class MountItems extends IPCContainer {
mountItems.push( mountItems.push(
<div <div
key={'it_' + mountItems.length} 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 ( return (
<div style={{ margin: 0, padding: 0 }}> <div style={{margin: 0, padding: 0}}>
{retryDisplay} {retryDisplay}
<div <div
className={ className={
@@ -446,7 +446,7 @@ class MountItems extends IPCContainer {
}> }>
{mountItems} {mountItems}
</div> </div>
<div style={{ paddingTop: 'var(--default_spacing)' }} /> <div style={{paddingTop: 'var(--default_spacing)'}}/>
{footerItems} {footerItems}
</div> </div>
); );

View File

@@ -4,12 +4,12 @@ import Box from '../../components/UI/Box/Box';
import Button from '../../components/UI/Button/Button'; import Button from '../../components/UI/Button/Button';
import CheckBox from '../../components/UI/CheckBox/CheckBox'; import CheckBox from '../../components/UI/CheckBox/CheckBox';
import IPCContainer from '../IPCContainer/IPCContainer'; import IPCContainer from '../IPCContainer/IPCContainer';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
import { connect } from 'react-redux'; import {connect} from 'react-redux';
import { displayPinnedManager } from '../../redux/actions/pinned_manager_actions'; import {displayPinnedManager} from '../../redux/actions/pinned_manager_actions';
import { faFolder } from '@fortawesome/free-solid-svg-icons'; import {faFolder} from '@fortawesome/free-solid-svg-icons';
import { notifyApplicationBusy } from '../../redux/actions/common_actions'; import {notifyApplicationBusy} from '../../redux/actions/common_actions';
import { notifyError, notifyInfo } from '../../redux/actions/error_actions'; import {notifyError, notifyInfo} from '../../redux/actions/error_actions';
const Constants = require('../../constants'); const Constants = require('../../constants');
@@ -39,7 +39,7 @@ class PinnedManager extends IPCContainer {
}); });
}; };
onGetDirectoryItemsReply = (_, { data }) => { onGetDirectoryItemsReply = (_, {data}) => {
if (data.Success) { if (data.Success) {
const items = data.Items.filter( const items = data.Items.filter(
(i) => (i) =>
@@ -70,9 +70,9 @@ class PinnedManager extends IPCContainer {
style.marginBottom = '4px'; style.marginBottom = '4px';
} }
return ( return (
<div key={'dir_' + idx} style={{ ...style }}> <div key={'dir_' + idx} style={{...style}}>
<Button <Button
buttonStyles={{ textAlign: 'left' }} buttonStyles={{textAlign: 'left'}}
clicked={() => { clicked={() => {
const previous = [...this.state.previous]; const previous = [...this.state.previous];
if (path === '..') { if (path === '..') {
@@ -95,7 +95,7 @@ class PinnedManager extends IPCContainer {
icon={faFolder} icon={faFolder}
fixedWidth fixedWidth
color={'var(--heading_text_color)'} color={'var(--heading_text_color)'}
style={{ padding: 0, margin: 0 }} style={{padding: 0, margin: 0}}
/> />
&nbsp;{name} &nbsp;{name}
</Button> </Button>
@@ -104,12 +104,12 @@ class PinnedManager extends IPCContainer {
}; };
createFile = (name, path, pinned, idx, total, item_idx) => { createFile = (name, path, pinned, idx, total, item_idx) => {
const style = { textAlign: 'left' }; const style = {textAlign: 'left'};
if (item_idx + 1 !== total) { if (item_idx + 1 !== total) {
style.marginBottom = '2px'; style.marginBottom = '2px';
} }
return ( return (
<div key={'file_' + idx} style={{ ...style }}> <div key={'file_' + idx} style={{...style}}>
<CheckBox <CheckBox
checked={pinned} checked={pinned}
changed={() => { changed={() => {
@@ -153,11 +153,11 @@ class PinnedManager extends IPCContainer {
<a <a
href={'#'} href={'#'}
onClick={() => this.props.displayPinnedManager(false)} onClick={() => this.props.displayPinnedManager(false)}
style={{ cursor: 'pointer', flex: '0' }}> style={{cursor: 'pointer', flex: '0'}}>
X X
</a> </a>
</div> </div>
<h1 style={{ width: '100%', textAlign: 'center' }}>{'Pinned File Manager'}</h1> <h1 style={{width: '100%', textAlign: 'center'}}>{'Pinned File Manager'}</h1>
<div className={'PinnedManagerActiveDirectory'}> <div className={'PinnedManagerActiveDirectory'}>
<b>&nbsp;{this.state.active_directory}</b> <b>&nbsp;{this.state.active_directory}</b>
</div> </div>

View File

@@ -1,13 +1,13 @@
import React from 'react'; import React from 'react';
import './SkynetExport.css'; import './SkynetExport.css';
import CheckboxTree from 'react-checkbox-tree'; import CheckboxTree from 'react-checkbox-tree';
import { connect } from 'react-redux'; import {connect} from 'react-redux';
import IPCContainer from '../IPCContainer/IPCContainer'; import IPCContainer from '../IPCContainer/IPCContainer';
import { notifyApplicationBusy } from '../../redux/actions/common_actions'; import {notifyApplicationBusy} from '../../redux/actions/common_actions';
import { notifyError, notifyInfo } from '../../redux/actions/error_actions'; import {notifyError, notifyInfo} from '../../redux/actions/error_actions';
import Box from '../../components/UI/Box/Box'; import Box from '../../components/UI/Box/Box';
import { displaySkynetExport } from '../../redux/actions/skynet_actions'; import {displaySkynetExport} from '../../redux/actions/skynet_actions';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
import { import {
faCheckSquare, faCheckSquare,
faChevronDown, faChevronDown,
@@ -158,7 +158,7 @@ export default connect(
render() { render() {
return this.props.AppBusy ? ( return this.props.AppBusy ? (
<div /> <div/>
) : ( ) : (
<Box <Box
dxDark dxDark
@@ -179,7 +179,7 @@ export default connect(
<a <a
href={'#'} href={'#'}
onClick={() => this.props.displaySkynetExport(false)} onClick={() => this.props.displaySkynetExport(false)}
style={{ cursor: 'pointer' }}> style={{cursor: 'pointer'}}>
X X
</a> </a>
</div> </div>
@@ -214,45 +214,45 @@ export default connect(
<FontAwesomeIcon <FontAwesomeIcon
icon={faCheckSquare} icon={faCheckSquare}
fixedWidth fixedWidth
style={{ padding: 0, margin: 0 }} style={{padding: 0, margin: 0}}
/> />
), ),
uncheck: ( uncheck: (
<FontAwesomeIcon icon={faSquare} fixedWidth style={{ padding: 0, margin: 0 }} /> <FontAwesomeIcon icon={faSquare} fixedWidth style={{padding: 0, margin: 0}}/>
), ),
halfCheck: ( halfCheck: (
<FontAwesomeIcon <FontAwesomeIcon
icon={faHSquare} icon={faHSquare}
fixedWidth fixedWidth
style={{ padding: 0, margin: 0 }} style={{padding: 0, margin: 0}}
/> />
), ),
expandClose: ( expandClose: (
<FontAwesomeIcon <FontAwesomeIcon
icon={faChevronRight} icon={faChevronRight}
fixedWidth fixedWidth
style={{ padding: 0, margin: 0 }} style={{padding: 0, margin: 0}}
/> />
), ),
expandOpen: ( expandOpen: (
<FontAwesomeIcon <FontAwesomeIcon
icon={faChevronDown} icon={faChevronDown}
fixedWidth fixedWidth
style={{ padding: 0, margin: 0 }} style={{padding: 0, margin: 0}}
/> />
), ),
expandAll: ( expandAll: (
<FontAwesomeIcon <FontAwesomeIcon
icon={faPlusSquare} icon={faPlusSquare}
fixedWidth fixedWidth
style={{ padding: 0, margin: 0 }} style={{padding: 0, margin: 0}}
/> />
), ),
collapseAll: ( collapseAll: (
<FontAwesomeIcon <FontAwesomeIcon
icon={faMinusSquare} icon={faMinusSquare}
fixedWidth fixedWidth
style={{ padding: 0, margin: 0 }} style={{padding: 0, margin: 0}}
/> />
), ),
parentClose: ( parentClose: (
@@ -260,7 +260,7 @@ export default connect(
icon={faFolder} icon={faFolder}
fixedWidth fixedWidth
color={'var(--heading_text_color)'} color={'var(--heading_text_color)'}
style={{ padding: 0, margin: 0 }} style={{padding: 0, margin: 0}}
/> />
), ),
parentOpen: ( parentOpen: (
@@ -268,7 +268,7 @@ export default connect(
icon={faFolderOpen} icon={faFolderOpen}
fixedWidth fixedWidth
color={'var(--heading_text_color)'} color={'var(--heading_text_color)'}
style={{ padding: 0, margin: 0 }} style={{padding: 0, margin: 0}}
/> />
), ),
leaf: ( leaf: (
@@ -276,18 +276,18 @@ export default connect(
icon={faFile} icon={faFile}
fixedWidth fixedWidth
color={'var(--text_color)'} color={'var(--text_color)'}
style={{ padding: 0, margin: 0 }} style={{padding: 0, margin: 0}}
/> />
), ),
}} }}
nodes={this.state.nodes} nodes={this.state.nodes}
onClick={(clicked) => this.setState({ clicked })} onClick={(clicked) => this.setState({clicked})}
onCheck={(checked) => this.setState({ checked })} onCheck={(checked) => this.setState({checked})}
onExpand={(expanded) => this.setState({ expanded })} onExpand={(expanded) => this.setState({expanded})}
/> />
)} )}
</div> </div>
<div style={{ display: 'flex', justifyContent: 'flex-end' }}> <div style={{display: 'flex', justifyContent: 'flex-end'}}>
{this.state.second_stage ? ( {this.state.second_stage ? (
<Button <Button
buttonStyles={{ buttonStyles={{

View File

@@ -2,7 +2,7 @@ import React from 'react';
import './Import.css'; import './Import.css';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
const Import = ({ data }) => { const Import = ({data}) => {
return ( return (
<div className={'ImportOwner'}> <div className={'ImportOwner'}>
<input <input
@@ -18,7 +18,7 @@ const Import = ({ data }) => {
<input <input
readOnly readOnly
className={'ConfigurationItemInput'} className={'ConfigurationItemInput'}
style={{ maxWidth: 'calc(33.33% - calc(var(--default_spacing) / 2))' }} style={{maxWidth: 'calc(33.33% - calc(var(--default_spacing) / 2))'}}
type={'text'} type={'text'}
value={data.skylink} value={data.skylink}
/> />

View File

@@ -4,7 +4,7 @@ import Import from './Import/Import';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import Text from '../../../components/UI/Text/Text'; import Text from '../../../components/UI/Text/Text';
const ImportList = ({ imports_array }) => { const ImportList = ({imports_array}) => {
let key = 0; let key = 0;
return ( return (
<div> <div>
@@ -12,21 +12,21 @@ const ImportList = ({ imports_array }) => {
<Text <Text
type={'Heading1'} type={'Heading1'}
text={'Directory'} text={'Directory'}
style={{ minWidth: '33.33%', maxWidth: '33.33%' }} style={{minWidth: '33.33%', maxWidth: '33.33%'}}
/> />
<Text <Text
type={'Heading1'} type={'Heading1'}
text={'Skylink'} 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> </div>
<hr /> <hr/>
<div className={'ImportListOwner'}> <div className={'ImportListOwner'}>
{imports_array.map((data) => { {imports_array.map((data) => {
return ( return (
<div key={'import_' + key++}> <div key={'import_' + key++}>
<Import data={data} /> <Import data={data}/>
</div> </div>
); );
})} })}

View File

@@ -1,14 +1,14 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux'; import {connect} from 'react-redux';
import './SkynetImport.css'; import './SkynetImport.css';
import Box from '../../components/UI/Box/Box'; import Box from '../../components/UI/Box/Box';
import Button from '../../components/UI/Button/Button'; 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 ImportList from './ImportList/ImportList';
import IPCContainer from '../IPCContainer/IPCContainer'; import IPCContainer from '../IPCContainer/IPCContainer';
import { notifyApplicationBusy } from '../../redux/actions/common_actions'; import {notifyApplicationBusy} from '../../redux/actions/common_actions';
import { notifyError, notifyInfo } from '../../redux/actions/error_actions'; import {notifyError, notifyInfo} from '../../redux/actions/error_actions';
import { promptLocationAndReadFile } from '../../utils'; import {promptLocationAndReadFile} from '../../utils';
const Constants = require('../../constants'); const Constants = require('../../constants');
@@ -79,7 +79,7 @@ export default connect(
handleLoadFile = () => { handleLoadFile = () => {
const data = promptLocationAndReadFile(this.props.notifyError); const data = promptLocationAndReadFile(this.props.notifyError);
if (data) { if (data) {
this.setState({ import_text: data }); this.setState({import_text: data});
} }
}; };
@@ -176,7 +176,7 @@ export default connect(
render() { render() {
return this.props.AppBusy ? ( return this.props.AppBusy ? (
<div /> <div/>
) : ( ) : (
<Box <Box
dxDark dxDark
@@ -197,7 +197,7 @@ export default connect(
<a <a
href={'#'} href={'#'}
onClick={() => this.props.displaySkynetImport(false)} onClick={() => this.props.displaySkynetImport(false)}
style={{ cursor: 'pointer' }}> style={{cursor: 'pointer'}}>
X X
</a> </a>
</div> </div>
@@ -205,7 +205,7 @@ export default connect(
{this.state.second_stage ? 'Verify Imports' : 'Import List'} {this.state.second_stage ? 'Verify Imports' : 'Import List'}
</h1> </h1>
{this.state.second_stage ? ( {this.state.second_stage ? (
<ImportList imports_array={this.state.imports_array} /> <ImportList imports_array={this.state.imports_array}/>
) : ( ) : (
<textarea <textarea
autoFocus={true} autoFocus={true}

View File

@@ -1,8 +1,8 @@
import React, { Component } from 'react'; import React, {Component} from 'react';
import './Password.css'; import './Password.css';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
import { faEye, faEyeSlash } from '@fortawesome/free-solid-svg-icons'; import {faEye, faEyeSlash} from '@fortawesome/free-solid-svg-icons';
class Password extends Component { class Password extends Component {
state = { state = {
@@ -115,7 +115,7 @@ class Password extends Component {
render() { render() {
return ( return (
<div className={'PasswordOwner'} style={{ ...this.props.style }}> <div className={'PasswordOwner'} style={{...this.props.style}}>
{this.props.readOnly ? null : ( {this.props.readOnly ? null : (
<a href={'#'} className={'PasswordLink'} onClick={this.handleActionClick}> <a href={'#'} className={'PasswordLink'} onClick={this.handleActionClick}>
<u>{this.state.button_text}</u> <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} value={this.state.button_text === 'confirm' ? this.state.password2 : this.state.password}
/> />
<a href={'#'} className={'PasswordShowHide'} onClick={this.handleShowHideClick}> <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> </a>
</div> </div>
); );

View File

@@ -317,7 +317,7 @@ module.exports.cleanupOldReleases = (versionList) => {
if (versionList && versionList.length > 0) { if (versionList && versionList.length > 0) {
const dataDir = _getDataDirectory(); const dataDir = _getDataDirectory();
const directoryList = fs const directoryList = fs
.readdirSync(dataDir, { withFileTypes: true }) .readdirSync(dataDir, {withFileTypes: true})
.filter((dirent) => dirent.isDirectory()) .filter((dirent) => dirent.isDirectory())
.map((dirent) => dirent); .map((dirent) => dirent);
@@ -823,7 +823,7 @@ module.exports.getMissingDependencies = (dependencies) => {
} }
const key = dep.registry[index].substr(hiveName.length); const key = dep.registry[index].substr(hiveName.length);
const regKey = new Registry({ hive: hive, key: key }); const regKey = new Registry({hive: hive, key: key});
regKey.valueExists('DisplayName', (err, exists) => { regKey.valueExists('DisplayName', (err, exists) => {
if (err || !exists) { if (err || !exists) {
regKey.valueExists('ProductName', (err, exists) => { regKey.valueExists('ProductName', (err, exists) => {
@@ -1002,7 +1002,7 @@ module.exports.importSkylinks = (version, jsonArray) => {
}; };
// https://stackoverflow.com/questions/31645738/how-to-create-full-path-with-nodes-fs-mkdirsync // https://stackoverflow.com/questions/31645738/how-to-create-full-path-with-nodes-fs-mkdirsync
module.exports.mkDirByPathSync = (targetDir, { isRelativeToScript = false } = {}) => { module.exports.mkDirByPathSync = (targetDir, {isRelativeToScript = false} = {}) => {
const sep = path.sep; const sep = path.sep;
const initDir = path.isAbsolute(targetDir) ? sep : ''; const initDir = path.isAbsolute(targetDir) ? sep : '';
const baseDir = isRelativeToScript ? __dirname : '.'; const baseDir = isRelativeToScript ? __dirname : '.';

View File

@@ -45,7 +45,7 @@ test('create temp signature files', () => {
.replace(/(\r\n|\n|\r)/gm, ''); .replace(/(\r\n|\n|\r)/gm, '');
expect(b64signature2).toEqual(b64signature); expect(b64signature2).toEqual(b64signature);
expect(fs.readFileSync(data.PublicKeyFile, { encoding: 'utf8' })).toEqual( expect(fs.readFileSync(data.PublicKeyFile, {encoding: 'utf8'})).toEqual(
Constants.DEV_PUBLIC_KEY Constants.DEV_PUBLIC_KEY
); );
fs.unlinkSync(data.PublicKeyFile); fs.unlinkSync(data.PublicKeyFile);

View File

@@ -3,16 +3,16 @@ import 'react-checkbox-tree/lib/react-checkbox-tree.css';
import React from 'react'; import React from 'react';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
import { Provider } from 'react-redux'; import {Provider} from 'react-redux';
import packageJson from '../package.json'; import packageJson from '../package.json';
import App from './App.jsx'; import App from './App.jsx';
import { setProviderState } from './redux/actions/mount_actions'; import {setProviderState} from './redux/actions/mount_actions';
import { setActiveRelease } from './redux/actions/release_version_actions'; import {setActiveRelease} from './redux/actions/release_version_actions';
import createAppStore from './redux/store/createAppStore'; import createAppStore from './redux/store/createAppStore';
import * as serviceWorker from './serviceWorker'; import * as serviceWorker from './serviceWorker';
import { getIPCRenderer } from './utils.jsx'; import {getIPCRenderer} from './utils.jsx';
const Constants = require('./constants'); const Constants = require('./constants');
@@ -51,7 +51,7 @@ if (ipcRenderer) {
ReactDOM.render( ReactDOM.render(
<Provider store={store}> <Provider store={store}>
<App /> <App/>
</Provider>, </Provider>,
document.getElementById('root') document.getElementById('root')
); );

View File

@@ -1,10 +1,10 @@
import { createAction } from '@reduxjs/toolkit'; import {createAction} from '@reduxjs/toolkit';
import { createResponseDialogAction } from '../utils'; import {createResponseDialogAction} from '../utils';
export const confirmYesNoAction = createResponseDialogAction('common', 'confirmYesNo'); export const confirmYesNoAction = createResponseDialogAction('common', 'confirmYesNo');
import * as Constants from '../../constants'; import * as Constants from '../../constants';
import { getIPCRenderer } from '../../utils.jsx'; import {getIPCRenderer} from '../../utils.jsx';
const ipcRenderer = getIPCRenderer(); const ipcRenderer = getIPCRenderer();
@@ -12,7 +12,7 @@ export const NOTIFY_APPLICATION_BUSY = 'common/notifyApplicationBusy';
export const notifyApplicationBusy = (busy, transparent) => { export const notifyApplicationBusy = (busy, transparent) => {
return { return {
type: NOTIFY_APPLICATION_BUSY, type: NOTIFY_APPLICATION_BUSY,
payload: { busy, transparent }, payload: {busy, transparent},
}; };
}; };
@@ -48,7 +48,7 @@ export const saveState = () => {
} }
if (ipcRenderer) { if (ipcRenderer) {
ipcRenderer.send(Constants.IPC_Save_State, { State: currentState }); ipcRenderer.send(Constants.IPC_Save_State, {State: currentState});
} }
} }
}; };

View File

@@ -1,16 +1,16 @@
import { createAction } from '@reduxjs/toolkit'; import {createAction} from '@reduxjs/toolkit';
import * as Constants from '../../constants'; import * as Constants from '../../constants';
import { getIPCRenderer } from '../../utils.jsx'; import {getIPCRenderer} from '../../utils.jsx';
import { notifyError } from './error_actions'; import {notifyError} from './error_actions';
import { installDependency, installRelease, installUpgrade } from './install_actions'; import {installDependency, installRelease, installUpgrade} from './install_actions';
export const setAllowDownload = createAction('download/setAllowDownload'); export const setAllowDownload = createAction('download/setAllowDownload');
export const SET_DOWNLOAD_BEGIN = 'download/setDownloadBegin'; export const SET_DOWNLOAD_BEGIN = 'download/setDownloadBegin';
export const setDownloadBegin = (name, type, url) => { export const setDownloadBegin = (name, type, url) => {
return { type: SET_DOWNLOAD_BEGIN, payload: { name, type, url } }; return {type: SET_DOWNLOAD_BEGIN, payload: {name, type, url}};
}; };
export const setDownloadEnd = createAction('download/setDownloadEnd'); export const setDownloadEnd = createAction('download/setDownloadEnd');

View File

@@ -1,4 +1,4 @@
import { showWindow, shutdownApplication } from './common_actions'; import {showWindow, shutdownApplication} from './common_actions';
let ErrorActions = []; let ErrorActions = [];
@@ -57,13 +57,13 @@ export const notifyInfo = (title, msg, saveToFile, fileName, extension) => {
export const SET_ERROR_INFO = 'error/setErrorInfo'; export const SET_ERROR_INFO = 'error/setErrorInfo';
export const setErrorInfo = (msg, critical) => { export const setErrorInfo = (msg, critical) => {
return { type: SET_ERROR_INFO, payload: { msg, critical } }; return {type: SET_ERROR_INFO, payload: {msg, critical}};
}; };
export const SET_INFO = 'error/setInfo'; export const SET_INFO = 'error/setInfo';
export const setInfo = (title, msg, saveToFile, fileName, extension) => { export const setInfo = (title, msg, saveToFile, fileName, extension) => {
return { return {
type: SET_INFO, type: SET_INFO,
payload: { title, msg, saveToFile, fileName, extension }, payload: {title, msg, saveToFile, fileName, extension},
}; };
}; };

View File

@@ -1,3 +1,3 @@
import { createResponseDialogAction } from '../utils'; import {createResponseDialogAction} from '../utils';
export const addEditHostAction = createResponseDialogAction('host', 'displayAddEditHost'); export const addEditHostAction = createResponseDialogAction('host', 'displayAddEditHost');

View File

@@ -1,7 +1,7 @@
import { createAction } from '@reduxjs/toolkit'; import {createAction} from '@reduxjs/toolkit';
import * as Constants from '../../constants'; import * as Constants from '../../constants';
import { getIPCRenderer, getSelectedVersionFromState } from '../../utils.jsx'; import {getIPCRenderer, getSelectedVersionFromState} from '../../utils.jsx';
import { import {
confirmYesNoAction, confirmYesNoAction,
@@ -11,9 +11,9 @@ import {
showWindow, showWindow,
shutdownApplication, shutdownApplication,
} from './common_actions'; } from './common_actions';
import { downloadItem, setAllowDownload } from './download_actions'; import {downloadItem, setAllowDownload} from './download_actions';
import { notifyError } from './error_actions'; import {notifyError} from './error_actions';
import { unmountAll } from './mount_actions'; import {unmountAll} from './mount_actions';
import { import {
setActiveRelease, setActiveRelease,
setInstalledVersion, setInstalledVersion,
@@ -166,8 +166,8 @@ export const installReleaseByVersion = (release, version) => {
}; };
if (getState().mounts.MountsBusy) { if (getState().mounts.MountsBusy) {
dispatch(confirmYesNoAction.display(true, null, { title: 'Unmount all drives?' })) dispatch(confirmYesNoAction.display(true, null, {title: 'Unmount all drives?'}))
.then(({ changed }) => { .then(({changed}) => {
if (changed) { if (changed) {
dispatch(unmountAll(install)); dispatch(unmountAll(install));
} }

View File

@@ -1,10 +1,10 @@
import { createAction } from '@reduxjs/toolkit'; import {createAction} from '@reduxjs/toolkit';
import * as Constants from '../../constants'; import * as Constants from '../../constants';
import { getIPCRenderer } from '../../utils.jsx'; import {getIPCRenderer} from '../../utils.jsx';
import { confirmYesNoAction, saveState } from './common_actions'; import {confirmYesNoAction, saveState} from './common_actions';
import { notifyError } from './error_actions'; import {notifyError} from './error_actions';
export const addRemoteMount = (hostNameOrIp, port, token) => { export const addRemoteMount = (hostNameOrIp, port, token) => {
return (dispatch, getState) => { return (dispatch, getState) => {
@@ -30,10 +30,10 @@ export const addRemoteMount = (hostNameOrIp, port, token) => {
ipcRenderer.send(Constants.IPC_Set_Config_Values, { ipcRenderer.send(Constants.IPC_Set_Config_Values, {
Items: [ Items: [
{ Name: 'RemoteMount.RemoteHostNameOrIp', Value: hostNameOrIp }, {Name: 'RemoteMount.RemoteHostNameOrIp', Value: hostNameOrIp},
{ Name: 'RemoteMount.RemoteToken', Value: token }, {Name: 'RemoteMount.RemoteToken', Value: token},
{ Name: 'RemoteMount.RemotePort', Value: port.toString() }, {Name: 'RemoteMount.RemotePort', Value: port.toString()},
{ Name: 'RemoteMount.IsRemoteMount', Value: 'true' }, {Name: 'RemoteMount.IsRemoteMount', Value: 'true'},
], ],
Provider: provider, Provider: provider,
Remote: true, Remote: true,
@@ -65,11 +65,11 @@ export const addS3Mount = (name, accessKey, secretKey, region, bucketName, url)
ipcRenderer.send(Constants.IPC_Set_Config_Values, { ipcRenderer.send(Constants.IPC_Set_Config_Values, {
Items: [ Items: [
{ Name: 'S3Config.AccessKey', Value: accessKey }, {Name: 'S3Config.AccessKey', Value: accessKey},
{ Name: 'S3Config.SecretKey', Value: secretKey }, {Name: 'S3Config.SecretKey', Value: secretKey},
{ Name: 'S3Config.Region', Value: region }, {Name: 'S3Config.Region', Value: region},
{ Name: 'S3Config.BucketName', Value: bucketName }, {Name: 'S3Config.BucketName', Value: bucketName},
{ Name: 'S3Config.URL', Value: url }, {Name: 'S3Config.URL', Value: url},
], ],
Provider: provider, Provider: provider,
S3: true, S3: true,
@@ -100,7 +100,7 @@ export const removeMount = (provider) => {
confirmYesNoAction.display(true, null, { confirmYesNoAction.display(true, null, {
title: 'Delete [' + provider.substr(isRemote ? 6 : 2) + ']?', title: 'Delete [' + provider.substr(isRemote ? 6 : 2) + ']?',
}) })
).then(({ changed }) => { ).then(({changed}) => {
if (changed) { if (changed) {
dispatch(removeMount2(provider)); dispatch(removeMount2(provider));
} }
@@ -129,34 +129,34 @@ export const removeMount3 = createAction('mounts/removeMount3');
export const RESET_MOUNTS_STATE = 'mounts/resetMountsState'; export const RESET_MOUNTS_STATE = 'mounts/resetMountsState';
export const resetMountsState = () => { export const resetMountsState = () => {
return { type: RESET_MOUNTS_STATE, payload: null }; return {type: RESET_MOUNTS_STATE, payload: null};
}; };
export const SET_ALLOW_MOUNT = 'mounts/setAllowMount'; export const SET_ALLOW_MOUNT = 'mounts/setAllowMount';
export const setAllowMount = (provider, allow) => { export const setAllowMount = (provider, allow) => {
return { type: SET_ALLOW_MOUNT, payload: { provider, allow } }; return {type: SET_ALLOW_MOUNT, payload: {provider, allow}};
}; };
export const SET_AUTO_MOUNT_PROCESSED = 'mounts/setAutoMountProcessed'; export const SET_AUTO_MOUNT_PROCESSED = 'mounts/setAutoMountProcessed';
export const setAutoMountProcessed = (provider, processed) => { export const setAutoMountProcessed = (provider, processed) => {
return { type: SET_AUTO_MOUNT_PROCESSED, payload: { provider, processed } }; return {type: SET_AUTO_MOUNT_PROCESSED, payload: {provider, processed}};
}; };
export const setBusy = createAction('mounts/setBusy'); export const setBusy = createAction('mounts/setBusy');
export const SET_MOUNT_STATE = 'mounts/setMountState'; export const SET_MOUNT_STATE = 'mounts/setMountState';
export const setMountState = (provider, state) => { export const setMountState = (provider, state) => {
return { type: SET_MOUNT_STATE, payload: { provider, state } }; return {type: SET_MOUNT_STATE, payload: {provider, state}};
}; };
export const SET_MOUNTED = 'mounts/setMounted'; export const SET_MOUNTED = 'mounts/setMounted';
export const setMounted = (provider, mounted) => { export const setMounted = (provider, mounted) => {
return { type: SET_MOUNTED, payload: { provider, mounted } }; return {type: SET_MOUNTED, payload: {provider, mounted}};
}; };
export const SET_PROVIDER_STATE = 'mounts/setProviderState'; export const SET_PROVIDER_STATE = 'mounts/setProviderState';
export const setProviderState = (provider, state) => { export const setProviderState = (provider, state) => {
return { type: SET_PROVIDER_STATE, payload: { provider, state } }; return {type: SET_PROVIDER_STATE, payload: {provider, state}};
}; };
export const unmountAll = (completedCallback) => { export const unmountAll = (completedCallback) => {

View File

@@ -1,3 +1,3 @@
import { createAction } from '@reduxjs/toolkit'; import {createAction} from '@reduxjs/toolkit';
export const displayPinnedManager = createAction('pinned/displayPinnedManager'); export const displayPinnedManager = createAction('pinned/displayPinnedManager');

View File

@@ -1,4 +1,4 @@
import { createAction } from '@reduxjs/toolkit'; import {createAction} from '@reduxjs/toolkit';
import axios from 'axios'; import axios from 'axios';
import * as Constants from '../../constants'; import * as Constants from '../../constants';
@@ -9,10 +9,10 @@ import {
getSelectedVersionFromState, getSelectedVersionFromState,
} from '../../utils.jsx'; } from '../../utils.jsx';
import { saveState, setAllowMount, setApplicationReady, showWindow } from './common_actions'; import {saveState, setAllowMount, setApplicationReady, showWindow} from './common_actions';
import { notifyError } from './error_actions'; import {notifyError} from './error_actions';
import { checkVersionInstalled, setDismissDependencies } from './install_actions'; import {checkVersionInstalled, setDismissDependencies} from './install_actions';
import { unmountAll } from './mount_actions'; import {unmountAll} from './mount_actions';
export const CLEAR_UI_UPGRADE = 'relver/clearUIUpgrade'; export const CLEAR_UI_UPGRADE = 'relver/clearUIUpgrade';
export const clearUIUpgrade = () => { export const clearUIUpgrade = () => {
@@ -183,7 +183,7 @@ export const NOTIFY_ACTIVE_RELEASE = 'relver/notifyActiveRelease';
export const notifyActiveRelease = (release, version) => { export const notifyActiveRelease = (release, version) => {
return { return {
type: NOTIFY_ACTIVE_RELEASE, type: NOTIFY_ACTIVE_RELEASE,
payload: { release: release, version: version }, payload: {release: release, version: version},
}; };
}; };

View File

@@ -1,4 +1,4 @@
import { createAction } from '@reduxjs/toolkit'; import {createAction} from '@reduxjs/toolkit';
export const displaySkynetExport = createAction('skynet/displaySkynetExport'); export const displaySkynetExport = createAction('skynet/displaySkynetExport');
export const displaySkynetImport = createAction('skynet/displaySkynetImport'); export const displaySkynetImport = createAction('skynet/displaySkynetImport');

View File

@@ -1,4 +1,4 @@
import { createReducer } from '@reduxjs/toolkit'; import {createReducer} from '@reduxjs/toolkit';
import { import {
confirmYesNoAction, confirmYesNoAction,
NOTIFY_APPLICATION_BUSY, NOTIFY_APPLICATION_BUSY,
@@ -31,7 +31,7 @@ export const createCommonReducer = (platformInfo, version) => {
}; };
}, },
[setAllowMount]: (state, action) => { [setAllowMount]: (state, action) => {
return { ...state, AllowMount: action.payload }; return {...state, AllowMount: action.payload};
}, },
[setApplicationReady]: (state, action) => { [setApplicationReady]: (state, action) => {
return { return {

View File

@@ -1,4 +1,4 @@
import { createReducer } from '@reduxjs/toolkit'; import {createReducer} from '@reduxjs/toolkit';
import { import {
SET_DOWNLOAD_BEGIN, SET_DOWNLOAD_BEGIN,
@@ -48,7 +48,7 @@ export const downloadReducer = createReducer(
}; };
}, },
[setDownloadProgress]: (state, action) => { [setDownloadProgress]: (state, action) => {
return { ...state, DownloadProgress: action.payload }; return {...state, DownloadProgress: action.payload};
}, },
} }
); );

View File

@@ -1,5 +1,5 @@
import { createReducer } from '@reduxjs/toolkit'; import {createReducer} from '@reduxjs/toolkit';
import { CLEAR_ERROR, CLEAR_INFO, SET_ERROR_INFO, SET_INFO } from '../actions/error_actions'; import {CLEAR_ERROR, CLEAR_INFO, SET_ERROR_INFO, SET_INFO} from '../actions/error_actions';
export const errorReducer = createReducer( export const errorReducer = createReducer(
{ {
@@ -46,7 +46,7 @@ export const errorReducer = createReducer(
}, },
...state.InfoStack, ...state.InfoStack,
]; ];
return { ...state, DisplayInfo: true, InfoStack: infoStack }; return {...state, DisplayInfo: true, InfoStack: infoStack};
}, },
} }
); );

View File

@@ -1,5 +1,5 @@
import { createReducer } from '@reduxjs/toolkit'; import {createReducer} from '@reduxjs/toolkit';
import { addEditHostAction } from '../actions/host_actions'; import {addEditHostAction} from '../actions/host_actions';
export const hostReducer = createReducer( export const hostReducer = createReducer(
{ {

View File

@@ -1,4 +1,4 @@
import { createReducer } from '@reduxjs/toolkit'; import {createReducer} from '@reduxjs/toolkit';
import { import {
setAutoInstallRelease, setAutoInstallRelease,
setDismissDependencies, setDismissDependencies,
@@ -20,10 +20,10 @@ export const installReducer = createReducer(
}, },
{ {
[setAutoInstallRelease]: (state, action) => { [setAutoInstallRelease]: (state, action) => {
return { ...state, AutoInstallRelease: action.payload }; return {...state, AutoInstallRelease: action.payload};
}, },
[setDismissDependencies]: (state, action) => { [setDismissDependencies]: (state, action) => {
return { ...state, DismissDependencies: action.payload }; return {...state, DismissDependencies: action.payload};
}, },
[setInstallActive]: (state, action) => { [setInstallActive]: (state, action) => {
return { return {
@@ -42,10 +42,10 @@ export const installReducer = createReducer(
}; };
}, },
[setInstallTestActive]: (state, action) => { [setInstallTestActive]: (state, action) => {
return { ...state, InstallTestActive: action.payload }; return {...state, InstallTestActive: action.payload};
}, },
[setMissingDependencies]: (state, action) => { [setMissingDependencies]: (state, action) => {
return { ...state, MissingDependencies: action.payload }; return {...state, MissingDependencies: action.payload};
}, },
} }
); );

View File

@@ -1,4 +1,4 @@
import { createReducer } from '@reduxjs/toolkit'; import {createReducer} from '@reduxjs/toolkit';
import * as Constants from '../../constants'; import * as Constants from '../../constants';
import { import {
@@ -32,7 +32,7 @@ export const createMountReducer = (state) => {
}; };
}) })
.reduce((map, obj) => { .reduce((map, obj) => {
return { ...map, ...obj }; return {...map, ...obj};
}); });
const mountState = providerList const mountState = providerList
@@ -46,15 +46,15 @@ export const createMountReducer = (state) => {
}; };
}) })
.reduce((map, obj) => { .reduce((map, obj) => {
return { ...map, ...obj }; return {...map, ...obj};
}); });
const autoMountProcessed = providerList const autoMountProcessed = providerList
.map((provider) => { .map((provider) => {
return { [provider]: false }; return {[provider]: false};
}) })
.reduce((map, obj) => { .reduce((map, obj) => {
return { ...map, ...obj }; return {...map, ...obj};
}); });
return createReducer( return createReducer(
@@ -71,21 +71,21 @@ export const createMountReducer = (state) => {
}, },
{ {
[addRemoteMount2]: (state, action) => { [addRemoteMount2]: (state, action) => {
let mountState = { ...state.MountState }; let mountState = {...state.MountState};
mountState[action.payload] = { mountState[action.payload] = {
AllowMount: false, AllowMount: false,
DriveLetters: [], DriveLetters: [],
Mounted: false, Mounted: false,
}; };
let providerState = { ...state.ProviderState }; let providerState = {...state.ProviderState};
providerState[action.payload] = { providerState[action.payload] = {
AutoMount: false, AutoMount: false,
AutoRestart: false, AutoRestart: false,
MountLocation: '', MountLocation: '',
}; };
let autoMountProcessed = { ...state.AutoMountProcessed }; let autoMountProcessed = {...state.AutoMountProcessed};
autoMountProcessed[action.payload] = true; autoMountProcessed[action.payload] = true;
return { return {
@@ -97,21 +97,21 @@ export const createMountReducer = (state) => {
}; };
}, },
[addS3Mount2]: (state, action) => { [addS3Mount2]: (state, action) => {
let mountState = { ...state.MountState }; let mountState = {...state.MountState};
mountState[action.payload] = { mountState[action.payload] = {
AllowMount: false, AllowMount: false,
DriveLetters: [], DriveLetters: [],
Mounted: false, Mounted: false,
}; };
let providerState = { ...state.ProviderState }; let providerState = {...state.ProviderState};
providerState[action.payload] = { providerState[action.payload] = {
AutoMount: false, AutoMount: false,
AutoRestart: false, AutoRestart: false,
MountLocation: '', MountLocation: '',
}; };
let autoMountProcessed = { ...state.AutoMountProcessed }; let autoMountProcessed = {...state.AutoMountProcessed};
autoMountProcessed[action.payload] = true; autoMountProcessed[action.payload] = true;
return { return {
@@ -131,13 +131,13 @@ export const createMountReducer = (state) => {
}; };
}, },
[removeMount3]: (state, action) => { [removeMount3]: (state, action) => {
let mountState = { ...state.MountState }; let mountState = {...state.MountState};
delete mountState[action.payload]; delete mountState[action.payload];
let providerState = { ...state.ProviderState }; let providerState = {...state.ProviderState};
delete providerState[action.payload]; delete providerState[action.payload];
let autoMountProcessed = { ...state.AutoMountProcessed }; let autoMountProcessed = {...state.AutoMountProcessed};
delete autoMountProcessed[action.payload]; delete autoMountProcessed[action.payload];
const remoteMounts = state.RemoteMounts.filter((i) => i !== action.payload); const remoteMounts = state.RemoteMounts.filter((i) => i !== action.payload);
@@ -152,7 +152,7 @@ export const createMountReducer = (state) => {
}; };
}, },
[RESET_MOUNTS_STATE]: (state) => { [RESET_MOUNTS_STATE]: (state) => {
return { ...state, MountsBusy: false, MountState: mountState }; return {...state, MountsBusy: false, MountState: mountState};
}, },
[SET_AUTO_MOUNT_PROCESSED]: (state, action) => { [SET_AUTO_MOUNT_PROCESSED]: (state, action) => {
return { return {
@@ -176,7 +176,7 @@ export const createMountReducer = (state) => {
}; };
}, },
[setBusy]: (state, action) => { [setBusy]: (state, action) => {
return { ...state, MountsBusy: action.payload }; return {...state, MountsBusy: action.payload};
}, },
[SET_MOUNT_STATE]: (state, action) => { [SET_MOUNT_STATE]: (state, action) => {
return { return {

View File

@@ -1,5 +1,5 @@
import { createReducer } from '@reduxjs/toolkit'; import {createReducer} from '@reduxjs/toolkit';
import { displayPinnedManager } from '../actions/pinned_manager_actions'; import {displayPinnedManager} from '../actions/pinned_manager_actions';
export const pinnedManagerReducer = createReducer( export const pinnedManagerReducer = createReducer(
{ {

View File

@@ -1,10 +1,10 @@
import { createReducer } from '@reduxjs/toolkit'; import {createReducer} from '@reduxjs/toolkit';
import * as Constants from '../../constants'; import * as Constants from '../../constants';
import * as Actions from '../actions/release_version_actions'; import * as Actions from '../actions/release_version_actions';
const versionLookup = Constants.RELEASE_TYPES.map((k) => { const versionLookup = Constants.RELEASE_TYPES.map((k) => {
return { [k]: ['unavailable'] }; return {[k]: ['unavailable']};
}).reduce((map, obj) => { }).reduce((map, obj) => {
return { return {
...map, ...map,
@@ -65,7 +65,7 @@ export const releaseVersionReducer = createReducer(
}; };
}, },
[Actions.setInstalledVersion]: (state, action) => { [Actions.setInstalledVersion]: (state, action) => {
return { ...state, InstalledVersion: action.payload }; return {...state, InstalledVersion: action.payload};
}, },
[Actions.setNewReleasesAvailable]: (state, action) => { [Actions.setNewReleasesAvailable]: (state, action) => {
return { return {

View File

@@ -1,4 +1,4 @@
import { createReducer } from '@reduxjs/toolkit'; import {createReducer} from '@reduxjs/toolkit';
import * as Actions from '../actions/skynet_actions'; import * as Actions from '../actions/skynet_actions';
export const skynetReducer = createReducer( export const skynetReducer = createReducer(
@@ -8,10 +8,10 @@ export const skynetReducer = createReducer(
}, },
{ {
[Actions.displaySkynetExport]: (state, action) => { [Actions.displaySkynetExport]: (state, action) => {
return { ...state, DisplayExport: action.payload }; return {...state, DisplayExport: action.payload};
}, },
[Actions.displaySkynetImport]: (state, action) => { [Actions.displaySkynetImport]: (state, action) => {
return { ...state, DisplayImport: action.payload }; return {...state, DisplayImport: action.payload};
}, },
} }
); );

View File

@@ -1,14 +1,14 @@
import { configureStore, getDefaultMiddleware } from '@reduxjs/toolkit'; import {configureStore, getDefaultMiddleware} from '@reduxjs/toolkit';
import { createCommonReducer } from '../reducers/common_reducer'; import {createCommonReducer} from '../reducers/common_reducer';
import { downloadReducer } from '../reducers/download_reducer'; import {downloadReducer} from '../reducers/download_reducer';
import { errorReducer } from '../reducers/error_reducer'; import {errorReducer} from '../reducers/error_reducer';
import { installReducer } from '../reducers/install_reducer'; import {installReducer} from '../reducers/install_reducer';
import { createMountReducer } from '../reducers/mount_reducer'; import {createMountReducer} from '../reducers/mount_reducer';
import { pinnedManagerReducer } from '../reducers/pinned_manager_reducer'; import {pinnedManagerReducer} from '../reducers/pinned_manager_reducer';
import { releaseVersionReducer } from '../reducers/release_version_reducer'; import {releaseVersionReducer} from '../reducers/release_version_reducer';
import { skynetReducer } from '../reducers/skynet_reducer'; import {skynetReducer} from '../reducers/skynet_reducer';
import { hostReducer } from '../reducers/host_reducer'; import {hostReducer} from '../reducers/host_reducer';
export default function createAppStore(platformInfo, version, state) { export default function createAppStore(platformInfo, version, state) {
const reducer = { const reducer = {

View File

@@ -4,7 +4,7 @@ export const createResponseDialogAction = (type, name) => {
const display = (show, cb, data) => { const display = (show, cb, data) => {
return (dispatch) => { return (dispatch) => {
if (cb) { if (cb) {
dispatch(display(show, null, data)).then(({ changed, data }) => cb(changed, data)); dispatch(display(show, null, data)).then(({changed, data}) => cb(changed, data));
} else { } else {
return new Promise((resolve) => { return new Promise((resolve) => {
dispatch(handleDisplay(show, data, resolve)); dispatch(handleDisplay(show, data, resolve));
@@ -27,7 +27,7 @@ export const createResponseDialogAction = (type, name) => {
const complete = (changed, data) => { const complete = (changed, data) => {
return (dispatch) => { return (dispatch) => {
if (changed) { if (changed) {
resolverList[0]({ changed, data }); resolverList[0]({changed, data});
} }
resolverList.splice(0, 1); resolverList.splice(0, 1);
dispatch(displayAction(false)); dispatch(displayAction(false));
@@ -36,7 +36,7 @@ export const createResponseDialogAction = (type, name) => {
const DISPLAY_ACTION = type + '/' + name; const DISPLAY_ACTION = type + '/' + name;
const displayAction = (display, data) => { const displayAction = (display, data) => {
return { type: DISPLAY_ACTION, payload: { display, data } }; return {type: DISPLAY_ACTION, payload: {display, data}};
}; };
return { return {

View File

@@ -1,6 +1,6 @@
const Constants = require('../../constants'); const Constants = require('../../constants');
const addListeners = (ipcMain, { closeApplication, setWindowVisibility }) => { const addListeners = (ipcMain, {closeApplication, setWindowVisibility}) => {
ipcMain.on(Constants.IPC_Shutdown, () => { ipcMain.on(Constants.IPC_Shutdown, () => {
closeApplication(); closeApplication();
}); });
@@ -15,4 +15,4 @@ const addListeners = (ipcMain, { closeApplication, setWindowVisibility }) => {
}); });
}; };
module.exports = { addListeners }; module.exports = {addListeners};

View File

@@ -1,7 +1,7 @@
const Constants = require('../../constants'); const Constants = require('../../constants');
const helpers = require('../../helpers'); const helpers = require('../../helpers');
const addListeners = (ipcMain, { standardIPCReply }) => { const addListeners = (ipcMain, {standardIPCReply}) => {
ipcMain.on(Constants.IPC_Get_Config, (event, data) => { ipcMain.on(Constants.IPC_Get_Config, (event, data) => {
helpers helpers
.getConfig(data.Version, data.Provider, data.Remote, data.S3) .getConfig(data.Version, data.Provider, data.Remote, data.S3)
@@ -58,4 +58,4 @@ const addListeners = (ipcMain, { standardIPCReply }) => {
}); });
}; };
module.exports = { addListeners }; module.exports = {addListeners};

View File

@@ -1,7 +1,7 @@
const Constants = require('../../constants'); const Constants = require('../../constants');
const helpers = require('../../helpers'); const helpers = require('../../helpers');
const addListeners = (ipcMain, { standardIPCReply }) => { const addListeners = (ipcMain, {standardIPCReply}) => {
ipcMain.on(Constants.IPC_Check_Daemon_Version, (event, data) => { ipcMain.on(Constants.IPC_Check_Daemon_Version, (event, data) => {
helpers helpers
.checkDaemonVersion(data.Version, data.Provider) .checkDaemonVersion(data.Version, data.Provider)
@@ -37,10 +37,10 @@ const addListeners = (ipcMain, { standardIPCReply }) => {
}) })
.catch((e) => { .catch((e) => {
event.returnValue = { event.returnValue = {
data: { Error: e.toString(), Success: false, Valid: false }, data: {Error: e.toString(), Success: false, Valid: false},
}; };
}); });
}); });
}; };
module.exports = { addListeners }; module.exports = {addListeners};

View File

@@ -2,7 +2,7 @@ const Constants = require('../../constants');
const fs = require('fs'); const fs = require('fs');
const helpers = require('../../helpers'); const helpers = require('../../helpers');
const addListeners = (ipcMain, { standardIPCReply }) => { const addListeners = (ipcMain, {standardIPCReply}) => {
ipcMain.on(Constants.IPC_Check_Dependency_Installed, (event, data) => { ipcMain.on(Constants.IPC_Check_Dependency_Installed, (event, data) => {
try { try {
const exists = fs.lstatSync(data.File).isFile(); const exists = fs.lstatSync(data.File).isFile();
@@ -30,7 +30,7 @@ const addListeners = (ipcMain, { standardIPCReply }) => {
}; };
} catch (e) { } catch (e) {
event.returnValue = { event.returnValue = {
data: { Exists: false }, data: {Exists: false},
}; };
} }
}); });
@@ -110,4 +110,4 @@ const addListeners = (ipcMain, { standardIPCReply }) => {
}); });
}; };
module.exports = { addListeners }; module.exports = {addListeners};

View File

@@ -2,7 +2,7 @@ const Constants = require('../../constants');
const helpers = require('../../helpers'); const helpers = require('../../helpers');
const path = require('path'); const path = require('path');
const addListeners = (ipcMain, { standardIPCReply }) => { const addListeners = (ipcMain, {standardIPCReply}) => {
ipcMain.on(Constants.IPC_Download_File, (event, data) => { ipcMain.on(Constants.IPC_Download_File, (event, data) => {
const destination = path.join(helpers.getDataDirectory(), data.Filename); const destination = path.join(helpers.getDataDirectory(), data.Filename);
helpers.downloadFile( helpers.downloadFile(
@@ -30,4 +30,4 @@ const addListeners = (ipcMain, { standardIPCReply }) => {
}); });
}; };
module.exports = { addListeners }; module.exports = {addListeners};

View File

@@ -1,7 +1,7 @@
const Constants = require('../../constants'); const Constants = require('../../constants');
const fs = require('fs'); const fs = require('fs');
const addListeners = (ipcMain, { getMainWindow, dialog }) => { const addListeners = (ipcMain, {getMainWindow, dialog}) => {
ipcMain.on(Constants.IPC_Browse_Directory + '_sync', (event, data) => { ipcMain.on(Constants.IPC_Browse_Directory + '_sync', (event, data) => {
dialog.showOpenDialog( dialog.showOpenDialog(
getMainWindow(), getMainWindow(),
@@ -43,7 +43,8 @@ const addListeners = (ipcMain, { getMainWindow, dialog }) => {
if (fs.existsSync(data.FilePath)) { if (fs.existsSync(data.FilePath)) {
fs.unlinkSync(data.FilePath); fs.unlinkSync(data.FilePath);
} }
} catch (e) {} } catch (e) {
}
}); });
ipcMain.on(Constants.IPC_Select_File + '_sync', (event, data) => { ipcMain.on(Constants.IPC_Select_File + '_sync', (event, data) => {
@@ -67,20 +68,20 @@ const addListeners = (ipcMain, { getMainWindow, dialog }) => {
ipcMain.on(Constants.IPC_Read_File + '_sync', (event, data) => { ipcMain.on(Constants.IPC_Read_File + '_sync', (event, data) => {
try { try {
const contents = fs.readFileSync(data.Location, 'utf8').toString(); const contents = fs.readFileSync(data.Location, 'utf8').toString();
event.returnValue = { success: true, contents }; event.returnValue = {success: true, contents};
} catch (err) { } catch (err) {
event.returnValue = { success: false, error: err.toString() }; event.returnValue = {success: false, error: err.toString()};
} }
}); });
ipcMain.on(Constants.IPC_Save_File + '_sync', (event, data) => { ipcMain.on(Constants.IPC_Save_File + '_sync', (event, data) => {
try { try {
fs.writeFileSync(data.Location, data.Data, 'utf8'); fs.writeFileSync(data.Location, data.Data, 'utf8');
event.returnValue = { success: true }; event.returnValue = {success: true};
} catch (err) { } catch (err) {
event.returnValue = { success: false, error: err.toString() }; event.returnValue = {success: false, error: err.toString()};
} }
}); });
}; };
module.exports = { addListeners }; module.exports = {addListeners};

View File

@@ -62,9 +62,9 @@ const unmountAllDrives = () => {
mountedData = {}; mountedData = {};
}; };
const addListeners = (ipcMain, { setTrayImage, standardIPCReply }) => { const addListeners = (ipcMain, {setTrayImage, standardIPCReply}) => {
ipcMain.on(Constants.IPC_Check_Mount_Location + '_sync', (event, data) => { ipcMain.on(Constants.IPC_Check_Mount_Location + '_sync', (event, data) => {
let response = { Success: true, Error: '' }; let response = {Success: true, Error: ''};
try { try {
if (fs.existsSync(data.Location) && fs.statSync(data.Location).isDirectory()) { if (fs.existsSync(data.Location) && fs.statSync(data.Location).isDirectory()) {
@@ -109,7 +109,8 @@ const addListeners = (ipcMain, { setTrayImage, standardIPCReply }) => {
driveLetters[provider].push(drive); driveLetters[provider].push(drive);
} }
} }
} catch (e) {} } catch (e) {
}
} }
} }
@@ -276,7 +277,7 @@ const addListeners = (ipcMain, { setTrayImage, standardIPCReply }) => {
standardIPCReply( standardIPCReply(
event, event,
Constants.IPC_Remove_Mount_Reply, Constants.IPC_Remove_Mount_Reply,
{ DataDirectory: dataDirectory }, {DataDirectory: dataDirectory},
e e
); );
} }

View File

@@ -1,7 +1,7 @@
const Constants = require('../../constants'); const Constants = require('../../constants');
const helpers = require('../../helpers'); const helpers = require('../../helpers');
const addListeners = (ipcMain, { standardIPCReply }) => { const addListeners = (ipcMain, {standardIPCReply}) => {
ipcMain.on(Constants.IPC_Get_Directory_Items, (event, data) => { ipcMain.on(Constants.IPC_Get_Directory_Items, (event, data) => {
helpers helpers
.grabDirectoryItems(data.Path, data.Version, data.Provider, data.Remote, data.S3) .grabDirectoryItems(data.Path, data.Version, data.Provider, data.Remote, data.S3)
@@ -28,7 +28,8 @@ const addListeners = (ipcMain, { standardIPCReply }) => {
}); });
}); });
ipcMain.on(Constants.IPC_Get_Pinned_Files_Status, (event, data) => {}); ipcMain.on(Constants.IPC_Get_Pinned_Files_Status, (event, data) => {
});
ipcMain.on(Constants.IPC_Set_Pinned + '_sync', (event, data) => { ipcMain.on(Constants.IPC_Set_Pinned + '_sync', (event, data) => {
helpers helpers
@@ -42,4 +43,4 @@ const addListeners = (ipcMain, { standardIPCReply }) => {
}); });
}; };
module.exports = { addListeners }; module.exports = {addListeners};

View File

@@ -4,7 +4,7 @@ const helpers = require('../../helpers');
const os = require('os'); const os = require('os');
const path = require('path'); const path = require('path');
const addListeners = (ipcMain, { detectScript }) => { const addListeners = (ipcMain, {detectScript}) => {
ipcMain.on(Constants.IPC_Get_Platform, (event) => { ipcMain.on(Constants.IPC_Get_Platform, (event) => {
const sendResponse = (appPlatform, platform) => { const sendResponse = (appPlatform, platform) => {
event.sender.send(Constants.IPC_Get_Platform_Reply, { event.sender.send(Constants.IPC_Get_Platform_Reply, {

View File

@@ -5,7 +5,7 @@ const os = require('os');
const path = require('path'); const path = require('path');
const unzip = require('unzipper'); const unzip = require('unzipper');
const addListeners = (ipcMain, { getCleanupReleases, standardIPCReply }) => { const addListeners = (ipcMain, {getCleanupReleases, standardIPCReply}) => {
ipcMain.on(Constants.IPC_Check_Installed, (event, data) => { ipcMain.on(Constants.IPC_Check_Installed, (event, data) => {
const destination = path.join(helpers.getDataDirectory(), data.Version); const destination = path.join(helpers.getDataDirectory(), data.Version);
helpers helpers
@@ -14,7 +14,8 @@ const addListeners = (ipcMain, { getCleanupReleases, standardIPCReply }) => {
let exists = false; let exists = false;
try { try {
exists = fs.existsSync(destination) && fs.lstatSync(destination).isDirectory(); exists = fs.existsSync(destination) && fs.lstatSync(destination).isDirectory();
} catch (e) {} } catch (e) {
}
standardIPCReply(event, Constants.IPC_Check_Installed_Reply, { standardIPCReply(event, Constants.IPC_Check_Installed_Reply, {
Dependencies: dependencies, Dependencies: dependencies,
Exists: exists, Exists: exists,
@@ -49,11 +50,12 @@ const addListeners = (ipcMain, { getCleanupReleases, standardIPCReply }) => {
const stream = fs.createReadStream(data.Source); const stream = fs.createReadStream(data.Source);
stream stream
.pipe(unzip.Extract({ path: destination })) .pipe(unzip.Extract({path: destination}))
.on('error', (error) => { .on('error', (error) => {
try { try {
helpers.removeDirectoryRecursively(destination); helpers.removeDirectoryRecursively(destination);
} catch (e) {} } catch (e) {
}
stream.close(); stream.close();
standardIPCReply( standardIPCReply(
event, event,
@@ -104,4 +106,4 @@ const addListeners = (ipcMain, { getCleanupReleases, standardIPCReply }) => {
}); });
}; };
module.exports = { addListeners }; module.exports = {addListeners};

View File

@@ -1,7 +1,7 @@
const Constants = require('../../constants'); const Constants = require('../../constants');
const helpers = require('../../helpers'); const helpers = require('../../helpers');
const addListeners = (ipcMain, { standardIPCReply }) => { const addListeners = (ipcMain, {standardIPCReply}) => {
ipcMain.on(Constants.IPC_Export_Skylinks, (event, data) => { ipcMain.on(Constants.IPC_Export_Skylinks, (event, data) => {
helpers helpers
.exportSkylinks(data.Version, data.Paths) .exportSkylinks(data.Version, data.Paths)
@@ -57,4 +57,4 @@ const addListeners = (ipcMain, { standardIPCReply }) => {
}); });
}; };
module.exports = { addListeners }; module.exports = {addListeners};

View File

@@ -6,7 +6,7 @@ const path = require('path');
const getDirectories = (source) => { const getDirectories = (source) => {
try { try {
return fs return fs
.readdirSync(source, { withFileTypes: true }) .readdirSync(source, {withFileTypes: true})
.filter((dirent) => dirent.isDirectory()) .filter((dirent) => dirent.isDirectory())
.map((dirent) => dirent.name); .map((dirent) => dirent.name);
} catch { } catch {
@@ -77,4 +77,4 @@ const addListeners = (ipcMain) => {
}); });
}; };
module.exports = { addListeners }; module.exports = {addListeners};

View File

@@ -2,7 +2,7 @@ const Constants = require('../../constants');
const os = require('os'); const os = require('os');
const helpers = require('../../helpers'); const helpers = require('../../helpers');
const addListeners = (ipcMain, { closeApplication }) => { const addListeners = (ipcMain, {closeApplication}) => {
ipcMain.on(Constants.IPC_Reboot_System, () => { ipcMain.on(Constants.IPC_Reboot_System, () => {
if (os.platform() === 'win32') { if (os.platform() === 'win32') {
helpers.executeAsync('shutdown.exe', ['/r', '/t', '30']); helpers.executeAsync('shutdown.exe', ['/r', '/t', '30']);
@@ -11,4 +11,4 @@ const addListeners = (ipcMain, { closeApplication }) => {
}); });
}; };
module.exports = { addListeners }; module.exports = {addListeners};

View File

@@ -3,7 +3,7 @@ const fs = require('fs');
const helpers = require('../../helpers'); const helpers = require('../../helpers');
const os = require('os'); const os = require('os');
const addListeners = (ipcMain, { setIsInstalling, unmountAllDrives, standardIPCReply }) => { const addListeners = (ipcMain, {setIsInstalling, unmountAllDrives, standardIPCReply}) => {
ipcMain.on(Constants.IPC_Install_Upgrade, (event, data) => { ipcMain.on(Constants.IPC_Install_Upgrade, (event, data) => {
let allowSkipVerification = true; let allowSkipVerification = true;
@@ -19,7 +19,8 @@ const addListeners = (ipcMain, { setIsInstalling, unmountAllDrives, standardIPCR
if (tempPub) { if (tempPub) {
fs.unlinkSync(tempPub); fs.unlinkSync(tempPub);
} }
} catch (e) {} } catch (e) {
}
}; };
const errorHandler = (err) => { const errorHandler = (err) => {
@@ -117,4 +118,4 @@ const addListeners = (ipcMain, { setIsInstalling, unmountAllDrives, standardIPCR
}); });
}; };
module.exports = { addListeners }; module.exports = {addListeners};