#48: Support pinning files to cache [partial]

This commit is contained in:
2020-12-11 21:44:05 -06:00
parent 775b852f91
commit 0ddddec220
2 changed files with 64 additions and 56 deletions

View File

@@ -274,12 +274,17 @@ class Configuration extends IPCContainer {
<Modal>
<Box dxStyle={{width: '40vw', padding: 'var(--default_spacing)'}}>
<h1 style={{width: '100%', textAlign: 'center'}}>Save Changes?</h1>
<table width='100%'><tbody>
<table width='100%'>
<tbody>
<tr>
<td align='center' width='50%'><Button clicked={this.saveAndClose} disabled={this.state.Saving}>Yes</Button></td>
<td align='center' width='50%'><Button clicked={this.props.hideConfiguration} disabled={this.state.Saving}>No</Button></td>
<td align='center' width='50%'><Button clicked={this.saveAndClose}
disabled={this.state.Saving}>Yes</Button>
</td>
<td align='center' width='50%'><Button clicked={this.props.hideConfiguration}
disabled={this.state.Saving}>No</Button></td>
</tr>
</tbody></table>
</tbody>
</table>
</Box>
</Modal>
);
@@ -355,14 +360,16 @@ class Configuration extends IPCContainer {
<h1 style={{width: '100%', textAlign: 'center'}}>{(
this.props.DisplayRemoteConfiguration ?
this.props.DisplayConfiguration.substr(6) :
this.props.DisplayConfiguration) + ' Configuration '}<a href={'#'}
className={'ConfigurationLink'}
onClick={() => {
this.props.displayPinnedManager(true);
return false;
}}><u>Pinned Files</u></a>
this.props.DisplayConfiguration) + ' Configuration '}
</h1>
<div style={{overflowY: 'auto', height: '90%'}}>
{this.props.MState.Mounted ? <Button
buttonStyles={{width: 'auto', height: 'auto', marginLeft: 'auto', marginRight: '4px'}}
clicked={() => {
this.props.displayPinnedManager(true);
return false;
}}>&nbsp;Pinned File Manager...&nbsp;</Button> : null}
<div style={{marginBottom: '4px'}}/>
{objectItems}
{(configurationItems.length > 0) ? <h2>Settings</h2> : null}
{configurationItems}
@@ -378,6 +385,7 @@ const mapStateToProps = state => {
DisplayConfiguration: state.mounts.DisplayConfiguration,
DisplayRemoteConfiguration: state.mounts.DisplayRemoteConfiguration,
DisplayS3Configuration: state.mounts.DisplayS3Configuration,
MState: state.mounts.MountState[state.mounts.DisplayConfiguration],
Platform: state.common.Platform,
}
};

View File

@@ -25,7 +25,7 @@ const mapDispatchToProps = dispatch => {
return {
displayPinnedManager: display => dispatch(displayPinnedManager(display)),
notifyApplicationBusy: busy => dispatch(notifyApplicationBusy(busy, true)),
notifyError: msg => dispatch(notifyError(msg)),
notifyError: (msg, cb) => dispatch(notifyError(msg, false, cb)),
notifyInfo: (title, msg) => dispatch(notifyInfo(title, msg)),
}
};
@@ -63,7 +63,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(class extends IPCCon
.map(i => {
return {
...i,
name: i.path === '..' ? i.path : '\'' + i.path.substr(i.path.lastIndexOf('/') + 1) + '\'',
name: i.path === '..' ? i.path : i.path.substr(i.path.lastIndexOf('/') + 1),
meta: {
...i.meta,
pinned: i.meta.pinned === '1',
@@ -74,7 +74,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(class extends IPCCon
items,
});
} else {
this.props.notifyError(data.Error, false, () => {
this.props.notifyError(data.Error, () => {
this.props.displayPinnedManager(false);
});
}
@@ -159,7 +159,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(class extends IPCCon
style={{cursor: 'pointer'}}>X</a>
</div>
<h1 style={{width: '100%', textAlign: 'center'}}>{'Pinned File Manager'}</h1>
<h2 className={'PinnedManagerActiveDirectory'}>{this.state.active_directory}</h2>
<div className={'PinnedManagerActiveDirectory'}><b>{this.state.active_directory}</b></div>
<div className={'PinnedManagerItems'}>
{
this.state.items.map((i, k) => {