[Fix VC runtime detection] [Remote mount changes]

This commit is contained in:
2019-10-07 16:18:03 -05:00
parent 52cd85ca6f
commit 522626e808
5 changed files with 101 additions and 62 deletions

View File

@@ -20,6 +20,7 @@ class Configuration extends IPCContainer {
ObjectLookup: {},
OriginalItemList: [],
OriginalObjectLookup: {},
IsRemoteMount: false,
ItemList: [],
Saving: false,
ShowAdvanced: false,
@@ -87,6 +88,7 @@ class Configuration extends IPCContainer {
.map(key => {
return {
advanced: template[key] ? template[key].advanced : false,
hide_remote: template[key] ? template[key].hide_remote : false,
label: key,
remote: template[key] ? template[key].remote : false,
value: (template[key] && (template[key].type === 'object')) ?
@@ -143,8 +145,20 @@ class Configuration extends IPCContainer {
const list2 = this.createItemList(obj.value, this.state.Template[obj.label].template);
objectLookup[obj.label] = list2.ItemList;
}
const isRemoteMount = this.props.remoteSupported &&
JSON.parse(objectLookup['RemoteMount'].find(s => s.label === 'IsRemoteMount').value);
if (isRemoteMount) {
for (const obj of list.ObjectList) {
if (obj.hide_remote) {
delete objectLookup[obj.label];
}
}
}
const objectLookupCopy = JSON.parse(JSON.stringify(objectLookup));
this.setState({
IsRemoteMount: isRemoteMount,
ItemList: list.ItemList,
ObjectLookup: objectLookup,
OriginalItemList: itemListCopy,
@@ -250,7 +264,7 @@ class Configuration extends IPCContainer {
const configurationItems = this.state.ItemList
.map((k, i) => {
return (
(!k.advanced || (this.state.ShowAdvanced && k.advanced)) ?
((!this.state.IsRemoteMount || !k.hide_remote) && (!k.advanced || (this.state.ShowAdvanced && k.advanced))) ?
<ConfigurationItem advanced={k.advanced}
changed={e=>this.handleItemChanged(e, i)}
grouping={'Settings'}
@@ -278,6 +292,7 @@ class Configuration extends IPCContainer {
items={this.state.Template[key].template[k.label].items}
key={i}
label={k.label}
readOnly={this.state.IsRemoteMount && ((k.label === 'RemoteHostNameOrIp') || (k.label === 'RemotePort'))}
template={this.state.Template[key].template[k.label]}
value={k.value}/> :
null)