SiaPrime changes

This commit is contained in:
Scott E. Graves
2018-11-07 14:55:53 -06:00
parent ce55edfb3a
commit 9640a0805c
5 changed files with 22 additions and 8 deletions

View File

@@ -254,6 +254,13 @@ ipcMain.on(Constants.IPC_Detect_Mounts, (event, data) => {
.then((results) => {
let hsLocation = results.Hyperspace.Location;
let siaLocation = results.Sia.Location;
if (!results.SiaPrime) {
results.SiaPrime = {
Active: false,
Location: '',
PID: -1,
};
}
let siaPrimeLocation = results.SiaPrime.Location;
if (os.platform() === 'win32') {
hsLocation = hsLocation.toUpperCase();

View File

@@ -175,8 +175,8 @@ module.exports.executeMount = (directory, version, storageType, location, exitCa
args.push('-sp');
}
if (os.platform() === 'linux') {
args.push("-o");
args.push("big_writes");
args.push('-o');
args.push('big_writes');
}
if (os.platform() === 'win32') {
args.push('-hidden');

View File

@@ -643,6 +643,9 @@ class App extends Component {
const allowConfig = this.state.LocationsLookup[selectedVersion] &&
this.state.LocationsLookup[selectedVersion].config_support;
const allowSiaPrime = this.state.LocationsLookup[selectedVersion] &&
this.state.LocationsLookup[selectedVersion].siaprime_support;
const showDependencies = missingDependencies &&
!this.state.DownloadActive;
@@ -738,6 +741,7 @@ class App extends Component {
<div key={'md_' + key++}
style={{height: '66%'}}>
<MountItems allowConfig={allowConfig}
allowSiaPrime={allowSiaPrime}
autoMountChanged={this.handleAutoMountChanged}
autoMountProcessed={this.notifyAutoMountProcessed}
autoRestartChanged={this.handleAutoRestartChanged}

View File

@@ -18,7 +18,7 @@ export default CSSModules((props) => {
rowSpan={6}>
<img alt=''
height={'16px'}
onClick={props.configClicked}
onClick={props.disabled ? (e)=>{e.preventDefault();} : props.configClicked}
src={configureImage}
style={{padding: 0, border: 0, margin: 0, cursor: 'pointer'}}
width={'16px'}/>
@@ -32,7 +32,7 @@ export default CSSModules((props) => {
inputColumnSpan = 20;
inputControl = <DropDown changed={props.changed}
colSpan={inputColumnSpan}
disabled={!props.allowMount || props.mounted}
disabled={!props.allowMount || props.mounted || props.disabled}
items={props.items}
row={secondRow}
rowSpan={7}
@@ -44,14 +44,14 @@ export default CSSModules((props) => {
<RootElem colSpan={inputColumnSpan}
row={secondRow}
rowSpan={7}>
<input disabled={!props.allowMount || props.mounted}
<input disabled={!props.allowMount || props.mounted || props.disabled}
onChange={props.changed}
type={'text'}
value={props.location}/>
</RootElem>);
}
const buttonDisplay = props.allowMount ?
const buttonDisplay = props.allowMount || props.disabled ?
(props.mounted ? 'Unmount' : 'Mount') :
<Loader color={'var(--heading_text_color)'}
height='19px'
@@ -62,7 +62,7 @@ export default CSSModules((props) => {
<Button clicked={()=>props.clicked(props.title, !props.mounted, props.location, props.pid)}
col={inputColumnSpan + 2}
colSpan={20}
disabled={!props.allowMount}
disabled={!props.allowMount || props.disabled}
row={secondRow}
rowSpan={7}>
{buttonDisplay}
@@ -74,6 +74,7 @@ export default CSSModules((props) => {
row={secondRow}
rowSpan={7}>
<input checked={props.autoMount}
disabled={props.disabled}
onChange={props.autoMountChanged}
type='checkbox'/>Auto-mount
</RootElem>
@@ -85,6 +86,7 @@ export default CSSModules((props) => {
row={secondRow}
rowSpan={7}>
<input checked={props.autoRestart}
disabled={props.disabled}
onChange={props.autoRestartChanged}
type='checkbox'/>Restart
</RootElem>

View File

@@ -198,7 +198,7 @@ class MountItems extends Component {
(this.props.sia.MountLocation.length > 0)) {
this.handleMountUnMount('Sia', true, this.props.sia.MountLocation);
}
if (this.props.siaprime.AutoMount &&
if (this.props.allowSiaPrime && this.props.siaprime.AutoMount &&
!this.state.SiaPrime.Mounted &&
(this.props.siaprime.MountLocation.length > 0)) {
this.handleMountUnMount('SiaPrime', true, this.props.siaprime.MountLocation);
@@ -250,6 +250,7 @@ class MountItems extends Component {
changed={(e) => this.handleMountLocationChanged('SiaPrime', e.target.value)}
clicked={this.handleMountUnMount}
configClicked={()=>this.props.configClicked('SiaPrime')}
disabled={!this.props.allowSiaPrime}
items={this.state.SiaPrime.DriveLetters}
location={this.props.siaprime.MountLocation}
mounted={this.state.SiaPrime.Mounted}