mirror of https://github.com/docker/docs.git
Updated logic and removed pref
Signed-off-by: French Ben <me+git@frenchben.com>
This commit is contained in:
parent
dfdf9e326e
commit
d1a49abcf6
|
|
@ -101,20 +101,18 @@ var Setup = React.createClass({
|
||||||
<button className="btn btn-action" onClick={this.handleLinuxDockerInstall}>Install Docker</button>
|
<button className="btn btn-action" onClick={this.handleLinuxDockerInstall}>Install Docker</button>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
} else if (util.isNative()) {
|
||||||
|
deleteVmAndRetry = (
|
||||||
|
<button className="btn btn-action" onClick={this.handleUseVbox}>Use VirtualBox</button>
|
||||||
|
);
|
||||||
|
} else if (this.state.started) {
|
||||||
|
deleteVmAndRetry = (
|
||||||
|
<button className="btn btn-action" onClick={this.handleErrorRemoveRetry}>Delete VM & Retry Setup</button>
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
if (util.isNative()) {
|
deleteVmAndRetry = (
|
||||||
deleteVmAndRetry = (
|
<button className="btn btn-action" onClick={this.handleToolBox}>Get Toolbox</button>
|
||||||
<button className="btn btn-action" onClick={this.handleUseVbox}>Use VirtualBox</button>
|
);
|
||||||
);
|
|
||||||
} else if (this.state.started) {
|
|
||||||
deleteVmAndRetry = (
|
|
||||||
<button className="btn btn-action" onClick={this.handleErrorRemoveRetry}>Delete VM & Retry Setup</button>
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
deleteVmAndRetry = (
|
|
||||||
<button className="btn btn-action" onClick={this.handleToolBox}>Get Toolbox</button>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<div className="setup">
|
<div className="setup">
|
||||||
|
|
|
||||||
|
|
@ -38,13 +38,19 @@ module.exports = {
|
||||||
return process.platform === 'linux';
|
return process.platform === 'linux';
|
||||||
},
|
},
|
||||||
isNative: function () {
|
isNative: function () {
|
||||||
let native = JSON.parse(localStorage.getItem('settings.useNative'));
|
// let native = JSON.parse(localStorage.getItem('settings.useNative'));
|
||||||
|
let native = null;
|
||||||
if (native === null) {
|
if (native === null) {
|
||||||
try {
|
try {
|
||||||
let stats = fs.statSync('/var/run/docker.sock');
|
// Check if file exists
|
||||||
|
fs.statSync('/var/run/docker.sock');
|
||||||
native = true;
|
native = true;
|
||||||
} catch(e){
|
} catch (e) {
|
||||||
native = false;
|
if (this.isLinux()) {
|
||||||
|
native = true;
|
||||||
|
} else {
|
||||||
|
native = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return native;
|
return native;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue