#40: Support for remote Windows mounts - partial

This commit is contained in:
2019-10-01 12:25:39 -05:00
parent 888a84f5a7
commit 686774741f
4 changed files with 36 additions and 19 deletions

View File

@@ -102,6 +102,9 @@ class App extends IPCContainer {
const noConsoleSupported = this.props.LocationsLookup[selectedVersion] &&
this.props.LocationsLookup[selectedVersion].no_console_supported;
const remoteSupported = this.props.LocationsLookup[selectedVersion] &&
this.props.LocationsLookup[selectedVersion].supports_remote;
const showConfig = !missingDependencies &&
this.props.DisplayConfiguration &&
!this.props.RebootRequired &&
@@ -124,7 +127,7 @@ class App extends IPCContainer {
const infoDisplay = this.createModalConditionally(this.props.DisplayInfo, <InfoDetails/>, true);
const rebootDisplay = this.createModalConditionally(this.props.RebootRequired, <Reboot />);
const configDisplay = this.createModalConditionally(showConfig, <Configuration version={selectedVersion} />);
const configDisplay = this.createModalConditionally(showConfig, <Configuration version={selectedVersion} remoteSupported={remoteSupported} />);
const dependencyDisplay = this.createModalConditionally(showDependencies, <DependencyList/>);
const downloadDisplay = this.createModalConditionally(this.props.DownloadActive, <DownloadProgress/>);
const errorDisplay = this.createModalConditionally(this.props.DisplayError, <ErrorDetails/>, true);
@@ -138,7 +141,7 @@ class App extends IPCContainer {
let key = 0;
mainContent.push((
<div key={'rvd_' + key++}
style={{height: '32%'}}>
style={{'paddingBottom': '8px'}}>
<ReleaseVersionDisplay downloadDisabled={!downloadEnabled}
version={selectedVersion}/>
</div>
@@ -146,11 +149,10 @@ class App extends IPCContainer {
if (allowMount) {
mainContent.push((
<div key={'md_' + key++}>
<MountItems allowConfig={allowConfig}
allowSiaPrime={allowSiaPrime}
key={'md_' + key++}
noConsoleSupported={noConsoleSupported}/>
</div>
));
}
}

View File

@@ -107,7 +107,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(props => {
}
return (
<Grid>
<Grid noScroll>
<Text colSpan={columns=>columns / 3}
rowSpan={4}
text={'Release'}

View File

@@ -3,14 +3,6 @@ import './Grid.css';
import GridComponent from './GridComponent/GridComponent';
export default class extends Component {
constructor(props) {
super(props);
window.addEventListener("resize", this.updateSizeAsync);
this.checkSizeInterval = setInterval(()=> {
this.updateSize()
}, 2000);
}
checkSizeInterval;
state = {
@@ -58,6 +50,10 @@ export default class extends Component {
};
componentDidMount() {
window.addEventListener("resize", this.updateSizeAsync);
this.checkSizeInterval = setInterval(()=> {
this.updateSize()
}, 2000);
this.updateSizeAsync();
}
@@ -108,15 +104,18 @@ export default class extends Component {
.filter(i => i !== null);
}
const style = {
let style = {
style: {
gridTemplateColumns: '4px '.repeat(dimensions.columns).trim(),
gridTemplateRows: '4px '.repeat(dimensions.rows).trim(),
gridAutoColumns: '4px',
gridAutoRows: '4px'
gridAutoRows: '4px',
}
};
if (this.props.noScroll) {
style['style'].overflowX = 'visible';
style['style'].overflowY = 'visible';
}
return (
<div
ref='GridOwner'

View File

@@ -87,6 +87,7 @@ class Configuration extends IPCContainer {
return {
advanced: template[key] ? template[key].advanced : false,
label: key,
remote: template[key] ? template[key].remote : false,
value: config[key],
};
})
@@ -141,7 +142,6 @@ class Configuration extends IPCContainer {
objectLookup[obj.label] = list2.ItemList;
}
const objectLookupCopy = JSON.parse(JSON.stringify(objectLookup));
this.setState({
ItemList: list.ItemList,
ObjectLookup: objectLookup,
@@ -207,6 +207,22 @@ class Configuration extends IPCContainer {
});
};
showRemoteConfigItem = (item, itemList) => {
if (item.advanced &&
item.remote &&
this.props.remoteSupported &&
(item.label !== 'IsRemoteMount')) {
const isRemoteMount = JSON.parse(itemList.find(s=>s.label === 'IsRemoteMount').value);
const enableRemoteMount = JSON.parse(itemList.find(s=>s.label === 'EnableRemoteMount').value);
return (item.label === 'RemoteHostNameOrIp') ?
isRemoteMount :
(item.label === 'EnableRemoteMount') ?
!isRemoteMount :
enableRemoteMount;
}
return false;
};
render() {
let confirmSave = null;
if ((this.state.ChangedItems.length > 0) || this.state.ChangedObjectLookup) {
@@ -228,7 +244,7 @@ class Configuration extends IPCContainer {
const configurationItems = this.state.ItemList
.map((k, i) => {
return (
((this.state.ShowAdvanced && k.advanced) || !k.advanced) ?
(!k.advanced || (this.state.ShowAdvanced && k.advanced)) ?
<ConfigurationItem advanced={k.advanced}
changed={e=>this.handleItemChanged(e, i)}
grouping={'Settings'}
@@ -249,7 +265,7 @@ class Configuration extends IPCContainer {
{
this.state.ObjectLookup[key].map((k, i) => {
return (
((this.state.ShowAdvanced && k.advanced) || !k.advanced) ?
(!k.advanced || (this.state.ShowAdvanced && k.advanced && !k.remote) || this.showRemoteConfigItem(k, this.state.ObjectLookup[key])) ?
<ConfigurationItem advanced={k.advanced}
changed={e=>this.handleObjectItemChanged(e, key, i)}
grouping={key}