Disable configure while mounting/unmounting
This commit is contained in:
@@ -19,14 +19,15 @@ export default connect(mapStateToProps)(props => {
|
|||||||
let configButton = null;
|
let configButton = null;
|
||||||
let secondRow = 6;
|
let secondRow = 6;
|
||||||
if (props.allowConfig) {
|
if (props.allowConfig) {
|
||||||
|
const pointer = {cursor: props.allowMount ? 'pointer' : 'no-drop'};
|
||||||
configButton = (
|
configButton = (
|
||||||
<RootElem colSpan={4}
|
<RootElem colSpan={4}
|
||||||
rowSpan={6}>
|
rowSpan={6}>
|
||||||
<img alt=''
|
<img alt=''
|
||||||
height={'16px'}
|
height={'16px'}
|
||||||
onClick={props.disabled ? (e)=>{e.preventDefault();} : props.configClicked}
|
onClick={props.allowMount ? props.configClicked : (e)=>{e.preventDefault();}}
|
||||||
src={configureImage}
|
src={configureImage}
|
||||||
style={{padding: 0, border: 0, margin: 0, cursor: 'pointer'}}
|
style={{padding: 0, border: 0, margin: 0, ...pointer}}
|
||||||
width={'16px'}/>
|
width={'16px'}/>
|
||||||
</RootElem>
|
</RootElem>
|
||||||
);
|
);
|
||||||
@@ -38,7 +39,7 @@ export default connect(mapStateToProps)(props => {
|
|||||||
inputColumnSpan = 20;
|
inputColumnSpan = 20;
|
||||||
inputControls = <DropDown changed={props.changed}
|
inputControls = <DropDown changed={props.changed}
|
||||||
colSpan={inputColumnSpan}
|
colSpan={inputColumnSpan}
|
||||||
disabled={!props.allowMount || props.mounted || props.disabled}
|
disabled={!props.allowMount || props.mounted}
|
||||||
items={props.items}
|
items={props.items}
|
||||||
row={secondRow}
|
row={secondRow}
|
||||||
rowSpan={7}
|
rowSpan={7}
|
||||||
@@ -53,7 +54,7 @@ export default connect(mapStateToProps)(props => {
|
|||||||
key={'i' + key++}
|
key={'i' + key++}
|
||||||
row={secondRow}
|
row={secondRow}
|
||||||
rowSpan={7}>
|
rowSpan={7}>
|
||||||
<input disabled={!props.allowMount || props.mounted || props.disabled}
|
<input disabled={!props.allowMount || props.mounted}
|
||||||
maxLength={4096}
|
maxLength={4096}
|
||||||
onChange={props.changed}
|
onChange={props.changed}
|
||||||
size={4096}
|
size={4096}
|
||||||
@@ -66,14 +67,14 @@ export default connect(mapStateToProps)(props => {
|
|||||||
<Button clicked={()=>props.browseClicked(props.title, props.location)}
|
<Button clicked={()=>props.browseClicked(props.title, props.location)}
|
||||||
col={inputColumnSpan - 7}
|
col={inputColumnSpan - 7}
|
||||||
colSpan={7}
|
colSpan={7}
|
||||||
disabled={props.mounted || props.disabled || !props.allowMount}
|
disabled={props.mounted || !props.allowMount}
|
||||||
key={'b' + key++}
|
key={'b' + key++}
|
||||||
row={secondRow}
|
row={secondRow}
|
||||||
rowSpan={7}>...</Button>
|
rowSpan={7}>...</Button>
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
const buttonDisplay = props.allowMount || props.disabled ?
|
const buttonDisplay = props.allowMount ?
|
||||||
(props.mounted ? 'Unmount' : 'Mount') :
|
(props.mounted ? 'Unmount' : 'Mount') :
|
||||||
<Loader color={'var(--heading_text_color)'}
|
<Loader color={'var(--heading_text_color)'}
|
||||||
height='19px'
|
height='19px'
|
||||||
@@ -84,7 +85,7 @@ export default connect(mapStateToProps)(props => {
|
|||||||
<Button clicked={()=>props.clicked(props.title, !props.mounted, props.location)}
|
<Button clicked={()=>props.clicked(props.title, !props.mounted, props.location)}
|
||||||
col={inputColumnSpan + 2}
|
col={inputColumnSpan + 2}
|
||||||
colSpan={21}
|
colSpan={21}
|
||||||
disabled={!props.allowMount || props.disabled}
|
disabled={!props.allowMount}
|
||||||
row={secondRow}
|
row={secondRow}
|
||||||
rowSpan={7}>
|
rowSpan={7}>
|
||||||
{buttonDisplay}
|
{buttonDisplay}
|
||||||
@@ -96,7 +97,6 @@ export default connect(mapStateToProps)(props => {
|
|||||||
row={secondRow}
|
row={secondRow}
|
||||||
rowSpan={7}>
|
rowSpan={7}>
|
||||||
<input checked={props.autoMount}
|
<input checked={props.autoMount}
|
||||||
disabled={props.disabled}
|
|
||||||
onChange={props.autoMountChanged}
|
onChange={props.autoMountChanged}
|
||||||
type='checkbox'/>Auto-mount
|
type='checkbox'/>Auto-mount
|
||||||
</RootElem>
|
</RootElem>
|
||||||
@@ -108,7 +108,6 @@ export default connect(mapStateToProps)(props => {
|
|||||||
row={secondRow}
|
row={secondRow}
|
||||||
rowSpan={7}>
|
rowSpan={7}>
|
||||||
<input checked={props.autoRestart}
|
<input checked={props.autoRestart}
|
||||||
disabled={props.disabled}
|
|
||||||
onChange={props.autoRestartChanged}
|
onChange={props.autoRestartChanged}
|
||||||
type='checkbox'/>Restart
|
type='checkbox'/>Restart
|
||||||
</RootElem>
|
</RootElem>
|
||||||
|
|||||||
Reference in New Issue
Block a user