Layout changes

This commit is contained in:
2019-10-06 13:59:51 -05:00
parent 7fb9226325
commit 82fad7b706
3 changed files with 24 additions and 22 deletions

View File

@@ -10,7 +10,7 @@
.MountItemsRemote { .MountItemsRemote {
padding: 0; padding: 0;
margin: 0; margin: 0;
height: 151px; height: 121px;
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
overflow-x: hidden; overflow-x: hidden;

View File

@@ -141,7 +141,6 @@ class MountItems extends IPCContainer {
}; };
handleMountUnMount = (provider, remote, mount, location) => { handleMountUnMount = (provider, remote, mount, location) => {
console.log(provider, remote, mount, location);
if (!location || (location.trim().length === 0)) { if (!location || (location.trim().length === 0)) {
this.props.notifyError('Mount location is not set'); this.props.notifyError('Mount location is not set');
} else { } else {
@@ -284,18 +283,17 @@ class MountItems extends IPCContainer {
let retryDisplay; let retryDisplay;
if (this.state.DisplayRetry) { if (this.state.DisplayRetry) {
let retryList = []; let retryList = [];
let retryListCount = 0; let retryCount = 0;
for (const provider in this.state.RetryItems) { for (const provider in this.state.RetryItems) {
if (this.state.RetryItems.hasOwnProperty(provider)) { if (this.state.RetryItems.hasOwnProperty(provider)) {
retryListCount++;
if (this.state.RetryItems[provider].RetryMessage) { if (this.state.RetryItems[provider].RetryMessage) {
retryList.push(<p key={'p' + retryListCount}>{this.state.RetryItems[provider].RetryMessage}</p>); retryList.push(<p key={'rl_' + retryList.length}>{this.state.RetryItems[provider].RetryMessage}</p>);
} }
retryList.push(<Button retryList.push(<Button clicked={()=>this.cancelRetryMount(provider, ()=> this.detectMounts())}
clicked={()=>this.cancelRetryMount(provider, ()=> this.detectMounts())} key={'rl_' + retryList.length}>Cancel {provider} Remount ({this.state.RetryItems[provider].RetrySeconds}s)</Button>);
key={'b' + retryListCount}>Cancel {provider} Remount ({this.state.RetryItems[provider].RetrySeconds}s)</Button>); if (retryCount++ < Object.keys(this.state.RetryItems).length) {
if (retryListCount < Object.keys(this.state.RetryItems).length) { retryList.push(<div style={{paddingTop: '8px'}}
retryList.push(<div style={{paddingTop: '8px'}} key={'d' + retryListCount}/>); key={'rl_' + retryList.length}/>);
} }
} }
} }
@@ -310,13 +308,14 @@ class MountItems extends IPCContainer {
) )
} }
let items = []; let headerItems = [];
if (this.props.remoteSupported) { if (this.props.remoteSupported) {
items.push(<AddRemoteMount key={'mi_' + items.length}/>); headerItems.push(<AddRemoteMount key={'hi_' + headerItems.length}/>);
items.push(<div key={'di_' + items.length} headerItems.push(<div key={'hi_' + headerItems.length}
style={{paddingTop: '4px'}} />) style={{paddingTop: '4px'}} />)
} }
let items = [];
for (const provider of Constants.PROVIDER_LIST) { for (const provider of Constants.PROVIDER_LIST) {
items.push(( items.push((
<MountItem allowConfig={this.props.allowConfig} <MountItem allowConfig={this.props.allowConfig}
@@ -324,10 +323,10 @@ class MountItems extends IPCContainer {
browseClicked={this.handleBrowseLocation} browseClicked={this.handleBrowseLocation}
changed={e => this.handleMountLocationChanged(provider, e.target.value)} changed={e => this.handleMountLocationChanged(provider, e.target.value)}
clicked={this.handleMountUnMount} clicked={this.handleMountUnMount}
key={'mi_' + items.length} key={'it_' + items.length}
provider={provider}/> provider={provider}/>
)); ));
items.push(<div key={'di_' + items.length} items.push(<div key={'it_' + items.length}
style={{paddingTop: '4px'}} />) style={{paddingTop: '4px'}} />)
} }
@@ -339,11 +338,11 @@ class MountItems extends IPCContainer {
browseClicked={this.handleBrowseLocation} browseClicked={this.handleBrowseLocation}
changed={e => this.handleMountLocationChanged(provider, e.target.value)} changed={e => this.handleMountLocationChanged(provider, e.target.value)}
clicked={this.handleMountUnMount} clicked={this.handleMountUnMount}
key={'mi_' + items.length} key={'it_' + items.length}
provider={provider} provider={provider}
remote/> remote/>
)); ));
items.push(<div key={'di_' + items.length} items.push(<div key={'it_' + items.length}
style={{paddingTop: '4px'}}/>) style={{paddingTop: '4px'}}/>)
} }
if (this.props.RemoteMounts.length > 0) { if (this.props.RemoteMounts.length > 0) {
@@ -354,9 +353,12 @@ class MountItems extends IPCContainer {
} }
return ( return (
<div className={this.props.remoteSupported ? 'MountItemsRemote' : 'MountItems'}> <div>
{retryDisplay} {retryDisplay}
{items} {headerItems}
<div className={this.props.remoteSupported ? 'MountItemsRemote' : 'MountItems'}>
{items}
</div>
</div>); </div>);
} }
} }

View File

@@ -78,7 +78,7 @@ p {
} }
.scrollable-content, ::-webkit-scrollbar { .scrollable-content, ::-webkit-scrollbar {
width: 10px; width: 8px;
} }
.scrollable-content, ::-webkit-scrollbar * { .scrollable-content, ::-webkit-scrollbar * {
@@ -86,5 +86,5 @@ p {
} }
.scrollable-content, ::-webkit-scrollbar-thumb { .scrollable-content, ::-webkit-scrollbar-thumb {
background: rgba(90, 90, 90, 0.6) !important; background: var(--control_background_hover) !important;
} }