#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

@@ -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}